Previous 15994 Revisions Next

r2019 Wednesday 19th March, 2008 at 10:46:47 UTC by Nathan Woods
Updated to MAME 0.123u6 core
[docs]messnew.txt
[src/emu]clifront.c cpuexec.c cpuint.c crsshair.c devintrf.c devintrf.h drawgfx.c inptport.c mconfig.h render.c sound.c sound.h state.c timer.c timer.h video.c video.h watchdog.c
[src/emu/cpu/alph8201]8201dasm.c alph8201.c
[src/emu/cpu/e132xs]e132xs.c e132xs.h
[src/emu/cpu/i8x41]i8x41.c
[src/emu/cpu/lh5801]lh5801.h
[src/emu/cpu/m68000]m68kmame.c
[src/emu/cpu/sh4]sh4dasm.c
[src/emu/debug]debugcpu.c
[src/emu/machine]z80dma.c
[src/emu/sound]aica.c msm5232.c msm5232.h
[src/emu/video]mc6845.c v9938.c v9938.h
[src/mame]mame.mak mamedriv.c
[src/mame/audio]exidy440.c irem.c mcr.c mw8080bw.c
[src/mame/drivers]1945kiii.c 40love.c 8080bw.c 88games.c airbustr.c armedf.c astrocde.c atarifb.c backfire.c balsente.c batman.c battlane.c battlera.c battlnts.c bbusters.c beathead.c beezer.c bfm_sc2.c bigevglf.c bionicc.c bladestl.c buggychl.c cave.c centiped.c champbas.c dcheese.c ddragon.c equites.c exctsccr.c exidy440.c flstory.c funworld.c jongkyo.c ladyfrog.c laserbas.c lethalj.c lsasquad.c m107.c m52.c m57.c magicfly.c megatech.c merit.c meritm.c mpu4drvr.c msisaac.c mw8080bw.c mystwarr.c naomi.c ninjakd2.c nmk16.c nycaptor.c offtwall.c pitnrun.c relief.c sangho.c segae.c seta.c shougi.c shuuz.c sidearms.c snowbros.c spbactn.c spdodgeb.c sshangha.c suna16.c system1.c tank8.c tecmosys.c terracre.c thunderj.c timeplt.c vertigo.c vicdual.c wilytowr.c
[src/mame/includes]astrocde.h cave.h equites.h* exidy440.h mw8080bw.h
[src/mame/layout]gorf.lay*
[src/mame/machine]ajax.c amiga.c atarigen.c vertigo.c
[src/mame/video]arcadecl.c astrocde.c atarig42.c atarigt.c atarigx2.c atarimo.c atarimo.h atarisy1.c atarisy2.c badlands.c batman.c blstroid.c btoads.c cave.c champbas.c cyberbal.c eprom.c equites.c exctsccr.c funworld.c gaiden.c gauntlet.c klax.c leland.c ninjakd2.c offtwall.c playch10.c rampart.c relief.c shuuz.c skullxbo.c spbactn.c thunderj.c toobin.c vindictr.c xybots.c
[src/mess]mess.mak
[src/mess/drivers]msx.c
[src/mess/machine]68901mfp.c geneve.c ins8154.c ti99_4x.c
[src/mess/video]dl1416.c
[src/osd/windows]drawd3d.c drawdd.c winfile.c winwork.c

src/mame/audio/exidy440.c
r2018r2019
99
1010#include "driver.h"
1111#include "streams.h"
12#include "deprecat.h"
1312#include "exidy440.h"
1413
1514
r2018r2019
7372
7473
7574/* globals */
76UINT8 *exidy440_sound_command;
77UINT8  exidy440_sound_command_ack;
75UINT8 exidy440_sound_command;
76UINT8 exidy440_sound_command_ack;
7877
7978/* local allocated storage */
8079static UINT8 *sound_banks;
r2018r2019
136135   int i, length;
137136
138137   /* reset the system */
139   *exidy440_sound_command = 0;
138   exidy440_sound_command = 0;
140139   exidy440_sound_command_ack = 1;
140   state_save_register_global(exidy440_sound_command);
141141   state_save_register_global(exidy440_sound_command_ack);
142142
143143   /* reset the 6844 */
r2018r2019
339339static READ8_HANDLER( sound_command_r )
340340{
341341   /* clear the FIRQ that got us here and acknowledge the read to the main CPU */
342   cpunum_set_input_line(Machine, 1, 1, CLEAR_LINE);
342   cpunum_set_input_line(machine, 1, 1, CLEAR_LINE);
343343   exidy440_sound_command_ack = 1;
344344
345   return *exidy440_sound_command;
345   return exidy440_sound_command;
346346}
347347
348348
r2018r2019
375375
376376static WRITE8_HANDLER( sound_interrupt_clear_w )
377377{
378   cpunum_set_input_line(Machine, 1, 0, CLEAR_LINE);
378   cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
379379}
380380
381381
src/mame/audio/mcr.c
r2018r2019
815815   MDRV_IMPORT_FROM(sounds_good)
816816
817817   MDRV_SOUND_REPLACE("tcs", DAC, 0)
818   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
818   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
819819
820820   MDRV_SOUND_REPLACE("sg", DAC, 0)
821   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
821   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
822822MACHINE_DRIVER_END
823823
824824
src/mame/audio/irem.c
r2018r2019
274274
275275   MDRV_SOUND_ADD(AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
276276   MDRV_SOUND_CONFIG(irem_ay8910_interface_1)
277   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
277   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
278278
279279   MDRV_SOUND_ADD(AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
280280   MDRV_SOUND_CONFIG(irem_ay8910_interface_2)
281   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
281   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
282282
283283   MDRV_SOUND_ADD(MSM5205, XTAL_384kHz) /* verified on pcb */
284284   MDRV_SOUND_CONFIG(irem_msm5205_interface_1)
285   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
285   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
286286
287287   MDRV_SOUND_ADD(MSM5205, XTAL_384kHz) /* verified on pcb */
288288   MDRV_SOUND_CONFIG(irem_msm5205_interface_2)
289   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
289   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
290290MACHINE_DRIVER_END
291291
292292
src/mame/audio/mw8080bw.c
r2018r2019
10351035   MDRV_SPEAKER_STANDARD_MONO("mono")
10361036   MDRV_SOUND_ADD(DISCRETE, 0)
10371037   MDRV_SOUND_CONFIG_DISCRETE(checkmat)
1038   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1038   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.4)
10391039MACHINE_DRIVER_END
10401040
10411041
r2018r2019
26932693
26942694   MDRV_SOUND_ADD(DISCRETE, 0)
26952695   MDRV_SOUND_CONFIG_DISCRETE(spcenctr)
2696   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1)
2696   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45)
26972697MACHINE_DRIVER_END
26982698
26992699
r2018r2019
40054005
40064006   MDRV_SOUND_ADD(DISCRETE, 0)
40074007   MDRV_SOUND_CONFIG_DISCRETE(invad2ct)
4008   MDRV_SOUND_ROUTE(0, "#1", 1.0)
4009   MDRV_SOUND_ROUTE(1, "#2", 1.0)
4008   MDRV_SOUND_ROUTE(0, "#1", 0.5)
4009   MDRV_SOUND_ROUTE(1, "#2", 0.5)
40104010
40114011   MDRV_SOUND_ADD(SN76477, 0)
40124012   MDRV_SOUND_CONFIG(invad2ct_p1_sn76477_interface)
4013   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "#1", 0.6)
4013   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "#1", 0.3)
40144014
40154015   MDRV_SOUND_ADD(SN76477, 0)
40164016   MDRV_SOUND_CONFIG(invad2ct_p2_sn76477_interface)
4017   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "#2", 0.6)
4017   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "#2", 0.3)
40184018MACHINE_DRIVER_END
40194019
40204020
src/mame/machine/amiga.c
r2018r2019
386386   cia_clock_tod(1);
387387
388388   /* render up to this scanline */
389   if (scanline < video_screen_get_visible_area(machine->primary_screen)->min_y)
389   if (!video_screen_update_partial(machine->primary_screen, scanline))
390390      amiga_render_scanline(machine, NULL, scanline);
391   else
392      video_screen_update_partial(machine->primary_screen, scanline);
393391
394392   /* force a sound update */
395393   amiga_audio_update();
src/mame/machine/vertigo.c
r2018r2019
1111#include "machine/74148.h"
1212#include "machine/pit8253.h"
1313
14
15
1416/*************************************
1517 *
1618 *  Prototypes
r2018r2019
2224static void update_irq(void);
2325
2426
27
2528/*************************************
2629 *
2730 *  Statics
r2018r2019
6063   }
6164};
6265
66
6367static const struct TTL74148_interface irq_encoder =
6468{
6569   update_irq
6670};
6771
6872
73
6974/*************************************
7075 *
7176 *  IRQ handling. The priority encoder
r2018r2019
8590      cpunum_set_input_line(Machine, 0, irq_state ^ 7, ASSERT_LINE);
8691}
8792
93
8894static void update_irq_encoder(int line, int state)
8995{
9096   TTL74148_input_line_w(0, line, !state);
9197   TTL74148_update(0);
9298}
9399
100
94101static void v_irq4_w(int level)
95102{
96103   update_irq_encoder(INPUT_LINE_IRQ4, level);
r2018r2019
98105   irq4_time = timer_get_time();
99106}
100107
108
101109static void v_irq3_w(int level)
102110{
103111   if (level)
r2018r2019
107115}
108116
109117
118
110119/*************************************
111120 *
112121 *  ADC and coin handlers
r2018r2019
124133   return 0;
125134}
126135
136
127137READ16_HANDLER( vertigo_io_adc )
128138{
129139   update_irq_encoder(INPUT_LINE_IRQ2, CLEAR_LINE);
130140   return adc_result;
131141}
132142
143
133144READ16_HANDLER( vertigo_coin_r )
134145{
135146   update_irq_encoder(INPUT_LINE_IRQ6, CLEAR_LINE);
136147   return (readinputportbytag("COIN"));
137148}
138149
150
139151INTERRUPT_GEN( vertigo_interrupt )
140152{
141153   /* Coin inputs cause IRQ6 */
r2018r2019
144156}
145157
146158
159
147160/*************************************
148161 *
149162 *  Sound board interface
r2018r2019
159172      cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
160173}
161174
175
162176static TIMER_CALLBACK( sound_command_w )
163177{
164   *exidy440_sound_command = param;
178   exidy440_sound_command = param;
165179   exidy440_sound_command_ack = 0;
166180   cpunum_set_input_line(machine, 1, INPUT_LINE_IRQ1, ASSERT_LINE);
167181
r2018r2019
172186   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
173187}
174188
189
175190WRITE16_HANDLER( vertigo_audio_w )
176191{
177192   if (ACCESSING_LSB)
178193      timer_call_after_resynch(NULL, data & 0xff, sound_command_w);
179194}
180195
196
181197READ16_HANDLER( vertigo_sio_r )
182198{
183199   if (exidy440_sound_command_ack)
r2018r2019
186202      return 0xfd;
187203}
188204
205
206
189207/*************************************
190208 *
191209 *  Machine initialization
r2018r2019
216234}
217235
218236
237
219238/*************************************
220239 *
221240 *  Motor controller interface
r2018r2019
226245{
227246   /* Motor controller interface. Not emulated. */
228247}
229
src/mame/machine/atarigen.c
r2018r2019
970970      emu_timer *timer = get_scanline_timer_for_screen(screen);
971971      timer_adjust_oneshot(timer, video_screen_get_time_until_pos(screen, 0, 0), 0);
972972   }
973
974   /* implicitly allocate a scanline interrupt timer */
975   get_scanline_interrupt_timer_for_screen(screen);
976
973977}
974978
975979
src/mame/machine/ajax.c
r2018r2019
201201
202202MACHINE_RESET( ajax )
203203{
204   firq_enable = 1;
204   ajax_bankswitch_w(machine, 0, 0);
205   ajax_bankswitch_2_w(machine, 0, 0);
205206}
206207
207208INTERRUPT_GEN( ajax_interrupt )
src/mame/mamedriv.c
r2018r2019
32743274   DRIVER( spatter )   /* 834-5583 (c) 1984 (S1) */
32753275   DRIVER( ssanchan )   /* 834-5583 (c) 1984 (S1) */
32763276   DRIVER( pitfall2 )   /* 834-5627 [1985?] reprogrammed, (c) 1984 Activision (S1) */
3277   DRIVER( pitfalla )   /* 834-5627 [1985?] reprogrammed, (c) 1984 Activision (S1) */
32773278   DRIVER( pitfallu )   /* 834-5627 [1985?] reprogrammed, (c) 1984 Activision (S1) */
32783279   DRIVER( seganinj )   /* 834-5677 (c) 1985 (S1) */
32793280   DRIVER( seganinu )   /* 834-5677 (c) 1985 (S1) */
r2018r2019
59115912   DRIVER( tdragn2a )   /* UPL-93091 (c) 1993 NMK */
59125913   DRIVER( bigbang )   /* UPL-93091 (c) 1993 NMK */
59135914   DRIVER( tdragon )   /* (c) 1991 NMK / Tecmo */
5915   DRIVER( tdragon1 )   /* (c) 1991 NMK / Tecmo */
59145916   DRIVER( hachamf )   /* (c) 1991 NMK */
59155917   DRIVER( macross )   /* (c) 1992 Banpresto */
59165918   DRIVER( riot )      /* (c) 1992 NMK */
r2018r2019
78187820   DRIVER( pool10 )   /* (c) 1996 C.M.C. */
78197821   DRIVER( pool10b )   /* (c) 1996 C.M.C. */
78207822   DRIVER( tortufam )   /* (c) 1997 C.M.C. */
7823   DRIVER( potgame )   /* (c) 1996 C.M.C. */
78217824   DRIVER( royalcrd )   /* (c) 1991 TAB-Austria */
78227825   DRIVER( royalcdb )   /* (c) 1991 TAB-Austria */
78237826   DRIVER( royalcdc )   /* (c) 1991 Evona Electronic */
src/mame/includes/mw8080bw.h
r2018r2019
6767
6868#define BLUESHRK_SPEAR_PORT_TAG         ("SPEAR")
6969
70#define INVADERS_CONTROL_PORT_P1 \
71   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG) \
72   INVADERS_CONTROL_PORT_PLAYER(1)
7073
74#define INVADERS_CONTROL_PORT_P2 \
75   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG) \
76   INVADERS_CONTROL_PORT_PLAYER(2)
77
78#define INVADERS_CONTROL_PORT_PLAYER(player) \
79   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(player) \
80   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(player) \
81   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(player) \
82   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
83
84#define INVADERS_CAB_TYPE_PORT \
85   PORT_START_TAG(INVADERS_CAB_TYPE_PORT_TAG) \
86   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) \
87   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) ) \
88   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
89
90
7191/*----------- defined in machine/mw8080bw.c -----------*/
7292
7393MACHINE_START( mw8080bw );
src/mame/includes/equites.h
r0r2019
1extern UINT16 *equites_bg_videoram;
2
3extern READ16_HANDLER(equites_fg_videoram_r);
4extern WRITE16_HANDLER(equites_fg_videoram_w);
5extern WRITE16_HANDLER(equites_bg_videoram_w);
6extern WRITE16_HANDLER(equites_scrollreg_w);
7extern WRITE16_HANDLER(equites_bgcolor_w);
8extern WRITE16_HANDLER(splndrbt_selchar0_w);
9extern WRITE16_HANDLER(splndrbt_selchar1_w);
10extern WRITE16_HANDLER(splndrbt_bgcolor_w);
11extern WRITE16_HANDLER(equites_flip0_w);
12extern WRITE16_HANDLER(equites_flip1_w);
13extern WRITE16_HANDLER(splndrbt_flip0_w);
14extern WRITE16_HANDLER(splndrbt_flip1_w);
15extern WRITE16_HANDLER(splndrbt_bg_scrollx_w);
16extern WRITE16_HANDLER(splndrbt_bg_scrolly_w);
17extern PALETTE_INIT( equites );
18extern VIDEO_START( equites );
19extern VIDEO_UPDATE( equites );
20extern PALETTE_INIT( splndrbt );
21extern VIDEO_START( splndrbt );
22extern VIDEO_UPDATE( splndrbt );
src/mame/includes/astrocde.h
r2018r2019
66
77#include "sound/custom.h"
88
9#define ASTROCADE_CLOCK      (XTAL_14_31818MHz/2)
9#define ASTROCADE_CLOCK      (14318180/2)
1010
1111#define AC_SOUND_PRESENT   (0x01)
1212#define AC_LIGHTPEN_INTS   (0x02)
src/mame/includes/exidy440.h
r2018r2019
1717
1818/*----------- defined in audio/exidy440.c -----------*/
1919
20extern UINT8 *exidy440_sound_command;
21extern UINT8  exidy440_sound_command_ack;
20extern UINT8 exidy440_sound_command;
21extern UINT8 exidy440_sound_command_ack;
2222
2323MACHINE_DRIVER_EXTERN( exidy440_audio );
2424
src/mame/includes/cave.h
r2018r2019
2727WRITE16_HANDLER( cave_vram_2_8x8_w );
2828WRITE16_HANDLER( cave_vram_3_8x8_w );
2929
30PALETTE_INIT( cave );
3031PALETTE_INIT( ddonpach );
3132PALETTE_INIT( dfeveron );
3233PALETTE_INIT( mazinger );
src/mame/mame.mak
r2018r2019
438438$(MAMEOBJ)/alpha.a: \
439439   $(DRIVERS)/alpha68k.o $(VIDEO)/alpha68k.o \
440440   $(DRIVERS)/champbas.o $(VIDEO)/champbas.o \
441   $(DRIVERS)/equites.o $(MACHINE)/equites.o $(VIDEO)/equites.o \
442   $(DRIVERS)/exctsccr.o $(MACHINE)/exctsccr.o $(VIDEO)/exctsccr.o \
441   $(DRIVERS)/equites.o $(VIDEO)/equites.o \
442   $(DRIVERS)/exctsccr.o $(VIDEO)/exctsccr.o \
443443   $(DRIVERS)/meijinsn.o \
444444   $(DRIVERS)/shougi.o \
445   $(DRIVERS)/talbot.o \
446445
447446$(MAMEOBJ)/amiga.a: \
448447   $(DRIVERS)/alg.o \
r2018r2019
16421641$(DRIVERS)/ampoker2.o:   $(LAYOUT)/ampoker2.lh \
16431642                  $(LAYOUT)/sigmapkr.lh \
16441643
1645$(DRIVERS)/astrocde.o:   $(LAYOUT)/tenpindx.lh
1644$(DRIVERS)/astrocde.o:   $(LAYOUT)/gorf.lh \
1645                  $(LAYOUT)/tenpindx.lh
16461646
16471647$(DRIVERS)/atarifb.o:   $(LAYOUT)/atarifb.lh \
16481648                  $(LAYOUT)/atarifb4.lh \
src/mame/video/eprom.c
r2018r2019
5656
5757VIDEO_START( eprom )
5858{
59   static const struct atarimo_desc modesc =
59   static const atarimo_desc modesc =
6060   {
6161      0,               /* index to which gfx system */
6262      1,               /* number of motion object banks */
r2018r2019
107107
108108VIDEO_START( guts )
109109{
110   static const struct atarimo_desc modesc =
110   static const atarimo_desc modesc =
111111   {
112112      0,               /* index to which gfx system */
113113      1,               /* number of motion object banks */
r2018r2019
187187
188188VIDEO_UPDATE( eprom )
189189{
190   struct atarimo_rect_list rectlist;
190   atarimo_rect_list rectlist;
191191   bitmap_t *mobitmap;
192192   int x, y, r;
193193
r2018r2019
195195   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0);
196196
197197   /* draw and merge the MO */
198   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
198   mobitmap = atarimo_render(0, cliprect, &rectlist);
199199   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
200200      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
201201      {
r2018r2019
333333
334334VIDEO_UPDATE( guts )
335335{
336   struct atarimo_rect_list rectlist;
336   atarimo_rect_list rectlist;
337337   bitmap_t *mobitmap;
338338   int x, y, r;
339339
r2018r2019
341341   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0);
342342
343343   /* draw and merge the MO */
344   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
344   mobitmap = atarimo_render(0, cliprect, &rectlist);
345345   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
346346      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
347347      {
src/mame/video/rampart.c
r2018r2019
2828
2929VIDEO_START( rampart )
3030{
31   static const struct atarimo_desc modesc =
31   static const atarimo_desc modesc =
3232   {
3333      0,               /* index to which gfx system */
3434      1,               /* number of motion object banks */
r2018r2019
8282
8383VIDEO_UPDATE( rampart )
8484{
85   struct atarimo_rect_list rectlist;
85   atarimo_rect_list rectlist;
8686   bitmap_t *mobitmap;
8787   int x, y, r;
8888
r2018r2019
9090   rampart_bitmap_render(screen->machine, bitmap, cliprect);
9191
9292   /* draw and merge the MO */
93   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
93   mobitmap = atarimo_render(0, cliprect, &rectlist);
9494   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
9595      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
9696      {
src/mame/video/gaiden.c
r2018r2019
464464
465465                  pdrawgfx(bitmap_sp, gfx,
466466                     number + layout[row][col],
467                     color * 16,
467                     color,
468468                     flipx, flipy,
469469                     sx, sy,
470                     cliprect, TRANSPARENCY_PEN_RAW, 0,
470                     cliprect, TRANSPARENCY_PEN, 0,
471471                     priority_mask);
472472               }
473473            }
r2018r2019
485485
486486                  pdrawgfx(bitmap, gfx,
487487                     number + layout[row][col],
488                     color * 16,
488                     color,
489489                     flipx, flipy,
490490                     sx, sy,
491                     cliprect, TRANSPARENCY_PEN_RAW, 0,
491                     cliprect, TRANSPARENCY_PEN, 0,
492492                     priority_mask);
493493               }
494494            }
src/mame/video/shuuz.c
r2018r2019
3535
3636VIDEO_START( shuuz )
3737{
38   static const struct atarimo_desc modesc =
38   static const atarimo_desc modesc =
3939   {
4040      1,               /* index to which gfx system */
4141      1,               /* number of motion object banks */
r2018r2019
8989
9090VIDEO_UPDATE( shuuz )
9191{
92   struct atarimo_rect_list rectlist;
92   atarimo_rect_list rectlist;
9393   bitmap_t *mobitmap;
9494   int x, y, r;
9595
r2018r2019
9797   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0);
9898
9999   /* draw and merge the MO */
100   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
100   mobitmap = atarimo_render(0, cliprect, &rectlist);
101101   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
102102      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
103103      {
src/mame/video/gauntlet.c
r2018r2019
6565
6666VIDEO_START( gauntlet )
6767{
68   static const struct atarimo_desc modesc =
68   static const atarimo_desc modesc =
6969   {
7070      0,               /* index to which gfx system */
7171      1,               /* number of motion object banks */
r2018r2019
189189
190190VIDEO_UPDATE( gauntlet )
191191{
192   struct atarimo_rect_list rectlist;
192   atarimo_rect_list rectlist;
193193   bitmap_t *mobitmap;
194194   int x, y, r;
195195
r2018r2019
197197   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0);
198198
199199   /* draw and merge the MO */
200   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
200   mobitmap = atarimo_render(0, cliprect, &rectlist);
201201   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
202202      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
203203      {
src/mame/video/spbactn.c
r2018r2019
66extern UINT16 *spbactn_bgvideoram, *spbactn_fgvideoram, *spbactn_spvideoram;
77static bitmap_t *tile_bitmap_bg, *tile_bitmap_fg;
88
9/* mix & blend the paletted 16-bit tile and sprite bitmaps into an RGB 32-bit bitmap */
109static void blendbitmaps(running_machine *machine,
1110      bitmap_t *dest,bitmap_t *src1,bitmap_t *src2,
12      int sx,int sy,const rectangle *clip)
11      const rectangle *cliprect)
1312{
14   int ox;
15   int oy;
16   int ex;
17   int ey;
13   int y,x;
14   const pen_t *paldata = machine->pens;
1815
19   /* check bounds */
20   ox = sx;
21   oy = sy;
22
23   ex = sx + src1->width - 1;
24   if (sx < 0) sx = 0;
25   if (sx < clip->min_x) sx = clip->min_x;
26   if (ex >= dest->width) ex = dest->width - 1;
27   if (ex > clip->max_x) ex = clip->max_x;
28   if (sx > ex) return;
29
30   ey = sy + src1->height - 1;
31   if (sy < 0) sy = 0;
32   if (sy < clip->min_y) sy = clip->min_y;
33   if (ey >= dest->height) ey = dest->height - 1;
34   if (ey > clip->max_y) ey = clip->max_y;
35   if (sy > ey) return;
36
16   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
3717   {
38      const pen_t *paldata = machine->pens;
39      UINT32 *end;
18      UINT32 *dd  = BITMAP_ADDR32(dest, y, 0);
19      UINT16 *sd1 = BITMAP_ADDR16(src1, y, 0);
20      UINT16 *sd2 = BITMAP_ADDR16(src2, y, 0);
4021
41      UINT16 *sd1 = src1->base;                                    /* source data   */
42      UINT16 *sd2 = src2->base;
43
44      int sw = ex-sx+1;                                          /* source width  */
45      int sh = ey-sy+1;                                          /* source height */
46      int sm = src1->rowpixels;                                    /* source modulo */
47
48      UINT32 *dd = BITMAP_ADDR32(dest, sy, sx);                        /* dest data     */
49      int dm = dest->rowpixels;                                    /* dest modulo   */
50
51      sd1 += (sx-ox);
52      sd1 += sm * (sy-oy);
53      sd2 += (sx-ox);
54      sd2 += sm * (sy-oy);
55
56      sm -= sw;
57      dm -= sw;
58
59      while (sh)
22      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
6023      {
61
62#define BLENDPIXEL(x)   if (sd2[x]) {                                    \
63                     if (sd2[x] & 0x1000) {                           \
64                        dd[x] = paldata[sd1[x] & 0x07ff] + paldata[sd2[x]];   \
65                     } else {                                    \
66                        dd[x] = paldata[sd2[x]];                     \
67                     }                                          \
68                  } else {                                       \
69                     dd[x] = paldata[sd1[x]];                        \
70                  }
71
72         end = dd + sw;
73         while (dd <= end - 8)
24         if (sd2[x])
7425         {
75            BLENDPIXEL(0);
76            BLENDPIXEL(1);
77            BLENDPIXEL(2);
78            BLENDPIXEL(3);
79            BLENDPIXEL(4);
80            BLENDPIXEL(5);
81            BLENDPIXEL(6);
82            BLENDPIXEL(7);
83            dd += 8;
84            sd1 += 8;
85            sd2 += 8;
26            if (sd2[x] & 0x1000)
27               dd[x] = paldata[sd1[x] & 0x07ff] + paldata[sd2[x]];
28            else
29               dd[x] = paldata[sd2[x]];
8630         }
87         while (dd < end)
88         {
89            BLENDPIXEL(0);
90            dd++;
91            sd1++;
92            sd2++;
93         }
94         sd1 += sm;
95         sd2 += sm;
96         dd += dm;
97         sh--;
98
99#undef BLENDPIXEL
100
31         else
32            dd[x] = paldata[sd1[x]];
10133      }
10234   }
10335}
10436
37
10538/* from gals pinball (which was in turn from ninja gaiden) */
10639static int draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
10740{
r2018r2019
188121{
189122   int offs, sx, sy;
190123
191   fillbitmap(tile_bitmap_fg,      0, cliprect);
124   fillbitmap(tile_bitmap_fg, 0, cliprect);
192125
193126   /* draw table bg gfx */
194127   for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++)
195128   {
196      int attr, code, colour;
129      int attr, code, color;
197130
198131      code = spbactn_bgvideoram[offs + 0x4000 / 2];
199132      attr = spbactn_bgvideoram[offs + 0x0000 / 2];
200133
201      colour = ((attr & 0x00f0) >> 4) | 0x80;
134      color = ((attr & 0x00f0) >> 4) | 0x80;
202135
203136      drawgfx(tile_bitmap_bg, screen->machine->gfx[1],
204137               code,
205               colour,
138               color,
206139               0, 0,
207140               16 * sx, 8 * sy,
208141               cliprect, TRANSPARENCY_NONE, 0);
r2018r2019
220153      /* kludge: draw table bg gfx again if priority 0 sprites are enabled */
221154      for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++)
222155      {
223         int attr, code, colour;
156         int attr, code, color;
224157
225158         code = spbactn_bgvideoram[offs + 0x4000 / 2];
226159         attr = spbactn_bgvideoram[offs + 0x0000 / 2];
227160
228         colour = ((attr & 0x00f0) >> 4) | 0x80;
161         color = ((attr & 0x00f0) >> 4) | 0x80;
229162
230163         drawgfx(tile_bitmap_bg, screen->machine->gfx[1],
231164               code,
232               colour,
165               color,
233166               0, 0,
234167               16 * sx, 8 * sy,
235168               cliprect, TRANSPARENCY_PEN, 0);
r2018r2019
248181   /* draw table fg gfx */
249182   for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++)
250183   {
251      int attr, code, colour;
184      int attr, code, color;
252185
253186      code = spbactn_fgvideoram[offs + 0x4000 / 2];
254187      attr = spbactn_fgvideoram[offs + 0x0000 / 2];
255188
256      colour = ((attr & 0x00f0) >> 4);
189      color = ((attr & 0x00f0) >> 4);
257190
258191      /* blending */
259192      if (attr & 0x0008)
260         colour += 0x00f0;
193         color += 0x00f0;
261194      else
262         colour |= 0x0080;
195         color |= 0x0080;
263196
264197      drawgfx(tile_bitmap_fg, screen->machine->gfx[0],
265198               code,
266               colour,
199               color,
267200               0, 0,
268201               16 * sx, 8 * sy,
269               cliprect,TRANSPARENCY_PEN, 0);
202               cliprect, TRANSPARENCY_PEN, 0);
270203
271204      sx++;
272205      if (sx > 63)
r2018r2019
279212   draw_sprites(screen->machine, tile_bitmap_fg, cliprect, 3);
280213
281214   /* mix & blend the tilemaps and sprites into a 32-bit bitmap */
282   blendbitmaps(screen->machine, bitmap, tile_bitmap_bg, tile_bitmap_fg, 0, 0, cliprect);
215   blendbitmaps(screen->machine, bitmap, tile_bitmap_bg, tile_bitmap_fg, cliprect);
283216   return 0;
284217}
src/mame/video/atarimo.c
r2018r2019
1/*##########################################################################
1/***************************************************************************
22
33    atarimo.c
44
55    Common motion object management functions for Atari raster games.
66
7##########################################################################*/
7***************************************************************************/
88
99#include "driver.h"
1010#include "atarimo.h"
1111
1212
13/*##########################################################################
13/***************************************************************************
1414    TYPES & STRUCTURES
15##########################################################################*/
15***************************************************************************/
1616
1717/* internal structure containing a word index, shift and mask */
18struct atarimo_mask
18typedef struct _atarimo_mask atarimo_mask;
19struct _atarimo_mask
1920{
2021   int               word;            /* word index */
2122   int               shift;            /* shift amount */
r2018r2019
2324};
2425
2526/* internal structure containing the state of the motion objects */
26struct atarimo_data
27typedef struct _atarimo_data atarimo_data;
28struct _atarimo_data
2729{
30   running_machine *   machine;         /* pointer back to the machine */
31
2832   UINT32            gfxchanged;         /* true if the gfx info has changed */
29   gfx_element   gfxelement[MAX_GFX_ELEMENTS]; /* local copy of graphics elements */
33   gfx_element         gfxelement[MAX_GFX_ELEMENTS]; /* local copy of graphics elements */
3034   int               gfxgranularity[MAX_GFX_ELEMENTS];
3135
3236   bitmap_t          *bitmap;         /* temporary bitmap to render to */
r2018r2019
6771
6872   int               maxperline;         /* maximum number of entries/line */
6973
70   struct atarimo_mask   linkmask;         /* mask for the link */
71   struct atarimo_mask gfxmask;         /* mask for the graphics bank */
72   struct atarimo_mask   codemask;         /* mask for the code index */
73   struct atarimo_mask codehighmask;      /* mask for the upper code index */
74   struct atarimo_mask   colormask;         /* mask for the color */
75   struct atarimo_mask   xposmask;         /* mask for the X position */
76   struct atarimo_mask   yposmask;         /* mask for the Y position */
77   struct atarimo_mask   widthmask;         /* mask for the width, in tiles*/
78   struct atarimo_mask   heightmask;         /* mask for the height, in tiles */
79   struct atarimo_mask   hflipmask;         /* mask for the horizontal flip */
80   struct atarimo_mask   vflipmask;         /* mask for the vertical flip */
81   struct atarimo_mask   prioritymask;      /* mask for the priority */
82   struct atarimo_mask   neighbormask;      /* mask for the neighbor */
83   struct atarimo_mask absolutemask;      /* mask for absolute coordinates */
74   atarimo_mask      linkmask;         /* mask for the link */
75   atarimo_mask       gfxmask;         /* mask for the graphics bank */
76   atarimo_mask      codemask;         /* mask for the code index */
77   atarimo_mask       codehighmask;      /* mask for the upper code index */
78   atarimo_mask      colormask;         /* mask for the color */
79   atarimo_mask      xposmask;         /* mask for the X position */
80   atarimo_mask      yposmask;         /* mask for the Y position */
81   atarimo_mask      widthmask;         /* mask for the width, in tiles*/
82   atarimo_mask      heightmask;         /* mask for the height, in tiles */
83   atarimo_mask      hflipmask;         /* mask for the horizontal flip */
84   atarimo_mask      vflipmask;         /* mask for the vertical flip */
85   atarimo_mask      prioritymask;      /* mask for the priority */
86   atarimo_mask      neighbormask;      /* mask for the neighbor */
87   atarimo_mask       absolutemask;      /* mask for absolute coordinates */
8488
85   struct atarimo_mask specialmask;      /* mask for the special value */
89   atarimo_mask       specialmask;      /* mask for the special value */
8690   int               specialvalue;      /* resulting value to indicate "special" */
87   atarimo_special_func   specialcb;         /* callback routine for special entries */
91   atarimo_special_func specialcb;         /* callback routine for special entries */
8892   int               codehighshift;      /* shift count for the upper code */
8993
90   struct atarimo_entry *spriteram;      /* pointer to sprite RAM */
94   atarimo_entry *      spriteram;         /* pointer to sprite RAM */
9195   UINT16 **         slipram;         /* pointer to the SLIP RAM pointer */
9296   UINT16 *         codelookup;         /* lookup table for codes */
9397   UINT8 *            colorlookup;      /* lookup table for colors */
9498   UINT8 *            gfxlookup;         /* lookup table for graphics */
9599
96   struct atarimo_entry *activelist[ATARIMO_MAXPERBANK];   /* pointers to active motion objects */
97   struct atarimo_entry **activelast;      /* pointer to the last pointer in the active list */
98   UINT32            last_link;         /* previous starting point */
100   atarimo_entry *      activelist[ATARIMO_MAXPERBANK];   /* pointers to active motion objects */
101   atarimo_entry **   activelast;         /* pointer to the last pointer in the active list */
99102
100103   UINT8 *            dirtygrid;         /* grid of dirty rects for blending */
101104   int               dirtywidth;         /* width of dirty grid */
102105   int               dirtyheight;      /* height of dirty grid */
103106
104   rectangle   rectlist[ATARIMO_MAXPERBANK];   /* list of bounding rectangles */
107   rectangle         rectlist[ATARIMO_MAXPERBANK];   /* list of bounding rectangles */
105108   int               rectcount;
106109
107110   UINT32            last_xpos;         /* (during processing) the previous X position */
r2018r2019
110113
111114
112115
113/*##########################################################################
116/***************************************************************************
114117    MACROS
115##########################################################################*/
118***************************************************************************/
116119
117120/* data extraction */
118121#define EXTRACT_DATA(_input, _mask) (((_input)->data[(_mask).word] >> (_mask).shift) & (_mask).mask)
119122
120123
121124
122/*##########################################################################
125/***************************************************************************
123126    GLOBAL VARIABLES
124##########################################################################*/
127***************************************************************************/
125128
126129UINT16 *atarimo_0_spriteram;
127130UINT16 *atarimo_0_slipram;
r2018r2019
131134
132135
133136
134/*##########################################################################
137/***************************************************************************
135138    STATIC VARIABLES
136##########################################################################*/
139***************************************************************************/
137140
138static struct atarimo_data atarimo[ATARIMO_MAX];
141static atarimo_data atarimo[ATARIMO_MAX];
139142static emu_timer *force_update_timer;
140143
141144
142/*##########################################################################
145/***************************************************************************
143146    STATIC FUNCTION DECLARATIONS
144##########################################################################*/
147***************************************************************************/
145148
146static int mo_render_object(running_machine *machine, struct atarimo_data *mo, const struct atarimo_entry *entry, const rectangle *cliprect);
149static int mo_render_object(atarimo_data *mo, const atarimo_entry *entry, const rectangle *cliprect);
147150
148151
149152
150/*##########################################################################
153/***************************************************************************
151154    INLINE FUNCTIONS
152##########################################################################*/
155***************************************************************************/
153156
154157/*---------------------------------------------------------------
155158    compute_log: Computes the number of bits necessary to
r2018r2019
194197    shift, and adjusted mask. Returns 0 if invalid.
195198---------------------------------------------------------------*/
196199
197INLINE int convert_mask(const struct atarimo_entry *input, struct atarimo_mask *result)
200INLINE int convert_mask(const atarimo_entry *input, atarimo_mask *result)
198201{
199202   int i, temp;
200203
r2018r2019
234237    gives us full control over colors.
235238---------------------------------------------------------------*/
236239
237INLINE void init_gfxelement(running_machine *machine, struct atarimo_data *mo, int idx)
240INLINE void init_gfxelement(atarimo_data *mo, int idx)
238241{
239   mo->gfxelement[idx] = *machine->gfx[idx];
242   mo->gfxelement[idx] = *mo->machine->gfx[idx];
240243   mo->gfxgranularity[idx] = mo->gfxelement[idx].color_granularity;
241244   mo->gfxelement[idx].color_granularity = 1;
242245   mo->gfxelement[idx].color_base = 0;
243246   mo->gfxelement[idx].total_colors = 65536;
244247}
245248
246static struct atarimo_data atarimo[ATARIMO_MAX];
249static atarimo_data atarimo[ATARIMO_MAX];
247250static emu_timer *force_update_timer;
248251
249252/*---------------------------------------------------------------
250253    init_savestate: Initialize save states
251254---------------------------------------------------------------*/
252255
253static void init_savestate(int index, struct atarimo_data *mo)
256static void init_savestate(int index, atarimo_data *mo)
254257{
255258   state_save_register_item("atarimo", index, mo->gfxchanged);
256259   state_save_register_item("atarimo", index, mo->palettebase);
257260   state_save_register_item("atarimo", index, mo->bank);
258261   state_save_register_item("atarimo", index, mo->xscroll);
259262   state_save_register_item("atarimo", index, mo->yscroll);
260   state_save_register_item("atarimo", index, mo->last_link);
261263   state_save_register_item("atarimo", index, mo->last_xpos);
262264   state_save_register_item("atarimo", index, mo->next_xpos);
263265
r2018r2019
297299
298300   state_save_register_bitmap("atarimo", index, "bitmap", mo->bitmap);
299301
300   state_save_register_memory("atarimo", index, "spriteram", mo->spriteram, sizeof(struct atarimo_entry), mo->spriteramsize);
302   state_save_register_memory("atarimo", index, "spriteram", mo->spriteram, sizeof(atarimo_entry), mo->spriteramsize);
301303
302304   state_save_register_item_pointer("atarimo", index, mo->codelookup, round_to_powerof2(mo->codemask.mask));
303305
r2018r2019
309311
310312}
311313
312/*##########################################################################
314/***************************************************************************
313315    GLOBAL FUNCTIONS
314##########################################################################*/
316***************************************************************************/
315317
316318static TIMER_CALLBACK( force_update )
317319{
r2018r2019
332334    the attribute lookup table.
333335---------------------------------------------------------------*/
334336
335void atarimo_init(running_machine *machine, int map, const struct atarimo_desc *desc)
337void atarimo_init(running_machine *machine, int map, const atarimo_desc *desc)
336338{
337339   gfx_element *gfx = machine->gfx[desc->gfxindex];
338   struct atarimo_data *mo = &atarimo[map];
340   atarimo_data *mo = &atarimo[map];
339341   int i;
340342
341343   assert_always(map >= 0 && map < ATARIMO_MAX, "atarimo_init: map out of range");
r2018r2019
357359   convert_mask(&desc->absolutemask,  &mo->absolutemask);
358360
359361   /* copy in the basic data */
360   mo->gfxchanged    = 0;
362   mo->machine       = machine;
363   mo->gfxchanged    = FALSE;
361364
362365   mo->linked        = desc->linked;
363366   mo->split         = desc->split;
r2018r2019
402405
403406   mo->slipram       = (map == 0) ? &atarimo_0_slipram : &atarimo_1_slipram;
404407
405   mo->last_link     = -1;
406
407408   /* allocate the temp bitmap */
408409   mo->bitmap        = video_screen_auto_bitmap_alloc(machine->primary_screen);
409410   fillbitmap(mo->bitmap, desc->transpen, NULL);
r2018r2019
441442      mo->gfxlookup[i] = desc->gfxindex;
442443
443444   /* initialize the gfx elements so we have full control over colors */
444   init_gfxelement(machine, mo, desc->gfxindex);
445   init_gfxelement(mo, desc->gfxindex);
445446
446447   /* start a timer to update a few times during refresh */
447448   force_update_timer = timer_alloc(force_update, NULL);
r2018r2019
464465
465466UINT16 *atarimo_get_code_lookup(int map, int *size)
466467{
467   struct atarimo_data *mo = &atarimo[map];
468   atarimo_data *mo = &atarimo[map];
468469
469470   if (size)
470471      *size = round_to_powerof2(mo->codemask.mask);
r2018r2019
479480
480481UINT8 *atarimo_get_color_lookup(int map, int *size)
481482{
482   struct atarimo_data *mo = &atarimo[map];
483   atarimo_data *mo = &atarimo[map];
483484
484485   if (size)
485486      *size = round_to_powerof2(mo->colormask.mask);
r2018r2019
494495
495496UINT8 *atarimo_get_gfx_lookup(int map, int *size)
496497{
497   struct atarimo_data *mo = &atarimo[map];
498   atarimo_data *mo = &atarimo[map];
498499
499   mo->gfxchanged = 1;
500   mo->gfxchanged = TRUE;
500501   if (size)
501502      *size = round_to_powerof2(mo->gfxmask.mask);
502503   return mo->gfxlookup;
r2018r2019
504505
505506
506507/*---------------------------------------------------------------
507    update_active_list: Update the list of active objects.
508    build_active_list: Build a list of active objects.
508509---------------------------------------------------------------*/
509510
510static void update_active_list(struct atarimo_data *mo, int link)
511static void build_active_list(atarimo_data *mo, int link)
511512{
512   struct atarimo_entry *bankbase = &mo->spriteram[mo->bank << mo->entrybits];
513   atarimo_entry *bankbase = &mo->spriteram[mo->bank << mo->entrybits];
513514   UINT8 movisit[ATARIMO_MAXPERBANK];
514   struct atarimo_entry **current;
515   atarimo_entry **current;
515516   int i;
516517
517518   /* reset the visit map */
518519   memset(movisit, 0, mo->entrycount);
519520
520   /* remember the last link */
521   mo->last_link = link;
522
523521   /* visit all the motion objects and copy their data into the display list */
524522   for (i = 0, current = mo->activelist; i < mo->maxperline && !movisit[link]; i++)
525523   {
526      struct atarimo_entry *modata = &bankbase[link];
524      atarimo_entry *modata = &bankbase[link];
527525
528526      /* copy the current entry into the list */
529527      *current++ = modata;
r2018r2019
546544    X and Y position.
547545---------------------------------------------------------------*/
548546
549INLINE UINT8 *get_dirty_base(struct atarimo_data *mo, int x, int y)
547INLINE UINT8 *get_dirty_base(atarimo_data *mo, int x, int y)
550548{
551549   UINT8 *result = mo->dirtygrid;
552550   result += ((y >> mo->tileyshift) + 1) * mo->dirtywidth;
r2018r2019
560558    cliprect.
561559---------------------------------------------------------------*/
562560
563static void erase_dirty_grid(struct atarimo_data *mo, const rectangle *cliprect)
561static void erase_dirty_grid(atarimo_data *mo, const rectangle *cliprect)
564562{
565563   int sx = cliprect->min_x >> mo->tilexshift;
566564   int ex = cliprect->max_x >> mo->tilexshift;
r2018r2019
583581    series of cliprects.
584582---------------------------------------------------------------*/
585583
586static void convert_dirty_grid_to_rects(struct atarimo_data *mo, const rectangle *cliprect, struct atarimo_rect_list *rectlist)
584static void convert_dirty_grid_to_rects(atarimo_data *mo, const rectangle *cliprect, atarimo_rect_list *rectlist)
587585{
588586   int sx = cliprect->min_x >> mo->tilexshift;
589587   int ex = cliprect->max_x >> mo->tilexshift;
r2018r2019
646644    destination bitmap.
647645---------------------------------------------------------------*/
648646
649bitmap_t *atarimo_render(running_machine *machine, int map, const rectangle *cliprect, struct atarimo_rect_list *rectlist)
647bitmap_t *atarimo_render(int map, const rectangle *cliprect, atarimo_rect_list *rectlist)
650648{
651   struct atarimo_data *mo = &atarimo[map];
649   atarimo_data *mo = &atarimo[map];
652650   int startband, stopband, band, i;
653651   rectangle *rect;
654652
655653   /* if the graphics info has changed, recompute */
656654   if (mo->gfxchanged)
657655   {
658      mo->gfxchanged = 0;
656      mo->gfxchanged = FALSE;
659657      for (i = 0; i < round_to_powerof2(mo->gfxmask.mask); i++)
660         init_gfxelement(machine, mo, mo->gfxlookup[i]);
658         init_gfxelement(mo, mo->gfxlookup[i]);
661659   }
662660
663661   /* compute start/stop bands */
r2018r2019
674672   /* loop over SLIP bands */
675673   for (band = startband; band <= stopband; band++)
676674   {
677      struct atarimo_entry **first, **current, **last;
675      atarimo_entry **first, **current, **last;
678676      rectangle bandclip;
679677      int link, step;
680678
r2018r2019
696694
697695         /* compute minimum Y and wrap around if necessary */
698696         bandclip.min_y = ((band << mo->slipshift) - mo->yscroll + mo->slipoffset) & mo->bitmapymask;
699         if (bandclip.min_y > video_screen_get_visible_area(machine->primary_screen)->max_y)
697         if (bandclip.min_y > video_screen_get_visible_area(mo->machine->primary_screen)->max_y)
700698            bandclip.min_y -= mo->bitmapheight;
701699
702700         /* maximum Y is based on the minimum */
r2018r2019
707705      }
708706
709707      /* if this matches the last link, we don't need to re-process the list */
710      if (link != mo->last_link)
711         update_active_list(mo, link);
708      build_active_list(mo, link);
712709
713710      /* set the start and end points */
714711      if (mo->reverse)
r2018r2019
729726
730727      /* render the mos */
731728      for (current = first; current != last; current += step)
732         mo_render_object(machine, mo, *current, &bandclip);
729         mo_render_object(mo, *current, &bandclip);
733730   }
734731
735732   /* convert the dirty grid to a rectlist */
r2018r2019
750747    to the destination.
751748---------------------------------------------------------------*/
752749
753static int mo_render_object(running_machine *machine, struct atarimo_data *mo, const struct atarimo_entry *entry, const rectangle *cliprect)
750static int mo_render_object(atarimo_data *mo, const atarimo_entry *entry, const rectangle *cliprect)
754751{
755752   int gfxindex = mo->gfxlookup[EXTRACT_DATA(entry, mo->gfxmask)];
756753   const gfx_element *gfx = &mo->gfxelement[gfxindex];
r2018r2019
815812   /* adjust the final coordinates */
816813   xpos &= mo->bitmapxmask;
817814   ypos &= mo->bitmapymask;
818   if (xpos > video_screen_get_visible_area(machine->primary_screen)->max_x) xpos -= mo->bitmapwidth;
819   if (ypos > video_screen_get_visible_area(machine->primary_screen)->max_y) ypos -= mo->bitmapheight;
815   if (xpos > video_screen_get_visible_area(mo->machine->primary_screen)->max_x) xpos -= mo->bitmapwidth;
816   if (ypos > video_screen_get_visible_area(mo->machine->primary_screen)->max_y) ypos -= mo->bitmapheight;
820817
821818   /* is this one special? */
822819   if (mo->specialmask.mask != 0 && EXTRACT_DATA(entry, mo->specialmask) == mo->specialvalue)
r2018r2019
926923
927924void atarimo_set_bank(int map, int bank)
928925{
929   struct atarimo_data *mo = &atarimo[map];
930   if (mo->bank != bank)
931   {
932      mo->bank = bank;
933      mo->last_link = -1;
934   }
926   atarimo_data *mo = &atarimo[map];
927   mo->bank = bank;
935928}
936929
937930
r2018r2019
942935
943936void atarimo_set_xscroll(int map, int xscroll)
944937{
945   struct atarimo_data *mo = &atarimo[map];
938   atarimo_data *mo = &atarimo[map];
946939   mo->xscroll = xscroll;
947940}
948941
r2018r2019
954947
955948void atarimo_set_yscroll(int map, int yscroll)
956949{
957   struct atarimo_data *mo = &atarimo[map];
950   atarimo_data *mo = &atarimo[map];
958951   mo->yscroll = yscroll;
959952}
960953
r2018r2019
10131006   }
10141007   bank = offset >> (2 + atarimo[0].entrybits);
10151008   COMBINE_DATA(&atarimo[0].spriteram[(bank << atarimo[0].entrybits) + entry].data[idx]);
1016   atarimo[0].last_link = -1;
10171009}
10181010
10191011
r2018r2019
10381030   }
10391031   bank = offset >> (2 + atarimo[1].entrybits);
10401032   COMBINE_DATA(&atarimo[1].spriteram[(bank << atarimo[1].entrybits) + entry].data[idx]);
1041   atarimo[1].last_link = -1;
10421033}
10431034
10441035
r2018r2019
10671058      }
10681059      bank = offset >> (2 + atarimo[0].entrybits);
10691060      COMBINE_DATA(&atarimo[0].spriteram[(bank << atarimo[0].entrybits) + entry].data[idx]);
1070      atarimo[0].last_link = -1;
10711061   }
10721062}
10731063
src/mame/video/atarimo.h
r2018r2019
1/*##########################################################################
1/***************************************************************************
22
33    atarimo.h
44
55    Common motion object management functions for Atari raster games.
66
7##########################################################################*/
7***************************************************************************/
88
99#ifndef __ATARIMO__
1010#define __ATARIMO__
1111
1212
13/*##########################################################################
13/***************************************************************************
1414    CONSTANTS
15##########################################################################*/
15***************************************************************************/
1616
1717/* maximum number of motion object processors */
1818#define ATARIMO_MAX            2
r2018r2019
2727
2828
2929
30/*##########################################################################
30/***************************************************************************
3131    TYPES & STRUCTURES
32##########################################################################*/
32***************************************************************************/
3333
3434/* callback for special processing */
3535typedef int (*atarimo_special_func)(bitmap_t *bitmap, const rectangle *clip, int code, int color, int xpos, int ypos, rectangle *mobounds);
3636
3737/* description for a four-word mask */
38struct atarimo_entry
38typedef struct _atarimo_entry atarimo_entry;
39struct _atarimo_entry
3940{
4041   UINT16         data[4];
4142};
4243
4344/* description of the motion objects */
44struct atarimo_desc
45typedef struct _atarimo_desc atarimo_desc;
46struct _atarimo_desc
4547{
4648   UINT8            gfxindex;         /* index to which gfx system */
4749   UINT8            banks;            /* number of motion object banks */
r2018r2019
5860   UINT16            maxcolors;         /* maximum number of colors */
5961   UINT8            transpen;         /* transparent pen index */
6062
61   struct atarimo_entry linkmask;         /* mask for the link */
62   struct atarimo_entry gfxmask;         /* mask for the graphics bank */
63   struct atarimo_entry codemask;         /* mask for the code index */
64   struct atarimo_entry codehighmask;      /* mask for the upper code index */
65   struct atarimo_entry colormask;         /* mask for the color */
66   struct atarimo_entry xposmask;         /* mask for the X position */
67   struct atarimo_entry yposmask;         /* mask for the Y position */
68   struct atarimo_entry widthmask;         /* mask for the width, in tiles*/
69   struct atarimo_entry heightmask;      /* mask for the height, in tiles */
70   struct atarimo_entry hflipmask;         /* mask for the horizontal flip */
71   struct atarimo_entry vflipmask;         /* mask for the vertical flip */
72   struct atarimo_entry prioritymask;      /* mask for the priority */
73   struct atarimo_entry neighbormask;      /* mask for the neighbor */
74   struct atarimo_entry absolutemask;      /* mask for absolute coordinates */
63   atarimo_entry       linkmask;         /* mask for the link */
64   atarimo_entry       gfxmask;         /* mask for the graphics bank */
65   atarimo_entry       codemask;         /* mask for the code index */
66   atarimo_entry       codehighmask;      /* mask for the upper code index */
67   atarimo_entry       colormask;         /* mask for the color */
68   atarimo_entry       xposmask;         /* mask for the X position */
69   atarimo_entry       yposmask;         /* mask for the Y position */
70   atarimo_entry       widthmask;         /* mask for the width, in tiles*/
71   atarimo_entry       heightmask;         /* mask for the height, in tiles */
72   atarimo_entry       hflipmask;         /* mask for the horizontal flip */
73   atarimo_entry       vflipmask;         /* mask for the vertical flip */
74   atarimo_entry       prioritymask;      /* mask for the priority */
75   atarimo_entry       neighbormask;      /* mask for the neighbor */
76   atarimo_entry       absolutemask;      /* mask for absolute coordinates */
7577
76   struct atarimo_entry specialmask;      /* mask for the special value */
77   UINT16         specialvalue;      /* resulting value to indicate "special" */
78   atarimo_special_func   specialcb;         /* callback routine for special entries */
78   atarimo_entry       specialmask;      /* mask for the special value */
79   UINT16            specialvalue;      /* resulting value to indicate "special" */
80   atarimo_special_func specialcb;         /* callback routine for special entries */
7981};
8082
8183/* rectangle list */
82struct atarimo_rect_list
84typedef struct _atarimo_rect_list atarimo_rect_list;
85struct _atarimo_rect_list
8386{
8487   int               numrects;
85   rectangle *   rect;
88   rectangle *         rect;
8689};
8790
8891
89/*##########################################################################
92/***************************************************************************
9093    FUNCTION PROTOTYPES
91##########################################################################*/
94***************************************************************************/
9295
9396/* setup/shutdown */
94void atarimo_init(running_machine *machine, int map, const struct atarimo_desc *desc);
97void atarimo_init(running_machine *machine, int map, const atarimo_desc *desc);
9598UINT16 *atarimo_get_code_lookup(int map, int *size);
9699UINT8 *atarimo_get_color_lookup(int map, int *size);
97100UINT8 *atarimo_get_gfx_lookup(int map, int *size);
98101
99102/* core processing */
100bitmap_t *atarimo_render(running_machine *machine, int map, const rectangle *cliprect, struct atarimo_rect_list *rectlist);
103bitmap_t *atarimo_render(int map, const rectangle *cliprect, atarimo_rect_list *rectlist);
101104
102105/* atrribute setters */
103106void atarimo_set_bank(int map, int bank);
r2018r2019
119122
120123
121124
122/*##########################################################################
125/***************************************************************************
123126    GLOBAL VARIABLES
124##########################################################################*/
127***************************************************************************/
125128
126129extern UINT16 *atarimo_0_spriteram;
127130extern UINT16 *atarimo_0_slipram;
src/mame/video/arcadecl.c
r2018r2019
3232
3333VIDEO_START( arcadecl )
3434{
35   static const struct atarimo_desc modesc =
35   static const atarimo_desc modesc =
3636   {
3737      0,               /* index to which gfx system */
3838      1,               /* number of motion object banks */
r2018r2019
9494   /* draw and merge the MO */
9595   if (has_mo)
9696   {
97      struct atarimo_rect_list rectlist;
97      atarimo_rect_list rectlist;
9898      bitmap_t *mobitmap;
9999      int x, y, r;
100100
101      mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
101      mobitmap = atarimo_render(0, cliprect, &rectlist);
102102      for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
103103         for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
104104         {
src/mame/video/leland.c
r2018r2019
8282
8383WRITE8_HANDLER( leland_scroll_w )
8484{
85   int scanline = video_screen_get_vpos(machine->primary_screen);
86   if (scanline > 0)
87      video_screen_update_partial(machine->primary_screen, scanline - 1);
88
8589   /* adjust the proper scroll value */
8690   switch (offset)
8791   {
8892      case 0:
89         video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen) - 1);
9093         xscroll = (xscroll & 0xff00) | (data & 0x00ff);
9194         break;
9295
9396      case 1:
94         video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen) - 1);
9597         xscroll = (xscroll & 0x00ff) | ((data << 8) & 0xff00);
9698         break;
9799
98100      case 2:
99         video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen) - 1);
100101         yscroll = (yscroll & 0xff00) | (data & 0x00ff);
101102         break;
102103
103104      case 3:
104         video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen) - 1);
105105         yscroll = (yscroll & 0x00ff) | ((data << 8) & 0xff00);
106106         break;
107107
r2018r2019
200200
201201   /* don't fully understand why this is needed.  Isn't the
202202       video RAM just one big RAM? */
203   video_screen_update_partial(Machine->primary_screen, video_screen_get_vpos(Machine->primary_screen) - 1);
203   int scanline = video_screen_get_vpos(Machine->primary_screen);
204   if (scanline > 0)
205      video_screen_update_partial(Machine->primary_screen, scanline - 1);
204206
205207   if (LOG_COMM && addr >= 0xf000)
206208      logerror("%04X:%s comm write %04X = %02X\n", activecpu_get_previouspc(), num ? "slave" : "master", addr, data);
src/mame/video/skullxbo.c
r2018r2019
4646
4747VIDEO_START( skullxbo )
4848{
49   static const struct atarimo_desc modesc =
49   static const atarimo_desc modesc =
5050   {
5151      0,               /* index to which gfx system */
5252      2,               /* number of motion object banks */
r2018r2019
236236
237237VIDEO_UPDATE( skullxbo )
238238{
239   struct atarimo_rect_list rectlist;
239   atarimo_rect_list rectlist;
240240   bitmap_t *mobitmap;
241241   int x, y, r;
242242
r2018r2019
244244   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0);
245245
246246   /* draw and merge the MO */
247   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
247   mobitmap = atarimo_render(0, cliprect, &rectlist);
248248   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
249249      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
250250      {
src/mame/video/btoads.c
r2018r2019
8787   if (ACCESSING_MSB)
8888   {
8989      /* allow multiple changes during display */
90      video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen) - 1);
90      int scanline = video_screen_get_vpos(machine->primary_screen);
91      if (scanline > 0)
92         video_screen_update_partial(machine->primary_screen, scanline - 1);
9193
9294      /* bit 15 controls which page is rendered and which page is displayed */
9395      if (data & 0x8000)
src/mame/video/xybots.c
r2018r2019
4444
4545VIDEO_START( xybots )
4646{
47   static const struct atarimo_desc modesc =
47   static const atarimo_desc modesc =
4848   {
4949      1,               /* index to which gfx system */
5050      1,               /* number of motion object banks */
r2018r2019
102102
103103VIDEO_UPDATE( xybots )
104104{
105   struct atarimo_rect_list rectlist;
105   atarimo_rect_list rectlist;
106106   bitmap_t *mobitmap;
107107   int x, y, r;
108108
r2018r2019
110110   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0);
111111
112112   /* draw and merge the MO */
113   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
113   mobitmap = atarimo_render(0, cliprect, &rectlist);
114114   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
115115      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
116116      {
src/mame/video/atarisy1.c
r2018r2019
151151
152152VIDEO_START( atarisy1 )
153153{
154   static const struct atarimo_desc modesc =
154   static const atarimo_desc modesc =
155155   {
156156      0,               /* index to which gfx system */
157157      8,               /* number of motion object banks */
r2018r2019
514514
515515VIDEO_UPDATE( atarisy1 )
516516{
517   struct atarimo_rect_list rectlist;
517   atarimo_rect_list rectlist;
518518   bitmap_t *mobitmap;
519519   int x, y, r;
520520
r2018r2019
522522   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0);
523523
524524   /* draw and merge the MO */
525   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
525   mobitmap = atarimo_render(0, cliprect, &rectlist);
526526   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
527527      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
528528      {
src/mame/video/atarig42.c
r2018r2019
180180         int newbank = word & 0x1f;
181181         if (newscroll != playfield_xscroll)
182182         {
183            video_screen_update_partial(screen, scanline + i - 1);
183            if (scanline + i > 0)
184               video_screen_update_partial(screen, scanline + i - 1);
184185            tilemap_set_scrollx(atarigen_playfield_tilemap, 0, newscroll);
185186            playfield_xscroll = newscroll;
186187         }
187188         if (newbank != playfield_color_bank)
188189         {
189            video_screen_update_partial(screen, scanline + i - 1);
190            if (scanline + i > 0)
191               video_screen_update_partial(screen, scanline + i - 1);
190192            tilemap_mark_all_tiles_dirty(atarigen_playfield_tilemap);
191193            playfield_color_bank = newbank;
192194         }
r2018r2019
199201         int newbank = word & 7;
200202         if (newscroll != playfield_yscroll)
201203         {
202            video_screen_update_partial(screen, scanline + i - 1);
204            if (scanline + i > 0)
205               video_screen_update_partial(screen, scanline + i - 1);
203206            tilemap_set_scrolly(atarigen_playfield_tilemap, 0, newscroll);
204207            playfield_yscroll = newscroll;
205208         }
206209         if (newbank != playfield_tile_bank)
207210         {
208            video_screen_update_partial(screen, scanline + i - 1);
211            if (scanline + i > 0)
212               video_screen_update_partial(screen, scanline + i - 1);
209213            tilemap_mark_all_tiles_dirty(atarigen_playfield_tilemap);
210214            playfield_tile_bank = newbank;
211215         }
src/mame/video/vindictr.c
r2018r2019
5757
5858VIDEO_START( vindictr )
5959{
60   static const struct atarimo_desc modesc =
60   static const atarimo_desc modesc =
6161   {
6262      0,               /* index to which gfx system */
6363      1,               /* number of motion object banks */
r2018r2019
224224
225225VIDEO_UPDATE( vindictr )
226226{
227   struct atarimo_rect_list rectlist;
227   atarimo_rect_list rectlist;
228228   bitmap_t *mobitmap;
229229   int x, y, r;
230230
r2018r2019
232232   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0);
233233
234234   /* draw and merge the MO */
235   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
235   mobitmap = atarimo_render(0, cliprect, &rectlist);
236236   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
237237      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
238238      {
src/mame/video/atarisy2.c
r2018r2019
7979
8080VIDEO_START( atarisy2 )
8181{
82   static const struct atarimo_desc modesc =
82   static const atarimo_desc modesc =
8383   {
8484      1,               /* index to which gfx system */
8585      1,               /* number of motion object banks */
r2018r2019
330330
331331VIDEO_UPDATE( atarisy2 )
332332{
333   struct atarimo_rect_list rectlist;
333   atarimo_rect_list rectlist;
334334   bitmap_t *mobitmap;
335335   int x, y, r;
336336
r2018r2019
342342   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 3, 3);
343343
344344   /* draw and merge the MO */
345   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
345   mobitmap = atarimo_render(0, cliprect, &rectlist);
346346   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
347347      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
348348      {
src/mame/video/ninjakd2.c
r2018r2019
335335 *
336336 *************************************/
337337
338static void draw_sprites(running_machine* const machine, bitmap_t* const bitmap, const rectangle* const cliprect)
338static void draw_sprites(running_machine* const machine, bitmap_t* const bitmap)
339339{
340340   const gfx_element* const gfx = machine->gfx[1];
341341   int const big_xshift = robokid_sprites ? 1 : 0;
r2018r2019
347347   // the sprite generator draws exactly 96 16x16 sprites per frame. When big
348348   // (32x32) sprites are drawn, this counts for 4 sprites drawn, so the sprite
349349   // list is reduced accordingly (i.e. three slots at the end of the list will
350   // be ignored). Note that a disabled sprite, even if it is not draw, still
350   // be ignored). Note that a disabled sprite, even if it is not drawn, still
351351   // counts as one sprite drawn.
352352   // This is proven by Mutant Night, which doesn't work correctly (leaves shots
353   // on screen) if we don't take this into account.
353   // on screen) if we don't take big sprites into account.
354354
355355   for (;;)
356356   {
r2018r2019
399399                     for (xx = 0; xx < 16; ++xx)
400400                     {
401401                        UINT16* const ptr = BITMAP_ADDR16(bitmap, sy + yy, sx + xx);
402                        int const offset = (flipx ? (16 - xx) : xx) + (flipy ? (16 - yy) : yy ) * gfx->line_modulo;;
402                        int const offset = (flipx ? (15 - xx) : xx) + (flipy ? (15 - yy) : yy ) * gfx->line_modulo;;
403403
404404                        if (srcgfx[offset] != 15 && (*ptr & 0xf0) >= 0xc0)
405                        {
406405                           *ptr = 15;
407                        }
408406                     }
409407                  }
410408               }
r2018r2019
415413                        color,
416414                        flipx,flipy,
417415                        sx + 16*x, sy + 16*y,
418                        cliprect,
419                        TRANSPARENCY_PEN, 15);
416                        0, TRANSPARENCY_PEN, 15);
420417               }
421418
422419               ++sprites_drawn;
r2018r2019
519516   // exit from stage 3.
520517   sprite_overdraw_enabled = next_sprite_overdraw_enabled;
521518
522   draw_sprites(machine, sp_bitmap, 0);
519   draw_sprites(machine, sp_bitmap);
523520}
src/mame/video/batman.c
r2018r2019
6868
6969VIDEO_START( batman )
7070{
71   static const struct atarimo_desc modesc =
71   static const atarimo_desc modesc =
7272   {
7373      1,               /* index to which gfx system */
7474      1,               /* number of motion object banks */
r2018r2019
143143            switch (data & 15)
144144            {
145145               case 9:
146                  video_screen_update_partial(screen, scanline - 1);
146                  if (scanline > 0)
147                     video_screen_update_partial(screen, scanline - 1);
147148                  atarivc_state.mo_xscroll = (data >> 7) & 0x1ff;
148149                  atarimo_set_xscroll(0, atarivc_state.mo_xscroll);
149150                  break;
150151
151152               case 10:
152                  video_screen_update_partial(screen, scanline - 1);
153                  if (scanline > 0)
154                     video_screen_update_partial(screen, scanline - 1);
153155                  atarivc_state.pf1_xscroll_raw = (data >> 7) & 0x1ff;
154156                  atarivc_update_pf_xscrolls();
155157                  tilemap_set_scrollx(atarigen_playfield_tilemap, 0, atarivc_state.pf0_xscroll);
r2018r2019
157159                  break;
158160
159161               case 11:
160                  video_screen_update_partial(screen, scanline - 1);
162                  if (scanline > 0)
163                     video_screen_update_partial(screen, scanline - 1);
161164                  atarivc_state.pf0_xscroll_raw = (data >> 7) & 0x1ff;
162165                  atarivc_update_pf_xscrolls();
163166                  tilemap_set_scrollx(atarigen_playfield_tilemap, 0, atarivc_state.pf0_xscroll);
164167                  break;
165168
166169               case 13:
167                  video_screen_update_partial(screen, scanline - 1);
170                  if (scanline > 0)
171                     video_screen_update_partial(screen, scanline - 1);
168172                  atarivc_state.mo_yscroll = (data >> 7) & 0x1ff;
169173                  atarimo_set_yscroll(0, atarivc_state.mo_yscroll);
170174                  break;
171175
172176               case 14:
173                  video_screen_update_partial(screen, scanline - 1);
177                  if (scanline > 0)
178                     video_screen_update_partial(screen, scanline - 1);
174179                  atarivc_state.pf1_yscroll = (data >> 7) & 0x1ff;
175180                  tilemap_set_scrolly(atarigen_playfield2_tilemap, 0, atarivc_state.pf1_yscroll);
176181                  break;
177182
178183               case 15:
179                  video_screen_update_partial(screen, scanline - 1);
184                  if (scanline > 0)
185                     video_screen_update_partial(screen, scanline - 1);
180186                  atarivc_state.pf0_yscroll = (data >> 7) & 0x1ff;
181187                  tilemap_set_scrolly(atarigen_playfield_tilemap, 0, atarivc_state.pf0_yscroll);
182188                  break;
r2018r2019
195201
196202VIDEO_UPDATE( batman )
197203{
198   struct atarimo_rect_list rectlist;
204   atarimo_rect_list rectlist;
199205   bitmap_t *mobitmap;
200206   int x, y, r;
201207
r2018r2019
211217   tilemap_draw(bitmap, cliprect, atarigen_playfield2_tilemap, 3, 0x8c);
212218
213219   /* draw and merge the MO */
214   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
220   mobitmap = atarimo_render(0, cliprect, &rectlist);
215221   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
216222      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
217223      {
src/mame/video/astrocde.c
r2018r2019
452452      vertical_feedback = vfeedback;
453453      horizontal_feedback = hfeedback;
454454   }
455   
456   /* nothing to do, clear the interrupt */
457   else
458      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
459455}
460456
461457
r2018r2019
472468   int astrocade_scanline = mame_vpos_to_astrocade_vpos(scanline);
473469
474470   /* force an update against the current scanline */
475   video_screen_update_partial(machine->primary_screen, scanline ? scanline - 1 : video_screen_get_height(machine->primary_screen));
471   if (scanline > 0)
472      video_screen_update_partial(machine->primary_screen, scanline - 1);
476473
477474   /* generate a scanline interrupt if it's time */
478475   if (astrocade_scanline == interrupt_scanline && (interrupt_enable & 0x08) != 0)
r2018r2019
493490   else if (astrocade_video_config & AC_LIGHTPEN_INTS)
494491      astrocade_trigger_lightpen(machine, astrocade_scanline, 8);
495492
496   /* nothing to do, clear the interrupt */
497   else
498      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
499
500493   /* advance to the next scanline */
501494   scanline++;
502495   if (scanline >= video_screen_get_height(machine->primary_screen))
r2018r2019
563556      case 0x17:   /* keypad column 3 */
564557         result = readinputportbytag_safe("KEYPAD3", 0xff);
565558         break;
566
567      case 0x1c:   /* player 1 knob */
568         result = readinputportbytag_safe("P1_KNOB", 0xff);
569         break;
570
571      case 0x1d:   /* player 2 knob */
572         result = readinputportbytag_safe("P2_KNOB", 0xff);
573         break;
574
575      case 0x1e:   /* player 3 knob */
576         result = readinputportbytag_safe("P3_KNOB", 0xff);
577         break;
578
579      case 0x1f:   /* player 4 knob */
580         result = readinputportbytag_safe("P4_KNOB", 0xff);
581         break;
582559   }
583560
584561   return result;
r2018r2019
587564
588565WRITE8_HANDLER( astrocade_data_chip_register_w )
589566{
590   static int color_index = 7;
591   
592567   /* these are the core registers */
593568   switch (offset & 0xff)
594569   {
r2018r2019
617592         break;
618593
619594      case 0x0b:   /* color block transfer */
620         colors[color_index] = data;
621         if (color_index-- == 0) color_index = 7;
595         colors[(offset >> 8) & 7] = data;
622596         break;
623597
624598      case 0x0c:   /* function generator */
src/mame/video/blstroid.c
r2018r2019
4444
4545VIDEO_START( blstroid )
4646{
47   static const struct atarimo_desc modesc =
47   static const atarimo_desc modesc =
4848   {
4949      1,               /* index to which gfx system */
5050      1,               /* number of motion object banks */
r2018r2019
150150
151151VIDEO_UPDATE( blstroid )
152152{
153   struct atarimo_rect_list rectlist;
153   atarimo_rect_list rectlist;
154154   bitmap_t *mobitmap;
155155   int x, y, r;
156156
r2018r2019
158158   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0);
159159
160160   /* draw and merge the MO */
161   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
161   mobitmap = atarimo_render(0, cliprect, &rectlist);
162162   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
163163      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
164164      {
src/mame/video/toobin.c
r2018r2019
5555
5656VIDEO_START( toobin )
5757{
58   static const struct atarimo_desc modesc =
58   static const atarimo_desc modesc =
5959   {
6060      1,               /* index to which gfx system */
6161      1,               /* number of motion object banks */
r2018r2019
227227
228228VIDEO_UPDATE( toobin )
229229{
230   struct atarimo_rect_list rectlist;
230   atarimo_rect_list rectlist;
231231   bitmap_t *mobitmap;
232232   int x, y, r;
233233
r2018r2019
239239   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 3, 3);
240240
241241   /* draw and merge the MO */
242   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
242   mobitmap = atarimo_render(0, cliprect, &rectlist);
243243   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
244244      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
245245      {
src/mame/video/funworld.c
r2018r2019
2929    * Pool 10 (italian, set 1),                         C.M.C.,             1996.
3030    * Pool 10 (italian, set 2),                         C.M.C.,             1996.
3131    * Tortuga Family (italian),                         C.M.C.,             1997.
32    * Pot Game (italian),                               C.M.C.,             1996.
3233    * Royal Card (austrian, set 1),                     TAB-Austria,        1991.
3334    * Royal Card (austrian, set 2),                     TAB-Austria,        1991.
3435    * Royal Card (slovak, encrypted),                   Evona Electronic,   1991.
src/mame/video/playch10.c
r2018r2019
1010extern int pc10_game_mode;
1111extern int pc10_dispmask_old;
1212
13/* from common.c */
13/* from romload.c */
1414extern int system_bios;
1515
1616static tilemap *bg_tilemap;
src/mame/video/cyberbal.c
r2018r2019
8888
8989static void video_start_cyberbal_common(running_machine* machine, int screens)
9090{
91   static const struct atarimo_desc mo0desc =
91   static const atarimo_desc mo0desc =
9292   {
9393      1,               /* index to which gfx system */
9494      1,               /* number of motion object banks */
r2018r2019
125125      0               /* callback routine for special entries */
126126   };
127127
128   static const struct atarimo_desc mo1desc =
128   static const atarimo_desc mo1desc =
129129   {
130130      1,               /* index to which gfx system */
131131      1,               /* number of motion object banks */
r2018r2019
296296      {
297297         if (((base[3] >> 1) & 7) != playfield_palette_bank[i])
298298         {
299            video_screen_update_partial(update_screen, scanline - 1);
299            if (scanline > 0)
300               video_screen_update_partial(update_screen, scanline - 1);
300301            playfield_palette_bank[i] = (base[3] >> 1) & 7;
301302            tilemap_set_palette_offset(i ? atarigen_playfield2_tilemap : atarigen_playfield_tilemap, playfield_palette_bank[i] << 8);
302303         }
r2018r2019
306307         int newscroll = 2 * (((base[4] >> 7) + 4) & 0x1ff);
307308         if (newscroll != playfield_xscroll[i])
308309         {
309            video_screen_update_partial(update_screen, scanline - 1);
310            if (scanline > 0)
311               video_screen_update_partial(update_screen, scanline - 1);
310312            tilemap_set_scrollx(i ? atarigen_playfield2_tilemap : atarigen_playfield_tilemap, 0, newscroll);
311313            playfield_xscroll[i] = newscroll;
312314         }
r2018r2019
317319         int newscroll = ((base[5] >> 7) - (scanline)) & 0x1ff;
318320         if (newscroll != playfield_yscroll[i])
319321         {
320            video_screen_update_partial(update_screen, scanline - 1);
322            if (scanline > 0)
323               video_screen_update_partial(update_screen, scanline - 1);
321324            tilemap_set_scrolly(i ? atarigen_playfield2_tilemap : atarigen_playfield_tilemap, 0, newscroll);
322325            playfield_yscroll[i] = newscroll;
323326         }
r2018r2019
326329      {
327330         if (current_slip[i] != base[7])
328331         {
329            video_screen_update_partial(update_screen, scanline - 1);
332            if (scanline > 0)
333               video_screen_update_partial(update_screen, scanline - 1);
330334            current_slip[i] = base[7];
331335         }
332336      }
r2018r2019
343347
344348static void update_one_screen(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect)
345349{
346   struct atarimo_rect_list rectlist;
350   atarimo_rect_list rectlist;
347351   rectangle tempclip = *cliprect;
348352   bitmap_t *mobitmap;
349353   int x, y, r, mooffset, temp;
r2018r2019
364368   temp = visarea->max_x;
365369   if (temp > SCREEN_WIDTH)
366370      visarea->max_x /= 2;
367   mobitmap = atarimo_render(screen->machine, (screen == left_screen) ? 0 : 1, cliprect, &rectlist);
371   mobitmap = atarimo_render((screen == left_screen) ? 0 : 1, cliprect, &rectlist);
368372   tempclip.min_x += mooffset;
369373   tempclip.max_x += mooffset;
370374   visarea->max_x = temp;
src/mame/video/badlands.c
r2018r2019
4444
4545VIDEO_START( badlands )
4646{
47   static const struct atarimo_desc modesc =
47   static const atarimo_desc modesc =
4848   {
4949      1,               /* index to which gfx system */
5050      1,               /* number of motion object banks */
r2018r2019
117117
118118VIDEO_UPDATE( badlands )
119119{
120   struct atarimo_rect_list rectlist;
120   atarimo_rect_list rectlist;
121121   bitmap_t *mobitmap;
122122   int x, y, r;
123123
r2018r2019
125125   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0);
126126
127127   /* draw and merge the MO */
128   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
128   mobitmap = atarimo_render(0, cliprect, &rectlist);
129129   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
130130      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
131131      {
src/mame/video/offtwall.c
r2018r2019
3535
3636VIDEO_START( offtwall )
3737{
38   static const struct atarimo_desc modesc =
38   static const atarimo_desc modesc =
3939   {
4040      0,               /* index to which gfx system */
4141      1,               /* number of motion object banks */
r2018r2019
8989
9090VIDEO_UPDATE( offtwall )
9191{
92   struct atarimo_rect_list rectlist;
92   atarimo_rect_list rectlist;
9393   bitmap_t *mobitmap;
9494   int x, y, r;
9595
r2018r2019
9797   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0);
9898
9999   /* draw and merge the MO */
100   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
100   mobitmap = atarimo_render(0, cliprect, &rectlist);
101101   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
102102      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
103103      {
src/mame/video/equites.c
r2018r2019
1/*******************************************************************************
2
3Equites           (c) 1984 Alpha Denshi Co./Sega
4Bull Fighter      (c) 1984 Alpha Denshi Co./Sega
5The Koukouyakyuh  (c) 1985 Alpha Denshi Co.
6Splendor Blast    (c) 1985 Alpha Denshi Co.
7High Voltage      (c) 1985 Alpha Denshi Co.
8
9drivers by Acho A. Tang
10
11*******************************************************************************/
12// Directives
13
141#include "driver.h"
2#include "equites.h"
153
16#define BMPAD 8
17#define BMW_l2 9
18#define FP_PRECISION 20
19#define FP_HALF ((1<<(FP_PRECISION-1))-1)
204
21/******************************************************************************/
22// Imports
5UINT16 *equites_bg_videoram;
236
24extern int equites_id, equites_flip;
7static UINT8 *equites_fg_videoram;
8static tilemap *fg_tilemap, *bg_tilemap;
9static int fg_char_bank;
10static UINT8 bgcolor;
11static UINT16 splndrbt_bg_scrollx, splndrbt_bg_scrolly;
2512
26/******************************************************************************/
27// Locals
2813
29static tilemap *charmap0, *charmap1, *activecharmap, *inactivecharmap;
30static UINT16 *defcharram, *charram0, *charram1, *activecharram, *inactivecharram;
31static UINT8 *dirtybuf;
32static int maskwidth, maskheight, maskcolor;
33static int scrollx, scrolly;
34static int bgcolor[4];
35static rectangle halfclip;
36static struct PRESTEP_TYPE { unsigned sy, fdx; } *prestep;
3714
38/******************************************************************************/
39// Exports
15/*************************************
16 *
17 *  Palette handling
18 *
19 *************************************/
4020
41UINT16 *splndrbt_scrollx, *splndrbt_scrolly;
42
43/******************************************************************************/
44// Initializations
45
46static void video_init_common(running_machine *machine)
47{
48   int i;
49   const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
50
51   // set defaults
52   maskwidth = 8;
53   maskheight = visarea->max_y - visarea->min_y + 1;
54   maskcolor = get_black_pen(machine);
55   scrollx = scrolly = 0;
56   for (i=0; i<4; i++) bgcolor[i] = 0;
57
58   // set uniques
59   switch (equites_id)
60   {
61      case 0x8401:
62         maskwidth = 16;
63      break;
64      case 0x8510:
65         scrollx = 128;
66         scrolly = 8;
67      break;
68      case 0x8511:
69         scrollx = 128;
70         scrolly = 8;
71      break;
72   }
73}
74
75// Equites Hardware
7621PALETTE_INIT( equites )
7722{
78   UINT8 *clut_ptr;
7923   int i;
8024
8125   machine->colortable = colortable_alloc(machine, 256);
8226
83   for (i=0; i<256; i++)
27   for (i = 0; i < 256; i++)
8428      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(pal4bit(color_prom[i]), pal4bit(color_prom[i+0x100]), pal4bit(color_prom[i+0x200])));
8529
86   for (i=0; i<256; i++)
30   // point to the CLUT
31   color_prom += 0x380;
32
33   for (i = 0; i < 256; i++)
8734      colortable_entry_set_value(machine->colortable, i, i);
8835
89   clut_ptr = memory_region(REGION_USER1) + 0x80;
90   for (i=0; i<128; i++)
91      colortable_entry_set_value(machine->colortable, i+0x100, clut_ptr[i]);
36   for (i = 0; i < 0x80; i++)
37      colortable_entry_set_value(machine->colortable, i+0x100, color_prom[i]);
9238}
9339
94static TILE_GET_INFO( equites_charinfo )
95{
96   int tile, color;
97
98   tile_index <<= 1;
99   tile = videoram16[tile_index];
100   color = videoram16[tile_index+1];
101   tile &= 0xff;
102   color &= 0x1f;
103
104   SET_TILE_INFO(0, tile, color, 0);
105}
106
107VIDEO_START( equites )
108{
109   charmap0 = tilemap_create(equites_charinfo, tilemap_scan_cols,  8, 8, 32, 32);
110   tilemap_set_transparent_pen(charmap0, 0);
111   tilemap_set_scrolldx(charmap0, BMPAD, BMPAD);
112   tilemap_set_scrolldy(charmap0, BMPAD, BMPAD);
113
114   video_init_common(machine);
115}
116
117// Splendor Blast Hardware
11840PALETTE_INIT( splndrbt )
11941{
120   UINT8 *prom_ptr;
12142   int i;
12243
12344   machine->colortable = colortable_alloc(machine, 256);
12445
125   for (i=0; i<0x100; i++)
46   for (i = 0; i < 0x100; i++)
12647      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(pal4bit(color_prom[i]), pal4bit(color_prom[i+0x100]), pal4bit(color_prom[i+0x200])));
12748
12849   for (i = 0; i < 0x100; i++)
12950      colortable_entry_set_value(machine->colortable, i, i);
13051
131   prom_ptr = memory_region(REGION_USER1);
132   for (i=0; i<0x80; i++)
133   {
134      colortable_entry_set_value(machine->colortable, i + 0x100, prom_ptr[i] + 0x10);
135      colortable_entry_set_value(machine->colortable, i + 0x180, prom_ptr[i]);
136   }
52   // point to the bg CLUT
53   color_prom += 0x300;
13754
138   prom_ptr += 0x100;
139   for (i=0; i<0x400; i++)
140      colortable_entry_set_value(machine->colortable, i + 0x200, prom_ptr[i]);
55   for (i = 0; i < 0x80; i++)
56      colortable_entry_set_value(machine->colortable, i + 0x100, color_prom[i] + 0x10);
57
58   // point to the sprite CLUT
59   color_prom += 0x100;
60
61   for (i = 0; i < 0x100; i++)
62      colortable_entry_set_value(machine->colortable, i + 0x180, color_prom[i]);
14163}
14264
143static TILE_GET_INFO( splndrbt_char0info )
144{
145   int tile, color;
14665
147   tile_index <<= 1;
148   tile = charram0[tile_index];
149   color = charram0[tile_index+1];
150   tile &= 0xff;
151   color &= 0x3f;
15266
67/*************************************
68 *
69 *  Callbacks for the TileMap code
70 *
71 *************************************/
72
73static TILE_GET_INFO( equites_fg_info )
74{
75   int tile = equites_fg_videoram[2*tile_index];
76   int color = equites_fg_videoram[2*tile_index+1] & 0x1f;
77
15378   SET_TILE_INFO(0, tile, color, 0);
15479   if (color & 0x10)
15580      tileinfo->flags |= TILE_FORCE_LAYER0;
15681}
15782
158static TILE_GET_INFO( splndrbt_char1info )
83static TILE_GET_INFO( splndrbt_fg_info )
15984{
160   int tile, color;
85   int tile = equites_fg_videoram[2*tile_index] + (fg_char_bank << 8);
86   int color = equites_fg_videoram[2*tile_index+1] & 0x3f;
16187
162   tile_index <<= 1;
163   tile = charram1[tile_index];
164   color = charram1[tile_index+1];
165   tile &= 0xff;
166   color &= 0x3f;
167   tile += 0x100;
168
16988   SET_TILE_INFO(0, tile, color, 0);
17089   if (color & 0x10)
17190      tileinfo->flags |= TILE_FORCE_LAYER0;
17291}
17392
174static void splndrbt_video_reset(void)
93static TILE_GET_INFO( equites_bg_info )
17594{
176   memset(spriteram16, 0, spriteram_size);
95   int data = equites_bg_videoram[tile_index];
96   int tile = data & 0x1ff;
97   int color = (data & 0xf000) >> 12;
98   int fxy = (data & 0x0600) >> 9;
17799
178   activecharram = charram0;
179   inactivecharram = charram1;
180
181   activecharmap = charmap0;
182   inactivecharmap = charmap1;
100   SET_TILE_INFO(1, tile, color, TILE_FLIPXY(fxy));
183101}
184102
185static void splndrbt_prestep(
186   struct PRESTEP_TYPE *ps,
187   const rectangle *dst_clip,
188   int src_w, int src_h,
189   int dst_startw, int dst_endw)
103static TILE_GET_INFO( splndrbt_bg_info )
190104{
191   double DA, DB, DC, D0, D1, Dsum;
192   int i, dst_vish;
105   int data = equites_bg_videoram[tile_index];
106   int tile = data & 0x1ff;
107   int color = (data & 0xf800) >> 11;
108   int fxy = (data & 0x0600) >> 9;
193109
194   dst_vish = dst_clip->max_y - dst_clip->min_y;
110   SET_TILE_INFO(1, tile, color, TILE_FLIPXY(fxy));
111   tileinfo->group = color;
112}
195113
196   DA = (double)(src_w << FP_PRECISION) * dst_vish;
197   DB = dst_endw - dst_startw;
198   DC = dst_startw * dst_vish;
199   D1 = 0;
200114
201   for (i=0; i<=dst_vish; i++)
202   {
203      D0 = DA / (DB * i + DC);
204      D1 += D0;
205      ps[i].fdx = (unsigned)D0;
206   }
207115
208   DA = src_w * dst_vish;
209   D0 = src_h;
210   D1 /= 1 << FP_PRECISION;
211   Dsum = 0.5;
116/*************************************
117 *
118 *  Video system start
119 *
120 *************************************/
212121
213   for (i=0; i<=dst_vish; i++)
214   {
215      ps[i].sy = (unsigned)Dsum;
216      Dsum += (DA * D0) / ((DB * i + DC) * D1);
217      //logerror("dst_y=%3u src_y=%3u\n", i, ps[i].sy);
218   }
122VIDEO_START( equites )
123{
124   equites_fg_videoram = auto_malloc(0x800);
125
126   fg_tilemap = tilemap_create(equites_fg_info, tilemap_scan_cols,  8, 8, 32, 32);
127   tilemap_set_transparent_pen(fg_tilemap, 0);
128
129   bg_tilemap = tilemap_create(equites_bg_info, tilemap_scan_rows, 16, 16, 16, 16);
130   tilemap_set_transparent_pen(bg_tilemap, 0);
131   tilemap_set_scrolldx(bg_tilemap, 0, -10);
219132}
220133
221134VIDEO_START( splndrbt )
222135{
223#define BMW (1<<BMW_l2)
224
225   UINT8 *buf8ptr;
226   int i;
227
228136   assert(video_screen_get_format(machine->primary_screen) == BITMAP_FORMAT_INDEXED16);
229137
230   halfclip = *video_screen_get_visible_area(machine->primary_screen);
231   i = halfclip.max_y - halfclip.min_y + 1;
232   halfclip.max_y = halfclip.min_y + (i >> 1) - 1;
138   equites_fg_videoram = auto_malloc(0x800);
233139
234   tmpbitmap = auto_bitmap_alloc(BMW, BMW, video_screen_get_format(machine->primary_screen));
140   fg_tilemap = tilemap_create(splndrbt_fg_info, tilemap_scan_cols,  8, 8, 32, 32);
141   tilemap_set_transparent_pen(fg_tilemap, 0);
142   tilemap_set_scrolldx(fg_tilemap, 8, -8);
235143
236   charmap0 = tilemap_create(splndrbt_char0info, tilemap_scan_cols,  8, 8, 32, 32);
237   tilemap_set_transparent_pen(charmap0, 0);
238   tilemap_set_scrolldx(charmap0, 8, 8);
239   tilemap_set_scrolldy(charmap0, 32, 32);
144   bg_tilemap = tilemap_create(splndrbt_bg_info, tilemap_scan_rows, 16, 16, 32, 32);
145   colortable_configure_tilemap_groups(machine->colortable, bg_tilemap, machine->gfx[1], 0x10);
240146
241   charmap1 = tilemap_create(splndrbt_char1info, tilemap_scan_cols,  8, 8, 32, 32);
242   tilemap_set_transparent_pen(charmap1, 0);
243   tilemap_set_scrolldx(charmap1, 8, 8);
244   tilemap_set_scrolldy(charmap1, 32, 32);
147   fg_char_bank = 0;
148}
245149
246   buf8ptr = auto_malloc(videoram_size * 2);
247   charram0 = (UINT16*)buf8ptr;
248   charram1 = (UINT16*)(buf8ptr + videoram_size);
249150
250   dirtybuf = auto_malloc(0x800);
251   memset(dirtybuf, 1, 0x800);
252151
253   prestep = auto_malloc(i * sizeof(struct PRESTEP_TYPE));
254   splndrbt_prestep(prestep, video_screen_get_visible_area(machine->primary_screen), BMW, 434, 96, 480);
152/*************************************
153 *
154 *  Memory handlers
155 *
156 *************************************/
255157
256   defcharram = videoram16 + videoram_size / 2;
257
258   video_init_common(machine);
259   splndrbt_video_reset();
158READ16_HANDLER(equites_fg_videoram_r)
159{
160   return 0xff00 | equites_fg_videoram[offset];
260161}
261162
262MACHINE_RESET( splndrbt )
163WRITE16_HANDLER(equites_fg_videoram_w)
263164{
264   splndrbt_video_reset();
165   if (ACCESSING_LSB)
166   {
167      equites_fg_videoram[offset] = data & 0xff;
168
169      tilemap_mark_tile_dirty(fg_tilemap, offset>>1);
170   }
265171}
266172
267/******************************************************************************/
268// Realtime Functions
269
270// Equites Hardware
271static void equites_update_clut(running_machine *machine)
173WRITE16_HANDLER(equites_bg_videoram_w)
272174{
273   int i, c;
175   COMBINE_DATA(equites_bg_videoram + offset);
274176
275   /* palette hacks! */
276   c = *bgcolor;
177   tilemap_mark_tile_dirty(bg_tilemap, offset);
178}
277179
278   for (i=0x80; i<0x100; i+=0x08)
279      colortable_entry_set_value(machine->colortable, i, c);
180WRITE16_HANDLER(equites_bgcolor_w)
181{
182   if (ACCESSING_MSB)
183      bgcolor = data >> 8;
280184}
281185
282static void equites_draw_scroll(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
186WRITE16_HANDLER(equites_scrollreg_w)
283187{
284#define TILE_BANKBASE 1
188   if (ACCESSING_LSB)
189      tilemap_set_scrolly(bg_tilemap, 0, data & 0xff);
285190
286   int i, offsx, offsy, skipx, skipy, dispx, dispy, encode, bank, tile, color, fy, fx, fxy, x, y, flipadjx;
191   if (ACCESSING_MSB)
192      tilemap_set_scrollx(bg_tilemap, 0, data >> 8);
193}
287194
288   flipadjx = (equites_flip) ? 10 : 0;
289
290   dispy = scrolly & 0x0f;
291   offsy = scrolly & 0xf0;
292   dispx = (scrollx + flipadjx) & 0x0f;
293   offsx = (scrollx + flipadjx)>>4 & 0xf;
294   if (dispy > 7)
195WRITE16_HANDLER(splndrbt_selchar0_w)
196{
197   if (fg_char_bank != 0)
295198   {
296      offsy += 0x10;
297      dispy -= 0x10;
199      fg_char_bank = 0;
200      tilemap_mark_all_tiles_dirty(fg_tilemap);
298201   }
299   if (dispx > 7)
300   {
301      offsx++;
302      dispx -= 0x10;
303   }
304
305   for (i=0; i<255; i++)
306   {
307      skipx = i & 0x0f;
308      skipy = i & 0xf0;
309      encode = spriteram16_2[((offsy + skipy) & 0xf0) + ((offsx + skipx) & 0x0f)];
310      bank = (encode>>8 & 0x01) + TILE_BANKBASE;
311      tile = encode & 0xff;
312      fxy = encode & 0x0800;
313      color = encode>>12 & 0x0f;
314      fx = (encode & 0x0400) | fxy;
315      fy = (encode & 0x0200) | fxy;
316      x = (skipx<<4) - dispx + BMPAD;
317      y = skipy - dispy + BMPAD;
318
319      drawgfx( bitmap,
320          machine->gfx[bank],
321          tile, color,
322          fx, fy,
323          x, y,
324          cliprect, TRANSPARENCY_NONE, 0);
325   }
326
327#undef TILE_BANKBASE
328202}
329203
330static void equites_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
204WRITE16_HANDLER(splndrbt_selchar1_w)
331205{
332#define SPRITE_BANKBASE 3
333#define SHIFTX -4
334#define SHIFTY 1
335
336   gfx_element *gfx;
337   UINT16 *sptr, *eptr;
338   int encode, bank, tile, color, fy, fx, fxy, absx, absy, sx, sy, flipadjx;
339
340   flipadjx = (equites_flip) ? 8 : 0;
341
342   sptr = spriteram16;
343   eptr = sptr + 0x100;
344   for (; sptr<eptr; sptr+=2)
206   if (fg_char_bank != 1)
345207   {
346      encode = *(sptr + 1);
347      if (encode)
348      {
349         bank = (encode>>8 & 0x01) + SPRITE_BANKBASE;
350         gfx = machine->gfx[bank];
351         tile = encode & 0xff;
352         fxy = encode & 0x800;
353         encode = ~encode & 0xf600;
354         fx = (encode & 0x400) | fxy;
355         fy = (encode & 0x200) | fxy;
356         color = encode>>12 & 0x0f;
357         encode = *sptr;
358         sx = encode>>8 & 0xff;
359         sy = encode & 0xff;
360         absx = (sx + flipadjx + SHIFTX) & 0xff;
361         absy = (sy + SHIFTY) & 0xff;
362         if (absx >= 248) absx -= 256;
363         if (absy >= 248) absy -= 256;
364
365         drawgfx(bitmap,
366            gfx,
367            tile, color,
368            fx, fy,
369            absx + BMPAD, absy + BMPAD,
370            cliprect, TRANSPARENCY_PEN, 0);
371      }
208      fg_char_bank = 1;
209      tilemap_mark_all_tiles_dirty(fg_tilemap);
372210   }
211}
373212
374#undef SHIFTY
375#undef SHIFTX
376#undef SPRITE_BANKBASE
213WRITE16_HANDLER(equites_flip0_w)
214{
215   flip_screen_set(0);
377216}
378217
379VIDEO_UPDATE( equites )
218WRITE16_HANDLER(equites_flip1_w)
380219{
381   equites_update_clut(screen->machine);
382   equites_draw_scroll(screen->machine, bitmap, cliprect);
383   equites_draw_sprites(screen->machine, bitmap, cliprect);
384   plot_box(bitmap, cliprect->min_x, cliprect->min_y, maskwidth, maskheight, maskcolor);
385   plot_box(bitmap, cliprect->max_x-maskwidth+1, cliprect->min_y, maskwidth, maskheight, maskcolor);
386   tilemap_draw(bitmap, cliprect, charmap0, 0, 0);
387   return 0;
220   flip_screen_set(1);
388221}
389222
390// Splendor Blast Hardware
391static void splndrbt_update_clut(running_machine *machine)
223WRITE16_HANDLER(splndrbt_flip0_w)
392224{
393   int c;
225   if (ACCESSING_LSB)
226      flip_screen_set(0);
394227
395   /* palette hacks! */
396   c = *bgcolor;
397
398   switch(equites_id)
399   {
400      case 0x8511:
401         colortable_entry_set_value(machine->colortable, 0x114, c);
402      break;
403   }
228   if (ACCESSING_MSB)
229      bgcolor = data >> 8;
404230}
405231
406static void splndrbt_draw_scroll(running_machine *machine, bitmap_t *bitmap)
232WRITE16_HANDLER(splndrbt_flip1_w)
407233{
408#define TILE_BANKBASE 1
234   if (ACCESSING_LSB)
235      flip_screen_set(1);
236}
409237
410   int data, bank, tile, color, fx, fy, x, y, i;
411
412   for (i=0; i<0x400; i++)
413   if (dirtybuf[i])
414   {
415      dirtybuf[i] = 0;
416
417      x = (i & 0x1f) << 4;
418      y = (i & ~0x1f) >> 1;
419      if (!(data = spriteram16_2[i])) { plot_box(bitmap, x, y, 16, 16, *bgcolor); continue; }
420      tile = data & 0xff;
421      data >>= 8;
422      bank = TILE_BANKBASE;
423      color = data>>3 & 0x1f;
424      bank += data & 1;
425      fx = data & 4;
426      fy = data & 2;
427
428      drawgfx(bitmap,
429         machine->gfx[bank],
430         tile, color,
431         fx, fy,
432         x, y,
433         0, TRANSPARENCY_NONE, 0);
434   }
435
436#undef TILE_BANKBASE
238WRITE16_HANDLER(splndrbt_bg_scrollx_w)
239{
240   COMBINE_DATA(&splndrbt_bg_scrollx);
437241}
438242
439static void splndrbt_slantcopy(
440   bitmap_t *src_bitmap,
441   bitmap_t *dst_bitmap,
442   const rectangle *dst_clip,
443   int src_x, int src_y,
444   unsigned src_w, unsigned src_h,
445   unsigned dst_startw, unsigned dst_endw,
446   struct PRESTEP_TYPE *ps)
243WRITE16_HANDLER(splndrbt_bg_scrolly_w)
447244{
448#define WRAP ((1<<BMW_l2)-1)
245   COMBINE_DATA(&splndrbt_bg_scrolly);
246}
449247
450   int src_center_x = ((src_x + (src_w>>1)) & WRAP) << FP_PRECISION;
451   int dst_pitch, dst_wdiff, dst_visw, dst_vish;
452   int dst_curline;
453248
454   dst_visw = dst_clip->max_x - dst_clip->min_x + 1;
455   dst_vish = dst_clip->max_y - dst_clip->min_y;
456   dst_pitch = dst_bitmap->rowpixels;
249/*************************************
250 *
251 *  Video update
252 *
253 *************************************/
457254
458   dst_wdiff = dst_endw - dst_startw;
255static void equites_draw_sprites_block(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int start, int end)
256{
257   int offs;
459258
460   for (dst_curline = dst_clip->min_y; dst_curline <= dst_clip->max_y; dst_curline++)
259   for (offs = end-2; offs >= start; offs -= 2)
461260   {
462      const UINT16 *src_ptr = BITMAP_ADDR16(src_bitmap, (src_y + ps[dst_curline - dst_clip->min_y].sy) & WRAP, 0);
463      UINT16 *dst_ptr = BITMAP_ADDR16(dst_bitmap, dst_curline, dst_clip->min_x + dst_visw / 2);
464      int dst_xend = dst_startw + (dst_wdiff * (dst_curline - dst_clip->min_y)) / dst_vish;
465      int src_fsx = FP_HALF;
466      int src_fdx = ps[dst_curline - dst_clip->min_y].fdx;
467      int dst_x;
261      int attr = spriteram16[offs + 1];
262      if (!(attr & 0x800))   // disable or x MSB?
263      {
264         int tile = attr & 0x1ff;
265         int fx = ~attr & 0x400;
266         int fy = ~attr & 0x200;
267         int color = (~attr & 0xf000) >> 12;
268         int sx = (spriteram16[offs] & 0xff00) >> 8;
269         int sy = (spriteram16[offs] & 0x00ff);
270         int transmask = colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0);
468271
469      if (dst_xend > dst_visw) dst_xend = dst_visw;
470      dst_xend /= 2;
272         if (flip_screen_get())
273         {
274            sx = 240 - sx;
275            sy = 240 - sy;
276            fx = !fx;
277            fy = !fy;
278         }
471279
472      for (dst_x = 0; dst_x < dst_xend; dst_x++)
473      {
474         dst_ptr[-dst_x - 1] = src_ptr[((src_center_x - src_fsx) >> FP_PRECISION) & WRAP];
475         dst_ptr[dst_x] = src_ptr[((src_center_x + src_fsx) >> FP_PRECISION) & WRAP];
476         src_fsx += src_fdx;
280         // align
281         sx -= 4;
282
283         // sprites are 16x14 centered in a 16x16 square, so skip the first line
284         sy += 1;
285
286         drawgfx(bitmap,machine->gfx[2],
287               tile,
288               color,
289               fx, fy,
290               sx, sy,
291               cliprect, TRANSPARENCY_PENS, transmask);
477292      }
478293   }
479
480#undef WRAP
481294}
482295
483static void splndrbt_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *clip)
296static void equites_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
484297{
485#define SPRITE_BANKBASE 3
486#define FP_ONE 0x10000
487#define SHIFTX 0
488#define SHIFTY 0
298   // note that we draw the sprites in three blocks; in each blocks, sprites at
299   // a lower address have priority. This gives good priorities in gekisou.
300   equites_draw_sprites_block(machine, bitmap, cliprect, 0x000/2, 0x060/2);
301   equites_draw_sprites_block(machine, bitmap, cliprect, 0x0e0/2, 0x100/2);
302   equites_draw_sprites_block(machine, bitmap, cliprect, 0x1a4/2, 0x200/2);
303}
489304
490   gfx_element *gfx;
491   UINT16 *data_ptr;
492   int data, sprite, fx, fy, absx, absy, sx, sy, adjy, scalex, scaley, color, i;
493305
494   gfx = machine->gfx[SPRITE_BANKBASE];
495   data_ptr = spriteram16 + 1;
306/*
307This is (probabbly) the sprite x scaling PROM.
308The layout is strange. Clearly every line os for one xscale setting. However,
309it seems that bytes 0-3 are handled separately from bytes 4-F.
310Also, note that sprites are 30x30, not 32x32.
31100020200 00000000 00000000 00000000
31200020200 01000000 00000000 00000002
31300020200 01000000 01000002 00000002
31400020200 01000100 01000002 00020002
31500020200 01000100 01010202 00020002
31602020201 01000100 01010202 00020002
31702020201 01010100 01010202 00020202
31802020201 01010101 01010202 02020202
31902020201 03010101 01010202 02020203
32002020201 03010103 01010202 03020203
32102020201 03010103 01030302 03020203
32202020201 03010303 01030302 03030203
32303020203 03010303 01030302 03030203
32403020203 03030303 01030302 03030303
32503020203 03030303 03030303 03030303
32603020303 03030303 03030303 03030303
327*/
496328
497   for (i=0; i<0x7e; i+=2)
498   {
499      data = data_ptr[i];
500      if (!data) continue;
329static void splndrbt_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
330{
331   const UINT8 * const xrom = memory_region(REGION_USER2);
332   const UINT8 * const yrom = xrom + 0x100;
333   const gfx_element* const gfx = machine->gfx[2];
334   int offs;
501335
502      fx = data & 0x2000;
503      fy = data & 0x1000;
504      sprite = data & 0x7f;
505      scaley = (data>>8 & 0x0f) + 1;
506      adjy = 0x10 - scaley;
507      scaley = (scaley << 12) + (scaley << 8) - 1;
508      if (scaley > FP_ONE) scaley = FP_ONE;
336   // note that sprites are actually 30x30, contained in 32x32 squares. The outer edge is not used.
509337
510      data = data_ptr[i+1];
511      sx = data & 0xff;
512      absx = (sx + SHIFTX) & 0xff;
513      if (absx >= 252) absx -= 256;
338   for (offs = 0x3f; offs < 0x6f; offs += 2)   // 24 sprites
339   {
340      int data = spriteram16[offs];
341      int fx = (data & 0x2000) >> 13;
342      int fy = (data & 0x1000) >> 12;
343      int tile = data & 0x007f;
344      int scaley = (data & 0x0f00) >> 8;
345      int data2 = spriteram16[offs+1];
346      int color = (data2 & 0x1f00) >> 8;
347      int sx = data2 & 0x00ff;
348      int sy = spriteram16_2[offs+0] & 0x00ff;
349      int scalex = spriteram16_2[offs+1] & 0x000f;
350      int transmask = colortable_get_transpen_mask(machine->colortable, gfx, color, 0);
514351
515      color = data>>8 & 0x1f;
352//      const UINT8 * const xromline = xrom + (scalex << 4);
353      const UINT8 * const yromline = yrom + (scaley << 4) + (15 - scaley);
354      const UINT8* const srcgfx = gfx->gfxdata + tile * gfx->char_modulo;
355      const pen_t *paldata = &machine->pens[gfx->color_base + gfx->color_granularity * color];
356      int x,yy;
516357
517      data = data_ptr[i+0x80];
518      sy = data & 0xff;
519      absy = (-sy + adjy + SHIFTY) & 0xff;
358      sy += 16;
520359
521      data = data_ptr[i+0x81];
522      scalex = (data & 0x0f) + 1;
523      scalex <<= 12;
360      if (flip_screen_get())
361      {
362         // sx NOT inverted
363         fx = fx ^ 1;
364         fy = fy ^ 1;
365      }
366      else
367      {
368         sy = 256 - sy;
369      }
524370
525      drawgfxzoom(bitmap,
526         gfx,
527         sprite, color,
528         fx, fy,
529         absx, absy, clip,
530         TRANSPARENCY_PEN, 0,
531         scalex, scaley);
532   }
371      for (yy = 0; yy <= scaley; ++yy)
372      {
373         int const line = yromline[yy];
374         int yhalf;
533375
534#undef SHIFTY
535#undef SHIFTX
536#undef FP_ONE
537#undef SPRITE_BANKBASE
538}
376         for (yhalf = 0; yhalf < 2; ++yhalf)   // top or bottom half
377         {
378            int const y = yhalf ? sy + 1 + yy : sy - yy;
539379
540VIDEO_UPDATE( splndrbt )
541{
542   splndrbt_update_clut(screen->machine);
543   fillbitmap(bitmap, *bgcolor, &halfclip);
544   splndrbt_draw_scroll(screen->machine, tmpbitmap);
380            if (y >= cliprect->min_y && y <= cliprect->max_y)
381            {
382               for (x = 0; x <= (scalex << 1); ++x)
383               {
384                  int bx = (sx + x) & 0xff;
545385
546   splndrbt_slantcopy(
547      tmpbitmap, bitmap, cliprect,
548      *splndrbt_scrollx + scrollx, *splndrbt_scrolly + scrolly,
549      BMW, 434, 96, 480, prestep);
386                  if (bx >= cliprect->min_x && bx <= cliprect->max_x)
387                  {
388                     int xx = scalex ? (x * 29 + scalex) / (scalex << 1) + 1 : 16;   // FIXME This is wrong. Should use the PROM.
389                     int const offset = (fx ? (31 - xx) : xx) + ((fy ^ yhalf) ? (16 + line) : (15 - line) ) * gfx->line_modulo;
550390
551   tilemap_draw(bitmap, cliprect, charmap1, 0, 0);
552   splndrbt_draw_sprites(screen->machine, bitmap, cliprect);
553   tilemap_draw(bitmap, cliprect, charmap0, 0, 0);
554   return 0;
555}
391                     int pen = srcgfx[offset];
556392
557/******************************************************************************/
558// Memory Handlers
559
560// Equites Hardware
561READ16_HANDLER(equites_spriteram_r)
562{
563   if (*spriteram16 == 0x5555) return (0);
564   return (spriteram16[offset]);
393                     if ((transmask & (1 << pen)) == 0)
394                        *BITMAP_ADDR16(bitmap, y, bx) = paldata[pen];
395                  }
396               }
397            }
398         }
399      }
400   }
565401}
566402
567WRITE16_HANDLER(equites_charram_w)
568{
569   COMBINE_DATA(videoram16 + offset);
570403
571   tilemap_mark_tile_dirty(charmap0, offset>>1);
572}
573
574WRITE16_HANDLER(equites_bgcolor_w)
404static void splndrbt_copy_bg(bitmap_t *dst_bitmap, const rectangle *cliprect)
575405{
576   if (!ACCESSING_MSB) return;
406   bitmap_t * const src_bitmap = tilemap_get_pixmap(bg_tilemap);
407   bitmap_t * const flags_bitmap = tilemap_get_flagsmap(bg_tilemap);
408   const UINT8 * const xrom = memory_region(REGION_USER1);
409   const UINT8 * const yrom = xrom + 0x2000;
410   int scroll_x = splndrbt_bg_scrollx;
411   int scroll_y = splndrbt_bg_scrolly;
412   int const dinvert = flip_screen_get() ? 0xff : 0x00;
413   int src_y = 0;
414   int dst_y;
577415
578   data >>= 8;
416   if (flip_screen_get())
417   {
418      scroll_x = -scroll_x - 8;
419      scroll_y = -scroll_y;
420   }
579421
580   switch (equites_id)
422   for (dst_y = 32; dst_y < 256-32; ++dst_y)
581423   {
582      case 0x8400:
583         if (!data) bgcolor[0] = 0;
584         else if (data==0x0e) bgcolor[0] = bgcolor[2];
585         else
424      if (dst_y >= cliprect->min_y && dst_y <= cliprect->max_y)
425      {
426         const UINT8 * const romline = &xrom[(dst_y ^ dinvert) << 5];
427         const UINT16 * const src_line = BITMAP_ADDR16(src_bitmap, (src_y + scroll_y) & 0x1ff, 0);
428         const UINT8 * const flags_line = BITMAP_ADDR8(flags_bitmap, (src_y + scroll_y) & 0x1ff, 0);
429         UINT16 * const dst_line = BITMAP_ADDR16(dst_bitmap, dst_y, 0);
430         int dst_x = 0;
431         int src_x;
432
433         for (src_x = 0; src_x < 256 && dst_x < 128; ++src_x)
586434         {
587            bgcolor[2] = bgcolor[1];
588            bgcolor[1] = bgcolor[0] = data;
435            if ((romline[31 - (src_x >> 3)] >> (src_x & 7)) & 1)
436            {
437               int sx;
438
439               sx = (256+128 + scroll_x + src_x) & 0x1ff;
440               if (flags_line[sx] & TILEMAP_PIXEL_LAYER0)
441                  dst_line[128 + dst_x] = src_line[sx];
442
443               sx = (255+128 + scroll_x - src_x) & 0x1ff;
444               if (flags_line[sx] & TILEMAP_PIXEL_LAYER0)
445                  dst_line[127 - dst_x] = src_line[sx];
446
447               ++dst_x;
448            }
589449         }
590      break;
591      default:
592         *bgcolor = data;
450      }
451
452      src_y += 1 + yrom[dst_y ^ dinvert];
593453   }
594454}
595455
596WRITE16_HANDLER(equites_scrollreg_w)
597{
598   if (ACCESSING_LSB) scrolly = data & 0xff;
599   if (ACCESSING_MSB) scrollx = data >> 8;
600}
601456
602// Splendor Blast Hardware
603WRITE16_HANDLER(splndrbt_selchar0_w)
604{
605   activecharram = charram0;
606   inactivecharram = charram1;
607457
608   activecharmap = charmap0;
609   inactivecharmap = charmap1;
610}
611
612WRITE16_HANDLER(splndrbt_selchar1_w)
458VIDEO_UPDATE( equites )
613459{
614   activecharram = charram1;
615   inactivecharram = charram0;
460   fillbitmap(bitmap, bgcolor, cliprect);
616461
617   activecharmap = charmap1;
618   inactivecharmap = charmap0;
619}
462   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
620463
621WRITE16_HANDLER(splndrbt_charram_w)
622{
623   int oddoffs = offset | 1;
464   equites_draw_sprites(screen->machine, bitmap, cliprect);
624465
625   COMBINE_DATA(videoram16 + offset);
626   COMBINE_DATA(defcharram + offset);
466   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
627467
628   if (data==0x20 && !(offset&1))
629   {
630      activecharram[offset] = inactivecharram[offset] = 0x20;
631      activecharram[oddoffs] = inactivecharram[oddoffs] = 0x08;
632      offset >>= 1;
633      tilemap_mark_tile_dirty(activecharmap, offset);
634      tilemap_mark_tile_dirty(activecharmap, oddoffs);
635      tilemap_mark_tile_dirty(inactivecharmap, offset);
636      tilemap_mark_tile_dirty(inactivecharmap, oddoffs);
637   }
638   else
639   {
640      COMBINE_DATA(activecharram + offset);
641      tilemap_mark_tile_dirty(activecharmap, offset>>1);
642   }
468   return 0;
643469}
644470
645READ16_HANDLER(splndrbt_bankedchar_r)
471VIDEO_UPDATE( splndrbt )
646472{
647   if (defcharram[offset|1]==0x3f) return(0);
648   return(defcharram[offset]);
649}
473   fillbitmap(bitmap, bgcolor, cliprect);
650474
651WRITE16_HANDLER(splndrbt_bankedchar_w)
652{
653   COMBINE_DATA(defcharram + offset);
654   COMBINE_DATA(activecharram + offset);
655   inactivecharram[offset&~1] = 0x20;
656   inactivecharram[offset|1] = 0x08;
657   offset >>= 1;
658   tilemap_mark_tile_dirty(activecharmap, offset);
659   tilemap_mark_tile_dirty(inactivecharmap, offset);
660}
475   splndrbt_copy_bg(bitmap, cliprect);
661476
662WRITE16_HANDLER(splndrbt_scrollram_w)
663{
664   COMBINE_DATA(spriteram16_2 + offset);
665   dirtybuf[offset] = 1;
666}
477   if (fg_char_bank)
478      tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
667479
668#ifdef UNUSED_FUNCTION
669WRITE16_HANDLER(splndrbt_bgcolor_w)
670{
671   data >>= 8;
480   splndrbt_draw_sprites(screen->machine, bitmap, cliprect);
672481
673   if (ACCESSING_MSB && *bgcolor != data)
674   {
675      *bgcolor = data;
676      memset(dirtybuf, 1, 0x400);
677   }
678}
679#endif
482   if (!fg_char_bank)
483      tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
680484
681/******************************************************************************/
485   return 0;
486}
src/mame/video/klax.c
r2018r2019
3535
3636VIDEO_START( klax )
3737{
38   static const struct atarimo_desc modesc =
38   static const atarimo_desc modesc =
3939   {
4040      1,               /* index to which gfx system */
4141      1,               /* number of motion object banks */
r2018r2019
101101
102102VIDEO_UPDATE( klax )
103103{
104   struct atarimo_rect_list rectlist;
104   atarimo_rect_list rectlist;
105105   bitmap_t *mobitmap;
106106   int x, y, r;
107107
r2018r2019
109109   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0);
110110
111111   /* draw and merge the MO */
112   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
112   mobitmap = atarimo_render(0, cliprect, &rectlist);
113113   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
114114      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
115115      {
src/mame/video/thunderj.c
r2018r2019
6767
6868VIDEO_START( thunderj )
6969{
70   static const struct atarimo_desc modesc =
70   static const atarimo_desc modesc =
7171   {
7272      1,               /* index to which gfx system */
7373      1,               /* number of motion object banks */
r2018r2019
154154
155155VIDEO_UPDATE( thunderj )
156156{
157   struct atarimo_rect_list rectlist;
157   atarimo_rect_list rectlist;
158158   bitmap_t *mobitmap;
159159   int x, y, r;
160160
r2018r2019
170170   tilemap_draw(bitmap, cliprect, atarigen_playfield2_tilemap, 3, 0x8c);
171171
172172   /* draw and merge the MO */
173   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
173   mobitmap = atarimo_render(0, cliprect, &rectlist);
174174   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
175175      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
176176      {
src/mame/video/atarigx2.c
r2018r2019
179179         int newbank = (word >> 16) & 0x1f;
180180         if (newscroll != playfield_xscroll)
181181         {
182            video_screen_update_partial(screen, scanline + i - 1);
182            if (scanline + i > 0)
183               video_screen_update_partial(screen, scanline + i - 1);
183184            tilemap_set_scrollx(atarigen_playfield_tilemap, 0, newscroll);
184185            playfield_xscroll = newscroll;
185186         }
186187         if (newbank != playfield_color_bank)
187188         {
188            video_screen_update_partial(screen, scanline + i - 1);
189            if (scanline + i > 0)
190               video_screen_update_partial(screen, scanline + i - 1);
189191            tilemap_mark_all_tiles_dirty(atarigen_playfield_tilemap);
190192            playfield_color_bank = newbank;
191193         }
r2018r2019
197199         int newbank = word & 15;
198200         if (newscroll != playfield_yscroll)
199201         {
200            video_screen_update_partial(screen, scanline + i - 1);
202            if (scanline + i > 0)
203               video_screen_update_partial(screen, scanline + i - 1);
201204            tilemap_set_scrolly(atarigen_playfield_tilemap, 0, newscroll);
202205            playfield_yscroll = newscroll;
203206         }
204207         if (newbank != playfield_tile_bank)
205208         {
206            video_screen_update_partial(screen, scanline + i - 1);
209            if (scanline + i > 0)
210               video_screen_update_partial(screen, scanline + i - 1);
207211            tilemap_mark_all_tiles_dirty(atarigen_playfield_tilemap);
208212            playfield_tile_bank = newbank;
209213         }
src/mame/video/relief.c
r2018r2019
4545
4646VIDEO_START( relief )
4747{
48   static const struct atarimo_desc modesc =
48   static const atarimo_desc modesc =
4949   {
5050      1,               /* index to which gfx system */
5151      1,               /* number of motion object banks */
r2018r2019
106106
107107VIDEO_UPDATE( relief )
108108{
109   struct atarimo_rect_list rectlist;
109   atarimo_rect_list rectlist;
110110   bitmap_t *mobitmap;
111111   int x, y, r;
112112
r2018r2019
116116   tilemap_draw(bitmap, cliprect, atarigen_playfield2_tilemap, 0, 1);
117117
118118   /* draw and merge the MO */
119   mobitmap = atarimo_render(screen->machine, 0, cliprect, &rectlist);
119   mobitmap = atarimo_render(0, cliprect, &rectlist);
120120   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
121121      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
122122      {
src/mame/video/champbas.c
r2018r2019
1/***************************************************************************
2
3  video.c
4
5  Functions to emulate the video hardware of the machine.
6
7***************************************************************************/
8
91#include "driver.h"
102#include "video/resnet.h"
113
12static UINT8 gfxbank;
4UINT8 *champbas_bg_videoram;
5
6static UINT8 gfx_bank;
137static UINT8 palette_bank;
148
159static tilemap *bg_tilemap;
r2018r2019
4640         2, &resistances_b[0],  bweights, 0, 0);
4741
4842   /* allocate the colortable */
49   machine->colortable = colortable_alloc(machine, 32);
43   machine->colortable = colortable_alloc(machine, 0x20);
5044
5145   /* create a lookup table for the palette */
5246   for (i = 0; i < 0x20; i++)
r2018r2019
7468      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
7569   }
7670
77   /* color_prom now points to the beginning of the lookup table */
78   color_prom += 32;
71   color_prom += 0x20;
7972
80   /* character lookup table - sprites use the same color lookup table as characters */
8173   for (i = 0; i < 0x200; i++)
8274   {
8375      UINT8 ctabentry = ((i & 0x100) >> 4) | (color_prom[i & 0xff] & 0x0f);
r2018r2019
8577   }
8678}
8779
88WRITE8_HANDLER( champbas_videoram_w )
80
81
82
83static TILE_GET_INFO( get_bg_tile_info )
8984{
90   videoram[offset] = data;
91   tilemap_mark_tile_dirty(bg_tilemap, offset);
85   int code = champbas_bg_videoram[tile_index] | (gfx_bank << 8);
86   int color = (champbas_bg_videoram[tile_index + 0x400] & 0x1f) | 0x20 | (palette_bank << 6);
87
88   SET_TILE_INFO(0, code, color, 0);
9289}
9390
94WRITE8_HANDLER( champbas_colorram_w )
91
92
93VIDEO_START( champbas )
9594{
96   colorram[offset] = data;
97   tilemap_mark_tile_dirty(bg_tilemap, offset);
95   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
96
97   // talbot has only 1 bank
98   gfx_bank = 0;
99   palette_bank = 0;
98100}
99101
102
103
104
105WRITE8_HANDLER( champbas_bg_videoram_w )
106{
107   champbas_bg_videoram[offset] = data;
108   tilemap_mark_tile_dirty(bg_tilemap, offset & 0x3ff);
109}
110
100111WRITE8_HANDLER( champbas_gfxbank_w )
101112{
102   if (gfxbank != (data & 0x01))
113   data &= 1;
114   if (gfx_bank != data)
103115   {
104      gfxbank = data & 0x01;
105      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
116      gfx_bank = data;
117      tilemap_mark_all_tiles_dirty(bg_tilemap);
106118   }
107119}
108120
109121WRITE8_HANDLER( champbas_palette_bank_w )
110122{
111   if (palette_bank != (data & 0x01))
123   data &= 1;
124   if (palette_bank != data)
112125   {
113      palette_bank = data & 0x01;
114      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
126      palette_bank = data;
127      tilemap_mark_all_tiles_dirty(bg_tilemap);
115128   }
116129}
117130
118131WRITE8_HANDLER( champbas_flipscreen_w )
119132{
120   if (flip_screen_get() != data)
121   {
122      flip_screen_set(data);
123      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
124   }
133   flip_screen_set(~data & 1);
125134}
126135
127static TILE_GET_INFO( get_bg_tile_info )
128{
129   int code = videoram[tile_index];
130   int color = (palette_bank << 6) | 0x20 | (colorram[tile_index] & 0x1f);
131136
132   SET_TILE_INFO(gfxbank, code, color, 0);
133}
134137
135VIDEO_START( champbas )
136{
137   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,  8, 8, 32, 32);
138}
139
140138static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
141139{
142140   int offs;
141   const gfx_element* const gfx = machine->gfx[1];
143142
144143   for (offs = spriteram_size - 2; offs >= 0; offs -= 2)
145144   {
146      int code = spriteram[offs] >> 2;
147      int color = (palette_bank << 6) | (spriteram[offs + 1] & 0x3f);
148      int flipx = spriteram[offs] & 0x01;
149      int flipy = spriteram[offs] & 0x02;
150      int sx = ((256 + 16 - spriteram_2[offs + 1]) & 0xff) - 16;
151      int sy = spriteram_2[offs] - 16;
145      int code = (spriteram[offs] >> 2) | (gfx_bank << 6);
146      int color = (spriteram[offs + 1] & 0x1f) | (palette_bank << 6);
147      int flipx = ~spriteram[offs] & 0x01;
148      int flipy = ~spriteram[offs] & 0x02;
149      int sx = spriteram_2[offs + 1] - 16;
150      int sy = 255 - spriteram_2[offs];
152151
153      drawgfx(bitmap,
154         machine->gfx[2 + gfxbank],
155         code, color,
156         flipx, flipy,
157         sx, sy,
158         cliprect,
159         TRANSPARENCY_PENS,
160         colortable_get_transpen_mask(machine->colortable, machine->gfx[2 + gfxbank], color, 0));
152      drawgfx(bitmap, gfx,
153            code, color,
154            flipx, flipy,
155            sx, sy,
156            cliprect,
157            TRANSPARENCY_PENS,
158            colortable_get_transpen_mask(machine->colortable, gfx, color, 0));
159
160      // wraparound
161      drawgfx(bitmap, gfx,
162            code, color,
163            flipx, flipy,
164            sx + 256, sy,
165            cliprect,
166            TRANSPARENCY_PENS,
167            colortable_get_transpen_mask(machine->colortable, gfx, color, 0));
161168   }
162169}
163170
171
172
164173VIDEO_UPDATE( champbas )
165174{
166175   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
src/mame/video/cave.c
r2018r2019
125125static int spriteram_bank;
126126static int spriteram_bank_delay;
127127
128static UINT16 *palette_map;
129
128130/***************************************************************************
129131
130132                            Palette Init Routines
r2018r2019
134136
135137***************************************************************************/
136138
139PALETTE_INIT( cave )
140{
141   int maxpen = cave_paletteram_size / 2;
142   int pen;
143
144   /* create a 1:1 palette map covering everything */
145   palette_map = auto_malloc(machine->config->total_colors * sizeof(palette_map[0]));
146   for (pen = 0; pen < machine->config->total_colors; pen++)
147      palette_map[pen] = pen % maxpen;
148}
149
137150PALETTE_INIT( dfeveron )
138151{
139152   int color, pen;
140153
141   /* allocate the colortable */
142   machine->colortable = colortable_alloc(machine, 0x0800);
143
144154   /* Fill the 0-3fff range, used by sprites ($40 color codes * $100 pens)
145155       Here sprites have 16 pens, but the sprite drawing routine always
146156       multiplies the color code by $100 (for consistency).
147157       That's why we need this function.    */
148158
159   PALETTE_INIT_CALL(cave);
160
149161   for (color = 0; color < 0x40; color++)
150162      for (pen = 0; pen < 0x10; pen++)
151         colortable_entry_set_value(machine->colortable, (color << 8) | pen, (color << 4) | pen);
163         palette_map[(color << 8) | pen] = (color << 4) | pen;
152164}
153165
154166PALETTE_INIT( ddonpach )
155167{
156168   int color, pen;
157169
158   /* allocate the colortable */
159   machine->colortable = colortable_alloc(machine, 0x8000);
160
161170   /* Fill the 8000-83ff range ($40 color codes * $10 pens) for
162171       layers 0 & 1 which are 4 bits deep rather than 8 bits deep
163172       like layer 2, but use the first 16 color of every 256 for
164173       any given color code. */
165174
175   PALETTE_INIT_CALL(cave);
176
166177   for (color = 0; color < 0x40; color++)
167178      for (pen = 0; pen < 0x10; pen++)
168         colortable_entry_set_value(machine->colortable, 0x8000 | (color << 4) | pen, 0x4000 | (color << 8) | pen);
179         palette_map[0x8000 | (color << 4) | pen] = 0x4000 | (color << 8) | pen;
169180}
170181
171182PALETTE_INIT( mazinger )
172183{
173184   int color, pen;
174185
175   /* allocate the colortable */
176   machine->colortable = colortable_alloc(machine, 0x4000);
186   PALETTE_INIT_CALL(cave);
177187
178188   /* sprites (encrypted) are 4 bit deep */
179189   for (color = 0; color < 0x40; color++)
180190      for (pen = 0; pen < 0x100; pen++)
181         colortable_entry_set_value(machine->colortable, (color << 8) | pen, (color << 4) + pen);   /* yes, PLUS, not OR */
191         palette_map[(color << 8) | pen] = (color << 4) + pen;   /* yes, PLUS, not OR */
182192
183193   /* layer 0 is 6 bit deep, there are 64 color codes but only $400
184194       colors are actually addressable */
185195   for (color = 0; color < 0x40; color++)
186196      for (pen = 0; pen < 0x40; pen++)
187         colortable_entry_set_value(machine->colortable, 0x4400 | (color << 6) | pen, 0x400 | ((color & 0x0f) << 6) | pen);
197         palette_map[0x4400 | (color << 6) | pen] = 0x400 | ((color & 0x0f) << 6) | pen;
188198}
189199
190200PALETTE_INIT( sailormn )
191201{
192202   int color, pen;
193203
194   /* allocate the colortable */
195   machine->colortable = colortable_alloc(machine, 0x2000);
204   PALETTE_INIT_CALL(cave);
196205
197206   /* sprites (encrypted) are 4 bit deep */
198207   for (color = 0; color < 0x40; color++)
199208      for (pen = 0; pen < 0x100; pen++)
200         colortable_entry_set_value(machine->colortable, (color << 8) | pen, (color << 4) + pen);   /* yes, PLUS, not OR */
209         palette_map[(color << 8) | pen] = (color << 4) + pen;   /* yes, PLUS, not OR */
201210
202211   /* layer 2 is 6 bit deep, there are 64 color codes but only $400
203212       colors are actually addressable */
204213   for (color = 0; color < 0x40; color++)
205214      for (pen = 0; pen < 0x40; pen++)
206         colortable_entry_set_value(machine->colortable, 0x4c00 | (color << 6) | pen, 0xc00 | ((color & 0x0f) << 6) | pen);
215         palette_map[0x4c00 | (color << 6) | pen] = 0xc00 | ((color & 0x0f) << 6) | pen;
207216}
208217
209218PALETTE_INIT( pwrinst2 )
210219{
211220   int color, pen;
212221
213   /* allocate the colortable */
214   machine->colortable = colortable_alloc(machine, 0x2800);
222   PALETTE_INIT_CALL(cave);
215223
216224   for (color = 0; color < 0x80; color++)
217225      for (pen = 0; pen < 0x10; pen++)
218         colortable_entry_set_value(machine->colortable, (color << 8) | pen, (color << 4) | pen);
226         palette_map[(color << 8) | pen] = (color << 4) | pen;
219227
220228   for (pen = 0x8000; pen < 0xa800; pen++)
221         colortable_entry_set_value(machine->colortable, pen, pen - 0x8000);
229         palette_map[pen] = pen - 0x8000;
222230}
223231
224232PALETTE_INIT( korokoro )
225233{
226234   int color, pen;
227235
228   /* allocate the colortable */
229   machine->colortable = colortable_alloc(machine, 0x4000);
236   PALETTE_INIT_CALL(cave);
230237
231238   for (color = 0; color < 0x40; color++)
232239      for (pen = 0; pen < 0x10; pen++)
233         colortable_entry_set_value(machine->colortable, (color << 8) | pen, 0x3c00 | (color << 4) | pen);
240         palette_map[(color << 8) | pen] = 0x3c00 | (color << 4) | pen;
234241}
235242
236243
237244static void set_pens(running_machine *machine)
238245{
239   offs_t i;
246   int pen;
240247
241   for (i = 0; i < cave_paletteram_size / 2; i++)
248   for (pen = 0; pen < machine->config->total_colors; pen++)
242249   {
243      UINT16 data = paletteram16[i];
250      UINT16 data = paletteram16[palette_map[pen]];
244251
245252      rgb_t color = MAKE_RGB(pal5bit(data >> 5), pal5bit(data >> 10), pal5bit(data >> 0));
246253
247      if (machine->colortable != NULL)
248         colortable_palette_set_color(machine->colortable, i, color);
249      else
250         palette_set_color(machine, i, color);
254      palette_set_color(machine, pen, color);
251255   }
252256}
253257
r2018r2019
427431
428432static void cave_vh_start(running_machine *machine, int num)
429433{
434   assert(palette_map != NULL);
435
430436   tilemap_0 = 0;
431437   tilemap_1 = 0;
432438   tilemap_2 = 0;
src/mame/video/atarigt.c
r2018r2019
244244         int newbank = (word >> 16) & 0x1f;
245245         if (newscroll != playfield_xscroll)
246246         {
247            video_screen_update_partial(screen, scanline + i - 1);
247            if (scanline + i > 0)
248               video_screen_update_partial(screen, scanline + i - 1);
248249            tilemap_set_scrollx(atarigen_playfield_tilemap, 0, newscroll);
249250            playfield_xscroll = newscroll;
250251         }
251252         if (newbank != playfield_color_bank)
252253         {
253            video_screen_update_partial(screen, scanline + i - 1);
254            if (scanline + i > 0)
255               video_screen_update_partial(screen, scanline + i - 1);
254256            tilemap_set_palette_offset(atarigen_playfield_tilemap, (newbank & 0x1f) << 8);
255257            playfield_color_bank = newbank;
256258         }
r2018r2019
262264         int newbank = word & 15;
263265         if (newscroll != playfield_yscroll)
264266         {
265            video_screen_update_partial(screen, scanline + i - 1);
267            if (scanline + i > 0)
268               video_screen_update_partial(screen, scanline + i - 1);
266269            tilemap_set_scrolly(atarigen_playfield_tilemap, 0, newscroll);
267270            playfield_yscroll = newscroll;
268271         }
269272         if (newbank != playfield_tile_bank)
270273         {
271            video_screen_update_partial(screen, scanline + i - 1);
274            if (scanline + i > 0)
275               video_screen_update_partial(screen, scanline + i - 1);
272276            tilemap_mark_all_tiles_dirty(atarigen_playfield_tilemap);
273277            playfield_tile_bank = newbank;
274278         }
src/mame/video/exctsccr.c
r2018r2019
1/***************************************************************************
2
3  video.c
4
5  Functions to emulate the video hardware of the machine.
6
7***************************************************************************/
8
91#include "driver.h"
102
113static int gfx_bank;
r2018r2019
5547   color_prom += 0x20;
5648
5749   /* characters */
58   for (i = 0; i < 0x80; i++)
50   for (i = 0; i < 0x100; i++)
5951   {
6052      int swapped_i = BITSWAP8(i,2,7,6,5,4,3,1,0);
6153      UINT8 ctabentry = color_prom[0x100 + swapped_i];
6254      colortable_entry_set_value(machine->colortable, i, ctabentry);
6355   }
64
6556   /* sprites */
66   for (i = 0; i < 0xf0; i++)
67   {
68      if ((i & 0x08) == 0)
69      {
70         int swapped_i = BITSWAP8(i,3,7,6,5,4,2,1,0);
71         UINT8 ctabentry = color_prom[i] | 0x10;
72         colortable_entry_set_value(machine->colortable, swapped_i + 0x80, ctabentry);
73      }
74   }
75
76   for (i = 0xf0; i < 0x100; i++)
77   {
78      if (i & 0x08)
79      {
80         int swapped_i = BITSWAP8(i,3,7,6,5,4,2,1,0);
81         UINT8 ctabentry = color_prom[i] | 0x10;
82         colortable_entry_set_value(machine->colortable, swapped_i + 0x80, ctabentry);
83      }
84   }
85
8657   for (i = 0x80; i < 0x100; i++)
8758   {
8859      int swapped_i = BITSWAP8(i,2,7,6,5,4,3,1,0);
8960      UINT8 ctabentry = color_prom[0x100 + swapped_i] | 0x10;
90      colortable_entry_set_value(machine->colortable, i + 0x80, ctabentry);
61      colortable_entry_set_value(machine->colortable, i, ctabentry);
9162   }
9263
93   /* patch for goalkeeper - but of course, this is totally wrong */
94   colortable_entry_set_value(machine->colortable, 0x80+(0x1d*8)+7, 0x10);
64   /* sprites */
65   for (i = 0; i < 0x100; i++)
66   {
67      UINT8 ctabentry = color_prom[i] | 0x10;
68      colortable_entry_set_value(machine->colortable, i + 0x100, ctabentry);
69   }
9570}
9671
97static TIMER_CALLBACK( exctsccr_fm_callback )
98{
99   cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0xff );
100}
101
10272WRITE8_HANDLER( exctsccr_videoram_w )
10373{
10474   videoram[offset] = data;
r2018r2019
11383
11484WRITE8_HANDLER( exctsccr_gfx_bank_w )
11585{
116   if (gfx_bank != (data & 0x01))
86   data &= 0x01;
87   if (gfx_bank != data)
11788   {
118      gfx_bank = data & 0x01;
89      gfx_bank = data;
11990      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
12091   }
12192}
12293
12394WRITE8_HANDLER( exctsccr_flipscreen_w )
12495{
125   if (flip_screen_get() != data)
126   {
127      flip_screen_set(data);
128      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
129   }
96   flip_screen_set(data & 0x01);
13097}
13198
13299static TILE_GET_INFO( get_bg_tile_info )
133100{
134101   int code = videoram[tile_index];
135
136   /* ZV 02052008 - this used to be "& 0x1f," but that's not supported by the
137       color PROM decoding, so I am using 0x0f.  I don't see any glitches */
138102   int color = colorram[tile_index] & 0x0f;
139103
140   SET_TILE_INFO(gfx_bank, code, color, 0);
104   SET_TILE_INFO(0, code + (gfx_bank << 8), color, 0);
141105}
142106
143107VIDEO_START( exctsccr )
144108{
145109   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
146110       8, 8, 32, 32);
147
148   timer_pulse(ATTOTIME_IN_HZ(75), NULL, 0, exctsccr_fm_callback); /* updates fm */
149111}
150112
151113static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
r2018r2019
156118   OBJ1 = videoram;
157119   OBJ2 = &(spriteram[0x20]);
158120
159   for ( offs = 0x0e; offs >= 0; offs -= 2 ) {
121   for ( offs = 0x0e; offs >= 0; offs -= 2 )
122   {
160123      int sx,sy,code,bank,flipx,flipy,color;
161124
162125      sx = 256 - OBJ2[offs+1];
r2018r2019
165128      code = ( OBJ1[offs] >> 2 ) & 0x3f;
166129      flipx = ( OBJ1[offs] ) & 0x01;
167130      flipy = ( OBJ1[offs] ) & 0x02;
168      color = ( OBJ1[offs+1] ) & 0x1f;
169      bank = 2;
170      bank += ( ( OBJ1[offs+1] >> 4 ) & 1 );
131      color = ( OBJ1[offs+1] ) & 0x0f;
132      bank = ( ( OBJ1[offs+1] >> 4 ) & 1 );
171133
172      drawgfx(bitmap,machine->gfx[bank],
173            code,
134      drawgfx(bitmap,machine->gfx[1],
135            code + (bank << 6),
174136            color,
175137            flipx, flipy,
176138            sx,sy,
r2018r2019
181143   OBJ1 = spriteram_2;
182144   OBJ2 = spriteram;
183145
184   for ( offs = 0x0e; offs >= 0; offs -= 2 ) {
185      int sx,sy,code,bank,flipx,flipy,color;
146   for ( offs = 0x0e; offs >= 0; offs -= 2 )
147   {
148      int sx,sy,code,flipx,flipy,color;
186149
187150      sx = 256 - OBJ2[offs+1];
188151      sy = OBJ2[offs] - 16;
r2018r2019
190153      code = ( OBJ1[offs] >> 2 ) & 0x3f;
191154      flipx = ( OBJ1[offs] ) & 0x01;
192155      flipy = ( OBJ1[offs] ) & 0x02;
193      color = ( OBJ1[offs+1] ) & 0x1f;
194      bank = 3;
156      color = ( OBJ1[offs+1] ) & 0x0f;
195157
196      if ( color == 0 )
197         continue;
198
199      if ( color < 0x10 )
200         bank++;
201
202      if ( color > 0x10 && color < 0x17 )
203      {
204         drawgfx(bitmap,machine->gfx[4],
205            code,
206            0x0e,
207            flipx, flipy,
208            sx,sy,
209            cliprect,
210            TRANSPARENCY_PEN,0);
211
212         color += 6;
213      }
214
215      if ( color==0x1d && gfx_bank==1 )
216      {
217         drawgfx(bitmap,machine->gfx[3],
218            code,
219            color,
220            flipx, flipy,
221            sx,sy,
222            cliprect,
223            TRANSPARENCY_PEN,0);
224
225         drawgfx(bitmap,machine->gfx[4],
226            code,
227            color,
228            flipx, flipy,
229            sx,sy,
230            cliprect,
231            TRANSPARENCY_PENS,
232            colortable_get_transpen_mask(machine->colortable, machine->gfx[4], color, 0x10));
233
234      }
235      else
236      {
237         drawgfx(bitmap,machine->gfx[bank],
238               code,
239               color,
240               flipx, flipy,
241               sx,sy,
242               cliprect,
243               TRANSPARENCY_PEN,0);
244      }
158      drawgfx(bitmap,machine->gfx[2],
159         code,
160         color,
161         flipx, flipy,
162         sx,sy,
163         cliprect,
164         TRANSPARENCY_PENS,
165         colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0x10));
245166   }
246167}
247168
169
170
248171VIDEO_UPDATE( exctsccr )
249172{
250173   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
src/mame/layout/gorf.lay
r0r2019
1<mamelayout version="2">
2   <element name="white">
3      <rect>
4         <color red="1.0" green="1.0" blue="1.0" />
5      </rect>
6   </element>
7   <element name="yellow">
8      <rect>
9         <color red="1.0" green="0.85" blue="0" />
10      </rect>
11   </element>
12   <element name="black">
13      <rect>
14         <color red="0" green="0" blue="0" />
15      </rect>
16   </element>
17   <element name="lamp" defstate="0">
18      <rect state="1">
19         <color red="1.0" green="0.85" blue="0.0" />
20      </rect>
21   </element>
22   <element name="spacetext">
23      <text string="SPACE">
24         <color red="0" green="0" blue="0" />
25      </text>
26   </element>
27   <element name="rank">
28      <text string="SPACE RANK">
29         <color red="0" green="0" blue="0" />
30      </text>
31   </element>
32   <element name="cadet">
33      <text string="CADET">
34         <color red="0" green="0" blue="0" />
35      </text>
36   </element>
37   <element name="captain">
38      <text string="CAPTAIN">
39         <color red="0" green="0" blue="0" />
40      </text>
41   </element>
42   <element name="colonel">
43      <text string="COLONEL">
44         <color red="0" green="0" blue="0" />
45      </text>
46   </element>
47   <element name="general">
48      <text string="GENERAL">
49         <color red="0" green="0" blue="0" />
50      </text>
51   </element>
52   <element name="warrior">
53      <text string="WARRIOR">
54         <color red="0" green="0" blue="0" />
55      </text>
56   </element>
57   <element name="avenger">
58      <text string="AVENGER">
59         <color red="0" green="0" blue="0" />
60      </text>
61   </element>
62   <view name="Lamps">
63      <bounds x="-112" y="0" width="524" height="400" />
64      <screen index="0">
65         <bounds x="0" y="0" width="300" height="400" />
66      </screen>
67      <bezel element="white">
68         <bounds x="324" y="213" width="88" height="180" />
69      </bezel>
70      <bezel element="rank">
71         <bounds x="330" y="214" width="76" height="10" />
72      </bezel>
73      <bezel element="black">
74         <bounds x="328" y="227" width="38" height="50" />
75      </bezel>
76      <bezel element="black">
77         <bounds x="370" y="227" width="38" height="50" />
78      </bezel>
79      <bezel element="black">
80         <bounds x="328" y="283" width="38" height="50" />
81      </bezel>
82      <bezel element="black">
83         <bounds x="370" y="283" width="38" height="50" />
84      </bezel>
85      <bezel element="black">
86         <bounds x="328" y="339" width="38" height="50" />
87      </bezel>
88      <bezel element="black">
89         <bounds x="370" y="339" width="38" height="50" />
90      </bezel>
91      <bezel name="lamp0" element="lamp">
92                  <bounds x="332" y="234" width="30" height="36" />
93      </bezel>
94      <bezel name="lamp1" element="lamp">
95                  <bounds x="374" y="234" width="30" height="36" />
96      </bezel>
97      <bezel name="lamp2" element="lamp">
98                  <bounds x="332" y="290" width="30" height="36" />
99      </bezel>
100      <bezel name="lamp3" element="lamp">
101                  <bounds x="374" y="290" width="30" height="36" />
102      </bezel>
103      <bezel name="lamp4" element="lamp">
104                  <bounds x="332" y="346" width="30" height="36" />
105      </bezel>
106      <bezel name="lamp5" element="lamp">
107                  <bounds x="374" y="346" width="30" height="36" />
108      </bezel>
109      <bezel element="yellow">
110                  <bounds x="332" y="234" width="30" height="36" />
111         <color alpha=".5" />
112      </bezel>
113      <bezel element="yellow">
114                  <bounds x="374" y="234" width="30" height="36" />
115         <color alpha=".5" />
116      </bezel>
117      <bezel element="yellow">
118                  <bounds x="332" y="290" width="30" height="36" />
119         <color alpha=".5" />
120      </bezel>
121      <bezel element="yellow">
122                  <bounds x="374" y="290" width="30" height="36" />
123         <color alpha=".5" />
124      </bezel>
125      <bezel element="yellow">
126                  <bounds x="332" y="346" width="30" height="36" />
127         <color alpha=".5" />
128      </bezel>
129      <bezel element="yellow">
130                  <bounds x="374" y="346" width="30" height="36" />
131         <color alpha=".5" />
132      </bezel>
133      <bezel element="spacetext">
134         <bounds x="332" y="244" width="30" height="7" />
135      </bezel>
136      <bezel element="cadet">
137         <bounds x="332" y="251" width="30" height="7" />
138      </bezel>
139      <bezel element="spacetext">
140         <bounds x="374" y="244" width="30" height="7" />
141      </bezel>
142      <bezel element="captain">
143         <bounds x="374" y="251" width="30" height="7" />
144      </bezel>
145      <bezel element="spacetext">
146         <bounds x="332" y="300" width="30" height="7" />
147      </bezel>
148      <bezel element="colonel">
149         <bounds x="332" y="307" width="30" height="7" />
150      </bezel>
151      <bezel element="spacetext">
152         <bounds x="374" y="300" width="30" height="7" />
153      </bezel>
154      <bezel element="general">
155         <bounds x="374" y="307" width="30" height="7" />
156      </bezel>
157      <bezel element="spacetext">
158         <bounds x="332" y="356" width="30" height="7" />
159      </bezel>
160      <bezel element="warrior">
161         <bounds x="332" y="363" width="30" height="7" />
162      </bezel>
163      <bezel element="spacetext">
164         <bounds x="374" y="356" width="30" height="7" />
165      </bezel>
166      <bezel element="avenger">
167         <bounds x="374" y="363" width="30" height="7" />
168      </bezel>
169   </view>
170</mamelayout>
src/mame/drivers/nycaptor.c
r2018r2019
846846
847847   MDRV_SOUND_ADD(MSM5232, 2000000)
848848   MDRV_SOUND_CONFIG(msm5232_interface)
849   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
849   MDRV_SOUND_ROUTE(0, "mono", 1.0)   // pin 28  2'-1
850   MDRV_SOUND_ROUTE(1, "mono", 1.0)   // pin 29  4'-1
851   MDRV_SOUND_ROUTE(2, "mono", 1.0)   // pin 30  8'-1
852   MDRV_SOUND_ROUTE(3, "mono", 1.0)   // pin 31 16'-1
853   MDRV_SOUND_ROUTE(4, "mono", 1.0)   // pin 36  2'-2
854   MDRV_SOUND_ROUTE(5, "mono", 1.0)   // pin 35  4'-2
855   MDRV_SOUND_ROUTE(6, "mono", 1.0)   // pin 34  8'-2
856   MDRV_SOUND_ROUTE(7, "mono", 1.0)   // pin 33 16'-2
857   // pin 1 SOLO  8'       not mapped
858   // pin 2 SOLO 16'       not mapped
859   // pin 22 Noise Output  not mapped
850860MACHINE_DRIVER_END
851861
852862static MACHINE_DRIVER_START( cyclshtg )
r2018r2019
897907
898908   MDRV_SOUND_ADD(MSM5232, 2000000)
899909   MDRV_SOUND_CONFIG(msm5232_interface)
900   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
910   MDRV_SOUND_ROUTE(0, "mono", 1.0)   // pin 28  2'-1
911   MDRV_SOUND_ROUTE(1, "mono", 1.0)   // pin 29  4'-1
912   MDRV_SOUND_ROUTE(2, "mono", 1.0)   // pin 30  8'-1
913   MDRV_SOUND_ROUTE(3, "mono", 1.0)   // pin 31 16'-1
914   MDRV_SOUND_ROUTE(4, "mono", 1.0)   // pin 36  2'-2
915   MDRV_SOUND_ROUTE(5, "mono", 1.0)   // pin 35  4'-2
916   MDRV_SOUND_ROUTE(6, "mono", 1.0)   // pin 34  8'-2
917   MDRV_SOUND_ROUTE(7, "mono", 1.0)   // pin 33 16'-2
918   // pin 1 SOLO  8'       not mapped
919   // pin 2 SOLO 16'       not mapped
920   // pin 22 Noise Output  not mapped
901921MACHINE_DRIVER_END
902922
903923
r2018r2019
946966
947967   MDRV_SOUND_ADD(MSM5232, 2000000)
948968   MDRV_SOUND_CONFIG(msm5232_interface)
949   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
969   MDRV_SOUND_ROUTE(0, "mono", 1.0)   // pin 28  2'-1
970   MDRV_SOUND_ROUTE(1, "mono", 1.0)   // pin 29  4'-1
971   MDRV_SOUND_ROUTE(2, "mono", 1.0)   // pin 30  8'-1
972   MDRV_SOUND_ROUTE(3, "mono", 1.0)   // pin 31 16'-1
973   MDRV_SOUND_ROUTE(4, "mono", 1.0)   // pin 36  2'-2
974   MDRV_SOUND_ROUTE(5, "mono", 1.0)   // pin 35  4'-2
975   MDRV_SOUND_ROUTE(6, "mono", 1.0)   // pin 34  8'-2
976   MDRV_SOUND_ROUTE(7, "mono", 1.0)   // pin 33 16'-2
977   // pin 1 SOLO  8'       not mapped
978   // pin 2 SOLO 16'       not mapped
979   // pin 22 Noise Output  not mapped
950980MACHINE_DRIVER_END
951981
952982
src/mame/drivers/snowbros.c
r2018r2019
17571757
17581758   MDRV_SOUND_REPLACE("3812", YM2151, 4000000)
17591759   MDRV_SOUND_CONFIG(ym2151_interface)
1760   MDRV_SOUND_ROUTE(0, "mono", 0.20)
1761   MDRV_SOUND_ROUTE(1, "mono", 0.20)
1760   MDRV_SOUND_ROUTE(0, "mono", 0.08)
1761   MDRV_SOUND_ROUTE(1, "mono", 0.08)
17621762
17631763   MDRV_SOUND_REPLACE("oki", OKIM6295, 999900)
17641764   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high)
1765   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
1765   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
17661766MACHINE_DRIVER_END
17671767
17681768
src/mame/drivers/battlnts.c
r2018r2019
102102***************************************************************************/
103103
104104static INPUT_PORTS_START( battlnts )
105   PORT_START   /* DSW #1 */
106   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
105   PORT_START_TAG("DSW1")
106   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:1,2,3,4")
107107   PORT_DIPSETTING(   0x02, DEF_STR( 4C_1C ) )
108108   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
109109   PORT_DIPSETTING(   0x08, DEF_STR( 2C_1C ) )
r2018r2019
120120   PORT_DIPSETTING(   0x0a, DEF_STR( 1C_6C ) )
121121   PORT_DIPSETTING(   0x09, DEF_STR( 1C_7C ) )
122122   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
123   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
123   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW1:5,6,7,8")
124124   PORT_DIPSETTING(   0x20, DEF_STR( 4C_1C ) )
125125   PORT_DIPSETTING(   0x50, DEF_STR( 3C_1C ) )
126126   PORT_DIPSETTING(   0x80, DEF_STR( 2C_1C ) )
r2018r2019
138138   PORT_DIPSETTING(   0x90, DEF_STR( 1C_7C ) )
139139//  PORT_DIPSETTING(    0x00, "Invalid" )
140140
141   PORT_START   /* DSW #2 */
142   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
141   PORT_START_TAG("DSW2")
142   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW2:1,2")
143143   PORT_DIPSETTING(   0x03, "2" )
144144   PORT_DIPSETTING(   0x02, "3" )
145145   PORT_DIPSETTING(   0x01, "5" )
146146   PORT_DIPSETTING(   0x00, "7" )
147   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
147   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SW2:3")
148148   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
149149   PORT_DIPSETTING(   0x04, DEF_STR( Cocktail ) )
150   PORT_DIPNAME( 0x18, 0x10, DEF_STR( Bonus_Life ) )
151   PORT_DIPSETTING(   0x18, "30k and every 70k" )
152   PORT_DIPSETTING(   0x10, "40k and every 80k" )
150   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW2:4,5")
151   PORT_DIPSETTING(   0x18, "30k And Every 70k" )
152   PORT_DIPSETTING(   0x10, "40k And Every 80k" )
153153   PORT_DIPSETTING(   0x08, "40k" )
154154   PORT_DIPSETTING(   0x00, "50k" )
155   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
155   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:6,7")
156156   PORT_DIPSETTING(   0x60, DEF_STR( Easy ) )
157157   PORT_DIPSETTING(   0x40, DEF_STR( Normal ) )
158158   PORT_DIPSETTING(   0x20, "Difficult" )
159159   PORT_DIPSETTING(   0x00, "Very Difficult" )
160   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
160   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW2:8")
161161   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
162162   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
163163
164   PORT_START   /* COINSW */
164   PORT_START_TAG("DSW3")
165165   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
166166   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
167167   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
168168   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
169169   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
170   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
170   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SW3:1")
171171   PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
172172   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
173   PORT_DIPNAME( 0x40, 0x40, "Upright Controls" )
173   PORT_DIPNAME( 0x40, 0x40, "Upright Controls" )      PORT_DIPLOCATION("SW3:2")
174174   PORT_DIPSETTING(   0x40, DEF_STR( Single ) )
175175   PORT_DIPSETTING(   0x00, DEF_STR( Dual ) )
176   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
176   PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_LOW, "SW3:3" )
177177
178   PORT_START   /* PLAYER 1 INPUTS */
178   PORT_START_TAG("P1")
179179   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
180180   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
181181   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(1)
r2018r2019
183183   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
184184   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
185185   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
186   PORT_DIPNAME( 0x80, 0x80, "Continue limit" )
187   PORT_DIPSETTING(   0x80, "3" )
188   PORT_DIPSETTING(   0x00, "5" )
186   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW3:4")
187   PORT_DIPSETTING(   0x80, "3 Times" )
188   PORT_DIPSETTING(   0x00, "5 Times" )
189189
190   PORT_START   /* PLAYER 2 INPUTS */
190   PORT_START_TAG("P2")
191191   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
192192   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
193193   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(2)
r2018r2019
199199INPUT_PORTS_END
200200
201201static INPUT_PORTS_START( thehustj )
202   PORT_START   /* DSW #1 */
203   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
204   PORT_DIPSETTING(   0x02, DEF_STR( 4C_1C ) )
205   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
206   PORT_DIPSETTING(   0x08, DEF_STR( 2C_1C ) )
207   PORT_DIPSETTING(   0x04, DEF_STR( 3C_2C ) )
208   PORT_DIPSETTING(   0x01, DEF_STR( 4C_3C ) )
209   PORT_DIPSETTING(   0x0f, DEF_STR( 1C_1C ) )
210   PORT_DIPSETTING(   0x03, DEF_STR( 3C_4C ) )
211   PORT_DIPSETTING(   0x07, DEF_STR( 2C_3C ) )
212   PORT_DIPSETTING(   0x0e, DEF_STR( 1C_2C ) )
213   PORT_DIPSETTING(   0x06, DEF_STR( 2C_5C ) )
214   PORT_DIPSETTING(   0x0d, DEF_STR( 1C_3C ) )
215   PORT_DIPSETTING(   0x0c, DEF_STR( 1C_4C ) )
216   PORT_DIPSETTING(   0x0b, DEF_STR( 1C_5C ) )
217   PORT_DIPSETTING(   0x0a, DEF_STR( 1C_6C ) )
218   PORT_DIPSETTING(   0x09, DEF_STR( 1C_7C ) )
219   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
220   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
221   PORT_DIPSETTING(   0x20, DEF_STR( 4C_1C ) )
222   PORT_DIPSETTING(   0x50, DEF_STR( 3C_1C ) )
223   PORT_DIPSETTING(   0x80, DEF_STR( 2C_1C ) )
224   PORT_DIPSETTING(   0x40, DEF_STR( 3C_2C ) )
225   PORT_DIPSETTING(   0x10, DEF_STR( 4C_3C ) )
226   PORT_DIPSETTING(   0xf0, DEF_STR( 1C_1C ) )
227   PORT_DIPSETTING(   0x30, DEF_STR( 3C_4C ) )
228   PORT_DIPSETTING(   0x70, DEF_STR( 2C_3C ) )
229   PORT_DIPSETTING(   0xe0, DEF_STR( 1C_2C ) )
230   PORT_DIPSETTING(   0x60, DEF_STR( 2C_5C ) )
231   PORT_DIPSETTING(   0xd0, DEF_STR( 1C_3C ) )
232   PORT_DIPSETTING(   0xc0, DEF_STR( 1C_4C ) )
233   PORT_DIPSETTING(   0xb0, DEF_STR( 1C_5C ) )
234   PORT_DIPSETTING(   0xa0, DEF_STR( 1C_6C ) )
235   PORT_DIPSETTING(   0x90, DEF_STR( 1C_7C ) )
236//  PORT_DIPSETTING(    0x00, "Invalid" )
202   PORT_INCLUDE( battlnts )
237203
238   PORT_START   /* DSW #2 */
239   PORT_DIPNAME( 0x03, 0x02, "Balls" )
204   PORT_MODIFY("DSW2")
205   PORT_DIPNAME( 0x03, 0x02, "Balls" )               PORT_DIPLOCATION("SW2:1,2")
240206   PORT_DIPSETTING(   0x03, "1" )
241207   PORT_DIPSETTING(   0x02, "2" )
242208   PORT_DIPSETTING(   0x01, "3" )
243209   PORT_DIPSETTING(   0x00, "6" )
244   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
245   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
246   PORT_DIPSETTING(   0x04, DEF_STR( Cocktail ) )
247   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
248   PORT_DIPSETTING(   0x08, DEF_STR( Off ) )
249   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
250   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
251   PORT_DIPSETTING(   0x10, DEF_STR( Off ) )
252   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
253   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
254   PORT_DIPSETTING(   0x60, DEF_STR( Easy ) )
255   PORT_DIPSETTING(   0x40, DEF_STR( Normal ) )
256   PORT_DIPSETTING(   0x20, "Difficult" )
257   PORT_DIPSETTING(   0x00, "Very Difficult" )
258   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
259   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
260   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
210   PORT_DIPNAME( 0x18, 0x18, "Time To Aim" )         PORT_DIPLOCATION("SW2:4,5")
211   PORT_DIPSETTING(   0x18, "25s (Stage 1: 30s)" )
212   PORT_DIPSETTING(   0x10, "20s (Stage 1: 25s)" )
213   PORT_DIPSETTING(   0x08, "17s (Stage 1: 22s)" )
214   PORT_DIPSETTING(   0x00, "15s (Stage 1: 20s)" )
261215
262   PORT_START   /* COINSW */
263   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
264   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
265   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
266   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
267   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
268   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
269   PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
270   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
271   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
272   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
273   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
274   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
216   PORT_MODIFY("DSW3")
217   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW3:2" )
275218
276   PORT_START   /* PLAYER 1 INPUTS */
277   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
278   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
279   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(1)
280   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
281   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
219   PORT_MODIFY("P1")
282220   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
283   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
284   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
285   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
286   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
221   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW3:4" )
287222
288   PORT_START   /* PLAYER 2 INPUTS */
289   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
290   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
291   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(2)
292   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
293   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
223   PORT_MODIFY("P2")
294224   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
295   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
296   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
297225INPUT_PORTS_END
298226
299227
src/mame/drivers/shougi.c
r2018r2019
3232
3333
3434
35TO DO:
36
37------
3835Both games use custom MCU: ALPHA 8201 (42 pin DIP).
3936It's connected to the RAM that is shared with the first CPU.
40CPU controls MCU (probably to run and stop it).
4137
42note: ALPHA 8302 is the MCU used in Exciting Soccer.
43
4438Shougi
4539Alpha Electronics Co. Ltd., 198x
4640
r2018r2019
10498  bit 2 -- 220 ohm resistor --/  \---------------1000 ohm resistor---\
10599  bit 3 -- 1000 ohm resistor--\                                      |
106100  bit 4 -- 470 ohm resistor --+--+--> GREEN                          |
107  bit 5 -- 220 ohm resistor --/  \---------------1000 ohm resistor---+--- 1000 Ohm pullup resistor
101  bit 5 -- 220 ohm resistor --/  \---------------1000 ohm resistor---+--- GND
108102  bit 6 -- 470 ohm resistor --+--+--> BLUE                           |
109103  bit 7 -- 220 ohm resistor --/  \---------------1000 ohm resistor---/
110104
r2018r2019
120114
121115
122116   compute_resistor_weights(0,   255,   -1.0,
123         3,   resistances_rg,   weights_r,   0,   1000+1000,
124         3,   resistances_rg,   weights_g,   0,   1000+1000,
125         2,   resistances_b,   weights_b,   0,   1000+1000);
117         3,   resistances_rg,   weights_r,   1000, 0,
118         3,   resistances_rg,   weights_g,   1000, 0,
119         2,   resistances_b,   weights_b,   1000, 0);
126120
127121   for (i = 0;i < machine->config->total_colors;i++)
128122   {
r2018r2019
154148
155149static VIDEO_UPDATE( shougi )
156150{
157int offs;
151   int offs;
158152
159153   for (offs = 0;offs <0x4000; offs++)
160154   {
r2018r2019
270264
271265   /* 4800-480f connected to the 74LS259, A3 is data line so 4800-4807 write 0, and 4808-480f write 1 */
272266   AM_RANGE(0x4800, 0x4800) AM_WRITE(cpu_shared_ctrl_sub_w)  AM_READ(input_port_2_r)
267   AM_RANGE(0x4801, 0x4801) AM_WRITE(nmi_disable_and_clear_line_w)
268   AM_RANGE(0x4802, 0x4802) AM_NOP
269   AM_RANGE(0x4803, 0x4803) AM_NOP
270   AM_RANGE(0x4804, 0x4804) AM_WRITE(shougi_mcu_halt_off_w)
271   AM_RANGE(0x4807, 0x4807) AM_WRITENOP   //?????? connected to +5v via resistor
273272   AM_RANGE(0x4808, 0x4808) AM_WRITE(cpu_shared_ctrl_main_w)
274   AM_RANGE(0x4801, 0x4801) AM_WRITE(nmi_disable_and_clear_line_w)
275273   AM_RANGE(0x4809, 0x4809) AM_WRITE(nmi_enable_w)
276   AM_RANGE(0x4802, 0x4802) AM_WRITE(SMH_NOP)
277   AM_RANGE(0x480a, 0x480a) AM_WRITE(SMH_NOP)
278   AM_RANGE(0x4803, 0x4803) AM_WRITE(SMH_NOP)
279   AM_RANGE(0x480b, 0x480b) AM_WRITE(SMH_NOP)
280   AM_RANGE(0x4804, 0x4804) AM_WRITE(shougi_mcu_halt_off_w)
274   AM_RANGE(0x480a, 0x480a) AM_NOP
275   AM_RANGE(0x480b, 0x480b) AM_NOP
281276   AM_RANGE(0x480c, 0x480c) AM_WRITE(shougi_mcu_halt_on_w)
282   AM_RANGE(0x4807, 0x4807) AM_WRITE(SMH_NOP)//?????? connected to +5v via resistor
283   AM_RANGE(0x480f, 0x480f) AM_WRITE(SMH_NOP)
277   AM_RANGE(0x480f, 0x480f) AM_NOP
284278
285279   AM_RANGE(0x5000, 0x5000) AM_READ(input_port_0_r)
286   AM_RANGE(0x5800, 0x5800) AM_WRITE(shougi_watchdog_reset_w) AM_READ(input_port_0_r) /* game won't boot if watchdog doesn't work */
280   AM_RANGE(0x5800, 0x5800) AM_READ(input_port_1_r) AM_WRITE(shougi_watchdog_reset_w)   /* game won't boot if watchdog doesn't work */
287281   AM_RANGE(0x6000, 0x6000) AM_WRITE(AY8910_control_port_0_w)
288282   AM_RANGE(0x6800, 0x6800) AM_WRITE(AY8910_write_port_0_w)
289283   AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE(1) /* 2114 x 2 (0x400 x 4bit each) */
290284   AM_RANGE(0x7800, 0x7bff) AM_RAM AM_SHARE(2) /* 2114 x 2 (0x400 x 4bit each) */
291//  AM_RANGE(0x7800, 0x78ff) AM_WRITE(cpu_sharedram_main_w) AM_BASE(&cpu_sharedram)/* sharedram main/sub */
292//  AM_RANGE(0x7800, 0x7bff) AM_READ(cpu_sharedram_r)/* 2114 x 2 (0x400 x 4bit each) */
293285
294286   AM_RANGE(0x8000, 0xffff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)   /* 4116 x 16 (32K) */
295287ADDRESS_MAP_END
r2018r2019
306298}
307299
308300static ADDRESS_MAP_START( readport_sub, ADDRESS_SPACE_IO, 8 )
309   ADDRESS_MAP_GLOBAL_MASK(0xff)
301   ADDRESS_MAP_GLOBAL_MASK( 0x00ff )
310302   AM_RANGE(0x00, 0x00) AM_READ(dummy_r)
311303ADDRESS_MAP_END
312304
r2018r2019
319311   AM_RANGE(0x0000, 0x03ff) AM_RAM AM_SHARE(1)
320312ADDRESS_MAP_END
321313
314
315
322316static INPUT_PORTS_START( shougi )
323   PORT_START   /* Player 1 controls */
324   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START2 )//+-
325   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )//+-
326   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
327   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 )
328   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
329   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
330   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
331   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
317   PORT_START_TAG("PLAYER1")
318   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START2 )
319   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
320   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
321   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
322   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
323   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
324   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
325   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
332326
333   PORT_START   /* Player 2 controls */
334   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_COCKTAIL
335   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_COCKTAIL
336   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
337   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
338   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
339   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
340   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
341   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP  ) PORT_8WAY PORT_COCKTAIL
327   PORT_START_TAG("PLAYER2")
328   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
329   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
330   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
331   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
332   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
333   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
334   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
335   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP  ) PORT_8WAY PORT_PLAYER(2)
342336
343   PORT_START   /* Coin, Start */
344   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )//+
345   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )//?
346   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 )
347   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 )
348   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN3 )
349   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN4 )
350   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START3 )
351   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START4 )
337   // dip switch order is not sequential. Only 2,3,4, and 5 identified.
338   // 1 and 6 missing, with three possible positions (the third available
339   // bit is not a dip switch)
340   PORT_START_TAG("DSW")
341   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
342   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
343   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
344   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
345   PORT_DIPNAME( 0x32, 0x32, "Time" ) PORT_DIPLOCATION("SW:!3,!4,!2")
346   PORT_DIPSETTING(    0x00, "1 Minute" )
347   PORT_DIPSETTING(    0x20, "2 Minutes" )
348   PORT_DIPSETTING(    0x02, "3 Minutes" )
349   PORT_DIPSETTING(    0x22, "4 Minutes" )
350   PORT_DIPSETTING(    0x10, "5 Minutes" )
351   PORT_DIPSETTING(    0x30, "10 Minutes" )
352   PORT_DIPSETTING(    0x12, "20 Minutes" )
353   PORT_DIPSETTING(    0x32, "30 Minutes" )
354   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW:!5")
355   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
356   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
357   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
358   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
359   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
360   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
361   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
362   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
363INPUT_PORTS_END
352364
365static INPUT_PORTS_START( shougi2 )
366   PORT_INCLUDE(shougi)
367
368   PORT_MODIFY("DSW")
369   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:!5")
370   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
371   PORT_DIPSETTING(    0x04, DEF_STR( 1C_1C ) )
353372INPUT_PORTS_END
354373
355374
375
356376static MACHINE_DRIVER_START( shougi )
357377
358378   MDRV_CPU_ADD(Z80,10000000/4)
r2018r2019
369389   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
370390
371391   MDRV_INTERLEAVE(10)
392   MDRV_WATCHDOG_VBLANK_INIT(16)   // assuming it's the same as champbas
372393
373394   /* video hardware */
374395   MDRV_SCREEN_ADD("main", RASTER)
r2018r2019
407428   ROM_LOAD( "7.3h",    0x4000, 0x1000, CRC(7ea8ec4a) SHA1(d3b999a683f49c911871d0ae6bb2022e73e3cfb8) )
408429   /* shougi has one socket empty */
409430
431   ROM_REGION( 0x2000, REGION_CPU3, 0 )
432   ROM_LOAD( "8201.bin", 0x0000, 0x2000, CRC(b77931ac) SHA1(405b02585e80d95a2821455538c5c2c31ce262d1) )
433
410434   ROM_REGION( 0x0020, REGION_PROMS, 0 )
411435   ROM_LOAD( "pr.2l",   0x0000, 0x0020, CRC(cd3559ff) SHA1(a1291b06a8a337943660b2ef62c94c49d58a6fb5) )
412436ROM_END
r2018r2019
426450   ROM_LOAD( "7-2.3h",    0x4000, 0x1000, CRC(5f37ebc6) SHA1(2e5c4c2f455979e2ad2c66c5aa9f4d92194796af) )
427451   ROM_LOAD( "10-2.3l",   0x5000, 0x1000, CRC(a26385fd) SHA1(2adb21bb4f67a378014bc1edda48daca349d17e1) )
428452
453   ROM_REGION( 0x2000, REGION_CPU3, 0 )
454   ROM_LOAD( "8201.bin", 0x0000, 0x2000, CRC(b77931ac) SHA1(405b02585e80d95a2821455538c5c2c31ce262d1) )
455
429456   ROM_REGION( 0x0020, REGION_PROMS, 0 )
430457   ROM_LOAD( "pr.2l",   0x0000, 0x0020, CRC(cd3559ff) SHA1(a1291b06a8a337943660b2ef62c94c49d58a6fb5) )
431458ROM_END
432459
433GAME( 198?, shougi,  0,        shougi,  shougi,  0, ROT0, "Alpha Denshi", "Shougi", GAME_UNEMULATED_PROTECTION )
434GAME( 198?, shougi2, shougi,   shougi,  shougi,  0, ROT0, "Alpha Denshi", "Shougi 2", GAME_UNEMULATED_PROTECTION )
460
461
462GAME( 1982?, shougi,  0,      shougi, shougi,  0, ROT0, "Alpha Denshi Co.", "Shougi", 0 )
463GAME( 1982?, shougi2, shougi, shougi, shougi2, 0, ROT0, "Alpha Denshi Co.", "Shougi 2", 0 )
src/mame/drivers/system1.c
r2018r2019
31613161   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
31623162ROM_END
31633163
3164ROM_START( pitfalla )
3165   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3166   ROM_LOAD( "epr-6505",   0x0000, 0x4000, CRC(b6769739) SHA1(e1b8401c20f77f8ec799b19d7bc94ae4f9ed702f) ) /* encrypted */
3167   ROM_LOAD( "epr-6506",   0x4000, 0x4000, CRC(1ce6aec4) SHA1(69b54c4569ccfb1166a901e7044ae1026db01a82) ) /* encrypted */
3168   ROM_LOAD( "epr6458a.96",   0x8000, 0x4000, CRC(5c30b3e8) SHA1(9048091ebf054d0ba0c6a92520ddfac38a479034) )
3169
3170   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3171   ROM_LOAD( "epr-6462.120",   0x0000, 0x2000, CRC(86bb9185) SHA1(89add2e3784e8f5a20b895fb2c4466bdd6c34b0c) )
3172
3173   ROM_REGION( 0xc000, REGION_GFX1, ROMREGION_DISPOSE )
3174   ROM_LOAD( "epr6474a.62",   0x0000, 0x2000, CRC(9f1711b9) SHA1(c652010a8b19828f81fd101aa1ea781e250c4ec2) )
3175   ROM_LOAD( "epr6473a.61",   0x2000, 0x2000, CRC(8e53b8dd) SHA1(23e04589f2b523d6b8e46d16f40e59685e27f522) )
3176   ROM_LOAD( "epr6472a.64",   0x4000, 0x2000, CRC(e0f34a11) SHA1(b7a96a1867f8bd3cc1251b5fd12991c406e62a37) )
3177   ROM_LOAD( "epr6471a.63",   0x6000, 0x2000, CRC(d5bc805c) SHA1(520afa7617e8dfd09bf469c01ac606a4a3acdc5e) )
3178   ROM_LOAD( "epr6470a.66",   0x8000, 0x2000, CRC(1439729f) SHA1(54ea6ef54be6dcc2a5d00f7f817fd8836a02b3b9) )
3179   ROM_LOAD( "epr6469a.65",   0xa000, 0x2000, CRC(e4ac6921) SHA1(f95e3b368c2c6dbf8265fb314d73019fe7dcce22) )
3180
3181   ROM_REGION( 0x8000, REGION_GFX2, 0 ) /* 32k for sprites data */
3182   ROM_LOAD( "epr6454a.117",   0x0000, 0x4000, CRC(a5d96780) SHA1(e0571f6fd031bbe2d971c3be7b96a017b0ea4be9) )
3183   ROM_LOAD( "epr-6455.05",   0x4000, 0x4000, CRC(32ee64a1) SHA1(21743f78735fc9105fbbfac420bdaa2965b4b56f) )
3184
3185   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
3186   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3187ROM_END
3188
31643189ROM_START( pitfallu )
31653190   ROM_REGION( 0x10000, REGION_CPU1, 0 )
31663191   ROM_LOAD( "epr-6623.116",   0x0000, 0x4000, CRC(bcb47ed6) SHA1(d33421999f899c0a4dc0d4553614c1f5c7027257) )
r2018r2019
49054930GAME( 1984, spatter,  0,        small,    spatter,  spatter,  ROT0,   "Sega",            "Spatter", GAME_SUPPORTS_SAVE )
49064931GAME( 1984, ssanchan, spatter,  small,    spatter,  spatter,  ROT0,   "Sega",            "Sanrin San Chan (Japan)", GAME_SUPPORTS_SAVE )
49074932GAME( 1985, pitfall2, 0,        pitfall2, pitfall2, pitfall2, ROT0,   "Sega",            "Pitfall II (315-5093)", GAME_SUPPORTS_SAVE )
4933GAME( 1985, pitfalla, pitfall2, pitfall2, pitfall2, pitfall2, ROT0,   "Sega",            "Pitfall II (315-5093, Flicky Conversion)", GAME_SUPPORTS_SAVE )
49084934GAME( 1985, pitfallu, pitfall2, pitfall2, pitfallu, 0,        ROT0,   "Sega",            "Pitfall II (not encrypted)", GAME_SUPPORTS_SAVE )
49094935GAME( 1985, seganinj, 0,        system1,  seganinj, seganinj, ROT0,   "Sega",            "Sega Ninja (315-5102)", GAME_SUPPORTS_SAVE )
49104936GAME( 1985, seganinu, seganinj, system1,  seganinj, 0,        ROT0,   "Sega",            "Sega Ninja (not encrypted)", GAME_SUPPORTS_SAVE )
r2018r2019
49354961GAME( 1986, wboy2,    wboy,     system1,  wboy,     wboy2,    ROT0,   "Sega (Escape license)", "Wonder Boy (set 2, 315-5178)", GAME_SUPPORTS_SAVE )
49364962GAME( 1986, wboy2u,   wboy,     system1,  wboy,     0,        ROT0,   "Sega (Escape license)", "Wonder Boy (set 2, not encrypted)", GAME_SUPPORTS_SAVE )
49374963GAME( 1986, wboy3,    wboy,     system1,  wboy3,    hvymetal, ROT0,   "Sega (Escape license)", "Wonder Boy (set 3, 315-5135)", GAME_SUPPORTS_SAVE )
4938GAME( 1986, wboy4,    wboy,     system1,  wboy,     4dwarrio, ROT0,   "Sega (Escape license)", "Wonder Boy (set 4, 315-5162)", GAME_SUPPORTS_SAVE )
4964GAME( 1986, wboy4,    wboy,     system1,  wboy,     4dwarrio, ROT0,   "Sega (Escape license)", "Wonder Boy (315-5162, 4-D Warriors Conversion)", GAME_SUPPORTS_SAVE )
49394965GAME( 1986, wboyu,    wboy,     system1,  wboyu,    0,        ROT0,   "Sega (Escape license)", "Wonder Boy (not encrypted)", GAME_SUPPORTS_SAVE )
49404966GAME( 1986, wboysys2, wboy,     wbml,     wboysys2, wboy,     ROT0,   "Sega (Escape license)", "Wonder Boy (system 2)", GAME_SUPPORTS_SAVE )
49414967GAME( 1986, wbdeluxe, wboy,     system1,  wbdeluxe, 0,        ROT0,   "Sega (Escape license)", "Wonder Boy Deluxe", GAME_SUPPORTS_SAVE )
src/mame/drivers/bfm_sc2.c
r2018r2019
16681668
16691669   PORT_START_TAG("STROBE9")
16701670   PORT_SERVICE_NO_TOGGLE(0x01,IP_ACTIVE_HIGH)
1671   PORT_DIPNAME( 0x02, 0x00, "Coin 1 Inhibit?" ) PORT_DIPLOCATION("DIL:02")
1672   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1673   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )
1674   PORT_DIPNAME( 0x04, 0x00, "Coin 2 Inhibit?" ) PORT_DIPLOCATION("DIL:03")
1675   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1676   PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
1677   PORT_DIPNAME( 0x08, 0x00, "Coin 3 Inhibit?" ) PORT_DIPLOCATION("DIL:04")
1678   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1679   PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
1680   PORT_DIPNAME( 0x10, 0x00, "Coin 4 Inhibit?" ) PORT_DIPLOCATION("DIL:05")
1681   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1682   PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
1671   PORT_DIPNAME( 0x02, 0x00, "Coin 1 Lockout")PORT_DIPLOCATION("DIL:!02")
1672   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1673   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1674   PORT_DIPNAME( 0x04, 0x00, "Coin 2 Lockout")PORT_DIPLOCATION("DIL:!03")
1675   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1676   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1677   PORT_DIPNAME( 0x08, 0x00, "Coin 3 Lockout")PORT_DIPLOCATION("DIL:!04")
1678   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1679   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1680   PORT_DIPNAME( 0x10, 0x00, "Coin 4 Lockout")PORT_DIPLOCATION("DIL:!05")
1681   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1682   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
16831683
16841684   PORT_START_TAG("STROBE10")
1685   PORT_DIPNAME( 0x01, 0x00, "DIL06" ) PORT_DIPLOCATION("DIL:06")
1686   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1687   PORT_DIPSETTING(    0x01, DEF_STR( On  ) )
1688   PORT_DIPNAME( 0x02, 0x02, "Attract mode language" ) PORT_DIPLOCATION("DIL:07")
1685   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "DIL:!06" )
1686   PORT_DIPNAME( 0x02, 0x00, "Attract mode language" ) PORT_DIPLOCATION("DIL:!07")
16891687   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
16901688   PORT_DIPSETTING(    0x02, "Dutch"       )
1691   PORT_DIPNAME( 0x0C, 0x00, "Skill Level" ) PORT_DIPLOCATION("DIL:08,10")
1689   PORT_DIPNAME( 0x0C, 0x00, "Skill Level" ) PORT_DIPLOCATION("DIL:!08,!10")
16921690   PORT_DIPSETTING(    0x00, DEF_STR( Low ) )
16931691   PORT_DIPSETTING(    0x04, "Medium-Low" )
16941692   PORT_DIPSETTING(    0x08, "Medium-High")
16951693   PORT_DIPSETTING(    0x0C, DEF_STR( High ) )
1696   PORT_DIPNAME( 0x10, 0x00, "DIL11" ) PORT_DIPLOCATION("DIL:11")
1697   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1698   PORT_DIPSETTING(    0x10, DEF_STR( On  ) )
1694   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "DIL:!11" )
16991695
17001696   PORT_START_TAG("STROBE11")
1701   PORT_DIPNAME( 0x01, 0x00, "DIL12" ) PORT_DIPLOCATION("DIL:12")
1697   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "DIL:!12" )
1698   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "DIL:!13" )
1699   PORT_DIPNAME( 0x04, 0x00, "Attract mode" ) PORT_DIPLOCATION("DIL:!14")
17021700   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1703   PORT_DIPSETTING(    0x01, DEF_STR( On  ) )
1704   PORT_DIPNAME( 0x02, 0x00, "DIL13" ) PORT_DIPLOCATION("DIL:13")
1705   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1706   PORT_DIPSETTING(    0x02, DEF_STR( On  ) )
1707   PORT_DIPNAME( 0x04, 0x04, "Attract mode" ) PORT_DIPLOCATION("DIL:14")
1708   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
17091701   PORT_DIPSETTING(    0x04, DEF_STR( On  ) )
1710   PORT_DIPNAME( 0x18, 0x00, "Stake" ) PORT_DIPLOCATION("DIL:15,16")
1702   PORT_DIPNAME( 0x18, 0x00, "Stake" ) PORT_DIPLOCATION("DIL:!15,!16")
17111703   PORT_DIPSETTING(    0x00, "4 credits per game"  )
17121704   PORT_DIPSETTING(    0x08, "1 credit  per round" )
17131705   PORT_DIPSETTING(    0x10, "2 credit  per round" )
17141706   PORT_DIPSETTING(    0x18, "4 credits per round" )
1715
17161707INPUT_PORTS_END
17171708
17181709// input ports for golden crown ///////////////////////////////////
17191710
17201711static INPUT_PORTS_START( gldncrwn )
1721   PORT_START_TAG("COINS")
1722    PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("Fl 5.00")
1723   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(3) PORT_NAME("Fl 2.50")
1724   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_IMPULSE(3) PORT_NAME("Fl 1.00")
1712   PORT_INCLUDE( pyramid )
1713
1714   PORT_MODIFY("COINS")
17251715   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN4 ) PORT_IMPULSE(3) PORT_NAME("Fl 0.25")
1726   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1727   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1728   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1729   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1730   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
17311716
1732   PORT_START_TAG("STROBE0")
1733   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
1734   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
1735   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
1736   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1737   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1738   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1739   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1740   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
1741
1742   PORT_START_TAG("STROBE1")
1717   PORT_MODIFY("STROBE1")
17431718   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER)   PORT_NAME( "Collect") PORT_CODE(KEYCODE_C)
17441719   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME( "Reel 1" )
17451720   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME( "Reel 2" )
r2018r2019
17491724   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
17501725   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
17511726
1752   PORT_START_TAG("STROBE2")
1727   PORT_MODIFY("STROBE2")
17531728   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME( "Reel 4" )
17541729   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME( "Reel 5" )
17551730   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME( "Reel 6" )
r2018r2019
17591734   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
17601735   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
17611736
1762   PORT_START_TAG("STROBE3")
1763   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
1764   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
1765   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
1766   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1767   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1768   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1769   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1770   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
1771
1772   PORT_START_TAG("STROBE4")
1773   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_INTERLOCK) PORT_NAME("Cashbox Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE
1774   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_INTERLOCK) PORT_NAME("Front Door") PORT_CODE(KEYCODE_W) PORT_TOGGLE
1775   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER)     PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE
1776   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1777   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1778   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1779   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1780   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
1781
1782   PORT_START_TAG("STROBE5")
1783   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
1784   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
1785   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
1786   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1787   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1788   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1789   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1790   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
1791
1792   PORT_START_TAG("STROBE6")
1793   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
1794   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
1795   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
1796   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1797   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1798   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1799   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1800   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
1801
1802   PORT_START_TAG("STROBE7")
1803   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
1804   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
1805   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
1806   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1807   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1808   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1809   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1810   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
1811
1812   PORT_START_TAG("STROBE8")
1813   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
1814   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
1815   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
1816   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1817   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1818   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1819   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1820   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
1821
1822   PORT_START_TAG("STROBE9")
1823   PORT_SERVICE_NO_TOGGLE(0x01,IP_ACTIVE_HIGH)
1824   PORT_DIPNAME( 0x02, 0x00, "Coin 1 Inhibit?" )PORT_DIPLOCATION("DIL:02")
1825   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1826   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )
1827   PORT_DIPNAME( 0x04, 0x00, "Coin 2 Inhibit?" )PORT_DIPLOCATION("DIL:03")
1828   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1829   PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
1830   PORT_DIPNAME( 0x08, 0x00, "Coin 3 Inhibit?" )PORT_DIPLOCATION("DIL:04")
1831   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1832   PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
1833   PORT_DIPNAME( 0x10, 0x00, "Coin 4 Inhibit?" )PORT_DIPLOCATION("DIL:05")
1834   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1835   PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
1836
1837   PORT_START_TAG("STROBE10")
1838   PORT_DIPNAME( 0x01, 0x00, "Attract mode language" )PORT_DIPLOCATION("DIL:06")
1737   PORT_MODIFY("STROBE10")
1738   PORT_DIPNAME( 0x01, 0x00, "Attract mode language" )PORT_DIPLOCATION("DIL:!06")
18391739   PORT_DIPSETTING(    0x00, "Dutch")
18401740   PORT_DIPSETTING(    0x01, DEF_STR( English ) )
1841   PORT_DIPNAME( 0x02, 0x00, "Max number of spins" )PORT_DIPLOCATION("DIL:07")
1741   PORT_DIPNAME( 0x02, 0x00, "Max number of spins" )PORT_DIPLOCATION("DIL:!07")
18421742   PORT_DIPSETTING(    0x00, "99")
18431743   PORT_DIPSETTING(    0x02, "50")
1844   PORT_DIPNAME( 0x0C, 0x00, "Skill Level" )PORT_DIPLOCATION("DIL:08,10")
1744   PORT_DIPNAME( 0x0C, 0x00, "Skill Level" )PORT_DIPLOCATION("DIL:!08,!10")
18451745   PORT_DIPSETTING(    0x00, DEF_STR( Low ))
18461746   PORT_DIPSETTING(    0x04, "Medium-Low"  )
18471747   PORT_DIPSETTING(    0x08, "Medium-High" )
18481748   PORT_DIPSETTING(    0x0C, DEF_STR( High ) )
1849   PORT_DIPNAME( 0x10, 0x00, "Base Pricing on:" )PORT_DIPLOCATION("DIL:11")
1749   PORT_DIPNAME( 0x10, 0x00, "Base Pricing on:" )PORT_DIPLOCATION("DIL:!11")
18501750   PORT_DIPSETTING(    0x00, "Full Game")
18511751   PORT_DIPSETTING(    0x10, "Individual Rounds")
18521752
1853   PORT_START_TAG("STROBE11")
1854   PORT_DIPNAME( 0x01, 0x01, "Credits required:" )PORT_DIPLOCATION("DIL:12")
1753   PORT_MODIFY("STROBE11")
1754   PORT_DIPNAME( 0x01, 0x00, "Credits required:" )PORT_DIPLOCATION("DIL:!12")
18551755   PORT_DIPSETTING(    0x00, "4 credits per game")PORT_CONDITION("STROBE10",0x10,PORTCOND_EQUALS,0x00)
18561756   PORT_DIPSETTING(    0x01, "2 credits per game")PORT_CONDITION("STROBE10",0x10,PORTCOND_EQUALS,0x00)
18571757   PORT_DIPSETTING(    0x00, "1 credit  per round")PORT_CONDITION("STROBE10",0x10,PORTCOND_EQUALS,0x10)
r2018r2019
18651765              1     1   4 credits per round
18661766 */
18671767
1868   PORT_DIPNAME( 0x02, 0x00, "Attract Mode" )PORT_DIPLOCATION("DIL:13")
1768   PORT_DIPNAME( 0x02, 0x00, "Attract Mode" )PORT_DIPLOCATION("DIL:!13")
18691769   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
18701770   PORT_DIPSETTING(    0x00, DEF_STR( On  ) )
1871   PORT_DIPNAME( 0x04, 0x04, "Time bar" )PORT_DIPLOCATION("DIL:14")
1771   PORT_DIPNAME( 0x04, 0x00, "Time bar" )PORT_DIPLOCATION("DIL:!14")
18721772   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
18731773   PORT_DIPSETTING(    0x00, DEF_STR( On  ) )
1874   PORT_DIPNAME( 0x18, 0x00, "Time bar speed" )PORT_DIPLOCATION("DIL:15,16")
1774   PORT_DIPNAME( 0x18, 0x00, "Time bar speed" )PORT_DIPLOCATION("DIL:!15,!16")
18751775   PORT_DIPSETTING(    0x00, "1 (fast)" )
18761776   PORT_DIPSETTING(    0x08, "2" )
18771777   PORT_DIPSETTING(    0x10, "3" )
18781778   PORT_DIPSETTING(    0x18, "4 (slow)" )
1879
18801779INPUT_PORTS_END
18811780
18821781// input ports for dutch quintoon /////////////////////////////////
18831782
18841783static INPUT_PORTS_START( qntoond )
1885   PORT_START_TAG("COINS")
1886    PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("Fl 5.00")
1784   PORT_INCLUDE( pyramid )
1785
1786   PORT_MODIFY("COINS")
1787   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("Fl 5.00")
18871788   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(3) PORT_NAME("Fl 2.50")
18881789   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_IMPULSE(3) PORT_NAME("Fl 1.00")
1889   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN4 ) PORT_IMPULSE(3) PORT_NAME("Fl 0.25")
1890   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1891   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1892   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1893   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
1790   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN4 ) PORT_IMPULSE(3) PORT_NAME("Fl 0.50")
18941791
1895   PORT_START_TAG("STROBE0")
1896   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
1897   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
1898   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
1899   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1900   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1901   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1902   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1903   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
1904
1905   PORT_START_TAG("STROBE1")
1792   PORT_MODIFY("STROBE1")
19061793   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER)     PORT_NAME("Collect") PORT_CODE(KEYCODE_C)
19071794   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Hand 1" )
19081795   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Hand 2" )
19091796   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Hand 3" )
19101797   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Hand 4" )
1911   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1912   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1913   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
19141798
1915   PORT_START_TAG("STROBE2")
1799   PORT_MODIFY("STROBE2")
19161800   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Hand 5" )
1917   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
19181801   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
19191802   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1920   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1921   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1922   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1923   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
19241803
1925   PORT_START_TAG("STROBE3")
1926   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
1927   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
1928   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
1929   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1930   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1931   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1932   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1933   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
1934
1935   PORT_START_TAG("STROBE4")
1936   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_INTERLOCK) PORT_NAME("Cashbox Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE
1937   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_INTERLOCK) PORT_NAME("Front Door") PORT_CODE(KEYCODE_W) PORT_TOGGLE
1938   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER)     PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE
1939   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1940   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1941   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1942   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1943   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
1944
1945   PORT_START_TAG("STROBE5")
1946   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
1947   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
1948   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
1949   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1950   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1951   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1952   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1953   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
1954
1955   PORT_START_TAG("STROBE6")
1956   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
1957   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
1958   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
1959   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1960   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1961   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1962   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1963   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
1964
1965   PORT_START_TAG("STROBE7")
1966   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
1967   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
1968   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
1969   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1970   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1971   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1972   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1973   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
1974
1975   PORT_START_TAG("STROBE8")
1976   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
1977   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
1978   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
1979   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1980   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
1981   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
1982   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
1983   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
1984
1985   PORT_START_TAG("STROBE9")
1804   PORT_MODIFY("STROBE9")
19861805   PORT_SERVICE_NO_TOGGLE(0x01,IP_ACTIVE_HIGH)
1987   PORT_DIPNAME( 0x02, 0x02, "Fl 0.25 Inhibit?" )PORT_DIPLOCATION("DIL:02")
1988   PORT_DIPSETTING(    0x02, DEF_STR( No ) )
1989   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1990   PORT_DIPNAME( 0x04, 0x04, "Fl 1.00 Inhibit?" )PORT_DIPLOCATION("DIL:03")
1991   PORT_DIPSETTING(    0x04, DEF_STR( No ) )
1992   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1993   PORT_DIPNAME( 0x08, 0x08, "Fl 2.50 Inhibit?" )PORT_DIPLOCATION("DIL:04")
1994   PORT_DIPSETTING(    0x08, DEF_STR( No ) )
1995   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1996   PORT_DIPNAME( 0x10, 0x10, "Fl 5.00 Inhibit?" )PORT_DIPLOCATION("DIL:05")
1997   PORT_DIPSETTING(    0x10, DEF_STR( No ) )
1998   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1806   PORT_DIPNAME( 0x1e, 0x1c, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DIL:!02,!03,!04,!05")
1807   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
1808   PORT_DIPSETTING(    0x02, "C1=2.5 C2=1.25 C3=0.5 C4=2C_0.25C" )
1809   PORT_DIPSETTING(    0x04, "C1=10 C2=5 C3=2 C4=0.5" )
1810   PORT_DIPSETTING(    0x06, "C1=1.5/3.25/5 C2=0.75/1.5/3.25 C3=0.25/0.5/1 C4=3C_0.25C" )
1811   PORT_DIPSETTING(    0x08, "C1=20 C2=10 C3=4 C4=1" )
1812   PORT_DIPSETTING(    0x0a, "C1=2 C2=1 C3=0.25/0.75/1/1.5/2 C4=3C_0.25C 5C_0.5C" )
1813   PORT_DIPSETTING(    0x0c, "C1=5 C2=2.5 C3=1 C4=0.25" )
1814   PORT_DIPSETTING(    0x0e, "C1=1.25 C2=0.5/1.25/1.75 C3=0.25 C4=0.25" )
1815   //PORT_DIPSETTING(    0x10, DEF_STR( Free_Play ) )
1816   PORT_DIPSETTING(    0x12, "C1=3 C2=1.5 C3=0.5 C4=0.25" )
1817   PORT_DIPSETTING(    0x14, "C1=12 C2=6 C3=2 C4=0.5" )
1818   PORT_DIPSETTING(    0x16, "C1=2 C2=1 C3=0.25 C4=3C_0.25C" )
1819   PORT_DIPSETTING(    0x18, "C1=24 C2=12 C3=4 C4=1" )
1820   PORT_DIPSETTING(    0x1a, "C1=2.25/4.75 C2=1/2.25/3.5/4.75/6 C3=0.25/0.75/1/1.5/2 C4=3C_0.25C 5C_0.5C" )
1821   PORT_DIPSETTING(    0x1c, "C1=6 C2=3 C3=1 C4=0.25" )
1822   PORT_DIPSETTING(    0x1e, "C1=1.5 C2=0.75 C3=0.25 C4=4C_0.25C" )
19991823
2000   PORT_START_TAG("STROBE10")
2001   PORT_DIPNAME( 0x01, 0x00, "DIL06" ) PORT_DIPLOCATION("DIL:06")
1824   PORT_MODIFY("STROBE10")
1825   PORT_DIPNAME( 0x01, 0x00, "Coin 1 Lockout")PORT_DIPLOCATION("DIL:!06")
20021826   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2003   PORT_DIPSETTING(    0x01, DEF_STR( On  ) )
2004   PORT_DIPNAME( 0x02, 0x00, "DIL07" ) PORT_DIPLOCATION("DIL:07")
1827   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1828   PORT_DIPNAME( 0x02, 0x00, "Coin 2 Lockout")PORT_DIPLOCATION("DIL:!07")
20051829   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2006   PORT_DIPSETTING(    0x02, DEF_STR( On  ) )
2007   PORT_DIPNAME( 0x04, 0x00, "DIL08" ) PORT_DIPLOCATION("DIL:08")
1830   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1831   PORT_DIPNAME( 0x04, 0x00, "Coin 3 Lockout")PORT_DIPLOCATION("DIL:!08")
20081832   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2009   PORT_DIPSETTING(    0x04, DEF_STR( On  ) )
2010   PORT_DIPNAME( 0x08, 0x00, "DIL09" ) PORT_DIPLOCATION("DIL:10")
1833   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1834   PORT_DIPNAME( 0x08, 0x00, "Coin 4 Lockout")PORT_DIPLOCATION("DIL:!10")
20111835   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2012   PORT_DIPSETTING(    0x08, DEF_STR( On  ) )
2013   PORT_DIPNAME( 0x10, 0x00, "Coin Jam Alarm" )PORT_DIPLOCATION("DIL:11")
1836   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1837   PORT_DIPNAME( 0x10, 0x00, "Coin Jam Alarm" )PORT_DIPLOCATION("DIL:!11")
20141838   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
20151839   PORT_DIPSETTING(    0x10, DEF_STR( On  ) )
20161840
2017   PORT_START_TAG("STROBE11")
2018   PORT_DIPNAME( 0x01, 0x00, "Time bar" )PORT_DIPLOCATION("DIL:12")
1841   PORT_MODIFY("STROBE11")
1842   PORT_DIPNAME( 0x01, 0x00, "Time bar" )PORT_DIPLOCATION("DIL:!12")
20191843   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
20201844   PORT_DIPSETTING(    0x01, DEF_STR( On  ) )
2021   PORT_DIPNAME( 0x02, 0x00, "Clear credits on reset" )PORT_DIPLOCATION("DIL:13")
1845   PORT_DIPNAME( 0x02, 0x00, "Clear credits on reset" )PORT_DIPLOCATION("DIL:!13")
20221846   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
20231847   PORT_DIPSETTING(    0x02, DEF_STR( Yes  ) )
2024   PORT_DIPNAME( 0x04, 0x00, "Attract mode" )PORT_DIPLOCATION("DIL:14")
1848   PORT_DIPNAME( 0x04, 0x00, "Attract mode" )PORT_DIPLOCATION("DIL:!14")
20251849   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
20261850   PORT_DIPSETTING(    0x04, DEF_STR( On  ) )
2027   PORT_DIPNAME( 0x08, 0x00, "Attract mode language" )PORT_DIPLOCATION("DIL:15")
2028   PORT_DIPSETTING(    0x00, "Dutch"    )
2029   PORT_DIPSETTING(    0x08, DEF_STR( English  ) )
2030   PORT_DIPNAME( 0x10, 0x00, "DIL15" ) PORT_DIPLOCATION("DIL:16")
2031   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2032   PORT_DIPSETTING(    0x10, DEF_STR( On  ) )
2033
1851   PORT_DIPNAME( 0x08, 0x00, "Attract mode language" )PORT_DIPLOCATION("DIL:!15")
1852   PORT_DIPSETTING(    0x00, DEF_STR( English  ) )
1853   PORT_DIPSETTING(    0x08, "Dutch"    )
1854   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "DIL:!16" )
20341855INPUT_PORTS_END
20351856
20361857// input ports for UK quintoon ////////////////////////////////////////////
20371858
20381859static INPUT_PORTS_START( quintoon )
2039   PORT_START_TAG("COINS")
1860   PORT_INCLUDE( pyramid )
1861
1862   PORT_MODIFY("COINS")
20401863    PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("10p")
20411864   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(3) PORT_NAME("20p")
20421865   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_IMPULSE(3) PORT_NAME("50p")
20431866   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN4 ) PORT_IMPULSE(3) PORT_NAME("GBP 1.00")
2044   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
2045   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2046   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2047   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
20481867
2049   PORT_START_TAG("STROBE0")
2050   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2051   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2052   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2053   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2054   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2055   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2056   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2057   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2058
2059   PORT_START_TAG("STROBE1")
1868   PORT_MODIFY("STROBE1")
20601869   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER)   PORT_NAME("Collect") PORT_CODE(KEYCODE_C)
20611870   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Hand 1")
20621871   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Hand 2")
20631872   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Hand 3")
20641873   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Hand 4")
2065   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2066   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2067   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
20681874
2069   PORT_START_TAG("STROBE2")
1875   PORT_MODIFY("STROBE2")
20701876   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Hand 5")
20711877   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("?1") PORT_CODE(KEYCODE_U)
20721878   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1)
20731879   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON8) PORT_NAME("?2") PORT_CODE(KEYCODE_I)
20741880   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON9) PORT_NAME("?3") PORT_CODE(KEYCODE_O)
2075   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2076   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2077   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
20781881
2079   PORT_START_TAG("STROBE3")
2080   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2081   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2082   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2083   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2084   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2085   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2086   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2087   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
1882   PORT_MODIFY("STROBE5")
1883   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_SPECIAL) //Payout opto
20881884
2089   PORT_START_TAG("STROBE4")
2090   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_INTERLOCK) PORT_NAME("Cashbox Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE
2091   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_INTERLOCK) PORT_NAME("Front Door") PORT_CODE(KEYCODE_W) PORT_TOGGLE
2092   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER)     PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE
2093   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
2094   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
2095   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2096   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2097   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
1885   PORT_MODIFY("STROBE9")
1886   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "DIL:!02" )
1887   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "DIL:!03" )
1888   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "DIL:!04" )
1889   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "DIL:!05" )
20981890
2099   PORT_START_TAG("STROBE5")//
2100   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
2101   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
2102   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_SPECIAL)//Payout opto
2103   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
2104   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
2105   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2106   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2107   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
2108
2109   PORT_START_TAG("STROBE6")
2110   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2111   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2112   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2113   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2114   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2115   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2116   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2117   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2118
2119   PORT_START_TAG("STROBE7")
2120   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2121   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2122   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2123   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2124   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2125   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2126   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2127   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2128
2129   PORT_START_TAG("STROBE8")
2130   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2131   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2132   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2133   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2134   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2135   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2136   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2137   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2138
2139   PORT_START_TAG("STROBE9")
2140   PORT_SERVICE_NO_TOGGLE(0x01,IP_ACTIVE_HIGH)
2141   PORT_DIPNAME( 0x02, 0x00, "Clear credits on reset?" )PORT_DIPLOCATION("DIL:02")
2142   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2143   PORT_DIPSETTING(    0x02, DEF_STR( Yes  ) )
2144   PORT_DIPNAME( 0x04, 0x00, "DIL03" )PORT_DIPLOCATION("DIL:03")
2145   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2146   PORT_DIPSETTING(    0x04, DEF_STR( On  ) )
2147   PORT_DIPNAME( 0x08, 0x00, "DIL04" )PORT_DIPLOCATION("DIL:04")
2148   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2149   PORT_DIPSETTING(    0x08, DEF_STR( On  ) )
2150   PORT_DIPNAME( 0x10, 0x00, "DIL05" )PORT_DIPLOCATION("DIL:05")
2151   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2152   PORT_DIPSETTING(    0x10, DEF_STR( On  ) )
2153
2154   PORT_START_TAG("STROBE10")
2155   PORT_DIPNAME( 0x01, 0x00, "Coin Lockout")PORT_DIPLOCATION("DIL:06")
2156   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )//Will activate coin lockout when Credit >= 1 Play
1891   PORT_MODIFY("STROBE10")
1892   PORT_DIPNAME( 0x01, 0x00, "Coin Lockout")PORT_DIPLOCATION("DIL:!06")
1893   PORT_DIPSETTING(    0x00, DEF_STR( Off ) ) //Will activate coin lockout when Credit >= 1 Play
21571894   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
2158   PORT_DIPNAME( 0x02, 0x00, "DIL07" )PORT_DIPLOCATION("DIL:07")
2159   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2160   PORT_DIPSETTING(    0x02, DEF_STR( On  ) )
2161   PORT_DIPNAME( 0x04, 0x00, "DIL08" )PORT_DIPLOCATION("DIL:08")
2162   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2163   PORT_DIPSETTING(    0x04, DEF_STR( On  ) )
2164   PORT_DIPNAME( 0x08, 0x00, "DIL10" )PORT_DIPLOCATION("DIL:10")
2165   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2166   PORT_DIPSETTING(    0x08, DEF_STR( On  ) )
2167   PORT_DIPNAME( 0x10, 0x00, "Stake per Game / Jackpot" )PORT_DIPLOCATION("DIL:11")
1895   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "DIL:!07" )
1896   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "DIL:!08" )
1897   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "DIL:!10" )
1898   PORT_DIPNAME( 0x10, 0x00, "Stake per Game / Jackpot" )PORT_DIPLOCATION("DIL:!11")
21681899   PORT_DIPSETTING(    0x00, "20p / 6 Pounds" )
21691900   PORT_DIPSETTING(    0x10, "50p / 20 Pounds" )
21701901
2171   PORT_START_TAG("STROBE11")
2172   PORT_DIPNAME( 0x01, 0x00, "DIL12" )PORT_DIPLOCATION("DIL:12")
2173   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2174   PORT_DIPSETTING(    0x01, DEF_STR( On  ) )
2175   PORT_DIPNAME( 0x02, 0x00, "DIL13" )PORT_DIPLOCATION("DIL:13")
2176   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2177   PORT_DIPSETTING(    0x02, DEF_STR( On  ) )
2178   PORT_DIPNAME( 0x1C, 0x1C, "Target percentage" )PORT_DIPLOCATION("DIL:14,15,16")
1902   PORT_MODIFY("STROBE11")
1903   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "DIL:!12" )
1904   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "DIL:!13" )
1905   PORT_DIPNAME( 0x1C, 0x00, "Target percentage" )PORT_DIPLOCATION("DIL:!14,!15,!16")
21791906   PORT_DIPSETTING(    0x1C, "50%")
21801907   PORT_DIPSETTING(    0x0C, "55%")
21811908   PORT_DIPSETTING(    0x08, "60%")
r2018r2019
21841911   PORT_DIPSETTING(    0x00, "75%")
21851912   PORT_DIPSETTING(    0x04, "80%")
21861913   PORT_DIPSETTING(    0x14, "85%")
2187
21881914INPUT_PORTS_END
21891915
2190// input ports for UK quintoon (older)/////////////////////////////////////
2191
2192static INPUT_PORTS_START( quintono )
2193   PORT_INCLUDE(quintoon)
2194   PORT_MODIFY("STROBE10")
2195   PORT_DIPNAME( 0x10, 0x00, "Stake per Game / Jackpot" )PORT_DIPLOCATION("DIL:11")
2196   PORT_DIPSETTING(    0x00, "20p / 6 Pounds" )
2197   PORT_DIPSETTING(    0x10, "50p / 20 Pounds" )
2198INPUT_PORTS_END
2199
22001916// input ports for slotsnl  ///////////////////////////////////////////////
22011917
22021918static INPUT_PORTS_START( slotsnl )
2203   PORT_START_TAG("COINS")
1919   PORT_INCLUDE( pyramid )
1920
1921   PORT_MODIFY("COINS")
22041922    PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("Fl 0.25")
22051923   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(3) PORT_NAME("Fl 1.00")
22061924   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_IMPULSE(3) PORT_NAME("Fl 2.50")
22071925   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN4 ) PORT_IMPULSE(3) PORT_NAME("Fl 5.00")
2208   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2209   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2210   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2211   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
22121926
2213   PORT_START_TAG("STROBE0")
2214   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2215   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2216   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2217   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2218   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2219   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2220   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2221   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2222
2223   PORT_START_TAG("STROBE1")
1927   PORT_MODIFY("STROBE1")
22241928   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
22251929   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Slot 1")
2226   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
22271930   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Slot 2")
22281931   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
2229   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2230   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2231   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
22321932
2233   PORT_START_TAG("STROBE2")
1933   PORT_MODIFY("STROBE2")
22341934   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3)  PORT_NAME("Slot 3")
22351935   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON4)  PORT_NAME("Slot 4")
22361936   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER )   PORT_NAME("Enter") PORT_CODE( KEYCODE_E )
22371937   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
22381938   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
2239   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2240   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2241   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
22421939
2243   PORT_START_TAG("STROBE3")
2244   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2245   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2246   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2247   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1940   PORT_MODIFY("STROBE3")
22481941   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1)
2249   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2250   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2251   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
22521942
2253   PORT_START_TAG("STROBE4")
2254   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_INTERLOCK) PORT_NAME("Cashbox Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE
2255   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_INTERLOCK) PORT_NAME("Front Door") PORT_CODE(KEYCODE_W) PORT_TOGGLE
2256   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER)     PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE
2257   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2258   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2259   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2260   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2261   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2262
2263   PORT_START_TAG("STROBE5")
2264   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2265   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2266   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2267   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2268   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2269   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2270   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2271   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2272
2273   PORT_START_TAG("STROBE6")
2274   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2275   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2276   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2277   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2278   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2279   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2280   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2281   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2282
2283   PORT_START_TAG("STROBE7")
2284   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2285   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2286   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2287   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2288   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2289   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2290   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2291   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2292
2293   PORT_START_TAG("STROBE8")
2294   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2295   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2296   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2297   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2298   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2299   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2300   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2301   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2302
2303   PORT_START_TAG("STROBE9")
2304   PORT_SERVICE_NO_TOGGLE(0x01,IP_ACTIVE_HIGH)
2305   PORT_DIPNAME( 0x02, 0x00, "Fl 0.25 Inhibit?" )PORT_DIPLOCATION("DIL:02")
2306   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2307   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )
2308   PORT_DIPNAME( 0x04, 0x00, "Fl 1.00 Inhibit?" )PORT_DIPLOCATION("DIL:03")
2309   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2310   PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
2311   PORT_DIPNAME( 0x08, 0x00, "Fl 2.50 Inhibit?" )PORT_DIPLOCATION("DIL:04")
2312   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2313   PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
2314   PORT_DIPNAME( 0x10, 0x00, "Fl 5.00 Inhibit?" )PORT_DIPLOCATION("DIL:05")
2315   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2316   PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
2317
2318   PORT_START_TAG("STROBE10")
2319   PORT_DIPNAME( 0x01, 0x00, "DIL06" ) PORT_DIPLOCATION("DIL:06")
1943   PORT_MODIFY("STROBE10")
1944   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "DIL:!06" )
1945   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "DIL:!07" )
1946   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "DIL:!08" )
1947   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "DIL:!10" )
1948   PORT_DIPNAME( 0x10, 0x00, "Coin Jam Alarm" )PORT_DIPLOCATION("DIL:!11")
23201949   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2321   PORT_DIPSETTING(    0x01, DEF_STR( On  ) )
2322   PORT_DIPNAME( 0x02, 0x00, "DIL07" ) PORT_DIPLOCATION("DIL:07")
2323   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2324   PORT_DIPSETTING(    0x02, DEF_STR( On  ) )
2325   PORT_DIPNAME( 0x04, 0x00, "DIL08" ) PORT_DIPLOCATION("DIL:08")
2326   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2327   PORT_DIPSETTING(    0x04, DEF_STR( On  ) )
2328   PORT_DIPNAME( 0x08, 0x00, "DIL10" ) PORT_DIPLOCATION("DIL:10")
2329   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2330   PORT_DIPSETTING(    0x08, DEF_STR( On  ) )
2331   PORT_DIPNAME( 0x10, 0x00, "Coin Jam Alarm" )PORT_DIPLOCATION("DIL:11")
2332   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
23331950   PORT_DIPSETTING(    0x10, DEF_STR( On  ) )
23341951
2335   PORT_START_TAG("STROBE11")
2336   PORT_DIPNAME( 0x01, 0x00, "DIL12" ) PORT_DIPLOCATION("DIL:12")
1952   PORT_MODIFY("STROBE11")
1953   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "DIL:!12" )
1954   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "DIL:!13" )
1955   PORT_DIPNAME( 0x04, 0x00, "Attract mode" )PORT_DIPLOCATION("DIL:!14")
23371956   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2338   PORT_DIPSETTING(    0x01, DEF_STR( On  ) )
2339   PORT_DIPNAME( 0x02, 0x00, "DIL13" ) PORT_DIPLOCATION("DIL:13")
2340   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2341   PORT_DIPSETTING(    0x02, DEF_STR( On  ) )
2342   PORT_DIPNAME( 0x04, 0x00, "Attract mode" )PORT_DIPLOCATION("DIL:14")
2343   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
23441957   PORT_DIPSETTING(    0x04, DEF_STR( On  ) )
2345   PORT_DIPNAME( 0x18, 0x00, "Timebar speed" )PORT_DIPLOCATION("DIL:15,16")
1958   PORT_DIPNAME( 0x18, 0x00, "Timebar speed" )PORT_DIPLOCATION("DIL:!15,!16")
23461959   PORT_DIPSETTING(    0x00, "1" )
23471960   PORT_DIPSETTING(    0x10, "2" )
23481961   PORT_DIPSETTING(    0x08, "3" )
23491962   PORT_DIPSETTING(    0x18, "4" )
2350
23511963INPUT_PORTS_END
23521964
23531965// input ports for sltblgtk  //////////////////////////////////////////////
23541966
23551967static INPUT_PORTS_START( sltblgtk )
2356   PORT_START_TAG("COINS")
1968   PORT_INCLUDE( pyramid )
1969
1970   PORT_MODIFY("COINS")
23571971   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
23581972   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("Token")
23591973   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(3) PORT_NAME("20 BFr")
23601974   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_IMPULSE(3) PORT_NAME("50 BFr")
2361   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2362   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2363   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2364   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
23651975
2366   PORT_START_TAG("STROBE0")
2367   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2368   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2369   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2370   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2371   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2372   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2373   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2374   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2375
2376   PORT_START_TAG("STROBE1")
1976   PORT_MODIFY("STROBE1")
23771977   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
23781978   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Slot 1")
2379   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
23801979   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Slot 2")
23811980   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
2382   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2383   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2384   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
23851981
2386   PORT_START_TAG("STROBE2")
1982   PORT_MODIFY("STROBE2")
23871983   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Slot 3")
23881984   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Slot 4")
23891985   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER  ) PORT_NAME("Enter") PORT_CODE( KEYCODE_E )
23901986   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
23911987   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
2392   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2393   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2394   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
23951988
2396   PORT_START_TAG("STROBE3")
2397   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_SPECIAL )//Tube 1
2398   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_SPECIAL )//Tube 2
2399   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2400   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1989   PORT_MODIFY("STROBE3")
1990   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_SPECIAL ) //Tube 1
1991   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_SPECIAL ) //Tube 2
24011992   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1)
2402   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2403   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2404   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
24051993
2406   PORT_START_TAG("STROBE4")
2407   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_INTERLOCK) PORT_NAME("Cashbox Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE
2408   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_INTERLOCK) PORT_NAME("Front Door") PORT_CODE(KEYCODE_W) PORT_TOGGLE
2409   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER)     PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE
2410   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2411   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2412   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2413   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2414   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2415
2416   PORT_START_TAG("STROBE5")
2417   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2418   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2419   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2420   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2421   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2422   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2423   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2424   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2425
2426   PORT_START_TAG("STROBE6")
2427   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2428   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2429   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2430   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2431   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2432   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2433   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2434   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2435
2436   PORT_START_TAG("STROBE7")
2437   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2438   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2439   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2440   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2441   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2442   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2443   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2444   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2445
2446   PORT_START_TAG("STROBE8")
2447   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2448   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2449   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2450   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2451   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2452   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2453   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2454   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2455
2456   PORT_START_TAG("STROBE9")
1994   PORT_MODIFY("STROBE9")
24571995   PORT_SERVICE_NO_TOGGLE(0x01,IP_ACTIVE_HIGH)
2458   PORT_DIPNAME( 0x02, 0x00, "CashMeters in refill menu" )PORT_DIPLOCATION("DIL:02")
1996   PORT_DIPNAME( 0x02, 0x00, "CashMeters in refill menu" )PORT_DIPLOCATION("DIL:!02")
24591997   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
24601998   PORT_DIPSETTING(    0x02, DEF_STR( On  ) )
2461   PORT_DIPNAME( 0x04, 0x00, "Token Inhibit?" )PORT_DIPLOCATION("DIL:03")
1999   PORT_DIPNAME( 0x04, 0x00, "Token Lockout" )PORT_DIPLOCATION("DIL:!03")
24622000   PORT_DIPSETTING(    0x00, DEF_STR( No  ) )
24632001   PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
2464   PORT_DIPNAME( 0x08, 0x00, "20 Bfr Inhibit?" )PORT_DIPLOCATION("DIL:04")
2002   PORT_DIPNAME( 0x08, 0x00, "20 Bfr Lockout" )PORT_DIPLOCATION("DIL:!04")
24652003   PORT_DIPSETTING(    0x00, DEF_STR( No  ) )
24662004   PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
2467   PORT_DIPNAME( 0x10, 0x00, "50 Bfr Inhibit?" )PORT_DIPLOCATION("DIL:05")
2005   PORT_DIPNAME( 0x10, 0x00, "50 Bfr Lockout" )PORT_DIPLOCATION("DIL:!05")
24682006   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
24692007   PORT_DIPSETTING(    0x10, DEF_STR( Yes  ) )
24702008
2471   PORT_START_TAG("STROBE10")
2472   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )PORT_DIPLOCATION("DIL:06")
2473   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2474   PORT_DIPSETTING(    0x01, DEF_STR( On  ) )
2475
2476   PORT_DIPNAME( 0x0E, 0x0E, "Payout Percentage" )PORT_DIPLOCATION("DIL:07,08,10")
2009   PORT_MODIFY("STROBE10")
2010   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "DIL:!06" )
2011   PORT_DIPNAME( 0x0E, 0x00, "Payout Percentage" )PORT_DIPLOCATION("DIL:!07,!08,!10")
24772012   PORT_DIPSETTING(    0x00, "60%")
24782013   PORT_DIPSETTING(    0x08, "65%")
24792014   PORT_DIPSETTING(    0x04, "70%")
r2018r2019
24822017   PORT_DIPSETTING(    0x0A, "84%")
24832018   PORT_DIPSETTING(    0x06, "88%")
24842019   PORT_DIPSETTING(    0x0E, "90%")
2485   PORT_DIPNAME( 0x10, 0x00, "Coin Jam Alarm" )PORT_DIPLOCATION("DIL:11")
2020   PORT_DIPNAME( 0x10, 0x00, "Coin Jam Alarm" )PORT_DIPLOCATION("DIL:!11")
24862021   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
24872022   PORT_DIPSETTING(    0x10, DEF_STR( On  ) )
24882023
2489   PORT_START_TAG("STROBE11")
2490   PORT_DIPNAME( 0x01, 0x01, "Timebar" )PORT_DIPLOCATION("DIL:12")
2024   PORT_MODIFY("STROBE11")
2025   PORT_DIPNAME( 0x01, 0x00, "Timebar" )PORT_DIPLOCATION("DIL:!12")
24912026   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
24922027   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
2493   PORT_DIPNAME( 0x02, 0x00, "Clear credits" )PORT_DIPLOCATION("DIL:13")
2028   PORT_DIPNAME( 0x02, 0x00, "Clear credits" )PORT_DIPLOCATION("DIL:!13")
24942029   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
24952030   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
2496   PORT_DIPNAME( 0x04, 0x00, "Attract mode" )PORT_DIPLOCATION("DIL:14")
2031   PORT_DIPNAME( 0x04, 0x00, "Attract mode" )PORT_DIPLOCATION("DIL:!14")
24972032   PORT_DIPSETTING(    0x00, DEF_STR( Off  ) )
24982033   PORT_DIPSETTING(    0x04, DEF_STR( On   ) )
2499   PORT_DIPNAME( 0x08, 0x08, "Show hints" )PORT_DIPLOCATION("DIL:15")
2034   PORT_DIPNAME( 0x08, 0x00, "Show hints" )PORT_DIPLOCATION("DIL:!15")
25002035   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
25012036   PORT_DIPSETTING(    0x08, DEF_STR( On  ) )
2502   PORT_DIPNAME( 0x10, 0x00, "Pay win to credits" )PORT_DIPLOCATION("DIL:16")
2037   PORT_DIPNAME( 0x10, 0x00, "Pay win to credits" )PORT_DIPLOCATION("DIL:!16")
25032038   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
25042039   PORT_DIPSETTING(    0x10, DEF_STR( On  ) )
2505
25062040INPUT_PORTS_END
25072041
25082042// input ports for sltblgpo  //////////////////////////////////////////////
25092043
25102044static INPUT_PORTS_START( sltblgpo )
2511   PORT_START_TAG("COINS")
2045   PORT_INCLUDE( pyramid )
2046
2047   PORT_MODIFY("COINS")
25122048   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
25132049   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
25142050   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("Bfr 20")
25152051   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(3) PORT_NAME("Bfr 50")
2516   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2517   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2518   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2519   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
25202052
2521   PORT_START_TAG("STROBE0")
2522   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2523   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2524   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2525   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2526   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2527   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2528   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2529   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2530
2531   PORT_START_TAG("STROBE1")
2053   PORT_MODIFY("STROBE1")
25322054   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
25332055   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Hand 1")
2534   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
25352056   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Hand 2")
25362057   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2537   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2538   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2539   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
25402058
2541   PORT_START_TAG("STROBE2")
2059   PORT_MODIFY("STROBE2")
25422060   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3)  PORT_NAME("Hand 3")
25432061   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON4)  PORT_NAME("Hand 4")
25442062   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1)
25452063   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
25462064   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1)  PORT_NAME("Stake")  PORT_CODE( KEYCODE_O )
2547   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2548   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2549   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
25502065
2551   PORT_START_TAG("STROBE3")
2552   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2553   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2554   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2066   PORT_MODIFY("STROBE3")
25552067   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Collect") PORT_CODE(KEYCODE_C)
2556   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2557   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2558   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2559   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
25602068
2561   PORT_START_TAG("STROBE4")
2562   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_INTERLOCK) PORT_NAME("Cashbox Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE
2563   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_INTERLOCK) PORT_NAME("Front Door") PORT_CODE(KEYCODE_W) PORT_TOGGLE
2564   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER)     PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE
2565   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2566   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2567   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2568   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2569   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2570
2571   PORT_START_TAG("STROBE5")
2572   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2573   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2574   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2575   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2576   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2577   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2578   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2579   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2580
2581   PORT_START_TAG("STROBE6")
2582   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2583   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2584   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2585   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2586   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2587   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2588   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2589   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2590
2591   PORT_START_TAG("STROBE7")
2592   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2593   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2594   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2595   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2596   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2597   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2598   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2599   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2600
2601   PORT_START_TAG("STROBE8")
2602   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2603   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2604   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2605   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2606   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2607   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2608   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2609   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2610
2611   PORT_START_TAG("STROBE9")
2069   PORT_MODIFY("STROBE9")
26122070   PORT_SERVICE_NO_TOGGLE(0x01,IP_ACTIVE_HIGH)
2613   PORT_DIPNAME( 0x02, 0x00, "Hopper Limit" )PORT_DIPLOCATION("DIL:02")
2071   PORT_DIPNAME( 0x02, 0x00, "Hopper Limit" )PORT_DIPLOCATION("DIL:!02")
26142072   PORT_DIPSETTING(    0x00, "300" )
26152073   PORT_DIPSETTING(    0x02, "500" )
2616   PORT_DIPNAME( 0x04, 0x00, "DIL03" )PORT_DIPLOCATION("DIL:03")
2617   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2618   PORT_DIPSETTING(    0x04, DEF_STR( On  ) )
2619
2620   PORT_DIPNAME( 0x18, 0x00, "Attendant payout" )PORT_DIPLOCATION("DIL:04,05")
2074   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "DIL:!03" )
2075   PORT_DIPNAME( 0x18, 0x00, "Attendant payout" )PORT_DIPLOCATION("DIL:!04,!05")
26212076   PORT_DIPSETTING(    0x00, "1000 Bfr" )
26222077   PORT_DIPSETTING(    0x08, "1250 Bfr" )
26232078   PORT_DIPSETTING(    0x10, "1500 Bfr" )
26242079   PORT_DIPSETTING(    0x18, "1750 Bfr" )
26252080
2626   PORT_START_TAG("STROBE10")
2627   PORT_DIPNAME( 0x01, 0x00, "Bfr 20 Inhibit?" )PORT_DIPLOCATION("DIL:06")
2081   PORT_MODIFY("STROBE10")
2082   PORT_DIPNAME( 0x01, 0x00, "Bfr 20 Lockout" )PORT_DIPLOCATION("DIL:!06")
26282083   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
26292084   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
2630   PORT_DIPNAME( 0x02, 0x00, "DIL07" )PORT_DIPLOCATION("DIL:07")
2085   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "DIL:!07" )
2086   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "DIL:!08" )
2087   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "DIL:!10" )
2088   PORT_DIPNAME( 0x10, 0x00, "Coin Jam Alarm" )PORT_DIPLOCATION("DIL:!11")
26312089   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2632   PORT_DIPSETTING(    0x02, DEF_STR( On  ) )
2633   PORT_DIPNAME( 0x04, 0x00, "DIL08" )PORT_DIPLOCATION("DIL:08")
2634   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2635   PORT_DIPSETTING(    0x04, DEF_STR( On  ) )
2636   PORT_DIPNAME( 0x08, 0x00, "DIL10" )PORT_DIPLOCATION("DIL:10")
2637   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2638   PORT_DIPSETTING(    0x08, DEF_STR( On  ) )
2639   PORT_DIPNAME( 0x10, 0x00, "Coin Jam Alarm" )PORT_DIPLOCATION("DIL:11")
2640   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
26412090   PORT_DIPSETTING(    0x10, DEF_STR( On  ) )
26422091
2643   PORT_START_TAG("STROBE11")
2644   PORT_DIPNAME( 0x01, 0x00, "Clear credits on reset?" )PORT_DIPLOCATION("DIL:12")
2092   PORT_MODIFY("STROBE11")
2093   PORT_DIPNAME( 0x01, 0x00, "Clear credits on reset?" )PORT_DIPLOCATION("DIL:!12")
26452094   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
26462095   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
2647   PORT_DIPNAME( 0x02, 0x00, "Attract Mode" )PORT_DIPLOCATION("DIL:13")
2096   PORT_DIPNAME( 0x02, 0x00, "Attract Mode" )PORT_DIPLOCATION("DIL:!13")
26482097   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
26492098   PORT_DIPSETTING(    0x00, DEF_STR( On  ) )
2650   PORT_DIPNAME( 0x1C, 0x08, "Target Percentage" )PORT_DIPLOCATION("DIL:14,15,16")
2099   PORT_DIPNAME( 0x1C, 0x00, "Target Percentage" )PORT_DIPLOCATION("DIL:!14,!15,!16")
26512100   PORT_DIPSETTING(    0x14, "80%")
26522101   PORT_DIPSETTING(    0x04, "82%")
26532102   PORT_DIPSETTING(    0x1C, "84%")
r2018r2019
26562105   PORT_DIPSETTING(    0x00, "92%")
26572106   PORT_DIPSETTING(    0x18, "94%")
26582107   PORT_DIPSETTING(    0x08, "96%")
2659
26602108INPUT_PORTS_END
26612109
26622110// input ports for paradice ///////////////////////////////////////////////
26632111
26642112static INPUT_PORTS_START( paradice )
2665   PORT_START_TAG("COINS")
2113   PORT_INCLUDE( pyramid )
2114
2115   PORT_MODIFY("COINS")
26662116    PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("Fl 0.25")
26672117   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(3) PORT_NAME("Fl 1.00")
26682118   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_IMPULSE(3) PORT_NAME("Fl 2.50")
26692119   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN4 ) PORT_IMPULSE(3) PORT_NAME("Fl 5.00")
2670   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2671   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2672   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2673   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
26742120
2675   PORT_START_TAG("STROBE0")
2676   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2677   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2678   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2679   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2680   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2681   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2682   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2683   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2684
2685   PORT_START_TAG("STROBE1")
2121   PORT_MODIFY("STROBE1")
26862122   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME( "1 Player Start (Left)" )
26872123   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME( "2 Player Start (Right)" )
2688   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
26892124   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME( "A" )
26902125   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME( "B" )
2691   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2692   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2693   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
26942126
2695
2696   PORT_START_TAG("STROBE2")
2127   PORT_MODIFY("STROBE2")
26972128   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME( "C" )
2698   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
26992129   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER  ) PORT_NAME( "Enter" ) PORT_CODE( KEYCODE_E )
27002130   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
2701   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
2702   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2703   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2704   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
27052131
2706   PORT_START_TAG("STROBE3")
2707   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2708   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2709   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2710   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2711   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2712   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2713   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2714   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2715
2716   PORT_START_TAG("STROBE4")
2717   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_INTERLOCK) PORT_NAME("Cashbox Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE
2718   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_INTERLOCK) PORT_NAME("Front Door") PORT_CODE(KEYCODE_W) PORT_TOGGLE
2719   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER)     PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE
2720   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2721   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2722   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2723   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2724   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2725
2726   PORT_START_TAG("STROBE5")
2727   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2728   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2729   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2730   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2731   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2732   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2733   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2734   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2735
2736   PORT_START_TAG("STROBE6")
2737   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2738   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2739   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2740   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2741   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2742   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2743   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2744   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2745
2746   PORT_START_TAG("STROBE7")
2747   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2748   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2749   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2750   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2751   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2752   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2753   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2754   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2755
2756   PORT_START_TAG("STROBE8")
2757   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2758   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2759   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2760   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2761   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2762   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2763   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2764   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2765
2766   PORT_START_TAG("STROBE9")
2767   PORT_SERVICE_NO_TOGGLE(0x01,IP_ACTIVE_HIGH)
2768   PORT_DIPNAME( 0x02, 0x00, "Coin 1 Inhibit?" )PORT_DIPLOCATION("DIL:02")
2769   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2770   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )
2771   PORT_DIPNAME( 0x04, 0x00, "Coin 2 Inhibit?" )PORT_DIPLOCATION("DIL:03")
2772   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2773   PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
2774   PORT_DIPNAME( 0x08, 0x00, "Coin 3 Inhibit?" )PORT_DIPLOCATION("DIL:04")
2775   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2776   PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
2777   PORT_DIPNAME( 0x10, 0x00, "Coin 4 Inhibit?" )PORT_DIPLOCATION("DIL:05")
2778   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2779   PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
2780
2781   PORT_START_TAG("STROBE10")
2782   PORT_DIPNAME( 0x01, 0x01, "Joker" )PORT_DIPLOCATION("DIL:06")
2132   PORT_MODIFY("STROBE10")
2133   PORT_DIPNAME( 0x01, 0x00, "Joker" )PORT_DIPLOCATION("DIL:!06")
27832134   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
27842135   PORT_DIPSETTING(    0x01, DEF_STR( On  ) )
2785   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Language ) )PORT_DIPLOCATION("DIL:07")
2136   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Language ) )PORT_DIPLOCATION("DIL:!07")
27862137   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
27872138   PORT_DIPSETTING(    0x02, "Dutch"    )
2788   PORT_DIPNAME( 0x0C, 0x0C, "Payout level" )PORT_DIPLOCATION("DIL:08,10")
2139   PORT_DIPNAME( 0x0C, 0x00, "Payout level" )PORT_DIPLOCATION("DIL:!08,!10")
27892140   PORT_DIPSETTING(    0x00, DEF_STR( Low ) )
27902141   PORT_DIPSETTING(    0x08, "Medium-Low"  )
27912142   PORT_DIPSETTING(    0x04, "Medium-High" )
27922143   PORT_DIPSETTING(    0x0C, DEF_STR( High ) )
2793   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Difficulty ) )PORT_DIPLOCATION("DIL:11")
2144   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Difficulty ) )PORT_DIPLOCATION("DIL:!11")
27942145   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
27952146   PORT_DIPSETTING(    0x10, DEF_STR( On  ) )
27962147
2797   PORT_START_TAG("STROBE11")
2798   PORT_DIPNAME( 0x03, 0x00, "Winlines to go" )PORT_DIPLOCATION("DIL:12,13")
2148   PORT_MODIFY("STROBE11")
2149   PORT_DIPNAME( 0x03, 0x00, "Winlines to go" )PORT_DIPLOCATION("DIL:!12,!13")
27992150   PORT_DIPSETTING(    0x00, "6" )
28002151   PORT_DIPSETTING(    0x02, "7" )
28012152   PORT_DIPSETTING(    0x01, "8" )
28022153   PORT_DIPSETTING(    0x03, "9" )
2803   PORT_DIPNAME( 0x04, 0x04, "Attract mode" )PORT_DIPLOCATION("DIL:14")
2154   PORT_DIPNAME( 0x04, 0x00, "Attract mode" )PORT_DIPLOCATION("DIL:!14")
28042155   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
28052156   PORT_DIPSETTING(    0x04, DEF_STR( On  ) )
2806   PORT_DIPNAME( 0x18, 0x00, "Timebar speed" )PORT_DIPLOCATION("DIL:15,16")
2157   PORT_DIPNAME( 0x18, 0x00, "Timebar speed" )PORT_DIPLOCATION("DIL:!15,!16")
28072158   PORT_DIPSETTING(    0x00, "0" )
28082159   PORT_DIPSETTING(    0x08, "1" )
28092160   PORT_DIPSETTING(    0x10, "2" )
28102161   PORT_DIPSETTING(    0x18, "3" )
2811
28122162INPUT_PORTS_END
28132163
28142164// input ports for pokio //////////////////////////////////////////////////
28152165
28162166static INPUT_PORTS_START( pokio )
2817   PORT_START_TAG("COINS")
2167   PORT_INCLUDE( pyramid )
2168
2169   PORT_MODIFY("COINS")
28182170    PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("Fl 0.25")
28192171   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(3) PORT_NAME("Fl 1.00")
28202172   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_IMPULSE(3) PORT_NAME("Fl 2.50")
28212173   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN4 ) PORT_IMPULSE(3) PORT_NAME("Fl 5.00")
2822   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2823   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2824   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2825   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
28262174
2827   PORT_START_TAG("STROBE0")
2828   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2829   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2830   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2831   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2832   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2833   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2834   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2835   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2836
2837   PORT_START_TAG("STROBE1")
2175   PORT_MODIFY("STROBE1")
28382176   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME( "Hand 1 Left" )
28392177   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME( "Hand 2 Left" )
28402178   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME( "Hand 3 Left" )
28412179   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
28422180   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2843   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2844   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2845   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
28462181
2847   PORT_START_TAG("STROBE2")
2182   PORT_MODIFY("STROBE2")
28482183   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME( "1 Player Start (Left)" )
28492184   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER )  PORT_NAME( "Enter" ) PORT_CODE( KEYCODE_SPACE )
28502185   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME( "2 Player Start (Right)" )
28512186   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON6 )PORT_NAME( "Hand 3 Right" )
28522187   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON5 )PORT_NAME( "Hand 2 Right" )
2853   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2854   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2855   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
28562188
2857   PORT_START_TAG("STROBE3")
2858   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
2859   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2860   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2861   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2189   PORT_MODIFY("STROBE3")
28622190   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4 )PORT_NAME( "Hand 1 Right" )
2863   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2864   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2865   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
28662191
2867   PORT_START_TAG("STROBE4")
2868   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_INTERLOCK) PORT_NAME("Cashbox Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE
2869   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_INTERLOCK) PORT_NAME("Front Door") PORT_CODE(KEYCODE_W) PORT_TOGGLE
2870   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER)     PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE
2871   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2872   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2873   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2874   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2875   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2876
2877   PORT_START_TAG("STROBE5")
2878   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2879   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2880   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2881   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2882   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2883   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2884   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2885   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2886
2887   PORT_START_TAG("STROBE6")
2888   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2889   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2890   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2891   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2892   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2893   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2894   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2895   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2896
2897   PORT_START_TAG("STROBE7")
2898   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2899   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2900   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2901   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2902   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2903   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2904   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2905   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2906
2907   PORT_START_TAG("STROBE8")
2908   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
2909   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
2910   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
2911   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
2912   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
2913   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
2914   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
2915   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
2916
2917   PORT_START_TAG("STROBE9")
2918   PORT_SERVICE_NO_TOGGLE(0x01,IP_ACTIVE_HIGH)
2919   PORT_DIPNAME( 0x02, 0x00, "Coin 1 Inhibit?" )PORT_DIPLOCATION("DIL:02")
2920   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2921   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )
2922   PORT_DIPNAME( 0x04, 0x00, "Coin 2 Inhibit?" )PORT_DIPLOCATION("DIL:03")
2923   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2924   PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
2925   PORT_DIPNAME( 0x08, 0x00, "Coin 3 Inhibit?" )PORT_DIPLOCATION("DIL:04")
2926   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2927   PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
2928   PORT_DIPNAME( 0x10, 0x00, "Coin 4 Inhibit?" )PORT_DIPLOCATION("DIL:05")
2929   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2930   PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
2931
2932   PORT_START_TAG("STROBE10")
2933   PORT_DIPNAME( 0x01, 0x00, "DIL06" ) PORT_DIPLOCATION("DIL:06")
2934   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2935   PORT_DIPSETTING(    0x01, DEF_STR( On  ) )
2936   PORT_DIPNAME( 0x02, 0x00, "DIL07" ) PORT_DIPLOCATION("DIL:07")
2937   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2938   PORT_DIPSETTING(    0x02, DEF_STR( On  ) )
2939   PORT_DIPNAME( 0x04, 0x00, "DIL08" ) PORT_DIPLOCATION("DIL:08")
2940   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2941   PORT_DIPSETTING(    0x04, DEF_STR( On  ) )
2942   PORT_DIPNAME( 0x08, 0x00, "DIL10" ) PORT_DIPLOCATION("DIL:10")
2943   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2944   PORT_DIPSETTING(    0x08, DEF_STR( On  ) )
2945   PORT_DIPNAME( 0x10, 0x00, "Coin Jam Alarm" )PORT_DIPLOCATION("DIL:11")
2192   PORT_MODIFY("STROBE10")
2193   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "DIL:!06" )
2194   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "DIL:!07" )
2195   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "DIL:!08" )
2196   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "DIL:!10" )
2197   PORT_DIPNAME( 0x10, 0x00, "Coin Jam Alarm" )PORT_DIPLOCATION("DIL:!11")
29462198   PORT_DIPSETTING(    0x10, DEF_STR( Off  ) )
29472199   PORT_DIPSETTING(    0x00, DEF_STR( On   ) )
29482200
2949   PORT_START_TAG("STROBE11")
2950   PORT_DIPNAME( 0x01, 0x01, "Time bar" ) PORT_DIPLOCATION("DIL:12")
2201   PORT_MODIFY("STROBE11")
2202   PORT_DIPNAME( 0x01, 0x00, "Time bar" ) PORT_DIPLOCATION("DIL:!12")
29512203   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
29522204   PORT_DIPSETTING(    0x01, DEF_STR( On  ) )
2953   PORT_DIPNAME( 0x02, 0x00, "DIL13" ) PORT_DIPLOCATION("DIL:13")
2205   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "DIL:!13" )
2206   PORT_DIPNAME( 0x04, 0x00, "Attract mode" )PORT_DIPLOCATION("DIL:!14")
29542207   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2955   PORT_DIPSETTING(    0x02, DEF_STR( On  ) )
2956   PORT_DIPNAME( 0x04, 0x04, "Attract mode" )PORT_DIPLOCATION("DIL:14")
2957   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
29582208   PORT_DIPSETTING(    0x04, DEF_STR( On  ) )
2959   PORT_DIPNAME( 0x18, 0x00, "Timebar speed" )PORT_DIPLOCATION("DIL:15,16")
2209   PORT_DIPNAME( 0x18, 0x00, "Timebar speed" )PORT_DIPLOCATION("DIL:!15,!16")
29602210   PORT_DIPSETTING(    0x00, "0" )
29612211   PORT_DIPSETTING(    0x08, "1" )
29622212   PORT_DIPSETTING(    0x10, "2" )
29632213   PORT_DIPSETTING(    0x18, "3" )
2964
29652214INPUT_PORTS_END
29662215
29672216static const struct upd7759_interface upd7759_interface =
r2018r2019
33642613GAMEL( 1993, qntoondo, qntoond,     scorpion2_vid, qntoond,   adder_dutch,0,       "BFM/ELAM", "Quintoon (Dutch, Game Card 95-750-136)",      GAME_SUPPORTS_SAVE,layout_quintoon )
33652614GAMEL( 1993, quintoon, 0,        scorpion2_vid, quintoon,  quintoon,   0,       "BFM",      "Quintoon (UK, Game Card 95-750-206)",         GAME_SUPPORTS_SAVE|GAME_IMPERFECT_SOUND,layout_quintoon ) //Current samples need verification
33662615GAMEL( 1993, quintond, quintoon,  scorpion2_vid, quintoon,  quintoon,   0,       "BFM",      "Quintoon (UK, Game Card 95-751-206, Datapak)",GAME_SUPPORTS_SAVE|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING,layout_quintoon ) //Current samples need verification
3367GAMEL( 1993, quintono, quintoon,  scorpion2_vid, quintono,  quintoon,   0,       "BFM",      "Quintoon (UK, Game Card 95-750-203)",         GAME_SUPPORTS_SAVE|GAME_IMPERFECT_SOUND,layout_quintoon ) //Current samples need verification
2616GAMEL( 1993, quintono, quintoon,  scorpion2_vid, quintoon,  quintoon,   0,       "BFM",      "Quintoon (UK, Game Card 95-750-203)",         GAME_SUPPORTS_SAVE|GAME_IMPERFECT_SOUND,layout_quintoon ) //Current samples need verification
33682617GAMEL( 1993, qntoond,  0,        scorpion2_vid, qntoond,   adder_dutch,0,       "BFM/ELAM", "Quintoon (Dutch, Game Card 95-750-243)",      GAME_SUPPORTS_SAVE,layout_quintoon )
33692618GAMEL( 1994, pokio,    0,        scorpion2_vid, pokio,     adder_dutch,0,       "BFM/ELAM", "Pokio (Dutch, Game Card 95-750-278)",         GAME_SUPPORTS_SAVE,layout_pokio )
33702619GAMEL( 1995, slotsnl,  0,        scorpion2_vid, slotsnl,   adder_dutch,0,       "BFM/ELAM", "Slots (Dutch, Game Card 95-750-368)",         GAME_SUPPORTS_SAVE,layout_slots )
src/mame/drivers/balsente.c
r2018r2019
531531   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(1)
532532
533533   PORT_MODIFY("IN3")
534   UNUSED_ANALOG
534   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
535535
536536   /* Player 1 Dial */
537537   PORT_MODIFY("AN2")
src/mame/drivers/terracre.c
r2018r2019
206206   state_save_register_global_array(mAmazonProtReg);
207207}
208208
209/* This is not the REAL Booby Kids (early Japanese version of Kid no Hore Hore Daisakusen),
210  it is a bootleg that was manufactureed in Italy which became popular in Europe.  The bootleggers
211  probably called it 'Booby Kids' because this is the name under which the game was known on home systems
212  at the time.  This is actually just a graphic hack of the other bootleg (horekidb) it is supported because
213  it is a common PCB, and we need to clarify that this is not the real thing.
214*/
215ROM_START( boobhack )
216   ROM_REGION( 0x20000, REGION_CPU1, 0 ) /* 68000 code (main CPU) */
217   ROM_LOAD16_BYTE( "1-c.bin", 0x00000, 0x8000, CRC(786619c7) SHA1(6b4a659839a7c19370a81f9f9b26e4fe0d210d7b) )
218   ROM_LOAD16_BYTE( "1-b.bin", 0x00001, 0x8000, CRC(3bbb475b) SHA1(575cdc4f902f15335579c0f860fa75e33a0ea539) )
219   ROM_LOAD16_BYTE( "1-d.bin",   0x10000, 0x8000, CRC(375c0c50) SHA1(ee040dbdfe6673cf48f143518458609b21b4e15d) )
220   ROM_LOAD16_BYTE( "1-a.bin",   0x10001, 0x8000, CRC(ee7d52bb) SHA1(b9083f672a6bc37ec2bbb9af081e6f27b712b663) )
221
222   ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Z80 code (sound) */
223   ROM_LOAD( "1-i.bin",   0x0000, 0x4000,CRC(49cd3b81) SHA1(284d75f6f6121d0581bb62f13ee02c85c3d972d2) )
224   ROM_LOAD( "1-j.bin",   0x4000, 0x4000,CRC(c1eaa938) SHA1(839f03e701f072a6441ee4980eb1961859c40d97) )
225   ROM_LOAD( "1-k.bin",   0x8000, 0x4000,CRC(0a2bc702) SHA1(0cef9e9022a27d30d2f83a16a55d8ede0ab686f4) )
226
227   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE ) /* alphanumerics */
228   ROM_LOAD( "1-p.bin",   0x0000, 0x2000, CRC(104b77cc) SHA1(f875c7fe4f2b540bc44fa144a449a01268011431) )
229
230   ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE ) /* tiles */
231   ROM_LOAD( "1-e.bin",   0x00000, 0x8000, CRC(da25ae10) SHA1(83d8b78cff85854b497b40525ec3c93a84ba6248) )
232   ROM_LOAD( "1-f.bin",   0x08000, 0x8000, CRC(616e4321) SHA1(5bf0e0a7290b6bcb5dfbb1070eeb683830e6916b) )
233   ROM_LOAD( "1-g.bin",   0x10000, 0x8000, CRC(8c7d2be2) SHA1(efd70997126fc7c2622546fabe69cb222dca87f9) )
234   ROM_LOAD( "1-h.bin",   0x18000, 0x8000, CRC(a0066b02) SHA1(d6437932028e937dab5728f40d6d09b6afe9a903) )
235
236   ROM_REGION( 0x20000, REGION_GFX3, ROMREGION_DISPOSE ) /* sprites */
237   ROM_LOAD( "1-l.bin",   0x00000, 0x8000, CRC(a3caa07a) SHA1(4baa7d1867dbaa8bace43416040114129f5405d6) )
238   ROM_LOAD( "1-m.bin",   0x08000, 0x8000, CRC(15b6cbdf) SHA1(b7f2a527946bcbd51aeae98b8971f4fbabcb3d14) ) // Booby Kids gfx hack changes these 2 roms ONLY
239   ROM_LOAD( "1-n.bin",   0x10000, 0x8000, CRC(e300747a) SHA1(5875a46c215b12f1e9a889819215bca40e4459a6) )
240   ROM_LOAD( "1-o.bin",   0x18000, 0x8000, CRC(cddc6a6c) SHA1(28d12342e0ada941f68845fa65793a3f5fa21246) ) // Booby Kids gfx hack changes these 2 roms ONLY
241
242   ROM_REGION( 0x500, REGION_PROMS, 0 )
243   ROM_LOAD( "kid_prom.10f", 0x000, 0x100, CRC(ca13ce23) SHA1(46f0ed22f601721fa35bab12ce8816f30b102f59) ) /* red */
244   ROM_LOAD( "kid_prom.11f", 0x100, 0x100, CRC(fb44285a) SHA1(f9605e82f63188daeff044fd48d81c1dfc4d4f2a) ) /* green */
245   ROM_LOAD( "kid_prom.12f", 0x200, 0x100, CRC(40d41237) SHA1(b33082540d739a3bfe096f68f3359fbf1360b5be) ) /* blue */
246   ROM_LOAD( "kid_prom.2g",  0x300, 0x100, CRC(4b9be0ed) SHA1(81aa7bb24fe6ea13f5dffdb67ea699adf0b3129a) ) /* clut */
247   ROM_LOAD( "kid_prom.4e",  0x400, 0x100, CRC(e4fb54ee) SHA1(aba89d347b24dc6680e6f25b4a6c0d6657bb6a83) ) /* ctable */
248ROM_END
249
250209static ADDRESS_MAP_START( terracre_readmem, ADDRESS_SPACE_PROGRAM, 16 )
251210   AM_RANGE(0x000000, 0x01ffff) AM_READ(SMH_ROM)
252211   AM_RANGE(0x020000, 0x0201ff) AM_READ(SMH_RAM)
r2018r2019
1009968   ROM_LOAD( "horekid.17",   0x0000, 0x2000, CRC(1d8d592b) SHA1(be8d6df8b5926069ae2cbc1dc26e1fa92d63f297) )
1010969ROM_END
1011970
971/* This is not the REAL Booby Kids (early Japanese version of Kid no Hore Hore Daisakusen),
972  it is a bootleg that was manufactureed in Italy which became popular in Europe.  The bootleggers
973  probably called it 'Booby Kids' because this is the name under which the game was known on home systems
974  at the time.  This is actually just a graphic hack of the other bootleg (horekidb) it is supported because
975  it is a common PCB, and we need to clarify that this is not the real thing.
976*/
977ROM_START( boobhack )
978   ROM_REGION( 0x20000, REGION_CPU1, 0 ) /* 68000 code (main CPU) */
979   ROM_LOAD16_BYTE( "1-c.bin", 0x00000, 0x8000, CRC(786619c7) SHA1(6b4a659839a7c19370a81f9f9b26e4fe0d210d7b) )
980   ROM_LOAD16_BYTE( "1-b.bin", 0x00001, 0x8000, CRC(3bbb475b) SHA1(575cdc4f902f15335579c0f860fa75e33a0ea539) )
981   ROM_LOAD16_BYTE( "1-d.bin",   0x10000, 0x8000, CRC(375c0c50) SHA1(ee040dbdfe6673cf48f143518458609b21b4e15d) )
982   ROM_LOAD16_BYTE( "1-a.bin",   0x10001, 0x8000, CRC(ee7d52bb) SHA1(b9083f672a6bc37ec2bbb9af081e6f27b712b663) )
983
984   ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Z80 code (sound) */
985   ROM_LOAD( "1-i.bin",   0x0000, 0x4000,CRC(49cd3b81) SHA1(284d75f6f6121d0581bb62f13ee02c85c3d972d2) )
986   ROM_LOAD( "1-j.bin",   0x4000, 0x4000,CRC(c1eaa938) SHA1(839f03e701f072a6441ee4980eb1961859c40d97) )
987   ROM_LOAD( "1-k.bin",   0x8000, 0x4000,CRC(0a2bc702) SHA1(0cef9e9022a27d30d2f83a16a55d8ede0ab686f4) )
988
989   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE ) /* alphanumerics */
990   ROM_LOAD( "1-p.bin",   0x0000, 0x2000, CRC(104b77cc) SHA1(f875c7fe4f2b540bc44fa144a449a01268011431) )
991
992   ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE ) /* tiles */
993   ROM_LOAD( "1-e.bin",   0x00000, 0x8000, CRC(da25ae10) SHA1(83d8b78cff85854b497b40525ec3c93a84ba6248) )
994   ROM_LOAD( "1-f.bin",   0x08000, 0x8000, CRC(616e4321) SHA1(5bf0e0a7290b6bcb5dfbb1070eeb683830e6916b) )
995   ROM_LOAD( "1-g.bin",   0x10000, 0x8000, CRC(8c7d2be2) SHA1(efd70997126fc7c2622546fabe69cb222dca87f9) )
996   ROM_LOAD( "1-h.bin",   0x18000, 0x8000, CRC(a0066b02) SHA1(d6437932028e937dab5728f40d6d09b6afe9a903) )
997
998   ROM_REGION( 0x20000, REGION_GFX3, ROMREGION_DISPOSE ) /* sprites */
999   ROM_LOAD( "1-l.bin",   0x00000, 0x8000, CRC(a3caa07a) SHA1(4baa7d1867dbaa8bace43416040114129f5405d6) )
1000   ROM_LOAD( "1-m.bin",   0x08000, 0x8000, CRC(15b6cbdf) SHA1(b7f2a527946bcbd51aeae98b8971f4fbabcb3d14) ) // Booby Kids gfx hack changes these 2 roms ONLY
1001   ROM_LOAD( "1-n.bin",   0x10000, 0x8000, CRC(e300747a) SHA1(5875a46c215b12f1e9a889819215bca40e4459a6) )
1002   ROM_LOAD( "1-o.bin",   0x18000, 0x8000, CRC(cddc6a6c) SHA1(28d12342e0ada941f68845fa65793a3f5fa21246) ) // Booby Kids gfx hack changes these 2 roms ONLY
1003
1004   ROM_REGION( 0x500, REGION_PROMS, 0 )
1005   ROM_LOAD( "kid_prom.10f", 0x000, 0x100, CRC(ca13ce23) SHA1(46f0ed22f601721fa35bab12ce8816f30b102f59) ) /* red */
1006   ROM_LOAD( "kid_prom.11f", 0x100, 0x100, CRC(fb44285a) SHA1(f9605e82f63188daeff044fd48d81c1dfc4d4f2a) ) /* green */
1007   ROM_LOAD( "kid_prom.12f", 0x200, 0x100, CRC(40d41237) SHA1(b33082540d739a3bfe096f68f3359fbf1360b5be) ) /* blue */
1008   ROM_LOAD( "kid_prom.2g",  0x300, 0x100, CRC(4b9be0ed) SHA1(81aa7bb24fe6ea13f5dffdb67ea699adf0b3129a) ) /* clut */
1009   ROM_LOAD( "kid_prom.4e",  0x400, 0x100, CRC(e4fb54ee) SHA1(aba89d347b24dc6680e6f25b4a6c0d6657bb6a83) ) /* ctable */
1010
1011   ROM_REGION( 0x0100, REGION_USER1, 0 )
1012   ROM_LOAD( "kid_prom.4e",  0x000, 0x100, NO_DUMP ) /* ctable */
1013ROM_END
1014
10121015static DRIVER_INIT( amazon )
10131016{
10141017   mpProtData = mAmazonProtData;
src/mame/drivers/vertigo.c
r2018r2019
3232   AM_RANGE(0x004020, 0x00402f) AM_READ(vertigo_coin_r) AM_MIRROR(0x001000)
3333   AM_RANGE(0x004030, 0x00403f) AM_READ(input_port_3_word_r) AM_MIRROR(0x001000)
3434   AM_RANGE(0x004040, 0x00404f) AM_READ(vertigo_sio_r) AM_MIRROR(0x001000)
35   AM_RANGE(0x004050, 0x00405f) AM_WRITE(vertigo_audio_w) AM_MIRROR(0x001000)
35   AM_RANGE(0x004050, 0x00405f) AM_READWRITE(SMH_RAM, vertigo_audio_w) AM_MIRROR(0x001000)
3636   AM_RANGE(0x004060, 0x00406f) AM_WRITE(vertigo_motor_w) AM_MIRROR(0x001000)
3737   AM_RANGE(0x004070, 0x00407f) AM_WRITE(vertigo_wsot_w) AM_MIRROR(0x001000)
3838   AM_RANGE(0x006000, 0x006007) AM_READWRITE(pit8253_0_lsb_r, pit8253_0_lsb_w)
src/mame/drivers/shuuz.c
r2018r2019
7373static MACHINE_RESET( shuuz )
7474{
7575   atarigen_eeprom_reset();
76   atarigen_interrupt_reset(update_interrupts);
7677   atarivc_reset(machine->primary_screen, atarivc_eof_data, 1);
77   atarigen_interrupt_reset(update_interrupts);
7878}
7979
8080
src/mame/drivers/armedf.c
r2018r2019
13581358
13591359
13601360/*     YEAR, NAME,    PARENT,   MACHINE,  INPUT,    INIT,     MONITOR, COMPANY,         FULLNAME,                          FLAGS */
1361GAME( 1987, legion,   0,        legion,   legion,   legion,   ROT270, "Nichibutsu",     "Legion (ver 2.03)",               GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
1362GAME( 1987, legiono,  legion,   legiono,  legion,   legiono,  ROT270, "Nichibutsu",     "Legion (ver 1.05)",               GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
1361GAME( 1987, legion,   0,        legion,   legion,   legion,   ROT270, "Nichibutsu",     "Chouji Meikyuu Legion (ver 2.03)",               GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
1362GAME( 1987, legiono,  legion,   legiono,  legion,   legiono,  ROT270, "Nichibutsu",     "Chouji Meikyuu Legion (ver 1.05)",               GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
13631363GAME( 1987, terraf,   0,        terraf,   terraf,   terraf,   ROT0,   "Nichibutsu",     "Terra Force (set 1)",             GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
13641364GAME( 1987, terrafa,  terraf,   terraf,   terraf,   terrafu,  ROT0,   "Nichibutsu",     "Terra Force (set 2)",             GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
13651365GAME( 1987, terrafu,  terraf,   terraf,   terraf,   terrafu,  ROT0,   "Nichibutsu USA", "Terra Force (US)",                GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
src/mame/drivers/beezer.c
r2018r2019
5050
5151
5252static INPUT_PORTS_START( beezer )
53   PORT_START   /* IN0 */
53   PORT_START_TAG("IN0")
5454   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
5555   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
5656   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
r2018r2019
6060   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
6161   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
6262
63   PORT_START   /* IN1 */
63   PORT_START_TAG("IN1")
6464   PORT_BIT( 0x0f, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_REVERSE
65   PORT_START   /* IN2 */
65   PORT_START_TAG("IN2")
6666   PORT_BIT( 0x0f, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_REVERSE
6767
68   PORT_START   /* IN3 */
69   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
68   /* Manual says "Dip Switch A" is not used. */
69
70   PORT_START_TAG("DSWB")
71   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SWB:1,2")
7072   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
7173   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
7274   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
73   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
75   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3")
7476   PORT_DIPSETTING(    0x04, "3" )
7577   PORT_DIPSETTING(    0x00, "4" )
76   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
78   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:4")
7779   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
7880   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
79   PORT_DIPNAME( 0x30, 0x10, DEF_STR( Bonus_Life ) )
81   PORT_DIPNAME( 0x30, 0x10, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5,6")
8082   PORT_DIPSETTING(    0x20, "30000" )
8183   PORT_DIPSETTING(    0x10, "60000" )
8284   PORT_DIPSETTING(    0x00, "90000" )
8385   PORT_DIPSETTING(    0x30, DEF_STR( No ) )
84   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
86   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:7,8")
8587   PORT_DIPSETTING(    0xc0, DEF_STR( Easy ) )
8688   PORT_DIPSETTING(    0x80, DEF_STR( Medium ) )
8789   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
r2018r2019
166168   ROM_LOAD( "e1.cpu", 0x100, 0x0100, CRC(3c775c5e) SHA1(ac86f45938c0c9d5fec1245bf86718442baf445b) )
167169ROM_END
168170
169GAME( 1982, beezer,  0,       beezer, beezer, beezer, ORIENTATION_FLIP_X, "Tong Electronic", "Beezer (set 1)", GAME_IMPERFECT_SOUND )
170GAME( 1982, beezer1,  beezer, beezer, beezer, beezer, ORIENTATION_FLIP_X, "Tong Electronic", "Beezer (set 2)", GAME_IMPERFECT_SOUND )
171GAME( 1982, beezer,  0,      beezer, beezer, beezer, ORIENTATION_FLIP_X, "Tong Electronic", "Beezer (set 1)", GAME_IMPERFECT_SOUND )
172GAME( 1982, beezer1, beezer, beezer, beezer, beezer, ORIENTATION_FLIP_X, "Tong Electronic", "Beezer (set 2)", GAME_IMPERFECT_SOUND )
src/mame/drivers/88games.c
r2018r2019
236236//  PORT_DIPSETTING(    0x00, "Disabled" )
237237
238238   PORT_START_TAG("DSW2")
239   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) )      PORT_DIPLOCATION("SW2:1")
240   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
241   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
239   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" )
242240   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SW2:2,3")
243241   PORT_DIPSETTING(    0x06, DEF_STR( Cocktail ) )
244242   PORT_DIPSETTING(    0x04, "Cocktail (A)" )
245243   PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
246244   PORT_DIPSETTING(    0x00, "Upright (D)" )
247   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )      PORT_DIPLOCATION("SW2:4")
248   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
249   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
250   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )      PORT_DIPLOCATION("SW2:5")
251   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
252   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
245   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW2:4" )
246   PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW2:5" )
253247   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:6,7")
254248   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
255249   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
src/mame/drivers/spbactn.c
r2018r2019
337337};
338338
339339static GFXDECODE_START( spbactn )
340   GFXDECODE_ENTRY( REGION_GFX1, 0, fgtilelayout,   0x0200, 16384  )
341   GFXDECODE_ENTRY( REGION_GFX2, 0, bgtilelayout,   0x0300, 16384  )
342   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,   0x0000, 16384  )
340   GFXDECODE_ENTRY( REGION_GFX1, 0, fgtilelayout,   0x0200, 16 + 240 )
341   GFXDECODE_ENTRY( REGION_GFX2, 0, bgtilelayout,   0x0300, 16 + 128 )
342   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,   0x0000, 16 + 384 )
343343GFXDECODE_END
344344
345345static void irqhandler(int linestate)
src/mame/drivers/tank8.c
r2018r2019
358358
359359   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
360360   MDRV_SOUND_CONFIG_DISCRETE(tank8)
361   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
361   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
362362MACHINE_DRIVER_END
363363
364364
src/mame/drivers/mw8080bw.c
r2018r2019
20082008 *************************************/
20092009
20102010#define SPCENCTR_STROBE_FREQ      (9.00)  /* Hz - calculated from the 555 timer */
2011#define SPCENCTR_STROBE_PERIOD      ATTOTIME_IN_HZ(SPCENCTR_STROBE_FREQ)
2012#define SPCENCTR_DUTY_CYCLE         (95) /* % */
2011#define SPCENCTR_STROBE_DUTY_CYCLE   (95)    /* % */
20132012
20142013
2015static emu_timer *spcenctr_strobe_on_timer;
2016static emu_timer *spcenctr_strobe_off_timer;
20172014static UINT8 spcenctr_strobe_state;
20182015static UINT8 spcenctr_trench_width;
20192016static UINT8 spcenctr_trench_center;
20202017static UINT8 spcenctr_trench_slope[16];  /* 16x4 bit RAM */
20212018
20222019
2023static void adjust_strobe_timers(void)
2020static TIMER_DEVICE_CALLBACK( spcenctr_strobe_timer_callback )
20242021{
2025   /* the strobe light is controlled by a 555 timer, which appears to have a
2026       frequency of 9Hz and a duty cycle of 95% */
2027   if (spcenctr_strobe_state)
2028   {
2029      /* multiply by the precentage and divide by 100 to get the ON period */
2030      attotime on_period = attotime_div(attotime_mul(SPCENCTR_STROBE_PERIOD, SPCENCTR_DUTY_CYCLE), 100);
2031
2032      timer_adjust_periodic(spcenctr_strobe_on_timer, attotime_zero, 1, SPCENCTR_STROBE_PERIOD);
2033      timer_adjust_periodic(spcenctr_strobe_off_timer, on_period, 0, SPCENCTR_STROBE_PERIOD);
2034   }
2035   else
2036   {
2037      timer_adjust_oneshot(spcenctr_strobe_on_timer, attotime_never, 0);
2038      timer_adjust_oneshot(spcenctr_strobe_off_timer, attotime_zero, 0);
2039   }
2022   output_set_value("STROBE", param && spcenctr_strobe_state);
20402023}
20412024
20422025
2043static TIMER_CALLBACK( spcenctr_strobe_timer_callback )
2044{
2045   output_set_value("STROBE", param);
2046}
2047
2048
20492026static MACHINE_START( spcenctr )
20502027{
2051   /* create timers */
2052   spcenctr_strobe_on_timer = timer_alloc(spcenctr_strobe_timer_callback, NULL);
2053   spcenctr_strobe_off_timer = timer_alloc(spcenctr_strobe_timer_callback, NULL);
2054
20552028   /* setup for save states */
20562029   state_save_register_global(spcenctr_strobe_state);
20572030   state_save_register_global(spcenctr_trench_width);
20582031   state_save_register_global(spcenctr_trench_center);
20592032   state_save_register_global_array(spcenctr_trench_slope);
2060   state_save_register_func_postload(adjust_strobe_timers);
20612033
20622034   MACHINE_START_CALL(mw8080bw);
20632035}
r2018r2019
20652037
20662038void spcenctr_set_strobe_state(UINT8 data)
20672039{
2068   if (data != spcenctr_strobe_state)
2069   {
2070      spcenctr_strobe_state = data;
2071
2072      adjust_strobe_timers();
2073   }
2040   spcenctr_strobe_state = data;
20742041}
20752042
20762043
r2018r2019
20932060
20942061
20952062static WRITE8_HANDLER( spcenctr_io_w )
2096{                              /* A7 A6 A5 A4 A3 A2 A1 A0 */
2063{                                    /* A7 A6 A5 A4 A3 A2 A1 A0 */
20972064   if ((offset & 0x07) == 0x02)
2098   {
2099      watchdog_reset_w(machine, 0, data);      /* -  -  -  -  -  0  1  0 */
2100   }
2065      watchdog_reset_w(machine, 0, data);      /*  -  -  -  -  -  0  1  0 */
2066
21012067   else if ((offset & 0x5f) == 0x01)
2102   {
2103      spcenctr_audio_1_w(machine, 0, data);   /* -  0  -  0  0  0  0  1 */
2104   }
2068      spcenctr_audio_1_w(machine, 0, data);   /*  -  0  -  0  0  0  0  1 */
2069
21052070   else if ((offset & 0x5f) == 0x09)
2106   {
2107      spcenctr_audio_2_w(machine, 0, data);   /* -  0  -  0  1  0  0  1 */
2108   }
2071      spcenctr_audio_2_w(machine, 0, data);   /*  -  0  -  0  1  0  0  1 */
2072
21092073   else if ((offset & 0x5f) == 0x11)
2110   {
2111      spcenctr_audio_3_w(machine, 0, data);   /* -  0  -  1  0  0  0  1 */
2112   }
2074      spcenctr_audio_3_w(machine, 0, data);   /*  -  0  -  1  0  0  0  1 */
2075
21132076   else if ((offset & 0x07) == 0x03)
2114   {                           /* -  -  -  -  -  0  1  1 */
2077   {                                 /* -  -  -  -  -  0  1  1 */
21152078      UINT8 addr = ((offset & 0xc0) >> 4) | ((offset & 0x18) >> 3);
21162079      spcenctr_trench_slope[addr] = data;
21172080   }
21182081   else if ((offset & 0x07) == 0x04)
2119   {
2120      spcenctr_trench_center = data;   /* -  -  -  -  -  1  0  0 */
2121   }
2082      spcenctr_trench_center = data;         /*  -  -  -  -  -  1  0  0 */
2083
21222084   else if ((offset & 0x07) == 0x07)
2123   {
2124      spcenctr_trench_width = data;   /* -  -  -  -  -  1  1  1 */
2125   }
2085      spcenctr_trench_width = data;         /*  -  -  -  -  -  1  1  1 */
2086
21262087   else
2127   {
2128      logerror("%04x:  Unmapped I/O port write to %02x = %02x\n",
2129             activecpu_get_pc(), offset, data);
2130   }
2088      logerror("%04x:  Unmapped I/O port write to %02x = %02x\n", activecpu_get_pc(), offset, data);
21312089}
21322090
21332091
r2018r2019
22022160   MDRV_MACHINE_START(spcenctr)
22032161   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
22042162
2163   /* timers */
2164   MDRV_TIMER_ADD_PERIODIC("STROBE_ON", spcenctr_strobe_timer_callback, HZ(SPCENCTR_STROBE_FREQ))
2165   MDRV_TIMER_PARAM(TRUE)   /* indicates strobe ON */
2166
2167   MDRV_TIMER_ADD_PERIODIC("STROBE_OFF", spcenctr_strobe_timer_callback, HZ(SPCENCTR_STROBE_FREQ))
2168   MDRV_TIMER_START_DELAY(HZ(SPCENCTR_STROBE_FREQ * 100 / SPCENCTR_STROBE_DUTY_CYCLE))
2169   MDRV_TIMER_PARAM(FALSE)   /* indicates strobe OFF */
2170
22052171   /* video hardware */
22062172   MDRV_VIDEO_UPDATE(spcenctr)
22072173
src/mame/drivers/lethalj.c
r2018r2019
539539
540540   MDRV_SOUND_ADD(OKIM6295, SOUND_CLOCK)
541541   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high)
542   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
542   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.26)
543543
544544   MDRV_SOUND_ADD(OKIM6295, SOUND_CLOCK)
545545   MDRV_SOUND_CONFIG(okim6295_interface_region_2_pin7high)
546   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
546   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.26)
547547
548548   MDRV_SOUND_ADD(OKIM6295, SOUND_CLOCK)
549549   MDRV_SOUND_CONFIG(okim6295_interface_region_3_pin7high)
550   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
550   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.26)
551551MACHINE_DRIVER_END
552552
553553
src/mame/drivers/bbusters.c
r2018r2019
168168
169169after adding the mechanized attack u.s. roms i suspect that there is more than just a few bytes changed ;-)
170170
171
172RansAckeR's notes:
173
174bbusters:
175
176If you only calibrate the P1 gun or do not hit the correct spots for all guns
177you will get either garbage or a black screen when rebooting.
178According to the manual this happens when the eprom contains invalid gun aim data.
179
180If you calibrate the guns correctly the game runs as expected:
1811) Using P1 controls fire at the indicated spots.
1822) Using P2 controls fire at the indicated spots.
1833) Using P3 controls fire at the indicated spots.
184
185
171186***************************************************************************/
172187
173188#include "driver.h"
r2018r2019
435450   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
436451
437452   PORT_START_TAG("DSW1")   /* Dip switch bank 1 */
438   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) )
453   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SW1:1")
439454   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
440455   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
441   PORT_DIPNAME( 0x06, 0x06, "Magazine / Grenade" )
456   PORT_DIPNAME( 0x06, 0x06, "Magazine / Grenade" )      PORT_DIPLOCATION("SW1:2,3")
442457   PORT_DIPSETTING(    0x04, "5 / 2" )
443458   PORT_DIPSETTING(    0x06, "7 / 3" )
444459   PORT_DIPSETTING(    0x02, "9 / 4" )
445460   PORT_DIPSETTING(    0x00, "12 / 5" )
446   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_A ) )
461   /* Manual (from a different revision/region?) says:
462                        SW1:4   SW1:5   SW1:6
463    1C_1C 1 To continue OFF     OFF     OFF
464    2C_1C 1 To continue ON      OFF     OFF
465    1C_2C 1 To continue OFF     ON      OFF
466    2C_1C 2 To continue ON      ON      OFF
467    3C_1C 1 To continue OFF     OFF     ON
468    3C_1C 2 To continue ON      OFF     ON
469    4C_3C 1 To continue OFF     ON      ON
470    Free Play Mode      OFF     OFF     OFF
471
472    SW1:7 Unused
473    SW1:8 Blood color: ON=green OFF=red */
474   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_A ) )         PORT_DIPLOCATION("SW1:4,5")
447475   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
448476   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
449477   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
450478   PORT_DIPSETTING(    0x18, DEF_STR( 1C_1C ) )
451   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_B ) )
479   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_B ) )         PORT_DIPLOCATION("SW1:6,7")
452480   PORT_DIPSETTING(    0x60, DEF_STR( 1C_2C ) )
453481   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
454482   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
455483   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
456   PORT_DIPNAME( 0x80, 0x80, "Coin Slots" )         // See notes
484   PORT_DIPNAME( 0x80, 0x80, "Coin Slots" )            PORT_DIPLOCATION("SW1:8") // See notes
457485   PORT_DIPSETTING(    0x80, "Common" )
458486   PORT_DIPSETTING(    0x00, "Individual" )
459487
460488   PORT_START_TAG("DSW2")   /* Dip switch bank 2 */
461   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
489   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )      PORT_DIPLOCATION("SW2:1,2")
462490   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
463491   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
464492   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
465493   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
466   PORT_DIPNAME( 0x0c, 0x0c, "Game Mode" )
494   PORT_DIPNAME( 0x0c, 0x0c, "Game Mode" )               PORT_DIPLOCATION("SW2:3,4")
467495   PORT_DIPSETTING(    0x08, "Demo Sounds Off" )
468496   PORT_DIPSETTING(    0x0c, "Demo Sounds On" )
469497   PORT_DIPSETTING(    0x04, "Infinite Energy (Cheat)")
470498   PORT_DIPSETTING(    0x00, "Freeze" )
471   PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW )
472   PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW )
473   PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW )
474    PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
499   PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW2:5" )         /* Listed as "Unused" */
500   PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW2:6" )         /* Listed as "Unused" */
501   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" )         /* Listed as "Unused" */
502   PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_LOW, "SW2:8" )
475503
476504   PORT_START_TAG("IN5")
477505   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(1)
r2018r2019
518546   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
519547
520548   PORT_START_TAG("DSW1")   /* Dip switch bank 1 */
521   PORT_DIPNAME( 0x0001, 0x0001, "Coin Slots" )      // See notes
549   PORT_DIPNAME( 0x0001, 0x0001, "Coin Slots" )            PORT_DIPLOCATION("SW1:1") // Listed as "Unused" (manual from different revision/region?), See notes
522550   PORT_DIPSETTING(      0x0001, "Common" )
523551   PORT_DIPSETTING(      0x0000, "Individual" )
524   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Allow_Continue ) )
552   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SW1:2")
525553   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
526554   PORT_DIPSETTING(      0x0002, DEF_STR( Yes ) )
527   PORT_DIPNAME( 0x000c, 0x000c, "Magazine / Grenade" )
555   PORT_DIPNAME( 0x000c, 0x000c, "Magazine / Grenade" )      PORT_DIPLOCATION("SW1:3,4")
528556   PORT_DIPSETTING(      0x0008, "5 / 2" )
529557   PORT_DIPSETTING(      0x000c, "6 / 3" )
530558   PORT_DIPSETTING(      0x0004, "7 / 4" )
531559   PORT_DIPSETTING(      0x0000, "8 / 5" )
532   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )   // See notes
560   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )         PORT_DIPLOCATION("SW1:5,6") // See notes
533561   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
534562   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )
535563   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )
536564   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )
537   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )   // See notes
565   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )         PORT_DIPLOCATION("SW1:7,8") // Listed as "Unused" (manual from different revision/region?), See notes
538566   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )
539567   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )
540568   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_3C ) )
541569   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_4C ) )
542   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) )
570   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) )      PORT_DIPLOCATION("SW2:1,2")
543571   PORT_DIPSETTING(      0x0200, DEF_STR( Easy ) )
544572   PORT_DIPSETTING(      0x0300, DEF_STR( Normal ) )
545573   PORT_DIPSETTING(      0x0100, DEF_STR( Hard ) )
546574   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
547   PORT_DIPNAME( 0x0c00, 0x0c00, "Game Mode" )
575   PORT_DIPNAME( 0x0c00, 0x0c00, "Game Mode" )               PORT_DIPLOCATION("SW2:3,4")
548576   PORT_DIPSETTING(      0x0800, "Demo Sounds Off" )
549577   PORT_DIPSETTING(      0x0c00, "Demo Sounds On" )
550578   PORT_DIPSETTING(      0x0400, "Infinite Energy (Cheat)")
551579   PORT_DIPSETTING(      0x0000, "Freeze" )
552   PORT_DIPUNUSED( 0x1000, IP_ACTIVE_LOW )
553   PORT_DIPUNUSED( 0x2000, IP_ACTIVE_LOW )
554   PORT_DIPUNUSED( 0x4000, IP_ACTIVE_LOW )
555    PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
580   PORT_DIPUNUSED_DIPLOC(0x1000, 0x1000, "SW2:5" )         /* Listed as "Unused" */
581   PORT_DIPUNUSED_DIPLOC(0x2000, 0x2000, "SW2:6" )         /* Listed as "Unused" */
582   PORT_DIPUNUSED_DIPLOC(0x4000, 0x4000, "SW2:7" )         /* Listed as "Unused" */
583   PORT_SERVICE_DIPLOC(  0x8000, IP_ACTIVE_LOW, "SW2:8" )
556584
557585   PORT_START_TAG("IN2")
558586   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(1)
src/mame/drivers/flstory.c
r2018r2019
231231
232232   /* this definitely controls main melody voice on 2'-1 and 4'-1 outputs */
233233   sndti_set_output_gain(SOUND_MSM5232, 0, 0, vol_ctrl[ (snd_ctrl0>>4) & 15 ] / 100.0);   /* group1 from msm5232 */
234   sndti_set_output_gain(SOUND_MSM5232, 0, 1, vol_ctrl[ (snd_ctrl0>>4) & 15 ] / 100.0);   /* group1 from msm5232 */
235   sndti_set_output_gain(SOUND_MSM5232, 0, 2, vol_ctrl[ (snd_ctrl0>>4) & 15 ] / 100.0);   /* group1 from msm5232 */
236   sndti_set_output_gain(SOUND_MSM5232, 0, 3, vol_ctrl[ (snd_ctrl0>>4) & 15 ] / 100.0);   /* group1 from msm5232 */
234237
235238}
236239static WRITE8_HANDLER( sound_control_1_w )
237240{
238241   snd_ctrl1 = data & 0xff;
239242//  popmessage("SND1 0=%02x 1=%02x 2=%02x 3=%02x", snd_ctrl0, snd_ctrl1, snd_ctrl2, snd_ctrl3);
240   sndti_set_output_gain(SOUND_MSM5232, 0, 1, vol_ctrl[ (snd_ctrl1>>4) & 15 ] / 100.0);   /* group2 from msm5232 */
243   sndti_set_output_gain(SOUND_MSM5232, 0, 4, vol_ctrl[ (snd_ctrl1>>4) & 15 ] / 100.0);   /* group2 from msm5232 */
244   sndti_set_output_gain(SOUND_MSM5232, 0, 5, vol_ctrl[ (snd_ctrl1>>4) & 15 ] / 100.0);   /* group2 from msm5232 */
245   sndti_set_output_gain(SOUND_MSM5232, 0, 6, vol_ctrl[ (snd_ctrl1>>4) & 15 ] / 100.0);   /* group2 from msm5232 */
246   sndti_set_output_gain(SOUND_MSM5232, 0, 7, vol_ctrl[ (snd_ctrl1>>4) & 15 ] / 100.0);   /* group2 from msm5232 */
241247}
242248
243249static WRITE8_HANDLER( sound_control_2_w )
r2018r2019
721727
722728   MDRV_SOUND_ADD(MSM5232, 2000000)
723729   MDRV_SOUND_CONFIG(msm5232_interface)
724   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
730   MDRV_SOUND_ROUTE(0, "mono", 1.0)   // pin 28  2'-1
731   MDRV_SOUND_ROUTE(1, "mono", 1.0)   // pin 29  4'-1
732   MDRV_SOUND_ROUTE(2, "mono", 1.0)   // pin 30  8'-1
733   MDRV_SOUND_ROUTE(3, "mono", 1.0)   // pin 31 16'-1
734   MDRV_SOUND_ROUTE(4, "mono", 1.0)   // pin 36  2'-2
735   MDRV_SOUND_ROUTE(5, "mono", 1.0)   // pin 35  4'-2
736   MDRV_SOUND_ROUTE(6, "mono", 1.0)   // pin 34  8'-2
737   MDRV_SOUND_ROUTE(7, "mono", 1.0)   // pin 33 16'-2
738   // pin 1 SOLO  8'       not mapped
739   // pin 2 SOLO 16'       not mapped
740   // pin 22 Noise Output  not mapped
725741
726742   MDRV_SOUND_ADD(DAC, 0)
727743   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
r2018r2019
769785
770786   MDRV_SOUND_ADD(MSM5232, 2000000)
771787   MDRV_SOUND_CONFIG(msm5232_interface)
772   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
788   MDRV_SOUND_ROUTE(0, "mono", 1.0)   // pin 28  2'-1
789   MDRV_SOUND_ROUTE(1, "mono", 1.0)   // pin 29  4'-1
790   MDRV_SOUND_ROUTE(2, "mono", 1.0)   // pin 30  8'-1
791   MDRV_SOUND_ROUTE(3, "mono", 1.0)   // pin 31 16'-1
792   MDRV_SOUND_ROUTE(4, "mono", 1.0)   // pin 36  2'-2
793   MDRV_SOUND_ROUTE(5, "mono", 1.0)   // pin 35  4'-2
794   MDRV_SOUND_ROUTE(6, "mono", 1.0)   // pin 34  8'-2
795   MDRV_SOUND_ROUTE(7, "mono", 1.0)   // pin 33 16'-2
796   // pin 1 SOLO  8'       not mapped
797   // pin 2 SOLO 16'       not mapped
798   // pin 22 Noise Output  not mapped
773799
774800   MDRV_SOUND_ADD(DAC, 0)
775801   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
r2018r2019
817843
818844   MDRV_SOUND_ADD(MSM5232, 2000000)
819845   MDRV_SOUND_CONFIG(msm5232_interface)
820   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
846   MDRV_SOUND_ROUTE(0, "mono", 1.0)   // pin 28  2'-1
847   MDRV_SOUND_ROUTE(1, "mono", 1.0)   // pin 29  4'-1
848   MDRV_SOUND_ROUTE(2, "mono", 1.0)   // pin 30  8'-1
849   MDRV_SOUND_ROUTE(3, "mono", 1.0)   // pin 31 16'-1
850   MDRV_SOUND_ROUTE(4, "mono", 1.0)   // pin 36  2'-2
851   MDRV_SOUND_ROUTE(5, "mono", 1.0)   // pin 35  4'-2
852   MDRV_SOUND_ROUTE(6, "mono", 1.0)   // pin 34  8'-2
853   MDRV_SOUND_ROUTE(7, "mono", 1.0)   // pin 33 16'-2
854   // pin 1 SOLO  8'       not mapped
855   // pin 2 SOLO 16'       not mapped
856   // pin 22 Noise Output  not mapped
821857
822858   MDRV_SOUND_ADD(DAC, 0)
823859   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
src/mame/drivers/sangho.c
r2018r2019
227227
228228static VIDEO_START( sangho )
229229{
230   v9938_init (machine, 0, tmpbitmap, MODEL_V9938, 0x20000, msx_vdp_interrupt);
230   VIDEO_START_CALL(generic_bitmapped);
231   v9938_init (machine, 0, machine->primary_screen, tmpbitmap, MODEL_V9938, 0x20000, msx_vdp_interrupt);
231232}
232233
233234static MACHINE_DRIVER_START(pzlestar)
src/mame/drivers/sshangha.c
r2018r2019
371371
372372   MDRV_SOUND_ADD(YM2203, 16000000/4)
373373   MDRV_SOUND_CONFIG(ym2203_interface)
374   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.60)
375   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.60)
374   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.33)
375   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.33)
376376
377377   MDRV_SOUND_ADD(OKIM6295, 1023924)
378378   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified
379   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.50)
380   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.50)
379   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.27)
380   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.27)
381381MACHINE_DRIVER_END
382382
383383/******************************************************************************/
src/mame/drivers/pitnrun.c
r2018r2019
284284GFXDECODE_END
285285
286286static MACHINE_DRIVER_START( pitnrun )
287   MDRV_CPU_ADD(Z80,XTAL_18_432MHz/12)       /* verified on pcb */
287   MDRV_CPU_ADD(Z80,XTAL_18_432MHz/6)       /* verified on pcb */
288288   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
289289   MDRV_CPU_VBLANK_INT("main", pitnrun_nmi_source)
290290
r2018r2019
294294   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
295295   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
296296
297   MDRV_CPU_ADD(M68705,XTAL_18_432MHz/12)       /* verified on pcb */
297   MDRV_CPU_ADD(M68705,XTAL_18_432MHz/6)       /* verified on pcb */
298298   MDRV_CPU_PROGRAM_MAP(mcu_readmem,mcu_writemem)
299299
300300   MDRV_MACHINE_RESET(pitnrun)
src/mame/drivers/bionicc.c
r2018r2019
202202   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1 )
203203
204204   PORT_START
205   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
205   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SWB:1,2,3")
206206   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
207207   PORT_DIPSETTING(      0x0001, DEF_STR( 3C_1C ) )
208208   PORT_DIPSETTING(      0x0002, DEF_STR( 2C_1C ) )
r2018r2019
211211   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
212212   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
213213   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_6C ) )
214   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
214   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SWB:4,5,6")
215215   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
216216   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
217217   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
r2018r2019
220220   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
221221   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
222222   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_6C ) )
223   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
224   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
223   PORT_SERVICE_DIPLOC(  0x0040, IP_ACTIVE_LOW, "SWB:7" )
224   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SWB:8")
225225   PORT_DIPSETTING(      0x0080, DEF_STR( Off ))
226226   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
227   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
227   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWA:1,2")
228228   PORT_DIPSETTING(      0x0300, "3" )
229229   PORT_DIPSETTING(      0x0200, "4" )
230230   PORT_DIPSETTING(      0x0100, "5" )
231231   PORT_DIPSETTING(      0x0000, "7" )
232   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Cabinet ) )
232   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SWA:3")
233233   PORT_DIPSETTING(      0x0400, DEF_STR( Upright ) )
234234   PORT_DIPSETTING(      0x0000, DEF_STR( Cocktail ) )
235   PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Bonus_Life ) )
235   PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWA:4,5")
236236   PORT_DIPSETTING(      0x1800, "20K, 40K, every 60K")
237237   PORT_DIPSETTING(      0x1000, "30K, 50K, every 70K" )
238238   PORT_DIPSETTING(      0x0800, "20K and 60K only")
239239   PORT_DIPSETTING(      0x0000, "30K and 70K only" )
240   PORT_DIPNAME( 0x6000, 0x4000, DEF_STR( Difficulty ) )
240   PORT_DIPNAME( 0x6000, 0x4000, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWA:6,7")
241241   PORT_DIPSETTING(      0x4000, DEF_STR( Easy ) )
242242   PORT_DIPSETTING(      0x6000, DEF_STR( Medium ))
243243   PORT_DIPSETTING(      0x2000, DEF_STR( Hard ))
244244   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
245   PORT_DIPNAME( 0x8000, 0x8000, "Freeze" )
245   PORT_DIPNAME( 0x8000, 0x8000, "Freeze" )            PORT_DIPLOCATION("SWA:8") /* Listed as "Unused" */
246246   PORT_DIPSETTING(      0x8000, DEF_STR( Off ))
247247   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
248248
src/mame/drivers/beathead.c
r2018r2019
141141   int scanline = param;
142142
143143   /* update the video */
144   video_screen_update_now(0);
144   video_screen_update_now(machine->primary_screen);
145145
146146   /* on scanline zero, clear any halt condition */
147147   if (scanline == 0)
src/mame/drivers/vicdual.c
r2018r2019
215215
216216static WRITE8_HANDLER( vicdual_videoram_w )
217217{
218   video_screen_update_now(0);
218   video_screen_update_now(machine->primary_screen);
219219   vicdual_videoram[offset] = data;
220220}
221221
r2018r2019
228228
229229static WRITE8_HANDLER( vicdual_characterram_w )
230230{
231   video_screen_update_now(0);
232
231   video_screen_update_now(machine->primary_screen);
233232   vicdual_characterram[offset] = data;
234233}
235234
src/mame/drivers/magicfly.c
r2018r2019
2727
2828    - CPU  1x R6502P
2929    - CRTC 1x MC6845P
30    - RAMs 1x MK48Z02B-20  (2K*8)  (near prg ROM)
31           2x HM6116LP-4   (2K*8)  (near GFX ROMs)
30    - RAMs 1x MK48Z02B-20  CMOS 2K*8 zeropower SRAM (near prg ROM)
31           2x HM6116LP-4   2K*8 SRAM (near GFX ROMs)
3232    - CLK  1x oscillator 10.000 MHz
3333
3434    - ROMs 1x AM27128      (NS3.1)
r2018r2019
3636           1x SGS M2764    (NS1)
3737    - PLDs 1x PAL16R4A     (read protected)
3838
39    - 1x TDA 2002      (8W. car radio audio amplifier)
40    - 3x OUAZ SS-112D  (relay 1 pole 12v)
3941    - 1x 4 DIP switches
4042    - 1x 30x2 edge connector
4143    - 1x 10 pins male connector
42    - 1x trimmer (volume)
44    - 2x trimmer (audio?)
4345
4446
4547    PCB Layout:
r2018r2019
7678    | | HM6116       |    ________       _________                ____|
7779    | | o MSM2128    |   | 74LS08 |     | 74LS174 |               ____|
7880    | |______________|   |________|     |_________|               ____|
79    |  ________________   __________                              ____|
80    | |                | | PAL16R4A |                             ____|
81    | |     2764       | |__________|                             ____|
82    | |________________|  __________                              ____|
81    |  ________________   __________           ______             ____|
82    | |                | | PAL16R4A |         | TDA  |-           ____|
83    | |     2764       | |__________|         | 2002 |-           ____|
84    | |________________|  __________          |______|-           ____|
8385    |  ________________  | 74LS166  |                             ____|
84    | |                | |__________|                            |
85    | |     2764       |  __________                             |
86    | |________________| | 74LS166  |                            |____
87    |  ________________  |__________|                               __|
88    | |                |  __________       _________               |  |
89    | |     2764       | | 74LS166  |     | 74LS05  |              |8 |  10
90    | |________________| |__________|     |_________|              |8 |  pins
91    |  ________  ______   __________       _________               |8 |  male
92    | | 74LS04 || osc. | | 74LS193  |     | 74LS86  |              |8 |  connector
93    | |________||10 MHz| |__________|     |_________|              |8 |
94    |           |______|                                           |__|
86    | |                | |__________|      _                     |
87    | |     2764       |  __________     /   \                   |
88    | |________________| | 74LS166  |   | pot |                  |____
89    |  ________________  |__________|    \ _ /                      __|
90    | |                |  __________       _________         ______|  |
91    | |     2764       | | 74LS166  |     | 74LS05  |   _   |ss112d|8 |  10
92    | |________________| |__________|     |_________| /   \ |______|8 |  pins
93    |  ________  ______   __________       _________ | pot ||ss112d|8 |  male
94    | | 74LS04 || osc. | | 74LS193  |     | 74LS86  | \ _ / |______|8 |  connector
95    | |________||10 MHz| |__________|     |_________|       |ss112d|8 |
96    |           |______|                                    |______|__|
9597    |_________________________________________________________________|
9698
9799
r2018r2019
182184        ($56 - $58)      ; Store credits value (shown in the game under "Secondi").
183185        ($5A - $5C)      ; Store bonus value (shown in the game under "Credits").
184186        ($5E - $5F)      ; Store values to be written in video and color ram, respectively.
187        ($63 - $63)      ; Store position of marker/cursor (0-4).
185188        ($66 - $66)      ; Store number of baloon to be risen.
186189        ($67 - $67)      ; Program compare the content with 0x02, 0x03, 0x04, 0x05 and 0xE1.
187190                         ; If 0xE1 is found here, the machine hangs showing "I/O ERROR" (see code at $C1A2).
r2018r2019
217220    $3000 - $3000    Input selector  ; Only writes. NMI write 0x01, 0x02, 0x04, 0x08.
218221                                     ; Main code at $C152 do a complex loop with boolean operations and write 0x00/0x80 here.
219222
220    $C000 - $FFFF    ROM        ; Program ROMs.
223    $C000 - $FFFF    ROM space       ; Program ROMs.
221224
222225
223226*******************************************************************************
r2018r2019
300303    - Cleaned up and optimized the driver.
301304    - Reworked/updated technical notes.
302305
306    [2008-03-14]
307    - Completed the component list & PCB layout.
308    - Added technical references to register $63 (magicfly).
309    - Switched crystal to new predefined format.
303310
311
304312    TODO:
305313
306314    - Correct colors. (where is the palette?)
r2018r2019
311319*******************************************************************************/
312320
313321
314#define MASTER_CLOCK   10000000   /* 10MHz */
322#define MASTER_CLOCK   XTAL_10MHz
315323
316324#include "driver.h"
317325#include "video/mc6845.h"
src/mame/drivers/centiped.c
r2018r2019
431431static UINT8 dsw_select, control_select;
432432static UINT8 *rambase;
433433
434static emu_timer *interrupt_timer;
435434
436
437435/*************************************
438436 *
439437 *  Interrupts
440438 *
441439 *************************************/
442440
443static TIMER_CALLBACK( generate_interrupt )
441static TIMER_DEVICE_CALLBACK( generate_interrupt )
444442{
445443   int scanline = param;
446444
447445   /* IRQ is clocked on the rising edge of 16V, equal to the previous 32V */
448446   if (scanline & 16)
449      cpunum_set_input_line(machine, 0, 0, ((scanline - 1) & 32) ? ASSERT_LINE : CLEAR_LINE);
447      cpunum_set_input_line(timer->machine, 0, 0, ((scanline - 1) & 32) ? ASSERT_LINE : CLEAR_LINE);
450448
451449   /* do a partial update now to handle sprite multiplexing (Maze Invaders) */
452   video_screen_update_partial(machine->primary_screen, scanline);
453
454   /* call back again after 16 scanlines */
455   scanline += 16;
456   if (scanline >= 256)
457      scanline = 0;
458
459   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline);
450   video_screen_update_partial(timer->machine->primary_screen, scanline);
460451}
461452
462453
r2018r2019
470461
471462static MACHINE_RESET( centiped )
472463{
473   interrupt_timer = timer_alloc(generate_interrupt, NULL);
474   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0);
475464   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
476465   dsw_select = 0;
477466   control_select = 0;
r2018r2019
16351624   MDRV_MACHINE_RESET(centiped)
16361625   MDRV_NVRAM_HANDLER(atari_vg)
16371626
1627   /* timer */
1628   MDRV_TIMER_ADD_SCANLINE("32V", generate_interrupt, "main", 0, 16)
1629
16381630   /* video hardware */
16391631   MDRV_SCREEN_ADD("main", RASTER)
16401632   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/mpu4drvr.c
r2018r2019
169169-----------+---+-----------------+--------------------------------------------------------------------------
170170 C000-FFFF | R | D D D D D D D D | ROM
171171-----------+---+-----------------+--------------------------------------------------------------------------
172TODO: - Confirm that MC6850 emulation is sufficient.
172TODO: - Craft bespoke 6850 core from MC6850 emulation.
173173      - MPU4 Master clock value taken from schematic, but 68k value is not.
174      - Deal 'Em changes its inputs depending on the cabinet, need conditional support
175      - Deal 'Em also has bad tiles (apostrophe and bottom corner), black should actually be transparent
174      - Deal 'Em lockouts vary on certain cabinets (normally connected to AUX, but not there?)
175      - Deal 'Em has bad tiles (apostrophe, logo, bottom corner), black should actually be transparent
176176      - to give black on green.
177177*****************************************************************************************/
178178
r2018r2019
11751175   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
11761176
11771177   PORT_START_TAG("ORANGE2")
1178   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN5) PORT_NAME("20p Token")PORT_IMPULSE(3)
1179   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
1178   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN5) PORT_NAME("20p Token")PORT_IMPULSE(5)
1179   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x04)
1180   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x05)
1181   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x06)
1182   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x07)
1183   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x08)
1184   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x09)
11801185   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
11811186   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
11821187   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
r2018r2019
11871192   PORT_START_TAG("BLACK1")
11881193   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Gamble")
11891194   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Pontoon")
1190   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
1191   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
1195   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x01)
1196   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x09)
1197   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x03)
1198   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x04)
1199   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x05)
1200   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x06)
1201   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x07)
1202   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x08)
11921203   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
11931204   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Button") PORT_CODE(KEYCODE_W)
11941205   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE
11951206   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Rear Door")  PORT_CODE(KEYCODE_Q) PORT_TOGGLE
11961207
11971208   PORT_START_TAG("BLACK2")
1198   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo")
1209   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x00)
1210   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x02)
11991211   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
12001212   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("Twist")
12011213   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Lo")
r2018r2019
12701282   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SPECIAL)
12711283   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SPECIAL)
12721284   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SPECIAL)
1273   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5)
1285   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x00)
1286   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x01)
1287   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x02)
1288   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x03)
12741289   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5)
12751290   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5)
12761291   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5)
r2018r2019
13981413
13991414/* TODO: Fix up MPU4 map*/
14001415static ADDRESS_MAP_START( mpu4_6809_map, ADDRESS_SPACE_PROGRAM, 8 )
1401   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
1416   AM_RANGE(0x0000, 0x07FF) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
14021417
14031418   AM_RANGE(0x0800, 0x0800) AM_READWRITE(acia6850_0_stat_r, acia6850_0_ctrl_w)
14041419   AM_RANGE(0x0801, 0x0801) AM_READWRITE(acia6850_0_data_r, acia6850_0_data_w)
r2018r2019
14141429   AM_RANGE(0x0E00, 0x0E03) AM_READWRITE(pia_4_r,pia_4_w)      // PIA6821 IC7
14151430   AM_RANGE(0x0F00, 0x0F03) AM_READWRITE(pia_5_r,pia_5_w)      // PIA6821 IC8
14161431
1417   AM_RANGE(0x4000, 0x40ff) AM_RAM // it actually runs code from here...
1432   AM_RANGE(0x4000, 0x40FF) AM_RAM // it actually runs code from here...
14181433
14191434   AM_RANGE(0xBE00, 0xBFFF) AM_RAM //00 written on startup
14201435   AM_RANGE(0xC000, 0xFFFF) AM_ROM   AM_REGION(REGION_CPU1,0)  // 64k EPROM on board, only this region read
r2018r2019
14941509  Blue:     470R
14951510            220R    Bit 7
14961511
1512  Everything is also tied to a 1K pulldown
14971513***************************************************************************/
14981514
14991515static PALETTE_INIT( dealem )
r2018r2019
15041520   double weights_r[3], weights_g[3], weights_b[2];
15051521
15061522   compute_resistor_weights(0,   255,   -1.0,
1507         3,   resistances_rg,   weights_r,   0,   0,
1508         3,   resistances_rg,   weights_g,   0,   0,
1509         2,   resistances_b,   weights_b,   0,   0);
1523         3,   resistances_rg,   weights_r,   1000,   0,
1524         3,   resistances_rg,   weights_g,   1000,   0,
1525         2,   resistances_b,   weights_b,   1000,   0);
15101526
15111527   for (i = 0; i < memory_region_length(REGION_PROMS); i++)
15121528   {
r2018r2019
15501566   return 0;
15511567}
15521568
1569MC6845_ON_VSYNC_CHANGED( dealem_vsync_changed )
1570{
1571   cpunum_set_input_line(device->machine, 0, INPUT_LINE_NMI, vsync);
1572}
1573
1574/*************************************
1575 *
1576 *  Machine driver
1577 *
1578 *************************************/
1579
1580static const mc6845_interface hd6845_intf =
1581{
1582   "main",               /* screen we are acting on */
1583   MPU4_MASTER_CLOCK/4/8,    /* the clock (pin 21) of the chip (educated guess)*/
1584   8,                  /* number of pixels per video memory address */
1585   NULL,               /* before pixel update callback */
1586   NULL,               /* row update callback */
1587   NULL,               /* after pixel update callback */
1588   NULL,               /* callback for display state changes */
1589   NULL,               /* HSYNC callback */
1590   dealem_vsync_changed   /* VSYNC callback */
1591};
1592
15531593static ADDRESS_MAP_START( dealem_memmap, ADDRESS_SPACE_PROGRAM, 8 )
15541594
15551595   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
15561596
1557   AM_RANGE(0x0800, 0x0800) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
1558   AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE(MC6845, "crtc", mc6845_register_r, mc6845_register_w)
1597   AM_RANGE(0x0800, 0x0800) AM_DEVWRITE(HD6845, "crtc", mc6845_address_w)
1598   AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE(HD6845, "crtc", mc6845_register_r, mc6845_register_w)
15591599
15601600//  AM_RANGE(0x0850, 0x0850) AM_READWRITE(bankswitch_r,bankswitch_w)    // write bank (rom page select)
15611601
r2018r2019
16281668
16291669   MDRV_MACHINE_START(mpu4mod2)                     // main mpu4 board initialisation
16301670   MDRV_MACHINE_RESET(mpu4_vid)
1631   MDRV_CPU_ADD_TAG("main", M6809, MPU4_MASTER_CLOCK/4)   // 6809 CPU
1632   MDRV_CPU_PROGRAM_MAP(dealem_memmap,0)               // setup read and write memorymap
1671   MDRV_CPU_ADD_TAG("main", M6809, MPU4_MASTER_CLOCK/4)
1672   MDRV_CPU_PROGRAM_MAP(dealem_memmap,0)
16331673
16341674   MDRV_CPU_PERIODIC_INT(gen_50hz, 100)               // generate 50 hz signal
16351675
r2018r2019
16411681
16421682   /* video hardware */
16431683   MDRV_SCREEN_ADD("main", RASTER)
1644   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)      /* not accurate */)
16451684   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1646   MDRV_SCREEN_SIZE((54+1)*8, (32+1)*8)               /* Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1) */
1647   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 31*8-1)      /* Taken from MC6845 init, registers 01 & 06 */
1648   MDRV_SCREEN_REFRESH_RATE(56)                     //Measured accurately from the flip-flop
1685   MDRV_SCREEN_SIZE((54+1)*8, (32+1)*8)               /* Taken from 6845 init, registers 00 & 04. Normally programmed with (value-1) */
1686   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 31*8-1)      /* Taken from 6845 init, registers 01 & 06 */
1687   MDRV_SCREEN_REFRESH_RATE(56)                     /* Measured accurately from the flip-flop */
16491688
16501689   MDRV_GFXDECODE(dealem)
16511690   MDRV_VIDEO_UPDATE(dealem)
r2018r2019
16531692   MDRV_PALETTE_LENGTH(32)
16541693   MDRV_PALETTE_INIT(dealem)
16551694
1656   MDRV_DEVICE_ADD("crtc", MC6845)
1695   MDRV_DEVICE_ADD("crtc", HD6845)                     // HD68B45
1696   MDRV_DEVICE_CONFIG(hd6845_intf)
16571697MACHINE_DRIVER_END
16581698
16591699static DRIVER_INIT (crmaze)
src/mame/drivers/laserbas.c
r2018r2019
137137   MDRV_SCREEN_ADD("main", RASTER)
138138   MDRV_SCREEN_REFRESH_RATE(60)
139139   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
140   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
140141   MDRV_SCREEN_SIZE(32*8, 32*8)
141142   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
142143
src/mame/drivers/suna16.c
r2018r2019
445445ADDRESS_MAP_END
446446
447447
448static MACHINE_RESET(uballoon)
449{
450   uballoon_pcm_1_bankswitch_w(machine, 0, 0);
451}
452
453
448454/***************************************************************************
449455                            Best Of Best
450456***************************************************************************/
r2018r2019
926932
927933   MDRV_INTERLEAVE(100)
928934
935   MDRV_MACHINE_RESET(uballoon)
936
929937   /* video hardware */
930938   MDRV_SCREEN_ADD("main", RASTER)
931939   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/jongkyo.c
r2018r2019
609609   MDRV_SPEAKER_STANDARD_MONO("mono")
610610   MDRV_SOUND_ADD(AY8910, JONGKYO_CLOCK/8)
611611   MDRV_SOUND_CONFIG(ay8910_interface)
612   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
612   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
613613MACHINE_DRIVER_END
614614
615615
src/mame/drivers/bigevglf.c
r2018r2019
519519
520520   MDRV_SOUND_ADD(MSM5232, 8000000/4)
521521   MDRV_SOUND_CONFIG(msm5232_interface)
522   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
522   MDRV_SOUND_ROUTE(0, "mono", 1.0)   // pin 28  2'-1
523   MDRV_SOUND_ROUTE(1, "mono", 1.0)   // pin 29  4'-1
524   MDRV_SOUND_ROUTE(2, "mono", 1.0)   // pin 30  8'-1
525   MDRV_SOUND_ROUTE(3, "mono", 1.0)   // pin 31 16'-1
526   MDRV_SOUND_ROUTE(4, "mono", 1.0)   // pin 36  2'-2
527   MDRV_SOUND_ROUTE(5, "mono", 1.0)   // pin 35  4'-2
528   MDRV_SOUND_ROUTE(6, "mono", 1.0)   // pin 34  8'-2
529   MDRV_SOUND_ROUTE(7, "mono", 1.0)   // pin 33 16'-2
530   // pin 1 SOLO  8'       not mapped
531   // pin 2 SOLO 16'       not mapped
532   // pin 22 Noise Output  not mapped
523533MACHINE_DRIVER_END
524534
525535/***************************************************************************
src/mame/drivers/ninjakd2.c
r2018r2019
8585  all write the 0xF0 "silence" command), however since these games don't have PCM
8686  samples it seems unlikely that the boards actually have the PCM circuitry. The
8787  command written might be a leftover from the code used for Ninja Kid II.
88  Atomic Robo-Kid definitely doesn't have the DAC and counters. The other boards
89  have not been verified.
8890
8991- Ark Area has no explicit copyright year on the title screen, however it was
9092  reportedly released in December 1987.
r2018r2019
115117
116118TODO:
117119-----
118- Ninja Kid II PCM sample playback frequency is not verified
119
120120- What does the "credit service" dip switch do in Ninja Kid II?
121121
122122******************************************************************************/
r2018r2019
131131#define MAIN_CLOCK_12 XTAL_12MHz
132132#define MAIN_CLOCK_5  XTAL_5MHz
133133
134// PCM playback is controlled by a 555 timer
135#define NE555_FREQUENCY   16300   // measured on PCB
136//#define NE555_FREQUENCY   (1.0f / (0.693 * (560 + 2*51) * 0.1e-6))    // theoretical: this gives 21.8kHz which is too high
137
138
134139static const INT16* ninjakd2_sampledata;
135140
136141static UINT8 omegaf_io_protection[3];
r2018r2019
233238         ++end;
234239
235240      if (end - start)
236         sample_start_raw(0, &ninjakd2_sampledata[start], end - start, MAIN_CLOCK_5 / 384, 0);   // 13020kHz NOT verified
241         sample_start_raw(0, &ninjakd2_sampledata[start], end - start, NE555_FREQUENCY, 0);
237242      else
238243         sample_stop(0);
239244   }
src/mame/drivers/m52.c
r2018r2019
103103
104104/*************************************
105105 *
106 *  Generic port definitions
106 *  Port definitions
107107 *
108108 *************************************/
109109
r2018r2019
160160   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW2:8" )
161161INPUT_PORTS_END
162162
163/*************************************
164 *
165 *  Games port definitions
166 *
167 *************************************/
168163
169164static INPUT_PORTS_START( mpatrol )
170165   PORT_INCLUDE(m52)
r2018r2019
205200   IREM_Z80_COINAGE_TYPE_1_LOC(SW1)
206201INPUT_PORTS_END
207202
203
208204static INPUT_PORTS_START( mpatrolw )
209205   PORT_INCLUDE(mpatrol)
210206
src/mame/drivers/spdodgeb.c
r2018r2019
444444   /* video hardware */
445445   MDRV_SCREEN_ADD("main", RASTER)
446446   MDRV_SCREEN_REFRESH_RATE(60)
447   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
447   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(500) /* not accurate */)
448448   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
449449   MDRV_SCREEN_SIZE(32*8, 32*8)
450450   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)
src/mame/drivers/seta.c
r2018r2019
29282928                        Caliber 50 / U.S. Classic
29292929***************************************************************************/
29302930
2931static MACHINE_RESET(calibr50)
2932{
2933   sub_bankswitch_w(machine, 0, 0);
2934}
2935
29312936static WRITE8_HANDLER( calibr50_soundlatch2_w )
29322937{
29332938   soundlatch2_w(machine,0,data);
r2018r2019
68436848   MDRV_CPU_PROGRAM_MAP(calibr50_sub_readmem,calibr50_sub_writemem)
68446849   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)   /* NMI caused by main cpu when writing to the sound latch */
68456850
6851   MDRV_MACHINE_RESET(calibr50)
6852
68466853   /* video hardware */
68476854   MDRV_SCREEN_ADD("main", RASTER)
68486855   MDRV_SCREEN_REFRESH_RATE(60)
r2018r2019
68896896   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4)   /* IRQ: 4/frame
68906897                               NMI: when the 68k writes the sound latch */
68916898
6899   MDRV_MACHINE_RESET(calibr50)
6900
68926901   /* video hardware */
68936902   MDRV_SCREEN_ADD("main", RASTER)
68946903   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/batman.c
r2018r2019
5959static MACHINE_RESET( batman )
6060{
6161   atarigen_eeprom_reset();
62   atarigen_interrupt_reset(update_interrupts);
6263   atarivc_reset(machine->primary_screen, atarivc_eof_data, 2);
63   atarigen_interrupt_reset(update_interrupts);
6464   atarigen_scanline_timer_reset(machine->primary_screen, batman_scanline_update, 8);
6565   atarijsa_reset();
6666   atarigen_init_save_state();
src/mame/drivers/naomi.c
r2018r2019
788788   /* video hardware */
789789   MDRV_SCREEN_ADD("main", RASTER)
790790   MDRV_SCREEN_REFRESH_RATE(60)
791   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
791   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
792792   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
793793   MDRV_SCREEN_SIZE(640, 480)
794794   MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
src/mame/drivers/megatech.c
r2018r2019
610610//attotime_never
611611static VIDEO_UPDATE(mtnew)
612612{
613   const device_config *main_screen = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "main");
614   const device_config *menu_screen = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "menu");
613   const device_config *megadriv_screen = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "megadriv");
614   const device_config *menu_screen     = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "menu");
615615
616   if (screen == main_screen)
616   if (screen == megadriv_screen)
617617   {
618618      /* if we're running an sms game then use the SMS update.. maybe this should be moved to the megadrive emulation core as compatibility mode is a feature of the chip */
619619      if (!current_game_is_sms) VIDEO_UPDATE_CALL(megadriv);
src/mame/drivers/battlera.c
r2018r2019
179179   PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
180180
181181   PORT_START_TAG("DSW1")
182   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
182   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:1,2")
183183   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
184184   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
185185   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
186186   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
187   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
187   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW1:3,4")
188188   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
189189   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
190190   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
191191   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
192   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )
193   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
194   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
195   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
192   PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW1:5" )      /* Listed as "Unused" */
193   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW1:6")
196194   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
197195   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
198   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
199   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
200   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
201   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
202   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
203   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
196   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW1:7" )      /* Listed as "Unused" */
197   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW1:8" )      /* Listed as "Unused" */
204198
205199   PORT_START_TAG("DSW2")
206   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
200   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW2:1,2")
207201   PORT_DIPSETTING(    0x01, "1" )
208202   PORT_DIPSETTING(    0x02, "2" )
209203   PORT_DIPSETTING(    0x03, "3" )
210204   PORT_DIPSETTING(    0x00, "Infinite (Cheat)")
211   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
205   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:3,4")
212206   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
213207   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
214208   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
215209   PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ) )
216   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) )
210   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5")
217211   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
218212   PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
219   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )
220   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
221   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
222   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
223   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
224   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
225   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
226   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
227   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
213   PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW2:6" )      /* Listed as "Unused" */
214   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" )      /* Listed as "Unused" */
215   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" )      /* Listed as "Unused" */
228216INPUT_PORTS_END
229217
230218/******************************************************************************/
src/mame/drivers/astrocde.c
r2018r2019
44    driver by Nicola Salmoria, Mike Coates, Frank Palazzolo, Aaron Giles
55
66    Games supported:
7        * Sea Wolf II
7        * Seawolf II
88        * Extra Bases
99        * Space Zap
1010        * Wizard of Wor
1111        * Gorf
1212        * Robby Roto
1313        * Professor Pac-Man
14        * Demons and Dragons
14        * Demons & Dragons
1515        * Ten Pix Deluxe
1616
1717    Known bugs:
18        * no audio board for Demons and Dragons
19        * Demons and Dragons doesn't work with RAM protection enabled
18        * No audio board for Demons & Dragons
19        * Demons & Dragons doesn't work with RAM protection enabled
2020        * Professor Pac-Man fails screen RAM test
2121
2222****************************************************************************
2323
2424    Game boards:
25        90002 = Sea Wolf II Motherboard (seawolf2)
26        90700 = Sea Wolf II Logic Board (seawolf2, ebases)
25        90002 = Seawolf II Motherboard (seawolf2)
26        90700 = Seawolf II Logic Board (seawolf2, ebases)
2727        91312 = Characterization Card (seawolf2)
2828        91354 = CPU Board (ebases, spacezap, wow, gorf, robby)
2929        91355 = Pattern Board (spacezap, wow, gorf, robby)
r2018r2019
3939        91699 = Sound I/O Board (tenpindx)
4040        91846 = 640K EPROM board (profpac)
4141
42    Sea Wolf II:
43        90002 = Sea Wolf II Motherboard
44        90700 = Sea Wolf II Logic Board
42    Seawolf II:
43        90002 = Seawolf II Motherboard
44        90700 = Seawolf II Logic Board
4545        91312 = Characterization Card
4646
4747    Extra Bases:
r2018r2019
118118#include "sound/astrocde.h"
119119#include "sound/ay8910.h"
120120#include "tenpindx.lh"
121#include "gorf.lh"
121122
122123
123124static UINT8 *protected_ram;
r2018r2019
179180
180181/*************************************
181182 *
182 *  Sea Wolf II specific input/output
183 *  Seawolf II specific input/output
183184 *
184185 *************************************/
185186
r2018r2019
455456
456457/*************************************
457458 *
458 *  Demons and Dragons specific input/output
459 *  Demons & Dragons specific input/output
459460 *
460461 *************************************/
461462
r2018r2019
17711772 *************************************/
17721773
17731774/* 90002 CPU board + 90700 game board + 91312 "characterization card" */
1774GAME( 1978, seawolf2, 0,    seawolf2, seawolf2, seawolf2, ROT0,   "Midway", "Sea Wolf II", GAME_SUPPORTS_SAVE )
1775GAME( 1978, seawolf2, 0,    seawolf2, seawolf2, seawolf2, ROT0,   "Midway", "Seawolf II", GAME_SUPPORTS_SAVE )
17751776
17761777/* 91354 CPU board + 90700 game board + 91356 RAM board */
17771778GAME( 1980, ebases,   0,    ebases,   ebases,   ebases,   ROT0,   "Midway", "Extra Bases", GAME_SUPPORTS_SAVE )
r2018r2019
17831784GAME( 1980, wow,      0,    wow,      wow,      wow,      ROT0,   "Midway", "Wizard of Wor", GAME_SUPPORTS_SAVE )
17841785
17851786/* 91354 CPU board + 90708 game board + 91356 RAM board + 91355 pattern board + 91364 ROM/RAM board */
1786GAME( 1981, gorf,     0,    gorf,     gorf,     gorf,     ROT270, "Midway", "Gorf", GAME_SUPPORTS_SAVE )
1787GAME( 1981, gorfpgm1, gorf, gorf,     gorf,     gorf,     ROT270, "Midway", "Gorf (Program 1)", GAME_SUPPORTS_SAVE )
1787GAMEL(1981, gorf,     0,    gorf,     gorf,     gorf,     ROT270, "Midway", "Gorf", GAME_SUPPORTS_SAVE, layout_gorf  )
1788GAMEL(1981, gorfpgm1, gorf, gorf,     gorf,     gorf,     ROT270, "Midway", "Gorf (program 1)", GAME_SUPPORTS_SAVE, layout_gorf )
17881789
17891790/* 91354 CPU board + 90708 game board + 91356 RAM board + 91355 pattern board + 91423 memory board */
17901791GAME( 1981, robby,    0,    robby,    robby,    robby,    ROT0,   "Bally Midway", "Robby Roto", GAME_SUPPORTS_SAVE )
17911792
17921793/* 91465 CPU board + 91469 game board + 91466 RAM board + 91488 pattern board + 91467 memory board + 91846 EPROM board */
1793GAME( 1983, profpac,  0,    profpac,  profpac,  profpac,  ROT0,   "Bally Midway", "Professor PacMan", GAME_SUPPORTS_SAVE )
1794GAME( 1983, profpac,  0,    profpac,  profpac,  profpac,  ROT0,   "Bally Midway", "Professor Pac-Man", GAME_SUPPORTS_SAVE )
17941795
17951796/* 91465 CPU board + 91699 game board + 91466 RAM board + 91488 pattern board + 91467 memory board */
1796GAME( 1982, demndrgn, 0,    demndrgn, demndrgn, demndrgn, ROT0,   "Bally Midway", "Demons and Dragons (prototype)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
1797GAME( 1982, demndrgn, 0,    demndrgn, demndrgn, demndrgn, ROT0,   "Bally Midway", "Demons & Dragons (prototype)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
17971798GAMEL(1983, tenpindx, 0,    tenpindx, tenpindx, tenpindx, ROT0,   "Bally Midway", "Ten Pin Deluxe", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE, layout_tenpindx )
src/mame/drivers/40love.c
r2018r2019
759759
760760   /* this definitely controls main melody voice on 2'-1 and 4'-1 outputs */
761761   sndti_set_output_gain(SOUND_MSM5232, 0, 0, vol_ctrl[ (snd_ctrl0>>4) & 15 ] / 100.0);   /* group1 from msm5232 */
762   sndti_set_output_gain(SOUND_MSM5232, 0, 1, vol_ctrl[ (snd_ctrl0>>4) & 15 ] / 100.0);   /* group1 from msm5232 */
763   sndti_set_output_gain(SOUND_MSM5232, 0, 2, vol_ctrl[ (snd_ctrl0>>4) & 15 ] / 100.0);   /* group1 from msm5232 */
764   sndti_set_output_gain(SOUND_MSM5232, 0, 3, vol_ctrl[ (snd_ctrl0>>4) & 15 ] / 100.0);   /* group1 from msm5232 */
762765
763766}
764767static WRITE8_HANDLER( sound_control_1_w )
765768{
766769   snd_ctrl1 = data & 0xff;
767770//  popmessage("SND1 0=%02x 1=%02x 2=%02x 3=%02x", snd_ctrl0, snd_ctrl1, snd_ctrl2, snd_ctrl3);
768   sndti_set_output_gain(SOUND_MSM5232, 0, 1, vol_ctrl[ (snd_ctrl1>>4) & 15 ] / 100.0);   /* group2 from msm5232 */
771   sndti_set_output_gain(SOUND_MSM5232, 0, 4, vol_ctrl[ (snd_ctrl1>>4) & 15 ] / 100.0);   /* group2 from msm5232 */
772   sndti_set_output_gain(SOUND_MSM5232, 0, 5, vol_ctrl[ (snd_ctrl1>>4) & 15 ] / 100.0);   /* group2 from msm5232 */
773   sndti_set_output_gain(SOUND_MSM5232, 0, 6, vol_ctrl[ (snd_ctrl1>>4) & 15 ] / 100.0);   /* group2 from msm5232 */
774   sndti_set_output_gain(SOUND_MSM5232, 0, 7, vol_ctrl[ (snd_ctrl1>>4) & 15 ] / 100.0);   /* group2 from msm5232 */
769775}
770776
771777static WRITE8_HANDLER( sound_control_2_w )
r2018r2019
815821
816822static INPUT_PORTS_START( 40love )
817823   PORT_START_TAG("DSW1")
818   PORT_DIPNAME( 0x01, 0x00, "DSW1 Unknown 0" )      PORT_DIPLOCATION("SW1:1")
819   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
820   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
821   PORT_DIPNAME( 0x02, 0x00, "DSW1 Unknown 1" )      PORT_DIPLOCATION("SW1:2")
822   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
823   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
824   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:1" )
825   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:2" )
824826   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Free_Play ) )   PORT_DIPLOCATION("SW1:3")
825827   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
826828   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r2018r2019
829831   PORT_DIPSETTING(    0x08, "2" )
830832   PORT_DIPSETTING(    0x10, "3" )
831833   PORT_DIPSETTING(    0x18, "4" )
832   PORT_DIPNAME( 0x20, 0x00, "DSW1 Unknown 5" )      PORT_DIPLOCATION("SW1:6")
833   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
834   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
834   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" )
835835   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SW1:7")
836836   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
837837   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
r2018r2019
876876   PORT_DIPSETTING(    0x70, DEF_STR( 1C_8C ) )
877877
878878   PORT_START_TAG("DSW3")
879   PORT_DIPNAME( 0x03, 0x00, "DSW3 Unknown 0" )         PORT_DIPLOCATION("SW3:1,2")
880   PORT_DIPSETTING(    0x00, "00" )
881   PORT_DIPSETTING(    0x01, "01" )
882   PORT_DIPSETTING(    0x02, "02" )
883   PORT_DIPSETTING(    0x03, "03" )
884   PORT_DIPNAME( 0x0c, 0x0c, "DSW3 Unknown 1" )         PORT_DIPLOCATION("SW3:3,4")
885   PORT_DIPSETTING(    0x00, "00" )
886   PORT_DIPSETTING(    0x04, "04" )
887   PORT_DIPSETTING(    0x08, "08" )
888   PORT_DIPSETTING(    0x0c, "0c" )
879   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:1" )
880   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" )
881   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW3:3" )
882   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" )
889883   PORT_DIPNAME( 0x10, 0x10, "Display Credit Settings" )   PORT_DIPLOCATION("SW3:5")
890884   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
891885   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
r2018r2019
931925INPUT_PORTS_END
932926
933927static INPUT_PORTS_START( undoukai )
934   PORT_START_TAG("DSW1")
935   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
928   PORT_INCLUDE( 40love )
929
930   PORT_MODIFY("DSW1")
931   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW1:1,2")
936932   PORT_DIPSETTING(    0x00, "4 (Hard)" )
937933   PORT_DIPSETTING(    0x01, "3" )
938934   PORT_DIPSETTING(    0x02, "2" )
939935   PORT_DIPSETTING(    0x03, "1 (Easy)" )
940   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Free_Play ) )
941   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
942   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
943   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) )
936   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:4")
944937   PORT_DIPSETTING(    0x08, "1" )
945938   PORT_DIPSETTING(    0x00, "2" )
946   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )
939   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW1:5")
947940   PORT_DIPSETTING(    0x10, DEF_STR( None ) )
948941   PORT_DIPSETTING(    0x00, "100000 200000" )
949   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Players ) )
950   PORT_DIPSETTING(    0x20, "1 or 2" )
951   PORT_DIPSETTING(    0x00, "1 to 4" )
952   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
942   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Players ) )      PORT_DIPLOCATION("SW1:6")
943   PORT_DIPSETTING(    0x20, "1 Or 2" )
944   PORT_DIPSETTING(    0x00, "1 To 4" )
945   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SW1:7")
953946   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
954947   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
955   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
956   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
957   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
958948
959   PORT_START_TAG("DSW2") /*All OK */
960   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) )
961   PORT_DIPSETTING(    0x0f, DEF_STR( 9C_1C ) )
962   PORT_DIPSETTING(    0x0e, DEF_STR( 8C_1C ) )
963   PORT_DIPSETTING(    0x0d, DEF_STR( 7C_1C ) )
964   PORT_DIPSETTING(    0x0c, DEF_STR( 6C_1C ) )
965   PORT_DIPSETTING(    0x0b, DEF_STR( 5C_1C ) )
966   PORT_DIPSETTING(    0x0a, DEF_STR( 4C_1C ) )
967   PORT_DIPSETTING(    0x09, DEF_STR( 3C_1C ) )
968   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
969   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
970   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
971   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
972   PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
973   PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
974   PORT_DIPSETTING(    0x05, DEF_STR( 1C_6C ) )
975   PORT_DIPSETTING(    0x06, DEF_STR( 1C_7C ) )
976   PORT_DIPSETTING(    0x07, DEF_STR( 1C_8C ) )
977   PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coin_B ) )
978   PORT_DIPSETTING(    0xf0, DEF_STR( 9C_1C ) )
979   PORT_DIPSETTING(    0xe0, DEF_STR( 8C_1C ) )
980   PORT_DIPSETTING(    0xd0, DEF_STR( 7C_1C ) )
981   PORT_DIPSETTING(    0xc0, DEF_STR( 6C_1C ) )
982   PORT_DIPSETTING(    0xb0, DEF_STR( 5C_1C ) )
983   PORT_DIPSETTING(    0xa0, DEF_STR( 4C_1C ) )
984   PORT_DIPSETTING(    0x90, DEF_STR( 3C_1C ) )
985   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
986   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
987   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
988   PORT_DIPSETTING(    0x20, DEF_STR( 1C_3C ) )
989   PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
990   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
991   PORT_DIPSETTING(    0x50, DEF_STR( 1C_6C ) )
992   PORT_DIPSETTING(    0x60, DEF_STR( 1C_7C ) )
993   PORT_DIPSETTING(    0x70, DEF_STR( 1C_8C ) )
994
995   PORT_START_TAG("DSW3") /* & START */
996   PORT_BIT(           0x01, IP_ACTIVE_LOW, IPT_START2 )
997   PORT_BIT(           0x02, IP_ACTIVE_LOW, IPT_START1 )
998   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) )
949   PORT_MODIFY("DSW3") /* & START */
950   PORT_BIT(           0x01, IP_ACTIVE_LOW, IPT_START2 )   PORT_DIPLOCATION("SW3:1")
951   PORT_BIT(           0x02, IP_ACTIVE_LOW, IPT_START1 )   PORT_DIPLOCATION("SW3:2")
952   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW3:3")
999953   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1000954   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1001   PORT_DIPNAME( 0x08, 0x08, "Freeze" )
955   PORT_DIPNAME( 0x08, 0x08, "Freeze" )               PORT_DIPLOCATION("SW3:4")
1002956   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1003957   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1004   PORT_DIPNAME( 0x10, 0x10, "Display Credit Settings" )
1005   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1006   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1007   PORT_DIPNAME( 0x20, 0x20, "Year Display" )
1008   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1009   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1010   PORT_DIPNAME( 0x40, 0x40, "No Qualify (Cheat)")
958   PORT_DIPNAME( 0x40, 0x40, "No Qualify (Cheat)")         PORT_DIPLOCATION("SW3:7")
1011959   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1012960   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1013   PORT_DIPNAME( 0x80, 0x00, "Coin Door Type" )
1014   PORT_DIPSETTING(    0x00, "Single Slot" )
1015   PORT_DIPSETTING(    0x80, "Double Slot" )
1016961
1017   PORT_START_TAG("IN0")
1018   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1019   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1020   PORT_BIT( 0x04, IP_ACTIVE_HIGH,IPT_COIN1 )
1021   PORT_BIT( 0x08, IP_ACTIVE_HIGH,IPT_COIN2 )
962   PORT_MODIFY("IN0")
1022963   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1023964   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1024   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
1025   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_TILT )
1026965
1027   PORT_START_TAG("IN1")
966   PORT_MODIFY("IN1")
1028967   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
1029968   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1030969   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 )
r2018r2019
1034973   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START3 )
1035974   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START4 )
1036975
1037   PORT_START_TAG("IN2")
976   PORT_MODIFY("IN2")
1038977   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
1039978   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
1040979   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
r2018r2019
11341073
11351074   MDRV_SOUND_ADD(MSM5232, 8000000/4)
11361075   MDRV_SOUND_CONFIG(msm5232_interface)
1137   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1076   MDRV_SOUND_ROUTE(0, "mono", 1.0)   // pin 28  2'-1
1077   MDRV_SOUND_ROUTE(1, "mono", 1.0)   // pin 29  4'-1
1078   MDRV_SOUND_ROUTE(2, "mono", 1.0)   // pin 30  8'-1
1079   MDRV_SOUND_ROUTE(3, "mono", 1.0)   // pin 31 16'-1
1080   MDRV_SOUND_ROUTE(4, "mono", 1.0)   // pin 36  2'-2
1081   MDRV_SOUND_ROUTE(5, "mono", 1.0)   // pin 35  4'-2
1082   MDRV_SOUND_ROUTE(6, "mono", 1.0)   // pin 34  8'-2
1083   MDRV_SOUND_ROUTE(7, "mono", 1.0)   // pin 33 16'-2
1084   // pin 1 SOLO  8'       not mapped
1085   // pin 2 SOLO 16'       not mapped
1086   // pin 22 Noise Output  not mapped
11381087
11391088   MDRV_SOUND_ADD(DAC, 0)
11401089   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
r2018r2019
11801129
11811130   MDRV_SOUND_ADD(MSM5232, 8000000/4)
11821131   MDRV_SOUND_CONFIG(msm5232_interface)
1183   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1132   MDRV_SOUND_ROUTE(0, "mono", 1.0)   // pin 28  2'-1
1133   MDRV_SOUND_ROUTE(1, "mono", 1.0)   // pin 29  4'-1
1134   MDRV_SOUND_ROUTE(2, "mono", 1.0)   // pin 30  8'-1
1135   MDRV_SOUND_ROUTE(3, "mono", 1.0)   // pin 31 16'-1
1136   MDRV_SOUND_ROUTE(4, "mono", 1.0)   // pin 36  2'-2
1137   MDRV_SOUND_ROUTE(5, "mono", 1.0)   // pin 35  4'-2
1138   MDRV_SOUND_ROUTE(6, "mono", 1.0)   // pin 34  8'-2
1139   MDRV_SOUND_ROUTE(7, "mono", 1.0)   // pin 33 16'-2
1140   // pin 1 SOLO  8'       not mapped
1141   // pin 2 SOLO 16'       not mapped
1142   // pin 22 Noise Output  not mapped
11841143
11851144   MDRV_SOUND_ADD(DAC, 0)
11861145   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
src/mame/drivers/8080bw.c
r2018r2019
118118   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
119119
120120   PORT_START_TAG("DSW0")
121   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
121   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:1,2")
122122   PORT_DIPSETTING(    0x00, "3" )
123123   PORT_DIPSETTING(    0x01, "4" )
124124   PORT_DIPSETTING(    0x02, "5" )
125125   PORT_DIPSETTING(    0x03, "6" )
126   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT ) PORT_DIPLOCATION("SW1:3")
127   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4")
126   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )         PORT_DIPLOCATION("SW1:3")
127   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW1:4")
128128   PORT_DIPSETTING(    0x08, "1000" )
129129   PORT_DIPSETTING(    0x00, "1500" )
130130   /* SW1:5,6,7: In OFF, PL2 can have no control of joystick, going auto left/right and other problems like no laser gun.
131131    Be sure these are always ON */
132132   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0) PORT_DIPLOCATION("SW1:5,6,7") /* Labeled as "FACTORY" */
133   PORT_DIPNAME( 0x80, 0x00, "Coin Info" ) PORT_DIPLOCATION("SW1:8")
133   PORT_DIPNAME( 0x80, 0x00, "Coin Info" )            PORT_DIPLOCATION("SW1:8")
134134   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
135135   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
136136
137137   /* Dummy controls port, P1 */
138   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
139   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
140   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
141   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
142   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
138   INVADERS_CONTROL_PORT_P1
143139
144140   /* Dummy controls port, P2 */
145   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
146   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
147   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
148   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
149   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
141   INVADERS_CONTROL_PORT_P2
150142
151143   /* Dummy port for cocktail mode */
152   PORT_START_TAG(INVADERS_CAB_TYPE_PORT_TAG)
153   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
154   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
155   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
144   INVADERS_CAB_TYPE_PORT
156145INPUT_PORTS_END
157146
158147/*******************************************************/
r2018r2019
164153/* same as the CV version with a test mode switch */
165154
166155static INPUT_PORTS_START( sitv )
167   PORT_START_TAG("IN0")
156   PORT_INCLUDE( sicv )
157
158   PORT_MODIFY("IN0")
168159   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
169   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
170   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
171   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
172   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
173   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
174   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
175   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
176160
177   PORT_START_TAG("IN1")
178   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
179   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
180   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
181   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
182   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
183   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
184   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
161   PORT_MODIFY("IN1")
185162   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
186
187   PORT_START_TAG("DSW0")
188   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
189   PORT_DIPSETTING(    0x00, "3" )
190   PORT_DIPSETTING(    0x01, "4" )
191   PORT_DIPSETTING(    0x02, "5" )
192   PORT_DIPSETTING(    0x03, "6" )
193   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT ) PORT_DIPLOCATION("SW1:3")
194   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4")
195   PORT_DIPSETTING(    0x08, "1000" )
196   PORT_DIPSETTING(    0x00, "1500" )
197   /* SW1:5,6,7: In OFF, PL2 can have no control of joystick, going auto left/right and other problems like no laser gun.
198    Be sure these are always ON */
199   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0) PORT_DIPLOCATION("SW1:5,6,7") /* Labeled as "FACTORY" */
200   PORT_DIPNAME( 0x80, 0x00, "Coin Info" ) PORT_DIPLOCATION("SW1:8")
201   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
202   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
203
204   /* Dummy controls port, P1 */
205   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
206   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
207   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
208   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
209   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
210
211   /* Dummy controls port, P2 */
212   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
213   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
214   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
215   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
216   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
217
218   /* Dummy port for cocktail mode */
219   PORT_START_TAG(INVADERS_CAB_TYPE_PORT_TAG)
220   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
221   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
222   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
223163INPUT_PORTS_END
224164
225165/*******************************************************/
r2018r2019
229169/*******************************************************/
230170
231171static INPUT_PORTS_START( invadrmr )
232   PORT_START_TAG("IN0")
233   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
234   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
235   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
236   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
237   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
238   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
239   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
240   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
172   PORT_INCLUDE( sicv )
241173
242   PORT_START_TAG("IN1")
243   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
244   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
245   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
246   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
247   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
248   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
249   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
250   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
251
252   PORT_START_TAG("DSW0")
253   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
254   PORT_DIPSETTING(    0x00, "3" )
255   PORT_DIPSETTING(    0x01, "4" )
256   PORT_DIPSETTING(    0x02, "5" )
257   PORT_DIPSETTING(    0x03, "6" )
258   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT ) PORT_DIPLOCATION("SW1:3")
174   PORT_MODIFY("DSW0")
259175   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4")
260176   PORT_DIPSETTING(    0x00, "1500" )
261177   PORT_DIPSETTING(    0x08, "3000" ) /* This is different to invaders */
262   /* SW1:5,6,7: In OFF, PL2 can have no control of joystick, going auto left/right and other problems like no laser gun.
263    Be sure these are always ON */
264   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0) PORT_DIPLOCATION("SW1:5,6,7") /* Labeled as "FACTORY" */
265   PORT_DIPNAME( 0x80, 0x00, "Coin Info" ) PORT_DIPLOCATION("SW1:8")
266   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
267   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
268
269   /* Dummy controls port, P1 */
270   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
271   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
272   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
273   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
274   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
275
276   /* Dummy controls port, P2 */
277   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
278   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
279   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
280   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
281   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
282
283   /* Dummy port for cocktail mode */
284   PORT_START_TAG(INVADERS_CAB_TYPE_PORT_TAG)
285   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
286   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
287   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
288178INPUT_PORTS_END
289179
290180/*******************************************************/
r2018r2019
304194ADDRESS_MAP_END
305195
306196static INPUT_PORTS_START( invadpt2 )
307   PORT_START_TAG("IN0")
308   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
309   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
310   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
311   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
312   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
313   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
197   PORT_INCLUDE( sicv )
198
199   PORT_MODIFY("IN0")
314200   // Name Reset - if name of high scorer was rude, owner can press this button
315201   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Name Reset") PORT_CODE(KEYCODE_F1)
316   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
317202
318   PORT_START_TAG("IN1")
319   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
320   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
321   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
322   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
323   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
324   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
325   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
203   PORT_MODIFY("IN1")
326204   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
327205
328   PORT_START_TAG("DSW0")
206   PORT_MODIFY("DSW0")
329207   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1")
330208   PORT_DIPSETTING(    0x00, "3" )
331209   PORT_DIPSETTING(    0x01, "4" )
r2018r2019
333211   PORT_DIPNAME( 0x02, 0x00, "Rotate Images" ) PORT_DIPLOCATION("SW1:2") /* "When ON, the images on screen will be rotated. Default is ON." */
334212   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
335213   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
336   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT ) PORT_DIPLOCATION("SW1:3")
337214   PORT_DIPNAME( 0x08, 0x00, "Preset Mode" ) PORT_DIPLOCATION("SW1:4") /* Preset Mode: "Switch for checking, when OFF checking can be done." */
338215   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
339216   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
340   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0) PORT_DIPLOCATION("SW1:5,6,7")
341   PORT_DIPNAME( 0x80, 0x00, "Coin Info" ) PORT_DIPLOCATION("SW1:8")
342   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
343   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
344
345   /* Dummy controls port, P1 */
346   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
347   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
348   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
349   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
350   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
351
352   /* Dummy controls port, P2 */
353   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
354   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
355   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
356   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
357   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
358
359   /* Dummy port for cocktail mode */
360   PORT_START_TAG(INVADERS_CAB_TYPE_PORT_TAG)
361   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
362   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
363   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
364217INPUT_PORTS_END
365218
366219
r2018r2019
398251
399252
400253static INPUT_PORTS_START( spcewars )
401   PORT_START_TAG("IN0")
402   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
403   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
404   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
405   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
406   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
407   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
408   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
409   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
254   PORT_INCLUDE( sicv )
410255
411   PORT_START_TAG("IN1")
412   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
413   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
414   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
415   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
416   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
417   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
418   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
256   PORT_MODIFY("IN1")
419257   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
420258
421   PORT_START_TAG("DSW0")
422   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )
259   PORT_MODIFY("DSW0")
260   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:1")
423261   PORT_DIPSETTING(    0x00, "3" )
424262   PORT_DIPSETTING(    0x01, "4" )
425   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
426   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
427   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
263   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "SW1:2" )
264   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW1:4")
428265   PORT_DIPSETTING(    0x00, "1500" )
429266   PORT_DIPSETTING(    0x08, "2000" )
430   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
431   PORT_DIPNAME( 0x80, 0x00, "Coin Info" )
432   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
433   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
434267
435   /* Dummy controls port, P1 */
436   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
437   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
438   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
439   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
440   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
441
442   /* Dummy controls port, P2 */
443   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
444   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
445   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
446   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
447   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
448
449   PORT_START_TAG(INVADERS_CAB_TYPE_PORT_TAG)      /* Dummy port for cocktail mode (not used) */
268   /* Dummy port for cocktail mode (not used) */
269   PORT_MODIFY(INVADERS_CAB_TYPE_PORT_TAG)
450270   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
451271INPUT_PORTS_END
452272
r2018r2019
492312
493313
494314static INPUT_PORTS_START( cosmo )
495   PORT_START_TAG("IN0")
496   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
497   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
498   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
499   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
500   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
501   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
502   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
503   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
315   PORT_INCLUDE( sicv )
504316
505   PORT_START_TAG("IN1")
506   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
507   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
508   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
509   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
510   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
511   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
512   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
317   PORT_MODIFY("IN1")
513318   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
514319
515   PORT_START_TAG("DSW0")
516   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )
320   PORT_MODIFY("DSW0")
321   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )   PORT_DIPLOCATION("SW1:1")
517322   PORT_DIPSETTING(    0x00, "3" )
518323   PORT_DIPSETTING(    0x01, "5" )
519   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
520   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
521   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
522   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
523   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN ) /* must be HIGH normally or the joystick won't work */
524
525   /* Dummy controls port, P1 */
526   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
527   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
528   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
529   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
530   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
531
532   /* Dummy controls port, P2 */
533   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
534   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
535   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
536   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
537   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
538
539   /* Dummy port for cocktail mode */
540   PORT_START_TAG(INVADERS_CAB_TYPE_PORT_TAG)
541   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
542   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
543   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
324   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "SW1:2" )
325   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:3" )
326   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:4" )
327   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) /* must be HIGH normally or the joystick won't work */
544328INPUT_PORTS_END
545329
546330static MACHINE_DRIVER_START( cosmo )
r2018r2019
566350/*******************************************************/
567351
568352static INPUT_PORTS_START( searthin )
569   PORT_START_TAG("IN0")
570   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
571   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
572   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
573   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
574   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
575   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
576   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
577   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
353   PORT_INCLUDE( sicv )
578354
579   PORT_START_TAG("IN1")
580   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
581   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
582   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
583   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
584   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
585   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
586   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
355   PORT_MODIFY("IN1")
587356   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
588357
589   PORT_START_TAG("DSW0")
590   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
358   PORT_MODIFY("DSW0")
359   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )   PORT_DIPLOCATION("SW1:1")
591360   PORT_DIPSETTING(    0x00, "2" )
592361   PORT_DIPSETTING(    0x01, "3" )
593   PORT_DIPNAME( 0x02, 0x02, "Pence Coinage" )
362   PORT_DIPNAME( 0x02, 0x02, "Pence Coinage" )      PORT_DIPLOCATION("SW1:2")
594363   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
595364   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
596   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 ) /* Pence Coin */
597   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) /* Not bonus */
598   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
599   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
600   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
601   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) )
365   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )      PORT_DIPLOCATION("SW1:3") /* Pence Coin */
366   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW1:4" )   /* Not bonus */
367   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) )   PORT_DIPLOCATION("SW1:8")
602368   PORT_DIPSETTING(    0x00, "2C/1C 50p/3C (+ Bonus Life)" )
603369   PORT_DIPSETTING(    0x80, "1C/1C 50p/5C" )
604
605   /* Dummy controls port, P1 */
606   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
607   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
608   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
609   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
610   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
611
612   /* Dummy controls port, P2 */
613   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
614   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
615   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
616   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
617   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
618
619   /* Dummy port for cocktail mode */
620   PORT_START_TAG(INVADERS_CAB_TYPE_PORT_TAG)
621   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
622   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
623   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
624370INPUT_PORTS_END
625371
626372
r2018r2019
631377/*******************************************************/
632378
633379static INPUT_PORTS_START( spaceatt )
634   PORT_START_TAG("IN0")
635   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
636   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
637   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
638   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
639   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
640   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
641   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
642   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
380   PORT_INCLUDE( sicv )
643381
644   PORT_START_TAG("IN1")
645   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
646   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
647   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
648   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
649   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
650   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
651   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
652   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
653
654   PORT_START_TAG("DSW0")
655   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
656   PORT_DIPSETTING(    0x00, "3" )
657   PORT_DIPSETTING(    0x01, "4" )
658   PORT_DIPSETTING(    0x02, "5" )
659   PORT_DIPSETTING(    0x03, "6" )
660   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
661   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
662   PORT_DIPSETTING(    0x08, "1000" )
663   PORT_DIPSETTING(    0x00, "1500" )
664   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
665   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
666   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
667   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
668   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
669   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
670   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
671   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
672   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
673   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) )
382   PORT_MODIFY("DSW0")
383   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW1:5" )
384   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW1:6" )
385   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW1:7" )
386   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) )   PORT_DIPLOCATION("SW1:8")
674387   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
675388   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
676389
677   PORT_START_TAG(INVADERS_CAB_TYPE_PORT_TAG)      /* Dummy port for cocktail mode (not used) */
390   /* Dummy port for cocktail mode (not used) */
391   PORT_MODIFY(INVADERS_CAB_TYPE_PORT_TAG)
678392   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
679393INPUT_PORTS_END
680394
r2018r2019
716430   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
717431
718432   PORT_START_TAG("DSW0")
719   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
433   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:1,2")
720434   PORT_DIPSETTING(    0x00, "3" )
721435   PORT_DIPSETTING(    0x01, "4" )
722436   PORT_DIPSETTING(    0x02, "5" )
723437   PORT_DIPSETTING(    0x03, "6" )
724   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
725   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
726   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
727   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
728   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
729   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
730   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
731   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) )
438   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )         PORT_DIPLOCATION("SW1:3")
439   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:4" )
440   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)               PORT_DIPLOCATION("SW1:5")
441   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)   PORT_DIPLOCATION("SW1:6")
442   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)   PORT_DIPLOCATION("SW1:7")
443   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SW1:8")
732444   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
733445   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
734446
735   PORT_START_TAG(CABINET_PORT_TAG)
736   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
737   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
738   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
447   /* Dummy port for cocktail mode */
448   INVADERS_CAB_TYPE_PORT
739449INPUT_PORTS_END
740450
741451
r2018r2019
759469/*******************************************************/
760470
761471static INPUT_PORTS_START( spclaser )
762   PORT_START_TAG("IN0")
763   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
764   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
765   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
766   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
767   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
768   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
769   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
770   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
472   PORT_INCLUDE( invrvnge )
771473
772   PORT_START_TAG("IN1")
474   PORT_MODIFY("IN1")
773475   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
774   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2) /* This is not 2 Player ??? */
775   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
776   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
777   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
778   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
779   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
476   //PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2) /* This is not 2 Player ??? */
780477   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
781478
782   PORT_START_TAG("DSW0")
783   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
784   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
785   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
786   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
787   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
788   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
789   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
790   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
791   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
792   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
793   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
794   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
795   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
796    PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
797    PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
798    PORT_DIPNAME( 0x80, 0x00, DEF_STR(Coinage) )
799    PORT_DIPSETTING(    0x00, "1 Coin/1 or 2 Players" )
479   PORT_MODIFY("DSW0")
480   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "SW1:1" )
481   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "SW1:2" )
482   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:3" )
483    PORT_DIPNAME( 0x80, 0x00, DEF_STR(Coinage) )      PORT_DIPLOCATION("SW1:8")
484    PORT_DIPSETTING(    0x00, "1 Coin/1 Or 2 Players" )
800485    PORT_DIPSETTING(    0x80, "1 Coin/1 Player  2 Coins/2 Players" )   /* Irrelevant, causes bugs */
801486
802   PORT_START_TAG(CABINET_PORT_TAG)      /* Dummy port for cocktail mode (not used) */
487   /* Dummy port for cocktail mode (not used) */
488   PORT_MODIFY(CABINET_PORT_TAG)
803489   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
804490INPUT_PORTS_END
805491
806/*******************************************************/
807/*                                                     */
808/* Space War (Leijac)                                  */
809/*                                                     */
810/*******************************************************/
811492
812static INPUT_PORTS_START( spcewarl )
813   PORT_START_TAG("IN0")
814   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
815   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
816   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
817   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
818   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
819   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
820   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
821   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
822
823   PORT_START_TAG("IN1")
824   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
825   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
826   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
827   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
828   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
829   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
830   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
831   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
832
833   PORT_START_TAG("DSW0")
834   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
835   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
836   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
837   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
838   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
839   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
840   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
841   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
842   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
843   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
844   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
845   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
846   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
847   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
848   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
849    PORT_DIPNAME( 0x80, 0x00, DEF_STR(Coinage) )
850    PORT_DIPSETTING(    0x00, "1 Coin/1 or 2 Players" )
851    PORT_DIPSETTING(    0x80, "1 Coin/1 Player  2 Coins/2 Players" )
852
853   PORT_START_TAG(CABINET_PORT_TAG)      /* Dummy port for cocktail mode (not used) */
854   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
855INPUT_PORTS_END
856
857
858493/*******************************************************/
859494/*                                                     */
860495/* Taito "Galaxy Wars"                                 */
r2018r2019
862497/*******************************************************/
863498
864499static INPUT_PORTS_START( galxwars )
865   PORT_START_TAG("IN0")
866   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
867   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
868   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
869   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
870   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
871   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
500   PORT_INCLUDE( sicv )
501
502   PORT_MODIFY("IN0")
872503   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN ) /* must be IP_ACTIVE_LOW for Universal Sets */
873   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
874504
875   PORT_START_TAG("IN1")
876   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
877   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
878   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
879   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
880   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
881   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
882   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
505   PORT_MODIFY("IN1")
883506   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
884507
885   PORT_START_TAG("DSW0")
886   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
508   PORT_MODIFY("DSW0")
509   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:1,2")
887510   PORT_DIPSETTING(    0x00, "2" )
888511   PORT_DIPSETTING(    0x01, "3" )
889512   PORT_DIPSETTING(    0x02, "4" )
890513   PORT_DIPSETTING(    0x03, "5" )
891   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
892   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
893   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
894   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
514   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:3" )
515   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW1:4")
895516   PORT_DIPSETTING(    0x00, "3000" )
896517   PORT_DIPSETTING(    0x08, "5000" )
897   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
898   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) )
518   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SW1:8")
899519   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
900520   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
901
902   /* Dummy controls port, P1 */
903   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
904   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
905   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
906   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
907   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
908
909   /* Dummy controls port, P2 */
910   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
911   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
912   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
913   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
914   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
915
916   PORT_START_TAG(CABINET_PORT_TAG)      /* Dummy port for cocktail mode */
917   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
918   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
919   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
920521INPUT_PORTS_END
921522
922523
r2018r2019
937538
938539
939540static INPUT_PORTS_START( lrescue )
940   PORT_START_TAG("IN0")
941   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
942   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
943   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
944   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
945   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
946   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
947   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
948   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
541   PORT_INCLUDE( sicv )
949542
950   PORT_START_TAG("IN1")
951   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
952   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
953   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
954   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
955   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
956   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
957   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
543   PORT_MODIFY("IN1")
958544   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
959545
960   PORT_START_TAG("DSW0")
961   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
962   PORT_DIPSETTING(    0x00, "3" )
963   PORT_DIPSETTING(    0x01, "4" )
964   PORT_DIPSETTING(    0x02, "5" )
965   PORT_DIPSETTING(    0x03, "6" )
546   PORT_MODIFY("DSW0")
966547   /* SW1:3-8 Unused according to manual: "Factory Adjustments". Default is ON. */
967   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT ) PORT_DIPLOCATION("SW1:3")
968548   PORT_DIPUNUSED_DIPLOC( 0x08, 0x00, "SW1:4" )
969   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0) PORT_DIPLOCATION("SW1:5,6,7")
970549   PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW1:8" )
971
972   /* Dummy controls port, P1 */
973   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
974   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
975   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
976   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
977   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
978
979   /* Dummy controls port, P2 */
980   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
981   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
982   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
983   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
984   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
985
986   PORT_START_TAG(CABINET_PORT_TAG)      /* Dummy port for cocktail mode */
987   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
988   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
989   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
990550INPUT_PORTS_END
991551
992552static MACHINE_DRIVER_START( lrescue )
r2018r2019
1020580/*******************************************************/
1021581
1022582static INPUT_PORTS_START( cosmicmo )
1023   PORT_START_TAG("IN0")
1024   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1025   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1026   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1027   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1028   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1029   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1030   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1031   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
583   PORT_INCLUDE( sicv )
1032584
1033   PORT_START_TAG("IN1")
1034   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
1035   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1036   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
1037   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1038   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1039   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1040   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
585   PORT_MODIFY("IN1")
1041586   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1042587
1043   PORT_START_TAG("DSW0")
1044   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
588   PORT_MODIFY("DSW0")
589   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:1,2")
1045590   PORT_DIPSETTING(    0x00, "2" )
1046591   PORT_DIPSETTING(    0x01, "3" )
1047592   PORT_DIPSETTING(    0x02, "4" )
1048593   PORT_DIPSETTING(    0x03, "5" )
1049   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1050   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1051   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1052   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1053   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1054   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1055   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
1056   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) )
594   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:3" )
595   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:4" )
596   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SW1:8")
1057597   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1058598   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
1059
1060   /* Dummy controls port, P1 */
1061   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
1062   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
1063   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
1064   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
1065   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1066
1067   /* Dummy controls port, P2 */
1068   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
1069   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1070   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
1071   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
1072   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1073
1074   PORT_START_TAG(CABINET_PORT_TAG)      /* Dummy port for cocktail mode */
1075   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1076   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
1077   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
1078599INPUT_PORTS_END
1079600
1080601
r2018r2019
1085606/*******************************************************/
1086607
1087608static INPUT_PORTS_START( invasion )
1088   PORT_START_TAG("IN0")
1089   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1090   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1091   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1092   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1093   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1094   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1095   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1096   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
609   PORT_INCLUDE( sicv )
1097610
1098   PORT_START_TAG("IN1")
1099   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1100   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1101   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
1102   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1103   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1104   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1105   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
611   PORT_MODIFY("IN1")
1106612   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN2 )
1107613
1108   PORT_START_TAG("DSW0")
614   PORT_MODIFY("DSW0")
1109615   /* SW1:5-8 Unused according to manual. */
1110   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:3,4") /* Default is OFF, OFF (6) */
616   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:4,3") /* Default is OFF, OFF (6) */
1111617   PORT_DIPSETTING(    0x00, "3" )
1112618   PORT_DIPSETTING(    0x01, "4" )
1113619   PORT_DIPSETTING(    0x02, "5" )
1114620   PORT_DIPSETTING(    0x03, "6" )
1115   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW1:8" ) /* Default OFF */
1116   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:2") /* Default is ON (2500) */
621   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW1:8" )      /* Default OFF */
622   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW1:2") /* Default is ON (2500) */
1117623   PORT_DIPSETTING(    0x08, "1500" )
1118624   PORT_DIPSETTING(    0x00, "2500" )
1119   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0) PORT_DIPLOCATION("SW1:5,6,7") /* Default ON */
1120   PORT_DIPNAME( 0x80, 0x00, "Laser Bonus Info" ) PORT_DIPLOCATION("SW1:1") /* Default is OFF (Info on) */
625   /* SW1:5,6,7 Default ON */
626   PORT_DIPNAME( 0x80, 0x80, "Laser Bonus Info" )      PORT_DIPLOCATION("SW1:1") /* Default is OFF (Info on) */
1121627   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1122628   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1123
1124   /* Dummy controls port, P1 */
1125   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
1126   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
1127   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
1128   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
1129   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1130
1131   /* Dummy controls port, P2 */
1132   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
1133   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1134   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
1135   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
1136   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1137
1138   PORT_START_TAG(INVADERS_CAB_TYPE_PORT_TAG)      /* Dummy port for cocktail mode */
1139   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1140   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
1141   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
1142629INPUT_PORTS_END
1143630
1144631
r2018r2019
1149636/*******************************************************/
1150637
1151638static INPUT_PORTS_START( superinv )
1152   PORT_START_TAG("IN0")
1153   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1154   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1155   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1156   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1157   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1158   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1159   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1160   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
639   PORT_INCLUDE( sicv )
1161640
1162   PORT_START_TAG("IN1")
641   PORT_MODIFY("IN1")
1163642   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1164   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1165   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
1166   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1167   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1168   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1169   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1170643   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN2 )
1171644
1172   PORT_START_TAG("DSW0")
1173   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1174   PORT_DIPSETTING(    0x00, "3" )
1175   PORT_DIPSETTING(    0x01, "4" )
1176   PORT_DIPSETTING(    0x02, "5" )
1177   PORT_DIPSETTING(    0x03, "6" )
1178   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1179   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
645   PORT_MODIFY("DSW0")
646   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:3" )
647   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW1:4")
1180648   PORT_DIPSETTING(    0x08, "1500" )
1181649   PORT_DIPSETTING(    0x00, "2500" )
1182   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
1183   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1184
1185   /* Dummy controls port, P1 */
1186   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
1187   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
1188   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
1189   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
1190   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1191
1192   /* Dummy controls port, P2 */
1193   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
1194   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1195   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
1196   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
1197   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1198
1199   PORT_START_TAG(INVADERS_CAB_TYPE_PORT_TAG)      /* Dummy port for cocktail mode */
1200   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1201   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
1202   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
650   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:8" )
1203651INPUT_PORTS_END
1204652
1205653
r2018r2019
1228676
1229677
1230678static INPUT_PORTS_START( rollingc )
1231   PORT_START_TAG("IN0")
1232   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
679   PORT_INCLUDE( sicv )
1233680
681   PORT_MODIFY("IN0")
1234682   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) /* Game Select */
1235683   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) /* Game Select */
1236   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1237   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1238   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1239   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1240   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1241684
1242   PORT_START_TAG("IN0")
685   PORT_MODIFY("IN1")
1243686   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1244   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1245   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
1246   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1247   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1248   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1249   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1250   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1251687
1252   PORT_START_TAG("DSW0")
1253   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1254   PORT_DIPSETTING(    0x00, "3" )
1255   PORT_DIPSETTING(    0x01, "4" )
1256   PORT_DIPSETTING(    0x02, "5" )
1257   PORT_DIPSETTING(    0x03, "6" )
1258   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
1259   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1260   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1261   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1262   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
1263   PORT_DIPNAME( 0x80, 0x00, "Coin Info" )
1264   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1265   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
688   PORT_MODIFY("DSW0")
689   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:4" )
1266690
1267   /* Dummy controls port, P1 */
1268   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
1269   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
1270   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
1271   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
1272   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1273
1274   /* Dummy controls port, P2 */
1275   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
1276   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1277   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
1278   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
1279   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1280
1281   PORT_START_TAG(CABINET_PORT_TAG)      /* Dummy port for cocktail mode */
691   /* Dummy port for cocktail mode (not used) */
692   PORT_MODIFY(CABINET_PORT_TAG)
1282693   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1283694INPUT_PORTS_END
1284695
r2018r2019
1332743   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2)
1333744   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2)
1334745   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1335   PORT_DIPNAME(0x20, 0x20, "Dipswitch 5")
1336   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1337   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1338   PORT_DIPNAME(0x40, 0x40, "Dipswitch 7")
1339   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1340   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
746   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW1:5" )
747   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW1:7" )
1341748   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
1342749
1343750   PORT_START_TAG("IN1")
r2018r2019
1351758   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
1352759
1353760   PORT_START_TAG("DSW0")   // port 2
1354   // dipswitch 1 and 2
1355   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
761   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:1,2")
1356762   PORT_DIPSETTING(    0x00, "3" )
1357763   PORT_DIPSETTING(    0x01, "4" )
1358764   PORT_DIPSETTING(    0x02, "5" )
1359765   PORT_DIPSETTING(    0x03, "6" )
1360   // dipswitch 3
1361   PORT_DIPNAME( 0x04, 0x04, "Dipswitch 3")
1362   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1363   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1364   // dipswitch 4
1365   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Difficulty ) )
766   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:3" )
767   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW1:4")
1366768   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
1367769   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )
1368770   // Name Reset - if name of high scorer was rude, owner can press this button
1369771   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Name Reset") PORT_CODE(KEYCODE_F1)
1370772   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_TILT )
1371   // dipswitch 6
1372   PORT_DIPNAME( 0x40, 0x00, "Number of Controllers" )
773   PORT_DIPNAME( 0x40, 0x00, "Number Of Controllers" )   PORT_DIPLOCATION("SW1:6")
1373774   PORT_DIPSETTING(    0x00, "1" )
1374775   PORT_DIPSETTING(    0x40, "2" )
1375776   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
r2018r2019
1437838
1438839
1439840static INPUT_PORTS_START( schasrcv )
1440   PORT_START_TAG("IN0")
1441   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1442   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1443   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1444   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1445   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1446   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1447   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1448   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
841   PORT_INCLUDE( invrvnge )
1449842
1450   PORT_START_TAG("IN1")
1451   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
1452   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1453   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
843   PORT_MODIFY("IN1")
1454844   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
1455   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1456845   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
1457846   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1458847   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
1459848
1460   PORT_START_TAG("DSW0")
1461   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )
849   PORT_MODIFY("DSW0")
850   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:1")
1462851   PORT_DIPSETTING(    0x00, "3" )
1463852   PORT_DIPSETTING(    0x01, "4" )
1464   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2)
1465   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2)
1466   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Difficulty ) )
853   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2)   PORT_DIPLOCATION("SW1:2")
854   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2)      PORT_DIPLOCATION("SW1:3")
855   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW1:4")
1467856   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
1468857   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )
1469   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1470   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
1471   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2)
1472   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1473   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1474   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1475
1476   PORT_START_TAG(CABINET_PORT_TAG)      /* Dummy port for cocktail mode */
1477   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1478   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
1479   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
858   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)               PORT_DIPLOCATION("SW1:5")
859   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)   PORT_DIPLOCATION("SW1:6")
860   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2)   PORT_DIPLOCATION("SW1:7")
861   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:8" )
1480862INPUT_PORTS_END
1481863
1482864static MACHINE_DRIVER_START( schasrcv )
r2018r2019
1588970
1589971
1590972static INPUT_PORTS_START( lupin3 )
1591   PORT_START_TAG("IN0")
1592   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* selects color mode (dynamic vs. static) */
1593   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* something has to do with sound */
973   PORT_INCLUDE( invrvnge )
974
975   PORT_MODIFY("IN0")
976   //PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* selects color mode (dynamic vs. static) */
977   //PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* something has to do with sound */
1594978   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
1595979   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_COCKTAIL
1596980   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
r2018r2019
1598982   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1599983   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
1600984
1601   PORT_START_TAG("IN1")
985   PORT_MODIFY("IN1")
1602986   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1603   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1604   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
1605987   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1606988   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1607989   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
1608990   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
1609991   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
1610992
1611   PORT_START_TAG("DSW0")
1612   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1613   PORT_DIPSETTING(    0x00, "3" )
1614   PORT_DIPSETTING(    0x01, "4" )
1615   PORT_DIPSETTING(    0x02, "5" )
1616   PORT_DIPSETTING(    0x03, "6" )
1617   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
993   PORT_MODIFY("DSW0")
994   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SW1:3")
1618995   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1619996   PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
1620   PORT_DIPNAME( 0x08, 0x00, "Bags to Collect" )
997   PORT_DIPNAME( 0x08, 0x00, "Bags To Collect" )      PORT_DIPLOCATION("SW1:4")
1621998   PORT_DIPSETTING(    0x08, "2" )
1622999   PORT_DIPSETTING(    0x00, "8" )
1623   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Language ) )
1000   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Language ) )      PORT_DIPLOCATION("SW1:5")
16241001   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
16251002   PORT_DIPSETTING(    0x10, DEF_STR( Japanese ) )
1626   PORT_BIT( 0x20, IP_ACTIVE_HIGH,  IPT_UNUSED )
1627   PORT_BIT( 0x40, IP_ACTIVE_HIGH,  IPT_UNUSED )
1628   PORT_DIPNAME(0x80,  0x00, "Invulnerability (Cheat)")
1003   PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "SW1:6" )
1004   PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW1:7" )
1005   PORT_DIPNAME(0x80,  0x00, "Invulnerability (Cheat)") PORT_DIPLOCATION("SW1:8")
16291006   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
16301007   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
16311008
1632   PORT_START_TAG(CABINET_PORT_TAG)      /* Dummy port for cocktail mode */
1009   /* Dummy port for cocktail mode (not used) */
1010   PORT_MODIFY(CABINET_PORT_TAG)
16331011   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
16341012INPUT_PORTS_END
16351013
r2018r2019
16971075
16981076
16991077static INPUT_PORTS_START( polaris )
1078   PORT_INCLUDE( schaser )
17001079
1701   PORT_START_TAG("IN0")
1702   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
1703   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1704   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1705   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) )
1706   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1707   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1080   PORT_MODIFY("IN0")
1081   PORT_DIPUNUSED_DIPLOC( 0x01, 0x00, "SW?:1" )
1082   PORT_DIPUNUSED_DIPLOC( 0x02, 0x00, "SW?:2" )
17081083   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
17091084   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
17101085   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
r2018r2019
17121087   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
17131088   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
17141089
1715   PORT_START_TAG("IN1")
1090   PORT_MODIFY("IN1")
17161091   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
17171092   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
17181093   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
r2018r2019
17221097   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
17231098   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
17241099
1725   PORT_START_TAG("DSW0")
1726   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1727   PORT_DIPSETTING(    0x00, "3" )
1728   PORT_DIPSETTING(    0x01, "4" )
1729   PORT_DIPSETTING(    0x02, "5" )
1730   PORT_DIPSETTING(    0x03, "6" )
1100   PORT_MODIFY("DSW0")
17311101   /* 0x04 should be Cabinet - Upright/Cocktail,
17321102       but until the cocktail hack is changed,
17331103       this will have to do. */
1734   PORT_DIPNAME( 0x04, 0x00, "Number of Controls" )
1104   PORT_DIPNAME( 0x04, 0x00, "Number Of Controls" )   PORT_DIPLOCATION("SW1:3")
17351105   PORT_DIPSETTING(    0x00, "1" )
17361106   PORT_DIPSETTING(    0x04, "2" )
1737   PORT_DIPNAME( 0x08, 0x00, "Invincible Test" )
1107   PORT_DIPNAME( 0x08, 0x00, "Invincible Test" )      PORT_DIPLOCATION("SW1:4")
17381108   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
17391109   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
17401110   /* The Demo Sounds dip switch does function.
17411111     * It allows the sonar sounds to play in demo mode. */
1742   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) )
1112   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW1:5")
17431113   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
17441114   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1745   PORT_DIPNAME( 0x20, 0x00, "Not Used" )
1115   PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "SW1:6" )
1116   PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW1:7" )
1117   PORT_DIPNAME( 0x80, 0x00, "High Score Preset Mode" ) PORT_DIPLOCATION("SW1:8")
17461118   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1747   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1748   PORT_DIPNAME( 0x40, 0x00, "Not Used" )
1749   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1750   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1751   PORT_DIPNAME( 0x80, 0x00, "High Score Preset Mode" )
1752   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
17531119   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
17541120
1755   PORT_START_TAG(CABINET_PORT_TAG)      /* Dummy port for cocktail mode */
1756   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1757   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
1758   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
1759
1760   PORT_START_TAG("VR1")
1121   PORT_MODIFY("VR1")
17611122   PORT_ADJUSTER( 80, "Sub Volume VR1" )
17621123
1763   PORT_START_TAG("VR2")
1124   PORT_MODIFY("VR2")
17641125   PORT_ADJUSTER( 70, "Sub Volume VR2" )
17651126
1766   PORT_START_TAG("VR3")
1127   PORT_MODIFY("VR3")
17671128   PORT_ADJUSTER( 90, "Sub Volume VR3" )
17681129INPUT_PORTS_END
17691130
r2018r2019
17971158/*******************************************************/
17981159
17991160static INPUT_PORTS_START( ozmawars )
1800   PORT_START_TAG("IN0")
1161   PORT_INCLUDE( sicv )
18011162
1802   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1803   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1804   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1805   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1806   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1807   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1808   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1809   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1810
1811   PORT_START_TAG("IN1")
1163   PORT_MODIFY("IN1")
18121164   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1813   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1814   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
1815   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1816   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1817   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1818   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1819   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
18201165
1821   PORT_START_TAG("DSW0")
1822   PORT_DIPNAME( 0x03, 0x00, "Energy" )
1166   PORT_MODIFY("DSW0")
1167   PORT_DIPNAME( 0x03, 0x00, "Energy" )         PORT_DIPLOCATION("SW1:1,2")
18231168   PORT_DIPSETTING(    0x00, "15000" )
18241169   PORT_DIPSETTING(    0x01, "20000" )
18251170   PORT_DIPSETTING(    0x02, "25000" )
18261171   PORT_DIPSETTING(    0x03, "35000" )
1827   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1828   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1829   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1830   PORT_DIPNAME( 0x08, 0x00, "Bonus Energy" )
1172   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:3" )
1173   PORT_DIPNAME( 0x08, 0x00, "Bonus Energy" )      PORT_DIPLOCATION("SW1:4")
18311174   PORT_DIPSETTING(    0x00, "15000" )
18321175   PORT_DIPSETTING(    0x08, "10000" )
1833   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
1834   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) )
1176   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) )   PORT_DIPLOCATION("SW1:8")
18351177   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
18361178   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
1837
1838   /* Dummy controls port, P1 */
1839   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
1840   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
1841   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
1842   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
1843   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1844
1845   /* Dummy controls port, P2 */
1846   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
1847   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1848   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
1849   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
1850   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1851
1852    PORT_START_TAG(CABINET_PORT_TAG)      /* Dummy port for cocktail mode */
1853   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1854   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
1855   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
18561179INPUT_PORTS_END
18571180
18581181
18591182static INPUT_PORTS_START( spaceph )
1860   PORT_START_TAG("IN0")
1861   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1862   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1863   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1864   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1865   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1866   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1867   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1868   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1183   PORT_INCLUDE( ozmawars )
18691184
1870   PORT_START_TAG("IN1")
1871   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1872   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1873   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
1874   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1875   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1876   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1877   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1185   PORT_MODIFY("IN1")
18781186   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1879
1880   PORT_START_TAG("IN1")
1881   PORT_DIPNAME( 0x03, 0x00, "Energy" )
1882   PORT_DIPSETTING(    0x00, "15000" )
1883   PORT_DIPSETTING(    0x01, "20000" )
1884   PORT_DIPSETTING(    0x02, "25000" )
1885   PORT_DIPSETTING(    0x03, "35000" )
1886   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1887   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1888   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1889   PORT_DIPNAME( 0x08, 0x00, "Bonus Energy" )
1890   PORT_DIPSETTING(    0x08, "10000" )
1891   PORT_DIPSETTING(    0x00, "15000" )
1892   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
1893   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) )
1894   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1895   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
1896
1897   /* Dummy controls port, P1 */
1898   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
1899   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
1900   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
1901   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
1902   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1903
1904   /* Dummy controls port, P2 */
1905   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
1906   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1907   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
1908   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
1909   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1910
1911   PORT_START_TAG(CABINET_PORT_TAG)      /* Dummy port for cocktail mode */
1912   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1913   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
1914   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
19151187INPUT_PORTS_END
19161188
19171189
r2018r2019
19231195/*******************************************************/
19241196
19251197static INPUT_PORTS_START( sinvemag )
1926   PORT_START_TAG("IN0")
1927   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1928   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1929   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1198   PORT_INCLUDE( sicv )
19301199
1931   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1932   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1933   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1934   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1935   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1936
1937   PORT_START_TAG("IN1")
1938   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
1939   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1940   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
1941   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1942   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1943   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1944   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1200   PORT_MODIFY("IN1")
19451201   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
19461202
1947   PORT_START_TAG("DSW0")
1948   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1949   PORT_DIPSETTING(    0x00, "3" )
1950   PORT_DIPSETTING(    0x01, "4" )
1951   PORT_DIPSETTING(    0x02, "5" )
1952   PORT_DIPSETTING(    0x03, "6" )
1953   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1954   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1955   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1956   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
1203   PORT_MODIFY("DSW0")
1204   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:3" )
1205   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW1:4")
19571206   PORT_DIPSETTING(    0x08, "2000" )
19581207   PORT_DIPSETTING(    0x00, "3000" )
1959   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
1960   PORT_DIPNAME( 0x80, 0x00, "Coin Info" )
1961   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1962   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1963
1964   /* Dummy controls port, P1 */
1965   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
1966   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
1967   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
1968   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
1969   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1970
1971   /* Dummy controls port, P2 */
1972   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
1973   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1974   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
1975   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
1976   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1977
1978    PORT_START_TAG(INVADERS_CAB_TYPE_PORT_TAG)      /* Dummy port for cocktail mode */
1979   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1980   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
1981   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
19821208INPUT_PORTS_END
19831209
19841210
r2018r2019
19901216/*******************************************************/
19911217
19921218static INPUT_PORTS_START( jspecter )
1219   PORT_INCLUDE( sicv )
19931220
1994   PORT_START_TAG("IN0")
1995   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1996   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1997   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1998   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1999   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2000   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2001   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2002   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1221   PORT_MODIFY("IN1")
1222   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY //typo? declared twice
20031223
2004   PORT_START_TAG("IN1")
2005   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
2006   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2007   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
2008   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2009   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
2010   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
2011   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
2012   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
2013
2014   PORT_START_TAG("DSW0")
2015   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
2016   PORT_DIPSETTING(    0x00, "3" )
2017   PORT_DIPSETTING(    0x01, "4" )
2018   PORT_DIPSETTING(    0x02, "5" )
2019   PORT_DIPSETTING(    0x03, "6" )
2020   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
2021   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2022   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2023   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
2024   PORT_DIPSETTING(    0x08, "1000" )
2025   PORT_DIPSETTING(    0x00, "1500" )
2026   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
2027   PORT_DIPNAME( 0x80, 0x00, "Coin Info" )
2028   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2029   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2030
2031   /* Dummy controls port, P1 */
2032   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
2033   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
2034   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
2035   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
2036   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
2037
2038   /* Dummy controls port, P2 */
2039   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
2040   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
2041   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2042   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2043   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
2044
2045   PORT_START_TAG(CABINET_PORT_TAG)      /* Dummy port for cocktail mode */
2046   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
2047   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
2048   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
1224   PORT_MODIFY("DSW0")
1225   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:3" )
20491226INPUT_PORTS_END
20501227
20511228
r2018r2019
20661243
20671244
20681245static INPUT_PORTS_START( ballbomb )
2069   PORT_START_TAG("IN0")
2070   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2071   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2072   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2073   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2074   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2075   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2076   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2077   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1246   PORT_INCLUDE( sicv )
20781247
2079   PORT_START_TAG("IN1")
1248   PORT_MODIFY("IN1")
20801249   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2081   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
2082   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
2083   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2084   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
2085   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
2086   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
2087   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
20881250
2089   PORT_START_TAG("DSW0")
2090   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
2091   PORT_DIPSETTING(    0x00, "3" )
2092   PORT_DIPSETTING(    0x01, "4" )
2093   PORT_DIPSETTING(    0x02, "5" )
2094   PORT_DIPSETTING(    0x03, "6" )
2095   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
2096   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2097   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
2098   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2099
2100   /* Dummy controls port, P1 */
2101   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
2102   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
2103   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
2104   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
2105   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
2106
2107   /* Dummy controls port, P2 */
2108   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
2109   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
2110   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2111   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2112   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
2113
2114   PORT_START_TAG(CABINET_PORT_TAG)      /* Dummy port for cocktail mode */
2115   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
2116   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
2117   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
1251   PORT_MODIFY("DSW0")
1252   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:4" )
1253   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:8" )
21181254INPUT_PORTS_END
21191255
21201256static MACHINE_DRIVER_START( ballbomb )
r2018r2019
21811317   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
21821318
21831319   /* Dummy controls port, P1 */
2184   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
2185   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
2186   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
2187   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
2188   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1320   INVADERS_CONTROL_PORT_P1
21891321
21901322   /* Dummy controls port, P2 */
2191   PORT_START_TAG(INVADERS_P2_CONTROL_PORT_TAG)
2192   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
2193   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
2194   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
2195   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
1323   INVADERS_CONTROL_PORT_P2
21961324
2197   PORT_START_TAG(CABINET_PORT_TAG)      /* Dummy port for cocktail mode */
1325   /* Dummy port for cocktail mode (not used) */
1326   PORT_START_TAG(CABINET_PORT_TAG)
21981327   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
21991328INPUT_PORTS_END
22001329
r2018r2019
22201349/*******************************************************/
22211350
22221351static INPUT_PORTS_START( indianbt )
2223
22241352   PORT_START_TAG("IN0")
22251353   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
22261354   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
r2018r2019
23451473   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) )
23461474   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
23471475   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2348
23491476   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Lives ) )
23501477   PORT_DIPSETTING(    0x00, "3" )
23511478   PORT_DIPSETTING(    0x02, "4" )
23521479   PORT_DIPSETTING(    0x04, "5" )
23531480   PORT_DIPSETTING(    0x06, "6" )
2354
23551481   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
23561482   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
23571483   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r2018r2019
25021628   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
25031629   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
25041630
2505   PORT_START_TAG(CABINET_PORT_TAG)      /* Dummy port for cocktail mode */
2506   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
2507   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
2508   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
1631   /* Dummy port for cocktail mode */
1632   INVADERS_CAB_TYPE_PORT
25091633INPUT_PORTS_END
25101634
25111635static MACHINE_DRIVER_START( darthvdr )
r2018r2019
32482372GAMEL(19??, invrvnga, invrvnge, invrvnge, invrvnge, 0, ROT270, "Zenitone-Microsec Ltd. (Dutchford license)", "Invader's Revenge (Dutchford)", GAME_IMPERFECT_SOUND, layout_invrvnge )
32492373GAME( 1980, spclaser, 0,        invaders, spclaser, 0, ROT270, "GamePlan (Taito)", "Space Laser", 0 )
32502374GAME( 1980, laser,    spclaser, invaders, spclaser, 0, ROT270, "Leisure Time Electronics Inc.", "Astro Laser", 0 )
3251GAME( 1979, spcewarl, spclaser, invaders, spcewarl, 0, ROT270, "Leijac Corporation (Konami)","Space War (Leijac Corporation)", 0 )
2375GAME( 1979, spcewarl, spclaser, invaders, spclaser, 0, ROT270, "Leijac Corporation (Konami)","Space War (Leijac Corporation)", 0 )
32522376GAME( 1979, rollingc, 0,        rollingc, rollingc, 0, ROT270, "Nichibutsu", "Rolling Crash / Moon Base", 0 )
32532377GAME( 1979, ozmawars, 0,        invaders, ozmawars, 0, ROT270, "SNK", "Ozma Wars (set 1)", 0 )
32542378GAME( 1979, ozmawar2, ozmawars, invaders, ozmawars, 0, ROT270, "SNK", "Ozma Wars (set 2)" , 0) /* Uses Taito's three board color version of Space Invaders PCB */
src/mame/drivers/meritm.c
r2018r2019
460460static VIDEO_START( meritm )
461461{
462462   vdp0_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
463   v9938_init (machine, 0, vdp0_bitmap, MODEL_V9938, 0x20000, meritm_vdp0_interrupt);
463   v9938_init (machine, 0, machine->primary_screen, vdp0_bitmap, MODEL_V9938, 0x20000, meritm_vdp0_interrupt);
464464   v9938_reset(0);
465465
466466   vdp1_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
467   v9938_init (machine, 1, vdp1_bitmap, MODEL_V9938, 0x20000, meritm_vdp1_interrupt);
467   v9938_init (machine, 1, machine->primary_screen, vdp1_bitmap, MODEL_V9938, 0x20000, meritm_vdp1_interrupt);
468468   v9938_reset(1);
469469
470470   state_save_register_global(meritm_vint);
src/mame/drivers/ladyfrog.c
r2018r2019
318318
319319   MDRV_SOUND_ADD(MSM5232, 2000000)
320320   MDRV_SOUND_CONFIG(msm5232_interface)
321   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
321   MDRV_SOUND_ROUTE(0, "mono", 1.0)   // pin 28  2'-1
322   MDRV_SOUND_ROUTE(1, "mono", 1.0)   // pin 29  4'-1
323   MDRV_SOUND_ROUTE(2, "mono", 1.0)   // pin 30  8'-1
324   MDRV_SOUND_ROUTE(3, "mono", 1.0)   // pin 31 16'-1
325   MDRV_SOUND_ROUTE(4, "mono", 1.0)   // pin 36  2'-2
326   MDRV_SOUND_ROUTE(5, "mono", 1.0)   // pin 35  4'-2
327   MDRV_SOUND_ROUTE(6, "mono", 1.0)   // pin 34  8'-2
328   MDRV_SOUND_ROUTE(7, "mono", 1.0)   // pin 33 16'-2
329   // pin 1 SOLO  8'       not mapped
330   // pin 2 SOLO 16'       not mapped
331   // pin 22 Noise Output  not mapped
322332MACHINE_DRIVER_END
323333
324334
src/mame/drivers/sidearms.c
r2018r2019
729729
730730   MDRV_SCREEN_ADD("main", RASTER)
731731   MDRV_SCREEN_REFRESH_RATE(60)
732   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
732   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
733733   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
734734   MDRV_SCREEN_SIZE(64*8, 32*8)
735735   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 )
r2018r2019
775775
776776   MDRV_SCREEN_ADD("main", RASTER)
777777   MDRV_SCREEN_REFRESH_RATE(60)
778   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
778   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
779779   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
780780   MDRV_SCREEN_SIZE(64*8, 32*8)
781781   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 )
src/mame/drivers/tecmosys.c
r2018r2019
1616
1717/*
1818
19Deroon DeroDero
20(c)1996 Tecmo
21Tecmo System Board
19Deroon Dero Dero
20Tecmo, 1996
2221
22This game is a Puyo Puyo rip-off.
23
24PCB Layout
25----------
26
27TECMO SYSTEM BOARD A
28|-------------------------------------------------------------------------|
29|  LM324  UPC452C      16.9MHz        |--------|    |--------|  6264  |
30| TA8205 LM324  YAC513  YMF262 YMZ280B  |TECMO  |    |TECMO  |  6264  |
31|        LM324  M6295  UPC452C          |AA03-8431    |AA02-1927        |
32|                      YAC512          |        |    |        |        |
33|                                        |--------|    |--------|        |
34|        Z80  6264 28MHz 14.31818MHz                  |--------|        |
35|                    16MHz              62256          |TECMO  |        |
36|            TA8030                    62256          |AA02-1927  6264  |
37|                                                      |        |  6264  |
38|J  93C46                              |--------|    |--------|        |
39|A                                      |TECMO  |    |--------|        |
40|M                                      |AA03-8431    |TECMO  |        |
41|M          68000                        |        |    |AA02-1927        |
42|A                                      |--------|    |        |  6264  |
43|                  PAL              6116              |--------|  6264  |
44|                                    6116              |--------|        |
45|  |--------|                                          |TECMO  |        |
46|  |TECMO  |                      PAL                |AA02-1927        |
47|  |AA03-8431  62256                                  |        |  6264  |
48|  |        |  62256                                  |--------|  6264  |
49|  |--------|                                |---------|                |
50|                                              |TECMO    |                |
51|                                              |AA03-8431|                |
52|                                              |        |                |
53|                                              |---------|          424260|
54|                                              62256 62256          424260|
55|-------------------------------------------------------------------------|
56Notes:
5768000 @ 16MHz
58Z80 @ 8MHz [16/2]
59YMZ280B @ 16.9MHz
60YMF262 @ 14.31818MHz
61OKI M6295 @ 2MHz [16/8]. Pin 7 HIGH
62
63Game Board
64----------
65
66TECMO SYSTEM BOARD B2
67|-------------------------------------------------------------------------|
68|    T201_DIP42_MASK.UBB1                                                |
69| |----|                                              T202_DIP42_MASK.UBC1|
70| |*  |                                                                  |
71| |----|                                                                  |
72|                                                                        |
73|  T003_2M_EPROM.UZ1                        T101_SOP44.UAH1            |
74|                                                                        |
75|                                            T301_DIP42_MASK.UBD1        |
76|                                                                        |
77|                                                                        |
78|                                                                        |
79|  T401_DIP42_MASK.UYA1      T104_SOP44.UCL1    T001_4M_EPROM.UPAU1    |
80|                              T103_SOP44.UBL1                            |
81|  T501_DIP32_MASK.UAD1      T102_SOP44.UAL1                            |
82|                                                  T002_4M_EPROM.UPAL1    |
83|-------------------------------------------------------------------------|
84Notes:
85      * - Unknown QFP64 microcontroller marked 'TECMO SC432146FU E23D 185 SSAB9540B'
86          Clocks: pin 33 - 8MHz, pin 31: 8MHz, pin 29 - 2MHz
87          GND on pins 49, 23, 24, 27
88          Power on pins 55, 25
89          Note - Pins 25 and 27 are tied to some jumpers, so these
90          appear to be some kind of configuration setting.
91
2392CPU  : TMP68HC000P-16
2493Sound: TMPZ84C00AP-8 YMF262 YMZ280B M6295
2594OSC  : 14.3181MHz (X1) 28.0000MHz (X2) 16.0000MHz (X3) 16.9MHz (X4)
src/mame/drivers/exidy440.c
r2018r2019
215215***************************************************************************/
216216
217217#include "driver.h"
218#include "deprecat.h"
219218#include "exidy440.h"
220219
221220
r2018r2019
343342static READ8_HANDLER( exidy440_input_port_3_r )
344343{
345344   /* I/O1 accesses clear the CIRQ flip/flop */
346   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
345   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
347346   return readinputport(3);
348347}
349348
r2018r2019
364363
365364static TIMER_CALLBACK( delayed_sound_command_w )
366365{
367   *exidy440_sound_command = param;
366   exidy440_sound_command = param;
368367   exidy440_sound_command_ack = 0;
369368
370369   /* cause an FIRQ on the sound CPU */
r2018r2019
381380static WRITE8_HANDLER( exidy440_input_port_3_w )
382381{
383382   /* I/O1 accesses clear the CIRQ flip/flop */
384   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
383   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
385384}
386385
387386
r2018r2019
476475   AM_RANGE(0x2b02, 0x2b02) AM_RAM AM_BASE(&exidy440_scanline)
477476   AM_RANGE(0x2b03, 0x2b03) AM_READWRITE(input_port_0_r, exidy440_control_w)
478477   AM_RANGE(0x2c00, 0x2dff) AM_READWRITE(exidy440_paletteram_r, exidy440_paletteram_w)
479   AM_RANGE(0x2e00, 0x2e1f) AM_READWRITE(SMH_RAM, sound_command_w) AM_BASE(&exidy440_sound_command)
478   AM_RANGE(0x2e00, 0x2e1f) AM_READWRITE(SMH_RAM, sound_command_w)
480479   AM_RANGE(0x2e20, 0x2e3f) AM_READWRITE(exidy440_input_port_3_r, exidy440_input_port_3_w)
481480   AM_RANGE(0x2e40, 0x2e5f) AM_READWRITE(SMH_NOP, exidy440_coin_counter_w)   /* read: clear coin counters I/O2 */
482481   AM_RANGE(0x2e60, 0x2e7f) AM_READWRITE(input_port_1_r, SMH_NOP)
src/mame/drivers/merit.c
r2018r2019
821821
822822   MDRV_SOUND_ADD(AY8910, 2500000)
823823   MDRV_SOUND_CONFIG(merit_ay8912_interface)
824   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
824   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
825825MACHINE_DRIVER_END
826826
827827static MACHINE_DRIVER_START( bigappg )
src/mame/drivers/segae.c
r2018r2019
716716   memset(chip->sprite_renderline,0x00,256+32);
717717
718718   chip->writemode = 0;
719   chip->r_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
719   chip->r_bitmap = auto_bitmap_alloc(256, 256, BITMAP_FORMAT_RGB15);
720720
721721   chip->sms_scanline_timer = timer_alloc(sms_scanline_timer_callback, chip);
722722
src/mame/drivers/bladestl.c
r2018r2019
162162***************************************************************************/
163163
164164static INPUT_PORTS_START( bladestl )
165   PORT_START   /* DSW #1 */
166   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
165   PORT_START_TAG("DSW1")
166   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:1,2,3,4")
167167   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
168168   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
169169   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
r2018r2019
180180   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
181181   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
182182   PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
183   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
183   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:5,6,7,8")
184184   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
185185   PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
186186   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
r2018r2019
198198   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
199199   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
200200
201   PORT_START   /* DSW #2 */
202   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
203   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
204   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
205   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
206   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
207   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
208   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
201   PORT_START_TAG("DSW2")
202   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" )
203   PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW2:2" )
204   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SW2:3")
209205   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
210206   PORT_DIPSETTING(   0x04, DEF_STR( Cocktail ) )
211   PORT_DIPNAME( 0x18, 0x18, "Bonus time set" )
207   PORT_DIPNAME( 0x18, 0x18, "Bonus time set" )      PORT_DIPLOCATION("SW2:4,5")
212208   PORT_DIPSETTING(    0x18, "30 secs" )
213209   PORT_DIPSETTING(    0x10, "20 secs" )
214210   PORT_DIPSETTING(    0x08, "15 secs" )
215211   PORT_DIPSETTING(    0x00, "10 secs" )
216   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
212   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:6,7")
217213   PORT_DIPSETTING(   0x60, DEF_STR( Easy ) )
218214   PORT_DIPSETTING(   0x40, DEF_STR( Normal ) )
219215   PORT_DIPSETTING(   0x20, "Difficult" )
220216   PORT_DIPSETTING(   0x00, "Very difficult" )
221   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
217   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW2:8")
222218   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
223219   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
224220
225   PORT_START   /* COINSW */
221   PORT_START_TAG("COINSW")
226222   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
227223   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
228224   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
229225   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
230226   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
231   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
227   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SW3:1")
232228   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
233229   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
234   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
235   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
236   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
237   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
230   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW3:2" )
231   PORT_SERVICE_DIPLOC(  0x80, IP_ACTIVE_LOW, "SW3:3" )
238232
239   PORT_START   /* PLAYER 1 INPUTS */
233   PORT_START_TAG("P1")
240234   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
241235   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
242236   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r2018r2019
244238   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
245239   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
246240   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
247   PORT_DIPNAME( 0x80, 0x80, "Period time set" )
241   PORT_DIPNAME( 0x80, 0x80, "Period time set" )      PORT_DIPLOCATION("SW3:4")
248242   PORT_DIPSETTING(    0x80, "4" )
249243   PORT_DIPSETTING(    0x00, "7" )
250244
251
252   PORT_START   /* PLAYER 2 INPUTS */
245   PORT_START_TAG("P2")
253246   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
254247   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
255248   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r2018r2019
259252   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
260253   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
261254
262   /* Trackball 1P */
263   PORT_START
255   PORT_START_TAG("TRACKBALL_P1_1")
264256   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_REVERSE PORT_PLAYER(1)
265   PORT_START
257
258   PORT_START_TAG("TRACKBALL_P1_2")
266259   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_PLAYER(1)
267260
268   /* Trackball 2P */
269   PORT_START
261   PORT_START_TAG("TRACKBALL_P2_1")
270262   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_REVERSE PORT_PLAYER(2)
271   PORT_START
263
264   PORT_START_TAG("TRACKBALL_P2_2")
272265   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_PLAYER(2)
273266INPUT_PORTS_END
274267
275268static INPUT_PORTS_START( bladstle )
276   PORT_START   /* DSW #1 */
277   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
278   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
279   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
280   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
281   PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) )
282   PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) )
283   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
284   PORT_DIPSETTING(    0x00, DEF_STR( 4C_5C ) )
285   PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) )
286   PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
287   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
288   PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )
289   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
290   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
291   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
292   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
293   PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
294   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
295   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
296   PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
297   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
298   PORT_DIPSETTING(    0x40, DEF_STR( 3C_2C ) )
299   PORT_DIPSETTING(    0x10, DEF_STR( 4C_3C ) )
300   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
301   PORT_DIPSETTING(    0x00, DEF_STR( 4C_5C ) )
302   PORT_DIPSETTING(    0x30, DEF_STR( 3C_4C ) )
303   PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
304   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
305   PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) )
306   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
307   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
308   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
309   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
310   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
269   PORT_INCLUDE( bladestl )
311270
312   PORT_START   /* DSW #2 */
313   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
314   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
315   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
316   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
317   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
318   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
319   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
320   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
321   PORT_DIPSETTING(   0x04, DEF_STR( Cocktail ) )
322   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
323   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
324   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
325   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
326   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
327   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
328   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
329   PORT_DIPSETTING(   0x60, DEF_STR( Easy ) )
330   PORT_DIPSETTING(   0x40, DEF_STR( Normal ) )
331   PORT_DIPSETTING(   0x20, "Difficult" )
332   PORT_DIPSETTING(   0x00, "Very difficult" )
333   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
334   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
335   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
271   PORT_MODIFY("DSW2")
272   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW2:4" )   /* Listed as "Unused" */
273   PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW2:5" )   /* Listed as "Unused" */
336274
337   PORT_START   /* COINSW */
338   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
339   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
340   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
341   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
342   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
343   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
344   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
345   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
346   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
347   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
348   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
349   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
275   PORT_MODIFY("P1")
276   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW3:4" )   /* Listed as "Unused" */
350277
351   PORT_START   /* PLAYER 1 INPUTS */
352   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
353   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
354   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
355   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
356   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
357   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
358   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
359   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
360
361   PORT_START   /* PLAYER 2 INPUTS */
362   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
363   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
364   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
365   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
366   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
367   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
368   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
369   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
370
371   /* Trackball 1P */
372   PORT_START
373   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_REVERSE PORT_PLAYER(1)
374   PORT_START
375   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_PLAYER(1)
376
377   /* Trackball 2P */
378   PORT_START
278   PORT_MODIFY("TRACKBALL_P2_1")
379279   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_PLAYER(2)
380   PORT_START
280
281   PORT_MODIFY("TRACKBALL_P2_2")
381282   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_PLAYER(2)
382283INPUT_PORTS_END
383284
src/mame/drivers/funworld.c
r2018r2019
2929    * Pool 10 (italian, set 1),                         C.M.C.,             1996.
3030    * Pool 10 (italian, set 2),                         C.M.C.,             1996.
3131    * Tortuga Family (italian),                         C.M.C.,             1997.
32    * Pot Game (italian),                               C.M.C.,             1996.
3233    * Royal Card (austrian, set 1),                     TAB-Austria,        1991.
3334    * Royal Card (austrian, set 2),                     TAB-Austria,        1991.
3435    * Royal Card (slovak, encrypted),                   Evona Electronic,   1991.
r2018r2019
148149    - Cuore 1
149150    - Elephant Family
150151    - Tortuga Family
152    - Pot Game
151153
152154    In Italy many people became addicted to videopokers. They put so much money on them,
153155    and they had to sell the house. Also some engineers modified videopokers to do less
r2018r2019
184186    get the input codes necessary to allow boot the game.
185187
186188
189    - Jolly Card (croatian sets) and Jolly Card Professional 2.0
190
191    These games don't operate with regular coins/tokens. Only remote credits are allowed.
192
193
187194    - Magic Card II (Impera)
188195
189196    Impera made 2 graphics sets for this game. One of them is encrypted, and meant for the TAB blue board.
r2018r2019
490497    - 1x battery
491498
492499
493    Tortuga Family (italian)
494    ------------------------
500    Tortuga Family (italian) & Pot Game (italian)
501    ---------------------------------------------
495502
496503    - 1x G65SC02P2 (main)
497504    - 1x 95101 (sound)
r2018r2019
813820    - Added minor corrections.
814821    - Updated technical notes.
815822
823    2008/03/14
824    - Added proper inputs to jolyc980.
825    - Added temporary patch to allow bypass the "code" screen in jolyc980.
826    - Updated technical notes.
816827
828    2008/03/18
829    - Added new game: Pot Game (italian).
830    - Updated technical notes.
831
832
817833    *** TO DO ***
818834
819835    - Figure out the royalcdc, jokercrd and saloon encryption.
820836    - Fix the imperfect sound in Magic Card II.
821    - Reverse-engineering the boot code of Jolly Card Professional 2.0 to get the proper input codes to boot.
837    - Reverse-engineering the boot code of Jolly Card Professional 2.0 to get the proper codes to boot.
822838    - Analyze the unknown writes to $2000/$4000 in some games.
823839    - Check for the reads to the ay8910 output ports in some games.
824840    - Figure out the MCU in monglfir and soccernw.
r2018r2019
11331149   PORT_DIPSETTING(    0x80, "Manual Payout SW" )
11341150INPUT_PORTS_END
11351151
1152static INPUT_PORTS_START( jolyc980 )
1153   PORT_START_TAG("IN0")
1154   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE )   PORT_NAME("Navijanje (Remote)") PORT_CODE(KEYCODE_Q)
1155   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )   PORT_NAME("Stop (Hold) 1") PORT_CODE(KEYCODE_Z)
1156   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 )   PORT_NAME("Ponistavange (Cancel) / Kasiranje (Take) / Autohold") PORT_CODE(KEYCODE_N)
1157   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )      PORT_NAME("Djelenje (Start) / Gamble (Play)")
1158   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 )   PORT_NAME("Stop (Hold) 5 / Ulog (Bet) / Half Gamble") PORT_CODE(KEYCODE_B)
1159   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 )   PORT_NAME("Konobar (Service1)")
1160   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE2 )   PORT_NAME("Namjestit (Service2)")
1161   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 )   PORT_NAME("Stop (Hold) 4 / Veca (High)") PORT_CODE(KEYCODE_V)
1162
1163   PORT_START_TAG("IN1")
1164   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )   PORT_NAME("Stop (Hold) 2 / Manja (Low)") PORT_CODE(KEYCODE_X)
1165   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 )   PORT_NAME("Stop (Hold) 3") PORT_CODE(KEYCODE_C)
1166   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1167   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1168   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1169   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1170   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1171   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 )   PORT_NAME("Vratiti Nazad (Payout)") PORT_CODE(KEYCODE_M)   // Payout? Need to check with hopper filled.
1172
1173   PORT_START_TAG("IN2")
1174   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1175   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1176   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1177   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1178   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1179   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1180   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1181   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1182
1183   PORT_START_TAG("DSW")
1184   PORT_DIPNAME( 0x01, 0x01, "State" )            PORT_DIPLOCATION("SW1:8")
1185   PORT_DIPSETTING(    0x01, "Play" )
1186   PORT_DIPSETTING(    0x00, "Keyboard Test" )
1187   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:7")
1188   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1189   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1190   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:6")
1191   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1192   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1193   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:5")
1194   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1195   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1196   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:4")
1197   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1198   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1199   PORT_DIPNAME( 0x20, 0x00, "Joker" )            PORT_DIPLOCATION("SW1:3")
1200   PORT_DIPSETTING(    0x00, "With Joker" )      // also enable Five of a Kind.
1201   PORT_DIPSETTING(    0x20, "Without Joker" )
1202   PORT_DIPNAME( 0x40, 0x00, "Hold" )            PORT_DIPLOCATION("SW1:2")
1203   PORT_DIPSETTING(    0x00, "Auto Hold" )
1204   PORT_DIPSETTING(    0x40, "No Auto Hold" )
1205   PORT_DIPNAME( 0x80, 0x80, "Payout" )         PORT_DIPLOCATION("SW1:1")
1206   PORT_DIPSETTING(    0x00, "Hopper" )
1207   PORT_DIPSETTING(    0x80, "Manual Payout SW" )
1208INPUT_PORTS_END
1209
11361210static INPUT_PORTS_START( bigdeal )
11371211   PORT_START_TAG("IN0")
11381212   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Remote") PORT_CODE(KEYCODE_Q)
r2018r2019
19292003   ROM_LOAD( "palce20v8h_tf.u23", 0x0400, 0x0157, NO_DUMP ) /* PAL is read protected */
19302004ROM_END
19312005
2006ROM_START( potgame )
2007   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2008   ROM_LOAD( "now.u2", 0x8000, 0x8000, CRC(7b537ce6) SHA1(b221d08c53b9e14178335632420e78070b9cfb27) )
2009
2010   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
2011   ROM_LOAD( "potg.b.u21", 0x0000, 0x8000, CRC(32fc1d4f) SHA1(cc533a44498338bc0cbb7c7b9c42559ce7ff1337) )
2012   ROM_LOAD( "potg.c.u20", 0x8000, 0x8000, CRC(0331eb42) SHA1(a8e838d644fc6d93a9632070b305e44e4242ce94) )
2013
2014   ROM_REGION( 0x0200, REGION_PROMS, 0 )
2015   ROM_LOAD( "am27s29_pot.u25",    0x0000, 0x0200, CRC(a221f151) SHA1(270c57c9b7de912b136686bc6720eb8f12dbb805) )
2016
2017   ROM_REGION( 0x0600, REGION_PLDS, 0 )
2018   ROM_LOAD( "palce16v8h_pot.u5",  0x0000, 0x0157, NO_DUMP ) /* PAL is read protected */
2019   ROM_LOAD( "palce20v8h_pot.u22", 0x0200, 0x0157, NO_DUMP ) /* PAL is read protected */
2020   ROM_LOAD( "palce20v8h_pot.u23", 0x0400, 0x0157, NO_DUMP ) /* PAL is read protected */
2021ROM_END
2022
19322023ROM_START( royalcrd )
19332024   ROM_REGION( 0x10000, REGION_CPU1, 0 )
19342025   ROM_LOAD( "r2.bin", 0x8000, 0x8000, CRC(25dfe0dc) SHA1(1a857a910d0c34b6b5bfc2b6ea2e08ed8ed0cae0) )
r2018r2019
22022293ROM_END
22032294
22042295
2205
2206
22072296/**************************
22082297*  Driver Initialization  *
22092298**************************/
r2018r2019
22172306
22182307static DRIVER_INIT( tabblue )
22192308{
2220/* +----------------------------------------------------------------------+
2309/*****************************************************************************
2310   +----------------------------------------------------------------------+
22212311   | For TAB blue colored PCB with 2 HY18CV85 (electrically-erasable PLD) |
22222312   +----------------------------------------------------------------------+
22232313
r2018r2019
22352325    to get the same result.
22362326
22372327    Since the table is very short, we will substitute each nibble.
2238*/
22392328
2329*****************************************************************************/
2330
22402331   int x, na, nb, nad, nbd;
22412332   UINT8 *src = memory_region( REGION_GFX1 );
22422333
r2018r2019
23142405   pia_config(1, &pia1_intf);
23152406}
23162407
2408static DRIVER_INIT( jolyc980 )
2409{
2410/************************************************************************************************
2411
2412   The game need the vector $07F0/$07F1 pointing to $801C to proper boot.
2413
2414   Vector $07F0/$07F1 is copied to $0006/$0007 (multipurpose)
2415   and then accessed through indirect JMP ($0006).
2416
2417   This is a temporary patch to allow boot the game since vector $07F0/$07F1 is normally empty,
2418   pointing to $0000 and therefore jumping to $C210 constantly where starts producing unexpected
2419   things, like stack overflow.
2420
2421*************************************************************************************************/
2422
2423   UINT8 *ROM = memory_region(REGION_CPU1);
2424
2425   ROM[0xc1fc] = 0x4c;
2426   ROM[0xc1fd] = 0x1c;
2427   ROM[0xc1fe] = 0x80;
2428
2429   /* Initializing PIAs... */
2430   pia_config(0, &pia0_intf);
2431   pia_config(1, &pia1_intf);
2432}
2433
23172434static DRIVER_INIT( soccernw )
23182435{
23192436/* temporary patch to avoid hardware errors for debug purposes */
r2018r2019
23432460GAME( 1985, jollycrd, 0,        funworld, funworld, funworld, ROT0, "TAB-Austria",     "Jolly Card (austrian)",                           0 )
23442461GAME( 1985, jolycdae, jollycrd, funworld, funworld, jolycdae, ROT0, "TAB-Austria",     "Jolly Card (austrian, encrypted)",                0 )
23452462GAME( 1985, jolyc3x3, jollycrd, funworld, funworld, funworld, ROT0, "TAB-Austria",     "Jolly Card (3x3 deal)",                           0 )
2346GAME( 2000, jolyc980, jollycrd, cuoreuno, funworld, funworld, ROT0, "Spale-Soft",      "Jolly Card Professional 2.0",                     0 )
2463GAME( 2000, jolyc980, jollycrd, cuoreuno, jolyc980, jolyc980, ROT0, "Spale-Soft",      "Jolly Card Professional 2.0",                     0 )
23472464GAME( 1998, jolycdev, jollycrd, funworld, funworld, funworld, ROT0, "TAB/Evona",       "Jolly Card (Evona Electronic)",                   0 )
23482465GAME( 1985, jolyccra, jollycrd, cuoreuno, jolycdcr, funworld, ROT0, "TAB-Austria",     "Jolly Card (croatian, set 1)",                    0 )
23492466GAME( 1993, jolyccrb, jollycrd, cuoreuno, jolycdcr, funworld, ROT0, "Soft Design",     "Jolly Card (croatian, set 2)",                    0 )
r2018r2019
23592476GAME( 1996, pool10,   0,        cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Pool 10 (italian, set 1)",                        0 )
23602477GAME( 1996, pool10b,  pool10,   cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Pool 10 (italian, set 2)",                        0 )
23612478GAME( 1997, tortufam, 0,        cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Tortuga Family (italian)",                        0 )
2479GAME( 1996, potgame,  0,        cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Pot Game (italian)",                              0 )
23622480GAME( 1991, royalcrd, 0,        royalcrd, royalcrd, funworld, ROT0, "TAB-Austria",     "Royal Card (austrian, set 1)",                    0 )
23632481GAME( 1991, royalcdb, royalcrd, royalcrd, royalcrd, funworld, ROT0, "TAB-Austria",     "Royal Card (austrian, set 2)",                    0 )
23642482GAME( 1991, royalcdc, royalcrd, royalcrd, royalcrd, funworld, ROT0, "Evona Electronic","Royal Card (slovak, encrypted)",                  GAME_WRONG_COLORS | GAME_NOT_WORKING )
src/mame/drivers/atarifb.c
r2018r2019
583583
584584   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
585585   MDRV_SOUND_CONFIG_DISCRETE(atarifb)
586   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
586   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.18)
587587MACHINE_DRIVER_END
588588
589589
r2018r2019
609609   /* sound hardware */
610610   MDRV_SOUND_REPLACE("discrete", DISCRETE, 0)
611611   MDRV_SOUND_CONFIG_DISCRETE(abaseb)
612   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
612   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.24)
613613MACHINE_DRIVER_END
614614
615615
src/mame/drivers/msisaac.c
r2018r2019
314314   //popmessage("SND0 0=%2x 1=%2x", snd_ctrl0, snd_ctrl1);
315315
316316   sndti_set_output_gain(SOUND_MSM5232, 0, 0, vol_ctrl[  snd_ctrl0     & 15 ] / 100.0);   /* group1 from msm5232 */
317   sndti_set_output_gain(SOUND_MSM5232, 0, 1, vol_ctrl[ (snd_ctrl0>>4) & 15 ] / 100.0);   /* group2 from msm5232 */
318
317   sndti_set_output_gain(SOUND_MSM5232, 0, 1, vol_ctrl[  snd_ctrl0     & 15 ] / 100.0);   /* group1 from msm5232 */
318   sndti_set_output_gain(SOUND_MSM5232, 0, 2, vol_ctrl[  snd_ctrl0     & 15 ] / 100.0);   /* group1 from msm5232 */
319   sndti_set_output_gain(SOUND_MSM5232, 0, 3, vol_ctrl[  snd_ctrl0     & 15 ] / 100.0);   /* group1 from msm5232 */
320   sndti_set_output_gain(SOUND_MSM5232, 0, 4, vol_ctrl[ (snd_ctrl0>>4) & 15 ] / 100.0);   /* group2 from msm5232 */
321   sndti_set_output_gain(SOUND_MSM5232, 0, 5, vol_ctrl[ (snd_ctrl0>>4) & 15 ] / 100.0);   /* group2 from msm5232 */
322   sndti_set_output_gain(SOUND_MSM5232, 0, 6, vol_ctrl[ (snd_ctrl0>>4) & 15 ] / 100.0);   /* group2 from msm5232 */
323   sndti_set_output_gain(SOUND_MSM5232, 0, 7, vol_ctrl[ (snd_ctrl0>>4) & 15 ] / 100.0);   /* group2 from msm5232 */
319324}
320325static WRITE8_HANDLER( sound_control_1_w )
321326{
r2018r2019
569574
570575   MDRV_SOUND_ADD(MSM5232, 2000000)
571576   MDRV_SOUND_CONFIG(msm5232_interface)
572   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
577   MDRV_SOUND_ROUTE(0, "mono", 1.0)   // pin 28  2'-1
578   MDRV_SOUND_ROUTE(1, "mono", 1.0)   // pin 29  4'-1
579   MDRV_SOUND_ROUTE(2, "mono", 1.0)   // pin 30  8'-1
580   MDRV_SOUND_ROUTE(3, "mono", 1.0)   // pin 31 16'-1
581   MDRV_SOUND_ROUTE(4, "mono", 1.0)   // pin 36  2'-2
582   MDRV_SOUND_ROUTE(5, "mono", 1.0)   // pin 35  4'-2
583   MDRV_SOUND_ROUTE(6, "mono", 1.0)   // pin 34  8'-2
584   MDRV_SOUND_ROUTE(7, "mono", 1.0)   // pin 33 16'-2
585   // pin 1 SOLO  8'       not mapped
586   // pin 2 SOLO 16'       not mapped
587   // pin 22 Noise Output  not mapped
573588MACHINE_DRIVER_END
574589
575590
src/mame/drivers/wilytowr.c
r2018r2019
1919  are drawn 2 pixels off in x/y directions. If you fix that, then the player
2020  sprite doesn't slide in the middle of the pipes when climbing...
2121
22Dip locations verified for:
23- atomboy (manual)
24
2225***************************************************************************/
2326
2427#include "driver.h"
r2018r2019
350353   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
351354
352355   PORT_START_TAG("DSW0")
353   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
356   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:!1,!2")
354357   PORT_DIPSETTING(    0x00, "2" )
355358   PORT_DIPSETTING(    0x01, "3" )
356359   PORT_DIPSETTING(    0x02, "4" )
357360   PORT_DIPSETTING(    0x03, "5" )
358   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
359   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
360   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
361   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
362   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
363   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
364   /* TODO: support the different settings which happen in Coin Mode 2 */
365   PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coinage ) ) /* mapped on coin mode 1 */
361   PORT_DIPNAME( 0x0c, 0x00, "Bonus Points Rate" )      PORT_DIPLOCATION("SW1:!3,!4")
362   PORT_DIPSETTING(    0x00, DEF_STR( Normal ) )
363   PORT_DIPSETTING(    0x04, "x1.2" )
364   PORT_DIPSETTING(    0x08, "x1.4" )
365   PORT_DIPSETTING(    0x0c, "x1.6" )
366   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:!5,!6") PORT_CONDITION("DSW1",0x04,PORTCOND_EQUALS,0x04) /* coin mode 2 */
367   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
368   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
369   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
370   PORT_DIPSETTING(    0x30, DEF_STR( Free_Play ) )   /* Not documented */
371   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW1:!7,!8") PORT_CONDITION("DSW1",0x04,PORTCOND_EQUALS,0x04) /* coin mode 2 */
372   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
373   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
374   PORT_DIPSETTING(    0x80, DEF_STR( 1C_5C ) )
375   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
376   PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SW1:!5,!6,!7,!8") PORT_CONDITION("DSW1",0x04,PORTCOND_EQUALS,0x00) /* coin mode 1 */
366377   PORT_DIPSETTING(    0x60, DEF_STR( 7C_1C ) )
367378   PORT_DIPSETTING(    0x50, DEF_STR( 6C_1C ) )
368379   PORT_DIPSETTING(    0x40, DEF_STR( 5C_1C ) )
r2018r2019
381392   PORT_DIPSETTING(    0xf0, DEF_STR( Free_Play ) )
382393
383394   PORT_START_TAG("DSW1")
384   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Flip_Screen ) )
395   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SW2:!1")
385396   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
386397   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
387   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
398   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SW2:!2")
388399   PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
389400   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
390   PORT_DIPNAME( 0x04, 0x00, "Coin Mode" )
401   /*  "For cabinets with a single coin selector or 2 coin selectors of the same value, set to Mode 1.
402        For cabinets with coin selectors of two different values, set to Mode 2." */
403   PORT_DIPNAME( 0x04, 0x00, "Coin Mode" )            PORT_DIPLOCATION("SW2:!3")
391404   PORT_DIPSETTING(    0x00, "Mode 1" )
392405   PORT_DIPSETTING(    0x04, "Mode 2" )
393   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
394   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
395   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
406   PORT_DIPUNUSED_DIPLOC( 0x08, 0x00, "SW2:!4" )      /* Listed as "Unused" */
396407   /* In stop mode, press 1 to stop and 2 to restart */
397   PORT_DIPNAME( 0x10, 0x00, "Stop Mode (Cheat)")
408   PORT_DIPNAME( 0x10, 0x00, "Stop Mode (Cheat)")      PORT_DIPLOCATION("SW2:!5")
398409   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
399410   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
400   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
411   PORT_DIPUNUSED_DIPLOC( 0x08, 0x00, "SW2:!6" )      /* Listed as "Unused" */
412   PORT_DIPNAME( 0x40, 0x00, "Invulnerability (Cheat)") PORT_DIPLOCATION("SW2:!7")
401413   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
402   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
403   PORT_DIPNAME( 0x40, 0x00, "Invulnerability (Cheat)")
404   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
405414   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
406   PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
415   PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_HIGH, "SW2:!8" )
407416INPUT_PORTS_END
408417
409418static INPUT_PORTS_START( fghtbskt )
src/mame/drivers/1945kiii.c
r2018r2019
204204   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SW2:2")
205205   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
206206   PORT_DIPSETTING(      0x0200, DEF_STR( Yes ) )
207   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )         PORT_DIPLOCATION("SW2:3")
208   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
209   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
210   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )         PORT_DIPLOCATION("SW2:4")
211   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
212   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
213   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )         PORT_DIPLOCATION("SW2:5")
214   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
215   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
216   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )         PORT_DIPLOCATION("SW2:6")
217   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
218   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
219   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )         PORT_DIPLOCATION("SW2:7")
220   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
221   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
222   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )         PORT_DIPLOCATION("SW2:8")
223   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
224   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
207   PORT_DIPUNKNOWN_DIPLOC( 0x0400, 0x0400, "SW2:3" )
208   PORT_DIPUNKNOWN_DIPLOC( 0x0800, 0x0800, "SW2:4" )
209   PORT_DIPUNKNOWN_DIPLOC( 0x1000, 0x1000, "SW2:5" )
210   PORT_DIPUNKNOWN_DIPLOC( 0x2000, 0x2000, "SW2:6" )
211   PORT_DIPUNKNOWN_DIPLOC( 0x4000, 0x4000, "SW2:7" )
212   PORT_DIPUNKNOWN_DIPLOC( 0x8000, 0x8000, "SW2:8" )
225213INPUT_PORTS_END
226214
227215
src/mame/drivers/offtwall.c
r2018r2019
5656static MACHINE_RESET( offtwall )
5757{
5858   atarigen_eeprom_reset();
59   atarigen_interrupt_reset(update_interrupts);
5960   atarivc_reset(machine->primary_screen, atarivc_eof_data, 1);
60   atarigen_interrupt_reset(update_interrupts);
6161   atarijsa_reset();
6262}
6363
src/mame/drivers/equites.c
r2018r2019
11/*******************************************************************************
22
3Equites           (c) 1984 Alpha Denshi Co./Sega
4Bull Fighter      (c) 1984 Alpha Denshi Co./Sega
5The Koukouyakyuh  (c) 1985 Alpha Denshi Co.
6Splendor Blast    (c) 1985 Alpha Denshi Co.
7High Voltage      (c) 1985 Alpha Denshi Co.
3Equites           (c) 1984 Alpha Denshi Co./Sega   8303
4Bull Fighter      (c) 1984 Alpha Denshi Co./Sega   8303
5Gekisou           (c) 1985 Eastern Corp.           8304
6The Koukouyakyuh  (c) 1985 Alpha Denshi Co.        8304
7Splendor Blast    (c) 1985 Alpha Denshi Co.        8303
8High Voltage      (c) 1985 Alpha Denshi Co.        8304 (POST says 8404)
89
9drivers by Acho A. Tang
10Driver by Acho A. Tang, Nicola Salmoria
11Many thanks to Corrado Tomaselli for precious hardware info.
1012
1113Stephh's notes (based on the games M68000 code and some tests) :
1214
r2018r2019
5355
54565) 'hvoltage'
5557
56  - When starting a 2 players game, when player 1 game is over, the game becomes
57    buggy on displaying the "GAME OVER" message and you can't start a new game
58    anymore.
59  - You can test player 2 by putting 0xff instead of 0x00 at 0x040009 ($9,A6).
60  - FYI, what should change the contents of $9,A6 is the routine at 0x000fc4,
61    but I haven't found where this routine could be called 8( 8404 issue ?
62
6358  - There is sort of "debug mode" that you can access if 0x000038.w returns 0x0000
64    instead of 0xffff. To enable it, turn HVOLTAGE_HACK to 1 then enable the fake
59    instead of 0xffff. To enable it, turn HVOLTAGE_DEBUG to 1 then enable the fake
6560    Dip Switch.
6661  - When you are in "debug mode", the Inputs and Dip Switches have special features.
6762    Here is IMO the full list :
r2018r2019
7772        a "band" is displayed at the left of the screen
7873
7974
80TO DO :
75Notes:
76-----
77- The sound board in all games is identical, labelled SOUND BOARD NO.59 MC 07.
78  There are three pots, labelled MUSIC, VOICE and FRQ. MUSIC and VOICE control
79  the volume, while FRQ changes (a unique feature of this hardware) the input
80  clock to the MSM5232. This affects the music pitch ONLY--tempo is unaffected.
81  Clock speed apparently ranges from 6.144MHz (OSC value) to about 150kHz.
8182
82  - support screen flipping in 'equites' and 'splndrbt'.
83- equites hardware: even if there are 0x200 bytes of sprite RAM, which would give
84  a total of 128 possible sprites, since all games only write to a limited part of
85  that RAM it looks like the hardware can only display 55 sprites. This is confirmed
86  by the POST test which only shows those 55 sprites. The strange thing is that the
87  sprites are not consecutive in RAM. The "good" parts are
88  100000-10005f
89  1000e0-1000ff
90  1001a4-1001ff
91  Possibly the remaining RAM is used by the sprite hardware as buffer? This doesn't
92  really explain the weird layout in memory, however.
93  Also, the priority order is counterintuitive. It seems that the above blocks are
94  in increasing priority order, however in each block the higher priority sprites
95  are at the lower addresses. This gives good priorities in gekisou (the car and
96  helicopter shadows would be wrong otherwise).
8397
98- similarly, splndrbt hardware only appears to be capable of displaying 24 sprites.
99  This time, they are consecutive in RAM.
84100
85Hardware Deficiencies
86---------------------
87101
88- Lack of 8303/8404 tech info. All MCU results are guessed.
102TODO:
103----
89104
90  equites_8404rule(unsigned pc, int offset, int data) details:
105- on startup, the CPU continuously writes 5555 to 100000 in a tight loop and expects
106  it to change to exit the loop. The value should obviously be modified by the
107  sprite hardware but it's difficult to guess what should happen. A kludge read
108  handler is used as a work around.
91109
92        pc: 68000 code address where the program queries the MCU
93    offset: 8404 memory offset(in bytes) from where MCU data is read
94      data: fake byte-value to return (negative numbers trigger special conditions)
110- the second interrupt source for main CPU is unknown.
95111
96The following ROMs need redump:
112- gekisou inputs. Looks like there should be an EEPROM. Note ROM patches in
113  DRIVER_INIT to make it boot past what I think is the EEPROM read.
114  Settings are changed by pressing the service button and then using joystick
115  to change options.
97116
98- The Koukouyakyuh's epr-6706.bin (the one in use is patched)
117  Settings:                1   2   3   4   5   6   7   8
118  COIN 1  1 Coin / 1 Play  ON  ON
119          1 Coin / 2 Play  ON  OFF
120          1 Coin / 3 Play  OFF OFF
121          2 Coin / 1 Play  OFF ON
122  COIN 2  1 Coin / 1 Play          ON  ON
123          1 Coin / 2 Play          ON  OFF
124          1 Coin / 3 Play          OFF OFF
125          2 Coin / 1 Play          OFF ON
126  DIFFICULTY  Easy                         ON
127              Hard                         OFF
128  CABINET     Cocktail                         ON
129              Upright                          OFF
99130
131- gekisou: there's a white line crossing the explosion sprite. This doesn't look
132  like a bad ROM since the line is crossing several, not concecutive, explosion
133  sprites, and no other sprites.
100134
101Emulation Deficiencies
102----------------------
135- gekisou: wrong sprite when hitting helicopter with missile?
103136
104- Equites has sprite lag in the post-rotate X direction depends on interrupt timing.
105- Scale factors in High Voltage and Splendor Blast are inaccurate. Actual values are believed
106  to be in the three unknown ROM s3.8l, 1.9j and 4.7m but the equations are unknown.
137- splndrbt, hvoltage: the interpretation of the scaling PROMs might be wrong.
138  The sprite x scaling is not used at all because I couldn't figure it out.
139  Note that sprites are 30x30 instead of 32x32.
107140
108- MSM5232 capacitor values are not known.
109- There is a potentiometer on the soundboard to adjust the MSM5232's music pitch.  Clock speed ranges
110  from 6.144mhz (OSC value) to few khz
111- All games have the same sound board with only rom swaps
141- Need to use different default volumes for various games, especially gekisou
142  where the car noise is really unpleasant with the default settings.
112143
144- analog drums/cymbals missing.
145
146- bassline imperfect. This is just the square wave output of the 5232 at the moment.
147  It should go through analog stages.
148
149- properly emulate the 8155 on the sound board.
150
151- implement low-pass filters on the DAC output
152
113153* Special Thanks to:
114154
115155  Jarek Burczynski for a superb MSM5232 emulation
r2018r2019
124164Alpha Denshi 1984 (SPT) Champion Croquet ?`?????s?I???N???b?P?[
125165Alpha Denshi 1985 (???) Tune Pit(?)      ?`?F?[???s?b?g
126166Alpha Denshi 1985 (MAJ) Perfect Janputer ?p?[?t?F?N?g?W?????s???[?^?[
127SNK/Eastern  1985 (ACT) Gekisoh          ????
128167
168
169*******************************************************************************
170
171Bull Fighter
172PCB layout
1732005-03-21
174f205v
175
176|----------------------|
177| Fully boxed = socket |
178|----------------------|
179
180
181| separation = solder
182
183
184-----------------------------------------------------------------------|
185|ALPHA DENSHI CO, LTD. SOUND BOARD NO.59MC07                           |
186|                                                                      |
187|          |--------------------|                                      |
188|   P | \/ |    JAPAN 84250C    | SN74LS232J | SN74LS74AN | DISSIPATOR |
189|     | /\ |      M5l8085AP     | 8131BJ     | 8314A      |            |
190|          |--------------------|                                      |
191|                                                                      |
192|   N                           | SN74LS74A                            |
193|                               | 8122AG                               |
194|                                                                      |
195|     |------------|                                                   |
196|   M | HV1VR OKI  | SN74LS138J | SN74LS74AJ | LM324N     | LM324N     |
197|     | 2764-45    | 8044AG     | F8048      | J423A2     | 98509      |- (+12V)
198|     |------------|                                                   |
199|                                                                      |- (+5V)
200|     |------------|                                                   |
201|   L | HV2VR OKI  | T74LS14B1  | SN74LS08N                            |- (OUT)
202|     | 2764-45    | 88442      | K8208                                |
203|     |------------|                                                   |- (
204|                                                                      |  (GND)
205|     |------------|                                                   |- (
206|   K | HV3VR OKI  | SN74LS08J  | SN74LS04N  | LM324N                  |
207|     | 2764-45    | K8208      | I8313      | 98509                   |
208|     |------------|                                                   |
209|                                                                      |
210|   J              | SN74LS74A  | SN74LS232J |            | LM324N     |
211|                  | 8122AG     | 8131BG     |            | 436A       |
212|                                                                      |
213|     |------------|            |------------|                         |
214|   H | HV4VR OKI  | SN74LS393N | TBP18S030N |            | LM324N     |
215|     | 2764-45    | K8208      | J419X      |            | 436A       |
216|     |------------|            |------------|                         |
217|                                                                      |
218|   F              | SN74LS138J | HCF40174BE |            | CD4066BCN  |
219|                  | 8044AG     | MSM40174   |            | MM5666BN   |
220|                                                                      |
221|   E              | M74LS123P  | SN74LS138J | CD4066BCN  | CD4066BCN  |
222|                  | 84A6C1     | 8044AG     | MM5666BN   | MM5666BN   |
223|                                                           MUSIC      |
224|                  |-------------------------|                         |
225|   D | SN74LS373N |       JAPAN 841903      |            | CD4066BCN  |
226|     | 2764-45    |         M5L8155P        |            | MM5666BN   |
227|                  |-------------------------|              VOICE      |
228|                                                                      |
229|C                 |-------------------------|                         |
230|O  C | 74LS173 PC |        MSM5232RS        |                         |
231|N    | 8247       |        OKI 4342         |                         |
232|N                 |-------------------------|                         |
233|                                                                      |
234|T  B                                                                  |
235|O                                                                     |
236|                  |-------------------------|                         |
237|M  A | 74LS173 PC |     SOUND AY-3-8910     | CD4066BCN  | CD4066BCN  |
238|A    | 8247       |        8046 CDA         | MM5666BN   | MM5666BN   |
239|I                 |-------------------------|                         |
240|N                                                                     |
241|     | 1          | 2           | 3         | 4          | 5          |
242-----------------------------------------------------------------------|
243
244
245
246
247-----------------------------------------------------------------------------------|
248|ALPHA DENSHI CO, LTD. MAIN CONNECTOR BOARD                                        |
249|                                                                                  |
250|                                                                                  |
251|      | K     | J     | H     | F     | E     | D     | C     | B     | A         |
252|                                                                              |   |
253J    1 | LS08  | LS74  | LS109 | LS27  | LS32  |       | LS153 | LS153 | 24S10 |L  |
2542                                                                              |S  |
255     2 | LS74  | LS04  | LS21  | LS00  | LS174 | LS153 | LS153 | LS273 | 24S10 |2  |
256T                                                                              |7  |
257O                                      |-------|                               |3  |
258     3 | LS32  | LS161 | LS161 | LS157 |H      | LS194 | LS194 | LS04  | 24S10 |   |
259L                                      |TMS2732|                                   |
260O                                      |-------|                                   |
261W                                                              |---------------|   |
262E    4 | LS00  | LS86  | LS86  | LS08          | LS157 | LS157 | ALPHA-8303    |   |
263R                                                              | 44801B42-3M 3 |   |
264                                                               |---------------|   |
265B                                      |-------|                                   |
266O    5 | LS393 | LS86  | LS86  | OSCLT |M58725P| LS157 | LS157                     |
267A                                      |-------|                                   |
268R                                                                      |-------|   |
269D    6 | LS04  | LS161 | LS161         | LS273 | LS157 | LS157 | LS08  |M58725P|   |-C
270|                                                                      |-------|   |-O
271|                                              |-----------|-----------|           |-N
272|    7 | LS74  | LS367 | LS74  | LS368 | LS373 |  M58725P  |  M58725P  | LS245     |-N
273|                                              |-----------|-----------|           |-E
274|                                                                                  |-C
275|    8 | LS32  | LS74  | LS32  | LS138 | LS245                         | LS245     |-T
276J                                              |-----------|-----------|           |-O
2771    9 | LS08  | LS00  | LS74  | LS138         |   empty   |   empty   | LS368     |-R
278                                               |-----------|-----------|           |-
279T                                              |-----------|-----------|           |-N
280O   10 | LS08  | LS32  | LS74  | LS138 | LS139 |HP3VR      |HP7VR      | LS368     |-O
281                                               |M5L2764K   |HN482764G  |           |-N
282L        |-                                    |-----------|-----------|           |-J
283O   11   |C \  | LS02  | LS00  | LS138 | LS259                         | LS368     |-A
284W        |O  \                                 |-----------|-----------|           |-M
285E        |N S |                                |HP2VR      |HP6VR      | LS368     |-M
286R   12   |N O |                                |HN482764G  |M5L2764K   |           |-A
287         |  U |                                |-----------|-----------|           |
288B        |F N |        |-----------------------|-----------|-----------|           |
289O   13   |R D || LS74  |       HD68000-8       |HP1VR      |HP5VR      |           |
290A        |O  /         |         4D3-R         |M5L2764K   |M5L2764K   |           |
291R        |M /          |-----------------------|-----------|-----------|           |
292D        |-                                                                        |
293|   14         | LS05  | LS193 | LS214 | LS08                  | LS139 | DIP 6x    |
294|                                                                                  |
295|----------------------------------------------------------------------------------|
296
297
298
299
300-------------------------------------------------------------------------------------|
301|ALPHA DENSHI CO, LTD. LOWER BOARD                                                   |
302|                                                                                    |
303|                                                                                    |
304J      | K     | J     | H        | F        | E     | D     | C     | B     | A     |
3052                                                                                    |
306     1 | LS245 | LS139 |----------|----------| LS174 | LS153 | 4416  | LS04  | LS194 |
307T                      | HM6116-3 | HS4VR    |                                       |
308O                      | M58725P  | M5L2764K |                                       |
309     2         | LS245 |          |          | LS174 | LS153 | 4416  | LS373 | LS194 |
310M                      |----------|----------|                                       |
311A                      | HM6116-3 | HS3VR    |                                       |
312I    3 | LS08  | LS04  | M58725P  | M5L2764K | LS283 | LS153 | 4416  | LS157 | LS194 |
313N                      |          |          |                                       |
314                       |----------|----------|                                       |
315B    4 | LS86  | LS86  | HS6VR    | HS2VR    | LS283 | LS153 | 4416  | LS373 | LS194 |
316O                      | M5L2764K | HN482764G|                                       |
317A                      |          |          |-------|-------|                       |
318R    5 | LS157 | LS157 |----------|----------| LS193 | LS193 | LS08  | LS32  | LS32  |
319D                      | HS5VR    | HS1VR    |-------|-------|                       |
320|                      | M5L2764K | M5L2764K |                       |-------|       |
321|    6 | LS08  | LS86  |          |          | LS157 | LS157 | LS153 | 24S10 | LS257 |
322|                      |----------|----------|                       |-------|       |
323|                      | HP5VR    | HB1VR    |                       |-------|       |
324|    7 | LS157 | LS157 | M5L2764K | M5L2764K | LS157 | LS273 | LS153 | 24S10 | LS257 |
325|                      |          |          |                       |-------|       |
326|                      |----------|----------|                                       |
327|    8 | LS669 | LS669 | HP6VR    | HB2VR    | LS157 | LS273 | LS153 | LS153 | LS32  |
328J                      | M5L2764K | M5L2764K |                                       |
3291                      |          |          |                       |-------|       |
330     9 | LS669 | LS669 |----------|----------| LS157 | LS273 | LS153 | 24S10 | LS257 |
331T                      | HM6116-3 | HB3VR    |                       |-------|       |
332O                      | M58725P  | M5L2764K |                       |-------|       |
333    10 | LS273 | LS273 |          |          | LS194 | LS04  | LS153 | 24S10 | LS257 |
334M                      |----------|----------|                       |-------|       |
335A                      | HM6116-3 | HB4VR    |                                       |
336I   11 | LS245 | LS245 | M58725P  | M5L2764K | LS157 | LS194 | LS86  | LS08  | LS02  |
337N                      |          |          |                                       |
338                       |----------|----------|                                       |
339B   12 | LS373 | LS373                       | LS194 | LS157 | LS08  | LS74  | LS175 |
340O                                                                                    |
341A                                                                                    |
342R   13 | LS373 | LS273 | LS174    | LS139    | LS08  | LS32  | LS74  | LS10  | LS00  |
343D                                                                                    |
344|------------------------------------------------------------------------------------|
345
346
129347*******************************************************************************/
130348// Directives
131349
132350#include "driver.h"
133351#include "deprecat.h"
352#include "cpu/i8085/i8085.h"
353#include "sound/ay8910.h"
354#include "sound/msm5232.h"
355#include "sound/dac.h"
356#include "sound/samples.h"
357#include "equites.h"
134358
135#define HVOLTAGE_HACK   0
359#define HVOLTAGE_DEBUG   0
136360#define EASY_TEST_MODE   1
137361
138// Equites Hardware
139#define BMPAD 8
362#define FRQ_ADJUSTER_TAG   "FRQ"
140363
364// MSM5232 clock is generated by a transistor oscillator circuit, not by the pcb xtal
365// The circuit is controlled by a pot to allow adjusting the frequency
366#define MSM5232_MAX_CLOCK 6144000
367#define MSM5232_MIN_CLOCK  214000   // unstable
368
369
141370/******************************************************************************/
142// Imports
143371
144// Common Hardware Start
145extern void equites_8404init(void);
146extern void equites_8404rule(unsigned pc, int offset, int data);
372static UINT16 *equites_workram;
373static UINT8 *mcu_ram;
147374
148extern READ16_HANDLER(equites_8404_r);
149extern WRITE8_HANDLER(equites_5232_w);
150extern WRITE8_HANDLER(equites_8910control_w);
151extern WRITE8_HANDLER(equites_8910data_w);
152extern WRITE8_HANDLER(equites_dac0_w);
153extern WRITE8_HANDLER(equites_dac1_w);
375static int equites_sound_prom_address;
376static UINT8 equites_dac_latch;
377static UINT8 equites_8155_portb;
154378
155extern UINT16 *equites_8404ram;
156extern struct MSM5232interface equites_5232intf;
157extern struct AY8910interface equites_8910intf;
379static UINT8 eq8155_port_a,eq8155_port_c,ay_port_a,ay_port_b,eq_unk1;
158380
159static ADDRESS_MAP_START( equites_s_map, ADDRESS_SPACE_PROGRAM, 8 )
160   AM_RANGE(0x0000, 0xbfff) AM_ROM
161   AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_r)
162   AM_RANGE(0xc080, 0xc08d) AM_WRITE(equites_5232_w)
163   AM_RANGE(0xc0a0, 0xc0a0) AM_WRITE(equites_8910data_w)
164   AM_RANGE(0xc0a1, 0xc0a1) AM_WRITE(equites_8910control_w)
165   AM_RANGE(0xc0b0, 0xc0b0) AM_WRITE(SMH_NOP) // INTR: sync with main melody
166   AM_RANGE(0xc0c0, 0xc0c0) AM_WRITE(SMH_NOP) // INTR: sync with specific beats
167   AM_RANGE(0xc0d0, 0xc0d0) AM_WRITE(equites_dac0_w)
168   AM_RANGE(0xc0e0, 0xc0e0) AM_WRITE(equites_dac1_w)
169   AM_RANGE(0xc0f8, 0xc0fe) AM_WRITE(SMH_NOP) // soundboard I/O, ignored
170   AM_RANGE(0xc0ff, 0xc0ff) AM_WRITE(soundlatch_clear_w)
171   AM_RANGE(0xe000, 0xe0ff) AM_RAM
172ADDRESS_MAP_END
381static MACHINE_RESET(equites)
382{
383   flip_screen_set(0);
384}
173385
174static ADDRESS_MAP_START( equites_s_portmap, ADDRESS_SPACE_IO, 8 )
175   AM_RANGE(0x00e0, 0x00e5) AM_WRITE(SMH_NOP) // soundboard I/O, ignored
176ADDRESS_MAP_END
386/******************************************************************************/
387// Sound
177388
178static MACHINE_DRIVER_START( equites_sound )
389/******************************************************************************/
179390
180   /* basic machine hardware */
181   MDRV_CPU_ADD(8085A, XTAL_6_144MHz) /* verified on pcb */
182   MDRV_CPU_PROGRAM_MAP(equites_s_map,0)
183   MDRV_CPU_IO_MAP(equites_s_portmap,0)
184   MDRV_CPU_PERIODIC_INT(nmi_line_pulse,4000)
391static emu_timer *nmi_timer, *adjuster_timer;
185392
186   /* sound hardware */
187   MDRV_SPEAKER_STANDARD_MONO("mono")
393static TIMER_CALLBACK( equites_nmi_callback )
394{
395   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE);
396}
188397
189   MDRV_SOUND_ADD(MSM5232, XTAL_6_144MHz/2)
190      /* OSC is connected to a pot which varies the frequency of M5232
191           from 6.144mhz to few Khz. Here I assume a value which gives a good pitch */
192   MDRV_SOUND_CONFIG(equites_5232intf)
193   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
398static TIMER_CALLBACK( equites_frq_adjuster_callback )
399{
400   UINT8 frq = readinputportbytag(FRQ_ADJUSTER_TAG);
194401
195   MDRV_SOUND_ADD(AY8910, XTAL_6_144MHz/4) /* verified on pcb */
196   MDRV_SOUND_CONFIG(equites_8910intf)
197   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
402   msm5232_set_clock(sndti_token(SOUND_MSM5232, 0), MSM5232_MIN_CLOCK + frq * (MSM5232_MAX_CLOCK - MSM5232_MIN_CLOCK) / 100);
403//popmessage("8155: C %02x A %02x  AY: A %02x B %02x Unk:%x", eq8155_port_c,eq8155_port_a,ay_port_a,ay_port_b,eq_unk1&15);
404}
198405
199   MDRV_SOUND_ADD(DAC, 0)
200   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
406static SOUND_START(equites)
407{
408   nmi_timer = timer_alloc(equites_nmi_callback, NULL);
201409
202   MDRV_SOUND_ADD(DAC, 0)
203   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
204MACHINE_DRIVER_END
410   adjuster_timer = timer_alloc(equites_frq_adjuster_callback, NULL);
411   timer_adjust_periodic(adjuster_timer, ATTOTIME_IN_HZ(60), 0, ATTOTIME_IN_HZ(60));
412}
205413
206// Common Hardware End
414static WRITE8_HANDLER(equites_c0f8_w)
415{
416   switch (offset)
417   {
418      case 0:   // c0f8: NMI ack (written by NMI handler)
419         cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
420         break;
207421
208// Equites Hardware
209extern PALETTE_INIT( equites );
210extern VIDEO_START( equites );
211extern VIDEO_UPDATE( equites );
212extern READ16_HANDLER(equites_spriteram_r);
213extern WRITE16_HANDLER(equites_charram_w);
214extern WRITE16_HANDLER(equites_scrollreg_w);
215extern WRITE16_HANDLER(equites_bgcolor_w);
422      case 1: // c0f9: RST75 trigger (written by NMI handler)
423         // Note: solder pad CP3 on the pcb would allow to disable this
424         cpunum_set_input_line(machine, 1, I8085_RST75_LINE, PULSE_LINE);
425         break;
216426
217// Splendor Blast Hareware
218extern MACHINE_RESET( splndrbt );
219extern PALETTE_INIT( splndrbt );
220extern VIDEO_START( splndrbt );
221extern VIDEO_UPDATE( splndrbt );
222extern READ16_HANDLER(splndrbt_bankedchar_r);
223extern WRITE16_HANDLER(splndrbt_charram_w);
224extern WRITE16_HANDLER(splndrbt_bankedchar_w);
225extern WRITE16_HANDLER(splndrbt_selchar0_w);
226extern WRITE16_HANDLER(splndrbt_selchar1_w);
227extern WRITE16_HANDLER(splndrbt_scrollram_w);
228extern WRITE16_HANDLER(splndrbt_bgcolor_w);
229extern UINT16 *splndrbt_scrollx, *splndrbt_scrolly;
427      case 2: // c0fa: INTR trigger (written by NMI handler)
428         // verified on PCB:
429         cpunum_set_input_line(machine, 1, I8085_INTR_LINE, HOLD_LINE);
430         break;
230431
231/******************************************************************************/
232// Locals
432      case 3: // c0fb: n.c.
433         // Note: this is written at end of the INTR handler, however LS138@E3 pin 12 is definitely unconnected
434         break;
233435
234// Equites Hardware
235static int disablejoyport2 = 0;
436      case 4: // c0fc: increment PROM address (written by NMI handler)
437         equites_sound_prom_address = (equites_sound_prom_address + 1) & 0x1f;
438//          FIXME: at this point, the 5-bit value
439//          memory_region(REGION_SOUND1)[equites_sound_prom_address] & 0x1f
440//          should be used for something...
441         break;
236442
237/******************************************************************************/
238// Exports
443      case 5: // c0fd: n.c.
444         // Note: this is written at end of the RST75 handler, however LS138@E3 pin 10 is definitely unconnected
445         break;
239446
240// Common
241UINT16 *equites_workram;
242int equites_id;
447      case 6:   // c0fe: 4-bit answer for main CPU (unused)
448         // Note: this would go to the LS173@B1, which is however unpopulated on the pcb
449         break;
243450
244// Equites Hardware
245int equites_flip;
451      case 7:   // c0ff: sound command latch clear
452         // Note: solder pad CP1 on the pcb would allow to disable this
453         soundlatch_clear_w(machine,0,0);
454         break;
455   }
456}
246457
247// Splendor Blast Hardware
248static int splndrbt_flip;
249458
459#define POPDRUMKIT 0
460#if POPDRUMKIT
461static int hihat,cymbal;
462#endif
463
464static WRITE8_HANDLER(equites_8910porta_w)
465{
466   // bongo 1
467   sample_set_volume(0, ((data & 0x30)>>4) * 0.33);
468   if (data & ~ay_port_a & 0x80)
469      sample_start(0, 0, 0);
470
471   // bongo 2
472   sample_set_volume(1, (data & 0x03) * 0.33);
473   if (data & ~ay_port_a & 0x08)
474      sample_start(1, 1, 0);
475
476   ay_port_a = data;
477
478#if POPDRUMKIT
479popmessage("HH %d(%d) CYM %d(%d)",hihat,BIT(ay_port_b,6),cymbal,ay_port_b&3);
480#endif
481}
482
483static WRITE8_HANDLER(equites_8910portb_w)
484{
485#if POPDRUMKIT
486if (data & ~ay_port_b & 0x08) cymbal++;
487if (data & ~ay_port_b & 0x04) hihat++;
488#endif
489
490   // bongo 3
491   sample_set_volume(2, ((data & 0x30)>>4) * 0.33);
492   if (data & ~ay_port_b & 0x80)
493      sample_start(2, 2, 0);
494
495   ay_port_b = data;
496
497#if POPDRUMKIT
498popmessage("HH %d(%d) CYM %d(%d)",hihat,BIT(ay_port_b,6),cymbal,ay_port_b&3);
499#endif
500}
501
502
503
504static void equites_update_dac(void)
505{
506   // there is only one latch, which is used to drive two DAC channels.
507   // When the channel is enabled in the 4066, it goes to a series of
508   // low-pass filters. The channel is kept enabled only for a short time,
509   // then it's disabled again.
510   // Note that PB0 goes through three filters while PB1 only goes through one.
511
512   if (equites_8155_portb & 1)
513      DAC_signed_data_w(0, equites_dac_latch);
514
515   if (equites_8155_portb & 2)
516      DAC_signed_data_w(1, equites_dac_latch);
517}
518
519static WRITE8_HANDLER(equites_dac_latch_w)
520{
521   equites_dac_latch = data<<2;
522   equites_update_dac();
523}
524
525static WRITE8_HANDLER(equites_8155_portb_w)
526{
527   equites_8155_portb = data;
528   equites_update_dac();
529}
530
531static WRITE8_HANDLER(equites_unk1_w)
532{
533   eq_unk1++;
534}
535
536static void equites_msm5232_gate(int state)
537{
538}
539
250540/******************************************************************************/
251541// Local Functions
252542
r2018r2019
262552      cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
263553}
264554
265// Splendor Blast Hareware
266static INTERRUPT_GEN( splndrbt_interrupt )
555static WRITE8_HANDLER(equites_8155_w)
267556{
268   if (cpu_getiloops())
269      cpunum_set_input_line(machine, 0, 2, HOLD_LINE);
270   else
271      cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
557   static int timer_count;
558
559   // FIXME proper 8155 emulation must be implemented
560   switch( offset )
561   {
562      case 0: //logerror( "8155 Command register write %x, timer command = %x, interrupt enable = %x, ports = %x\n", data, (data >> 6) & 3, (data >> 4) & 3, data & 0xf );
563         if (((data >> 6) & 3) == 3)
564            timer_adjust_periodic(nmi_timer, ATTOTIME_IN_HZ(XTAL_6_144MHz/2 / timer_count), 0, ATTOTIME_IN_HZ(XTAL_6_144MHz/2 / timer_count));
565         break;
566      case 1: //logerror( "8155 I/O Port A write %x\n", data );
567         eq8155_port_a = data;
568
569         sndti_set_output_gain(SOUND_MSM5232, 0, 0, (data >> 4) / 15.0);   /* group1 from msm5232 */
570         sndti_set_output_gain(SOUND_MSM5232, 0, 1, (data >> 4) / 15.0);   /* group1 from msm5232 */
571         sndti_set_output_gain(SOUND_MSM5232, 0, 2, (data >> 4) / 15.0);   /* group1 from msm5232 */
572         sndti_set_output_gain(SOUND_MSM5232, 0, 3, (data >> 4) / 15.0);   /* group1 from msm5232 */
573         sndti_set_output_gain(SOUND_MSM5232, 0, 4, (data & 0x0f) / 15.0);   /* group2 from msm5232 */
574         sndti_set_output_gain(SOUND_MSM5232, 0, 5, (data & 0x0f) / 15.0);   /* group2 from msm5232 */
575         sndti_set_output_gain(SOUND_MSM5232, 0, 6, (data & 0x0f) / 15.0);   /* group2 from msm5232 */
576         sndti_set_output_gain(SOUND_MSM5232, 0, 7, (data & 0x0f) / 15.0);   /* group2 from msm5232 */
577
578         break;
579      case 2: //logerror( "8155 I/O Port B write %x\n", data );
580         equites_8155_portb_w(machine,0,data);
581         break;
582      case 3: //logerror( "8155 I/O Port C (or control) write %x\n", data );
583         eq8155_port_c = data;
584
585         sndti_set_output_gain(SOUND_MSM5232, 0, 8, (data & 0x0f) / 15.0);   /* SOLO  8' from msm5232 */
586         if (data & 0x20)
587            sndti_set_output_gain(SOUND_MSM5232, 0, 9, (data & 0x0f) / 15.0);   /* SOLO 16' from msm5232 */
588         else
589            sndti_set_output_gain(SOUND_MSM5232, 0, 9, 0);   /* SOLO 16' from msm5232 */
590
591         break;
592      case 4: //logerror( "8155 Timer low 8 bits write %x\n", data );
593         timer_count = (timer_count & 0xff00) | data;
594         break;
595      case 5: //logerror( "8155 Timer high 6 bits write %x, timer mode %x\n", data & 0x3f, (data >> 6) & 3);
596         timer_count = (timer_count & 0x00ff) | ((data & 0x3f) << 8);
597         break;
598   }
272599}
273600
274601/******************************************************************************/
275602// Main CPU Handlers
276603
277// Equites Hardware
278static READ16_HANDLER(equites_joyport_r)
604#if HVOLTAGE_DEBUG
605static READ16_HANDLER(hvoltage_debug_r)
279606{
280   int data;
607   return(readinputport(2));
608}
609#endif
281610
282   data = readinputport(0);
283   if (disablejoyport2) data = (data & 0x80ff) | (data<<8 & 0x7f00);
611/******************************************************************************/
612// Main CPU Memory Map
284613
285   return (data);
286}
287614
288static WRITE16_HANDLER(equites_flip0_w)
615static READ16_HANDLER(equites_spriteram_kludge_r)
289616{
290   if (ACCESSING_LSB) disablejoyport2 = 1;
291   if (ACCESSING_MSB) equites_flip = 0;
617   if (spriteram16[0] == 0x5555)
618      return 0;
619   else
620      return spriteram16[0];
292621}
293622
294static WRITE16_HANDLER(equites_flip1_w)
623static READ16_HANDLER(mcu_r)
295624{
296   if (ACCESSING_LSB) disablejoyport2 = 0;
297   if (ACCESSING_MSB) equites_flip = 1;
625   return 0xff00 | mcu_ram[offset];
298626}
299627
300// Splendor Blast Hardware
301#if HVOLTAGE_HACK
302static READ16_HANDLER(hvoltage_debug_r)
628static WRITE16_HANDLER(mcu_w)
303629{
304   return(readinputport(2));
630   if (ACCESSING_LSB)
631      mcu_ram[offset] = data & 0xff;
305632}
306#endif
307633
308static WRITE16_HANDLER(splndrbt_flip0_w)
634static WRITE16_HANDLER( mcu_halt_assert_w )
309635{
310   if (ACCESSING_LSB) splndrbt_flip = 0;
311   if (ACCESSING_MSB) equites_bgcolor_w(machine, offset, data, 0x00ff);
636   cpunum_set_input_line(machine, 2, INPUT_LINE_HALT, ASSERT_LINE);
312637}
313638
314static WRITE16_HANDLER(splndrbt_flip1_w)
639static WRITE16_HANDLER( mcu_halt_clear_w )
315640{
316   if (ACCESSING_LSB) splndrbt_flip = 1;
641   cpunum_set_input_line(machine, 2, INPUT_LINE_HALT, CLEAR_LINE);
317642}
318#if 0
319static WRITE16_HANDLER(log16_w)
320{
321   int pc = activecpu_get_pc();
322643
323   popmessage("%04x: %04x(w)\n", pc, data);
324   logerror("%04x: %04x(w)\n", pc, data);
325}
326#endif
327/******************************************************************************/
328// Main CPU Memory Map
329644
330// Equites Hardware
645
331646static ADDRESS_MAP_START( equites_map, ADDRESS_SPACE_PROGRAM, 16 )
332   AM_RANGE(0x000000, 0x00ffff) AM_ROM AM_WRITENOP // ROM area is written several times (dev system?)
647   AM_RANGE(0x000000, 0x00ffff) AM_ROM   // ROM area is written several times (dev system?)
333648   AM_RANGE(0x040000, 0x040fff) AM_RAM AM_BASE(&equites_workram)
334   AM_RANGE(0x080000, 0x080fff) AM_READWRITE(SMH_RAM, equites_charram_w) AM_BASE(&videoram16)
335   AM_RANGE(0x0c0000, 0x0c0fff) AM_RAM AM_BASE(&spriteram16_2)
336   AM_RANGE(0x100000, 0x100fff) AM_READWRITE(equites_spriteram_r, SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
337   AM_RANGE(0x140000, 0x1407ff) AM_READWRITE(equites_8404_r, SMH_RAM) AM_BASE(&equites_8404ram)
649   AM_RANGE(0x080000, 0x080fff) AM_READWRITE(equites_fg_videoram_r, equites_fg_videoram_w)   // 8-bit
650   AM_RANGE(0x0c0000, 0x0c01ff) AM_RAM AM_WRITE(equites_bg_videoram_w) AM_BASE(&equites_bg_videoram)
651   AM_RANGE(0x0c0200, 0x0c0fff) AM_RAM
652   AM_RANGE(0x100000, 0x100001) AM_READ(equites_spriteram_kludge_r)
653   AM_RANGE(0x100000, 0x1001ff) AM_RAM AM_BASE(&spriteram16)
654   AM_RANGE(0x140000, 0x1407ff) AM_READWRITE(mcu_r, mcu_w)   // 8-bit
338655   AM_RANGE(0x180000, 0x180001) AM_READWRITE(input_port_1_word_r, soundlatch_word_w) // LSB: sound latch
339   AM_RANGE(0x184000, 0x184001) AM_WRITE(equites_flip0_w) // [MMLL] MM: normal screen, LL: use joystick 1 only
340   AM_RANGE(0x188000, 0x188001) AM_WRITE(SMH_NOP) // 8404 control port1
341   AM_RANGE(0x18c000, 0x18c001) AM_WRITE(SMH_NOP) // 8404 control port2
342   AM_RANGE(0x1a4000, 0x1a4001) AM_WRITE(equites_flip1_w) // [MMLL] MM: flip screen, LL: use both joysticks
343   AM_RANGE(0x1a8000, 0x1a8001) AM_WRITE(SMH_NOP) // 8404 control port3
344   AM_RANGE(0x1ac000, 0x1ac001) AM_WRITE(SMH_NOP) // 8404 control port4
345   AM_RANGE(0x1c0000, 0x1c0001) AM_READWRITE(equites_joyport_r, equites_scrollreg_w) // scroll register[XXYY]
656   AM_RANGE(0x184000, 0x184001) AM_WRITE(equites_flip0_w)
657   AM_RANGE(0x188000, 0x188001) AM_WRITE(mcu_halt_clear_w) // 8404 control port1
658   AM_RANGE(0x18c000, 0x18c001) AM_WRITENOP // 8404 control port2
659   AM_RANGE(0x1a4000, 0x1a4001) AM_WRITE(equites_flip1_w)
660   AM_RANGE(0x1a8000, 0x1a8001) AM_WRITE(mcu_halt_assert_w) // 8404 control port3
661   AM_RANGE(0x1ac000, 0x1ac001) AM_WRITENOP // 8404 control port4
662   AM_RANGE(0x1c0000, 0x1c0001) AM_READWRITE(input_port_0_word_r, equites_scrollreg_w) // scroll register[XXYY]
346663   AM_RANGE(0x380000, 0x380001) AM_WRITE(equites_bgcolor_w) // bg color register[CC--]
347   AM_RANGE(0x780000, 0x780001) AM_WRITE(SMH_NOP) // watchdog
664   AM_RANGE(0x780000, 0x780001) AM_WRITE(watchdog_reset16_w)
348665ADDRESS_MAP_END
349666
350// Splendor Blast Hardware
351667static ADDRESS_MAP_START( splndrbt_map, ADDRESS_SPACE_PROGRAM, 16 )
352668   AM_RANGE(0x000000, 0x00ffff) AM_ROM
353669   AM_RANGE(0x040000, 0x040fff) AM_RAM AM_BASE(&equites_workram) // work RAM
354670   AM_RANGE(0x080000, 0x080001) AM_READ(input_port_0_word_r) // joyport [2211]
355671   AM_RANGE(0x0c0000, 0x0c0001) AM_READWRITE(input_port_1_word_r, splndrbt_flip0_w) // [MMLL] MM: bg color register, LL: normal screen
356   AM_RANGE(0x0c4000, 0x0c4001) AM_WRITE(SMH_NOP) // 8404 control port1
357   AM_RANGE(0x0c8000, 0x0c8001) AM_WRITE(SMH_NOP) // 8404 control port2
672   AM_RANGE(0x0c4000, 0x0c4001) AM_WRITE(mcu_halt_clear_w) // 8404 control port1
673   AM_RANGE(0x0c8000, 0x0c8001) AM_WRITENOP // 8404 control port2
358674   AM_RANGE(0x0cc000, 0x0cc001) AM_WRITE(splndrbt_selchar0_w) // select active char map
359675   AM_RANGE(0x0e0000, 0x0e0001) AM_WRITE(splndrbt_flip1_w) // [MMLL] MM: not used, LL: flip screen
360   AM_RANGE(0x0e4000, 0x0e4001) AM_WRITE(SMH_NOP) // 8404 control port3
361   AM_RANGE(0x0e8000, 0x0e8001) AM_WRITE(SMH_NOP) // 8404 control port4
676   AM_RANGE(0x0e4000, 0x0e4001) AM_WRITE(mcu_halt_assert_w) // 8404 control port3
677   AM_RANGE(0x0e8000, 0x0e8001) AM_WRITENOP // 8404 control port4
362678   AM_RANGE(0x0ec000, 0x0ec001) AM_WRITE(splndrbt_selchar1_w) // select active char map
363   AM_RANGE(0x100000, 0x100001) AM_RAM AM_BASE(&splndrbt_scrollx) // scrollx
679   AM_RANGE(0x100000, 0x100001) AM_WRITE(splndrbt_bg_scrollx_w)
364680   AM_RANGE(0x140000, 0x140001) AM_WRITE(soundlatch_word_w) // LSB: sound command
365   AM_RANGE(0x1c0000, 0x1c0001) AM_RAM AM_BASE(&splndrbt_scrolly) // scrolly
366   AM_RANGE(0x180000, 0x1807ff) AM_READWRITE(equites_8404_r, SMH_RAM) AM_BASE(&equites_8404ram) // 8404 RAM
367   AM_RANGE(0x200000, 0x200fff) AM_READWRITE(SMH_RAM, splndrbt_charram_w) AM_BASE(&videoram16) AM_SIZE(&videoram_size) // char RAM page 0
368   AM_RANGE(0x201000, 0x201fff) AM_READWRITE(splndrbt_bankedchar_r, splndrbt_bankedchar_w) // banked char RAM page 1,2
369   AM_RANGE(0x400000, 0x400fff) AM_READWRITE(SMH_RAM, splndrbt_scrollram_w) AM_BASE(&spriteram16_2) // scroll RAM 0,1
370   AM_RANGE(0x600000, 0x6001ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) // sprite RAM 0,1,2
681   AM_RANGE(0x1c0000, 0x1c0001) AM_WRITE(splndrbt_bg_scrolly_w)
682   AM_RANGE(0x180000, 0x1807ff) AM_READWRITE(mcu_r, mcu_w)   // 8-bit
683   AM_RANGE(0x200000, 0x200fff) AM_MIRROR(0x1000) AM_READWRITE(equites_fg_videoram_r, equites_fg_videoram_w)   // 8-bit
684   AM_RANGE(0x400000, 0x4007ff) AM_RAM AM_WRITE(equites_bg_videoram_w) AM_BASE(&equites_bg_videoram)
685   AM_RANGE(0x400800, 0x400fff) AM_RAM
686   AM_RANGE(0x600000, 0x6000ff) AM_RAM AM_BASE(&spriteram16)   // sprite RAM 0,1
687   AM_RANGE(0x600100, 0x6001ff) AM_RAM AM_BASE(&spriteram16_2)   // sprite RAM 2 (8-bit)
371688ADDRESS_MAP_END
372689
690static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
691   AM_RANGE(0x0000, 0xbfff) AM_ROM
692   AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_r)
693   AM_RANGE(0xc080, 0xc08d) AM_WRITE(MSM5232_0_w)
694   AM_RANGE(0xc0a0, 0xc0a0) AM_WRITE(AY8910_write_port_0_w)
695   AM_RANGE(0xc0a1, 0xc0a1) AM_WRITE(AY8910_control_port_0_w)
696   AM_RANGE(0xc0b0, 0xc0b0) AM_WRITENOP // n.c.
697   AM_RANGE(0xc0c0, 0xc0c0) AM_WRITE(equites_unk1_w)
698   AM_RANGE(0xc0d0, 0xc0d0) AM_WRITE(equites_dac_latch_w)   // followed by 1 (and usually 0) on 8155 port B
699   AM_RANGE(0xc0e0, 0xc0e0) AM_WRITE(equites_dac_latch_w)   // followed by 2 (and usually 0) on 8155 port B
700   AM_RANGE(0xc0f8, 0xc0ff) AM_WRITE(equites_c0f8_w)
701   AM_RANGE(0xe000, 0xe0ff) AM_RAM
702ADDRESS_MAP_END
703
704static ADDRESS_MAP_START( sound_portmap, ADDRESS_SPACE_IO, 8 )
705   AM_RANGE(0x00e0, 0x00e5) AM_WRITE(equites_8155_w)
706ADDRESS_MAP_END
707
708
709static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 )
710   AM_RANGE(0x0000, 0x03ff) AM_RAM AM_BASE(&mcu_ram) /* main CPU shared RAM */
711ADDRESS_MAP_END
712
373713/******************************************************************************/
374714// Common Port Map
375715
r2018r2019
407747#if EASY_TEST_MODE
408748   PORT_SERVICE( 0x0300, IP_ACTIVE_HIGH )
409749#endif
410   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Cabinet ) )
750   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:!6")
411751   PORT_DIPSETTING(      0x0400, DEF_STR( Upright ) )
412752   PORT_DIPSETTING(      0x0000, DEF_STR( Cocktail ) )
413   PORT_DIPNAME( 0x0800, 0x0800, "Buttons" )
753   PORT_DIPNAME( 0x0800, 0x0800, "Buttons" ) PORT_DIPLOCATION("SW:!5")
414754   PORT_DIPSETTING(      0x0000, "2" )
415755   PORT_DIPSETTING(      0x0800, "3" )
416   PORT_DIPNAME( 0x1000, 0x0000, DEF_STR ( Lives ) )
756   PORT_DIPNAME( 0x1000, 0x0000, DEF_STR ( Lives ) ) PORT_DIPLOCATION("SW:!4")
417757   PORT_DIPSETTING(      0x0000, "3" )
418758   PORT_DIPSETTING(      0x1000, "5" )
419   PORT_DIPNAME( 0x2000, 0x0000, DEF_STR ( Difficulty ) )
759   PORT_DIPNAME( 0x2000, 0x0000, DEF_STR ( Difficulty ) ) PORT_DIPLOCATION("SW:!3")
420760   PORT_DIPSETTING(      0x0000, DEF_STR( Normal ) )
421761   PORT_DIPSETTING(      0x2000, DEF_STR( Hard ) )
422   PORT_DIPNAME( 0xc000, 0x0000, DEF_STR( Coinage ) )
762   PORT_DIPNAME( 0xc000, 0x0000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:!2,!1")
423763   PORT_DIPSETTING(      0xc000, "A 2C/1C B 3C/1C" )
424764   PORT_DIPSETTING(      0x0000, "A 1C/1C B 2C/1C" )
425765   PORT_DIPSETTING(      0x8000, "A 1C/2C B 1C/4C" )
426766   PORT_DIPSETTING(      0x4000, "A 1C/3C B 1C/6C" )
767
768   /* this is actually a variable resistor */
769   PORT_START_TAG(FRQ_ADJUSTER_TAG)
770   PORT_ADJUSTER(50, "MSM5232 Clock")
427771INPUT_PORTS_END
428772
429773/******************************************************************************/
774// Gekisou Port Map
775
776static INPUT_PORTS_START( gekisou )
777   PORT_START
778   EQUITES_PLAYER_INPUT_LSB( IPT_BUTTON1, IPT_BUTTON2, IPT_BUTTON3, IPT_START1 )
779   EQUITES_PLAYER_INPUT_MSB( IPT_BUTTON1, IPT_BUTTON2, IPT_BUTTON3, IPT_START2 )
780
781   PORT_START
782   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_COIN1 )
783   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_COIN2 )
784#if EASY_TEST_MODE
785   PORT_SERVICE( 0x0300, IP_ACTIVE_HIGH )
786#endif
787   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR ( Unknown ) )
788   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
789   PORT_DIPSETTING(      0x0400, DEF_STR( On ) )
790   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR ( Unknown ) )
791   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
792   PORT_DIPSETTING(      0x0800, DEF_STR( On ) )
793   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR ( Unknown ) )
794   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
795   PORT_DIPSETTING(      0x1000, DEF_STR( On ) )
796   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR ( Unknown ) )
797   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
798   PORT_DIPSETTING(      0x2000, DEF_STR( On ) )
799   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR ( Unknown ) )
800   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
801   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
802   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR ( Unknown ) )
803   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
804   PORT_DIPSETTING(      0x8000, DEF_STR( On ) )
805
806   /* this is actually a variable resistor */
807   PORT_START_TAG(FRQ_ADJUSTER_TAG)
808   PORT_ADJUSTER(50, "MSM5232 Clock")
809INPUT_PORTS_END
810
811/******************************************************************************/
430812// Bull Fighter Port Map
431813
432814static INPUT_PORTS_START( bullfgtr )
r2018r2019
440822#if EASY_TEST_MODE
441823   PORT_SERVICE( 0x0300, IP_ACTIVE_HIGH )
442824#endif
443   PORT_DIPNAME( 0x0c00, 0x0000, DEF_STR( Game_Time ) )
825   PORT_DIPNAME( 0x0c00, 0x0000, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("SW:!6,!5")
444826   PORT_DIPSETTING(      0x0c00, "3:00" )
445827   PORT_DIPSETTING(      0x0800, "2:00" )
446828   PORT_DIPSETTING(      0x0000, "1:30" )
447829   PORT_DIPSETTING(      0x0400, "1:00" )
448   PORT_DIPNAME( 0x2000, 0x0000, DEF_STR ( Difficulty ) )
830   PORT_DIPNAME( 0x2000, 0x0000, DEF_STR ( Difficulty ) ) PORT_DIPLOCATION("SW:!3")
449831   PORT_DIPSETTING(      0x0000, DEF_STR( Normal ) )
450832   PORT_DIPSETTING(      0x2000, DEF_STR( Hard ) )
451   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) )
833   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW:!2")
452834   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
453835   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
454   PORT_DIPNAME( 0x9000, 0x0000, DEF_STR( Coinage ) )
455//  PORT_DIPSETTING(      0x9000, "A 1C/1C B 1C/1C" )       // More than 1 credit per player needed
456   PORT_DIPSETTING(      0x0000, "A 1C/1C B 1C/1C" )
836   PORT_DIPNAME( 0x9000, 0x0000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:!4,!1")
837   PORT_DIPSETTING(      0x9000, "1C/1C (3C per player)" )
838   PORT_DIPSETTING(      0x0000, "1C/1C (1C per player)" )
457839   PORT_DIPSETTING(      0x8000, "A 1C/1C B 1C/4C" )
458840   PORT_DIPSETTING(      0x1000, "A 1C/2C B 1C/3C" )
841
842   /* this is actually a variable resistor */
843   PORT_START_TAG(FRQ_ADJUSTER_TAG)
844   PORT_ADJUSTER(50, "MSM5232 Clock")
459845INPUT_PORTS_END
460846
461847/******************************************************************************/
r2018r2019
473859#if EASY_TEST_MODE
474860   PORT_SERVICE( 0x0300, IP_ACTIVE_HIGH )
475861#endif
476   PORT_DIPNAME( 0x0c00, 0x0000, "Game Points" )
862   PORT_DIPNAME( 0x0c00, 0x0000, "Game Points" ) PORT_DIPLOCATION("SW:!6,!5")
477863   PORT_DIPSETTING(      0x0800, "3000" )
478864   PORT_DIPSETTING(      0x0400, "4000" )
479865   PORT_DIPSETTING(      0x0000, "5000" )
480866   PORT_DIPSETTING(      0x0c00, "7000" )
481   PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unused ) )
867   PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW:!3")
482868   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
483869   PORT_DIPSETTING(      0x2000, DEF_STR( On ) )
484   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) )
870   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW:!2")
485871   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
486872   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
487   PORT_DIPNAME( 0x9000, 0x0000, DEF_STR( Coinage ) )
873   PORT_DIPNAME( 0x9000, 0x0000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:!4,!1")
488874   PORT_DIPSETTING(      0x9000, "1C/1C (2C per player)" )
489875   PORT_DIPSETTING(      0x0000, "1C/1C (1C per player)" )
490876   PORT_DIPSETTING(      0x8000, "1C/1C (1C for 2 players)" )
491877   PORT_DIPSETTING(      0x1000, "1C/3C (1C per player)" )
878
879   /* this is actually a variable resistor */
880   PORT_START_TAG(FRQ_ADJUSTER_TAG)
881   PORT_ADJUSTER(50, "MSM5232 Clock")
492882INPUT_PORTS_END
493883
494884/******************************************************************************/
r2018r2019
505895#if EASY_TEST_MODE
506896   PORT_SERVICE( 0x0300, IP_ACTIVE_HIGH )
507897#endif
508   PORT_DIPNAME( 0x0c00, 0x0000, DEF_STR ( Difficulty ) )
898   PORT_DIPNAME( 0x0c00, 0x0000, DEF_STR ( Difficulty ) ) PORT_DIPLOCATION("SW:!6,!5")
509899   PORT_DIPSETTING(      0x0400, DEF_STR( Easy ) )
510900   PORT_DIPSETTING(      0x0000, DEF_STR( Normal ) )
511901   PORT_DIPSETTING(      0x0800, DEF_STR( Hard ) )
512902   PORT_DIPSETTING(      0x0c00, DEF_STR( Hardest ) )
513   PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Demo_Sounds ) )
903   PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW:!4")
514904   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
515905   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
516   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Cabinet ) )
906   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:!3")
517907   PORT_DIPSETTING(      0x2000, DEF_STR( Upright ) )
518908   PORT_DIPSETTING(      0x0000, DEF_STR( Cocktail ) )
519   PORT_DIPNAME( 0xc000, 0x0000, DEF_STR( Coinage ) )
909   PORT_DIPNAME( 0xc000, 0x0000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:!2,!1")
520910   PORT_DIPSETTING(      0xc000, "A 2C/1C B 3C/1C" )
521911   PORT_DIPSETTING(      0x0000, "A 1C/1C B 2C/1C" )
522912   PORT_DIPSETTING(      0x4000, "A 1C/2C B 1C/4C" )
523913   PORT_DIPSETTING(      0x8000, "A 1C/3C B 1C/6C" )
914
915   /* this is actually a variable resistor */
916   PORT_START_TAG(FRQ_ADJUSTER_TAG)
917   PORT_ADJUSTER(50, "MSM5232 Clock")
524918INPUT_PORTS_END
525919
526920/******************************************************************************/
r2018r2019
528922
529923static INPUT_PORTS_START( hvoltage )
530924   PORT_START
531   EQUITES_PLAYER_INPUT_LSB( IPT_BUTTON1, IPT_BUTTON2, IPT_UNKNOWN, IPT_START1 )
532   EQUITES_PLAYER_INPUT_MSB( IPT_BUTTON1, IPT_BUTTON2, IPT_UNKNOWN, IPT_START2 )
925   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
926   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
927   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
928   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
929   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 )
930   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 )
931   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Cabinet ) )
932   PORT_DIPSETTING(      0x0040, DEF_STR( Upright ) )
933   PORT_DIPSETTING(      0x0000, DEF_STR( Cocktail ) )
934   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_START1 )
935   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
936   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
937   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
938   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
939   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
940   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
941   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_COCKTAIL
942   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_START2 )
533943
534944   PORT_START
535945   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_COIN1 )
r2018r2019
537947#if EASY_TEST_MODE
538948   PORT_SERVICE( 0x0300, IP_ACTIVE_HIGH )
539949#endif
540#if HVOLTAGE_HACK
541   PORT_DIPNAME( 0x0400, 0x0000, "Invulnerability" )
950#if HVOLTAGE_DEBUG
951   PORT_DIPNAME( 0x0400, 0x0000, "Invulnerability" ) PORT_DIPLOCATION("SW:!6")
542952   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
543953   PORT_DIPSETTING(      0x0400, DEF_STR( On ) )
544   PORT_DIPNAME( 0x0800, 0x0000, "Need to kill Bosses" )
954   PORT_DIPNAME( 0x0800, 0x0000, "Need to kill Bosses" ) PORT_DIPLOCATION("SW:!5")
545955   PORT_DIPSETTING(      0x0800, DEF_STR( No ) )
546956   PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
547957#else
548   PORT_DIPNAME( 0x0c00, 0x0000, DEF_STR ( Difficulty ) )
958   PORT_DIPNAME( 0x0c00, 0x0000, DEF_STR ( Difficulty ) ) PORT_DIPLOCATION("SW:!6,!5")
549959   PORT_DIPSETTING(      0x0400, DEF_STR( Easy ) )
550960   PORT_DIPSETTING(      0x0000, DEF_STR( Normal ) )
551961   PORT_DIPSETTING(      0x0800, DEF_STR( Hard ) )
552962   PORT_DIPSETTING(      0x0c00, DEF_STR( Hardest ) )
553963#endif
554   PORT_DIPNAME( 0x1000, 0x0000, DEF_STR ( Lives ) )         // See notes
964   PORT_DIPNAME( 0x1000, 0x0000, DEF_STR ( Lives ) ) PORT_DIPLOCATION("SW:!4")   // See notes
555965   PORT_DIPSETTING(      0x0000, "3" )
556966   PORT_DIPSETTING(      0x1000, "5" )
557   PORT_DIPNAME( 0x2000, 0x0000, DEF_STR ( Bonus_Life ) )
967   PORT_DIPNAME( 0x2000, 0x0000, DEF_STR ( Bonus_Life ) ) PORT_DIPLOCATION("SW:!3")
558968   PORT_DIPSETTING(      0x0000, "50k, 100k then every 100k" )
559969   PORT_DIPSETTING(      0x2000, "50k, 200k then every 100k" )
560   PORT_DIPNAME( 0xc000, 0x0000, DEF_STR( Coinage ) )         // See notes
970   PORT_DIPNAME( 0xc000, 0x0000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:!2,!1")   // See notes
561971   PORT_DIPSETTING(      0xc000, "A 2C/1C B 3C/1C" )
562972   PORT_DIPSETTING(      0x0000, "A 1C/1C B 2C/1C" )
563973   PORT_DIPSETTING(      0x4000, "A 1C/2C B 1C/4C" )
564974   PORT_DIPSETTING(      0x8000, "A 1C/3C B 1C/6C" )
565975
566#if HVOLTAGE_HACK
976#if HVOLTAGE_DEBUG
567977   /* Fake port to handle debug mode */
568978   PORT_START
569979   PORT_DIPNAME( 0xffff, 0xffff, "Debug Mode" )
570980   PORT_DIPSETTING(      0xffff, DEF_STR( Off ) )
571981   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
572982#endif
983
984   /* this is actually a variable resistor */
985   PORT_START_TAG(FRQ_ADJUSTER_TAG)
986   PORT_ADJUSTER(50, "MSM5232 Clock")
573987INPUT_PORTS_END
574988
575989/******************************************************************************/
576990// Graphics Layouts
577991
578// Equites Hardware
579static const gfx_layout eq_charlayout =
992static const gfx_layout charlayout =
580993{
581994   8, 8,
582   256,
995   RGN_FRAC(1,1),
583996   2,
584997   { 0, 4 },
585998   { STEP4(8*8+3,-1), STEP4(0*8+3,-1) },
r2018r2019
5871000   16*8
5881001};
5891002
590static const gfx_layout eq_tilelayout =
1003static const gfx_layout tilelayout_3bpp =
5911004{
5921005   16, 16,
593   256,
1006   RGN_FRAC(1,2),
5941007   3,
595   { 0, 0x4000*8, 0x4000*8+4 },
596   { STEP4(128*1+3,-1), STEP4(128*2+3,-1), STEP4(128*3+3,-1), STEP4(128*0+3,-1) },
1008   { 4, RGN_FRAC(1,2), RGN_FRAC(1,2)+4 },
1009   { STEP4(16*8+3,-1), STEP4(32*8+3,-1), STEP4(48*8+3,-1), STEP4(0*8+3,-1) },
5971010   { STEP16(0,8) },
5981011   64*8
5991012};
6001013
601static const gfx_layout eq_spritelayout =
1014static const gfx_layout tilelayout_2bpp =
6021015{
603   16, 14,
604   256,
605   3,
606   { 0, 0x4000*8, 0x4000*8+4 },
607   { STEP4(128*0+3,-1), STEP4(128*1+3,-1), STEP4(128*2+3,-1), STEP4(128*3+3,-1) },
608   { STEP8(1*8,8), STEP4(1*8+8*8,8), STEP2(1*8+12*8,8) },
609   64*8
610};
611
612static GFXDECODE_START( equites )
613   GFXDECODE_ENTRY( REGION_GFX1, 0, eq_charlayout,     0, 32 ) // chars
614   GFXDECODE_ENTRY( REGION_GFX2, 0, eq_tilelayout,   128, 16 ) // tile set0
615   GFXDECODE_ENTRY( REGION_GFX3, 0, eq_tilelayout,   128, 16 ) // tile set1
616   GFXDECODE_ENTRY( REGION_GFX4, 0, eq_spritelayout, 256, 16 ) // sprite set0
617   GFXDECODE_ENTRY( REGION_GFX5, 0, eq_spritelayout, 256, 16 ) // sprite set1
618GFXDECODE_END
619
620// Splendor Blast Hardware
621static const gfx_layout sp_charlayout =
622{
623   8, 8,
624   512,
625   2,
626   { 0, 4 },
627   { STEP4(8*8+3,-1), STEP4(0*8+3,-1) },
628   { STEP8(0*8,8) },
629   16*8
630};
631
632static const gfx_layout sp_tilelayout =
633{
6341016   16,16,
635   256,
1017   RGN_FRAC(1,1),
6361018   2,
6371019   { 0, 4 },
6381020   { STEP4(16*8+3,-1), STEP4(32*8+3,-1), STEP4(48*8+3,-1), STEP4(0*8+3,-1) },
r2018r2019
6401022   64*8
6411023};
6421024
643static const gfx_layout sp_spritelayout =
1025static const gfx_layout spritelayout_16x14 =
6441026{
1027   16, 14,   // 16x14, very unusual
1028   RGN_FRAC(1,2),
1029   3,
1030   { 4, RGN_FRAC(1,2), RGN_FRAC(1,2)+4 },
1031   { STEP4(128*0+3,-1), STEP4(128*1+3,-1), STEP4(128*2+3,-1), STEP4(128*3+3,-1) },
1032   { 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
1033         8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8 },
1034   64*8
1035};
1036
1037static const gfx_layout spritelayout_32x32 =
1038{
6451039   32,32,
646   128,
1040   RGN_FRAC(1,2),
6471041   3,
648   { 0, 0x8000*8, 0x8000*8+4 },
1042   { 4, RGN_FRAC(1,2), RGN_FRAC(1,2)+4 },
6491043   { STEP4(0*8+3,-1), STEP4(1*8+3,-1), STEP4(2*8+3,-1), STEP4(3*8+3,-1), STEP4(4*8+3,-1), STEP4(5*8+3,-1), STEP4(6*8+3,-1), STEP4(7*8+3,-1) },
6501044   { STEP16(0*8*8,8*8), STEP16(31*8*8,-8*8) },
651   8*32*8
1045   256*8
6521046};
6531047
1048
1049static GFXDECODE_START( equites )
1050   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,         0x000, 0x80/4 ) // chars
1051   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout_3bpp,    0x080, 0x80/8 ) // tiles
1052   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout_16x14, 0x100, 0x80/8 ) // sprites
1053GFXDECODE_END
1054
6541055static GFXDECODE_START( splndrbt )
655   GFXDECODE_ENTRY( REGION_GFX1, 0, sp_charlayout,     0, 256/4 ) // 512 4-color chars
656   GFXDECODE_ENTRY( REGION_GFX2, 0, sp_tilelayout,   256, 256/4 ) // 256 4-color tiles
657   GFXDECODE_ENTRY( REGION_GFX3, 0, sp_tilelayout,   256, 256/4 ) // 256 4-color tiles
658   GFXDECODE_ENTRY( REGION_GFX4, 0, sp_spritelayout, 512, 256/8 ) // 256 8-color sprites
1056   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,         0x000, 0x100/4 ) // chars
1057   GFXDECODE_ENTRY( REGION_GFX2, 0, tilelayout_2bpp,    0x100, 0x080/4 ) // tiles
1058   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout_32x32, 0x180, 0x100/8 ) // sprites
6591059GFXDECODE_END
6601060
1061
1062
6611063/******************************************************************************/
662// Hardware Definitions
6631064
1065static const struct MSM5232interface equites_5232intf =
1066{
1067   { 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6 }, // verified
1068   equites_msm5232_gate
1069};
1070
1071
1072static const struct AY8910interface equites_8910intf =
1073{
1074   0,
1075   0,
1076   equites_8910porta_w,
1077   equites_8910portb_w
1078};
1079
1080
1081static const char *const alphamc07_sample_names[] =
1082{
1083   "*alphamc07",
1084   "bongo1.wav",
1085   "bongo2.wav",
1086   "bongo3.wav",
1087   0
1088};
1089
1090const struct Samplesinterface alphamc07_samples_interface =
1091{
1092   3,   /* 3 channels */
1093   alphamc07_sample_names
1094};
1095
1096
1097#define MSM5232_BASE_VOLUME 1.0
1098
1099// the sound board is the same in all games
1100static MACHINE_DRIVER_START( common_sound )
1101
1102   MDRV_CPU_ADD(8085A, XTAL_6_144MHz)   /* verified on pcb */
1103   MDRV_CPU_PROGRAM_MAP(sound_map,0)
1104   MDRV_CPU_IO_MAP(sound_portmap,0)
1105
1106   MDRV_SOUND_START(equites)
1107
1108   /* sound hardware */
1109   MDRV_SPEAKER_STANDARD_MONO("mono")
1110
1111   MDRV_SOUND_ADD(MSM5232, MSM5232_MAX_CLOCK)   // will be adjusted at runtime through PORT_ADJUSTER
1112   MDRV_SOUND_CONFIG(equites_5232intf)
1113   MDRV_SOUND_ROUTE(0, "mono", MSM5232_BASE_VOLUME/2.2)   // pin 28  2'-1 : 22k resistor
1114   MDRV_SOUND_ROUTE(1, "mono", MSM5232_BASE_VOLUME/1.5)   // pin 29  4'-1 : 15k resistor
1115   MDRV_SOUND_ROUTE(2, "mono", MSM5232_BASE_VOLUME)      // pin 30  8'-1 : 10k resistor
1116   MDRV_SOUND_ROUTE(3, "mono", MSM5232_BASE_VOLUME)      // pin 31 16'-1 : 10k resistor
1117   MDRV_SOUND_ROUTE(4, "mono", MSM5232_BASE_VOLUME/2.2)   // pin 36  2'-2 : 22k resistor
1118   MDRV_SOUND_ROUTE(5, "mono", MSM5232_BASE_VOLUME/1.5)   // pin 35  4'-2 : 15k resistor
1119   MDRV_SOUND_ROUTE(6, "mono", MSM5232_BASE_VOLUME)      // pin 34  8'-2 : 10k resistor
1120   MDRV_SOUND_ROUTE(7, "mono", MSM5232_BASE_VOLUME)      // pin 33 16'-2 : 10k resistor
1121   MDRV_SOUND_ROUTE(8, "mono", 1.0)      // pin 1 SOLO  8'
1122   MDRV_SOUND_ROUTE(9, "mono", 1.0)      // pin 2 SOLO 16'
1123   // pin 22 Noise Output  not mapped
1124
1125   MDRV_SOUND_ADD(AY8910, XTAL_6_144MHz/4) /* verified on pcb */
1126   MDRV_SOUND_CONFIG(equites_8910intf)
1127   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
1128
1129   MDRV_SOUND_ADD(DAC, 0)
1130   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1131
1132   MDRV_SOUND_ADD(DAC, 0)
1133   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1134
1135   MDRV_SOUND_ADD(SAMPLES, 0)
1136   MDRV_SOUND_CONFIG(alphamc07_samples_interface)
1137   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
1138MACHINE_DRIVER_END
1139
1140/******************************************************************************/
1141
6641142static MACHINE_DRIVER_START( equites )
6651143
6661144   /* basic machine hardware */
r2018r2019
6681146   MDRV_CPU_PROGRAM_MAP(equites_map,0)
6691147   MDRV_CPU_VBLANK_INT_HACK(equites_interrupt, 2)
6701148
1149   MDRV_IMPORT_FROM(common_sound)
1150
1151   MDRV_CPU_ADD(ALPHA8301, 4000000/8)
1152   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
1153
6711154   /* video hardware */
672   MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
673
6741155   MDRV_SCREEN_ADD("main", RASTER)
6751156   MDRV_SCREEN_REFRESH_RATE(60)
676   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(600))
6771157   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
678   MDRV_SCREEN_SIZE(256 +BMPAD*2, 256 +BMPAD*2)
679   MDRV_SCREEN_VISIBLE_AREA(0 +BMPAD, 256-1 +BMPAD, 24 +BMPAD, 232-1 +BMPAD)
1158   MDRV_SCREEN_SIZE(32*8, 32*8)
1159   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 3*8, 29*8-1)
6801160
681   MDRV_PALETTE_LENGTH(384)
6821161   MDRV_GFXDECODE(equites)
683
1162   MDRV_PALETTE_LENGTH(0x180)
6841163   MDRV_PALETTE_INIT(equites)
6851164   MDRV_VIDEO_START(equites)
6861165   MDRV_VIDEO_UPDATE(equites)
6871166
688   /* sound hardware */
689   MDRV_IMPORT_FROM(equites_sound)
690
1167   MDRV_MACHINE_RESET(equites)
6911168MACHINE_DRIVER_END
6921169
6931170static MACHINE_DRIVER_START( splndrbt )
r2018r2019
6951172   /* basic machine hardware */
6961173   MDRV_CPU_ADD(M68000, XTAL_24MHz/4) /* 68000P8 running at 6mhz, verified on pcb */
6971174   MDRV_CPU_PROGRAM_MAP(splndrbt_map, 0)
698   MDRV_CPU_VBLANK_INT_HACK(splndrbt_interrupt, 2)
1175   MDRV_CPU_VBLANK_INT_HACK(equites_interrupt, 2)
6991176
700   MDRV_MACHINE_RESET(splndrbt)
1177   MDRV_IMPORT_FROM(common_sound)
7011178
1179   MDRV_CPU_ADD(ALPHA8301, 4000000/8)
1180   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
1181
7021182   /* video hardware */
703   MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
704
7051183   MDRV_SCREEN_ADD("main", RASTER)
7061184   MDRV_SCREEN_REFRESH_RATE(60)
707   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(600))
7081185   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
709   MDRV_SCREEN_SIZE(256, 256)
710   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 64, 256-1)
1186   MDRV_SCREEN_SIZE(32*8, 32*8)
1187   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
7111188
712   MDRV_PALETTE_LENGTH(1536)
7131189   MDRV_GFXDECODE(splndrbt)
714
1190   MDRV_PALETTE_LENGTH(0x280)
7151191   MDRV_PALETTE_INIT(splndrbt)
7161192   MDRV_VIDEO_START(splndrbt)
7171193   MDRV_VIDEO_UPDATE(splndrbt)
7181194
719   /* sound hardware */
720   MDRV_IMPORT_FROM(equites_sound)
721
1195   MDRV_MACHINE_RESET(equites)
7221196MACHINE_DRIVER_END
7231197
1198
7241199/******************************************************************************/
7251200// Equites ROM Map
7261201
1202/*
1203Equites by ALPHA DENSHI CO. (1984)
1204
1205Note: CPU - Main PCB
1206      SND - Sound PCB    NO.59 MC07
1207      VID - Video PCB
1208
1209Main processor   - 68000 2.988MHz
1210
1211Video processor  - ALPHA-8303 custom
1212
1213Sound processor  - 8085 3.073MHz
1214                 - TMP8155 RIOTs    (RAM & I/O Timers)
1215                 - MSM5232R3
1216                 - AY-3-8910
1217*/
7271218ROM_START( equites )
7281219   ROM_REGION( 0x10000, REGION_CPU1, 0 ) // 68000 ROMs
729   ROM_LOAD16_BYTE( "ep1", 0x00001, 0x2000, CRC(6a4fe5f7) SHA1(5ff1594a2cee28cc7d59448eb57473088ac6f14b) )
730   ROM_LOAD16_BYTE( "ep5", 0x00000, 0x2000, CRC(00faa3eb) SHA1(6b31d041ad4ca81eda36487f659997cc4030f23c) )
1220   ROM_LOAD16_BYTE( "ep1",         0x00001, 0x2000, CRC(6a4fe5f7) SHA1(5ff1594a2cee28cc7d59448eb57473088ac6f14b) )
1221   ROM_LOAD16_BYTE( "ep5",         0x00000, 0x2000, CRC(00faa3eb) SHA1(6b31d041ad4ca81eda36487f659997cc4030f23c) )
7311222   ROM_LOAD16_BYTE( "epr-ep2.12d", 0x04001, 0x2000, CRC(0c1bc2e7) SHA1(4c3510dfeee2fb2f295a32e2fe2021c4c7f08e8a) )
7321223   ROM_LOAD16_BYTE( "epr-ep6.12b", 0x04000, 0x2000, CRC(bbed3dcc) SHA1(46ef2c60ccfa76a187b19dc0b7e6c594050b183f) )
7331224   ROM_LOAD16_BYTE( "epr-ep3.10d", 0x08001, 0x2000, CRC(5f2d059a) SHA1(03fe904a445cce89462788fecfd61ac53f4dd17f) )
7341225   ROM_LOAD16_BYTE( "epr-ep7.10b", 0x08000, 0x2000, CRC(a8f6b8aa) SHA1(ee4edb54c147a95944482e998616b025642a268a) )
735   ROM_LOAD16_BYTE( "ep4",  0x0c001, 0x2000, CRC(b636e086) SHA1(5fc23a86b6051ecf6ff3f95f810f0eb471a203b0) )
736   ROM_LOAD16_BYTE( "ep8",  0x0c000, 0x2000, CRC(d7ee48b0) SHA1(d0398704d8e89f2b0a9ed05e18f7c644d1e047c0) )
1226   ROM_LOAD16_BYTE( "ep4",         0x0c001, 0x2000, CRC(b636e086) SHA1(5fc23a86b6051ecf6ff3f95f810f0eb471a203b0) )
1227   ROM_LOAD16_BYTE( "ep8",         0x0c000, 0x2000, CRC(d7ee48b0) SHA1(d0398704d8e89f2b0a9ed05e18f7c644d1e047c0) )
7371228
738   ROM_REGION( 0x10000, REGION_CPU2, 0 ) // Z80 ROMs
1229   ROM_REGION( 0x10000, REGION_CPU2, 0 ) // 8085A ROMs
7391230   ROM_LOAD( "ev1.1m", 0x00000, 0x2000, CRC(43faaf2e) SHA1(c9aaf298d673eb70399366776474f1b242549eb4) )
7401231   ROM_LOAD( "ev2.1l", 0x02000, 0x2000, CRC(09e6702d) SHA1(896771f73a486e5035909eeed9ef48103d81d4ae) )
7411232   ROM_LOAD( "ev3.1k", 0x04000, 0x2000, CRC(10ff140b) SHA1(7c28f988a9c8b2a702d007096199e67b447a183c) )
r2018r2019
7441235   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE ) // chars
7451236   ROM_LOAD( "ep9",  0x00000, 0x1000, CRC(0325be11) SHA1(d95667b439e3d97b08efeaf08022348546a4f385) )
7461237
747   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE ) // tile set1
748   ROM_LOAD_NIB_HIGH( "eb5.7h",  0x00000, 0x2000, CRC(cbef7da5) SHA1(c5fcd2341ce5b039a15116fbd85796bb5ddc4701) )
749   ROM_LOAD         ( "eb5.7h",  0x02000, 0x2000, CRC(cbef7da5) SHA1(c5fcd2341ce5b039a15116fbd85796bb5ddc4701) )
750   ROM_LOAD         ( "eb1.7f",  0x04000, 0x2000, CRC(9a236583) SHA1(fcc4da2efe904f0178bd83fdee25d4752b9cc5ce) )
751   ROM_LOAD         ( "eb2.8f",  0x06000, 0x2000, CRC(f0fb6355) SHA1(3c4c009f80e648d02767b29bb8d18f4de7b26d4e) )
1238   ROM_REGION( 0x10000, REGION_GFX2, ROMREGION_DISPOSE ) // tiles
1239   ROM_LOAD( "eb5.7h",  0x00000, 0x2000, CRC(cbef7da5) SHA1(c5fcd2341ce5b039a15116fbd85796bb5ddc4701) )
1240   // empty space to unpack previous ROM
1241   ROM_LOAD( "eb6.8h",  0x04000, 0x2000, CRC(1e5e5475) SHA1(80ebe9326c628685faafb259f956a98ac435c809) )
1242   // empty space to unpack previous ROM
1243   ROM_LOAD( "eb1.7f",  0x08000, 0x2000, CRC(9a236583) SHA1(fcc4da2efe904f0178bd83fdee25d4752b9cc5ce) )
1244   ROM_LOAD( "eb2.8f",  0x0a000, 0x2000, CRC(f0fb6355) SHA1(3c4c009f80e648d02767b29bb8d18f4de7b26d4e) )
1245   ROM_LOAD( "eb3.10f", 0x0c000, 0x2000, CRC(dbd0044b) SHA1(5611517bb0f54bfb0585eeca8af21fbfc2f65b2c) )
1246   ROM_LOAD( "eb4.11f", 0x0e000, 0x2000, CRC(f8f8e600) SHA1(c7c97e4dc1f7a73694c98b2b1a3d7fa9f3317a2a) )
7521247
753   ROM_REGION( 0x8000, REGION_GFX3, ROMREGION_DISPOSE ) // tile set2
754   ROM_LOAD_NIB_HIGH( "eb6.8h",  0x00000, 0x2000, CRC(1e5e5475) SHA1(80ebe9326c628685faafb259f956a98ac435c809) )
755   ROM_LOAD         ( "eb6.8h",  0x02000, 0x2000, CRC(1e5e5475) SHA1(80ebe9326c628685faafb259f956a98ac435c809) )
756   ROM_LOAD         ( "eb3.10f", 0x04000, 0x2000, CRC(dbd0044b) SHA1(5611517bb0f54bfb0585eeca8af21fbfc2f65b2c) )
757   ROM_LOAD         ( "eb4.11f", 0x06000, 0x2000, CRC(f8f8e600) SHA1(c7c97e4dc1f7a73694c98b2b1a3d7fa9f3317a2a) )
1248   ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE ) // sprites
1249   ROM_LOAD( "es5.5h",  0x00000, 0x2000, CRC(d5b82e6a) SHA1(956a1413426e53f8a735260e660805b04016ca8d) )
1250   // empty space to unpack previous ROM
1251   ROM_LOAD( "es6.4h",  0x04000, 0x2000, CRC(cb4f5da9) SHA1(5af8f6aca0a3bb6417430e0179ec97c33d4014e3) )
1252   // empty space to unpack previous ROM
1253   ROM_LOAD( "es1.5f",  0x08000, 0x2000, CRC(cf81a2cd) SHA1(a1b45451cafeaceabe3dfe24eb073098a33ab22b) )
1254   ROM_LOAD( "es2.4f",  0x0a000, 0x2000, CRC(ae3111d8) SHA1(d63633b531339fa04af757f42e956b8eb1debc4e) )
1255   ROM_LOAD( "es3.2f",  0x0c000, 0x2000, CRC(3d44f815) SHA1(1835aef280a6915acbf7cad771d65bf1074f0f98) )
1256   ROM_LOAD( "es4.1f",  0x0e000, 0x2000, CRC(16e6d18a) SHA1(44f9045ad034808070cd6497a3b94c3d8cc93262) )
7581257
759   ROM_REGION( 0x8000, REGION_GFX4, ROMREGION_DISPOSE ) // sprite set1
760   ROM_LOAD_NIB_HIGH( "es5.5h",     0x00000, 0x2000, CRC(d5b82e6a) SHA1(956a1413426e53f8a735260e660805b04016ca8d) )
761   ROM_LOAD         ( "es5.5h",     0x02000, 0x2000, CRC(d5b82e6a) SHA1(956a1413426e53f8a735260e660805b04016ca8d) )
762   ROM_LOAD         ( "es1.5f",     0x04000, 0x2000, CRC(cf81a2cd) SHA1(a1b45451cafeaceabe3dfe24eb073098a33ab22b) )
763   ROM_LOAD         ( "es2.4f",     0x06000, 0x2000, CRC(ae3111d8) SHA1(d63633b531339fa04af757f42e956b8eb1debc4e) )
1258   ROM_REGION( 0x0700, REGION_PROMS, 0 )
1259   ROM_LOAD( "bprom.3a",  0x0000, 0x100, CRC(2fcdf217) SHA1(4acf67d37e844c2773028ecffe72a66754ed5bca) ) // R
1260   ROM_LOAD( "bprom.1a",  0x0100, 0x100, CRC(d7e6cd1f) SHA1(ce330e43ba8a97ab79040c053a25e46e8fe60bdb) ) // G
1261   ROM_LOAD( "bprom.2a",  0x0200, 0x100, CRC(e3d106e8) SHA1(6b153eb8140d36b4d194e26106a5ba5bffd1a851) ) // B
1262   ROM_LOAD( "bprom.6b",  0x0300, 0x100, CRC(6294cddf) SHA1(c7a2854f62e31032df2b07fae3fb3b51ac6daac2) ) // CLUT(same PROM x 4)
1263   ROM_LOAD( "bprom.7b",  0x0400, 0x100, CRC(6294cddf) SHA1(c7a2854f62e31032df2b07fae3fb3b51ac6daac2) )
1264   ROM_LOAD( "bprom.9b",  0x0500, 0x100, CRC(6294cddf) SHA1(c7a2854f62e31032df2b07fae3fb3b51ac6daac2) )
1265   ROM_LOAD( "bprom.10b", 0x0600, 0x100, CRC(6294cddf) SHA1(c7a2854f62e31032df2b07fae3fb3b51ac6daac2) )
7641266
765   ROM_REGION( 0x8000, REGION_GFX5, ROMREGION_DISPOSE ) // sprite set2
766   ROM_LOAD_NIB_HIGH( "es6.4h",     0x00000, 0x2000, CRC(cb4f5da9) SHA1(5af8f6aca0a3bb6417430e0179ec97c33d4014e3) )
767   ROM_LOAD         ( "es6.4h",     0x02000, 0x2000, CRC(cb4f5da9) SHA1(5af8f6aca0a3bb6417430e0179ec97c33d4014e3) )
768   ROM_LOAD         ( "es3.2f",     0x04000, 0x2000, CRC(3d44f815) SHA1(1835aef280a6915acbf7cad771d65bf1074f0f98) )
769   ROM_LOAD         ( "es4.1f",     0x06000, 0x2000, CRC(16e6d18a) SHA1(44f9045ad034808070cd6497a3b94c3d8cc93262) )
770
771   ROM_REGION( 0x0300, REGION_PROMS, 0 ) // RGB PROMs
772   ROM_LOAD( "bprom.3a",  0x00000, 0x100, CRC(2fcdf217) SHA1(4acf67d37e844c2773028ecffe72a66754ed5bca) ) // R
773   ROM_LOAD( "bprom.1a",  0x00100, 0x100, CRC(d7e6cd1f) SHA1(ce330e43ba8a97ab79040c053a25e46e8fe60bdb) ) // G
774   ROM_LOAD( "bprom.2a",  0x00200, 0x100, CRC(e3d106e8) SHA1(6b153eb8140d36b4d194e26106a5ba5bffd1a851) ) // B
775
776   ROM_REGION( 0x0100, REGION_USER1, 0 ) // CLUT(same PROM x 4)
777   ROM_LOAD( "bprom.6b",  0x0000, 0x100, CRC(6294cddf) SHA1(c7a2854f62e31032df2b07fae3fb3b51ac6daac2) )
778   ROM_LOAD( "bprom.7b",  0x0000, 0x100, CRC(6294cddf) SHA1(c7a2854f62e31032df2b07fae3fb3b51ac6daac2) )
779   ROM_LOAD( "bprom.9b",  0x0000, 0x100, CRC(6294cddf) SHA1(c7a2854f62e31032df2b07fae3fb3b51ac6daac2) )
780   ROM_LOAD( "bprom.10b", 0x0000, 0x100, CRC(6294cddf) SHA1(c7a2854f62e31032df2b07fae3fb3b51ac6daac2) )
781
782   ROM_REGION( 0x0020, REGION_USER2, 0 ) // MSM5232 PROM?
1267   ROM_REGION( 0x0020, REGION_SOUND1, 0 )
7831268   ROM_LOAD( "bprom.3h",  0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) )
7841269ROM_END
7851270
1271/*
1272Equites
1273(c)1984 SEGA/ALPHA
1274
1275CPU   : 68000 Z-80x2
1276SOUND : AY-3-8910 MSM5232RS
1277OSC.  : 12.000MHz 14.31818MHz ?MHz
1278*/
7861279ROM_START( equitess )
7871280   ROM_REGION( 0x10000, REGION_CPU1, 0 ) // 68000 ROMs
7881281   ROM_LOAD16_BYTE( "epr-ep1.13d", 0x00001, 0x2000, CRC(c6edf1cd) SHA1(21dba62e692f4fdc79155ce169a48ae827bd5994) )
r2018r2019
7941287   ROM_LOAD16_BYTE( "epr-ep4.9d",  0x0c001, 0x2000, CRC(956a06bd) SHA1(a716f9aaf0c32c522968f4ff13de904d6e8c7f98) )
7951288   ROM_LOAD16_BYTE( "epr-ep8.9b",  0x0c000, 0x2000, CRC(4c78d60d) SHA1(207a82779e2fe3e9082f4fa09b87c713a51167e6) )
7961289
797   ROM_REGION( 0x10000, REGION_CPU2, 0 ) // Z80 ROMs
1290   ROM_REGION( 0x10000, REGION_CPU2, 0 ) // 8085A ROMs
7981291   ROM_LOAD( "ev1.1m", 0x00000, 0x2000, CRC(43faaf2e) SHA1(c9aaf298d673eb70399366776474f1b242549eb4) )
7991292   ROM_LOAD( "ev2.1l", 0x02000, 0x2000, CRC(09e6702d) SHA1(896771f73a486e5035909eeed9ef48103d81d4ae) )
8001293   ROM_LOAD( "ev3.1k", 0x04000, 0x2000, CRC(10ff140b) SHA1(7c28f988a9c8b2a702d007096199e67b447a183c) )
r2018r2019
8031296   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE ) // chars
8041297   ROM_LOAD( "epr-ep0.3e",  0x00000, 0x1000, CRC(3f5a81c3) SHA1(8fd5bc621f483bfa46be7e40e6480b25243bdf70) )
8051298
806   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE ) // tile set1
807   ROM_LOAD_NIB_HIGH( "eb5.7h",  0x00000, 0x2000, CRC(cbef7da5) SHA1(c5fcd2341ce5b039a15116fbd85796bb5ddc4701) )
808   ROM_LOAD         ( "eb5.7h",  0x02000, 0x2000, CRC(cbef7da5) SHA1(c5fcd2341ce5b039a15116fbd85796bb5ddc4701) )
809   ROM_LOAD         ( "eb1.7f",  0x04000, 0x2000, CRC(9a236583) SHA1(fcc4da2efe904f0178bd83fdee25d4752b9cc5ce) )
810   ROM_LOAD         ( "eb2.8f",  0x06000, 0x2000, CRC(f0fb6355) SHA1(3c4c009f80e648d02767b29bb8d18f4de7b26d4e) )
1299   ROM_REGION( 0x10000, REGION_GFX2, ROMREGION_DISPOSE ) // tiles
1300   ROM_LOAD( "eb5.7h",  0x00000, 0x2000, CRC(cbef7da5) SHA1(c5fcd2341ce5b039a15116fbd85796bb5ddc4701) )
1301   // empty space to unpack previous ROM
1302   ROM_LOAD( "eb6.8h",  0x04000, 0x2000, CRC(1e5e5475) SHA1(80ebe9326c628685faafb259f956a98ac435c809) )
1303   // empty space to unpack previous ROM
1304   ROM_LOAD( "eb1.7f",  0x08000, 0x2000, CRC(9a236583) SHA1(fcc4da2efe904f0178bd83fdee25d4752b9cc5ce) )
1305   ROM_LOAD( "eb2.8f",  0x0a000, 0x2000, CRC(f0fb6355) SHA1(3c4c009f80e648d02767b29bb8d18f4de7b26d4e) )
1306   ROM_LOAD( "eb3.10f", 0x0c000, 0x2000, CRC(dbd0044b) SHA1(5611517bb0f54bfb0585eeca8af21fbfc2f65b2c) )
1307   ROM_LOAD( "eb4.11f", 0x0e000, 0x2000, CRC(f8f8e600) SHA1(c7c97e4dc1f7a73694c98b2b1a3d7fa9f3317a2a) )
8111308
812   ROM_REGION( 0x8000, REGION_GFX3, ROMREGION_DISPOSE ) // tile set2
813   ROM_LOAD_NIB_HIGH( "eb6.8h",  0x00000, 0x2000, CRC(1e5e5475) SHA1(80ebe9326c628685faafb259f956a98ac435c809) )
814   ROM_LOAD         ( "eb6.8h",  0x02000, 0x2000, CRC(1e5e5475) SHA1(80ebe9326c628685faafb259f956a98ac435c809) )
815   ROM_LOAD         ( "eb3.10f", 0x04000, 0x2000, CRC(dbd0044b) SHA1(5611517bb0f54bfb0585eeca8af21fbfc2f65b2c) )
816   ROM_LOAD         ( "eb4.11f", 0x06000, 0x2000, CRC(f8f8e600) SHA1(c7c97e4dc1f7a73694c98b2b1a3d7fa9f3317a2a) )
1309   ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE ) // sprites
1310   ROM_LOAD( "es5.5h",  0x00000, 0x2000, CRC(d5b82e6a) SHA1(956a1413426e53f8a735260e660805b04016ca8d) )
1311   // empty space to unpack previous ROM
1312   ROM_LOAD( "es6.4h",  0x04000, 0x2000, CRC(cb4f5da9) SHA1(5af8f6aca0a3bb6417430e0179ec97c33d4014e3) )
1313   // empty space to unpack previous ROM
1314   ROM_LOAD( "es1.5f",  0x08000, 0x2000, CRC(cf81a2cd) SHA1(a1b45451cafeaceabe3dfe24eb073098a33ab22b) )
1315   ROM_LOAD( "es2.4f",  0x0a000, 0x2000, CRC(ae3111d8) SHA1(d63633b531339fa04af757f42e956b8eb1debc4e) )
1316   ROM_LOAD( "es3.2f",  0x0c000, 0x2000, CRC(3d44f815) SHA1(1835aef280a6915acbf7cad771d65bf1074f0f98) )
1317   ROM_LOAD( "es4.1f",  0x0e000, 0x2000, CRC(16e6d18a) SHA1(44f9045ad034808070cd6497a3b94c3d8cc93262) )
8171318
818   ROM_REGION( 0x8000, REGION_GFX4, ROMREGION_DISPOSE ) // sprite set1
819   ROM_LOAD_NIB_HIGH( "es5.5h",     0x00000, 0x2000, CRC(d5b82e6a) SHA1(956a1413426e53f8a735260e660805b04016ca8d) )
820   ROM_LOAD         ( "es5.5h",     0x02000, 0x2000, CRC(d5b82e6a) SHA1(956a1413426e53f8a735260e660805b04016ca8d) )
821   ROM_LOAD         ( "es1.5f",     0x04000, 0x2000, CRC(cf81a2cd) SHA1(a1b45451cafeaceabe3dfe24eb073098a33ab22b) )
822   ROM_LOAD         ( "es2.4f",     0x06000, 0x2000, CRC(ae3111d8) SHA1(d63633b531339fa04af757f42e956b8eb1debc4e) )
1319   ROM_REGION( 0x0700, REGION_PROMS, 0 )
1320   ROM_LOAD( "bprom.3a",  0x0000, 0x100, CRC(2fcdf217) SHA1(4acf67d37e844c2773028ecffe72a66754ed5bca) ) // R
1321   ROM_LOAD( "bprom.1a",  0x0100, 0x100, CRC(d7e6cd1f) SHA1(ce330e43ba8a97ab79040c053a25e46e8fe60bdb) ) // G
1322   ROM_LOAD( "bprom.2a",  0x0200, 0x100, CRC(e3d106e8) SHA1(6b153eb8140d36b4d194e26106a5ba5bffd1a851) ) // B
1323   ROM_LOAD( "bprom.6b",  0x0300, 0x100, CRC(6294cddf) SHA1(c7a2854f62e31032df2b07fae3fb3b51ac6daac2) ) // CLUT(same PROM x 4)
1324   ROM_LOAD( "bprom.7b",  0x0400, 0x100, CRC(6294cddf) SHA1(c7a2854f62e31032df2b07fae3fb3b51ac6daac2) )
1325   ROM_LOAD( "bprom.9b",  0x0500, 0x100, CRC(6294cddf) SHA1(c7a2854f62e31032df2b07fae3fb3b51ac6daac2) )
1326   ROM_LOAD( "bprom.10b", 0x0600, 0x100, CRC(6294cddf) SHA1(c7a2854f62e31032df2b07fae3fb3b51ac6daac2) )
8231327
824   ROM_REGION( 0x8000, REGION_GFX5, ROMREGION_DISPOSE ) // sprite set2
825   ROM_LOAD_NIB_HIGH( "es6.4h",     0x00000, 0x2000, CRC(cb4f5da9) SHA1(5af8f6aca0a3bb6417430e0179ec97c33d4014e3) )
826   ROM_LOAD         ( "es6.4h",     0x02000, 0x2000, CRC(cb4f5da9) SHA1(5af8f6aca0a3bb6417430e0179ec97c33d4014e3) )
827   ROM_LOAD         ( "es3.2f",     0x04000, 0x2000, CRC(3d44f815) SHA1(1835aef280a6915acbf7cad771d65bf1074f0f98) )
828   ROM_LOAD         ( "es4.1f",     0x06000, 0x2000, CRC(16e6d18a) SHA1(44f9045ad034808070cd6497a3b94c3d8cc93262) )
829
830   ROM_REGION( 0x0300, REGION_PROMS, 0 ) // RGB PROMs
831   ROM_LOAD( "bprom.3a",  0x00000, 0x100, CRC(2fcdf217) SHA1(4acf67d37e844c2773028ecffe72a66754ed5bca) ) // R
832   ROM_LOAD( "bprom.1a",  0x00100, 0x100, CRC(d7e6cd1f) SHA1(ce330e43ba8a97ab79040c053a25e46e8fe60bdb) ) // G
833   ROM_LOAD( "bprom.2a",  0x00200, 0x100, CRC(e3d106e8) SHA1(6b153eb8140d36b4d194e26106a5ba5bffd1a851) ) // B
834
835   ROM_REGION( 0x0100, REGION_USER1, 0 ) // CLUT(same PROM x 4)
836   ROM_LOAD( "bprom.6b",  0x0000, 0x100, CRC(6294cddf) SHA1(c7a2854f62e31032df2b07fae3fb3b51ac6daac2) )
837   ROM_LOAD( "bprom.7b",  0x0000, 0x100, CRC(6294cddf) SHA1(c7a2854f62e31032df2b07fae3fb3b51ac6daac2) )
838   ROM_LOAD( "bprom.9b",  0x0000, 0x100, CRC(6294cddf) SHA1(c7a2854f62e31032df2b07fae3fb3b51ac6daac2) )
839   ROM_LOAD( "bprom.10b", 0x0000, 0x100, CRC(6294cddf) SHA1(c7a2854f62e31032df2b07fae3fb3b51ac6daac2) )
840
841   ROM_REGION( 0x0020, REGION_USER2, 0 ) // MSM5232 PROM?
1328   ROM_REGION( 0x0020, REGION_SOUND1, 0 )
8421329   ROM_LOAD( "bprom.3h",  0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) )
8431330ROM_END
8441331
845
846
8471332/*
848
8491333Gekisou (JPN Ver.)
8501334(c)1985 Eastern
8511335
r2018r2019
8531337CPU:MC68000P8
8541338OSC:12.000MHz
8551339
8560.5C         [7e8bf4d1]
857
8581.15B        [945fd546]
8592.15D        [3c057150]
8603.14B        [7c1cf4d0]
8614.14D        [c7282391]
862
8635.16R        [88ef550a]
8646.15R        [473e3fbf]
8657.18R        [a1918b6c]
8668.8R         [2e0c392c]
8679.6R         [56a03b08]
86810.9R        [11d89c73]
869
8702N.BPR       [c7333120]
8713N.BPR       [c7333120]
8724N.BPR       [c7333120]
8735N.BPR       [c7333120]
874
8751B.BPR       [11a1c0aa]
8762B.BPR       [4f5d4141]
8774B.BPR       [c7ebe52c]
878
879
8801340SOUND BOARD NO.59 MC 07
8811341CPU  :TMP8085AP
8821342Sound:AY-3-8910A,OKI M5232,D8155HC
8831343OSC  :6.144MHz
884
885V1.1L        [dc6af437]
886V2.1H        [cb12582e]
887V3.1E        [0ab5e777]
888
8893H.BPR       [33b98466]
890
8911344*/
892
893
8941345ROM_START( gekisou )
8951346   ROM_REGION( 0x10000, REGION_CPU1, 0 ) // 68000 ROMs
8961347   ROM_LOAD16_BYTE( "1.15b", 0x00001, 0x4000, CRC(945fd546) SHA1(6045dbf11272fcec8320aacb2852d4223d0943a0) )
r2018r2019
9061357   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE ) // chars
9071358   ROM_LOAD( "0.5c",  0x00000, 0x1000, CRC(7e8bf4d1) SHA1(8abb82be006e8d1df449a5f83d59637314405119) )
9081359
909   /* GFX loading is wrong -- why do we load roms twice in other sets anyway, we shouldn't load
910       things twice unless they are on the board twice, if they're not we should expand them in
911       init functions. */
912   ROM_REGION( 0x10000, REGION_GFX2, ROMREGION_DISPOSE ) // tile set1
913//  ROM_LOAD_NIB_HIGH( "5.16r",  0x00000, 0x4000, CRC(88ef550a) SHA1(b50e7b8257d1bb6923d289e7af885c14d089b394) )
914   ROM_LOAD         ( "5.16r",  0x04000, 0x4000, CRC(88ef550a) SHA1(b50e7b8257d1bb6923d289e7af885c14d089b394) )
915   ROM_LOAD         ( "6.15r",  0x08000, 0x4000, CRC(473e3fbf) SHA1(5039387b3627c19f592d630ba7bd010a3881adc5) )
916   ROM_LOAD         ( "7.18r",  0x0c000, 0x4000, CRC(a1918b6c) SHA1(6ffa4c845d23d311b59cc19411a68a782618b3fd) )
1360   ROM_REGION( 0x10000, REGION_GFX2, ROMREGION_DISPOSE ) // tiles
1361   ROM_LOAD( "7.18r",   0x00000, 0x2000, CRC(a1918b6c) SHA1(6ffa4c845d23d311b59cc19411a68a782618b3fd) )
1362   // empty space to unpack previous ROM
1363   ROM_CONTINUE(        0x04000, 0x2000)
1364   // empty space to unpack previous ROM
1365   ROM_LOAD( "5.16r",   0x08000, 0x2000, CRC(88ef550a) SHA1(b50e7b8257d1bb6923d289e7af885c14d089b394) )
1366   ROM_CONTINUE(        0x0c000, 0x2000)
1367   ROM_LOAD( "6.15r",   0x0a000, 0x2000, CRC(473e3fbf) SHA1(5039387b3627c19f592d630ba7bd010a3881adc5) )
1368   ROM_CONTINUE(        0x0e000, 0x2000)
9171369
918   ROM_REGION( 0x8000, REGION_GFX3, ROMREGION_DISPOSE ) // tile set2
1370   ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE ) // sprites
1371   ROM_LOAD( "10.9r",   0x00000, 0x2000, CRC(11d89c73) SHA1(8753f635d321c8e9b93b0ab767cf44aca1db7a0a) )
1372   // empty space to unpack previous ROM
1373   ROM_CONTINUE(        0x04000, 0x2000)
1374   // empty space to unpack previous ROM
1375   ROM_LOAD( "8.8r",    0x08000, 0x2000, CRC(2e0c392c) SHA1(48542a24a34e3d5d00af418b29a2ee15557efc99) )
1376   ROM_CONTINUE(        0x0c000, 0x2000)
1377   ROM_LOAD( "9.6r",    0x0a000, 0x2000, CRC(56a03b08) SHA1(d90b246890fedfc437de85be8bcc6b60ff068be1) )
1378   ROM_CONTINUE(        0x0e000, 0x2000)
9191379
920   ROM_REGION( 0x10000, REGION_GFX4, ROMREGION_DISPOSE ) // sprite set1
921//  ROM_LOAD_NIB_HIGH( "8.8r",     0x00000, 0x4000, CRC(2e0c392c) SHA1(48542a24a34e3d5d00af418b29a2ee15557efc99) )
922   ROM_LOAD         ( "8.8r",     0x04000, 0x4000, CRC(2e0c392c) SHA1(48542a24a34e3d5d00af418b29a2ee15557efc99) )
923   ROM_LOAD         ( "9.6r",     0x08000, 0x4000, CRC(56a03b08) SHA1(d90b246890fedfc437de85be8bcc6b60ff068be1) )
924   ROM_LOAD         ( "10.9r",    0x0c000, 0x4000, CRC(11d89c73) SHA1(8753f635d321c8e9b93b0ab767cf44aca1db7a0a) )
1380   ROM_REGION( 0x0700, REGION_PROMS, 0 )
1381   ROM_LOAD( "1b.bpr",  0x0000, 0x100, CRC(11a1c0aa) SHA1(d007d31f68bf802c89422ea2393747ac8de94d70) ) // R
1382   ROM_LOAD( "4b.bpr",  0x0100, 0x100, CRC(c7ebe52c) SHA1(19d2ee70d67fd5e1c57f66d030ec9a5b6af5a49e) ) // G
1383   ROM_LOAD( "2b.bpr",  0x0200, 0x100, CRC(4f5d4141) SHA1(965221c6af4a868760e6d168b55e037fc5f9fa52) ) // B
1384   ROM_LOAD( "2n.bpr",  0x0300, 0x100, CRC(c7333120) SHA1(ad590e8ece3dcf56b285c4a080f4ee8bb4c9d77c) ) // CLUT(same PROM x 4)
1385   ROM_LOAD( "3n.bpr",  0x0400, 0x100, CRC(c7333120) SHA1(ad590e8ece3dcf56b285c4a080f4ee8bb4c9d77c) )
1386   ROM_LOAD( "4n.bpr",  0x0500, 0x100, CRC(c7333120) SHA1(ad590e8ece3dcf56b285c4a080f4ee8bb4c9d77c) )
1387   ROM_LOAD( "5n.bpr",  0x0600, 0x100, CRC(c7333120) SHA1(ad590e8ece3dcf56b285c4a080f4ee8bb4c9d77c) )
9251388
926   ROM_REGION( 0x8000, REGION_GFX5, ROMREGION_DISPOSE ) // sprite set2
927
928   ROM_REGION( 0x0300, REGION_PROMS, 0 ) // RGB PROMs
929   ROM_LOAD( "1b.bpr",  0x00000, 0x100, CRC(11a1c0aa) SHA1(d007d31f68bf802c89422ea2393747ac8de94d70) ) // R
930   ROM_LOAD( "2b.bpr",  0x00100, 0x100, CRC(4f5d4141) SHA1(965221c6af4a868760e6d168b55e037fc5f9fa52) ) // G
931   ROM_LOAD( "4b.bpr",  0x00200, 0x100, CRC(c7ebe52c) SHA1(19d2ee70d67fd5e1c57f66d030ec9a5b6af5a49e) ) // B
932
933   ROM_REGION( 0x0100, REGION_USER1, 0 ) // CLUT(same PROM x 4)
934   ROM_LOAD( "2n.bpr",  0x0000, 0x100, CRC(c7333120) SHA1(ad590e8ece3dcf56b285c4a080f4ee8bb4c9d77c) )
935   ROM_LOAD( "3n.bpr",  0x0000, 0x100, CRC(c7333120) SHA1(ad590e8ece3dcf56b285c4a080f4ee8bb4c9d77c) )
936   ROM_LOAD( "4n.bpr",  0x0000, 0x100, CRC(c7333120) SHA1(ad590e8ece3dcf56b285c4a080f4ee8bb4c9d77c) )
937   ROM_LOAD( "5n.bpr",  0x0000, 0x100, CRC(c7333120) SHA1(ad590e8ece3dcf56b285c4a080f4ee8bb4c9d77c) )
938
939   ROM_REGION( 0x0020, REGION_USER2, 0 ) // MSM5232 PROM?
1389   ROM_REGION( 0x0020, REGION_SOUND1, 0 )
9401390   ROM_LOAD( "3h.bpr",  0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) )
9411391ROM_END
9421392
9431393/******************************************************************************/
9441394// Koukouyakyuh ROM Map
9451395
1396/*
1397The Koukouyakyuh (JPN Ver.)
1398
1399(c)1985 Alpha denshi
1400
1401CPU   :MAIN  68000
1402       SOUND 8085
1403Sound :AY-3-8910 M3M5232RS
1404OSC   :12.000MHz 6.??MHz 14.31818MHz
1405*/
9461406ROM_START( kouyakyu )
9471407   ROM_REGION( 0x10000, REGION_CPU1, 0 )  // 68000 ROMs
9481408   ROM_LOAD16_BYTE( "epr-6704.bin", 0x00001, 0x2000, CRC(c7ac2292) SHA1(614bfb0949620d4c260768f14a116b076dd38438) )
r2018r2019
9531413   ROM_LOAD16_BYTE( "epr-6709.bin", 0x08000, 0x2000, CRC(f41cb58c) SHA1(f0d1048e949d51432739755f985e4df65b8e918b) )
9541414   ROM_FILL(                        0x0c000, 0x4000, 0 )
9551415
956   ROM_REGION( 0x10000, REGION_CPU2, 0 ) // Z80 ROMs
1416   ROM_REGION( 0x10000, REGION_CPU2, 0 ) // 8085A ROMs
9571417   ROM_LOAD( "epr-6703.bin", 0x00000, 0x2000, CRC(fbff3a86) SHA1(4ed2887b1e4509ded853a230f735d4d2aa475886) )
9581418   ROM_LOAD( "epr-6702.bin", 0x02000, 0x2000, CRC(27ddf031) SHA1(2f11d3b693e46852762669ed1e35a667990edec7) )
9591419   ROM_LOAD( "epr-6701.bin", 0x04000, 0x2000, CRC(3c83588a) SHA1(a84c813ba9d464cffc855397aaacbb9177c86fb4) )
r2018r2019
9641424   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE ) // chars
9651425   ROM_LOAD( "epr-6710.bin", 0x00000, 0x1000, CRC(accda190) SHA1(265d2fd92574d65e7890e48d5f305bf903a67bc8) )
9661426
967   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE ) // tile set1
968   ROM_LOAD_NIB_HIGH( "epr-6695.bin", 0x00000, 0x2000, CRC(22bea465) SHA1(4860d7ee3c386cdacc9c608ffe74ec8bfa58edcb) )
969   ROM_LOAD         ( "epr-6695.bin", 0x02000, 0x2000, CRC(22bea465) SHA1(4860d7ee3c386cdacc9c608ffe74ec8bfa58edcb) )
970   ROM_LOAD         ( "epr-6689.bin", 0x04000, 0x2000, CRC(53bf7587) SHA1(0046cd04d11ce789ff69e0807700a624af96eb36) )
971   ROM_LOAD         ( "epr-6688.bin", 0x06000, 0x2000, CRC(ceb76c5b) SHA1(81fa236871f10c77eb201e1c9771bd57406df15b) )
1427   ROM_REGION( 0x10000, REGION_GFX2, ROMREGION_DISPOSE ) // tiles
1428   ROM_LOAD( "epr-6695.bin", 0x00000, 0x2000, CRC(22bea465) SHA1(4860d7ee3c386cdacc9c608ffe74ec8bfa58edcb) )
1429   // empty space to unpack previous ROM
1430   ROM_LOAD( "epr-6694.bin", 0x04000, 0x2000, CRC(51a7345e) SHA1(184c890559ed633e23cb459c313e6179cc3eb542) )
1431   // empty space to unpack previous ROM
1432   ROM_LOAD( "epr-6689.bin", 0x08000, 0x2000, CRC(53bf7587) SHA1(0046cd04d11ce789ff69e0807700a624af96eb36) )
1433   ROM_LOAD( "epr-6688.bin", 0x0a000, 0x2000, CRC(ceb76c5b) SHA1(81fa236871f10c77eb201e1c9771bd57406df15b) )
1434   ROM_LOAD( "epr-6687.bin", 0x0c000, 0x2000, CRC(9c1f49df) SHA1(1a5cf5278777f829d3654e838bd2bb9f4dbb57ba) )
1435   ROM_LOAD( "epr-6686.bin", 0x0e000, 0x2000, CRC(3d9e516f) SHA1(498614821f87dbcc39edb1756e1af6b536044e6a) )
9721436
973   ROM_REGION( 0x8000, REGION_GFX3, ROMREGION_DISPOSE ) // tile set2
974   ROM_LOAD_NIB_HIGH( "epr-6694.bin", 0x00000, 0x2000, CRC(51a7345e) SHA1(184c890559ed633e23cb459c313e6179cc3eb542) )
975   ROM_LOAD         ( "epr-6694.bin", 0x02000, 0x2000, CRC(51a7345e) SHA1(184c890559ed633e23cb459c313e6179cc3eb542) )
976   ROM_LOAD         ( "epr-6687.bin", 0x04000, 0x2000, CRC(9c1f49df) SHA1(1a5cf5278777f829d3654e838bd2bb9f4dbb57ba) )
977   ROM_LOAD         ( "epr-6686.bin", 0x06000, 0x2000, CRC(3d9e516f) SHA1(498614821f87dbcc39edb1756e1af6b536044e6a) )
1437   ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE ) // sprites
1438   ROM_LOAD( "epr-6696.bin", 0x00000, 0x2000, CRC(0625f48e) SHA1(bea09ccf37f38678fb53c55bd0a79557d6c81b3f) )
1439   // empty space to unpack previous ROM
1440   ROM_LOAD( "epr-6697.bin", 0x04000, 0x2000, CRC(f18afabe) SHA1(abd7f6c0bd0de145c423166a2f4e86ccdb12b1ce) )
1441   // empty space to unpack previous ROM
1442   ROM_LOAD( "epr-6690.bin", 0x08000, 0x2000, CRC(a142a11d) SHA1(209c7e0591622434ada4445f3f8789059c5f4f77) )
1443   ROM_LOAD( "epr-6691.bin", 0x0a000, 0x2000, CRC(b640568c) SHA1(8cef1387c469abec8b488621a94cc9575d6c5fcc) )
1444   ROM_LOAD( "epr-6692.bin", 0x0c000, 0x2000, CRC(b91d8172) SHA1(8d8f6ea78ebf652f295ce96abf19e628fe777d07) )
1445   ROM_LOAD( "epr-6693.bin", 0x0e000, 0x2000, CRC(874e3acc) SHA1(29438f196811fc2c8f54b6c47f1c175e4797dd4c) )
9781446
979   ROM_REGION( 0x8000, REGION_GFX4, ROMREGION_DISPOSE ) // sprite set1
980   ROM_LOAD_NIB_HIGH( "epr-6696.bin", 0x00000, 0x2000, CRC(0625f48e) SHA1(bea09ccf37f38678fb53c55bd0a79557d6c81b3f) )
981   ROM_LOAD         ( "epr-6696.bin", 0x02000, 0x2000, CRC(0625f48e) SHA1(bea09ccf37f38678fb53c55bd0a79557d6c81b3f) )
982   ROM_LOAD         ( "epr-6690.bin", 0x04000, 0x2000, CRC(a142a11d) SHA1(209c7e0591622434ada4445f3f8789059c5f4f77) )
983   ROM_LOAD         ( "epr-6691.bin", 0x06000, 0x2000, CRC(b640568c) SHA1(8cef1387c469abec8b488621a94cc9575d6c5fcc) )
1447   ROM_REGION( 0x0700, REGION_PROMS, 0 )
1448   ROM_LOAD( "pr6627.bpr",  0x0000, 0x100, CRC(5ec5480d) SHA1(f966a277539a5d257f32692cdd92ce44b08599e8) ) // R
1449   ROM_LOAD( "pr6629.bpr",  0x0100, 0x100, CRC(29c7a393) SHA1(67cced39c0a80655c420aad668dfe836c1d7c643) ) // G
1450   ROM_LOAD( "pr6628.bpr",  0x0200, 0x100, CRC(8af247a4) SHA1(01702fbce53dd4875e4825f0487e7aed9cf212fa) ) // B
1451   ROM_LOAD( "pr6630a.bpr", 0x0300, 0x100, CRC(d6e202da) SHA1(500ebd5c95d2d2c33535d25cf7f8f649897dc224) ) // CLUT(same PROM x 4)
1452   ROM_LOAD( "pr6630b.bpr", 0x0400, 0x100, CRC(d6e202da) SHA1(500ebd5c95d2d2c33535d25cf7f8f649897dc224) )
1453   ROM_LOAD( "pr6630c.bpr", 0x0500, 0x100, CRC(d6e202da) SHA1(500ebd5c95d2d2c33535d25cf7f8f649897dc224) )
1454   ROM_LOAD( "pr6630d.bpr", 0x0600, 0x100, CRC(d6e202da) SHA1(500ebd5c95d2d2c33535d25cf7f8f649897dc224) )
9841455
985   ROM_REGION( 0x8000, REGION_GFX5, ROMREGION_DISPOSE ) // sprite set2
986   ROM_LOAD_NIB_HIGH( "epr-6697.bin", 0x00000, 0x2000, CRC(f18afabe) SHA1(abd7f6c0bd0de145c423166a2f4e86ccdb12b1ce) )
987   ROM_LOAD         ( "epr-6697.bin", 0x02000, 0x2000, CRC(f18afabe) SHA1(abd7f6c0bd0de145c423166a2f4e86ccdb12b1ce) )
988   ROM_LOAD         ( "epr-6692.bin", 0x04000, 0x2000, CRC(b91d8172) SHA1(8d8f6ea78ebf652f295ce96abf19e628fe777d07) )
989   ROM_LOAD         ( "epr-6693.bin", 0x06000, 0x2000, CRC(874e3acc) SHA1(29438f196811fc2c8f54b6c47f1c175e4797dd4c) )
990
991   ROM_REGION( 0x0300, REGION_PROMS, 0 ) // RGB PROMS
992   ROM_LOAD( "pr6627.bpr",  0x00000, 0x100, CRC(5ec5480d) SHA1(f966a277539a5d257f32692cdd92ce44b08599e8) ) // R
993   ROM_LOAD( "pr6629.bpr",  0x00100, 0x100, CRC(29c7a393) SHA1(67cced39c0a80655c420aad668dfe836c1d7c643) ) // G
994   ROM_LOAD( "pr6628.bpr",  0x00200, 0x100, CRC(8af247a4) SHA1(01702fbce53dd4875e4825f0487e7aed9cf212fa) ) // B
995
996   ROM_REGION( 0x0100, REGION_USER1, 0 ) // CLUT(same PROM x 4)
997   ROM_LOAD( "pr6630a.bpr", 0x0000, 0x100, CRC(d6e202da) SHA1(500ebd5c95d2d2c33535d25cf7f8f649897dc224) )
998   ROM_LOAD( "pr6630b.bpr", 0x0000, 0x100, CRC(d6e202da) SHA1(500ebd5c95d2d2c33535d25cf7f8f649897dc224) )
999   ROM_LOAD( "pr6630c.bpr", 0x0000, 0x100, CRC(d6e202da) SHA1(500ebd5c95d2d2c33535d25cf7f8f649897dc224) )
1000   ROM_LOAD( "pr6630d.bpr", 0x0000, 0x100, CRC(d6e202da) SHA1(500ebd5c95d2d2c33535d25cf7f8f649897dc224) )
1001
1002   ROM_REGION( 0x0020, REGION_USER2, 0 ) // MSM5232 PROM?(identical to bprom.3h in Equites)
1456   ROM_REGION( 0x0020, REGION_SOUND1, 0 )
10031457   ROM_LOAD( "pr.bpr",      0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) )
10041458ROM_END
10051459
r2018r2019
10161470   ROM_LOAD16_BYTE( "hp7vr.bin",  0x08000, 0x2000, CRC(665cc015) SHA1(17fe18c8f22808a102f48bc4cbc8e4a1f6f9eaf1) )
10171471   ROM_FILL(                      0x0c000, 0x4000, 0 )
10181472
1019   ROM_REGION( 0x10000, REGION_CPU2, 0 ) // Z80 ROMs
1473   ROM_REGION( 0x10000, REGION_CPU2, 0 ) // 8085A ROMs
10201474   ROM_LOAD( "hv1vr.bin", 0x00000, 0x2000, CRC(2a8e6fcf) SHA1(866903408e05938a982ffef4c9b849203c6cc060) )
10211475   ROM_LOAD( "hv2vr.bin", 0x02000, 0x2000, CRC(026e1533) SHA1(6271869a3faaafacfac35262746e87a83c158b93) )
10221476   ROM_LOAD( "hv3vr.bin", 0x04000, 0x2000, CRC(51ee751c) SHA1(60bf848dfdfe313ab05df5a5c05819b0fa87ca50) )
r2018r2019
10251479   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE ) // chars
10261480   ROM_LOAD( "h.bin", 0x000000, 0x1000, CRC(c6894c9a) SHA1(0d5a55cded4fd833211bdc733a78c6c8423897de) )
10271481
1028   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE ) // tile set1
1029   ROM_LOAD_NIB_HIGH( "hb5vr.bin",  0x00000, 0x2000, CRC(6d05e9f2) SHA1(4b5c92b72bf73a08a2359fe889a327a696a45e8a) )
1030   ROM_LOAD         ( "hb5vr.bin",  0x02000, 0x2000, CRC(6d05e9f2) SHA1(4b5c92b72bf73a08a2359fe889a327a696a45e8a) )
1031   ROM_LOAD         ( "hb1vr.bin",  0x04000, 0x2000, CRC(4352d069) SHA1(bac687f050837b023da00cb53bb524b2a76310d4) )
1032   ROM_LOAD         ( "hb2vr.bin",  0x06000, 0x2000, CRC(24edfd7d) SHA1(be8a40d8d5ccff06f37c1ab67341f56e41a5ea88) )
1482   ROM_REGION( 0x10000, REGION_GFX2, ROMREGION_DISPOSE ) // tiles
1483   ROM_LOAD( "hb5vr.bin",  0x00000, 0x2000, CRC(6d05e9f2) SHA1(4b5c92b72bf73a08a2359fe889a327a696a45e8a) )
1484   // empty space to unpack previous ROM
1485   ROM_LOAD( "hb6vr.bin",  0x04000, 0x2000, CRC(016340ae) SHA1(f980d39337c711a15520388967ca4503e7970e18) )
1486   // empty space to unpack previous ROM
1487   ROM_LOAD( "hb1vr.bin",  0x08000, 0x2000, CRC(4352d069) SHA1(bac687f050837b023da00cb53bb524b2a76310d4) )
1488   ROM_LOAD( "hb2vr.bin",  0x0a000, 0x2000, CRC(24edfd7d) SHA1(be8a40d8d5ccff06f37c1ab67341f56e41a5ea88) )
1489   ROM_LOAD( "hb3vr.bin",  0x0c000, 0x2000, CRC(4947114e) SHA1(822dc3f14b71dc9e5b69078aefbed6b438aa0690) )
1490   ROM_LOAD( "hb4vr.bin",  0x0e000, 0x2000, CRC(fa296cb3) SHA1(2ba864766655cb3dd2999a6cdf96dcefd6818135) )
10331491
1034   ROM_REGION( 0x8000, REGION_GFX3, ROMREGION_DISPOSE ) // tile set2
1035   ROM_LOAD_NIB_HIGH( "hb6vr.bin",  0x00000, 0x2000, CRC(016340ae) SHA1(f980d39337c711a15520388967ca4503e7970e18) )
1036   ROM_LOAD         ( "hb6vr.bin",  0x02000, 0x2000, CRC(016340ae) SHA1(f980d39337c711a15520388967ca4503e7970e18) )
1037   ROM_LOAD         ( "hb3vr.bin",  0x04000, 0x2000, CRC(4947114e) SHA1(822dc3f14b71dc9e5b69078aefbed6b438aa0690) )
1038   ROM_LOAD         ( "hb4vr.bin",  0x06000, 0x2000, CRC(fa296cb3) SHA1(2ba864766655cb3dd2999a6cdf96dcefd6818135) )
1492   ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE ) // sprites
1493   ROM_LOAD( "hs5vr.bin",  0x00000, 0x2000, CRC(48394389) SHA1(a5c6021b60226a775b2052909e8d21b5f79d9ec5) )
1494   // empty space to unpack previous ROM
1495   ROM_LOAD( "hs6vr.bin",  0x04000, 0x2000, CRC(141409ec) SHA1(3cc542fa34fdbd71e392c7c22da5d5120642be86) )
1496   // empty space to unpack previous ROM
1497   ROM_LOAD( "hs1vr.bin",  0x08000, 0x2000, CRC(7c69b473) SHA1(abc181b4e5b3f48c667a0bb4814c3818dfc6e9e2) )
1498   ROM_LOAD( "hs2vr.bin",  0x0a000, 0x2000, CRC(c3dc713f) SHA1(c2072cc71ea61e0c718c339bda1460d93343469e) )
1499   ROM_LOAD( "hs3vr.bin",  0x0c000, 0x2000, CRC(883f93fd) SHA1(a96df701f82e62582522953830049d29bcb3d458) )
1500   ROM_LOAD( "hs4vr.bin",  0x0e000, 0x2000, CRC(578ace7b) SHA1(933e85d49db7b27fd85e4713f0984612bc29e134) )
10391501
1040   ROM_REGION( 0x8000, REGION_GFX4, ROMREGION_DISPOSE ) // sprite set1
1041   ROM_LOAD_NIB_HIGH( "hs5vr.bin",  0x00000, 0x2000, CRC(48394389) SHA1(a5c6021b60226a775b2052909e8d21b5f79d9ec5) )
1042   ROM_LOAD         ( "hs5vr.bin",  0x02000, 0x2000, CRC(48394389) SHA1(a5c6021b60226a775b2052909e8d21b5f79d9ec5) )
1043   ROM_LOAD         ( "hs1vr.bin",  0x04000, 0x2000, CRC(7c69b473) SHA1(abc181b4e5b3f48c667a0bb4814c3818dfc6e9e2) )
1044   ROM_LOAD         ( "hs2vr.bin",  0x06000, 0x2000, CRC(c3dc713f) SHA1(c2072cc71ea61e0c718c339bda1460d93343469e) )
1502   ROM_REGION( 0x0700, REGION_PROMS, 0 )
1503   ROM_LOAD( "24s10n.a3",  0x0000, 0x100, CRC(e8a9d159) SHA1(d015149a39adcb5fc6d12d9afe7820ecef480039) ) // R
1504   ROM_LOAD( "24s10n.a1",  0x0100, 0x100, CRC(3956af86) SHA1(ccbb69535ece5e228622907d17c959b195b97a0a) ) // G
1505   ROM_LOAD( "24s10n.a2",  0x0200, 0x100, CRC(f50f8ec5) SHA1(ec2d934618e25e3471153f9fe7b34f978b113a47) ) // B
1506   ROM_LOAD( "24s10n.b6",  0x0300, 0x100, CRC(8835a069) SHA1(bc8d4130d4fa0f16bb2511ac66b84d53218042a3) ) // CLUT(same PROM x 4)
1507   ROM_LOAD( "24s10n.b7",  0x0400, 0x100, CRC(8835a069) SHA1(bc8d4130d4fa0f16bb2511ac66b84d53218042a3) )
1508   ROM_LOAD( "24s10n.b9",  0x0500, 0x100, CRC(8835a069) SHA1(bc8d4130d4fa0f16bb2511ac66b84d53218042a3) )
1509   ROM_LOAD( "24s10n.b10", 0x0600, 0x100, CRC(8835a069) SHA1(bc8d4130d4fa0f16bb2511ac66b84d53218042a3) )
10451510
1046   ROM_REGION( 0x8000, REGION_GFX5, ROMREGION_DISPOSE ) // sprite set2
1047   ROM_LOAD_NIB_HIGH( "hs6vr.bin",  0x00000, 0x2000, CRC(141409ec) SHA1(3cc542fa34fdbd71e392c7c22da5d5120642be86) )
1048   ROM_LOAD         ( "hs6vr.bin",  0x02000, 0x2000, CRC(141409ec) SHA1(3cc542fa34fdbd71e392c7c22da5d5120642be86) )
1049   ROM_LOAD         ( "hs3vr.bin",  0x04000, 0x2000, CRC(883f93fd) SHA1(a96df701f82e62582522953830049d29bcb3d458) )
1050   ROM_LOAD         ( "hs4vr.bin",  0x06000, 0x2000, CRC(578ace7b) SHA1(933e85d49db7b27fd85e4713f0984612bc29e134) )
1511   ROM_REGION( 0x0020, REGION_SOUND1, 0 )
1512   ROM_LOAD( "18s030.h3",  0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) )
1513ROM_END
10511514
1052   ROM_REGION( 0x0300, REGION_PROMS, 0 ) // RGB PROMs
1053   ROM_LOAD( "24s10n.a3", 0x00000, 0x100, CRC(e8a9d159) SHA1(d015149a39adcb5fc6d12d9afe7820ecef480039) )
1054   ROM_LOAD( "24s10n.a1", 0x00100, 0x100, CRC(3956af86) SHA1(ccbb69535ece5e228622907d17c959b195b97a0a) )
1055   ROM_LOAD( "24s10n.a2", 0x00200, 0x100, CRC(f50f8ec5) SHA1(ec2d934618e25e3471153f9fe7b34f978b113a47) )
1515/*
1516Bull Fighter
10561517
1057   ROM_REGION( 0x0100, REGION_USER1, 0 ) // CLUT(same PROM x 4)
1058   ROM_LOAD( "24s10n.b6",  0x0000, 0x100, CRC(8835a069) SHA1(bc8d4130d4fa0f16bb2511ac66b84d53218042a3) )
1059   ROM_LOAD( "24s10n.b7",  0x0000, 0x100, CRC(8835a069) SHA1(bc8d4130d4fa0f16bb2511ac66b84d53218042a3) )
1060   ROM_LOAD( "24s10n.b9",  0x0000, 0x100, CRC(8835a069) SHA1(bc8d4130d4fa0f16bb2511ac66b84d53218042a3) )
1061   ROM_LOAD( "24s10n.b10", 0x0000, 0x100, CRC(8835a069) SHA1(bc8d4130d4fa0f16bb2511ac66b84d53218042a3) )
1518Upper board (Sound)
1519-------------------
1520All roms 2764
15211 prom TBP18S030
1522CPU 8085, AY-3-8910, 8155, 5232
10621523
1063   ROM_REGION( 0x0020, REGION_USER2, 0 ) // MSM5232 PROMs?(identical to bprom.3h in Equites)
1064   ROM_LOAD( "18s030.h3",  0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) )
1065ROM_END
1524Midle board
1525-----------
1526Chips named M_xxx
10661527
1528e3 = 2732
1529All other roms 2764
1530A1- A3 TBP24S030 PROM
1531
1532CPU 68000
1533Special chip:
1534Alpha 8303 44801B42
1535
1536Lower board
1537-----------
1538Chips named L_xxx
1539All roms 2764
1540All Proms TBP24S10
1541*/
10671542ROM_START( bullfgts )
10681543   ROM_REGION( 0x10000, REGION_CPU1, 0 ) // 68000 ROMs
10691544   ROM_LOAD16_BYTE( "m_d13.bin",  0x00001, 0x2000, CRC(7c35dd4b) SHA1(6bd604ee32c0c5db17f90e24aa254ec7072d27dd) )
r2018r2019
10741549   ROM_LOAD16_BYTE( "m_b10.bin",  0x08000, 0x2000, CRC(9d84f678) SHA1(32584d54788cb570bd5210992836f28ba9c87aac) )
10751550   ROM_FILL(                      0x0c000, 0x4000, 0 )
10761551
1077   ROM_REGION( 0x10000, REGION_CPU2, 0 ) // Z80 ROMs
1552   ROM_REGION( 0x10000, REGION_CPU2, 0 ) // 8085A ROMs
10781553   ROM_LOAD( "hv1vr.bin", 0x00000, 0x2000, CRC(2a8e6fcf) SHA1(866903408e05938a982ffef4c9b849203c6cc060) )
10791554   ROM_LOAD( "hv2vr.bin", 0x02000, 0x2000, CRC(026e1533) SHA1(6271869a3faaafacfac35262746e87a83c158b93) )
10801555   ROM_LOAD( "hv3vr.bin", 0x04000, 0x2000, CRC(51ee751c) SHA1(60bf848dfdfe313ab05df5a5c05819b0fa87ca50) )
r2018r2019
10831558   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE ) // chars
10841559   ROM_LOAD( "h.bin", 0x000000, 0x1000, CRC(c6894c9a) SHA1(0d5a55cded4fd833211bdc733a78c6c8423897de) )
10851560
1086   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE ) // tile set1
1087   ROM_LOAD_NIB_HIGH( "hb5vr.bin",  0x00000, 0x2000, CRC(6d05e9f2) SHA1(4b5c92b72bf73a08a2359fe889a327a696a45e8a) )
1088   ROM_LOAD         ( "hb5vr.bin",  0x02000, 0x2000, CRC(6d05e9f2) SHA1(4b5c92b72bf73a08a2359fe889a327a696a45e8a) )
1089   ROM_LOAD         ( "hb1vr.bin",  0x04000, 0x2000, CRC(4352d069) SHA1(bac687f050837b023da00cb53bb524b2a76310d4) )
1090   ROM_LOAD         ( "hb2vr.bin",  0x06000, 0x2000, CRC(24edfd7d) SHA1(be8a40d8d5ccff06f37c1ab67341f56e41a5ea88) )
1561   ROM_REGION( 0x10000, REGION_GFX2, ROMREGION_DISPOSE ) // tiles
1562   ROM_LOAD( "hb5vr.bin",  0x00000, 0x2000, CRC(6d05e9f2) SHA1(4b5c92b72bf73a08a2359fe889a327a696a45e8a) )
1563   // empty space to unpack previous ROM
1564   ROM_LOAD( "hb6vr.bin",  0x04000, 0x2000, CRC(016340ae) SHA1(f980d39337c711a15520388967ca4503e7970e18) )
1565   // empty space to unpack previous ROM
1566   ROM_LOAD( "hb1vr.bin",  0x08000, 0x2000, CRC(4352d069) SHA1(bac687f050837b023da00cb53bb524b2a76310d4) )
1567   ROM_LOAD( "hb2vr.bin",  0x0a000, 0x2000, CRC(24edfd7d) SHA1(be8a40d8d5ccff06f37c1ab67341f56e41a5ea88) )
1568   ROM_LOAD( "hb3vr.bin",  0x0c000, 0x2000, CRC(4947114e) SHA1(822dc3f14b71dc9e5b69078aefbed6b438aa0690) )
1569   ROM_LOAD( "hb4vr.bin",  0x0e000, 0x2000, CRC(fa296cb3) SHA1(2ba864766655cb3dd2999a6cdf96dcefd6818135) )
10911570
1092   ROM_REGION( 0x8000, REGION_GFX3, ROMREGION_DISPOSE ) // tile set2
1093   ROM_LOAD_NIB_HIGH( "hb6vr.bin",  0x00000, 0x2000, CRC(016340ae) SHA1(f980d39337c711a15520388967ca4503e7970e18) )
1094   ROM_LOAD         ( "hb6vr.bin",  0x02000, 0x2000, CRC(016340ae) SHA1(f980d39337c711a15520388967ca4503e7970e18) )
1095   ROM_LOAD         ( "hb3vr.bin",  0x04000, 0x2000, CRC(4947114e) SHA1(822dc3f14b71dc9e5b69078aefbed6b438aa0690) )
1096   ROM_LOAD         ( "hb4vr.bin",  0x06000, 0x2000, CRC(fa296cb3) SHA1(2ba864766655cb3dd2999a6cdf96dcefd6818135) )
1571   ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE ) // sprites
1572   ROM_LOAD( "hs5vr.bin",  0x00000, 0x2000, CRC(48394389) SHA1(a5c6021b60226a775b2052909e8d21b5f79d9ec5) )
1573   // empty space to unpack previous ROM
1574   ROM_LOAD( "hs6vr.bin",  0x04000, 0x2000, CRC(141409ec) SHA1(3cc542fa34fdbd71e392c7c22da5d5120642be86) )
1575   // empty space to unpack previous ROM
1576   ROM_LOAD( "hs1vr.bin",  0x08000, 0x2000, CRC(7c69b473) SHA1(abc181b4e5b3f48c667a0bb4814c3818dfc6e9e2) )
1577   ROM_LOAD( "hs2vr.bin",  0x0a000, 0x2000, CRC(c3dc713f) SHA1(c2072cc71ea61e0c718c339bda1460d93343469e) )
1578   ROM_LOAD( "hs3vr.bin",  0x0c000, 0x2000, CRC(883f93fd) SHA1(a96df701f82e62582522953830049d29bcb3d458) )
1579   ROM_LOAD( "hs4vr.bin",  0x0e000, 0x2000, CRC(578ace7b) SHA1(933e85d49db7b27fd85e4713f0984612bc29e134) )
10971580
1098   ROM_REGION( 0x8000, REGION_GFX4, ROMREGION_DISPOSE ) // sprite set1
1099   ROM_LOAD_NIB_HIGH( "hs5vr.bin",  0x00000, 0x2000, CRC(48394389) SHA1(a5c6021b60226a775b2052909e8d21b5f79d9ec5) )
1100   ROM_LOAD         ( "hs5vr.bin",  0x02000, 0x2000, CRC(48394389) SHA1(a5c6021b60226a775b2052909e8d21b5f79d9ec5) )
1101   ROM_LOAD         ( "hs1vr.bin",  0x04000, 0x2000, CRC(7c69b473) SHA1(abc181b4e5b3f48c667a0bb4814c3818dfc6e9e2) )
1102   ROM_LOAD         ( "hs2vr.bin",  0x06000, 0x2000, CRC(c3dc713f) SHA1(c2072cc71ea61e0c718c339bda1460d93343469e) )
1581   ROM_REGION( 0x0700, REGION_PROMS, 0 )
1582   ROM_LOAD( "24s10n.a3",  0x0000, 0x100, CRC(e8a9d159) SHA1(d015149a39adcb5fc6d12d9afe7820ecef480039) ) // R
1583   ROM_LOAD( "24s10n.a1",  0x0100, 0x100, CRC(3956af86) SHA1(ccbb69535ece5e228622907d17c959b195b97a0a) ) // G
1584   ROM_LOAD( "24s10n.a2",  0x0200, 0x100, CRC(f50f8ec5) SHA1(ec2d934618e25e3471153f9fe7b34f978b113a47) ) // B
1585   ROM_LOAD( "24s10n.b6",  0x0300, 0x100, CRC(8835a069) SHA1(bc8d4130d4fa0f16bb2511ac66b84d53218042a3) ) // CLUT(same PROM x 4)
1586   ROM_LOAD( "24s10n.b7",  0x0400, 0x100, CRC(8835a069) SHA1(bc8d4130d4fa0f16bb2511ac66b84d53218042a3) )
1587   ROM_LOAD( "24s10n.b9",  0x0500, 0x100, CRC(8835a069) SHA1(bc8d4130d4fa0f16bb2511ac66b84d53218042a3) )
1588   ROM_LOAD( "24s10n.b10", 0x0600, 0x100, CRC(8835a069) SHA1(bc8d4130d4fa0f16bb2511ac66b84d53218042a3) )
11031589
1104   ROM_REGION( 0x8000, REGION_GFX5, ROMREGION_DISPOSE ) // sprite set2
1105   ROM_LOAD_NIB_HIGH( "hs6vr.bin",  0x00000, 0x2000, CRC(141409ec) SHA1(3cc542fa34fdbd71e392c7c22da5d5120642be86) )
1106   ROM_LOAD         ( "hs6vr.bin",  0x02000, 0x2000, CRC(141409ec) SHA1(3cc542fa34fdbd71e392c7c22da5d5120642be86) )
1107   ROM_LOAD         ( "hs3vr.bin",  0x04000, 0x2000, CRC(883f93fd) SHA1(a96df701f82e62582522953830049d29bcb3d458) )
1108   ROM_LOAD         ( "hs4vr.bin",  0x06000, 0x2000, CRC(578ace7b) SHA1(933e85d49db7b27fd85e4713f0984612bc29e134) )
1109
1110   ROM_REGION( 0x0300, REGION_PROMS, 0 ) // RGB PROMs
1111   ROM_LOAD( "24s10n.a3", 0x00000, 0x100, CRC(e8a9d159) SHA1(d015149a39adcb5fc6d12d9afe7820ecef480039) )
1112   ROM_LOAD( "24s10n.a1", 0x00100, 0x100, CRC(3956af86) SHA1(ccbb69535ece5e228622907d17c959b195b97a0a) )
1113   ROM_LOAD( "24s10n.a2", 0x00200, 0x100, CRC(f50f8ec5) SHA1(ec2d934618e25e3471153f9fe7b34f978b113a47) )
1114
1115   ROM_REGION( 0x0100, REGION_USER1, 0 ) // CLUT(same PROM x 4)
1116   ROM_LOAD( "24s10n.b6",  0x0000, 0x100, CRC(8835a069) SHA1(bc8d4130d4fa0f16bb2511ac66b84d53218042a3) )
1117   ROM_LOAD( "24s10n.b7",  0x0000, 0x100, CRC(8835a069) SHA1(bc8d4130d4fa0f16bb2511ac66b84d53218042a3) )
1118   ROM_LOAD( "24s10n.b9",  0x0000, 0x100, CRC(8835a069) SHA1(bc8d4130d4fa0f16bb2511ac66b84d53218042a3) )
1119   ROM_LOAD( "24s10n.b10", 0x0000, 0x100, CRC(8835a069) SHA1(bc8d4130d4fa0f16bb2511ac66b84d53218042a3) )
1120
1121   ROM_REGION( 0x0020, REGION_USER2, 0 ) // MSM5232 PROMs?(identical to bprom.3h in Equites)
1590   ROM_REGION( 0x0020, REGION_SOUND1, 0 )
11221591   ROM_LOAD( "18s030.h3",  0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) )
11231592ROM_END
11241593
11251594/******************************************************************************/
11261595// Splendor Blast ROM Map
11271596
1597/*
1598Splendor Blast (JPN Ver.)
1599(c)1985 Alpha denshi
1600
1601ALPHA 68K24
1602CPU  :HD68000-8
1603OSC  :24.000MHz
1604Other:ALPHA-8303
1605
1606SOUND BOARD NO.59 MC 07
1607CPU  :TMP8085AP
1608Sound:AY-3-8910A,OKI M5232,M5L8155P
1609OSC  :6.144MHz
1610*/
11281611ROM_START( splndrbt )
11291612   ROM_REGION( 0x10000, REGION_CPU1, 0 ) // 68000 ROMs(16k x 4)
11301613   ROM_LOAD16_BYTE( "1.16a", 0x00001, 0x4000, CRC(4bf4b047) SHA1(ef0efffa2f49905e17e4ed3a03cac419793b26d1) )
r2018r2019
11321615   ROM_LOAD16_BYTE( "3.15a", 0x08001, 0x4000, CRC(5b182189) SHA1(50ebb1fddcb6838442e8a20261f200f3386ce8a8) )
11331616   ROM_LOAD16_BYTE( "4.15c", 0x08000, 0x4000, CRC(cde99613) SHA1(250b59f75eee84442da3cc7c599d1e16f0294df9) )
11341617
1135   ROM_REGION( 0x10000, REGION_CPU2, 0 ) // Z80 ROMs(8k x 4)
1618   ROM_REGION( 0x10000, REGION_CPU2, 0 ) // 8085A ROMs
11361619   ROM_LOAD( "1_v.1m", 0x00000, 0x2000, CRC(1b3a6e42) SHA1(41a4f0503c939ec0a739c8bc6bf3c8fc354912ee) )
11371620   ROM_LOAD( "2_v.1l", 0x02000, 0x2000, CRC(2a618c72) SHA1(6ad459d94352c317150ae6344d4db9bb613938dd) )
11381621   ROM_LOAD( "3_v.1k", 0x04000, 0x2000, CRC(bbee5346) SHA1(753cb784b04f081fa1f8590dc28056d9918f313b) )
11391622   ROM_LOAD( "4_v.1h", 0x06000, 0x2000, CRC(10f45af4) SHA1(00fa599bad8bf3ba6deee54165f381403096e8f9) )
11401623
1141   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE ) // 512 chars(8k x 1)
1624   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )   // chars
11421625   ROM_LOAD( "10.8c",  0x00000, 0x2000, CRC(501887d4) SHA1(3cf4401d6fddff1500066219a71ac3b30ecbdd28) )
11431626
1144   ROM_REGION( 0x4000, REGION_GFX2, ROMREGION_DISPOSE ) // 256 tiles(16k x 1)
1627   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE )   // tiles
11451628   ROM_LOAD( "8.14m",  0x00000, 0x4000, CRC(c2c86621) SHA1(a715c70ace98502f2c0d4a81539cd79d19e9b6c4) )
1629   ROM_LOAD( "9.12m",  0x04000, 0x4000, CRC(4f7da6ff) SHA1(0516271df4a36d6ea38d1b8a5e471e1d2a79e8c1) )
11461630
1147   ROM_REGION( 0x4000, REGION_GFX3, ROMREGION_DISPOSE ) // 256 tiles(16k x 1)
1148   ROM_LOAD( "9.12m",  0x00000, 0x4000, CRC(4f7da6ff) SHA1(0516271df4a36d6ea38d1b8a5e471e1d2a79e8c1) )
1631   ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE )   // sprites
1632   ROM_LOAD( "6.18n", 0x00000, 0x2000, CRC(aa72237f) SHA1(0a26746a6c448a7fb853ef708e2bdeb76edd99cf) )
1633   // empty space to unpack previous ROM
1634   ROM_CONTINUE(      0x04000, 0x2000 )
1635   // empty space to unpack previous ROM
1636   ROM_LOAD( "5.18m", 0x08000, 0x4000, CRC(5f618b39) SHA1(2891067e71b8e1183ee5741487faa1561316cade) )
1637   ROM_LOAD( "7.17m", 0x0c000, 0x4000, CRC(abdd8483) SHA1(df8c8338c24fa487c49b01ce26db7eb28c8c6b85) )
11491638
1150   ROM_REGION( 0x10000, REGION_GFX4, ROMREGION_DISPOSE ) // 256 sprites
1151   ROM_LOAD_NIB_HIGH( "6.18n", 0x00000, 0x2000, CRC(aa72237f) SHA1(0a26746a6c448a7fb853ef708e2bdeb76edd99cf) )
1152   ROM_CONTINUE     (          0x04000, 0x2000 )
1153   ROM_LOAD         ( "6.18n", 0x02000, 0x2000, CRC(aa72237f) SHA1(0a26746a6c448a7fb853ef708e2bdeb76edd99cf) )
1154   ROM_CONTINUE     (          0x06000, 0x2000 )
1155   ROM_LOAD         ( "5.18m", 0x08000, 0x4000, CRC(5f618b39) SHA1(2891067e71b8e1183ee5741487faa1561316cade) )
1156   ROM_LOAD         ( "7.17m", 0x0c000, 0x4000, CRC(abdd8483) SHA1(df8c8338c24fa487c49b01ce26db7eb28c8c6b85) )
1639   ROM_REGION( 0x0500, REGION_PROMS, 0 )
1640   ROM_LOAD( "r.3a",   0x0000, 0x100, CRC(ca1f08ce) SHA1(e46e2850d3ee3c8cbb23c10645f07d406c7ff50b) ) // R
1641   ROM_LOAD( "g.1a",   0x0100, 0x100, CRC(66f89177) SHA1(caa51c1bf071764d5089487342794cbf023136c0) ) // G
1642   ROM_LOAD( "b.2a",   0x0200, 0x100, CRC(d14318bc) SHA1(e219963b3e40eb246e608fbe10daa85dbb4c1226) ) // B
1643   ROM_LOAD( "2.8k",   0x0300, 0x100, CRC(e1770ad3) SHA1(e408b175b8fff934e07b0ded1ee21d7f91a9523d) ) // CLUT bg
1644   ROM_LOAD( "s5.15p", 0x0400, 0x100, CRC(7f6cf709) SHA1(5938faf937b682dcc83e53444cbf5e0bd7741363) ) // CLUT sprites
11571645
1158   ROM_REGION( 0x0300, REGION_PROMS, 0 ) // RGB PROMs
1159   ROM_LOAD( "r.3a",   0x00000, 0x100, CRC(ca1f08ce) SHA1(e46e2850d3ee3c8cbb23c10645f07d406c7ff50b) ) // R
1160   ROM_LOAD( "g.1a",   0x00100, 0x100, CRC(66f89177) SHA1(caa51c1bf071764d5089487342794cbf023136c0) ) // G
1161   ROM_LOAD( "b.2a",   0x00200, 0x100, CRC(d14318bc) SHA1(e219963b3e40eb246e608fbe10daa85dbb4c1226) ) // B
1646   ROM_REGION( 0x0020, REGION_SOUND1, 0 )
1647   ROM_LOAD( "3h.bpr", 0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) )
11621648
1163   ROM_REGION( 0x0500, REGION_USER1, 0 ) // CLUT(256bytes x 5)
1164   ROM_LOAD( "2.8k",   0x00000, 0x100, CRC(e1770ad3) SHA1(e408b175b8fff934e07b0ded1ee21d7f91a9523d) )
1165   ROM_LOAD( "s5.15p", 0x00100, 0x100, CRC(7f6cf709) SHA1(5938faf937b682dcc83e53444cbf5e0bd7741363) )
1166   ROM_LOAD( "s3.8l",  0x00200, 0x100, CRC(1314b0b5) SHA1(31ef4b916110581390afc1ba90c5dca7c08c619f) ) // unknown
1167   ROM_LOAD( "1.9j",   0x00300, 0x100, CRC(f5b9b777) SHA1(a4ec731be77306db6baf319391c4fe78517fe43e) ) // unknown
1168   ROM_LOAD( "4.7m",   0x00400, 0x100, CRC(12cbcd2c) SHA1(a7946820bbf3f7e110a328b673123988af97ce7e) ) // unknown
1649   ROM_REGION( 0x2100, REGION_USER1, 0 ) // bg scaling
1650   ROM_LOAD( "0.8h",   0x0000, 0x2000, CRC(12681fb5) SHA1(7a0930819d4cd00475d1897128daa6ac865e07d0) ) // x
1651   ROM_LOAD( "1.9j",   0x2000, 0x0100, CRC(f5b9b777) SHA1(a4ec731be77306db6baf319391c4fe78517fe43e) ) // y
11691652
1170   ROM_REGION( 0x2000, REGION_USER2, 0 ) // unknown(8k x 1)
1171   ROM_LOAD( "0.8h",   0x00000, 0x2000, CRC(12681fb5) SHA1(7a0930819d4cd00475d1897128daa6ac865e07d0) )
1172
1173   ROM_REGION( 0x0020, REGION_USER3, 0 ) // MSM5232 PROMs?(identical to bprom.3h in Equites)
1174   ROM_LOAD( "3h.bpr", 0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) )
1653   ROM_REGION( 0x0200, REGION_USER2, 0 ) // sprite scaling
1654   ROM_LOAD( "4.7m",   0x0000, 0x0100, CRC(12cbcd2c) SHA1(a7946820bbf3f7e110a328b673123988af97ce7e) ) // x
1655   ROM_LOAD( "s3.8l",  0x0100, 0x0100, CRC(1314b0b5) SHA1(31ef4b916110581390afc1ba90c5dca7c08c619f) ) // y
11751656ROM_END
11761657
11771658/******************************************************************************/
11781659// High Voltage ROM Map
11791660
1661/*
1662High Voltage (JPN Ver.)
1663(c)1985 Alpha denshi
1664
1665ALPHA 68K24
1666CPU  :HD68000-8
1667OSC  :24.000MHz
1668Other:ALPHA-8304
1669
1670SOUND BOARD NO.59 MC 07
1671CPU  :TMP8085AP
1672Sound:AY-3-8910A,OKI M5232,D8155HC
1673OSC  :6.144MHz
1674*/
11801675ROM_START( hvoltage )
11811676   ROM_REGION( 0x10000, REGION_CPU1, 0 ) // 68000 ROMs(16k x 4)
11821677   ROM_LOAD16_BYTE( "1.16a", 0x00001, 0x4000, CRC(82606e3b) SHA1(25c3172928d8f1eda2c4c757d505fdfd91f21ea1) )
r2018r2019
11841679   ROM_LOAD16_BYTE( "3.15a", 0x08001, 0x4000, CRC(677abe14) SHA1(78b343122f9ad187c823bf49e8f001288c762586) )
11851680   ROM_LOAD16_BYTE( "4.15c", 0x08000, 0x4000, CRC(8aab5a20) SHA1(fb90817173ad69c0e00d03814b4e10b18955c07e) )
11861681
1187   ROM_REGION( 0x10000, REGION_CPU2, 0 ) // Z80 ROMs(8k x 3)
1682   ROM_REGION( 0x10000, REGION_CPU2, 0 ) // 8085A ROMs
11881683   ROM_LOAD( "5_v.1l", 0x00000, 0x4000, CRC(ed9bb6ea) SHA1(73b0251b86835368ec2a4e98a5f61e28e58fd234) )
11891684   ROM_LOAD( "6_v.1h", 0x04000, 0x4000, CRC(e9542211) SHA1(482f2c90e842fe5cc31cc6a39025adf65ba47ce9) )
11901685   ROM_LOAD( "7_v.1e", 0x08000, 0x4000, CRC(44d38554) SHA1(6765971376eafa218fda1accb1e173a7c1850cc8) )
11911686
1192   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE ) // 512 chars(8k x 1)
1687   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE ) // chars
11931688   ROM_LOAD( "5.8c",   0x00000, 0x2000, CRC(656d53cd) SHA1(9971ed7e7da0e8bf46e97e8f75a2c2201b33fc2f) )
11941689
1195   ROM_REGION( 0x4000, REGION_GFX2, ROMREGION_DISPOSE ) // 256 tiles(16k x 1)
1690   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE ) // tiles
11961691   ROM_LOAD( "9.14m",  0x00000, 0x4000, CRC(506a0989) SHA1(0e7f2c9bab5e83f06a8148f69d8d0cbfe7d55c5e) )
1692   ROM_LOAD( "10.12m", 0x04000, 0x4000, CRC(98f87d4f) SHA1(94a7a14b0905597993595b347102436d97fc1dc9) )
11971693
1198   ROM_REGION( 0x4000, REGION_GFX3, ROMREGION_DISPOSE ) // 256 tiles(16k x 1)
1199   ROM_LOAD( "10.12m", 0x00000, 0x4000, CRC(98f87d4f) SHA1(94a7a14b0905597993595b347102436d97fc1dc9) )
1694   ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE ) // sprites
1695   ROM_LOAD( "8.18n", 0x00000, 0x2000, CRC(725acae5) SHA1(ba54598a087f8bb5fa7182b0e85d0e038003e622) )
1696   // empty space to unpack previous ROM
1697   ROM_CONTINUE(      0x04000, 0x2000 )
1698   // empty space to unpack previous ROM
1699   ROM_LOAD( "6.18m", 0x08000, 0x4000, CRC(9baf2c68) SHA1(208e5ac8eb157d4bf949ab4330827da032a04235) )
1700   ROM_LOAD( "7.17m", 0x0c000, 0x4000, CRC(12d25fb1) SHA1(99f5d68bd6d6ee5f2acb7685aceacfb0894c4961) )
12001701
1201   ROM_REGION( 0x10000, REGION_GFX4, ROMREGION_DISPOSE ) // 256 sprites
1202   ROM_LOAD_NIB_HIGH( "8.18n", 0x00000, 0x2000, CRC(725acae5) SHA1(ba54598a087f8bb5fa7182b0e85d0e038003e622) )
1203   ROM_CONTINUE     (          0x04000, 0x2000 )
1204   ROM_LOAD         ( "8.18n", 0x02000, 0x2000, CRC(725acae5) SHA1(ba54598a087f8bb5fa7182b0e85d0e038003e622) )
1205   ROM_CONTINUE     (          0x06000, 0x2000 )
1206   ROM_LOAD         ( "6.18m", 0x08000, 0x4000, CRC(9baf2c68) SHA1(208e5ac8eb157d4bf949ab4330827da032a04235) )
1207   ROM_LOAD         ( "7.17m", 0x0c000, 0x4000, CRC(12d25fb1) SHA1(99f5d68bd6d6ee5f2acb7685aceacfb0894c4961) )
1702   ROM_REGION( 0x0500, REGION_PROMS, 0 )
1703   ROM_LOAD( "r.3a",   0x0000, 0x100, CRC(98eccbf6) SHA1(a55755e8388d3edf3020b1129a638fe1e99362b6) ) // R
1704   ROM_LOAD( "g.1a",   0x0100, 0x100, CRC(fab2ed23) SHA1(6f63b6a3196dda76eb9a885b17d886a14365f922) ) // G
1705   ROM_LOAD( "b.2a",   0x0200, 0x100, CRC(7274961b) SHA1(d13070060e216d633675a528cf0dc3de94c95ffb) ) // B
1706   ROM_LOAD( "2.8k",   0x0300, 0x100, CRC(685f4e44) SHA1(110cb8f5a37f22ce9d391bd0cd46dcbb8fcf66b8) ) // CLUT bg
1707   ROM_LOAD( "s5.15p", 0x0400, 0x100, CRC(b09bcc73) SHA1(f8139feaa9563324b69aeac5c17beccfdbfa0864) ) // CLUT sprites
12081708
1209   ROM_REGION( 0x0300, REGION_PROMS, 0 ) // RGB PROMs
1210   ROM_LOAD( "r.3a",   0x00000, 0x100, CRC(98eccbf6) SHA1(a55755e8388d3edf3020b1129a638fe1e99362b6) ) // R
1211   ROM_LOAD( "g.1a",   0x00100, 0x100, CRC(fab2ed23) SHA1(6f63b6a3196dda76eb9a885b17d886a14365f922) ) // G
1212   ROM_LOAD( "b.2a",   0x00200, 0x100, CRC(7274961b) SHA1(d13070060e216d633675a528cf0dc3de94c95ffb) ) // B
1709   ROM_REGION( 0x0020, REGION_SOUND1, 0 )
1710   ROM_LOAD( "3h.bpr", 0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) )
12131711
1214   ROM_REGION( 0x0500, REGION_USER1, 0 ) // CLUT(256bytes x 5)
1215   ROM_LOAD( "2.8k",   0x00000, 0x100, CRC(685f4e44) SHA1(110cb8f5a37f22ce9d391bd0cd46dcbb8fcf66b8) )
1216   ROM_LOAD( "s5.15p", 0x00100, 0x100, CRC(b09bcc73) SHA1(f8139feaa9563324b69aeac5c17beccfdbfa0864) )
1217   ROM_LOAD( "3.8l",   0x00200, 0x100, CRC(1314b0b5) SHA1(31ef4b916110581390afc1ba90c5dca7c08c619f) ) // unknown(identical to s3.8l in Splendor Blast)
1218   ROM_LOAD( "1.9j",   0x00300, 0x100, CRC(f5b9b777) SHA1(a4ec731be77306db6baf319391c4fe78517fe43e) ) // unknown(identical to 1.9j in Splendor Blast)
1219   ROM_LOAD( "4.7m",   0x00400, 0x100, CRC(12cbcd2c) SHA1(a7946820bbf3f7e110a328b673123988af97ce7e) ) // unknown(identical to 4.7m in Splendor Blast)
1712   ROM_REGION( 0x2100, REGION_USER1, 0 ) // bg scaling
1713   ROM_LOAD( "0.8h",   0x0000, 0x2000, CRC(12681fb5) SHA1(7a0930819d4cd00475d1897128daa6ac865e07d0) ) // x
1714   ROM_LOAD( "1.9j",   0x2000, 0x0100, CRC(f5b9b777) SHA1(a4ec731be77306db6baf319391c4fe78517fe43e) ) // y
12201715
1221   ROM_REGION( 0x2000, REGION_USER2, 0 ) // unknown(8k x 1, identical to 0.8h in Splendor Blast )
1222   ROM_LOAD( "0.8h",   0x00000, 0x2000, CRC(12681fb5) SHA1(7a0930819d4cd00475d1897128daa6ac865e07d0) )
1223
1224   ROM_REGION( 0x0020, REGION_USER3, 0 ) // MSM5232 PROMs?(identical to bprom.3h in Equites)
1225   ROM_LOAD( "3h.bpr", 0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) )
1716   ROM_REGION( 0x0200, REGION_USER2, 0 ) // sprite scaling
1717   ROM_LOAD( "4.7m",   0x0000, 0x0100, CRC(12cbcd2c) SHA1(a7946820bbf3f7e110a328b673123988af97ce7e) ) // x
1718   ROM_LOAD( "3.8l",   0x0100, 0x0100, CRC(1314b0b5) SHA1(31ef4b916110581390afc1ba90c5dca7c08c619f) ) // y
12261719ROM_END
12271720
12281721/******************************************************************************/
12291722// Initializations
12301723
1231static void equites_init_common(void)
1724static void unpack_block(int region, int offset, int size)
12321725{
1233   equites_flip = 0;
1726   UINT8 *rom = memory_region(region);
1727   int i;
12341728
1235   equites_8404init();
1729   for (i = 0; i < size; ++i)
1730   {
1731      rom[(offset + i + size)] = (rom[(offset + i)] >> 4);
1732      rom[(offset + i)] &= 0x0f;
1733   }
12361734}
12371735
1238static void splndrbt_init_common(void)
1736static void unpack_region(int region)
12391737{
1240   equites_8404init();
1738   unpack_block(region, 0x0000, 0x2000);
1739   unpack_block(region, 0x4000, 0x2000);
12411740}
12421741
1742
12431743static DRIVER_INIT( equites )
12441744{
1245   equites_id = 0x8400;
1246
1247   equites_init_common();
1248
1249   equites_8404rule(0x094a, 0x007, 0x04); // 8404 test
1250   equites_8404rule(0x094e, 0x049, 0x00); // 8404 test
1251
1252   equites_8404rule(0x0c76, 0x00b, 0x04); // death
1253   equites_8404rule(0x0c7e, 0x0cf, 0x0c); // 2nd jmp hi
1254   equites_8404rule(0x0c84, 0x0d1, 0xae); // 2nd jmp lo
1255   equites_8404rule(0x0c8c, 0x0d3, 0x0c); // 1st jmp hi
1256   equites_8404rule(0x0c92, 0x0d5, 0x9c); // 1st jmp lo
1257
1258   equites_8404rule(0x92a6, 0x00f, 0x04); // respawn
1259   equites_8404rule(0x92b0, 0x27d,-0x40); // 2nd jmp hi
1260   equites_8404rule(0x92b6, 0x27f,-0x04); // 2nd jmp lo
1261   equites_8404rule(0x92b0, 0x281,-0x50); // 1st jmp hi
1262   equites_8404rule(0x92b6, 0x283,-0x05); // 1st jmp lo
1263
1264   equites_8404rule(0x8f06, 0x013, 0x04); // ENT
1265   equites_8404rule(0x8f0c, 0x481,-0x10); // ENT jmpaddr hi
1266   equites_8404rule(0x8f12, 0x483,-0x01); // ENT jmpaddr lo
1267
1268   equites_8404rule(0x915e, 0x017, 0x04); // EXT
1269   equites_8404rule(0x9164, 0x47d,-0x20); // scroll y
1270   equites_8404rule(0x916a, 0x47f,-0x02); // player y
1271   equites_8404rule(0x9170, 0x481,-0x30); // exit location hi
1272   equites_8404rule(0x9176, 0x483,-0x03); // exit location lo
1745   unpack_region(REGION_GFX2);
1746   unpack_region(REGION_GFX3);
12731747}
12741748
12751749static DRIVER_INIT( bullfgtr )
12761750{
1277   equites_id = 0x8401;
1278
1279   equites_init_common();
1280
1281   equites_8404rule(0x0e7a, 0x601, 0x00); // boot up
1282   equites_8404rule(0x3dc4, 0x201, 0x0c); // goal in
1751   unpack_region(REGION_GFX2);
1752   unpack_region(REGION_GFX3);
12831753}
12841754
1285static DRIVER_INIT( bullfgts )
1755static DRIVER_INIT( kouyakyu )
12861756{
1287   equites_id = 0x8401;
1288
1289   equites_init_common();
1290
1291   equites_8404rule(0x0e7a, 0x601, 0x00); // boot up
1292   equites_8404rule(0x3da4, 0x201, 0x0c); // goal in
1757   unpack_region(REGION_GFX2);
1758   unpack_region(REGION_GFX3);
12931759}
12941760
1295static DRIVER_INIT( kouyakyu )
1761static DRIVER_INIT( gekisou )
12961762{
1297   equites_id = 0x8500;
1763   UINT16 *rom = (UINT16 *)memory_region(REGION_CPU1);
12981764
1299   equites_init_common();
1765   unpack_region(REGION_GFX2);
1766   unpack_region(REGION_GFX3);
13001767
1301   equites_8404rule(0x5582, 0x603, 0x05); // home run
1768   // FIXME - patch input check
1769   rom[0x8b0>>1] = 0x4e71;
1770   rom[0x8d4>>1] = 0x4e71;
1771   rom[0xb3a>>1] = 0x4e71;
1772   rom[0xb3c>>1] = 0x4e71;
1773   // patch ROM checksum test too
1774   rom[0x4b4>>1] = 0x4e71;
1775   rom[0x4b6>>1] = 0x4e71;
1776   rom[0x4bc>>1] = 0x4e71;
1777   rom[0x4be>>1] = 0x4e71;
13021778}
13031779
13041780static DRIVER_INIT( splndrbt )
13051781{
1306   equites_id = 0x8510;
1307
1308   splndrbt_init_common();
1309
1310   equites_8404rule(0x06f8, 0x007, 0x04); // 8404 test
1311   equites_8404rule(0x06fc, 0x049, 0x00); // 8404 test
1312
1313   equites_8404rule(0x12dc, 0x01b, 0x04); // guard point
1314   equites_8404rule(0x12e4, 0x01f, 0x04); // guard point
1315
1316   equites_8404rule(0x0dc2, 0x00b, 0x04); // guard point (start race)
1317   equites_8404rule(0x0dd4, 0x5e1, 0x00); // no. of addresses to look up - 1
1318   equites_8404rule(0x0dd8, 0x5e3, 0x0c); // race start/respawn addr hi
1319   equites_8404rule(0x0dde, 0x5e5, 0x32); // race start/respawn addr lo
1320
1321   equites_8404rule(0x1268, 0x023, 0x04); // guard point
1322
1323   equites_8404rule(0x1298, 0x25f,-0x0c); // stage number?
1324
1325   // game params. (180261-18027f)->(40060-4006f)
1326   equites_8404rule(0x12a0, 0x261, 0x0a); // max speed hi
1327   equites_8404rule(0x12a0, 0x263, 0x00); // max speed lo
1328   equites_8404rule(0x12a0, 0x265, 0x00); // accel hi
1329   equites_8404rule(0x12a0, 0x267, 0x10); // accel lo
1330   equites_8404rule(0x12a0, 0x269, 0x0c); // max turbo speed hi
1331   equites_8404rule(0x12a0, 0x26b, 0x00); // max turbo speed lo
1332   equites_8404rule(0x12a0, 0x26d, 0x00); // turbo accel hi
1333   equites_8404rule(0x12a0, 0x26f, 0x20); // turbo accel lo
1334   equites_8404rule(0x12a0, 0x271,-0x09); // random enemy spwan list
1335   equites_8404rule(0x12a0, 0x273,-0x09); // .
1336   equites_8404rule(0x12a0, 0x275,-0x09); // .
1337   equites_8404rule(0x12a0, 0x277,-0x09); // .
1338   equites_8404rule(0x12a0, 0x279,-0x09); // .
1339   equites_8404rule(0x12a0, 0x27b,-0x09); // .
1340   equites_8404rule(0x12a0, 0x27d,-0x09); // .
1341   equites_8404rule(0x12a0, 0x27f,-0x09); // .
1342
1343   equites_8404rule(0x500e, 0x281,-0x08); // power-up's (random?)
1344   equites_8404rule(0x500e, 0x283,-0x08); // power-up's (random?)
1345
1346   equites_8404rule(0x132e, 0x285,-0xa0); // object spawn table addr hi
1347   equites_8404rule(0x1334, 0x287,-0x0a); // object spawn table addr lo
1348
1349   equites_8404rule(0x739a, 0x289,-0xb0); // level section table addr hi
1350   equites_8404rule(0x73a0, 0x28b,-0x0b); // level section table addr lo
1351
1352   equites_8404rule(0x0912, 0x017, 0x04); // guard point
1353   equites_8404rule(0x0b4c, 0x013, 0x04); // guard point
1354
1355   equites_8404rule(0x0bfc, 0x00f, 0x04); // guard point (miss/no gas/end level)
1356   equites_8404rule(0x0c08, 0x5e1, 0x05); // no. of addresses to look up - 1
1357   equites_8404rule(0x0c0c, 0x5e3,-0x70); // game over/respawn addr hi
1358   equites_8404rule(0x0c12, 0x5e5,-0x07); // game over/respawn addr lo
1359   equites_8404rule(0x0c0c, 0x5e7,-0x70); // game over/respawn addr hi
1360   equites_8404rule(0x0c12, 0x5e9,-0x07); // game over/respawn addr lo
1361   equites_8404rule(0x0c0c, 0x5eb,-0x70); // game over/respawn addr hi
1362   equites_8404rule(0x0c12, 0x5ed,-0x07); // game over/respawn addr lo
1363   equites_8404rule(0x0c0c, 0x5ef,-0x70); // game over/respawn addr hi
1364   equites_8404rule(0x0c12, 0x5f1,-0x07); // game over/respawn addr lo
1365   equites_8404rule(0x0c0c, 0x5f3,-0x70); // game over/respawn addr hi
1366   equites_8404rule(0x0c12, 0x5f5,-0x07); // game over/respawn addr lo
1367   equites_8404rule(0x0c0c, 0x5f7,-0x70); // game over/respawn addr hi
1368   equites_8404rule(0x0c12, 0x5f9,-0x07); // game over/respawn addr lo
1782   unpack_region(REGION_GFX3);
13691783}
13701784
13711785static DRIVER_INIT( hvoltage )
13721786{
1373   int i;
1787   unpack_region(REGION_GFX3);
13741788
1375#if HVOLTAGE_HACK
1789#if HVOLTAGE_DEBUG
13761790   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x000038, 0x000039, 0, 0, hvoltage_debug_r);
13771791#endif
1378
1379   equites_id = 0x8511;
1380
1381   splndrbt_init_common();
1382
1383   equites_8404rule(0x0b18, 0x007, 0x04); // 8404 test
1384   equites_8404rule(0x0b1c, 0x049, 0x00); // 8404 test
1385
1386   for(i=0x07; i<0x47; i+=4) equites_8404rule(0x0c64, i, 0xff); // checksum
1387
1388   equites_8404rule(0x0df6, 0x00f, 0x04); // 1st gateway (init)
1389   equites_8404rule(0x0e02, 0x247, 0x01); // no. of addresses to look up - 1
1390   equites_8404rule(0x0e06, 0x249, 0x10); // addr hi
1391   equites_8404rule(0x0e0c, 0x24b, 0x12); // addr lo
1392   equites_8404rule(0x0e06, 0x24d, 0x19); // addr hi
1393   equites_8404rule(0x0e0c, 0x24f, 0x96); // addr lo
1394
1395   equites_8404rule(0x10fc, 0x017, 0x04); // 2nd gateway (intro)
1396   equites_8404rule(0x111e, 0x6a5, 0x00); // no. of addresses to look up - 1
1397   equites_8404rule(0x1122, 0x6a7, 0x11); // addr hi
1398   equites_8404rule(0x1128, 0x6a9, 0xa4); // addr lo
1399
1400   equites_8404rule(0x0f86, 0x013, 0x04); // 3rd gateway (miss)
1401   equites_8404rule(0x0f92, 0x491, 0x03); // no. of addresses to look up - 1
1402   equites_8404rule(0x0f96, 0x493,-0x60); // addr hi
1403   equites_8404rule(0x0f9c, 0x495,-0x06); // addr lo
1404   equites_8404rule(0x0f96, 0x497,-0x60); // addr hi
1405   equites_8404rule(0x0f9c, 0x499,-0x06); // addr lo
1406   equites_8404rule(0x0f96, 0x49b,-0x60); // addr hi
1407   equites_8404rule(0x0f9c, 0x49d,-0x06); // addr lo
1408   equites_8404rule(0x0f96, 0x49f,-0x60); // addr hi
1409   equites_8404rule(0x0f9c, 0x4a1,-0x06); // addr lo
14101792}
14111793
14121794/******************************************************************************/
r2018r2019
14141796// Game Entries
14151797
14161798// Equites Hardware
1417GAME( 1984, equites,  0,        equites,  equites,  equites,  ROT90, "Alpha Denshi Co.",                "Equites", GAME_UNEMULATED_PROTECTION | GAME_NO_COCKTAIL )
1418GAME( 1984, equitess, equites,  equites,  equites,  equites,  ROT90, "Alpha Denshi Co. (Sega license)", "Equites (Sega)", GAME_UNEMULATED_PROTECTION | GAME_NO_COCKTAIL )
1419GAME( 1985, gekisou,  0,        equites,  equites,  equites,  ROT90, "Eastern",                         "Gekisou (Japan)", GAME_UNEMULATED_PROTECTION | GAME_NO_COCKTAIL | GAME_NOT_WORKING )
1420GAME( 1984, bullfgtr, 0,        equites,  bullfgtr, bullfgtr, ROT90, "Alpha Denshi Co.",                "Bull Fighter", GAME_UNEMULATED_PROTECTION )
1421GAME( 1984, bullfgts, bullfgtr, equites,  bullfgtr, bullfgts, ROT90, "Alpha Denshi Co. (Sega license)", "Bull Fighter (Sega)", GAME_UNEMULATED_PROTECTION )
1422GAME( 1985, kouyakyu, 0,        equites,  kouyakyu, kouyakyu, ROT0,  "Alpha Denshi Co.",                "The Koukouyakyuh", GAME_UNEMULATED_PROTECTION )
1799GAME( 1984, equites,  0,        equites,  equites,  equites,  ROT90, "Alpha Denshi Co.",                "Equites", GAME_IMPERFECT_SOUND )
1800GAME( 1984, equitess, equites,  equites,  equites,  equites,  ROT90, "Alpha Denshi Co. (Sega license)", "Equites (Sega)", GAME_IMPERFECT_SOUND )
1801GAME( 1985, gekisou,  0,        equites,  gekisou,  gekisou,  ROT90, "Eastern Corp.",                   "Gekisou (Japan)", GAME_NO_COCKTAIL | GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
1802GAME( 1984, bullfgtr, 0,        equites,  bullfgtr, bullfgtr, ROT90, "Alpha Denshi Co.",                "Bull Fighter", GAME_IMPERFECT_SOUND )
1803GAME( 1984, bullfgts, bullfgtr, equites,  bullfgtr, bullfgtr, ROT90, "Alpha Denshi Co. (Sega license)", "Bull Fighter (Sega)", GAME_IMPERFECT_SOUND )
1804GAME( 1985, kouyakyu, 0,        equites,  kouyakyu, kouyakyu, ROT0,  "Alpha Denshi Co.",                "The Koukouyakyuh", GAME_IMPERFECT_SOUND )
14231805
14241806// Splendor Blast Hardware
1425GAME( 1985, splndrbt, 0,        splndrbt, splndrbt, splndrbt, ROT0,  "Alpha Denshi Co.", "Splendor Blast", GAME_UNEMULATED_PROTECTION | GAME_NO_COCKTAIL )
1426GAME( 1985, hvoltage, 0,        splndrbt, hvoltage, hvoltage, ROT0,  "Alpha Denshi Co.", "High Voltage", GAME_UNEMULATED_PROTECTION )
1807GAME( 1985, splndrbt, 0,        splndrbt, splndrbt, splndrbt, ROT0,  "Alpha Denshi Co.", "Splendor Blast", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
1808GAME( 1985, hvoltage, 0,        splndrbt, hvoltage, hvoltage, ROT0,  "Alpha Denshi Co.", "High Voltage", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
14271809
14281810/******************************************************************************/
src/mame/drivers/mystwarr.c
r2018r2019
11661166   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
11671167   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM ready (always 1) */
11681168   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )
1169   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
1169   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
11701170   PORT_DIPNAME( 0x10, 0x00, "Sound Output")
11711171   PORT_DIPSETTING(    0x10, DEF_STR( Mono ))
11721172   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ))
src/mame/drivers/m57.c
r2018r2019
198198static const gfx_layout spritelayout =
199199{
200200   16,32,
201   RGN_FRAC(1,3),
201   RGN_FRAC(1,6),
202202   3,
203203   { RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3) },
204204   { STEP8(0,1), STEP8(16*8,1) },
src/mame/drivers/thunderj.c
r2018r2019
5959static MACHINE_RESET( thunderj )
6060{
6161   atarigen_eeprom_reset();
62   atarigen_interrupt_reset(update_interrupts);
6263   atarivc_reset(machine->primary_screen, atarivc_eof_data, 2);
63   atarigen_interrupt_reset(update_interrupts);
6464   atarijsa_reset();
6565
6666   rom_base[0] = (UINT16 *)memory_region(REGION_CPU1);
src/mame/drivers/buggychl.c
r2018r2019
473473
474474   MDRV_SOUND_ADD(MSM5232, 2000000)
475475   MDRV_SOUND_CONFIG(msm5232_interface)
476   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
476   MDRV_SOUND_ROUTE(0, "mono", 1.0)   // pin 28  2'-1
477   MDRV_SOUND_ROUTE(1, "mono", 1.0)   // pin 29  4'-1
478   MDRV_SOUND_ROUTE(2, "mono", 1.0)   // pin 30  8'-1
479   MDRV_SOUND_ROUTE(3, "mono", 1.0)   // pin 31 16'-1
480   MDRV_SOUND_ROUTE(4, "mono", 1.0)   // pin 36  2'-2
481   MDRV_SOUND_ROUTE(5, "mono", 1.0)   // pin 35  4'-2
482   MDRV_SOUND_ROUTE(6, "mono", 1.0)   // pin 34  8'-2
483   MDRV_SOUND_ROUTE(7, "mono", 1.0)   // pin 33 16'-2
484   // pin 1 SOLO  8'       not mapped
485   // pin 2 SOLO 16'       not mapped
486   // pin 22 Noise Output  not mapped
477487MACHINE_DRIVER_END
478488
479489/***************************************************************************
src/mame/drivers/ddragon.c
r2018r2019
146146   int vcount = scanline_to_vcount(scanline);
147147
148148   /* update to the current point */
149   video_screen_update_partial(machine->primary_screen, scanline - 1);
149   if (scanline > 0)
150      video_screen_update_partial(machine->primary_screen, scanline - 1);
150151
151152   /* on the rising edge of VBLK (vcount == F8), signal an NMI */
152153   if (vcount == 0xf8)
src/mame/drivers/timeplt.c
r2018r2019
4545***************************************************************************/
4646
4747#include "driver.h"
48#include "deprecat.h"
4948#include "timeplt.h"
5049#include "audio/timeplt.h"
5150
r2018r2019
5453
5554
5655
57static UINT8 irq_enable;
56static UINT8 nmi_enable;
5857
5958
6059/*************************************
r2018r2019
6564
6665static MACHINE_START( timeplt )
6766{
68   state_save_register_global(irq_enable);
67   state_save_register_global(nmi_enable);
6968}
7069
7170
7271static INTERRUPT_GEN( timeplt_interrupt )
7372{
74   if (irq_enable)
73   if (nmi_enable)
7574      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE);
7675}
7776
7877
79static WRITE8_HANDLER( irq_enable_w )
78static WRITE8_HANDLER( timeplt_nmi_enable_w )
8079{
81   irq_enable = data & 1;
82   if (!irq_enable)
83      cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
80   nmi_enable = data & 1;
81   if (!nmi_enable)
82      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
8483}
8584
8685
r2018r2019
10099
101100/*************************************
102101 *
102 *  Power Surge protection
103 *
104 *************************************/
105
106static READ8_HANDLER( psurge_protection_r )
107{
108   return 0x80;
109}
110
111
112
113/*************************************
114 *
103115 *  Memory maps
104116 *
117 *  Power Surge has no NMI enable
118 *  but has a protection check
119 *
105120 *************************************/
106121
107static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
122static ADDRESS_MAP_START( timeplt_main_map, ADDRESS_SPACE_PROGRAM, 8 )
108123   ADDRESS_MAP_UNMAP_HIGH
109124   AM_RANGE(0x0000, 0x5fff) AM_ROM
110125   AM_RANGE(0xa000, 0xa3ff) AM_READWRITE(SMH_RAM, timeplt_colorram_w) AM_BASE(&colorram)
r2018r2019
114129   AM_RANGE(0xb400, 0xb4ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(&spriteram_2)
115130   AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0cff) AM_WRITE(soundlatch_w)
116131   AM_RANGE(0xc200, 0xc200) AM_MIRROR(0x0cff) AM_WRITE(watchdog_reset_w)
117   AM_RANGE(0xc300, 0xc300) AM_MIRROR(0x0cf1) AM_WRITE(irq_enable_w)
132   AM_RANGE(0xc300, 0xc300) AM_MIRROR(0x0cf1) AM_WRITE(timeplt_nmi_enable_w)
118133   AM_RANGE(0xc302, 0xc302) AM_MIRROR(0x0cf1) AM_WRITE(timeplt_flipscreen_w)
119134   AM_RANGE(0xc304, 0xc304) AM_MIRROR(0x0cf1) AM_WRITE(timeplt_sh_irqtrigger_w)
120135   AM_RANGE(0xc30a, 0xc30c) AM_MIRROR(0x0cf1) AM_WRITE(timeplt_coin_counter_w)
r2018r2019
127142ADDRESS_MAP_END
128143
129144
145static ADDRESS_MAP_START( psurge_main_map, ADDRESS_SPACE_PROGRAM, 8 )
146   ADDRESS_MAP_UNMAP_HIGH
147   AM_RANGE(0x0000, 0x5fff) AM_ROM
148   AM_RANGE(0x6004, 0x6004) AM_READ(psurge_protection_r)
149   AM_RANGE(0xa000, 0xa3ff) AM_READWRITE(SMH_RAM, timeplt_colorram_w) AM_BASE(&colorram)
150   AM_RANGE(0xa400, 0xa7ff) AM_READWRITE(SMH_RAM, timeplt_videoram_w) AM_BASE(&videoram)
151   AM_RANGE(0xa800, 0xafff) AM_RAM
152   AM_RANGE(0xb000, 0xb0ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(&spriteram)
153   AM_RANGE(0xb400, 0xb4ff) AM_MIRROR(0x0b00) AM_RAM AM_BASE(&spriteram_2)
154   AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0cff) AM_WRITE(soundlatch_w)
155   AM_RANGE(0xc200, 0xc200) AM_MIRROR(0x0cff) AM_WRITE(watchdog_reset_w)
156   AM_RANGE(0xc302, 0xc302) AM_MIRROR(0x0cf1) AM_WRITE(timeplt_flipscreen_w)
157   AM_RANGE(0xc304, 0xc304) AM_MIRROR(0x0cf1) AM_WRITE(timeplt_sh_irqtrigger_w)
158   AM_RANGE(0xc30a, 0xc30c) AM_MIRROR(0x0cf1) AM_WRITE(timeplt_coin_counter_w)
159   AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0cff) AM_READ(timeplt_scanline_r)
160   AM_RANGE(0xc200, 0xc200) AM_MIRROR(0x0cff) AM_READ_PORT("DSW1")
161   AM_RANGE(0xc300, 0xc300) AM_MIRROR(0x0c9f) AM_READ_PORT("IN0")
162   AM_RANGE(0xc320, 0xc320) AM_MIRROR(0x0c9f) AM_READ_PORT("IN1")
163   AM_RANGE(0xc340, 0xc340) AM_MIRROR(0x0c9f) AM_READ_PORT("IN2")
164   AM_RANGE(0xc360, 0xc360) AM_MIRROR(0x0c9f) AM_READ_PORT("DSW0")
165ADDRESS_MAP_END
130166
167
168
131169/*************************************
132170 *
133171 *  Port definitions
r2018r2019
321359static MACHINE_DRIVER_START( timeplt )
322360
323361   /* basic machine hardware */
324   MDRV_CPU_ADD(Z80, MASTER_CLOCK/3/2)   /* not confirmed, but common for Konami games of the era */
325   MDRV_CPU_PROGRAM_MAP(main_map,0)
362   MDRV_CPU_ADD_TAG("main", Z80, MASTER_CLOCK/3/2)   /* not confirmed, but common for Konami games of the era */
363   MDRV_CPU_PROGRAM_MAP(timeplt_main_map,0)
326364   MDRV_CPU_VBLANK_INT("main", timeplt_interrupt)
327365
328366   MDRV_MACHINE_START(timeplt)
r2018r2019
348386MACHINE_DRIVER_END
349387
350388
389static MACHINE_DRIVER_START( psurge )
390   MDRV_IMPORT_FROM(timeplt)
351391
392   /* basic machine hardware */
393   MDRV_CPU_MODIFY("main")
394   MDRV_CPU_PROGRAM_MAP(psurge_main_map,0)
395   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
396
397   MDRV_MACHINE_START(NULL)
398MACHINE_DRIVER_END
399
400
401
352402/*************************************
353403 *
354404 *  ROM definitions
r2018r2019
484534GAME( 1982, timepltc, timeplt, timeplt, timeplt, 0, ROT90,  "Konami (Centuri license)", "Time Pilot (Centuri)", GAME_SUPPORTS_SAVE )
485535GAME( 1982, timeplta, timeplt, timeplt, timeplt, 0, ROT90,  "Konami (Atari license)", "Time Pilot (Atari)", GAME_SUPPORTS_SAVE )
486536GAME( 1982, spaceplt, timeplt, timeplt, timeplt, 0, ROT90,  "bootleg", "Space Pilot", GAME_SUPPORTS_SAVE )
487GAME( 1988, psurge,   0,       timeplt, psurge,  0, ROT270, "<unknown>", "Power Surge", GAME_SUPPORTS_SAVE )
537GAME( 1988, psurge,   0,       psurge, psurge,  0, ROT270, "<unknown>", "Power Surge", GAME_SUPPORTS_SAVE )
src/mame/drivers/relief.c
r2018r2019
8585static MACHINE_RESET( relief )
8686{
8787   atarigen_eeprom_reset();
88   atarigen_interrupt_reset(update_interrupts);
8889   atarivc_reset(machine->primary_screen, atarivc_eof_data, 2);
89   atarigen_interrupt_reset(update_interrupts);
9090
9191   OKIM6295_set_bank_base(0, 0);
9292   ym2413_volume = 15;
src/mame/drivers/champbas.c
r2018r2019
55driver by Nicola Salmoria
66ALPHA 8201 MCU handling by Tatsuyuki satoh
77
8Note: the Champion Baseball II unofficial schematics show a 8302 instead of
9the 8201, however the MCU is used like a plain 8201, 830x extra instructions
10are not used.
11
812TODO:
913  champbb2 , sometime mcu err and ACCESS VIOLATION trap.
1014
r2018r2019
5256c000(-dfff) DAC
5357e000-e3ff   RAM
5458
59
60Notes:
61------
62- Bit 2 of the watchdog counter can be read through an input port. The games check
63  it on boot and hang if it is not 0. Also, the Talbot MCU does a security check
64  and crashes if the bit doesn't match bit 2 of RAM location 0x8c00.
65
5566***************************************************************************/
5667
5768#include "driver.h"
r2018r2019
6071#include "sound/dac.h"
6172
6273
63WRITE8_HANDLER( champbas_videoram_w );
64WRITE8_HANDLER( champbas_colorram_w );
74#define CPUTAG_MCU "MCU"
75
76extern UINT8 *champbas_bg_videoram;
77WRITE8_HANDLER( champbas_bg_videoram_w );
6578WRITE8_HANDLER( champbas_gfxbank_w );
6679WRITE8_HANDLER( champbas_palette_bank_w );
6780WRITE8_HANDLER( champbas_flipscreen_w );
r2018r2019
7083VIDEO_START( champbas );
7184VIDEO_UPDATE( champbas );
7285
86
87static int champbas_watchdog_count;
88
89
90static VIDEO_EOF( champbas )
91{
92   champbas_watchdog_count++;
93
94   if (champbas_watchdog_count == 0x10)
95      mame_schedule_soft_reset(machine);
96}
97
98static WRITE8_HANDLER( champbas_watchdog_reset_w )
99{
100   champbas_watchdog_count = 0;
101}
102
103static CUSTOM_INPUT( champbas_watchdog_bit2 )
104{
105   return BIT(champbas_watchdog_count,2);
106}
107
108
109static WRITE8_HANDLER( irq_ack_w )
110{
111   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
112}
113
114
73115static WRITE8_HANDLER( champbas_dac_w )
74116{
75117   DAC_signed_data_w(0,data<<2);
r2018r2019
79121// protection handling
80122///////////////////////////////////////////////////////////////////////////
81123
124static WRITE8_HANDLER( champbas_mcu_switch_w )
125{
126   // switch shared RAM between CPU and MCU bus
127   // FIXME not implemented
128}
129
82130static WRITE8_HANDLER( champbas_mcu_halt_w )
83131{
132   int cpunum = mame_find_cpu_index(Machine, CPUTAG_MCU);
133
134   // MCU not present/not used in champbas
135   if (cpunum == -1)
136      return;
137
84138   data &= 1;
85   cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, data ? ASSERT_LINE : CLEAR_LINE);
139   cpunum_set_input_line(Machine, cpunum, INPUT_LINE_HALT, data ? ASSERT_LINE : CLEAR_LINE);
86140}
87141
88142/* champbja another protection */
r2018r2019
115169   return data;
116170}
117171
172
173
174static ADDRESS_MAP_START( talbot_main_map, ADDRESS_SPACE_PROGRAM, 8 )
175   AM_RANGE(0x0000, 0x5fff) AM_ROM
176   AM_RANGE(0x6000, 0x63ff) AM_RAM AM_SHARE(1) /* MCU shared RAM */
177   AM_RANGE(0x7000, 0x7000) AM_WRITE(AY8910_write_port_0_w)
178   AM_RANGE(0x7001, 0x7001) AM_WRITE(AY8910_control_port_0_w)
179   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_WRITE(champbas_bg_videoram_w) AM_BASE(&champbas_bg_videoram)
180   AM_RANGE(0x8800, 0x8fef) AM_RAM
181   AM_RANGE(0x8ff0, 0x8fff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
182
183   AM_RANGE(0xa000, 0xa000) AM_WRITE(irq_ack_w)
184   AM_RANGE(0xa001, 0xa001) AM_WRITENOP   // !WORK board output (no use?)
185   AM_RANGE(0xa002, 0xa002) AM_WRITENOP
186   AM_RANGE(0xa003, 0xa003) AM_WRITE(champbas_flipscreen_w)
187   AM_RANGE(0xa004, 0xa004) AM_WRITENOP
188   AM_RANGE(0xa005, 0xa005) AM_WRITENOP
189   AM_RANGE(0xa006, 0xa006) AM_WRITE(champbas_mcu_halt_w)
190   AM_RANGE(0xa007, 0xa007) AM_WRITE(champbas_mcu_switch_w)
191
192   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
193   AM_RANGE(0xa040, 0xa040) AM_READ(input_port_1_r)
194   AM_RANGE(0xa060, 0xa06f) AM_WRITE(SMH_RAM) AM_BASE(&spriteram_2)
195   AM_RANGE(0xa080, 0xa080) AM_READ(input_port_2_r)
196   AM_RANGE(0xa0c0, 0xa0c0) AM_READWRITE(input_port_3_r, champbas_watchdog_reset_w)
197ADDRESS_MAP_END
198
118199static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
119200   AM_RANGE(0x0000, 0x5fff) AM_ROM
201   AM_RANGE(0x6000, 0x63ff) AM_RAM AM_SHARE(1)
202
120203   AM_RANGE(0x7000, 0x7000) AM_WRITE(AY8910_write_port_0_w)
121204   AM_RANGE(0x7001, 0x7001) AM_WRITE(AY8910_control_port_0_w)
122   AM_RANGE(0x7800, 0x7fff) AM_ROM
205   AM_RANGE(0x7800, 0x7fff) AM_ROM   // champbb2 only
123206
124   AM_RANGE(0x8000, 0x83ff) AM_WRITE(champbas_videoram_w) AM_READ(SMH_RAM) AM_BASE(&videoram)
125   AM_RANGE(0x8400, 0x87ff) AM_WRITE(champbas_colorram_w) AM_READ(SMH_RAM) AM_BASE(&colorram)
207   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_WRITE(champbas_bg_videoram_w) AM_BASE(&champbas_bg_videoram)
126208   AM_RANGE(0x8800, 0x8fef) AM_RAM
127209   AM_RANGE(0x8ff0, 0x8fff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
128   AM_RANGE(0xa000, 0xa000) AM_WRITE(interrupt_enable_w) AM_READ(input_port_0_r)
210
211   AM_RANGE(0xa000, 0xa000) AM_WRITE(irq_ack_w) AM_READ(input_port_0_r)
212   AM_RANGE(0xa001, 0xa001) AM_WRITENOP   // !WORK board output (no use?)
129213   AM_RANGE(0xa002, 0xa002) AM_WRITE(champbas_gfxbank_w)
130214   AM_RANGE(0xa003, 0xa003) AM_WRITE(champbas_flipscreen_w)
131215   AM_RANGE(0xa004, 0xa004) AM_WRITE(champbas_palette_bank_w)
132   AM_RANGE(0xa005, 0xa005) AM_NOP
216   AM_RANGE(0xa005, 0xa005) AM_WRITENOP   // n.c.
217   AM_RANGE(0xa006, 0xa006) AM_WRITE(champbas_mcu_halt_w)   // MCU not present/not used in champbas
218   AM_RANGE(0xa007, 0xa007) AM_WRITE(champbas_mcu_switch_w)   // MCU not present/not used in champbas
133219
134220   AM_RANGE(0xa040, 0xa040)                            AM_READ(input_port_1_r)
135   AM_RANGE(0xa060, 0xa06f) AM_WRITE(SMH_RAM)                                  AM_BASE(&spriteram_2)
221   AM_RANGE(0xa060, 0xa06f) AM_RAM AM_BASE(&spriteram_2)
136222   AM_RANGE(0xa080, 0xa080) AM_WRITE(soundlatch_w)     AM_READ(input_port_2_r)
137223/*  AM_RANGE(0xa0a0, 0xa0a0)    ???? */
138   AM_RANGE(0xa0c0, 0xa0c0) AM_WRITE(watchdog_reset_w) AM_READ(input_port_3_r)
224   AM_RANGE(0xa0c0, 0xa0c0) AM_WRITE(champbas_watchdog_reset_w) AM_READ(input_port_3_r)
139225
140   /* has MCU pcb only */
141   AM_RANGE(0x6000, 0x63ff) AM_RAM AM_SHARE(1)
142/*  AM_RANGE(0xa006, 0xa006) AM_WRITE(champbas_mcu_halt_w) */
143   AM_RANGE(0xa007, 0xa007) AM_NOP /* MCU shared RAM switch , but no-hawdrare */
144
145226   /* champbja only */
146227   AM_RANGE(0x6800, 0x68ff) AM_READ(champbja_alt_protection_r)
147228
r2018r2019
149230
150231static ADDRESS_MAP_START( sub_map, ADDRESS_SPACE_PROGRAM, 8 )
151232   AM_RANGE(0x0000, 0x5fff) AM_ROM
152   AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r)
153   AM_RANGE(0xe000, 0xe3ff) AM_READ(SMH_RAM)
154/*  AM_RANGE(0x8000, 0x8000) AM_WRITE(SMH_NOP) return low 4bit to main CPU */
155   AM_RANGE(0xa000, 0xa000) AM_WRITE(soundlatch_clear_w)
156   AM_RANGE(0xc000, 0xc000) AM_WRITE(champbas_dac_w)
157   AM_RANGE(0xe000, 0xe3ff) AM_WRITE(SMH_RAM)
233   AM_RANGE(0x6000, 0x7fff) AM_READ(soundlatch_r)
234   AM_RANGE(0x8000, 0x9fff) AM_WRITENOP   // 4-bit return code to main CPU (not used)
235   AM_RANGE(0xa000, 0xbfff) AM_WRITE(soundlatch_clear_w)
236   AM_RANGE(0xc000, 0xdfff) AM_WRITE(champbas_dac_w)
237   AM_RANGE(0xe000, 0xe3ff) AM_MIRROR(0x1c00) AM_RAM
158238ADDRESS_MAP_END
159239
160240static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 )
161241   AM_RANGE(0x0000, 0x03ff) AM_RAM AM_SHARE(1) /* main CPU shared RAM */
162242ADDRESS_MAP_END
163243
244
245
246static INPUT_PORTS_START( talbot )
247   PORT_START      /* IN0 */
248   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
249   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
250   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
251   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 )
252   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
253   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
254   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
255   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
256
257   PORT_START      /* IN1 */
258   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
259   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
260   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
261   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
262   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
263   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
264   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
265   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
266
267   PORT_START
268   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
269   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
270   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
271   PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )
272   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
273   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Lives ) )
274   PORT_DIPSETTING(    0x00, "3" )
275   PORT_DIPSETTING(    0x04, "4" )
276   PORT_DIPSETTING(    0x08, "5" )
277   PORT_DIPSETTING(    0x0c, "6" )
278   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
279   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
280   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
281   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
282   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
283   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
284   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
285   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
286   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
287   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(champbas_watchdog_bit2, 0)   // bit 2 of the watchdog counter
288
289   PORT_START      /* IN2 */
290   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
291   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
292   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
293   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
294   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
295   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
296   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
297   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
298INPUT_PORTS_END
299
164300static INPUT_PORTS_START( champbas )
165301   PORT_START   /* IN0 */
166   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
167   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
168   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 )
169   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 )
302   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )   // throw (red)
303   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
304   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 )   // changes (blue)
305   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 )   // steal (yellow)
170306   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
171307   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
172308   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
173309   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
174310
175311   PORT_START   /* IN1 */
176   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
177   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
178   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
179   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL
180   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
181   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
182   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
183   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
312   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL   // steal (yellow)
313   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL   // changes (blue)
314   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_COCKTAIL
315   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL   // throw (red)
316   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
317   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
318   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
319   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
184320
185321   PORT_START   /* DSW */
186322   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coinage ) )
r2018r2019
188324   PORT_DIPSETTING(    0x02, "A 1/1 B 2/1")
189325   PORT_DIPSETTING(    0x01, "A 1/2 B 1/6" )
190326   PORT_DIPSETTING(    0x00, "A 1/3 B 1/6")
191   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Flip_Screen ) )
192   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
193   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
327   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Flip_Screen ) )
328   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
329   PORT_DIPSETTING(    0x00, DEF_STR( On ))
194330   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
195331   PORT_DIPSETTING(    0x08, DEF_STR( Off ))
196332   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
197333   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) )
198334   PORT_DIPSETTING(    0x00, DEF_STR( Upright ))
199335   PORT_DIPSETTING(    0x10, DEF_STR( Cocktail ) )
200   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Difficulty ) )
336   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) )
201337   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
202338   PORT_DIPSETTING(    0x00, DEF_STR( Hard ))
203339   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
204340   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
205341   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
206   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) /* watchdog half over : The game won't boot if set to ON */
207   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
208   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
342   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(champbas_watchdog_bit2, 0)   // bit 2 of the watchdog counter
209343
210344   PORT_START   /* COIN */
211345   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
r2018r2019
223357
224358static const gfx_layout charlayout =
225359{
226   8,8,   /* 8*8 characters */
227   256,   /* 256 characters */
228   2,   /* 2 bits per pixel */
229   { 0, 4 },   /* the two bitplanes for 4 pixels are packed into one byte */
230   { 8*8+0, 8*8+1, 8*8+2, 8*8+3, 0, 1, 2, 3 },   /* bits are packed in groups of four */
231   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
232   16*8   /* every char takes 16 bytes */
360   8,8,
361   RGN_FRAC(1,1),
362   2,
363   { 0, 4 },
364   { STEP4(8*8,1), STEP4(0,1) },
365   { STEP8(0,8) },
366   16*8
233367};
234368
235369static const gfx_layout spritelayout =
236370{
237   16,16,   /* 16*16 sprites */
238   64,   /* 64 sprites */
239   2,   /* 2 bits per pixel */
240   { 0, 4 },   /* the two bitplanes for 4 pixels are packed into one byte */
241   { 8*8, 8*8+1, 8*8+2, 8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3,
242         24*8+0, 24*8+1, 24*8+2, 24*8+3, 0, 1, 2, 3 },
243   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
244         32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 },
245   64*8   /* every sprite takes 64 bytes */
371   16,16,
372   RGN_FRAC(1,1),
373   2,
374   { 0, 4 },
375   { STEP4(8*8,1), STEP4(16*8,1), STEP4(24*8,1), STEP4(0,1) },
376   { STEP8(0,8), STEP8(32*8,8) },
377   64*8
246378};
247379
380static GFXDECODE_START( talbot )
381   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x100, 0x100/4 )
382   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0x000, 0x100/4 )
383GFXDECODE_END
384
248385static GFXDECODE_START( champbas )
249   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,   0, 128 )
250   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, charlayout,   0, 128 )
251   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, spritelayout, 0, 128 )
252   GFXDECODE_ENTRY( REGION_GFX2, 0x1000, spritelayout, 0, 128 )
386   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 0x200/4 )
387   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0, 0x200/4 )
253388GFXDECODE_END
254389
255390
256391
257392
258static const struct AY8910interface ay8910_interface =
259{
260   input_port_0_r,
261   input_port_1_r
262};
393static MACHINE_DRIVER_START( talbot )
263394
395   /* basic machine hardware */
396
397   MDRV_CPU_ADD(Z80, XTAL_18_432MHz/6)
398   MDRV_CPU_PROGRAM_MAP(talbot_main_map, 0)
399   MDRV_CPU_VBLANK_INT("main", irq0_line_assert)
400
401   /* MCU */
402   MDRV_CPU_ADD_TAG(CPUTAG_MCU, ALPHA8201, XTAL_18_432MHz/6/8)
403   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
404
405   /* video hardware */
406   MDRV_SCREEN_ADD("main", RASTER)
407   MDRV_SCREEN_REFRESH_RATE(60)
408   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
409   MDRV_SCREEN_SIZE(32*8, 32*8)
410   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
411
412   MDRV_GFXDECODE(talbot)
413   MDRV_PALETTE_LENGTH(0x200)
414
415   MDRV_PALETTE_INIT(champbas)
416   MDRV_VIDEO_START(champbas)
417   MDRV_VIDEO_UPDATE(champbas)
418   MDRV_VIDEO_EOF(champbas)
419
420   /* sound hardware */
421   MDRV_SPEAKER_STANDARD_MONO("mono")
422   MDRV_SOUND_ADD(AY8910, XTAL_18_432MHz/12)
423   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
424MACHINE_DRIVER_END
425
426
264427static MACHINE_DRIVER_START( champbas )
265428
266429   /* basic machine hardware */
267430
268431   /* main cpu */
269   MDRV_CPU_ADD(Z80, 18432000/6)
432   MDRV_CPU_ADD(Z80, XTAL_18_432MHz/6)
270433   MDRV_CPU_PROGRAM_MAP(main_map,0)
271   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
434   MDRV_CPU_VBLANK_INT("main", irq0_line_assert)
272435
273436   /* audio CPU */
274   MDRV_CPU_ADD(Z80, 18432000/6)
437   MDRV_CPU_ADD(Z80, XTAL_18_432MHz/6)
275438   MDRV_CPU_PROGRAM_MAP(sub_map,0)
276439
277440   /* video hardware */
278441   MDRV_SCREEN_ADD("main", RASTER)
279442   MDRV_SCREEN_REFRESH_RATE(60)
280   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
281443   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
282444   MDRV_SCREEN_SIZE(32*8, 32*8)
283445   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
284446
285447   MDRV_GFXDECODE(champbas)
286   MDRV_PALETTE_LENGTH(128*4)
448   MDRV_PALETTE_LENGTH(0x200)
287449
288450   MDRV_PALETTE_INIT(champbas)
289451   MDRV_VIDEO_START(champbas)
290452   MDRV_VIDEO_UPDATE(champbas)
453   MDRV_VIDEO_EOF(champbas)
291454
292455   /* sound hardware */
293456   MDRV_SPEAKER_STANDARD_MONO("mono")
294457
295   MDRV_SOUND_ADD(AY8910, 18432000/12)
296   MDRV_SOUND_CONFIG(ay8910_interface)
458   MDRV_SOUND_ADD(AY8910, XTAL_18_432MHz/12)
297459   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
298460
299461   MDRV_SOUND_ADD(DAC, 0)
r2018r2019
301463MACHINE_DRIVER_END
302464
303465
304static MACHINE_DRIVER_START( champbb2 )
466static MACHINE_DRIVER_START( champmcu )
305467   /* basic machine hardware */
306468   MDRV_IMPORT_FROM(champbas)
307469
308470   /* MCU */
309   MDRV_CPU_ADD(ALPHA8201, 18432000/6/8)
471   MDRV_CPU_ADD_TAG(CPUTAG_MCU, ALPHA8201, XTAL_18_432MHz/6/8)
310472   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
311473
312474   /* to MCU timeout champbbj */
313475   MDRV_INTERLEAVE(50)
314476MACHINE_DRIVER_END
315477
316/* MCU handling */
317static DRIVER_INIT(champbb2)
318{
319   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa006, 0xa006, 0, 0, champbas_mcu_halt_w);
320}
321
322478/***************************************************************************
323479
324480  Game driver(s)
325481
326482***************************************************************************/
327483
484ROM_START( talbot )
485   ROM_REGION( 0x10000, REGION_CPU1, 0 )
486   ROM_LOAD( "11.10g", 0x0000, 0x1000, CRC(0368607d) SHA1(275a29fb018bd327e64cf4fcc04590099c90290a) )
487   ROM_LOAD( "12.11g", 0x1000, 0x1000, CRC(400e633b) SHA1(8d76df34174286e2b0c9341bbc141c9e77533f06) )
488   ROM_LOAD( "13.10h", 0x2000, 0x1000, CRC(be575d9e) SHA1(17d3bbdc755920b5a6e1e81cbb7d51be20257ff1) )
489   ROM_LOAD( "14.11h", 0x3000, 0x1000, CRC(56464614) SHA1(21cfcf3212e0a74c695ce1d6412d630a7141b2c9) )
490   ROM_LOAD( "15.10i", 0x4000, 0x1000, CRC(0225b7ef) SHA1(9adee4831eb633b0a31580596205a655df94c2b2) )
491   ROM_LOAD( "16.11i", 0x5000, 0x1000, CRC(1612adf5) SHA1(9adeb21d5d1692f6e31460062f03f2008076b307) )
492
493   ROM_REGION( 0x2000, REGION_CPU2, 0 )
494   ROM_LOAD( "8201.bin", 0x0000, 0x2000, CRC(b77931ac) SHA1(405b02585e80d95a2821455538c5c2c31ce262d1) )
495
496   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )   // chars
497   ROM_LOAD( "7.6a", 0x0000, 0x1000, CRC(bde14194) SHA1(f8f569342a3094eb5450a30b8ab87901b98e6061) )
498
499   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )   // sprites
500   ROM_LOAD( "8.6b", 0x0000, 0x1000, CRC(ddcd227a) SHA1(c44de36311cd173afb3eebf8487305b06e069c0f) )
501
502   ROM_REGION( 0x0120, REGION_PROMS, 0 )
503   ROM_LOAD( "mb7051.7h", 0x0000, 0x0020, CRC(7a153c60) SHA1(4b147c63e467cca7359acb5f3652ed9db9a36cc8) )
504   ROM_LOAD( "mb7052.5e", 0x0020, 0x0100, CRC(a3189986) SHA1(f113c1253ba2f8f213c600e93a39c0957a933306) )
505ROM_END
506
328507ROM_START( champbas )
329508   ROM_REGION( 0x10000, REGION_CPU1, 0 )
330   ROM_LOAD( "champbb.1",    0x0000, 0x2000, CRC(218de21e) SHA1(7577fd04bdda4666c017f3b36e81ec23bcddd845) )
331   ROM_LOAD( "champbb.2",    0x2000, 0x2000, CRC(5ddd872e) SHA1(68e21572e27707c991180b1bd0a6b31f7b64abf6) )
332   ROM_LOAD( "champbb.3",    0x4000, 0x2000, CRC(f39a7046) SHA1(3097bffe84ac74ce9e6481028a0ebbe8b1d6eaf9) )
509   ROM_LOAD( "champbb.1", 0x0000, 0x2000, CRC(218de21e) SHA1(7577fd04bdda4666c017f3b36e81ec23bcddd845) )
510   ROM_LOAD( "champbb.2", 0x2000, 0x2000, CRC(5ddd872e) SHA1(68e21572e27707c991180b1bd0a6b31f7b64abf6) )
511   ROM_LOAD( "champbb.3", 0x4000, 0x2000, CRC(f39a7046) SHA1(3097bffe84ac74ce9e6481028a0ebbe8b1d6eaf9) )
333512
334513   ROM_REGION( 0x10000, REGION_CPU2, 0 )
335   ROM_LOAD( "champbb.6",    0x0000, 0x2000, CRC(26ab3e16) SHA1(019b9d34233a6b7a53e204154b782ceb42915d2b) )
336   ROM_LOAD( "champbb.7",    0x2000, 0x2000, CRC(7c01715f) SHA1(b15b2001b8c110f2599eee3aeed79f67686ebd7e) )
337   ROM_LOAD( "champbb.8",    0x4000, 0x2000, CRC(3c911786) SHA1(eea0c467e213d237b5bb9d04b19a418d6090c2dc) )
514   ROM_LOAD( "champbb.6", 0x0000, 0x2000, CRC(26ab3e16) SHA1(019b9d34233a6b7a53e204154b782ceb42915d2b) )
515   ROM_LOAD( "champbb.7", 0x2000, 0x2000, CRC(7c01715f) SHA1(b15b2001b8c110f2599eee3aeed79f67686ebd7e) )
516   ROM_LOAD( "champbb.8", 0x4000, 0x2000, CRC(3c911786) SHA1(eea0c467e213d237b5bb9d04b19a418d6090c2dc) )
338517
339   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
340   ROM_LOAD( "champbb.4",    0x0000, 0x2000, CRC(1930fb52) SHA1(cae0b2701c2b53b79e9df3a7496442ba3472e996) )
518   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )   // chars + sprites: rearranged by DRIVER_INIT to leave only chars
519   ROM_LOAD( "champbb.4", 0x0000, 0x2000, CRC(1930fb52) SHA1(cae0b2701c2b53b79e9df3a7496442ba3472e996) )
341520
342   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
343   ROM_LOAD( "champbb.5",    0x0000, 0x2000, CRC(a4cef5a1) SHA1(fa00ed0d075e00992a1ddce3c1327ed74770a735) )
521   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )   // chars + sprites: rearranged by DRIVER_INIT to leave only sprites
522   ROM_LOAD( "champbb.5", 0x0000, 0x2000, CRC(a4cef5a1) SHA1(fa00ed0d075e00992a1ddce3c1327ed74770a735) )
344523
345524   ROM_REGION( 0x0120, REGION_PROMS, 0 )
346   ROM_LOAD( "champbb.pr2",  0x0000, 0x020, CRC(2585ffb0) SHA1(ce7f62f37955c2bbb4f82b139cc716978b084767) ) /* palette */
347   ROM_LOAD( "champbb.pr1",  0x0020, 0x100, CRC(872dd450) SHA1(6c1e2c4a2fc072f4bf4996c731adb0b01b347506) ) /* look-up table */
525   ROM_LOAD( "champbb.pr2", 0x0000, 0x020, CRC(2585ffb0) SHA1(ce7f62f37955c2bbb4f82b139cc716978b084767) ) /* palette */
526   ROM_LOAD( "champbb.pr1", 0x0020, 0x100, CRC(872dd450) SHA1(6c1e2c4a2fc072f4bf4996c731adb0b01b347506) ) /* look-up table */
348527ROM_END
349528
350529ROM_START( champbbj )
351530   ROM_REGION( 0x10000, REGION_CPU1, 0 )
352   ROM_LOAD( "11.2e",      0x0000, 0x2000, CRC(e2dfc166) SHA1(482e084d7d21b1cf2d17431699e6bab4c4b6ac15) )
353   ROM_LOAD( "12.2g",      0x2000, 0x2000, CRC(7b4e5faa) SHA1(b7201816a819ef313ddc81f312d26982b83ef1c7) )
354   ROM_LOAD( "13.2h",      0x4000, 0x2000, CRC(b201e31f) SHA1(bba3b611ff60ad8d5dd8484df4cfc2026f4fd344) )
531   ROM_LOAD( "11.2e", 0x0000, 0x2000, CRC(e2dfc166) SHA1(482e084d7d21b1cf2d17431699e6bab4c4b6ac15) )
532   ROM_LOAD( "12.2g", 0x2000, 0x2000, CRC(7b4e5faa) SHA1(b7201816a819ef313ddc81f312d26982b83ef1c7) )
533   ROM_LOAD( "13.2h", 0x4000, 0x2000, CRC(b201e31f) SHA1(bba3b611ff60ad8d5dd8484df4cfc2026f4fd344) )
355534
356535   ROM_REGION( 0x10000, REGION_CPU2, 0 )
357   ROM_LOAD( "16.2k",      0x0000, 0x2000, CRC(24c482ee) SHA1(c25bdf77014e095fc11a9a6b17f16858f19db451) )
358   ROM_LOAD( "17.2l",      0x2000, 0x2000, CRC(f10b148b) SHA1(d66516d509f6f16e51ee59d27c4867e276064c3f) )
359   ROM_LOAD( "18.2n",      0x4000, 0x2000, CRC(2dc484dd) SHA1(28bd68c787d7e6989849ca52009948dbd5cdcc79) )
536   ROM_LOAD( "16.2k", 0x0000, 0x2000, CRC(24c482ee) SHA1(c25bdf77014e095fc11a9a6b17f16858f19db451) )
537   ROM_LOAD( "17.2l", 0x2000, 0x2000, CRC(f10b148b) SHA1(d66516d509f6f16e51ee59d27c4867e276064c3f) )
538   ROM_LOAD( "18.2n", 0x4000, 0x2000, CRC(2dc484dd) SHA1(28bd68c787d7e6989849ca52009948dbd5cdcc79) )
360539
361   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
362   ROM_LOAD( "14.5e",      0x0000, 0x2000, CRC(1b8202b3) SHA1(889b77fc3d0cb029baf8c47be260f513f3ed59bd) )
540   ROM_REGION( 0x2000, REGION_CPU3, 0 )
541   ROM_LOAD( "8201.bin", 0x0000, 0x2000, CRC(b77931ac) SHA1(405b02585e80d95a2821455538c5c2c31ce262d1) )
363542
364   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
365   ROM_LOAD( "15.5g",      0x0000, 0x2000, CRC(a67c0c40) SHA1(3845839eff8c1624d26937f28ffde67a5fcb4805) )
543   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )   // chars + sprites: rearranged by DRIVER_INIT to leave only chars
544   ROM_LOAD( "14.5e", 0x0000, 0x2000, CRC(1b8202b3) SHA1(889b77fc3d0cb029baf8c47be260f513f3ed59bd) )
366545
546   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )   // chars + sprites: rearranged by DRIVER_INIT to leave only sprites
547   ROM_LOAD( "15.5g", 0x0000, 0x2000, CRC(a67c0c40) SHA1(3845839eff8c1624d26937f28ffde67a5fcb4805) )
548
367549   ROM_REGION( 0x0120, REGION_PROMS, 0 )
368   ROM_LOAD( "1e.bpr",    0x0000, 0x0020, CRC(f5ce825e) SHA1(956f580840f1a7d24bfbd72b2929d14e9ee1b660) ) /* palette */
369   ROM_LOAD( "5k.bpr",    0x0020, 0x0100, CRC(2e481ffa) SHA1(bc8979efd43bee8be0ce96ebdacc873a5821e06e) ) /* look-up table */
550   ROM_LOAD( "1e.bpr", 0x0000, 0x0020, CRC(f5ce825e) SHA1(956f580840f1a7d24bfbd72b2929d14e9ee1b660) ) /* palette */
551   ROM_LOAD( "5k.bpr", 0x0020, 0x0100, CRC(2e481ffa) SHA1(bc8979efd43bee8be0ce96ebdacc873a5821e06e) ) /* look-up table */
370552ROM_END
371553
372554ROM_START( champbja )
373555   ROM_REGION( 0x10000, REGION_CPU1, 0 )
374   ROM_LOAD( "10",         0x0000, 0x2000, CRC(f7cdaf8e) SHA1(d4c840f2107394fadbcf822d64aaa381ac900367) )
375   ROM_LOAD( "09",         0x2000, 0x2000, CRC(9d39e5b3) SHA1(11c1a1d2296c0bf16d7610eaa79b034bfd813740) )
376   ROM_LOAD( "08",         0x4000, 0x2000, CRC(53468a0f) SHA1(d4b5ea48b27754eebe593c8b4fcf5bf117f27ae4) )
556   ROM_LOAD( "10", 0x0000, 0x2000, CRC(f7cdaf8e) SHA1(d4c840f2107394fadbcf822d64aaa381ac900367) )
557   ROM_LOAD( "09", 0x2000, 0x2000, CRC(9d39e5b3) SHA1(11c1a1d2296c0bf16d7610eaa79b034bfd813740) )
558   ROM_LOAD( "08", 0x4000, 0x2000, CRC(53468a0f) SHA1(d4b5ea48b27754eebe593c8b4fcf5bf117f27ae4) )
377559
378560   ROM_REGION( 0x10000, REGION_CPU2, 0 )
379   ROM_LOAD( "16.2k",      0x0000, 0x2000, CRC(24c482ee) SHA1(c25bdf77014e095fc11a9a6b17f16858f19db451) )
380   ROM_LOAD( "17.2l",      0x2000, 0x2000, CRC(f10b148b) SHA1(d66516d509f6f16e51ee59d27c4867e276064c3f) )
381   ROM_LOAD( "18.2n",      0x4000, 0x2000, CRC(2dc484dd) SHA1(28bd68c787d7e6989849ca52009948dbd5cdcc79) )
561   ROM_LOAD( "16.2k", 0x0000, 0x2000, CRC(24c482ee) SHA1(c25bdf77014e095fc11a9a6b17f16858f19db451) )
562   ROM_LOAD( "17.2l", 0x2000, 0x2000, CRC(f10b148b) SHA1(d66516d509f6f16e51ee59d27c4867e276064c3f) )
563   ROM_LOAD( "18.2n", 0x4000, 0x2000, CRC(2dc484dd) SHA1(28bd68c787d7e6989849ca52009948dbd5cdcc79) )
382564
383   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
384   ROM_LOAD( "14.5e",      0x0000, 0x2000, CRC(1b8202b3) SHA1(889b77fc3d0cb029baf8c47be260f513f3ed59bd) )
565   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )   // chars + sprites: rearranged by DRIVER_INIT to leave only chars
566   ROM_LOAD( "14.5e", 0x0000, 0x2000, CRC(1b8202b3) SHA1(889b77fc3d0cb029baf8c47be260f513f3ed59bd) )
385567
386   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
387   ROM_LOAD( "15.5g",      0x0000, 0x2000, CRC(a67c0c40) SHA1(3845839eff8c1624d26937f28ffde67a5fcb4805) )
568   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )   // chars + sprites: rearranged by DRIVER_INIT to leave only sprites
569   ROM_LOAD( "15.5g", 0x0000, 0x2000, CRC(a67c0c40) SHA1(3845839eff8c1624d26937f28ffde67a5fcb4805) )
388570
389571   ROM_REGION( 0x0120, REGION_PROMS, 0 )
390   ROM_LOAD( "clr",       0x0000, 0x0020, CRC(8f989357) SHA1(d0916fb5ef4b43bdf84663cd403418ffc5e98c17) ) /* palette */
391   ROM_LOAD( "5k.bpr",    0x0020, 0x0100, CRC(2e481ffa) SHA1(bc8979efd43bee8be0ce96ebdacc873a5821e06e) ) /* look-up table */
572   ROM_LOAD( "clr",    0x0000, 0x0020, CRC(8f989357) SHA1(d0916fb5ef4b43bdf84663cd403418ffc5e98c17) ) /* palette */
573   ROM_LOAD( "5k.bpr", 0x0020, 0x0100, CRC(2e481ffa) SHA1(bc8979efd43bee8be0ce96ebdacc873a5821e06e) ) /* look-up table */
392574ROM_END
393575
394576ROM_START( champbb2 )
395577   ROM_REGION( 0x10000, REGION_CPU1, 0 )
396   ROM_LOAD( "epr5932",      0x0000, 0x2000, CRC(528e3c78) SHA1(ee300201580c1bace783f1340bd4f1ea2a00dffa) )
397   ROM_LOAD( "epr5929",      0x2000, 0x2000, CRC(17b6057e) SHA1(67c5aed950acf4d045edf39019066af2896265e1) )
398   ROM_LOAD( "epr5930",      0x4000, 0x2000, CRC(b6570a90) SHA1(5a2651aeac986000913b5854792b2d81df6b2fc6) )
399   ROM_LOAD( "epr5931",      0x7800, 0x0800, CRC(0592434d) SHA1(a7f61546c39ffdbff46c4db485c9b3f6eefcf1ac) )
578   ROM_LOAD( "epr5932", 0x0000, 0x2000, CRC(528e3c78) SHA1(ee300201580c1bace783f1340bd4f1ea2a00dffa) )
579   ROM_LOAD( "epr5929", 0x2000, 0x2000, CRC(17b6057e) SHA1(67c5aed950acf4d045edf39019066af2896265e1) )
580   ROM_LOAD( "epr5930", 0x4000, 0x2000, CRC(b6570a90) SHA1(5a2651aeac986000913b5854792b2d81df6b2fc6) )
581   ROM_LOAD( "epr5931", 0x7800, 0x0800, CRC(0592434d) SHA1(a7f61546c39ffdbff46c4db485c9b3f6eefcf1ac) )
400582
401583   ROM_REGION( 0x10000, REGION_CPU2, 0 )
402   ROM_LOAD( "epr5933",      0x0000, 0x2000, CRC(26ab3e16) SHA1(019b9d34233a6b7a53e204154b782ceb42915d2b) )
403   ROM_LOAD( "epr5934",      0x2000, 0x2000, CRC(7c01715f) SHA1(b15b2001b8c110f2599eee3aeed79f67686ebd7e) )
404   ROM_LOAD( "epr5935",      0x4000, 0x2000, CRC(3c911786) SHA1(eea0c467e213d237b5bb9d04b19a418d6090c2dc) )
584   ROM_LOAD( "epr5933", 0x0000, 0x2000, CRC(26ab3e16) SHA1(019b9d34233a6b7a53e204154b782ceb42915d2b) )
585   ROM_LOAD( "epr5934", 0x2000, 0x2000, CRC(7c01715f) SHA1(b15b2001b8c110f2599eee3aeed79f67686ebd7e) )
586   ROM_LOAD( "epr5935", 0x4000, 0x2000, CRC(3c911786) SHA1(eea0c467e213d237b5bb9d04b19a418d6090c2dc) )
405587
406   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
407   ROM_LOAD( "epr5936",      0x0000, 0x2000, CRC(c4a4df75) SHA1(7b85dbf405697b0b8881f910c08f6db6c828b19a) )
588   ROM_REGION( 0x2000, REGION_CPU3, 0 )
589   ROM_LOAD( "8201.bin", 0x0000, 0x2000, CRC(b77931ac) SHA1(405b02585e80d95a2821455538c5c2c31ce262d1) )
408590
409   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
410   ROM_LOAD( "epr5937",      0x0000, 0x2000, CRC(5c80ec42) SHA1(9b79737577e48a6b2ec20ce145252545955e82c3) )
591   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )   // chars + sprites: rearranged by DRIVER_INIT to leave only chars
592   ROM_LOAD( "epr5936", 0x0000, 0x2000, CRC(c4a4df75) SHA1(7b85dbf405697b0b8881f910c08f6db6c828b19a) )
411593
594   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )   // chars + sprites: rearranged by DRIVER_INIT to leave only sprites
595   ROM_LOAD( "epr5937", 0x0000, 0x2000, CRC(5c80ec42) SHA1(9b79737577e48a6b2ec20ce145252545955e82c3) )
596
412597   ROM_REGION( 0x0120, REGION_PROMS, 0 )
413   ROM_LOAD( "pr5957",       0x0000, 0x020, CRC(f5ce825e) SHA1(956f580840f1a7d24bfbd72b2929d14e9ee1b660) ) /* palette */
414   ROM_LOAD( "pr5956",       0x0020, 0x100, CRC(872dd450) SHA1(6c1e2c4a2fc072f4bf4996c731adb0b01b347506) ) /* look-up table */
598   ROM_LOAD( "pr5957", 0x0000, 0x020, CRC(f5ce825e) SHA1(956f580840f1a7d24bfbd72b2929d14e9ee1b660) ) /* palette */
599   ROM_LOAD( "pr5956", 0x0020, 0x100, CRC(872dd450) SHA1(6c1e2c4a2fc072f4bf4996c731adb0b01b347506) ) /* look-up table */
415600ROM_END
416601
417602ROM_START( champb2a )
418603   ROM_REGION( 0x10000, REGION_CPU1, 0 )
419   ROM_LOAD( "1.bin",        0x0000, 0x2000, CRC(9b75b44d) SHA1(35b67638a5e48cbe999907e3c9c3a33da9d76bba) )
420   ROM_LOAD( "2.bin",        0x2000, 0x2000, CRC(736a1b62) SHA1(24c2d57506754ca789b378a595c03b7591eb5b5c) )
421   ROM_LOAD( "3.bin",        0x4000, 0x2000, CRC(cf5f28cb) SHA1(d553f2085c9c8c77b241b4239cc1ad1764b490d0) )
422   ROM_LOAD( "4.bin",        0x7800, 0x0800, NO_DUMP )
604   ROM_LOAD( "1.bin", 0x0000, 0x2000, CRC(9b75b44d) SHA1(35b67638a5e48cbe999907e3c9c3a33da9d76bba) )
605   ROM_LOAD( "2.bin", 0x2000, 0x2000, CRC(736a1b62) SHA1(24c2d57506754ca789b378a595c03b7591eb5b5c) )
606   ROM_LOAD( "3.bin", 0x4000, 0x2000, CRC(cf5f28cb) SHA1(d553f2085c9c8c77b241b4239cc1ad1764b490d0) )
607   ROM_LOAD( "4.bin", 0x7800, 0x0800, NO_DUMP )
423608
424609   /* not in this set, but probably the same */
425610   ROM_REGION( 0x10000, REGION_CPU2, 0 )
426   ROM_LOAD( "epr5933",      0x0000, 0x2000, CRC(26ab3e16) SHA1(019b9d34233a6b7a53e204154b782ceb42915d2b) )
427   ROM_LOAD( "epr5934",      0x2000, 0x2000, CRC(7c01715f) SHA1(b15b2001b8c110f2599eee3aeed79f67686ebd7e) )
428   ROM_LOAD( "epr5935",      0x4000, 0x2000, CRC(3c911786) SHA1(eea0c467e213d237b5bb9d04b19a418d6090c2dc) )
611   ROM_LOAD( "epr5933", 0x0000, 0x2000, CRC(26ab3e16) SHA1(019b9d34233a6b7a53e204154b782ceb42915d2b) )
612   ROM_LOAD( "epr5934", 0x2000, 0x2000, CRC(7c01715f) SHA1(b15b2001b8c110f2599eee3aeed79f67686ebd7e) )
613   ROM_LOAD( "epr5935", 0x4000, 0x2000, CRC(3c911786) SHA1(eea0c467e213d237b5bb9d04b19a418d6090c2dc) )
429614
430   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
431   ROM_LOAD( "epr5936",      0x0000, 0x2000, CRC(c4a4df75) SHA1(7b85dbf405697b0b8881f910c08f6db6c828b19a) )
615   ROM_REGION( 0x2000, REGION_CPU3, 0 )
616   ROM_LOAD( "8201.bin", 0x0000, 0x2000, CRC(b77931ac) SHA1(405b02585e80d95a2821455538c5c2c31ce262d1) )
432617
433   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
434   ROM_LOAD( "epr5937",      0x0000, 0x2000, CRC(5c80ec42) SHA1(9b79737577e48a6b2ec20ce145252545955e82c3) )
618   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )   // chars + sprites: rearranged by DRIVER_INIT to leave only chars
619   ROM_LOAD( "epr5936", 0x0000, 0x2000, CRC(c4a4df75) SHA1(7b85dbf405697b0b8881f910c08f6db6c828b19a) )
435620
621   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )   // chars + sprites: rearranged by DRIVER_INIT to leave only sprites
622   ROM_LOAD( "epr5937", 0x0000, 0x2000, CRC(5c80ec42) SHA1(9b79737577e48a6b2ec20ce145252545955e82c3) )
623
436624   ROM_REGION( 0x0120, REGION_PROMS, 0 )
437   ROM_LOAD( "pr5957",       0x0000, 0x020, CRC(f5ce825e) SHA1(956f580840f1a7d24bfbd72b2929d14e9ee1b660) ) /* palette */
438   ROM_LOAD( "pr5956",       0x0020, 0x100, CRC(872dd450) SHA1(6c1e2c4a2fc072f4bf4996c731adb0b01b347506) ) /* look-up table */
625   ROM_LOAD( "pr5957", 0x0000, 0x020, CRC(f5ce825e) SHA1(956f580840f1a7d24bfbd72b2929d14e9ee1b660) ) /* palette */
626   ROM_LOAD( "pr5956", 0x0020, 0x100, CRC(872dd450) SHA1(6c1e2c4a2fc072f4bf4996c731adb0b01b347506) ) /* look-up table */
439627ROM_END
440628
441GAME( 1983, champbas, 0,        champbas, champbas, 0,        ROT0, "Sega", "Champion Base Ball", 0 )
442GAME( 1983, champbbj, champbas, champbb2, champbas, champbb2, ROT0, "Alpha Denshi Co.", "Champion Base Ball (Japan set 1)", 0 )
443GAME( 1983, champbja, champbas, champbb2, champbas, champbb2, ROT0, "Alpha Denshi Co.", "Champion Base Ball (Japan set 2)", 0 )
444GAME( 1983, champbb2, 0,        champbb2, champbas, champbb2, ROT0, "Sega",   "Champion Base Ball Part-2: Pair Play (set 1)", 0 )
445629
446/* NO DUMP */
447GAME( 1983, champb2a, champbb2, champbb2, champbas, champbb2, ROT0, "Alpha Denshi Co.", "Champion Baseball II (set 2)", GAME_NOT_WORKING)
448630
631static DRIVER_INIT(champbas)
632{
633   // chars and sprites are mixed in the same ROMs, so rearrange them for easier decoding
634   UINT8 *rom1 = memory_region(REGION_GFX1);
635   UINT8 *rom2 = memory_region(REGION_GFX2);
636   int len = memory_region_length(REGION_GFX1);
637   int i;
638
639   for (i = 0; i < len/2; ++i)
640   {
641      UINT8 t = rom1[i + len/2];
642      rom1[i + len/2] = rom2[i];
643      rom2[i] = t;
644   }
645}
646
647
648
649GAME( 1982, talbot,   0,        talbot,   talbot,   0,        ROT270, "Alpha Denshi Co. (Volt Electronics license)", "Talbot", 0 )
650
651GAME( 1983, champbas, 0,        champbas, champbas, champbas, ROT0,   "[Alpha Denshi Co.] (Sega license)", "Champion Base Ball", 0 )
652GAME( 1983, champbbj, champbas, champmcu, champbas, champbas, ROT0,   "Alpha Denshi Co.", "Champion Base Ball (Japan set 1)", 0 )
653GAME( 1983, champbja, champbas, champbas, champbas, champbas, ROT0,   "Alpha Denshi Co.", "Champion Base Ball (Japan set 2)", 0 )
654GAME( 1983, champbb2, 0,        champmcu, champbas, champbas, ROT0,   "[Alpha Denshi Co.] (Sega license)", "Champion Base Ball Part-2: Pair Play (set 1)", 0 )
655GAME( 1983, champb2a, champbb2, champmcu, champbas, champbas, ROT0,   "Alpha Denshi Co.", "Champion Baseball II (set 2)", GAME_NOT_WORKING)   // no dump
src/mame/drivers/m107.c
r2018r2019
495495   /* video hardware */
496496   MDRV_SCREEN_ADD("main", RASTER)
497497   MDRV_SCREEN_REFRESH_RATE(60)
498   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
498   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
499499   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
500500   MDRV_SCREEN_SIZE(512, 256)
501501   MDRV_SCREEN_VISIBLE_AREA(80, 511-112, 8, 247) /* 320 x 240 */
src/mame/drivers/airbustr.c
r2018r2019
648648
649649static MACHINE_DRIVER_START( airbusb )
650650   MDRV_IMPORT_FROM(airbustr)
651   MDRV_WATCHDOG_VBLANK_INIT(0) // no protection device or watchdog
651   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_SEC(0)) // no protection device or watchdog
652652MACHINE_DRIVER_END
653653
654654
src/mame/drivers/dcheese.c
r2018r2019
432432
433433   MDRV_SOUND_ADD(BSMT2000, SOUND_OSC)
434434   MDRV_SOUND_CONFIG(bsmt2000_interface_region_1)
435   MDRV_SOUND_ROUTE(0, "left", 1.8)
436   MDRV_SOUND_ROUTE(1, "right", 1.8)
435   MDRV_SOUND_ROUTE(0, "left", 1.2)
436   MDRV_SOUND_ROUTE(1, "right", 1.2)
437437MACHINE_DRIVER_END
438438
439439
src/mame/drivers/lsasquad.c
r2018r2019
622622   MDRV_SPEAKER_STANDARD_MONO("mono")
623623
624624   MDRV_SOUND_ADD(AY8910, 3000000)
625   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
625   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.12)
626626
627627   MDRV_SOUND_ADD(YM2203, 3000000)
628628   MDRV_SOUND_CONFIG(ym2203_interface)
629   MDRV_SOUND_ROUTE(0, "mono", 0.20)
630   MDRV_SOUND_ROUTE(1, "mono", 0.20)
631   MDRV_SOUND_ROUTE(2, "mono", 0.20)
632   MDRV_SOUND_ROUTE(3, "mono", 1.0)
629   MDRV_SOUND_ROUTE(0, "mono", 0.12)
630   MDRV_SOUND_ROUTE(1, "mono", 0.12)
631   MDRV_SOUND_ROUTE(2, "mono", 0.12)
632   MDRV_SOUND_ROUTE(3, "mono", 0.63)
633633MACHINE_DRIVER_END
634634
635635static MACHINE_DRIVER_START( daikaiju )
r2018r2019
668668   MDRV_SPEAKER_STANDARD_MONO("mono")
669669
670670   MDRV_SOUND_ADD(AY8910, 3000000)
671   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
671   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.12)
672672
673673   MDRV_SOUND_ADD(YM2203, 3000000)
674674   MDRV_SOUND_CONFIG(ym2203_interface)
675   MDRV_SOUND_ROUTE(0, "mono", 0.20)
676   MDRV_SOUND_ROUTE(1, "mono", 0.20)
677   MDRV_SOUND_ROUTE(2, "mono", 0.20)
678   MDRV_SOUND_ROUTE(3, "mono", 1.0)
675   MDRV_SOUND_ROUTE(0, "mono", 0.12)
676   MDRV_SOUND_ROUTE(1, "mono", 0.12)
677   MDRV_SOUND_ROUTE(2, "mono", 0.12)
678   MDRV_SOUND_ROUTE(3, "mono", 0.63)
679679MACHINE_DRIVER_END
680680
681681
src/mame/drivers/cave.c
r2018r2019
21562156   MDRV_GFXDECODE(esprade)
21572157   MDRV_PALETTE_LENGTH(0x8000)
21582158
2159   MDRV_PALETTE_INIT(cave)
21592160   MDRV_VIDEO_START(cave_3_layers)
21602161   MDRV_VIDEO_UPDATE(cave)
21612162
r2018r2019
21932194   MDRV_GFXDECODE(esprade)
21942195   MDRV_PALETTE_LENGTH(0x8000)
21952196
2197   MDRV_PALETTE_INIT(cave)
21962198   MDRV_VIDEO_START(cave_3_layers)
21972199   MDRV_VIDEO_UPDATE(cave)
21982200
r2018r2019
22312233   MDRV_GFXDECODE(esprade)
22322234   MDRV_PALETTE_LENGTH(0x8000)
22332235
2236   MDRV_PALETTE_INIT(cave)
22342237   MDRV_VIDEO_START(cave_3_layers)
22352238   MDRV_VIDEO_UPDATE(cave)
22362239
r2018r2019
25912594   MDRV_GFXDECODE(uopoko)
25922595   MDRV_PALETTE_LENGTH(0x8000)
25932596
2597   MDRV_PALETTE_INIT(cave)
25942598   MDRV_VIDEO_START(cave_1_layer)
25952599   MDRV_VIDEO_UPDATE(cave)
25962600
src/mame/drivers/battlane.c
r2018r2019
118118
119119
120120static INPUT_PORTS_START( battlane )
121   PORT_START      /* IN0 */
121   PORT_START_TAG("IN0")
122122   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
123123   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
124124   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
r2018r2019
128128   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
129129   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
130130
131    PORT_START      /* IN1 */
131   PORT_START_TAG("IN1")
132132   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
133133   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
134134   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
r2018r2019
138138   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
139139    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
140140
141   PORT_START      /* DSW1 */
142   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) )
141   PORT_START_TAG("DSW1")
142   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW1:1,2")
143143   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
144144   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C )  )
145145   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
146146   PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )
147   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) )
147   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:3,4")
148148   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
149149   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
150150   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
151151   PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
152   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) )
152   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW1:5")
153153   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
154154   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
155   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
155   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SW1:6")
156156   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
157157   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
158   PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Difficulty ) )
158   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW1:7,8")
159159   PORT_DIPSETTING(    0xc0, DEF_STR( Easy )  )
160160   PORT_DIPSETTING(    0x80, DEF_STR( Normal ) )
161161   PORT_DIPSETTING(    0x40, DEF_STR( Hard )  )
162162   PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ) )
163163
164   PORT_START      /* DSW2 */
165   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
164   PORT_START_TAG("DSW2")
165   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW2:1,2")
166166   PORT_DIPSETTING(    0x03, "3" )
167167   PORT_DIPSETTING(    0x02, "4" )
168168   PORT_DIPSETTING(    0x01, "5" )
169169   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play) )
170   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
170   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW2:3,4")
171171   PORT_DIPSETTING(    0x0c, "20K 50K+" )
172172   PORT_DIPSETTING(    0x08, "20K 70K+" )
173173   PORT_DIPSETTING(    0x04, "20K 90K+" )
src/mame/drivers/backfire.c
r2018r2019
500500   MDRV_SCREEN_ADD("left", RASTER)
501501   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
502502   MDRV_SCREEN_REFRESH_RATE(60)
503   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
503   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
504504   MDRV_SCREEN_SIZE(40*8, 32*8)
505505   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
506506
507507   MDRV_SCREEN_ADD("right", RASTER)
508508   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
509509   MDRV_SCREEN_REFRESH_RATE(60)
510   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
510   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
511511   MDRV_SCREEN_SIZE(40*8, 32*8)
512512   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
513513
src/mame/drivers/exctsccr.c
r2018r2019
2222as Coin 1. Basically, this allowed to select an alternative coin table
2323based on wich Coin input was connected.
2424
25The Kazutomi bootleg board is a conversion from Champion Baseball:
26Alpha denshi co. LTD made in Japan
27cpu board 58AS1
28Display board 58AS2
29Voice board 58AS3
30KAZUTOMI board
311x Alpha8201 (CPU board)
321x AY-3-8910 (CPU board)
331x Sharp Z80ACPU (CPU board)
341x Sharp Z80ACPU (VOICE board)
353x 2764 (CPU board) (1-2-3)
363x 2764 (VOICE board) (a-b-c)
372x 2764 (DISPLAY board) (4-5)
381x 2764 (daughter board kazutomi) (6)
392x 2732 (daughter board kazutomi) (7-8)
40
41TODO:
42- interrupt source for sound CPU is unknown.
43
44- sound CPU writes to unknown ports on startup. Timer configure?
45
46- unknown writes to 8910 I/O ports (filters?)
47
2548***************************************************************************/
2649
2750#include "driver.h"
r2018r2019
2952#include "sound/ay8910.h"
3053#include "sound/dac.h"
3154
32/* MCU hacking switch */
33/*  when set 1, old raw patch */
34/*  when set 0, uses MCU core emulation and some MCU patch */
35#define MCU_HACK 0
36
3755/* from video */
3856extern WRITE8_HANDLER( exctsccr_videoram_w );
3957extern WRITE8_HANDLER( exctsccr_colorram_w );
r2018r2019
4462extern VIDEO_START( exctsccr );
4563extern VIDEO_UPDATE( exctsccr );
4664
47/* from machine */
48#if MCU_HACK
49extern UINT8 *exctsccr_mcu_ram;
50extern WRITE8_HANDLER( exctsccr_mcu_w );
51extern WRITE8_HANDLER( exctsccr_mcu_control_w );
52extern WRITE8_HANDLER( exctscc2_mcu_control_w );
53#endif
5465
55
56static WRITE8_HANDLER( exctsccr_DAC_data_w )
66static TIMER_CALLBACK( exctsccr_fm_callback )
5767{
58   DAC_signed_data_w(offset,data << 2);
68   cpunum_set_input_line_and_vector(machine, 1, 0, HOLD_LINE, 0xff );
5969}
6070
61/*
62exctsccr MCU program patch data
63*/
64static const int exctsccr_mcu_patch_data[] =
71static MACHINE_START( exctsccr )
6572{
66/*
67bypass ROM sum error because some opcodes are unknown yet
683B7: F6      db   f6
693BA: F6      db   f6
703BC: F9      db   f9
713BD: F6      db   f6
723C1: F6      db   f6
733C7: F8      db   f8 ; check SUM to ZF
74*/
75  (0x3c8<<16) | (0xd1<<8) | 0xd2, // JZ -> JMP
76  -1
77};
73   // FIXME
74   timer_pulse(ATTOTIME_IN_HZ(75), NULL, 0, exctsccr_fm_callback); /* updates fm */
75}
7876
79/*
80exctscc2 MCU program patch data
81*/
82static const int exctscc2_mcu_patch_data[] =
77
78static WRITE8_HANDLER( exctsccr_DAC_data_w )
8379{
84/*
85bypass initislize check
80   DAC_signed_data_w(offset,data << 2);
81}
8682
87307: D5 01 unknown
88309: D4 00 unknown
89A reg 2 to 5
9083
9130F: D4 01 unknown
92A reg 5 to 2
93
94*/
95  (0x30d<<16) | (0xcf<<8) | 0xda, // JNZ -> CMP
96  (0x313<<16) | (0xcf<<8) | 0xda, // JNZ -> CMP
97/*
98bypass ROM check sum
993B7: F6      db   f6
1003BA: F6      db   f6
1013BC: F9      db   f9
1023BD: F6      db   f6
1033C1: F6      db   f6
1043C7: F8      db   f8
105*/
106  (0x3C8<<16) | (0xd1<<8) | 0xd2, // JZ -> JMP
107  -1
108};
109
110static const int *mcu_patch_data = NULL;
111static UINT8 *mcu_shared_ram;
112static WRITE8_HANDLER( cexctsccr_mcu_halt_w )
84static WRITE8_HANDLER( exctsccr_mcu_halt_w )
11385{
114#if MCU_HACK
115   exctsccr_mcu_control_w(offset,data&1);
116#else
117   const int *p;
118
119   data &= 1;
120   cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, data ? ASSERT_LINE : CLEAR_LINE);
121   if( (p=mcu_patch_data) != NULL)
122   {
123      /* patch MCU program */
124      while(*p != -1)
125      {
126         int a = (*p)>>16;
127         int c = ((*p)>>8) & 0xff;
128         int d = (*p)&0xff;
129         if(mcu_shared_ram[a] == c)
130            mcu_shared_ram[a] = d;
131         p++;
132      }
133   }
134#endif
86   cpunum_set_input_line(Machine, 2, INPUT_LINE_HALT, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
13587}
13688
13789/***************************************************************************
r2018r2019
14294
14395static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
14496   AM_RANGE(0x0000, 0x5fff) AM_ROM
145#if MCU_HACK
146   AM_RANGE(0x6000, 0x63ff) AM_WRITE(exctsccr_mcu_w) AM_READ(SMH_RAM) AM_BASE(&exctsccr_mcu_ram) /* Alpha mcu (protection) */
147#else
148   AM_RANGE(0x6000, 0x63ff) AM_RAM AM_SHARE(1) AM_BASE(&mcu_shared_ram)
149#endif
97   AM_RANGE(0x6000, 0x63ff) AM_RAM AM_SHARE(1)
15098   AM_RANGE(0x7c00, 0x7fff) AM_RAM
151   AM_RANGE(0x8000, 0x83ff) AM_WRITE(exctsccr_videoram_w) AM_READ(SMH_RAM) AM_BASE(&videoram)
152   AM_RANGE(0x8400, 0x87ff) AM_WRITE(exctsccr_colorram_w) AM_READ(SMH_RAM) AM_BASE(&colorram)
153   AM_RANGE(0x8800, 0x8bff) AM_WRITE(SMH_RAM) AM_READ(SMH_RAM) AM_BASE(&spriteram_2) /* ??? */
154   AM_RANGE(0xa000, 0xa000) AM_WRITE(SMH_NOP) AM_READ(input_port_0_r)
155   AM_RANGE(0xa001, 0xa001) AM_WRITE(SMH_NOP) /* ??? */
99   AM_RANGE(0x8000, 0x83ff) AM_RAM AM_WRITE(exctsccr_videoram_w) AM_BASE(&videoram)
100   AM_RANGE(0x8400, 0x87ff) AM_RAM AM_WRITE(exctsccr_colorram_w) AM_BASE(&colorram)
101   AM_RANGE(0x8800, 0x8bff) AM_RAM AM_BASE(&spriteram_2) /* ??? */
102   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
103   AM_RANGE(0xa000, 0xa000) AM_WRITENOP   /* ??? toggled twice at end of irq handler */
104//  AM_RANGE(0xa001, 0xa001) AM_WRITENOP    /* ??? */
156105   AM_RANGE(0xa002, 0xa002) AM_WRITE(exctsccr_gfx_bank_w)
157   AM_RANGE(0xa003, 0xa003) AM_WRITE(exctsccr_flipscreen_w) /* Cocktail mode ( 0xff = flip screen, 0x00 = normal ) */
158   /* 0xa006 MCU control */
159   AM_RANGE(0xa006, 0xa006) AM_WRITE(cexctsccr_mcu_halt_w)
160   AM_RANGE(0xa007, 0xa007) AM_WRITE(SMH_NOP) /* This is also MCU control, but i dont need it */
106   AM_RANGE(0xa003, 0xa003) AM_WRITE(exctsccr_flipscreen_w)
107   AM_RANGE(0xa006, 0xa006) AM_WRITE(exctsccr_mcu_halt_w)
108   AM_RANGE(0xa007, 0xa007) AM_WRITENOP /* This is also MCU control, but i dont need it */
161109   AM_RANGE(0xa040, 0xa06f) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) /* Sprite pos */
162110   AM_RANGE(0xa080, 0xa080) AM_WRITE(soundlatch_w)
163111   AM_RANGE(0xa0c0, 0xa0c0) AM_WRITE(watchdog_reset_w)
164112
165113   AM_RANGE(0xa040, 0xa040) AM_READ(input_port_1_r)
166   AM_RANGE(0xa080, 0xa080) AM_READ(input_port_3_r)
167   AM_RANGE(0xa0c0, 0xa0c0) AM_READ(input_port_2_r)
114   AM_RANGE(0xa080, 0xa080) AM_READ(input_port_2_r)   // FIXME use champbas_dsw_r
115   AM_RANGE(0xa0c0, 0xa0c0) AM_READ(input_port_3_r)
168116ADDRESS_MAP_END
169117
170118static ADDRESS_MAP_START( sub_map, ADDRESS_SPACE_PROGRAM, 8 )
171119   AM_RANGE(0x0000, 0x8fff) AM_ROM
172120   AM_RANGE(0xa000, 0xa7ff) AM_RAM
173121   AM_RANGE(0xc008, 0xc009) AM_WRITE(exctsccr_DAC_data_w)
174   AM_RANGE(0xc00c, 0xc00c) AM_WRITE(soundlatch_w) /* used to clear the latch */
122   AM_RANGE(0xc00c, 0xc00c) AM_WRITE(soundlatch_clear_w)
175123   AM_RANGE(0xc00d, 0xc00d) AM_READ(soundlatch_r)
176   AM_RANGE(0xc00f, 0xc00f) AM_WRITE(SMH_NOP) /* ??? */
124//  AM_RANGE(0xc00f, 0xc00f) AM_WRITE(MWA8_NOP) /* ??? */
177125ADDRESS_MAP_END
178126
179127static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 )
180   ADDRESS_MAP_GLOBAL_MASK(0xff)
128   ADDRESS_MAP_GLOBAL_MASK( 0x00ff )
181129   AM_RANGE(0x82, 0x82) AM_WRITE(AY8910_write_port_0_w)
182130   AM_RANGE(0x83, 0x83) AM_WRITE(AY8910_control_port_0_w)
183131   AM_RANGE(0x86, 0x86) AM_WRITE(AY8910_write_port_1_w)
r2018r2019
188136   AM_RANGE(0x8f, 0x8f) AM_WRITE(AY8910_control_port_3_w)
189137ADDRESS_MAP_END
190138
191/* Bootleg */
192static ADDRESS_MAP_START( bl_readmem, ADDRESS_SPACE_PROGRAM, 8 )
193   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
194   AM_RANGE(0x8000, 0x83ff) AM_READ(SMH_RAM)
195   AM_RANGE(0x8400, 0x87ff) AM_READ(SMH_RAM)
196   AM_RANGE(0x8800, 0x8fff) AM_READ(SMH_RAM) /* ??? */
197   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
198   AM_RANGE(0xa040, 0xa040) AM_READ(input_port_1_r)
199   AM_RANGE(0xa080, 0xa080) AM_READ(input_port_3_r)
200   AM_RANGE(0xa0c0, 0xa0c0) AM_READ(input_port_2_r)
139static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 )
140   AM_RANGE(0x0000, 0x03ff) AM_RAM AM_SHARE(1) /* main CPU shared RAM */
201141ADDRESS_MAP_END
202142
203static ADDRESS_MAP_START( bl_writemem, ADDRESS_SPACE_PROGRAM, 8 )
204   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM)
143
144/* Bootleg */
145static ADDRESS_MAP_START( bl_map, ADDRESS_SPACE_PROGRAM, 8 )
146   AM_RANGE(0x0000, 0x5fff) AM_ROM
205147   AM_RANGE(0x7000, 0x7000) AM_WRITE(AY8910_write_port_0_w)
206148   AM_RANGE(0x7001, 0x7001) AM_WRITE(AY8910_control_port_0_w)
207   AM_RANGE(0x8000, 0x83ff) AM_WRITE(exctsccr_videoram_w) AM_BASE(&videoram)
208   AM_RANGE(0x8400, 0x87ff) AM_WRITE(exctsccr_colorram_w) AM_BASE(&colorram)
209   AM_RANGE(0x8800, 0x8fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram_2) /* ??? */
210   AM_RANGE(0xa000, 0xa000) AM_WRITE(SMH_NOP) /* ??? */
211   AM_RANGE(0xa001, 0xa001) AM_WRITE(SMH_NOP) /* ??? */
212   AM_RANGE(0xa002, 0xa002) AM_WRITE(exctsccr_gfx_bank_w) /* ??? */
213   AM_RANGE(0xa003, 0xa003) AM_WRITE(exctsccr_flipscreen_w) /* Cocktail mode ( 0xff = flip screen, 0x00 = normal ) */
214   AM_RANGE(0xa006, 0xa006) AM_WRITE(SMH_NOP) /* no MCU, but some leftover code still writes here */
215   AM_RANGE(0xa007, 0xa007) AM_WRITE(SMH_NOP) /* no MCU, but some leftover code still writes here */
149
150   AM_RANGE(0x8000, 0x83ff) AM_RAM AM_WRITE(exctsccr_videoram_w) AM_BASE(&videoram)
151   AM_RANGE(0x8400, 0x87ff) AM_RAM AM_WRITE(exctsccr_colorram_w) AM_BASE(&colorram)
152   AM_RANGE(0x8800, 0x8fff) AM_RAM AM_BASE(&spriteram_2) /* ??? */
153
154   AM_RANGE(0xa000, 0xa000) AM_WRITENOP   /* ??? */
155   AM_RANGE(0xa001, 0xa001) AM_WRITENOP   /* ??? */
156   AM_RANGE(0xa002, 0xa002) AM_WRITE(exctsccr_gfx_bank_w)
157   AM_RANGE(0xa003, 0xa003) AM_WRITE(exctsccr_flipscreen_w)
158   AM_RANGE(0xa006, 0xa006) AM_WRITENOP   /* MCU is not used, but some leftover code still writes here */
159   AM_RANGE(0xa007, 0xa007) AM_WRITENOP   /* MCU is not used, but some leftover code still writes here */
160
216161   AM_RANGE(0xa040, 0xa06f) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) /* Sprite Pos */
217162   AM_RANGE(0xa080, 0xa080) AM_WRITE(soundlatch_w)
218163   AM_RANGE(0xa0c0, 0xa0c0) AM_WRITE(watchdog_reset_w)
219ADDRESS_MAP_END
220164
221static ADDRESS_MAP_START( bl_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
222   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
223   AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r)
224   AM_RANGE(0xe000, 0xe3ff) AM_READ(SMH_RAM)
165   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
166   AM_RANGE(0xa040, 0xa040) AM_READ(input_port_1_r)
167   AM_RANGE(0xa080, 0xa080) AM_READ(input_port_2_r)   // FIXME use champbas_dsw_r
168   AM_RANGE(0xa0c0, 0xa0c0) AM_READ(input_port_3_r)
225169ADDRESS_MAP_END
226170
227static ADDRESS_MAP_START( bl_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
228   AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM)
229   AM_RANGE(0x8000, 0x8000) AM_WRITE(SMH_NOP) /* 0 = DAC sound off, 1 = DAC sound on */
230   AM_RANGE(0xa000, 0xa000) AM_WRITE(soundlatch_w) /* used to clear the latch */
171static ADDRESS_MAP_START( bl_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
172   AM_RANGE(0x0000, 0x5fff) AM_ROM
173   AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r)
174//  AM_RANGE(0x8000, 0x8000) AM_WRITENOP    /* 0 = DAC sound off, 1 = DAC sound on */
175   AM_RANGE(0xa000, 0xa000) AM_WRITE(soundlatch_clear_w)
231176   AM_RANGE(0xc000, 0xc000) AM_WRITE(exctsccr_DAC_data_w)
232   AM_RANGE(0xe000, 0xe3ff) AM_WRITE(SMH_RAM)
177   AM_RANGE(0xe000, 0xe3ff) AM_RAM
233178ADDRESS_MAP_END
234179
235static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 )
236   AM_RANGE(0x0000, 0x03ff) AM_RAM AM_SHARE(1) /* main CPU shared RAM */
237ADDRESS_MAP_END
238
239180/***************************************************************************
240181
241182    Input port(s)
r2018r2019
263204   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
264205   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
265206
266   PORT_START      /* IN2 */
267   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
268   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
269   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
270   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
271   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
272   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
273   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
274   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
275
276207   PORT_START      /* DSW0 */
277208   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
278209   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
r2018r2019
293224   PORT_DIPSETTING(    0x00, "2 Min." )
294225   PORT_DIPSETTING(    0x60, "3 Min." )
295226   PORT_DIPSETTING(    0x40, "4 Min." )
296   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Has to be 0 */
227   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_SPECIAL )   // bit 2 of the watchdog counter
228
229   PORT_START      /* IN2 */
230   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
231   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
232   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
233   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
234   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
235   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
236   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
237   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
297238INPUT_PORTS_END
298239
299240/***************************************************************************
r2018r2019
302243
303244***************************************************************************/
304245
305static const gfx_layout charlayout1 =
246static const gfx_layout charlayout_3bpp =
306247{
307   8,8,   /* 8*8 characters */
308   256,   /* 256 characters */
309   3,      /* 3 bits per pixel */
310   { 0x4000*8+4, 0, 4 },   /* plane offset */
311   { 8*8+0, 8*8+1, 8*8+2, 8*8+3, 0, 1, 2, 3 },
312   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
313   16*8   /* every char takes 16 consecutive bytes */
248   8,8,
249   RGN_FRAC(1,2),
250   3,
251   { RGN_FRAC(1,2)+4, 0, 4 },
252   { STEP4(8*8,1), STEP4(0,1) },
253   { STEP8(0,8) },
254   16*8
314255};
315256
316static const gfx_layout charlayout2 =
257static const gfx_layout spritelayout_3bpp =
317258{
318   8,8,   /* 8*8 characters */
319   256,   /* 256 characters */
320   3,      /* 3 bits per pixel */
321   { 0x2000*8, 0, 4 },   /* plane offset */
322   { 8*8+0, 8*8+1, 8*8+2, 8*8+3, 0, 1, 2, 3 },
323   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
324   16*8   /* every char takes 16 consecutive bytes */
259   16,16,
260   RGN_FRAC(1,2),
261   3,
262   { RGN_FRAC(1,2)+4, 0, 4 },
263   { STEP4(8*8,1), STEP4(16*8,1), STEP4(24*8,1), STEP4(0,1) },
264   { STEP8(0,8), STEP8(32*8,8) },
265   64*8
325266};
326267
327static const gfx_layout spritelayout1 =
268static const gfx_layout spritelayout_4bpp =
328269{
329   16,16,       /* 16*16 sprites */
330   64,           /* 64 sprites */
331   3,           /* 3 bits per pixel */
332   { 0x4000*8+4, 0, 4 },   /* plane offset */
333   { 8*8, 8*8+1, 8*8+2, 8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3,
334         24*8+0, 24*8+1, 24*8+2, 24*8+3, 0, 1, 2, 3  },
335   { 0 * 8, 1 * 8, 2 * 8, 3 * 8, 4 * 8, 5 * 8, 6 * 8, 7 * 8,
336         32 * 8, 33 * 8, 34 * 8, 35 * 8, 36 * 8, 37 * 8, 38 * 8, 39 * 8 },
337   64*8   /* every sprite takes 64 bytes */
270   16,16,
271   RGN_FRAC(1,2),
272   4,
273   { RGN_FRAC(1,2)+0, RGN_FRAC(1,2)+4, 0, 4 },
274   { STEP4(8*8,1), STEP4(16*8,1), STEP4(24*8,1), STEP4(0,1) },
275   { STEP8(0,8), STEP8(32*8,8) },
276   64*8
338277};
339278
340static const gfx_layout spritelayout2 =
341{
342   16,16,       /* 16*16 sprites */
343   64,         /* 64 sprites */
344   3,           /* 3 bits per pixel */
345   { 0x2000*8, 0, 4 },   /* plane offset */
346   { 8*8, 8*8+1, 8*8+2, 8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3,
347         24*8+0, 24*8+1, 24*8+2, 24*8+3, 0, 1, 2, 3  },
348   { 0 * 8, 1 * 8, 2 * 8, 3 * 8, 4 * 8, 5 * 8, 6 * 8, 7 * 8,
349         32 * 8, 33 * 8, 34 * 8, 35 * 8, 36 * 8, 37 * 8, 38 * 8, 39 * 8 },
350   64*8   /* every sprite takes 64 bytes */
351};
352
353static const gfx_layout spritelayout =
354{
355   16,16,      /* 16*16 sprites */
356   64,          /* 64 sprites */
357   3,          /* 2 bits per pixel */
358   { 0x1000*8+4, 0, 4 },   /* plane offset */
359   { 8*8, 8*8+1, 8*8+2, 8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3,
360         24*8+0, 24*8+1, 24*8+2, 24*8+3, 0, 1, 2, 3  },
361   { 0 * 8, 1 * 8, 2 * 8, 3 * 8, 4 * 8, 5 * 8, 6 * 8, 7 * 8,
362         32 * 8, 33 * 8, 34 * 8, 35 * 8, 36 * 8, 37 * 8, 38 * 8, 39 * 8 },
363   64*8   /* every sprite takes 64 bytes */
364};
365
366279static GFXDECODE_START( exctsccr )
367   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout1,      0, 16 ) /* chars */
368   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, charlayout2,      0, 16 ) /* chars */
369   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, spritelayout1, 16*8, 32 ) /* sprites */
370   GFXDECODE_ENTRY( REGION_GFX1, 0x3000, spritelayout2, 16*8, 32 ) /* sprites */
371   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout,  16*8, 32 ) /* sprites */
280   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout_3bpp,   0x000, 0x080/8 ) /* chars */
281   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout_3bpp, 0x080, 0x080/8 ) /* sprites */
282   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout_4bpp, 0x100, 0x100/16 ) /* sprites */
372283GFXDECODE_END
373284
374285
r2018r2019
391302   MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 4000) /* 4 kHz, updates the dac */
392303
393304   /* MCU */
394#if MCU_HACK
395#else
396305   MDRV_CPU_ADD(ALPHA8301, 4000000/8)
397306   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
398#endif
399307
308   MDRV_MACHINE_START(exctsccr)
309
400310   /* video hardware */
401311   MDRV_SCREEN_ADD("main", RASTER)
402312   MDRV_SCREEN_REFRESH_RATE(60)
403   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
404313   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
405314   MDRV_SCREEN_SIZE(32*8, 32*8)
406315   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
407316
408317   MDRV_GFXDECODE(exctsccr)
409   MDRV_PALETTE_LENGTH(48*8)
318   MDRV_PALETTE_LENGTH(0x200)
410319
411320   MDRV_PALETTE_INIT(exctsccr)
412321   MDRV_VIDEO_START(exctsccr)
r2018r2019
416325   MDRV_SPEAKER_STANDARD_MONO("mono")
417326
418327   MDRV_SOUND_ADD(AY8910, 1500000)
419   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
328   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.08)
420329
421330   MDRV_SOUND_ADD(AY8910, 1500000)
422   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
331   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.08)
423332
424333   MDRV_SOUND_ADD(AY8910, 1500000)
425   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
334   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.08)
426335
427336   MDRV_SOUND_ADD(AY8910, 1500000)
428   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
337   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.08)
429338
430339   MDRV_SOUND_ADD(DAC, 0)
431   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
340   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
432341
433342   MDRV_SOUND_ADD(DAC, 0)
434   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
343   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
435344MACHINE_DRIVER_END
436345
437/* Bootleg */
346/* Bootleg on a modified Championship Baseball board */
438347static MACHINE_DRIVER_START( exctsccb )
439348
440349   /* basic machine hardware */
441   MDRV_CPU_ADD(Z80, 4000000)   /* 4.0 MHz (?) */
442   MDRV_CPU_PROGRAM_MAP(bl_readmem,bl_writemem)
350   MDRV_CPU_ADD(Z80, XTAL_18_432MHz/6)
351   MDRV_CPU_PROGRAM_MAP(bl_map,0)
443352   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
444353
445   MDRV_CPU_ADD(Z80, 3072000)   /* 3.072 MHz ? */
446   MDRV_CPU_PROGRAM_MAP(bl_sound_readmem,bl_sound_writemem)
354   MDRV_CPU_ADD(Z80, XTAL_18_432MHz/6)
355   MDRV_CPU_PROGRAM_MAP(bl_sound_map,0)
447356
448357   /* video hardware */
449358   MDRV_SCREEN_ADD("main", RASTER)
450359   MDRV_SCREEN_REFRESH_RATE(60)
451   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
452360   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
453361   MDRV_SCREEN_SIZE(32*8, 32*8)
454362   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
455363
456364   MDRV_GFXDECODE(exctsccr)
457   MDRV_PALETTE_LENGTH(48*8)
365   MDRV_PALETTE_LENGTH(0x200)
458366
459367   MDRV_PALETTE_INIT(exctsccr)
460368   MDRV_VIDEO_START(exctsccr)
r2018r2019
463371   /* sound hardware */
464372   MDRV_SPEAKER_STANDARD_MONO("mono")
465373
466   MDRV_SOUND_ADD(AY8910, 1500000)
374   MDRV_SOUND_ADD(AY8910, XTAL_18_432MHz/12)
467375   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
468376
469377   MDRV_SOUND_ADD(DAC, 0)
470   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
378   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
471379MACHINE_DRIVER_END
472380
473381/***************************************************************************
r2018r2019
489397   ROM_LOAD( "7_c6.bin",     0x6000, 0x2000, CRC(6d51521e) SHA1(2809bd2e61f40dcd31d43c62520982bdcfb0a865) )
490398   ROM_LOAD( "1_a6.bin",     0x8000, 0x1000, CRC(20f2207e) SHA1(b1ed2237d0bd50ddbe593fd2fbff9f1d67c1eb11) )
491399
492   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
493   ROM_LOAD( "4_a5.bin",     0x0000, 0x2000, CRC(c342229b) SHA1(a989d6c12521c77882a7e17d4d80afe7eae05906) )
494   ROM_LOAD( "5_b5.bin",     0x2000, 0x2000, CRC(35f4f8c9) SHA1(cdf5bbfea9abdd338938e5f4499d2d71ce3c6237) )
495   ROM_LOAD( "6_c5.bin",     0x4000, 0x2000, CRC(eda40e32) SHA1(6c08fd4f4fb35fd354d02e04548e960c545f6a88) )
400   ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE )   // 3bpp chars + sprites: rearranged by DRIVER_INIT to leave only chars
401   ROM_LOAD( "4_a5.bin",     0x0000, 0x2000, CRC(c342229b) SHA1(a989d6c12521c77882a7e17d4d80afe7eae05906) ) /* planes 0,1 */
402   ROM_LOAD( "6_c5.bin",     0x2000, 0x2000, CRC(eda40e32) SHA1(6c08fd4f4fb35fd354d02e04548e960c545f6a88) ) /* plane 3 */
496403
497   ROM_REGION( 0x02000, REGION_GFX2, ROMREGION_DISPOSE )
404   ROM_REGION( 0x04000, REGION_GFX2, ROMREGION_DISPOSE )   // 3bpp chars + sprites: rearranged by DRIVER_INIT to leave only sprites
405   ROM_LOAD( "5_b5.bin",     0x0000, 0x2000, CRC(35f4f8c9) SHA1(cdf5bbfea9abdd338938e5f4499d2d71ce3c6237) ) /* planes 0,1 */
406
407   ROM_REGION( 0x02000, REGION_GFX3, ROMREGION_DISPOSE )   // 4bpp sprites
498408   ROM_LOAD( "2_k5.bin",     0x0000, 0x1000, CRC(7f9cace2) SHA1(bf05a31716f3ca1c2fd1034cd1f39e2d21cdaed3) )
499409   ROM_LOAD( "3_l5.bin",     0x1000, 0x1000, CRC(db2d9e0d) SHA1(6ec09a47f7aea6bf31eb0ee78f44012f4d92de8a) )
500410
r2018r2019
517427   ROM_LOAD( "7_c6.bin",     0x6000, 0x2000, CRC(6d51521e) SHA1(2809bd2e61f40dcd31d43c62520982bdcfb0a865) )
518428   ROM_LOAD( "1_a6.bin",     0x8000, 0x1000, CRC(20f2207e) SHA1(b1ed2237d0bd50ddbe593fd2fbff9f1d67c1eb11) )
519429
520   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
521   ROM_LOAD( "4_a5.bin",     0x0000, 0x2000, CRC(c342229b) SHA1(a989d6c12521c77882a7e17d4d80afe7eae05906) )
522   ROM_LOAD( "5_b5.bin",     0x2000, 0x2000, CRC(35f4f8c9) SHA1(cdf5bbfea9abdd338938e5f4499d2d71ce3c6237) )
523   ROM_LOAD( "6_c5.bin",     0x4000, 0x2000, CRC(eda40e32) SHA1(6c08fd4f4fb35fd354d02e04548e960c545f6a88) )
430   ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE )   // 3bpp chars + sprites: rearranged by DRIVER_INIT to leave only chars
431   ROM_LOAD( "4_a5.bin",     0x0000, 0x2000, CRC(c342229b) SHA1(a989d6c12521c77882a7e17d4d80afe7eae05906) ) /* planes 0,1 */
432   ROM_LOAD( "6_c5.bin",     0x2000, 0x2000, CRC(eda40e32) SHA1(6c08fd4f4fb35fd354d02e04548e960c545f6a88) ) /* plane 3 */
524433
525   ROM_REGION( 0x02000, REGION_GFX2, ROMREGION_DISPOSE )
434   ROM_REGION( 0x04000, REGION_GFX2, ROMREGION_DISPOSE )   // 3bpp chars + sprites: rearranged by DRIVER_INIT to leave only sprites
435   ROM_LOAD( "5_b5.bin",     0x0000, 0x2000, CRC(35f4f8c9) SHA1(cdf5bbfea9abdd338938e5f4499d2d71ce3c6237) ) /* planes 0,1 */
436
437   ROM_REGION( 0x02000, REGION_GFX3, ROMREGION_DISPOSE )   // 4bpp sprites
526438   ROM_LOAD( "2_k5.bin",     0x0000, 0x1000, CRC(7f9cace2) SHA1(bf05a31716f3ca1c2fd1034cd1f39e2d21cdaed3) )
527439   ROM_LOAD( "3_l5.bin",     0x1000, 0x1000, CRC(db2d9e0d) SHA1(6ec09a47f7aea6bf31eb0ee78f44012f4d92de8a) )
528440
r2018r2019
544456   ROM_LOAD( "es-b.l2",      0x2000, 0x2000, CRC(8b3db794) SHA1(dbfed2357c7631bfca6bbd63a23617bc3abf6ca3) )
545457   ROM_LOAD( "es-c.m2",      0x4000, 0x2000, CRC(7bed2f81) SHA1(cbbb0480519cc04a99e8983228b18c9e49a9985d) )
546458
547   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
548   /* I'm using the ROMs from exctscc2, national flags are wrong (ITA replaces USA) */
549   ROM_LOAD( "vr.5a",        0x0000, 0x2000, BAD_DUMP CRC(4ff1783d) SHA1(c45074864c3a4bcbf3a87d164027ae16dca53d9c)  )
550   ROM_LOAD( "vr.5b",        0x2000, 0x2000, BAD_DUMP CRC(5605b60b) SHA1(19d5909896ae4a3d7552225c369d30475c56793b)  )
551   ROM_LOAD( "vr.5c",        0x4000, 0x2000, BAD_DUMP CRC(1fb84ee6) SHA1(56ceb86c509be783f806403ac21e7c9684760d5f)  )
459   /* the national flags are wrong. This happens on the real board */
460   ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE )   // 3bpp chars + sprites: rearranged by DRIVER_INIT to leave only chars
461   ROM_LOAD( "4_a5.bin",     0x0000, 0x2000, CRC(c342229b) SHA1(a989d6c12521c77882a7e17d4d80afe7eae05906) ) /* planes 0,1 */
462   ROM_LOAD( "6_c5.bin",     0x2000, 0x2000, CRC(eda40e32) SHA1(6c08fd4f4fb35fd354d02e04548e960c545f6a88) ) /* plane 3 */
552463
553   ROM_REGION( 0x02000, REGION_GFX2, ROMREGION_DISPOSE )
554   ROM_LOAD( "vr.5k",        0x0000, 0x1000, BAD_DUMP CRC(1d37edfa) SHA1(184fa6dd7b1b3fff4c5fc19b42301ccb7979ac84)  )
555   ROM_LOAD( "vr.5l",        0x1000, 0x1000, BAD_DUMP CRC(b97f396c) SHA1(4ffe512acf047230bd593911a615fc0ef66b481d)  )
464   ROM_REGION( 0x04000, REGION_GFX2, ROMREGION_DISPOSE )   // 3bpp chars + sprites: rearranged by DRIVER_INIT to leave only sprites
465   ROM_LOAD( "5_b5.bin",     0x0000, 0x2000, CRC(35f4f8c9) SHA1(cdf5bbfea9abdd338938e5f4499d2d71ce3c6237) ) /* planes 0,1 */
556466
467   ROM_REGION( 0x02000, REGION_GFX3, ROMREGION_DISPOSE )   // 4bpp sprites
468   ROM_LOAD( "2_k5.bin",     0x0000, 0x1000, CRC(7f9cace2) SHA1(bf05a31716f3ca1c2fd1034cd1f39e2d21cdaed3) )
469   ROM_LOAD( "3_l5.bin",     0x1000, 0x1000, CRC(db2d9e0d) SHA1(6ec09a47f7aea6bf31eb0ee78f44012f4d92de8a) )
470
557471   ROM_REGION( 0x0220, REGION_PROMS, 0 )
558472   ROM_LOAD( "prom1.e1",     0x0000, 0x0020, CRC(d9b10bf0) SHA1(bc1263331968f4bf37eb70ec4f56a8cb763c29d2) ) /* palette */
559473   ROM_LOAD( "prom2.8r",     0x0020, 0x0100, CRC(8a9c0edf) SHA1(8aad387e9409cff0eeb42eeb57e9ea88770a8c9a) ) /* lookup table */
r2018r2019
573487   ROM_LOAD( "7_c6.bin",     0x6000, 0x2000, CRC(6d51521e) SHA1(2809bd2e61f40dcd31d43c62520982bdcfb0a865) )   /* vr.7h */
574488   ROM_LOAD( "1_a6.bin",     0x8000, 0x1000, CRC(20f2207e) SHA1(b1ed2237d0bd50ddbe593fd2fbff9f1d67c1eb11) )   /* vr.7k */
575489
576   ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
577   ROM_LOAD( "vr.5a",        0x0000, 0x2000, CRC(4ff1783d) SHA1(c45074864c3a4bcbf3a87d164027ae16dca53d9c) )
578   ROM_LOAD( "vr.5b",        0x2000, 0x2000, CRC(5605b60b) SHA1(19d5909896ae4a3d7552225c369d30475c56793b) )
579   ROM_LOAD( "vr.5c",        0x4000, 0x2000, CRC(1fb84ee6) SHA1(56ceb86c509be783f806403ac21e7c9684760d5f) )
490   ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE )   // 3bpp chars + sprites: rearranged by DRIVER_INIT to leave only chars
491   ROM_LOAD( "vr.5a",        0x0000, 0x2000, CRC(4ff1783d) SHA1(c45074864c3a4bcbf3a87d164027ae16dca53d9c) ) /* planes 0,1 */
492   ROM_LOAD( "vr.5c",        0x2000, 0x2000, CRC(1fb84ee6) SHA1(56ceb86c509be783f806403ac21e7c9684760d5f) ) /* plane 3 */
580493
581   ROM_REGION( 0x02000, REGION_GFX2, ROMREGION_DISPOSE )
494   ROM_REGION( 0x04000, REGION_GFX2, ROMREGION_DISPOSE )   // 3bpp chars + sprites: rearranged by DRIVER_INIT to leave only sprites
495   ROM_LOAD( "vr.5b",        0x0000, 0x2000, CRC(5605b60b) SHA1(19d5909896ae4a3d7552225c369d30475c56793b) ) /* planes 0,1 */
496
497   ROM_REGION( 0x02000, REGION_GFX3, ROMREGION_DISPOSE )   // 4bpp sprites
582498   ROM_LOAD( "vr.5k",        0x0000, 0x1000, CRC(1d37edfa) SHA1(184fa6dd7b1b3fff4c5fc19b42301ccb7979ac84) )
583499   ROM_LOAD( "vr.5l",        0x1000, 0x1000, CRC(b97f396c) SHA1(4ffe512acf047230bd593911a615fc0ef66b481d) )
584500
r2018r2019
588504   ROM_LOAD( "prom3.k5",     0x0120, 0x0100, CRC(b5db1c2c) SHA1(900aaaac6b674a9c5c7b7804a4b0c3d5cce761aa) ) /* lookup table */
589505ROM_END
590506
591/* The games need a different MCU control */
592507
508
593509static DRIVER_INIT( exctsccr )
594510{
595#if MCU_HACK
596   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa006, 0xa006, 0, 0, exctsccr_mcu_control_w);
597#else
598   mcu_patch_data = exctsccr_mcu_patch_data;
599#endif
600}
511   // chars and sprites are mixed in the same ROMs, so rearrange them for easier decoding
512   UINT8 *rom1 = memory_region(REGION_GFX1);
513   UINT8 *rom2 = memory_region(REGION_GFX2);
514   int i;
601515
602static DRIVER_INIT( exctscc2 )
603{
604#if MCU_HACK
605   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa006, 0xa006, 0, 0, exctscc2_mcu_control_w);
606#else
607   mcu_patch_data = exctscc2_mcu_patch_data;
608#endif
516   // planes 0,1
517   for (i = 0; i < 0x1000; ++i)
518   {
519      UINT8 t = rom1[i + 0x1000];
520      rom1[i + 0x1000] = rom2[i];
521      rom2[i] = t;
522   }
523
524   // plane 3
525   for (i = 0; i < 0x1000; ++i)
526   {
527      rom2[i + 0x3000] = rom1[i + 0x3000] >> 4;
528      rom2[i + 0x2000] = rom1[i + 0x3000] & 0x0f;
529   }
530   for (i = 0; i < 0x1000; ++i)
531   {
532      rom1[i + 0x3000] = rom1[i + 0x2000] >> 4;
533      rom1[i + 0x2000] &= 0x0f;
534   }
609535}
610536
537
538
611539GAME( 1983, exctsccr, 0,        exctsccr, exctsccr, exctsccr, ROT90, "Alpha Denshi Co.", "Exciting Soccer", 0 )
612540GAME( 1983, exctscca, exctsccr, exctsccr, exctsccr, exctsccr, ROT90, "Alpha Denshi Co.", "Exciting Soccer (alternate music)", 0 )
613GAME( 1983, exctsccb, exctsccr, exctsccb, exctsccr, 0,        ROT90, "bootleg",          "Exciting Soccer (bootleg)", 0 )
614GAME( 1984, exctscc2, 0       , exctsccr, exctsccr, exctscc2, ROT90, "Alpha Denshi Co.", "Exciting Soccer II", GAME_IMPERFECT_GRAPHICS )
541GAME( 1983, exctsccb, exctsccr, exctsccb, exctsccr, exctsccr, ROT90, "bootleg",          "Exciting Soccer (bootleg)", 0 )
542GAME( 1984, exctscc2, 0       , exctsccr, exctsccr, exctsccr, ROT90, "Alpha Denshi Co.", "Exciting Soccer II", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/nmk16.c
r2018r2019
8181
8282----
8383
84tdragon,mustang and hachamf test mode:
84tdragon and hachamf test mode:
8585
86861)  Press player 2 buttons 1+2 during reset.  "Ready?" will appear
87872)  Press player 1 button 2 14 (!) times
8888
89mustang test mode:
90
911)  Press player 2 buttons 1+2 during reset.  "Ready?" will appear
922)  Press player 1 button 1 14 (!) times
93
8994gunnail test mode:
9095
91961)  Press player 2 buttons 1+2 during reset.  "Ready?" will appear
r2018r2019
41204125static MACHINE_DRIVER_START( tdragon )
41214126
41224127   /* basic machine hardware */
4123   MDRV_CPU_ADD(M68000, 10000000)
4128   MDRV_CPU_ADD(M68000, XTAL_8MHz) /* verified on pcb */
41244129   MDRV_CPU_PROGRAM_MAP(tdragon_readmem,tdragon_writemem)
41254130   MDRV_CPU_VBLANK_INT_HACK(nmk_interrupt,2)
41264131   //MDRV_CPU_VBLANK_INT("main", irq4_line_hold)
r2018r2019
41464151   /* sound hardware */
41474152   MDRV_SPEAKER_STANDARD_MONO("mono")
41484153
4149   MDRV_SOUND_ADD(YM2203, 1500000)
4154   MDRV_SOUND_ADD(YM2203, XTAL_12MHz/8) /* verified on pcb */
41504155   MDRV_SOUND_CONFIG(ym2203_nmk004_interface)
41514156   MDRV_SOUND_ROUTE(0, "mono", 0.50)
41524157   MDRV_SOUND_ROUTE(1, "mono", 0.50)
41534158   MDRV_SOUND_ROUTE(2, "mono", 0.50)
41544159   MDRV_SOUND_ROUTE(3, "mono", 2.00)
41554160
4156   MDRV_SOUND_ADD(OKIM6295, 16000000/4)
4157   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7low)
4161   MDRV_SOUND_ADD(OKIM6295, XTAL_8MHz/2) /* verified on pcb */
4162   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7low) /* verified on pcb */
41584163   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
41594164
4160   MDRV_SOUND_ADD(OKIM6295, 16000000/4)
4161   MDRV_SOUND_CONFIG(okim6295_interface_region_2_pin7low)
4165   MDRV_SOUND_ADD(OKIM6295, XTAL_8MHz/2) /* verified on pcb */
4166   MDRV_SOUND_CONFIG(okim6295_interface_region_2_pin7low) /* verified on pcb */
41624167   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
41634168MACHINE_DRIVER_END
41644169
r2018r2019
56465651
56475652ROM_START( tdragon )
56485653   ROM_REGION( 0x80000, REGION_CPU1, 0 )      /* 68000 code -bitswapped- */
5654   ROM_LOAD16_BYTE( "91070_68k.8",  0x00000, 0x20000, CRC(121c3ae7) SHA1(b88446df3b177d40e0b59a481f8e4de212e3afbc) )
5655   ROM_LOAD16_BYTE( "91070_68k.7",  0x00001, 0x20000, CRC(6e154d8e) SHA1(29baea24d670ab63149efe281de25cca15b7b863) )
5656
5657   ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE )
5658   ROM_LOAD( "91070.6",      0x000000, 0x20000, CRC(fe365920) SHA1(7581931cb95cd5a8ed40e4f5385b533e3d19af22) )   /* 8x8 tiles */
5659
5660   ROM_REGION( 0x100000, REGION_GFX2, ROMREGION_DISPOSE )
5661   ROM_LOAD( "91070.5",      0x000000, 0x100000, CRC(d0bde826) SHA1(3b74d5fc88a4a9329e101ee72f393608d327d816) )   /* 16x16 tiles */
5662
5663   ROM_REGION( 0x100000, REGION_GFX3, ROMREGION_DISPOSE )
5664   ROM_LOAD16_WORD_SWAP( "91070.4",   0x000000, 0x100000, CRC(3eedc2fe) SHA1(9f48986c231a8fbc07f2b39b2017d1e967b2ed3c) )   /* Sprites */
5665
5666   ROM_REGION( 0x010000, REGION_CPU2, 0 )      /* Code for (unknown?) CPU */
5667   ROM_LOAD( "91070.1",      0x00000, 0x10000, CRC(bf493d74) SHA1(6f8f5eff4b71fb6cabda10075cfa88a3f607859e) )
5668
5669   ROM_REGION( 0x0a0000, REGION_SOUND1, 0 )   /* OKIM6295 samples */
5670   ROM_LOAD( "91070.3",     0x00000, 0x20000, CRC(ae6875a8) SHA1(bfdb350b3d3fce2bead1ac60875beafe427765ed) )
5671   ROM_CONTINUE(            0x40000, 0x60000 )   /* banked */
5672
5673   ROM_REGION( 0x0a0000, REGION_SOUND2, 0 )   /* OKIM6295 samples */
5674   ROM_LOAD( "91070.2",     0x00000, 0x20000, CRC(ecfea43e) SHA1(d664dfa6698fec8e602523bdae16068f1ff6547b) )
5675   ROM_CONTINUE(            0x40000, 0x60000 )   /* banked */
5676
5677   ROM_REGION( 0x0200, REGION_PROMS, 0 )
5678   ROM_LOAD( "91070.9",  0x0000, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) )   /* unknown */
5679   ROM_LOAD( "91070.10", 0x0100, 0x0100, CRC(e6ead349) SHA1(6d81b1c0233580aa48f9718bade42d640e5ef3dd) )   /* unknown */
5680ROM_END
5681
5682ROM_START( tdragon1 )
5683   ROM_REGION( 0x80000, REGION_CPU1, 0 )      /* 68000 code -bitswapped- */
56495684   ROM_LOAD16_BYTE( "thund.8",  0x00000, 0x20000, CRC(edd02831) SHA1(d6bc8d2c37707768a8bf666090f33eea12dda336) )
56505685   ROM_LOAD16_BYTE( "thund.7",  0x00001, 0x20000, CRC(52192fe5) SHA1(9afef197410e7feb71dc48003e181fbbaf5c99b2) )
56515686
56525687   ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE )
5653   ROM_LOAD( "thund.6",      0x000000, 0x20000, CRC(fe365920) SHA1(7581931cb95cd5a8ed40e4f5385b533e3d19af22) )   /* 8x8 tiles */
5688   ROM_LOAD( "91070.6",      0x000000, 0x20000, CRC(fe365920) SHA1(7581931cb95cd5a8ed40e4f5385b533e3d19af22) )   /* 8x8 tiles */
56545689
56555690   ROM_REGION( 0x100000, REGION_GFX2, ROMREGION_DISPOSE )
5656   ROM_LOAD( "thund.5",      0x000000, 0x100000, CRC(d0bde826) SHA1(3b74d5fc88a4a9329e101ee72f393608d327d816) )   /* 16x16 tiles */
5691   ROM_LOAD( "91070.5",      0x000000, 0x100000, CRC(d0bde826) SHA1(3b74d5fc88a4a9329e101ee72f393608d327d816) )   /* 16x16 tiles */
56575692
56585693   ROM_REGION( 0x100000, REGION_GFX3, ROMREGION_DISPOSE )
5659   ROM_LOAD16_WORD_SWAP( "thund.4",   0x000000, 0x100000, CRC(3eedc2fe) SHA1(9f48986c231a8fbc07f2b39b2017d1e967b2ed3c) )   /* Sprites */
5694   ROM_LOAD16_WORD_SWAP( "91070.4",   0x000000, 0x100000, CRC(3eedc2fe) SHA1(9f48986c231a8fbc07f2b39b2017d1e967b2ed3c) )   /* Sprites */
56605695
56615696   ROM_REGION( 0x010000, REGION_CPU2, 0 )      /* Code for (unknown?) CPU */
5662   ROM_LOAD( "thund.1",      0x00000, 0x10000, CRC(bf493d74) SHA1(6f8f5eff4b71fb6cabda10075cfa88a3f607859e) )
5697   ROM_LOAD( "91070.1",      0x00000, 0x10000, CRC(bf493d74) SHA1(6f8f5eff4b71fb6cabda10075cfa88a3f607859e) )
56635698
56645699   ROM_REGION( 0x0a0000, REGION_SOUND1, 0 )   /* OKIM6295 samples */
5665   ROM_LOAD( "thund.3",     0x00000, 0x20000, CRC(ae6875a8) SHA1(bfdb350b3d3fce2bead1ac60875beafe427765ed) )
5700   ROM_LOAD( "91070.3",     0x00000, 0x20000, CRC(ae6875a8) SHA1(bfdb350b3d3fce2bead1ac60875beafe427765ed) )
56665701   ROM_CONTINUE(            0x40000, 0x60000 )   /* banked */
56675702
56685703   ROM_REGION( 0x0a0000, REGION_SOUND2, 0 )   /* OKIM6295 samples */
5669   ROM_LOAD( "thund.2",     0x00000, 0x20000, CRC(ecfea43e) SHA1(d664dfa6698fec8e602523bdae16068f1ff6547b) )
5704   ROM_LOAD( "91070.2",     0x00000, 0x20000, CRC(ecfea43e) SHA1(d664dfa6698fec8e602523bdae16068f1ff6547b) )
56705705   ROM_CONTINUE(            0x40000, 0x60000 )   /* banked */
56715706
56725707   ROM_REGION( 0x0200, REGION_PROMS, 0 )
5673   ROM_LOAD( "9.bin",  0x0000, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) )   /* unknown */
5674   ROM_LOAD( "10.bin", 0x0100, 0x0100, CRC(e6ead349) SHA1(6d81b1c0233580aa48f9718bade42d640e5ef3dd) )   /* unknown */
5708   ROM_LOAD( "91070.9",  0x0000, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) )   /* unknown */
5709   ROM_LOAD( "91070.10", 0x0100, 0x0100, CRC(e6ead349) SHA1(6d81b1c0233580aa48f9718bade42d640e5ef3dd) )   /* unknown */
56755710ROM_END
56765711
56775712ROM_START( tdragonb )
r2018r2019
69216956
69226957GAME( 1989, tharrier, 0,        tharrier, tharrier, 0,        ROT270, "UPL (American Sammy license)", "Task Force Harrier", 0  )
69236958GAME( 1989, tharierj, tharrier, tharrier, tharrier, 0,        ROT270, "UPL",                          "Task Force Harrier (Japan)", 0 )
6924GAME( 1990, mustang,  0,        mustang,  mustang,  0,        ROT0,   "UPL",                          "US AAF Mustang (Japan)", GAME_IMPERFECT_SOUND)
6925GAME( 1990, mustangs, mustang,  mustang,  mustang,  0,        ROT0,   "UPL (Seoul Trading license)",  "US AAF Mustang (Seoul Trading)", GAME_IMPERFECT_SOUND )
6959GAME( 1990, mustang,  0,        mustang,  mustang,  0,        ROT0,   "UPL",                          "US AAF Mustang (25th May. 1990)", GAME_IMPERFECT_SOUND)
6960GAME( 1990, mustangs, mustang,  mustang,  mustang,  0,        ROT0,   "UPL (Seoul Trading license)",  "US AAF Mustang (25th May. 1990 / Seoul Trading)", GAME_IMPERFECT_SOUND )
69266961GAME( 1990, bioship,  0,        bioship,  bioship,  0,        ROT0,   "UPL (American Sammy license)", "Bio-ship Paladin", GAME_IMPERFECT_SOUND )
69276962GAME( 1990, sbsgomo,  bioship,  bioship,  bioship,  0,        ROT0,   "UPL",                          "Space Battle Ship Gomorrah", GAME_IMPERFECT_SOUND )
69286963GAME( 1990, vandyke,  0,        vandyke,  vandyke,  0,        ROT270, "UPL",                          "Vandyke (Japan)",  GAME_IMPERFECT_SOUND )
r2018r2019
69346969GAME( 1991, acrobatm, 0,        acrobatm, acrobatm, 0,        ROT270, "UPL (Taito license)",          "Acrobat Mission", GAME_IMPERFECT_SOUND )
69356970GAME( 1992, strahl,   0,        strahl,   strahl,   0,        ROT0,   "UPL",                          "Koutetsu Yousai Strahl (Japan set 1)", GAME_IMPERFECT_SOUND )
69366971GAME( 1992, strahla,  strahl,   strahl,   strahl,   0,        ROT0,   "UPL",                          "Koutetsu Yousai Strahl (Japan set 2)", GAME_IMPERFECT_SOUND )
6937GAME( 1991, tdragon,  0,        tdragon,  tdragon,  tdragon,  ROT270, "NMK (Tecmo license)",          "Thunder Dragon", GAME_IMPERFECT_SOUND )
6972GAME( 1991, tdragon,  0,        tdragon,  tdragon,  tdragon,  ROT270, "NMK (Tecmo license)",          "Thunder Dragon (9th Jan. 1992)", GAME_IMPERFECT_SOUND )
6973GAME( 1991, tdragon1, tdragon,  tdragon,  tdragon,  tdragon,  ROT270, "NMK (Tecmo license)",          "Thunder Dragon (4th Jun. 1991)", GAME_IMPERFECT_SOUND )
69386974
6939GAME( 1991, hachamf,  0,        hachamf,  hachamf,  hachamf,  ROT0,   "NMK",                          "Hacha Mecha Fighter", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
6975GAME( 1991, hachamf,  0,        hachamf,  hachamf,  hachamf,  ROT0,   "NMK",                          "Hacha Mecha Fighter (19th Sep. 1991)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
69406976GAME( 1992, macross,  0,        macross,  macross,  nmk,      ROT270, "Banpresto",                    "Super Spacefortress Macross / Chou-Jikuu Yousai Macross", GAME_IMPERFECT_SOUND )
6941GAME( 1993, gunnail,  0,        gunnail,  gunnail,  nmk,      ROT270, "NMK / Tecmo",                  "GunNail", GAME_IMPERFECT_SOUND )
6977GAME( 1993, gunnail,  0,        gunnail,  gunnail,  nmk,      ROT270, "NMK / Tecmo",                  "GunNail (28th May. 1992)", GAME_IMPERFECT_SOUND )
69426978GAME( 1993, macross2, 0,        macross2, macross2, 0,        ROT0,   "Banpresto",                    "Super Spacefortress Macross II / Chou-Jikuu Yousai Macross II", GAME_NO_COCKTAIL )
69436979GAME( 1993, tdragon2, 0,        tdragon2, tdragon2, 0,        ROT270, "NMK",                          "Thunder Dragon 2 (9th Nov. 1993)", GAME_NO_COCKTAIL )
69446980GAME( 1993, tdragn2a, tdragon2, tdragon2, tdragon2, 0,        ROT270, "NMK",                          "Thunder Dragon 2 (1st Oct. 1993)", GAME_NO_COCKTAIL )
69456981GAME( 1993, bigbang,  tdragon2, tdragon2, tdragon2, 0,        ROT270, "NMK",                          "Big Bang (9th Nov. 1993)", GAME_NO_COCKTAIL )
69466982GAME( 1994, raphero,  0,        raphero,  raphero,  0,        ROT270, "Media Trading Corp",           "Rapid Hero (Japan?)", GAME_IMPERFECT_SOUND ) // 23rd July 1993 in test mode, (c)1994 on title screen
69476983
6948GAME( 1992, sabotenb, 0,        bjtwin,   sabotenb, nmk,      ROT0,   "NMK / Tecmo",                  "Saboten Bombers (set 1)", GAME_NO_COCKTAIL )
6949GAME( 1992, sabotnba, sabotenb, bjtwin,   sabotenb, nmk,      ROT0,   "NMK / Tecmo",                  "Saboten Bombers (set 2)", GAME_NO_COCKTAIL )
6984GAME( 1992, sabotenb, 0,        bjtwin,   sabotenb, nmk,      ROT0,   "NMK / Tecmo",                  "Saboten Bombers (9th Mar. 1992 / set 1)", GAME_NO_COCKTAIL )
6985GAME( 1992, sabotnba, sabotenb, bjtwin,   sabotenb, nmk,      ROT0,   "NMK / Tecmo",                  "Saboten Bombers (9th Mar. 1992 / set 2)", GAME_NO_COCKTAIL )
69506986GAME( 1993, bjtwin,   0,        bjtwin,   bjtwin,   bjtwin,   ROT270, "NMK",                          "Bombjack Twin", GAME_NO_COCKTAIL )
69516987GAME( 1995, nouryoku, 0,        bjtwin,   nouryoku, nmk,      ROT0,   "Tecmo",                        "Nouryoku Koujou Iinkai", GAME_NO_COCKTAIL )
69526988
src/osd/windows/winfile.c
r2018r2019
4242
4343
4444//============================================================
45//  INLINE FUNCTIONS
46//============================================================
47
48INLINE int is_path_to_physical_drive(const char *path)
49{
50   return (_strnicmp(path, "\\\\.\\physicaldrive", 17) == 0);
51}
52
53
54
55//============================================================
4556//  osd_open
4657//============================================================
4758
r2018r2019
7990   // select the file open modes
8091   if (openflags & OPEN_FLAG_WRITE)
8192   {
82      disposition = (openflags & OPEN_FLAG_CREATE) ? CREATE_ALWAYS : OPEN_EXISTING;
93      disposition = (!is_path_to_physical_drive(path) && (openflags & OPEN_FLAG_CREATE)) ? CREATE_ALWAYS : OPEN_EXISTING;
8394      access = (openflags & OPEN_FLAG_READ) ? (GENERIC_READ | GENERIC_WRITE) : GENERIC_WRITE;
8495      sharemode = 0;
8596   }
r2018r2019
250261   int result;
251262
252263   // if it doesn't smell like a physical drive, just return FALSE
253   if (_strnicmp(filename, "\\\\.\\physicaldrive", 17) != 0)
264   if (!is_path_to_physical_drive(filename))
254265      return FALSE;
255266
256267   // do a create file on the drive
src/osd/windows/winwork.c
r2018r2019
427427               (double)thread->waittime * 100.0 / (double)total);
428428      }
429429#endif
430   }
430431
431      // free the list
432   // free the list
433   if (queue->thread != NULL)
432434      free(queue->thread);
433   }
434435
435436   // free all the events
436437   if (queue->doneevent != NULL)
src/osd/windows/drawdd.c
r2018r2019
12911291
12921292static void pick_best_mode(win_window_info *window)
12931293{
1294   const device_config *primary_screen = video_screen_first(Machine->config);
12941295   dd_info *dd = window->drawdata;
12951296   mode_enum_info einfo;
12961297   HRESULT result;
r2018r2019
13041305   // use those as the target for now
13051306   einfo.target_width = einfo.minimum_width * MAX(1, video_config.prescale);
13061307   einfo.target_height = einfo.minimum_height * MAX(1, video_config.prescale);
1307   einfo.target_refresh = ATTOSECONDS_TO_HZ(video_screen_get_frame_period(Machine->primary_screen).attoseconds);
13081308
1309   // determine the refresh rate of the primary screen
1310   einfo.target_refresh = 60.0;
1311   if (primary_screen != NULL)
1312   {
1313      const screen_config *config = primary_screen->inline_config;
1314      einfo.target_refresh = ATTOSECONDS_TO_HZ(config->refresh);
1315   }
1316   printf("Target refresh = %f\n", einfo.target_refresh);
1317
13091318   // if we're not stretching, allow some slop on the minimum since we can handle it
13101319   if (!video_config.hwstretch)
13111320   {
src/osd/windows/drawd3d.c
r2018r2019
12381238
12391239static void pick_best_mode(win_window_info *window)
12401240{
1241   double target_refresh = ATTOSECONDS_TO_HZ(video_screen_get_frame_period(Machine->primary_screen).attoseconds);
1241   const device_config *primary_screen = video_screen_first(Machine->config);
1242   double target_refresh = 60.0;
12421243   INT32 target_width, target_height;
12431244   d3d_info *d3d = window->drawdata;
12441245   INT32 minwidth, minheight;
r2018r2019
12461247   int maxmodes;
12471248   int modenum;
12481249
1250   // determine the refresh rate of the primary screen
1251   if (primary_screen != NULL)
1252   {
1253      const screen_config *config = primary_screen->inline_config;
1254      target_refresh = ATTOSECONDS_TO_HZ(config->refresh);
1255   }
1256
12491257   // determine the minimum width/height for the selected target
12501258   // note: technically we should not be calling this from an alternate window
12511259   // thread; however, it is only done during init time, and the init code on
src/emu/debug/debugcpu.c
r2018r2019
297297
298298   /* add callback for breaking on VBLANK */
299299   if (machine->primary_screen != NULL)
300      video_screen_register_vbl_cb(machine->primary_screen, on_vblank);
300      video_screen_register_vblank_callback(machine->primary_screen, on_vblank);
301301
302302   add_exit_callback(machine, debug_cpu_exit);
303303}
src/emu/cpu/lh5801/lh5801.h
r2018r2019
7171#define LH5801_INT_NONE 0
7272#define LH5801_IRQ 1
7373
74void lh5801_get_info(UINT32 state, cpuinfo *info);
7475extern offs_t lh5801_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
7576
7677#endif
src/emu/cpu/m68000/m68kmame.c
r2018r2019
928928      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
929929      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
930930      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
931      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 16;                     break;
931      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 20;                     break;
932932      case CPUINFO_INT_MIN_CYCLES:               info->i = 4;                     break;
933933      case CPUINFO_INT_MAX_CYCLES:               info->i = 158;                     break;
934934
r2018r2019
11701170      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
11711171      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
11721172      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
1173      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 16;                     break;
1173      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 20;                     break;
11741174      case CPUINFO_INT_MIN_CYCLES:               info->i = 4;                     break;
11751175      case CPUINFO_INT_MAX_CYCLES:               info->i = 158;                     break;
11761176
src/emu/cpu/e132xs/e132xs.c
r2018r2019
14701470   /* IO3 is priority 5; state is in bit 6 of ISR; FCR bit 10 enables input and FCR bit 8 inhibits interrupt */
14711471   if (IO3_LINE_STATE && (FCR & 0x00000500) == 0x00000400)
14721472   {
1473      execute_int(get_trap_addr(IO3));
1473      execute_int(get_trap_addr(TRAPNO_IO3));
14741474      (*hyperstone.irq_callback)(IRQ_IO3);
14751475      return;
14761476   }
r2018r2019
14791479   if (hyperstone.timer_int_pending && (FCR & 0x00b00000) == 0x00300000)
14801480   {
14811481      hyperstone.timer_int_pending = 0;
1482      execute_int(get_trap_addr(TIMER));
1482      execute_int(get_trap_addr(TRAPNO_TIMER));
14831483      return;
14841484   }
14851485
14861486   /* INT1 is priority 7; state is in bit 0 of ISR; FCR bit 28 inhibits interrupt */
14871487   if (INT1_LINE_STATE && (FCR & 0x10000000) == 0x00000000)
14881488   {
1489      execute_int(get_trap_addr(INT1));
1489      execute_int(get_trap_addr(TRAPNO_INT1));
14901490      (*hyperstone.irq_callback)(IRQ_INT1);
14911491      return;
14921492   }
r2018r2019
14951495   if (hyperstone.timer_int_pending && (FCR & 0x00b00000) == 0x00200000)
14961496   {
14971497      hyperstone.timer_int_pending = 0;
1498      execute_int(get_trap_addr(TIMER));
1498      execute_int(get_trap_addr(TRAPNO_TIMER));
14991499      return;
15001500   }
15011501
15021502   /* INT2 is priority 9; state is in bit 1 of ISR; FCR bit 29 inhibits interrupt */
15031503   if (INT2_LINE_STATE && (FCR & 0x20000000) == 0x00000000)
15041504   {
1505      execute_int(get_trap_addr(INT2));
1505      execute_int(get_trap_addr(TRAPNO_INT2));
15061506      (*hyperstone.irq_callback)(IRQ_INT2);
15071507      return;
15081508   }
r2018r2019
15111511   if (hyperstone.timer_int_pending && (FCR & 0x00b00000) == 0x00100000)
15121512   {
15131513      hyperstone.timer_int_pending = 0;
1514      execute_int(get_trap_addr(TIMER));
1514      execute_int(get_trap_addr(TRAPNO_TIMER));
15151515      return;
15161516   }
15171517
15181518   /* INT3 is priority 11; state is in bit 2 of ISR; FCR bit 30 inhibits interrupt */
15191519   if (INT3_LINE_STATE && (FCR & 0x40000000) == 0x00000000)
15201520   {
1521      execute_int(get_trap_addr(INT3));
1521      execute_int(get_trap_addr(TRAPNO_INT3));
15221522      (*hyperstone.irq_callback)(IRQ_INT3);
15231523      return;
15241524   }
r2018r2019
15271527   if (hyperstone.timer_int_pending && (FCR & 0x00b00000) == 0x00000000)
15281528   {
15291529      hyperstone.timer_int_pending = 0;
1530      execute_int(get_trap_addr(TIMER));
1530      execute_int(get_trap_addr(TRAPNO_TIMER));
15311531      return;
15321532   }
15331533
15341534   /* INT4 is priority 13; state is in bit 3 of ISR; FCR bit 31 inhibits interrupt */
15351535   if (INT4_LINE_STATE && (FCR & 0x80000000) == 0x00000000)
15361536   {
1537      execute_int(get_trap_addr(INT4));
1537      execute_int(get_trap_addr(TRAPNO_INT4));
15381538      (*hyperstone.irq_callback)(IRQ_INT4);
15391539      return;
15401540   }
r2018r2019
15421542   /* IO1 is priority 14; state is in bit 4 of ISR; FCR bit 2 enables input and FCR bit 0 inhibits interrupt */
15431543   if (IO1_LINE_STATE && (FCR & 0x00000005) == 0x00000004)
15441544   {
1545      execute_int(get_trap_addr(IO1));
1545      execute_int(get_trap_addr(TRAPNO_IO1));
15461546      (*hyperstone.irq_callback)(IRQ_IO1);
15471547      return;
15481548   }
r2018r2019
15501550   /* IO2 is priority 15; state is in bit 5 of ISR; FCR bit 6 enables input and FCR bit 4 inhibits interrupt */
15511551   if (IO2_LINE_STATE && (FCR & 0x00000050) == 0x00000040)
15521552   {
1553      execute_int(get_trap_addr(IO2));
1553      execute_int(get_trap_addr(TRAPNO_IO2));
15541554      (*hyperstone.irq_callback)(IRQ_IO2);
15551555      return;
15561556   }
r2018r2019
17391739   set_global_register(FCR_REGISTER, ~0);
17401740   set_global_register(TPR_REGISTER, 0xc000000);
17411741
1742   PC = get_trap_addr(RESET);
1742   PC = get_trap_addr(TRAPNO_RESET);
17431743   change_pc(PC);
17441744
17451745   SET_FP(0);
r2018r2019
17861786
17871787INLINE void hyperstone_chk(struct regs_decode *decode)
17881788{
1789   UINT32 addr = get_trap_addr(RANGE_ERROR);
1789   UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR);
17901790
17911791   if( SRC_IS_SR )
17921792   {
r2018r2019
18391839
18401840         if( (!old_s && GET_S) || (!GET_S && !old_l && GET_L))
18411841         {
1842            UINT32 addr = get_trap_addr(PRIVILEGE_ERROR);
1842            UINT32 addr = get_trap_addr(TRAPNO_PRIVILEGE_ERROR);
18431843            execute_exception(addr);
18441844         }
18451845
r2018r2019
19151915            //N -> undefined
19161916            UINT32 addr;
19171917            SET_V(1);
1918            addr = get_trap_addr(RANGE_ERROR);
1918            addr = get_trap_addr(TRAPNO_RANGE_ERROR);
19191919            execute_exception(addr);
19201920         }
19211921         else
r2018r2019
19641964            //N -> undefined
19651965            UINT32 addr;
19661966            SET_V(1);
1967            addr = get_trap_addr(RANGE_ERROR);
1967            addr = get_trap_addr(TRAPNO_RANGE_ERROR);
19681968            execute_exception(addr);
19691969         }
19701970         else
r2018r2019
20042004         case 3:
20052005            if( !SRC_IS_PC && (SREG > EXTRA_U) )
20062006            {
2007               UINT32 addr = get_trap_addr(RANGE_ERROR);
2007               UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR);
20082008               execute_exception(addr);
20092009            }
20102010            else if( SRC_IS_PC && (SREG >= EXTRA_U) )
20112011            {
2012               UINT32 addr = get_trap_addr(RANGE_ERROR);
2012               UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR);
20132013               execute_exception(addr);
20142014            }
20152015            else
r2018r2019
20952095
20962096   if( GET_V && !SRC_IS_SR )
20972097   {
2098      UINT32 addr = get_trap_addr(RANGE_ERROR);
2098      UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR);
20992099      execute_exception(addr);
21002100   }
21012101}
r2018r2019
21322132{
21332133   if( !GET_S && decode->dst >= 16 )
21342134   {
2135      UINT32 addr = get_trap_addr(PRIVILEGE_ERROR);
2135      UINT32 addr = get_trap_addr(TRAPNO_PRIVILEGE_ERROR);
21362136      execute_exception(addr);
21372137   }
21382138
r2018r2019
21972197
21982198   if( GET_V )
21992199   {
2200      UINT32 addr = get_trap_addr(RANGE_ERROR);
2200      UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR);
22012201      execute_exception(addr);
22022202   }
22032203}
r2018r2019
23332333
23342334   if( GET_V )
23352335   {
2336      UINT32 addr = get_trap_addr(RANGE_ERROR);
2336      UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR);
23372337      execute_exception(addr);
23382338   }
23392339}
r2018r2019
24372437
24382438   if( GET_V && !SRC_IS_SR ) //trap doesn't occur when source is SR
24392439   {
2440      UINT32 addr = get_trap_addr(RANGE_ERROR);
2440      UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR);
24412441      execute_exception(addr);
24422442   }
24432443}
r2018r2019
24712471{
24722472   if( !GET_S && decode->dst >= 16 )
24732473   {
2474      UINT32 addr = get_trap_addr(PRIVILEGE_ERROR);
2474      UINT32 addr = get_trap_addr(TRAPNO_PRIVILEGE_ERROR);
24752475      execute_exception(addr);
24762476   }
24772477
r2018r2019
25452545
25462546   if( GET_V )
25472547   {
2548      UINT32 addr = get_trap_addr(RANGE_ERROR);
2548      UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR);
25492549      execute_exception(addr);
25502550   }
25512551}
r2018r2019
45164516
45174517      if( tmp_flag )
45184518      {
4519         UINT32 addr = get_trap_addr(FRAME_ERROR);
4519         UINT32 addr = get_trap_addr(TRAPNO_FRAME_ERROR);
45204520         execute_exception(addr);
45214521      }
45224522   }
r2018r2019
47804780
47814781      if( GET_T && GET_P && hyperstone.delay.delay_cmd == NO_DELAY ) /* Not in a Delayed Branch instructions */
47824782      {
4783         UINT32 addr = get_trap_addr(TRACE_EXCEPTION);
4783         UINT32 addr = get_trap_addr(TRAPNO_TRACE_EXCEPTION);
47844784         execute_exception(addr);
47854785      }
47864786
src/emu/cpu/e132xs/e132xs.h
r2018r2019
156156#define IRQ_IO3         6
157157
158158/* Trap numbers */
159#define IO2               48
160#define IO1               49
161#define INT4            50
162#define INT3            51
163#define INT2            52
164#define INT1            53
165#define IO3               54
166#define TIMER            55
167#define RESERVED1         56
168#define TRACE_EXCEPTION      57
169#define PARITY_ERROR      58
170#define EXTENDED_OVERFLOW   59
171#define RANGE_ERROR         60
172#define PRIVILEGE_ERROR      RANGE_ERROR
173#define FRAME_ERROR         RANGE_ERROR
174#define RESERVED2         61
175#define RESET            62   // reserved if not mapped @ MEM3
176#define ERROR_ENTRY         63   // for instruction code of all ones
159#define TRAPNO_IO2               48
160#define TRAPNO_IO1               49
161#define TRAPNO_INT4            50
162#define TRAPNO_INT3            51
163#define TRAPNO_INT2            52
164#define TRAPNO_INT1            53
165#define TRAPNO_IO3               54
166#define TRAPNO_TIMER            55
167#define TRAPNO_RESERVED1         56
168#define TRAPNO_TRACE_EXCEPTION      57
169#define TRAPNO_PARITY_ERROR      58
170#define TRAPNO_EXTENDED_OVERFLOW   59
171#define TRAPNO_RANGE_ERROR         60
172#define TRAPNO_PRIVILEGE_ERROR      TRAPNO_RANGE_ERROR
173#define TRAPNO_FRAME_ERROR         TRAPNO_RANGE_ERROR
174#define TRAPNO_RESERVED2         61
175#define TRAPNO_RESET            62   // reserved if not mapped @ MEM3
176#define TRAPNO_ERROR_ENTRY         63   // for instruction code of all ones
177177
178178/* Traps code */
179179#define   TRAPLE      4
src/emu/cpu/sh4/sh4dasm.c
r2018r2019
142142
143143static UINT32 op0001(char *buffer, UINT32 pc, UINT16 opcode)
144144{
145   sprintf(buffer, "MOV.L   %s,@($%02X,%s)\n", regname[Rm], (opcode & 15) * 4, regname[Rn]);
145   sprintf(buffer, "MOV.L   %s,@($%02X,%s)", regname[Rm], (opcode & 15) * 4, regname[Rn]);
146146   return 0;
147147}
148148
r2018r2019
462462
463463static UINT32 op0101(char *buffer, UINT32 pc, UINT16 opcode)
464464{
465   sprintf(buffer, "MOV.L   @($%02X,%s),%s\n", (opcode & 15) * 4, regname[Rm], regname[Rn]);
465   sprintf(buffer, "MOV.L   @($%02X,%s),%s", (opcode & 15) * 4, regname[Rm], regname[Rn]);
466466   return 0;
467467}
468468
r2018r2019
525525
526526static UINT32 op0111(char *buffer, UINT32 pc, UINT16 opcode)
527527{
528   sprintf(buffer, "ADD     #$%02X,%s\n", opcode & 0xff, regname[Rn]);
528   sprintf(buffer, "ADD     #$%02X,%s", opcode & 0xff, regname[Rn]);
529529   return 0;
530530}
531531
r2018r2019
561561      sprintf(buffer, "BFS     $%08X", pc + SIGNX8(opcode & 0xff) * 2 + 2);
562562      break;
563563   default :
564      sprintf(buffer, "invalid $%04X\n", opcode);
564      sprintf(buffer, "invalid $%04X", opcode);
565565   }
566566   return 0;
567567}
r2018r2019
659659   switch (opcode & 0xf)
660660   {
661661      case 0:
662         sprintf(buffer, "FADD    F%s, F%s\n", regname[Rm], regname[Rn]);
662         sprintf(buffer, "FADD    F%s, F%s", regname[Rm], regname[Rn]);
663663         break;
664664      case 1:
665         sprintf(buffer, "FSUB    F%s, F%s\n", regname[Rm], regname[Rn]);
665         sprintf(buffer, "FSUB    F%s, F%s", regname[Rm], regname[Rn]);
666666         break;
667667      case 2:
668         sprintf(buffer, "FMUL    F%s, F%s\n", regname[Rm], regname[Rn]);
668         sprintf(buffer, "FMUL    F%s, F%s", regname[Rm], regname[Rn]);
669669         break;
670670      case 3:
671         sprintf(buffer, "FDIV    F%s, F%s\n", regname[Rm], regname[Rn]);
671         sprintf(buffer, "FDIV    F%s, F%s", regname[Rm], regname[Rn]);
672672         break;
673673      case 4:
674         sprintf(buffer, "FCMP/EQ    F%s, F%s\n", regname[Rm], regname[Rn]);
674         sprintf(buffer, "FCMP/EQ    F%s, F%s", regname[Rm], regname[Rn]);
675675         break;
676676      case 5:
677         sprintf(buffer, "FCMP/GT    F%s, F%s\n", regname[Rm], regname[Rn]);
677         sprintf(buffer, "FCMP/GT    F%s, F%s", regname[Rm], regname[Rn]);
678678         break;
679679      case 6:
680         sprintf(buffer, "FMOV.S  @(R0,%s),F%s\n", regname[Rm], regname[Rn]);
680         sprintf(buffer, "FMOV.S  @(R0,%s),F%s", regname[Rm], regname[Rn]);
681681         break;
682682      case 7:
683         sprintf(buffer, "FMOV.S  F%s, @(R0,%s)\n", regname[Rm], regname[Rn]);
683         sprintf(buffer, "FMOV.S  F%s, @(R0,%s)", regname[Rm], regname[Rn]);
684684         break;
685685      case 8:
686         sprintf(buffer, "FMOV.S  @%s, F%s\n", regname[Rm], regname[Rn]);
686         sprintf(buffer, "FMOV.S  @%s, F%s", regname[Rm], regname[Rn]);
687687         break;
688688      case 9:
689         sprintf(buffer, "FMOV.S  @%s+, F%s\n", regname[Rm], regname[Rn]);
689         sprintf(buffer, "FMOV.S  @%s+, F%s", regname[Rm], regname[Rn]);
690690         break;
691691      case 10:
692         sprintf(buffer, "FMOV.S  F%s, @%s\n", regname[Rm], regname[Rn]);
692         sprintf(buffer, "FMOV.S  F%s, @%s", regname[Rm], regname[Rn]);
693693         break;
694694      case 11:
695         sprintf(buffer, "FMOV.S  F%s, @-%s\n", regname[Rm], regname[Rn]);
695         sprintf(buffer, "FMOV.S  F%s, @-%s", regname[Rm], regname[Rn]);
696696         break;
697697      case 12:
698         sprintf(buffer, "FMOV.S  F%s, F%s\n", regname[Rm], regname[Rn]);
698         sprintf(buffer, "FMOV.S  F%s, F%s", regname[Rm], regname[Rn]);
699699         break;
700700      case 13:
701701         switch (opcode & 0xF0)
702702         {
703703            case 0x00:
704               sprintf(buffer, "FSTS    FPUL, F%s\n", regname[Rn]);
704               sprintf(buffer, "FSTS    FPUL, F%s", regname[Rn]);
705705               break;
706706            case 0x10:
707               sprintf(buffer, "FLDS    F%s, FPUL\n", regname[Rn]);
707               sprintf(buffer, "FLDS    F%s, FPUL", regname[Rn]);
708708               break;
709709            case 0x20:
710               sprintf(buffer, "FLOAT   FPUL, F%s\n", regname[Rn]);
710               sprintf(buffer, "FLOAT   FPUL, F%s", regname[Rn]);
711711               break;
712712            case 0x30:
713               sprintf(buffer, "FTRC    F%s, FPUL\n", regname[Rn]);
713               sprintf(buffer, "FTRC    F%s, FPUL", regname[Rn]);
714714               break;
715715            case 0x40:
716               sprintf(buffer, "FNEG    F%s\n", regname[Rn]);
716               sprintf(buffer, "FNEG    F%s", regname[Rn]);
717717               break;
718718            case 0x50:
719               sprintf(buffer, "FABS    F%s\n", regname[Rn]);
719               sprintf(buffer, "FABS    F%s", regname[Rn]);
720720               break;
721721            case 0x60:
722               sprintf(buffer, "FSQRT   F%s\n", regname[Rn]);
722               sprintf(buffer, "FSQRT   F%s", regname[Rn]);
723723               break;
724724            case 0x70:
725               sprintf(buffer, "FSRRA   F%s\n", regname[Rn]);
725               sprintf(buffer, "FSRRA   F%s", regname[Rn]);
726726               break;
727727            case 0x80:
728               sprintf(buffer, "FLDI0   F%s\n", regname[Rn]);
728               sprintf(buffer, "FLDI0   F%s", regname[Rn]);
729729               break;
730730            case 0x90:
731               sprintf(buffer, "FLDI1   F%s\n", regname[Rn]);
731               sprintf(buffer, "FLDI1   F%s", regname[Rn]);
732732               break;
733733            case 0xA0:
734               sprintf(buffer, "FCNVSD  FPUL, D%s\n", regname[Rn]);
734               sprintf(buffer, "FCNVSD  FPUL, D%s", regname[Rn]);
735735               break;
736736            case 0xB0:
737               sprintf(buffer, "FCNVDS  D%s, FPUL\n", regname[Rn]);
737               sprintf(buffer, "FCNVDS  D%s, FPUL", regname[Rn]);
738738               break;
739739            case 0xE0:
740               sprintf(buffer, "FIPR    FV%d, FV%d\n", Rn << 2, Rn & 12);
740               sprintf(buffer, "FIPR    FV%d, FV%d", Rn << 2, Rn & 12);
741741               break;
742742            case 0xF0:
743743               if (opcode & 0x100) {
r2018r2019
745745                     switch (opcode & 0xC00)
746746                     {
747747                        case 0x000:
748                           sprintf(buffer, "FSCHG\n");
748                           sprintf(buffer, "FSCHG");
749749                           break;
750750                        case 0x800:
751                           sprintf(buffer, "FRCHG\n");
751                           sprintf(buffer, "FRCHG");
752752                           break;
753753                        default:
754754                           sprintf(buffer, "Funknown $%04X", opcode);
755755                           break;
756756                     }
757757                  } else {
758                     sprintf(buffer, "FTRV    XMTRX, FV%d\n", Rn & 12);
758                     sprintf(buffer, "FTRV    XMTRX, FV%d", Rn & 12);
759759                  }
760760               } else {
761                  sprintf(buffer, "FSSCA    FPUL, F%d\n", Rn & 14);
761                  sprintf(buffer, "FSSCA    FPUL, F%d", Rn & 14);
762762               }
763763               break;
764764            default:
r2018r2019
767767         }
768768         break;
769769      case 14:
770         sprintf(buffer, "FMAC    FR0, F%s,F%s\n", regname[Rm], regname[Rn]);
770         sprintf(buffer, "FMAC    FR0, F%s,F%s", regname[Rm], regname[Rn]);
771771         break;
772772      default:
773773         sprintf(buffer, "Funknown $%04X", opcode);
src/emu/cpu/alph8201/8201dasm.c
r2018r2019
1515#define FMT(a,b) a, b
1616#define PTRS_PER_FORMAT 2
1717
18/****************************************************
198201 CONFIRMED OPCODES:
20
21opcode       mnemonic     function      flags
22--------     ------------ ------------- -----
2300000000     NOP          -             --
2400000001     RORA         ror A         -C
2500000010     ROLA         rol A         -C
2600000011     INC RXB      RXB+=2        ZC
2700000100     DEC RXB      RXB-=2        ZC (C=1 means No Borrow: RXB>=2)
2800000101     INC A        A++           ZC
2900000110     DEC A        A--           ZC (C=1 means No Borrow: A>=1)
3000000110     CPL A        A^=$FF        --
3100001aaa     LD A,(IX0+i) [IX0+i]->A    --
3200010aaa     LD A,(IX1+i) [IX1+i]->A    --
3300011aaa     LD (IX2+i),A A->[IX2+i]    --
3400111aaa     BIT R0.n     ZF=R0 bit n   Z-
350100aaa0     LD A,Rn      A=Rn          Z-
360100aaa1     LD Rn,A      Rn=A          --
370101aaa0     ADD A,Rn     A+=Rn         ZC
380101aaa1     SUB A,Rn     A-=Rn         ZC (C=1 means No Borrow: A>=Rn)
390110aaa0     AND A,Rn     A&=Rn         Z-
400110aaa1     OR A,Rn      A|=Rn         Z-
410111aaaa     ADD IX0,i    IX0+=i        --
421000aaaa     ADD IX1,i    IX1+=i        --
431001aaaa     ADD IX2,i    IX2+=i        --
441010aaaa     LD RB,i      RB=i          -- Note: no bounds checking. Can set bank up to F.
451011-0aa     LD MB,i      set after-jump page
461011-1--     STOP
4711000000 imm LD IX0,imm   IX0=imm       --
4811000001 imm LD IX1,imm   IX1=imm       --
4911000010 imm LD IX2,imm   IX2=imm       --
5011000011 imm LD A,imm     A=imm         --
5111000100 imm LD LP0,imm   LP0=imm       --
5211000101 imm LD LP1,imm   LP1=imm       --
5311000110 imm LD LP2,imm   LP2=imm       --
5411000111 imm LD RXB,imm   RXB=imm       --
5511001000 imm ADD A,imm    A+=imm        ZC
5611001001 imm SUB A,imm    A-=imm        ZC (C=1 means No Borrow: A>=imm)
5711001010 imm AND A,imm    A&=imm        Z-
5811001011 imm OR  A,imm    A|=imm        Z-
5911001100 imm DJNZ LP0,imm LP0--,branch  --
6011001101 imm DJNZ LP1,imm LP1--,branch  --
6111001110 imm DJNZ LP2,imm LP2--,branch  --
6211001111 imm JNZ imm      branch if !Z  --
631101--00 imm JNC imm      branch if !C  --
641101--01 imm JZ  imm      branch if Z   --
651101--1- imm J   imm      branch        --
661110--xx mirror for the above
671111--xx mirror for the above
68
69****************************************************/
70
71
72/****************************************************/
73
1874static const char *const Formats[] = {
19   FMT("0000_0000", "NOP"),         // 00
20   FMT("0000_0001", "RRCA"),         // 01
21   FMT("0000_0010", "RLCA"),         // 02
22   FMT("0000_0011", "INC  B"),         // 03 : shougi $360 to $377
23   FMT("0000_0100", "DEC  B"),         // 04 : not found
24   FMT("0000_0101", "INC  A"),         // 05
25   FMT("0000_0110", "DEC  A"),         // 06
26   FMT("0000_0111", "CPL  A"),         // 07
27   FMT("0000_1aaa", "LD   A,(IX0+%X)"),// 08-0F
28   FMT("0001_0aaa", "LD   A,(IX1+%X)"),// 10-17
29   FMT("0001_1aaa", "LD   (IX2+%X),A"),// 18-1F
30   FMT("0010_0xxx", "LD   [IX0+%X],B"), // 20-27 : shougi $360 to $377
31   FMT("0010_1xxx", "ld   [ix1+%X],b ?"),// 28-2f : not found
32   FMT("0011_0xxx", "ld   b,[ix2+%X] ?"),// 30-37 : not found
33   FMT("0011_1aaa", "BIT  R0.%d"),      // 38-3f ZF = R0.a (bit test)
34   FMT("0100_aaa0", "LD   A,R%X"),      // 40-4E
35   FMT("0100_aaa1", "LD   R%X,A"),      // 41-4F
36   FMT("0101_aaa0", "ADD  A,R%X"),      // 50-5E
37   FMT("0101_aaa1", "SUB  A,R%X"),      // 51-5F
38   FMT("0110_aaa0", "AND  A,R%X"),      // 60-6E
39   FMT("0110_aaa1", "OR   A,R%X"),      // 61-6F
40   FMT("0111_aaaa", "ADD  IX0,$%X"),   // 70-7f
41   FMT("1000_aaaa", "ADD  IX1,$%X"),   // 80-8f
42   FMT("1001_aaaa", "ADD  IX2,$%X"),   // 90-9f
43   FMT("1010_0aaa", "LD   RB,%X"),      // A0-A7
44//  FMT("1010_1xxx", "unknown"),        // A8-AF : not found
45   FMT("1011_00aa", "LD   MB,%X"),      // B0-B3
46   FMT("1011_0100", "HALT"),         // B4
47//  FMT("1011_0101", "unknown"),        // B5 : not found
48//  FMT("1011_0110", "unknown"),        // B6 : not found
49//  FMT("1011_0111", "unknown"),        // B7 : not found
50//  FMT("1011_1xxx", "unknown"),        // B8-BF : not found
51   FMT("1100_0000 I", "LD   IX0,$%02X"),// C0
52   FMT("1100_0001 I", "LD   IX1,$%02X"),// C1
53   FMT("1100_0010 I", "LD   IX2,$%02X"),// C2
54   FMT("1100_0011 I", "LD   A,$%02X"),   // C3
55   FMT("1100_0100 I", "LD   LP0,$%02X"),// C4
56   FMT("1100_0101 I", "LD   LP1,$%02X"),// C5
57   FMT("1000_0110 I", "LD   LP2,$%02X"),// C6
58   FMT("1100_0111 I", "LD   B,$%02X"),   // C7 : shougi.c : please check with real chip !
59   FMT("1100_1000 I", "ADD  A,$%02X"),   // C8
60   FMT("1100_1001 I", "SUB  A,$%02X"),   // C9
61   FMT("1100_1010 I", "AND  A,$%02X"),   // CA
62   FMT("1100_1011 I", "OR   A,$%02X"),   // CB
63   FMT("1100_1100 I", "DJNZ LP0,$%02X"),// CC
64   FMT("1100_1101 I", "DJNZ LP1,$%02X"),// CD
65   FMT("1100_1110 I", "DJNZ LP2,$%02X"),// CE
66   FMT("1100_1111 I", "JNZ  $%02X"),   // CF
67   FMT("1101_0000 I", "JC   $%02X"),   // D0
68   FMT("1101_0001 I", "JZ   $%02X"),   // D1
69   FMT("1101_0010 I", "J    $%02X"),   // D2
70   FMT("1101_0011 I", "unk  $%02X"),   // D3
71   FMT("1101_0100 I", "alu  a,$%02X ?"), // D4 : 8031 , exctscc2 alu a,n ?
72   FMT("1101_0101 I", "alu  a,$%02X ?"), // D5 : 8031 , exctscc2 alu a,n ?
73   FMT("1101_0110 I", "unk  $%02X"),   // D6
74   FMT("1101_0111 I", "unk  $%02X"),   // D7
75   FMT("1101_1000 I", "unk  $%02X"),   // D8
76   FMT("1101_1001 I", "unk  $%02X"),   // D9
77   FMT("1101_1010 I", "CMP  A,$%02X"),   // DA : 8301
78   FMT("1101_1011 I", "unk  $%02X"),   // DB
79   FMT("1101_1100 I", "unk  $%02X"),   // DC
80   FMT("1101_1101 I", "unk  $%02X"),   // DD
81   FMT("1101_1110 I", "unk  $%02X"),   // DE
82   FMT("1101_1111 I", "CALL $%02X"),   // DF : 8301
83//
84   FMT("1110_0000", "DEC  IX0"),      // E0 : 8301
85//  FMT("1110_0001", "unknown"),        // E1
86//  FMT("1110_0010", "unknown"),        // E2
87   FMT("1110_0011", "ld   a,b ?"),      // E3 : 8301
88//  FMT("1110_0100", "unknown"),        // E4
89//  FMT("1110_0101", "unknown"),        // E5
90//  FMT("1110_0110", "unknown"),        // E6 : 8301
91//  FMT("1110_0110", "unknown"),        // E7
92   FMT("1110_1000", "LD   IX0,A"),      // E8 : 8301
93   FMT("1110_1001", "LD   IX1,A ?"),   // E9 : not found
94   FMT("1110_1010", "LD   IX2,A"),      // EA : 8301
95   FMT("1110_1011", "ld   b,a ?"),      // EB : 8301
96//  FMT("1110_1100", "unknown"),        // EC
97//  FMT("1110_1100", "unknown"),        // ED
98//  FMT("1110_1110", "unknown"),        // EE : 8301
99//  FMT("1110_1111", "unknown"),        // EF
100//  FMT("1111_0000", "unknown"),        // F0
101   FMT("1111_0001", "LD   IX2,IX0"),   // F1 : 8301
102//  FMT("1111_0010", "unknown"),        // F2 : 8301 , alu a,[IXR] ?
103//  FMT("1111_0011", "unknown"),        // F3
104//  FMT("1111_0100", "unknown"),        // F4
105//  FMT("1111_0101", "unknown"),        // F5
106   FMT("1111_0110", "alu  ?,a"),      // F6 : 8301 , exctsccr, alu ?,a
107//  FMT("1111_0110", "unknown"),        // F7
108   FMT("1111_1000", "alu  a,?"),      // F8 : 8301 , exctsccr, alu b,a ? : ZF check
109   FMT("1111_1001", "alu  a,?"),      // F9 : 8301 , exctsccr, alu a,?
110   FMT("1111_1010", "ADD  A,CF"),      // FA : 8301
111//  FMT("1111_1011", "unknown"),        // FB
112   FMT("1111_1100", "tst  a ?"),      // FC : 8301 , ZF = (A==0) ?
113   FMT("1111_1101", "CLR  A"),         // FD : 8301
114   FMT("1111_1110", "LD   A,(IX0+A)"),   // FE : 8301
115   FMT("1111_1111", "RET"),         // FF : 8301
75   FMT("0000_0000", "NOP"),            // 00
76   FMT("0000_0001", "RRCA"),            // 01
77   FMT("0000_0010", "RLCA"),            // 02
78   FMT("0000_0011", "INC  RXB"),         // 03 : shougi $360 to $377; splndrbt
79   FMT("0000_0100", "DEC  RXB"),         // 04 : not found
80   FMT("0000_0101", "INC  A"),            // 05
81   FMT("0000_0110", "DEC  A"),            // 06
82   FMT("0000_0111", "CPL  A"),            // 07
83   FMT("0000_1aaa", "LD   A,(IX0+%X)"),   // 08-0F
84   FMT("0001_0aaa", "LD   A,(IX1+%X)"),   // 10-17
85   FMT("0001_1aaa", "LD   (IX2+%X),A"),   // 18-1F
86   FMT("0010_0aaa", "LD   (RXB),(IX0+%X)"),// 20-27 : shougi $360 to $377
87   FMT("0010_1aaa", "LD   (RXB),(IX1+%X)"),// 28-2f : not found
88   FMT("0011_0aaa", "LD   (IX2+%X),(RXB)"),// 30-37 : not found
89   FMT("0011_1aaa", "BIT  R0.%d"),         // 38-3F ZF = R0.a (bit test)
90   FMT("0100_aaa0", "LD   A,R%X"),         // 40-4E
91   FMT("0100_aaa1", "LD   R%X,A"),         // 41-4F
92   FMT("0101_aaa0", "ADD  A,R%X"),         // 50-5E
93   FMT("0101_aaa1", "SUB  A,R%X"),         // 51-5F
94   FMT("0110_aaa0", "AND  A,R%X"),         // 60-6E
95   FMT("0110_aaa1", "OR   A,R%X"),         // 61-6F
96   FMT("0111_aaaa", "ADD  IX0,$%X"),      // 70-7f
97   FMT("1000_aaaa", "ADD  IX1,$%X"),      // 80-8f
98   FMT("1001_aaaa", "ADD  IX2,$%X"),      // 90-9f
99   FMT("1010_aaaa", "LD   RB,%X"),         // A0-AF
100   FMT("1011_x0aa", "LD   MB,%X"),         // B0-B3 (+ mirrors)
101   FMT("1011_x1xx", "STOP"),            // B4 (+ mirrors)
102
103   FMT("1100_0000 I", "LD   IX0,$%02X"),   // C0
104   FMT("1100_0001 I", "LD   IX1,$%02X"),   // C1
105   FMT("1100_0010 I", "LD   IX2,$%02X"),   // C2
106   FMT("1100_0011 I", "LD   A,$%02X"),      // C3
107   FMT("1100_0100 I", "LD   LP0,$%02X"),   // C4
108   FMT("1100_0101 I", "LD   LP1,$%02X"),   // C5
109   FMT("1100_0110 I", "LD   LP2,$%02X"),   // C6
110   FMT("1100_0111 I", "LD   RXB,$%02X"),   // C7 : shougi, splndrbt, equites
111   FMT("1100_1000 I", "ADD  A,$%02X"),      // C8
112   FMT("1100_1001 I", "SUB  A,$%02X"),      // C9
113   FMT("1100_1010 I", "AND  A,$%02X"),      // CA
114   FMT("1100_1011 I", "OR   A,$%02X"),      // CB
115   FMT("1100_1100 I", "DJNZ LP0,$%02X"),   // CC
116   FMT("1100_1101 I", "DJNZ LP1,$%02X"),   // CD
117   FMT("1100_1110 I", "DJNZ LP2,$%02X"),   // CE
118   FMT("1100_1111 I", "JNZ  $%02X"),      // CF
119   FMT("1101_0000 I", "JNC  $%02X"),      // D0
120   FMT("1101_0001 I", "JZ   $%02X"),      // D1
121   FMT("1101_001x I", "J    $%02X"),      // D2 (+ mirror)
122
123   /* -------------- 830x only ------------- */
124
125   FMT("1101_0100 I", "LD   A,(R7:$%02X)"),   // D4 : exctscc2, bullfgtr; not sure if R7 or R77
126   FMT("1101_0101 I", "LD   (R7:$%02X),A"),   // D5 : exctscc2, bullfgtr, kouyakyu; not sure if R7 or R77
127   FMT("1101_0110 I", "LD   LP0,(R7:$%02X)"),   // D6 : kouyakyu; not sure if R7 or R77
128   FMT("1101_0111 I", "LD   (R7:$%02X),LP0"),   // D7 : hvoltage; not sure if R7 or R77
129   FMT("1101_1000 I", "LD   A,($%02X)"),      // D8 : equites
130   FMT("1101_1001 I", "LD   ($%02X),A"),      // D9 : equites
131   FMT("1101_1010 I", "CMP  A,$%02X"),         // DA :
132   FMT("1101_1011 I", "XOR  A,$%02X"),         // DB : equites splndrbt
133   FMT("1101_1100 I", "unk  $%02X"),         // DC : not found (LD   A,R($%02X) ?)
134   FMT("1101_1101 I", "LD   R($%02X),A"),      // DD : equites, splndrbt
135   FMT("1101_1110 I", "unk  $%02X"),         // DE : not found
136   FMT("1101_1111 I", "CALL $%02X"),         // DF :
137
138   FMT("1110_0000", "DEC  IX0"),         // E0 :
139   FMT("1110_0001", "unknown"),         // E1 : not found (DEC IX1?)
140   FMT("1110_0010", "unknown"),         // E2 : not found (DEC IX2?)
141   FMT("1110_0011", "ld   a,unk ?"),      // E3 : exctsccr in pair with EB
142   FMT("1110_0100", "unknown"),         // E4 : not found
143   FMT("1110_0101", "LD   A,B"),         // E5 : splndrbt
144   FMT("1110_0110", "EXG  A,LP0"),         // E6 : splndrbt, bullfgtr, kouyakyu. EXG, not LD: see splndrbt $3ba to $3d3
145   FMT("1110_0111", "unknown"),         // E7 : not found
146   FMT("1110_1000", "LD   IX0,A"),         // E8 :
147   FMT("1110_1001", "ld   ix1,a ?"),      // E9 : not found
148   FMT("1110_1010", "LD   IX2,A"),         // EA :
149   FMT("1110_1011", "ld   unk,a ?"),      // EB : exctsccr in pair with E3. unk is not LP0, IX0, IX2
150   FMT("1110_1100", "unknown"),         // EC : not found
151   FMT("1110_1101", "LD   B,A"),         // ED : splndrbt
152   FMT("1110_1110", "LD   LP0,A"),         // EE : splndrbt, bullfgtr
153   FMT("1110_1111", "unknown"),         // EF : not found
154   FMT("1111_0000", "unknown"),         // F0 : not found
155   FMT("1111_0001", "EXG  IX0,IX2"),      // F1 : should be EXG, see splndrbt $2e to $38, equites $40 to $4a
156   FMT("1111_0010", "LDIR"),            // F2 : splndrbt  LD (IX2+%X),(RXB); INC B; DJNZ LP0
157   FMT("1111_0011", "unknown"),         // F3 : not found
158   FMT("1111_0100", "unknown"),         // F4 : not found
159   FMT("1111_0101", "unknown"),         // F5 : not found
160   FMT("1111_0110", "LD   (RXB),A"),      // F6 : exctsccr
161   FMT("1111_0111", "unknown"),         // F7 : not found
162   FMT("1111_1000", "sub/cmp  a,(rxb) ?"),   // F8 : exctsccr : ZF check  could be CMP instead? see DA/DB
163   FMT("1111_1001", "XOR  A,(RXB)"),      // F9 : exctsccr
164   FMT("1111_1010", "ADD  A,CF"),         // FA :
165   FMT("1111_1011", "unknown"),         // FB : not found (SUB  A,CF ?)
166   FMT("1111_1100", "TST  A"),            // FC : ZF = (A==0) ?
167   FMT("1111_1101", "CLR  A"),            // FD :
168   FMT("1111_1110", "LD   A,(IX0+A)"),      // FE :
169   FMT("1111_1111", "RET"),            // FF :
116170   NULL
117171};
118172
src/emu/cpu/alph8201/alph8201.c
r2018r2019
44                      Copyright Tatsuyuki Satoh
55                   Originally written for the MAME project.
66
7    Notes :
87
9      tested with champbas.c , talbot.c , shougi.c
8The Alpha8201/830x isn't a real CPU. It is a Hitachi HD44801 4-bit MCU,
9programmed to interpret an external program using a custom instruction set.
10Alpha8301 has an expanded instruction set, backwards compatible with Alpha8201
1011
11      This MCU looks too slow speed,
12      but fast execution don't work to champbb2, champbbj, talbot.
12The internal ROM hasn't been read (yet), so here we provide a simultaion of
13the behaviour.
1314
14      some unknown instruction are not emulation (used by shougi).
1515
16Game                      Year  MCU
17------------------------  ----  ----
18Shougi                    1982? 8201 (pcb)
19Shougi 2                  1982? 8201 (pcb)
20Talbot                    1982  8201?
21Champion Base Ball        1983  8201 (schematics)
22Exciting Soccer           1983  8301?
23Champion Base Ball II     1983  8302?(unofficial schematics)
24Exciting Soccer II        1984  8302?
25Equites                   1984  8303 (post)
26Bull Fighter              1984  8303 (post)
27Splendor Blast            1985  8303 (post)
28Gekisou                   1985  8304 (post)
29The Koukouyakyuh          1985  8304 (post)
30High Voltage              1985  8404?(post says 8404, but readme says 8304)
31
32
33    Notes :
34      some unknown instruction are not emulated.
35
1636      Because there was no information, opcode-syntax was created.
1737
1838    TODO:
r2018r2019
2343            -memory address 001 bit 7-5 specification
2444            -write value after HALT operation to ODD of vector memory.
2545            -operation cycle(execution speed).
26    History:
2746
28060327:
29    IXR changes to Breg.
30    The addition of Memory Access of Breg and IX0
31
32060326:
33    Added ALPHA 8301 I/F and emulation
34
35060324:
36    Archtectore Created by compare code no-MCU Z80 code and MCU version code.
37    and check  talbot and shougi.c.
38
3947****************************************************************************/
4048
4149/****************************************************************************
r2018r2019
4553-----------------------
4654ALPHA 8201 DIP 42
4755
48    1     -WR (or -RD)
49    2-4 : ? NC
50    5-7 : ? GND to shougi , NC to champbas
51    8-14: ? NC
52    15  : RESET
53    16  : GND
54    17  : CLK (champbas=768KHz)
55    18  : ? NC
56    19-21: to VCC
57    22-25: DB4-DB7
58    26-29: DB0-DB3
59    30   : HALT (input)
60    31   : ? NC
61    32-35: A4-A7
62    36-39: A0-A3
63    40-41: A8-A9
64    42   : -RD (or -WR)
56pin    HD44801  Alpha
57---    -------  -----
581    : D3       WR
592-4  : D4-D6    n.c.
605-7  : D7-D9    GND in shougi , n.c. in champbas
618-13 : D10-D15  n.c.
6214   : n.c.     n.c.
6315   : RESET    RESET
6416   : GND      GND
6517   : OSC1     (champbas=384KHz)
6618   : OSC2     n.c.
6719   : !HLT     Vcc
6820   : !TEST    Vcc
6921   : Vcc      Vcc
7022-25: R00-R03  DB4-DB7
7126-29: R10-R13  DB0-DB3
7230   : INT0     GO (input)
7331   : INT1     n.c.
7432-35: R20-R23  A4-A7
7536-39: R30-R33  A0-A3
7640-41: D0-D1    A8-A9
7742   : D2       /RD
6578
66ALPHA 8301 seems to be 8201 upper compatibility IC.
67The package of ALPHA8301 is unknown.
6879
6980-----------------------
7081Register Set
r2018r2019
144155#define TRACE_PC 0
145156#define SHOW_ENTRY_POINT 0
146157#define SHOW_MESSAGE_CONSOLE 0
158#define BREAK_ON_UNKNOWN_OPCODE 0
159#define BREAK_ON_UNCERTAIN_OPCODE 0
147160
148161/* MAME is unnecessary */
149162#define HANDLE_HALT_LINE 0
r2018r2019
188201static int      ALPHA8201_ICount;
189202static int    inst_cycles;
190203
191#define intRAM   R.RAM
204#define regRAM   R.RAM
192205#define regPTR   R.regPtr
193206
194207#define PC   R.pc.w.l
195208#define PCL    R.pc.b.l
196#define R0   intRAM[regPTR  ]
197#define R1   intRAM[regPTR+1]
198#define R2   intRAM[regPTR+2]
199#define R3   intRAM[regPTR+3]
200#define R4   intRAM[regPTR+4]
201#define R5   intRAM[regPTR+5]
202#define R6   intRAM[regPTR+6]
203#define R7   intRAM[regPTR+7]
209#define RD_REG(x)   regRAM[(regPTR<<3)+(x)]
210#define WR_REG(x,d)   regRAM[(regPTR<<3)+(x)]=(d)
204211#define ZF   R.zf
205212#define CF   R.cf
206213#define IX0   R.ix0.b.l
r2018r2019
230237   CF = temp>>8;
231238}
232239
233INLINE void M_SUB(UINT8 dat)
234{
235   CF = (R.A<dat);
236   R.A -= dat;
237   ZF = (R.A==0);
238}
239
240240INLINE void M_ADDB(UINT8 dat)
241241{
242242   UINT16 temp = R.B + dat;
r2018r2019
245245   CF = temp>>8;
246246}
247247
248INLINE void M_SUBB(UINT8 dat)
248INLINE void M_SUB(UINT8 dat)
249249{
250   CF = (R.B<dat);
251   R.B -= dat;
252   ZF = (R.B==0);
250   CF = (R.A>=dat);   // CF is No Borrow
251   R.A -= dat;
252   ZF = (R.A==0);
253253}
254254
255255INLINE void M_AND(UINT8 dat)
256256{
257257   R.A &= dat;
258258   ZF = (R.A==0);
259   CF = 0;
260259}
261260
262261INLINE void M_OR(UINT8 dat)
263262{
264263   R.A |= dat;
265264   ZF = (R.A==0);
266   CF = 0;
267265}
268266
267INLINE void M_XOR(UINT8 dat)
268{
269   R.A ^= dat;
270   ZF = (R.A==0);
271//  CF = 0; unknown whether it's affected or not
272}
273
269274INLINE void M_JMP(UINT8 dat)
270275{
271276   PCL = dat;
r2018r2019
280285#if SHOW_MESSAGE_CONSOLE
281286   mame_printf_debug("ALPHA8201:  PC = %03x,  Unimplemented opcode = %02x\n", PC-1, M_RDMEM(PC-1));
282287#endif
288#if BREAK_ON_UNKNOWN_OPCODE
289   DEBUGGER_BREAK;
290#endif
283291}
284292
285293INLINE void M_UNDEFINED2(void)
r2018r2019
290298#if SHOW_MESSAGE_CONSOLE
291299   mame_printf_debug("ALPHA8201:  PC = %03x,  Unimplemented opcode = %02x,%02x\n", PC-2, op,imm);
292300#endif
301#if BREAK_ON_UNKNOWN_OPCODE
302   DEBUGGER_BREAK;
303#endif
293304}
294305
295306static void undefined(void)   { M_UNDEFINED(); }
r2018r2019
302313#if SHOW_MESSAGE_CONSOLE
303314   mame_printf_debug("ALPHA8201:  PC = %03x, unknown opcode = %02x is '%s' ??\n",PC-1, op,s);
304315#endif
316#if BREAK_ON_UNCERTAIN_OPCODE
317   DEBUGGER_BREAK;
318#endif
305319}
306320
321#if 0
322static void need_verify2(const char *s)
323{
324   UINT8 op1 = M_RDOP(PC-2);
325   UINT8 op2 = M_RDOP(PC-1);
326   logerror("ALPHA8201:  PC = %03x, unknown opcode = %02x %02x is '%s' ??\n",PC-2, op1, op2, s);
327#if SHOW_MESSAGE_CONSOLE
328   mame_printf_debug("ALPHA8201:  PC = %03x, unknown opcode = %02x %02x is '%s' ??\n",PC-2, op1, op2, s);
329#endif
330#if BREAK_ON_UNCERTAIN_OPCODE
331   DEBUGGER_BREAK;
332#endif
333}
334#endif
335
307336static void nop(void)       { }
308static void rlca(void)       { CF = (R.A>>7)&1; R.A = (R.A<<1) | (R.A>>7); ZF = (R.A==0); }
309static void rrca(void)       { CF = R.A &1;     R.A = (R.A>>1) | (R.A<<7); ZF = (R.A==0); }
310static void inc_b(void)        { M_ADDB(1); }
311static void dec_b(void)        { M_SUBB(1); }
312static void inc_a(void)       { M_ADD(1); }
313static void dec_a(void)       { M_SUB(1); }
314static void cpl(void)       { R.A = R.A^0xff; ZF = (R.A==0); }
337static void rora(void)       { CF = R.A &1;     R.A = (R.A>>1) | (R.A<<7); }
338static void rola(void)       { CF = (R.A>>7)&1; R.A = (R.A<<1) | (R.A>>7); }
339static void inc_b(void)        { M_ADDB(0x02); }
340static void dec_b(void)        { M_ADDB(0xfe); }
341static void inc_a(void)       { M_ADD(0x01); }
342static void dec_a(void)       { M_ADD(0xff); }
343static void cpl(void)       { R.A ^= 0xff; };
315344
316345static void ld_a_ix0_0(void) { R.A = M_RDMEM(BIX0+0); }
317346static void ld_a_ix0_1(void) { R.A = M_RDMEM(BIX0+1); }
r2018r2019
340369static void ld_ix2_6_a(void) { M_WRMEM(BIX2+6,R.A); }
341370static void ld_ix2_7_a(void) { M_WRMEM(BIX2+7,R.A); }
342371
343static void ld_ix0_0_b(void) { M_WRMEM(BIX0+0,R.B); }
344static void ld_ix0_1_b(void) { M_WRMEM(BIX0+0,R.B); }
345static void ld_ix0_2_b(void) { M_WRMEM(BIX0+0,R.B); }
346static void ld_ix0_3_b(void) { M_WRMEM(BIX0+0,R.B); }
347static void ld_ix0_4_b(void) { M_WRMEM(BIX0+0,R.B); }
348static void ld_ix0_5_b(void) { M_WRMEM(BIX0+0,R.B); }
349static void ld_ix0_6_b(void) { M_WRMEM(BIX0+0,R.B); }
350static void ld_ix0_7_b(void) { M_WRMEM(BIX0+0,R.B); }
372static void ld_ix0_0_b(void) { regRAM[(R.B>>1)&0x3f] = M_RDMEM(BIX0+0); }
373static void ld_ix0_1_b(void) { regRAM[(R.B>>1)&0x3f] = M_RDMEM(BIX0+1); }
374static void ld_ix0_2_b(void) { regRAM[(R.B>>1)&0x3f] = M_RDMEM(BIX0+2); }
375static void ld_ix0_3_b(void) { regRAM[(R.B>>1)&0x3f] = M_RDMEM(BIX0+3); }
376static void ld_ix0_4_b(void) { regRAM[(R.B>>1)&0x3f] = M_RDMEM(BIX0+4); }
377static void ld_ix0_5_b(void) { regRAM[(R.B>>1)&0x3f] = M_RDMEM(BIX0+5); }
378static void ld_ix0_6_b(void) { regRAM[(R.B>>1)&0x3f] = M_RDMEM(BIX0+6); }
379static void ld_ix0_7_b(void) { regRAM[(R.B>>1)&0x3f] = M_RDMEM(BIX0+7); }
351380
352static void ld_ix1_0_b(void) { M_WRMEM(BIX1+0,R.B); need_verify("LD   (IX1+0),B"); }
353static void ld_ix1_1_b(void) { M_WRMEM(BIX1+1,R.B); need_verify("LD   (IX1+1),B"); }
354static void ld_ix1_2_b(void) { M_WRMEM(BIX1+2,R.B); need_verify("LD   (IX1+2),B"); }
355static void ld_ix1_3_b(void) { M_WRMEM(BIX1+3,R.B); need_verify("LD   (IX1+3),B"); }
356static void ld_ix1_4_b(void) { M_WRMEM(BIX1+4,R.B); need_verify("LD   (IX1+4),B"); }
357static void ld_ix1_5_b(void) { M_WRMEM(BIX1+5,R.B); need_verify("LD   (IX1+5),B"); }
358static void ld_ix1_6_b(void) { M_WRMEM(BIX1+6,R.B); need_verify("LD   (IX1+6),B"); }
359static void ld_ix1_7_b(void) { M_WRMEM(BIX1+7,R.B); need_verify("LD   (IX1+7),B"); }
381static void bit_r0_0(void)    { ZF = RD_REG(0)&(1<<0)?0:1; }
382static void bit_r0_1(void)    { ZF = RD_REG(0)&(1<<1)?0:1; }
383static void bit_r0_2(void)    { ZF = RD_REG(0)&(1<<2)?0:1; }
384static void bit_r0_3(void)    { ZF = RD_REG(0)&(1<<3)?0:1; }
385static void bit_r0_4(void)    { ZF = RD_REG(0)&(1<<4)?0:1; }
386static void bit_r0_5(void)    { ZF = RD_REG(0)&(1<<5)?0:1; }
387static void bit_r0_6(void)    { ZF = RD_REG(0)&(1<<6)?0:1; }
388static void bit_r0_7(void)    { ZF = RD_REG(0)&(1<<7)?0:1; }
360389
361static void ld_b_ix2_0(void) { R.B = M_RDMEM(BIX2+0); need_verify("LD   B,(IX2+0)");  }
362static void ld_b_ix2_1(void) { R.B = M_RDMEM(BIX2+1); need_verify("LD   B,(IX2+1)");  }
363static void ld_b_ix2_2(void) { R.B = M_RDMEM(BIX2+2); need_verify("LD   B,(IX2+2)");  }
364static void ld_b_ix2_3(void) { R.B = M_RDMEM(BIX2+3); need_verify("LD   B,(IX2+3)");  }
365static void ld_b_ix2_4(void) { R.B = M_RDMEM(BIX2+4); need_verify("LD   B,(IX2+4)");  }
366static void ld_b_ix2_5(void) { R.B = M_RDMEM(BIX2+5); need_verify("LD   B,(IX2+5)");  }
367static void ld_b_ix2_6(void) { R.B = M_RDMEM(BIX2+6); need_verify("LD   B,(IX2+6)");  }
368static void ld_b_ix2_7(void) { R.B = M_RDMEM(BIX2+7); need_verify("LD   B,(IX2+7)");  }
390static void ld_a_n(void)    { R.A = M_RDMEM_OPCODE(); }
369391
370static void bit_r0_0(void)    { R.zf = R0&(1<<0)?0:1; }
371static void bit_r0_1(void)    { R.zf = R0&(1<<1)?0:1; }
372static void bit_r0_2(void)    { R.zf = R0&(1<<2)?0:1; }
373static void bit_r0_3(void)    { R.zf = R0&(1<<3)?0:1; }
374static void bit_r0_4(void)    { R.zf = R0&(1<<4)?0:1; }
375static void bit_r0_5(void)    { R.zf = R0&(1<<5)?0:1; }
376static void bit_r0_6(void)    { R.zf = R0&(1<<6)?0:1; }
377static void bit_r0_7(void)    { R.zf = R0&(1<<7)?0:1; }
392static void ld_a_r0(void)    { R.A = RD_REG(0); ZF = (R.A==0); }
393static void ld_a_r1(void)    { R.A = RD_REG(1); ZF = (R.A==0); }
394static void ld_a_r2(void)    { R.A = RD_REG(2); ZF = (R.A==0); }
395static void ld_a_r3(void)    { R.A = RD_REG(3); ZF = (R.A==0); }
396static void ld_a_r4(void)    { R.A = RD_REG(4); ZF = (R.A==0); }
397static void ld_a_r5(void)    { R.A = RD_REG(5); ZF = (R.A==0); }
398static void ld_a_r6(void)    { R.A = RD_REG(6); ZF = (R.A==0); }
399static void ld_a_r7(void)    { R.A = RD_REG(7); ZF = (R.A==0); }
378400
379static void ld_a_n(void)    { R.A = M_RDMEM_OPCODE(); }
380static void ld_a_r0(void)    { R.A = R0; }
381static void ld_a_r1(void)    { R.A = R1; }
382static void ld_a_r2(void)    { R.A = R2; }
383static void ld_a_r3(void)    { R.A = R3; }
384static void ld_a_r4(void)    { R.A = R4; }
385static void ld_a_r5(void)    { R.A = R5; }
386static void ld_a_r6(void)    { R.A = R6; }
387static void ld_a_r7(void)    { R.A = R7; }
401static void ld_r0_a(void)    { WR_REG(0,R.A); }
402static void ld_r1_a(void)    { WR_REG(1,R.A); }
403static void ld_r2_a(void)    { WR_REG(2,R.A); }
404static void ld_r3_a(void)    { WR_REG(3,R.A); }
405static void ld_r4_a(void)    { WR_REG(4,R.A); }
406static void ld_r5_a(void)    { WR_REG(5,R.A); }
407static void ld_r6_a(void)    { WR_REG(6,R.A); }
408static void ld_r7_a(void)    { WR_REG(7,R.A); }
388409
389static void ld_r0_a(void)    { R0 = R.A; }
390static void ld_r1_a(void)    { R1 = R.A; }
391static void ld_r2_a(void)    { R2 = R.A; }
392static void ld_r3_a(void)    { R3 = R.A; }
393static void ld_r4_a(void)    { R4 = R.A; }
394static void ld_r5_a(void)    { R5 = R.A; }
395static void ld_r6_a(void)    { R6 = R.A; }
396static void ld_r7_a(void)    { R7 = R.A; }
397
398410static void add_a_n(void)    { M_ADD(M_RDMEM_OPCODE()); }
399static void add_a_r0(void)    { M_ADD(R0); }
400static void add_a_r1(void)    { M_ADD(R1); }
401static void add_a_r2(void)    { M_ADD(R2); }
402static void add_a_r3(void)    { M_ADD(R3); }
403static void add_a_r4(void)    { M_ADD(R4); }
404static void add_a_r5(void)    { M_ADD(R5); }
405static void add_a_r6(void)    { M_ADD(R6); }
406static void add_a_r7(void)    { M_ADD(R7); }
407411
412static void add_a_r0(void)    { M_ADD(RD_REG(0)); }
413static void add_a_r1(void)    { M_ADD(RD_REG(1)); }
414static void add_a_r2(void)    { M_ADD(RD_REG(2)); }
415static void add_a_r3(void)    { M_ADD(RD_REG(3)); }
416static void add_a_r4(void)    { M_ADD(RD_REG(4)); }
417static void add_a_r5(void)    { M_ADD(RD_REG(5)); }
418static void add_a_r6(void)    { M_ADD(RD_REG(6)); }
419static void add_a_r7(void)    { M_ADD(RD_REG(7)); }
420
408421static void sub_a_n(void)    { M_SUB(M_RDMEM_OPCODE()); }
409static void sub_a_r0(void)    { M_SUB(R0); }
410static void sub_a_r1(void)    { M_SUB(R1); }
411static void sub_a_r2(void)    { M_SUB(R2); }
412static void sub_a_r3(void)    { M_SUB(R3); }
413static void sub_a_r4(void)    { M_SUB(R4); }
414static void sub_a_r5(void)    { M_SUB(R5); }
415static void sub_a_r6(void)    { M_SUB(R6); }
416static void sub_a_r7(void)    { M_SUB(R7); }
417422
423static void sub_a_r0(void)    { M_SUB(RD_REG(0)); }
424static void sub_a_r1(void)    { M_SUB(RD_REG(1)); }
425static void sub_a_r2(void)    { M_SUB(RD_REG(2)); }
426static void sub_a_r3(void)    { M_SUB(RD_REG(3)); }
427static void sub_a_r4(void)    { M_SUB(RD_REG(4)); }
428static void sub_a_r5(void)    { M_SUB(RD_REG(5)); }
429static void sub_a_r6(void)    { M_SUB(RD_REG(6)); }
430static void sub_a_r7(void)    { M_SUB(RD_REG(7)); }
431
418432static void and_a_n(void)    { M_AND(M_RDMEM_OPCODE()); }
419static void and_a_r0(void)    { M_AND(R0); }
420static void and_a_r1(void)    { M_AND(R1); }
421static void and_a_r2(void)    { M_AND(R2); }
422static void and_a_r3(void)    { M_AND(R3); }
423static void and_a_r4(void)    { M_AND(R4); }
424static void and_a_r5(void)    { M_AND(R5); }
425static void and_a_r6(void)    { M_AND(R6); }
426static void and_a_r7(void)    { M_AND(R7); }
427433
434static void and_a_r0(void)    { M_AND(RD_REG(0)); }
435static void and_a_r1(void)    { M_AND(RD_REG(1)); }
436static void and_a_r2(void)    { M_AND(RD_REG(2)); }
437static void and_a_r3(void)    { M_AND(RD_REG(3)); }
438static void and_a_r4(void)    { M_AND(RD_REG(4)); }
439static void and_a_r5(void)    { M_AND(RD_REG(5)); }
440static void and_a_r6(void)    { M_AND(RD_REG(6)); }
441static void and_a_r7(void)    { M_AND(RD_REG(7)); }
442
428443static void or_a_n(void)    { M_OR(M_RDMEM_OPCODE()); }
429static void or_a_r0(void)    { M_OR(R0); }
430static void or_a_r1(void)    { M_OR(R1); }
431static void or_a_r2(void)    { M_OR(R2); }
432static void or_a_r3(void)    { M_OR(R3); }
433static void or_a_r4(void)    { M_OR(R4); }
434static void or_a_r5(void)    { M_OR(R5); }
435static void or_a_r6(void)    { M_OR(R6); }
436static void or_a_r7(void)    { M_OR(R7); }
437444
438static void add_ix0_0(void)    {}
445static void or_a_r0(void)    { M_OR(RD_REG(0)); }
446static void or_a_r1(void)    { M_OR(RD_REG(1)); }
447static void or_a_r2(void)    { M_OR(RD_REG(2)); }
448static void or_a_r3(void)    { M_OR(RD_REG(3)); }
449static void or_a_r4(void)    { M_OR(RD_REG(4)); }
450static void or_a_r5(void)    { M_OR(RD_REG(5)); }
451static void or_a_r6(void)    { M_OR(RD_REG(6)); }
452static void or_a_r7(void)    { M_OR(RD_REG(7)); }
453
454static void add_ix0_0(void)    { }
439455static void add_ix0_1(void)    { IX0 += 1; }
440456static void add_ix0_2(void)    { IX0 += 2; }
441457static void add_ix0_3(void)    { IX0 += 3; }
r2018r2019
452468static void add_ix0_e(void)    { IX0 += 14; }
453469static void add_ix0_f(void)    { IX0 += 15; }
454470
455static void add_ix1_0(void)    {}
471static void add_ix1_0(void)    { }
456472static void add_ix1_1(void)    { IX1 += 1; }
457473static void add_ix1_2(void)    { IX1 += 2; }
458474static void add_ix1_3(void)    { IX1 += 3; }
r2018r2019
469485static void add_ix1_e(void)    { IX1 += 14; }
470486static void add_ix1_f(void)    { IX1 += 15; }
471487
472static void add_ix2_0(void)    {}
488static void add_ix2_0(void)    { }
473489static void add_ix2_1(void)    { IX2 += 1; }
474490static void add_ix2_2(void)    { IX2 += 2; }
475491static void add_ix2_3(void)    { IX2 += 3; }
r2018r2019
486502static void add_ix2_e(void)    { IX2 += 14; }
487503static void add_ix2_f(void)    { IX2 += 15; }
488504
489static void ld_base_0(void)    { regPTR = 0<<3; }
490static void ld_base_1(void)    { regPTR = 1<<3; }
491static void ld_base_2(void)    { regPTR = 2<<3; }
492static void ld_base_3(void)    { regPTR = 3<<3; }
493static void ld_base_4(void)    { regPTR = 4<<3; }
494static void ld_base_5(void)    { regPTR = 5<<3; }
495static void ld_base_6(void)    { regPTR = 6<<3; }
496static void ld_base_7(void)    { regPTR = 7<<3; }
505static void ld_base_0(void)    { regPTR = 0; }
506static void ld_base_1(void)    { regPTR = 1; }
507static void ld_base_2(void)    { regPTR = 2; }
508static void ld_base_3(void)    { regPTR = 3; }
509static void ld_base_4(void)    { regPTR = 4; }
510static void ld_base_5(void)    { regPTR = 5; }
511static void ld_base_6(void)    { regPTR = 6; }
512static void ld_base_7(void)    { regPTR = 7; }
497513
498514static void ld_bank_0(void)    { R.mb = 0; }
499515static void ld_bank_1(void)    { R.mb = 1; }
500516static void ld_bank_2(void)    { R.mb = 2; }
501517static void ld_bank_3(void)    { R.mb = 3; }
502518
503static void halt(void)
519static void stop(void)
504520{
505521   UINT8 pcptr = M_RDMEM(0x001) & 0x1f;
506   M_WRMEM(pcptr,0x08); /* mark entry point ODD to HALT */
522   M_WRMEM(pcptr,(M_RDMEM(pcptr)&0xf)+0x08); /* mark entry point ODD to HALT */
507523   R.mb |= 0x08;        /* mark internal HALT state */
508524}
509525
r2018r2019
518534static void djnz_lp0(void)   { UINT8 i=M_RDMEM_OPCODE(); LP0--; if (LP0 != 0) M_JMP(i); }
519535static void djnz_lp1(void)   { UINT8 i=M_RDMEM_OPCODE(); LP1--; if (LP1 != 0) M_JMP(i); }
520536static void djnz_lp2(void)   { UINT8 i=M_RDMEM_OPCODE(); LP2--; if (LP2 != 0) M_JMP(i); }
521static void jnz(void)   { UINT8 i=M_RDMEM_OPCODE(); if (!R.zf) M_JMP(i); }
522static void jc(void)   { UINT8 i=M_RDMEM_OPCODE(); if ( R.cf) M_JMP(i); }
523static void jz(void)   { UINT8 i=M_RDMEM_OPCODE(); if ( R.zf) M_JMP(i); }
537static void jnz(void)   { UINT8 i=M_RDMEM_OPCODE(); if (!ZF) M_JMP(i); }
538static void jnc(void)   { UINT8 i=M_RDMEM_OPCODE(); if (!CF) M_JMP(i);}
539static void jz(void)   { UINT8 i=M_RDMEM_OPCODE(); if ( ZF) M_JMP(i); }
524540static void jmp(void)   { M_JMP( M_RDMEM_OPCODE() ); }
525541
526542#if (HAS_ALPHA8201)
527543static const s_opcode opcode_8201[256]=
528544{
529   {C1, nop        },{C1,rrca      },{C1, rlca      },{C1,inc_b     },{C1, dec_b    },{C1, inc_a    },{C1, dec_a    },{C1, cpl      },
545   {C1, nop        },{C1,rora      },{C1, rola      },{C1,inc_b     },{C1,dec_b     },{C1, inc_a    },{C1, dec_a    },{C1, cpl      },
530546   {C2,ld_a_ix0_0  },{C2,ld_a_ix0_1},{C2, ld_a_ix0_2},{C2,ld_a_ix0_3},{C2,ld_a_ix0_4},{C2,ld_a_ix0_5},{C2,ld_a_ix0_6},{C2,ld_a_ix0_7},
531547   {C2,ld_a_ix1_0  },{C2,ld_a_ix1_1},{C2, ld_a_ix1_2},{C2,ld_a_ix1_3},{C2,ld_a_ix1_4},{C2,ld_a_ix1_5},{C2,ld_a_ix1_6},{C2,ld_a_ix1_7},
532548   {C2,ld_ix2_0_a  },{C2,ld_ix2_1_a},{C2, ld_ix2_2_a},{C2,ld_ix2_3_a},{C2,ld_ix2_4_a},{C2,ld_ix2_5_a},{C2,ld_ix2_6_a},{C2,ld_ix2_7_a},
533549/* 20 */
534550   {C2,ld_ix0_0_b  },{C2,ld_ix0_1_b},{C2, ld_ix0_2_b},{C2,ld_ix0_3_b},{C2,ld_ix0_4_b},{C2,ld_ix0_5_b},{C2,ld_ix0_6_b},{C2,ld_ix0_7_b},
535   {C2,ld_ix1_0_b  },{C2,ld_ix1_1_b},{C2, ld_ix1_2_b},{C2,ld_ix1_3_b},{C2,ld_ix1_4_b},{C2,ld_ix1_5_b},{C2,ld_ix1_6_b},{C2,ld_ix1_7_b},
536   {C2,ld_b_ix2_0  },{C2,ld_b_ix2_1},{C2, ld_b_ix2_2},{C2,ld_b_ix2_3},{C2,ld_b_ix2_4},{C2,ld_b_ix2_5},{C2,ld_b_ix2_6},{C2,ld_b_ix2_7},
551   {C2,undefined   },{C2,undefined },{C2, undefined },{C2,undefined },{C2,undefined },{C2,undefined },{C2,undefined },{C2,undefined },
552   {C2,undefined   },{C2,undefined },{C2, undefined },{C2,undefined },{C2,undefined },{C2,undefined },{C2,undefined },{C2,undefined },
537553   {C2,bit_r0_0    },{C2,bit_r0_1  },{C2, bit_r0_2 },{C2, bit_r0_3 },{C2, bit_r0_4 },{C2, bit_r0_5 },{C2, bit_r0_6 },{C2, bit_r0_7 },
538554/* 40 : 8201 */
539555   {C2, ld_a_r0    },{C2, ld_r0_a   },{C2, ld_a_r1   },{C2, ld_r1_a   },{C2, ld_a_r2   },{C2, ld_r2_a   },{C2, ld_a_r3   },{C2, ld_r3_a   },
r2018r2019
551567   {C1, add_ix2_8   },{C1, add_ix2_9},{C1, add_ix2_a},{C1, add_ix2_b},{C1, add_ix2_c},{C1, add_ix2_d},{C1, add_ix2_e},{C1, add_ix2_f},
552568   {C1, ld_base_0   },{C1, ld_base_1},{C1, ld_base_2},{C1, ld_base_3},{C1, ld_base_4},{C1, ld_base_5},{C1, ld_base_6},{C1, ld_base_7},
553569   {C1, undefined   },{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},
554   {C1, ld_bank_0   },{C1, ld_bank_1},{C1, ld_bank_2},{C1, ld_bank_3},{C2, halt      },{C1, undefined},{C1, undefined},{C1, undefined},
570   {C1, ld_bank_0   },{C1, ld_bank_1},{C1, ld_bank_2},{C1, ld_bank_3},{C2, stop     },{C1, undefined},{C1, undefined},{C1, undefined},
555571   {C1, undefined   },{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},
556572/* c0 : 8201 */
557573   {C2, ld_ix0_n   },{C2, ld_ix1_n   },{C2, ld_ix2_n   },{C2, ld_a_n   },{C2, ld_lp0_n   },{C2, ld_lp1_n   },{C2, ld_lp2_n   },{C2, ld_b_n   },
558574   {C2, add_a_n   },{C2, sub_a_n   },{C2, and_a_n   },{C2, or_a_n   },{C2, djnz_lp0   },{C2, djnz_lp1   },{C2, djnz_lp2   },{C2, jnz      },
559   {C2, jc         },{C2, jz      },{C2, jmp      },{C2,undefined2},{C2,undefined2},{C2,undefined2},{C2,undefined2},{C2, undefined2},
575   {C2, jnc          },{C2, jz      },{C2, jmp      },{C2,undefined2},{C2,undefined2},{C2,undefined2},{C2,undefined2},{C2, undefined2},
560576   {C2, undefined2   },{C2,undefined2},{C2,undefined2},{C2,undefined2},{C2,undefined2},{C2,undefined2},{C2,undefined2},{C2, undefined2},
561577/* E0 : 8201*/
562578   {C1, undefined   },{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},
r2018r2019
571587/* ALPHA 8301 : added instruction */
572588static void dec_ix0(void)  { IX0--; } /* OK */
573589
590static void ld_a_x(void)  { R.A = R.B; need_verify("LD   A,unk"); }
591static void ld_x_a(void)  { R.B = R.A; need_verify("LD   unk,A"); }
574592static void ld_a_b(void)  { R.A = R.B; }
575593static void ld_b_a(void)  { R.B = R.A; }
594static void exg_a_lp0(void)  { UINT8 t=R.A; R.A = LP0; LP0 = t; }
595static void ld_lp0_a(void)  { LP0 = R.A; }
576596
577597static void ld_ix0_a(void)    { IX0 = R.A; } /* maybe OK */
578598static void ld_ix1_a(void)    { IX1 = R.A; need_verify("LD   IX1,A"); } /* not found */
579599static void ld_ix2_a(void)    { IX2 = R.A; } /* maybe OK */
580600
581static void ld_ix2_ix0(void)  { IX2 = IX0; } /* OK */
601static void exg_ix0_ix2(void)  { UINT8 t=IX2; IX2 = IX0; IX0 = t; }
582602
583/* used by exctscc2 initialize routine */
584/* A=2 , D5 01 , D4 00 -> R=5 */
585/* A=5 , D4 01 -> R=2         */
586/*
587300: DA 02   CMP  A,$02  ; A is 2
588302: CF 00   JNZ  $00
589304: A7      LD   RB,7
590305: 41      LD   R0,A
591306: 4F      LD   R7,A
592307: D5 01 --------------
593309: D4 00 --------------
59430B: DA 05   CMP  A,$05   ; A must be set 5
59530D: CF 00   JNZ  $00
59630F: D4 01 --------------
597311: DA 02   CMP  A,$02   ; A must be set 5
598313: CF 00   JNZ  $00
599315: FD      clr  a ?
600*/
601static void op_d4(void) { undefined2(); }
602static void op_d5(void) { undefined2(); }
603static void op_d4(void) { R.A = M_RDMEM( ((RD_REG(7) & 3) << 8) | M_RDMEM_OPCODE() ); }
604static void op_d5(void) { M_WRMEM( ((RD_REG(7) & 3) << 8) | M_RDMEM_OPCODE(), R.A ); }
605static void op_d6(void) { LP0 = M_RDMEM( ((RD_REG(7) & 3) << 8) | M_RDMEM_OPCODE() ); }
606static void op_d7(void) { M_WRMEM( ((RD_REG(7) & 3) << 8) | M_RDMEM_OPCODE(), LP0 ); }
607static void ld_a_abs(void) { R.A = M_RDMEM( ((R.mb & 3) << 8) | M_RDMEM_OPCODE() ); }
608static void ld_abs_a(void) { M_WRMEM( ((R.mb & 3) << 8) | M_RDMEM_OPCODE(), R.A ); }
603609
604/* used by exctsccr/exctscc2 ROM check sum routine (382-3cf) */
605/* ZF = 0 in op_f8 are patch for bypass exctsccr and exctscc2 check sum error */
606static void op_f6(void) { logerror("ALPHA-8301 Unknown OP-code PC = %03x, opcode = 0xf6: alu ?,a ??\n",PC-1); }
607static void op_f8(void) { ZF = 1; logerror("ALPHA-8301 Unknown OP-code PC = %03x, opcode = 0xf8: alu ?,a ??\n",PC-1); }
608static void op_f9(void) { logerror("ALPHA-8301 Unknown OP-code PC = %03x, opcode = 0xf9: alu a,? ??\n",PC-1); }
610static void op_dd(void) { regRAM[(M_RDMEM_OPCODE()>>1)&0x3f] = R.A; }
611static void op_ldir(void) { M_WRMEM(BIX2+0, regRAM[(R.B>>1)&0x3f]); IX2++; R.B+=2; LP0--; if (LP0 != 0) PCL--; }
612static void op_f6(void) { regRAM[(R.B>>1)&0x3f] = R.A; }
613static void op_f8(void) { M_SUB( regRAM[(R.B>>1)&0x3f] );  need_verify("SUB/CMP  A,(RXB)"); }
614static void op_f9(void) { M_XOR( regRAM[(R.B>>1)&0x3f] ); }
609615
610static void add_a_cf(void) { R.A += CF; CF = 0; ZF = (R.A==0); } /* OK */
611static void tst_a(void)    { ZF = (R.A==0); }                          /* maybe OK */
612static void clr_a(void)    { R.A = 0; ZF = (R.A==0); }                 /* maybe OK */
613static void cmp_a_n(void)   { UINT8 i=M_RDMEM_OPCODE();  ZF = (R.A==i); CF = (R.A<i); }
614static void call(void) { UINT8 i=M_RDMEM_OPCODE(); R.retptr.w.l = PC; M_JMP(i); } /* OK , but stack is unknown */
615static void ld_a_ix0_a(void) { R.A = M_RDMEM(BIX0+R.A); }              /* maybe OK */
616static void ret(void) { R.mb = R.retptr.b.h; M_JMP( R.retptr.b.l ); }  /* OK , but stack is unknown */
616static void add_a_cf(void) { R.A += CF; CF = 0; ZF = (R.A==0); }
617static void tst_a(void)    { ZF = (R.A==0); }
618static void clr_a(void)    { R.A = 0; ZF = (R.A==0); }
619static void cmp_a_n(void)   { UINT8 i=M_RDMEM_OPCODE();  ZF = (R.A==i); CF = (R.A>=i); }
620static void xor_a_n(void)   { M_XOR( M_RDMEM_OPCODE() ); }
621static void call(void) { UINT8 i=M_RDMEM_OPCODE(); R.retptr.w.l = PC; M_JMP(i); }; /* OK , but stack is unknown */
622static void ld_a_ix0_a(void) { R.A = M_RDMEM(BIX0+R.A); }
623static void ret(void) { R.mb = R.retptr.b.h; M_JMP( R.retptr.b.l ); }; /* OK , but stack is unknown */
617624
618625static const s_opcode opcode_8301[256]=
619626{
620   {C1, nop        },{C1,rrca      },{C1, rlca      },{C1,inc_b     },{C1, dec_b    },{C1, inc_a    },{C1, dec_a    },{C1, cpl      },
627   {C1, nop        },{C1,rora      },{C1, rola      },{C1,inc_b     },{C1,dec_b     },{C1, inc_a    },{C1, dec_a    },{C1, cpl      },
621628   {C2,ld_a_ix0_0  },{C2,ld_a_ix0_1},{C2, ld_a_ix0_2},{C2,ld_a_ix0_3},{C2,ld_a_ix0_4},{C2,ld_a_ix0_5},{C2,ld_a_ix0_6},{C2,ld_a_ix0_7},
622629   {C2,ld_a_ix1_0  },{C2,ld_a_ix1_1},{C2, ld_a_ix1_2},{C2,ld_a_ix1_3},{C2,ld_a_ix1_4},{C2,ld_a_ix1_5},{C2,ld_a_ix1_6},{C2,ld_a_ix1_7},
623630   {C2,ld_ix2_0_a  },{C2,ld_ix2_1_a},{C2, ld_ix2_2_a},{C2,ld_ix2_3_a},{C2,ld_ix2_4_a},{C2,ld_ix2_5_a},{C2,ld_ix2_6_a},{C2,ld_ix2_7_a},
624631/* 20 : 8301 */
625632   {C2,ld_ix0_0_b  },{C2,ld_ix0_1_b},{C2, ld_ix0_2_b},{C2,ld_ix0_3_b},{C2,ld_ix0_4_b},{C2,ld_ix0_5_b},{C2,ld_ix0_6_b},{C2,ld_ix0_7_b},
626   {C2,ld_ix1_0_b  },{C2,ld_ix1_1_b},{C2, ld_ix1_2_b},{C2,ld_ix1_3_b},{C2,ld_ix1_4_b},{C2,ld_ix1_5_b},{C2,ld_ix1_6_b},{C2,ld_ix1_7_b},
627   {C2,ld_b_ix2_0  },{C2,ld_b_ix2_1},{C2, ld_b_ix2_2},{C2,ld_b_ix2_3},{C2,ld_b_ix2_4},{C2,ld_b_ix2_5},{C2,ld_b_ix2_6},{C2,ld_b_ix2_7},
633   {C2,undefined   },{C2,undefined },{C2, undefined },{C2,undefined },{C2,undefined },{C2,undefined },{C2,undefined },{C2,undefined },
634   {C2,undefined   },{C2,undefined },{C2, undefined },{C2,undefined },{C2,undefined },{C2,undefined },{C2,undefined },{C2,undefined },
628635   {C2,bit_r0_0    },{C2,bit_r0_1  },{C2, bit_r0_2 },{C2, bit_r0_3 },{C2, bit_r0_4 },{C2, bit_r0_5 },{C2, bit_r0_6 },{C2, bit_r0_7 },
629636/* 40 : 8301 */
630637   {C2, ld_a_r0    },{C2, ld_r0_a   },{C2, ld_a_r1   },{C2, ld_r1_a   },{C2, ld_a_r2   },{C2, ld_r2_a   },{C2, ld_a_r3   },{C2, ld_r3_a   },
r2018r2019
644651/* A0 : 8301 */
645652   {C1, ld_base_0   },{C1, ld_base_1},{C1, ld_base_2},{C1, ld_base_3},{C1, ld_base_4},{C1, ld_base_5},{C1, ld_base_6},{C1, ld_base_7},
646653   {C1, undefined   },{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},
647   {C1, ld_bank_0   },{C1, ld_bank_1},{C1, ld_bank_2},{C1, ld_bank_3},{C2, halt      },{C1, undefined},{C1, undefined},{C1, undefined},
654   {C1, ld_bank_0   },{C1, ld_bank_1},{C1, ld_bank_2},{C1, ld_bank_3},{C2, stop     },{C1, undefined},{C1, undefined},{C1, undefined},
648655   {C1, undefined   },{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},
649656/* c0 : 8301 */
650   {C2, ld_ix0_n   },{C2, ld_ix1_n   },{C2, ld_ix2_n   },{C2, ld_a_n   },{C2, ld_lp0_n   },{C2, ld_lp1_n   },{C2, ld_lp2_n   },{C2, ld_b_n   },
657   {C2, ld_ix0_n   },{C2, ld_ix1_n},{C2, ld_ix2_n   },{C2, ld_a_n   },{C2, ld_lp0_n   },{C2, ld_lp1_n   },{C2, ld_lp2_n   },{C2, ld_b_n   },
651658   {C2, add_a_n   },{C2, sub_a_n   },{C2, and_a_n   },{C2, or_a_n   },{C2, djnz_lp0   },{C2, djnz_lp1   },{C2, djnz_lp2   },{C2, jnz      },
652   {C2, jc         },{C2, jz      },{C2, jmp      },{C2,undefined2},{C2, op_d4    },{C2, op_d5    },{C2,undefined2},{C2, undefined2},
653   {C2, undefined2   },{C2,undefined2},{C2,cmp_a_n   },{C2,undefined2},{C2,undefined2},{C2,undefined2},{C2,undefined2},{C2, call},
659   {C2, jnc         },{C2, jz      },{C2, jmp      },{C2,undefined2},{C2, op_d4    },{C2, op_d5    },{C2, op_d6    },{C2, op_d7    },
660   {C2, ld_a_abs  },{C2, ld_abs_a},{C2,cmp_a_n   },{C2,xor_a_n   },{C2,undefined2},{C2, op_dd    },{C2,undefined2},{C2, call},
654661/* E0 : 8301 */
655   {C1, dec_ix0   },{C1, undefined},{C1, undefined},{C1, ld_a_b   },{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},
656   {C1, ld_ix0_a   },{C1, ld_ix1_a },{C1, ld_ix2_a },{C1, ld_b_a   },{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},
657   {C1, undefined   },{C1,ld_ix2_ix0},{C1, undefined},{C1, undefined},{C1, undefined},{C1, undefined},{C1, op_f6    },{C1, undefined},
662   {C1, dec_ix0   },{C1, undefined},{C1, undefined},{C1, ld_a_x   },{C1, undefined},{C1, ld_a_b   },{C1, exg_a_lp0   },{C1, undefined},
663   {C1, ld_ix0_a   },{C1, ld_ix1_a },{C1, ld_ix2_a },{C1, ld_x_a   },{C1, undefined},{C1, ld_b_a   },{C1, ld_lp0_a   },{C1, undefined},
664   {C1, undefined   },{C1,exg_ix0_ix2},{C1,op_ldir  },{C1, undefined},{C1, undefined},{C1, undefined},{C1, op_f6    },{C1, undefined},
658665   {C1, op_f8      },{C1, op_f9    },{C1, add_a_cf },{C1, undefined},{C1, tst_a    },{C1, clr_a   },{C1,ld_a_ix0_a},{C1, ret }
659666};
660667#endif
r2018r2019
668675   state_save_register_item("ALPHA8201", index, R.PREVPC);
669676   state_save_register_item("ALPHA8201", index, PC);
670677   state_save_register_item("ALPHA8201", index, regPTR);
671   state_save_register_item("ALPHA8201", index, R.zf);
672   state_save_register_item("ALPHA8201", index, R.cf);
678   state_save_register_item("ALPHA8201", index, ZF);
679   state_save_register_item("ALPHA8201", index, CF);
673680   state_save_register_item("ALPHA8201", index, R.mb);
674681#if HANDLE_HALT_LINE
675682   state_save_register_item("ALPHA8201", index, R.halt);
r2018r2019
704711#if HANDLE_HALT_LINE
705712   R.halt = 0;
706713#endif
707/*  memset(R.RAM, 0, sizeof(R.RAM)); */
708714}
709715
710716/****************************************************************************
r2018r2019
855861      case CPUINFO_INT_REGISTER + ALPHA8201_PC:         PC = info->i;                  break;
856862      case CPUINFO_INT_SP:
857863      case CPUINFO_INT_REGISTER + ALPHA8201_SP:         M_WRMEM(0x001,info->i);            break;
858      case CPUINFO_INT_REGISTER + ALPHA8201_RB:         regPTR = (info->i & 7)<<3;         break;
864      case CPUINFO_INT_REGISTER + ALPHA8201_RB:         regPTR = info->i & 7;            break;
859865      case CPUINFO_INT_REGISTER + ALPHA8201_MB:         R.mb = info->i & 0x03;            break;
860866#if 0
861      case CPUINFO_INT_REGISTER + ALPHA8201_ZF:         R.zf= info->i & 0x01;            break;
862      case CPUINFO_INT_REGISTER + ALPHA8201_CF:         R.cf= info->i & 0x01;            break;
867      case CPUINFO_INT_REGISTER + ALPHA8201_ZF:         ZF= info->i & 0x01;            break;
868      case CPUINFO_INT_REGISTER + ALPHA8201_CF:         CF= info->i & 0x01;            break;
863869#endif
864870      case CPUINFO_INT_REGISTER + ALPHA8201_IX0:         IX0 = info->i;                  break;
865871      case CPUINFO_INT_REGISTER + ALPHA8201_IX1:         IX1 = info->i;                  break;
r2018r2019
869875      case CPUINFO_INT_REGISTER + ALPHA8201_LP2:         LP2 = info->i;                  break;
870876      case CPUINFO_INT_REGISTER + ALPHA8201_A:         R.A = info->i;                  break;
871877      case CPUINFO_INT_REGISTER + ALPHA8201_B:         R.B = info->i;                  break;
872      case CPUINFO_INT_REGISTER + ALPHA8201_R0:         R0 = info->i;                  break;
873      case CPUINFO_INT_REGISTER + ALPHA8201_R1:         R1 = info->i;                  break;
874      case CPUINFO_INT_REGISTER + ALPHA8201_R2:         R2 = info->i;                  break;
875      case CPUINFO_INT_REGISTER + ALPHA8201_R3:         R3 = info->i;                  break;
876      case CPUINFO_INT_REGISTER + ALPHA8201_R4:         R4 = info->i;                  break;
877      case CPUINFO_INT_REGISTER + ALPHA8201_R5:         R5 = info->i;                  break;
878      case CPUINFO_INT_REGISTER + ALPHA8201_R6:         R6 = info->i;                  break;
879      case CPUINFO_INT_REGISTER + ALPHA8201_R7:         R7 = info->i;                  break;
878      case CPUINFO_INT_REGISTER + ALPHA8201_R0:         WR_REG(0,info->i);               break;
879      case CPUINFO_INT_REGISTER + ALPHA8201_R1:         WR_REG(1,info->i);               break;
880      case CPUINFO_INT_REGISTER + ALPHA8201_R2:         WR_REG(2,info->i);               break;
881      case CPUINFO_INT_REGISTER + ALPHA8201_R3:         WR_REG(3,info->i);               break;
882      case CPUINFO_INT_REGISTER + ALPHA8201_R4:         WR_REG(4,info->i);               break;
883      case CPUINFO_INT_REGISTER + ALPHA8201_R5:         WR_REG(5,info->i);               break;
884      case CPUINFO_INT_REGISTER + ALPHA8201_R6:         WR_REG(6,info->i);               break;
885      case CPUINFO_INT_REGISTER + ALPHA8201_R7:         WR_REG(7,info->i);               break;
880886   }
881887}
882888
r2018r2019
932938      case CPUINFO_INT_REGISTER + ALPHA8201_LP2:         info->i = LP2;                  break;
933939      case CPUINFO_INT_REGISTER + ALPHA8201_A:         info->i = R.A;                  break;
934940      case CPUINFO_INT_REGISTER + ALPHA8201_B:         info->i = R.B;                  break;
935      case CPUINFO_INT_REGISTER + ALPHA8201_R0:         info->i = R0;                  break;
936      case CPUINFO_INT_REGISTER + ALPHA8201_R1:         info->i = R1;                  break;
937      case CPUINFO_INT_REGISTER + ALPHA8201_R2:         info->i = R2;                  break;
938      case CPUINFO_INT_REGISTER + ALPHA8201_R3:         info->i = R3;                  break;
939      case CPUINFO_INT_REGISTER + ALPHA8201_R4:         info->i = R4;                  break;
940      case CPUINFO_INT_REGISTER + ALPHA8201_R5:         info->i = R5;                  break;
941      case CPUINFO_INT_REGISTER + ALPHA8201_R6:         info->i = R6;                  break;
942      case CPUINFO_INT_REGISTER + ALPHA8201_R7:         info->i = R7;                  break;
941      case CPUINFO_INT_REGISTER + ALPHA8201_R0:         info->i = RD_REG(0);            break;
942      case CPUINFO_INT_REGISTER + ALPHA8201_R1:         info->i = RD_REG(1);            break;
943      case CPUINFO_INT_REGISTER + ALPHA8201_R2:         info->i = RD_REG(2);            break;
944      case CPUINFO_INT_REGISTER + ALPHA8201_R3:         info->i = RD_REG(3);            break;
945      case CPUINFO_INT_REGISTER + ALPHA8201_R4:         info->i = RD_REG(4);            break;
946      case CPUINFO_INT_REGISTER + ALPHA8201_R5:         info->i = RD_REG(5);            break;
947      case CPUINFO_INT_REGISTER + ALPHA8201_R6:         info->i = RD_REG(6);            break;
948      case CPUINFO_INT_REGISTER + ALPHA8201_R7:         info->i = RD_REG(7);            break;
943949
944950      /* --- the following bits of info are returned as pointers to data or functions --- */
945951      case CPUINFO_PTR_SET_INFO:                  info->setinfo = ALPHA8201_set_info;      break;
r2018r2019
962968      case CPUINFO_STR_FLAGS:                     sprintf(info->s, "%c%c", CF?'C':'.',ZF?'Z':'.'); break;
963969      case CPUINFO_STR_REGISTER + ALPHA8201_PC:      sprintf(info->s, "PC:%03X", PC);      break;
964970      case CPUINFO_STR_REGISTER + ALPHA8201_SP:      sprintf(info->s, "SP:%02X", M_RDMEM(0x001) ); break;
965      case CPUINFO_STR_REGISTER + ALPHA8201_RB:      sprintf(info->s, "RB:%02X", regPTR>>3);   break;
971      case CPUINFO_STR_REGISTER + ALPHA8201_RB:      sprintf(info->s, "RB:%X", regPTR);      break;
966972      case CPUINFO_STR_REGISTER + ALPHA8201_MB:      sprintf(info->s, "MB:%X", R.mb);      break;
967973#if 0
968      case CPUINFO_STR_REGISTER + ALPHA8201_ZF:      sprintf(info->s, "ZF:%X", R.zf);      break;
969      case CPUINFO_STR_REGISTER + ALPHA8201_CF:      sprintf(info->s, "CF:%X", R.cf);      break;
974      case CPUINFO_STR_REGISTER + ALPHA8201_ZF:      sprintf(info->s, "ZF:%X", ZF);      break;
975      case CPUINFO_STR_REGISTER + ALPHA8201_CF:      sprintf(info->s, "CF:%X", CF);      break;
970976#endif
971977      case CPUINFO_STR_REGISTER + ALPHA8201_IX0:      sprintf(info->s, "IX0:%02X", IX0);      break;
972978      case CPUINFO_STR_REGISTER + ALPHA8201_IX1:      sprintf(info->s, "IX1:%02X", IX1);      break;
r2018r2019
976982      case CPUINFO_STR_REGISTER + ALPHA8201_LP2:      sprintf(info->s, "LP2:%02X", LP2);      break;
977983      case CPUINFO_STR_REGISTER + ALPHA8201_A:      sprintf(info->s, "A:%02X", R.A);      break;
978984      case CPUINFO_STR_REGISTER + ALPHA8201_B:      sprintf(info->s, "B:%02X", R.B);      break;
979      case CPUINFO_STR_REGISTER + ALPHA8201_R0:      sprintf(info->s, "R0:%02X", R0);      break;
980      case CPUINFO_STR_REGISTER + ALPHA8201_R1:      sprintf(info->s, "R1:%02X", R1);      break;
981      case CPUINFO_STR_REGISTER + ALPHA8201_R2:      sprintf(info->s, "R2:%02X", R2);      break;
982      case CPUINFO_STR_REGISTER + ALPHA8201_R3:      sprintf(info->s, "R3:%02X", R3);      break;
983      case CPUINFO_STR_REGISTER + ALPHA8201_R4:      sprintf(info->s, "R4:%02X", R4);      break;
984      case CPUINFO_STR_REGISTER + ALPHA8201_R5:      sprintf(info->s, "R5:%02X", R5);      break;
985      case CPUINFO_STR_REGISTER + ALPHA8201_R6:      sprintf(info->s, "R6:%02X", R6);      break;
986      case CPUINFO_STR_REGISTER + ALPHA8201_R7:      sprintf(info->s, "R7:%02X", R7);      break;
985      case CPUINFO_STR_REGISTER + ALPHA8201_R0:      sprintf(info->s, "R0:%02X", RD_REG(0));      break;
986      case CPUINFO_STR_REGISTER + ALPHA8201_R1:      sprintf(info->s, "R1:%02X", RD_REG(1));      break;
987      case CPUINFO_STR_REGISTER + ALPHA8201_R2:      sprintf(info->s, "R2:%02X", RD_REG(2));      break;
988      case CPUINFO_STR_REGISTER + ALPHA8201_R3:      sprintf(info->s, "R3:%02X", RD_REG(3));      break;
989      case CPUINFO_STR_REGISTER + ALPHA8201_R4:      sprintf(info->s, "R4:%02X", RD_REG(4));      break;
990      case CPUINFO_STR_REGISTER + ALPHA8201_R5:      sprintf(info->s, "R5:%02X", RD_REG(5));      break;
991      case CPUINFO_STR_REGISTER + ALPHA8201_R6:      sprintf(info->s, "R6:%02X", RD_REG(6));      break;
992      case CPUINFO_STR_REGISTER + ALPHA8201_R7:      sprintf(info->s, "R7:%02X", RD_REG(7));      break;
987993   }
988994}
989995#if (HAS_ALPHA8201)
src/emu/cpu/i8x41/i8x41.c
r2018r2019
183183#define R(n)      i8x41.ram[((PSW & BS) ? M_BANK1:M_BANK0)+(n)]
184184#define STATE      i8x41.state
185185#define ENABLE      i8x41.enable
186#define TIMER      i8x41.timer
187186#define PRESCALER   i8x41.prescaler
188187#define P1         i8x41.p1
189188#define P2         i8x41.p2
r2018r2019
868867 ***********************************/
869868INLINE void mov_a_t(void)
870869{
871   A = TIMER;
870   A = i8x41.timer;
872871}
873872
874873/***********************************
r2018r2019
935934 ***********************************/
936935INLINE void mov_t_a(void)
937936{
938   TIMER = A;
937   i8x41.timer = A;
939938}
940939
941940/***********************************
r2018r2019
19471946            T1_level = RP(I8X41_t1);
19481947            if( (CONTROL & TEST1) && (T1_level == 0) )   /* Negative Edge */
19491948            {
1950               TIMER++;
1951               if (TIMER == 0)
1949               i8x41.timer++;
1950               if (i8x41.timer == 0)
19521951               {
19531952                  CONTROL |= TOVF;
19541953                  if( ENABLE & TCNTI )
r2018r2019
19671966         if( PRESCALER >= 32 )
19681967         {
19691968            PRESCALER -= 32;
1970            TIMER++;
1971            if( TIMER == 0 )
1969            i8x41.timer++;
1970            if( i8x41.timer == 0 )
19721971            {
19731972               CONTROL |= TOVF;
19741973               if( ENABLE & TCNTI )
r2018r2019
20682067            /* counting enabled? */
20692068            if( ENABLE & CNT )
20702069            {
2071               TIMER++;
2072               if( TIMER == 0 )
2070               i8x41.timer++;
2071               if( i8x41.timer == 0 )
20732072               {
20742073                  CONTROL |= TOVF;
20752074                  CONTROL |= TIRQ_PEND;
r2018r2019
21152114
21162115      case CPUINFO_INT_REGISTER + I8X41_PSW:         PSW = info->i;                     break;
21172116      case CPUINFO_INT_REGISTER + I8X41_A:         A = info->i;                     break;
2118      case CPUINFO_INT_REGISTER + I8X41_T:         TIMER = info->i & 0x1fff;            break;
2117      case CPUINFO_INT_REGISTER + I8X41_T:         i8x41.timer = info->i & 0x1fff;            break;
21192118      case CPUINFO_INT_REGISTER + I8X41_R0:         SETR(0, info->i);                  break;
21202119      case CPUINFO_INT_REGISTER + I8X41_R1:         SETR(1, info->i);                  break;
21212120      case CPUINFO_INT_REGISTER + I8X41_R2:         SETR(2, info->i);                  break;
r2018r2019
22282227
22292228      case CPUINFO_INT_REGISTER + I8X41_PSW:         info->i = PSW;                     break;
22302229      case CPUINFO_INT_REGISTER + I8X41_A:         info->i = A;                     break;
2231      case CPUINFO_INT_REGISTER + I8X41_T:         info->i = TIMER;                  break;
2230      case CPUINFO_INT_REGISTER + I8X41_T:         info->i = i8x41.timer;                  break;
22322231      case CPUINFO_INT_REGISTER + I8X41_R0:         info->i = GETR(0);                  break;
22332232      case CPUINFO_INT_REGISTER + I8X41_R1:         info->i = GETR(1);                  break;
22342233      case CPUINFO_INT_REGISTER + I8X41_R2:         info->i = GETR(2);                  break;
src/emu/video/v9938.c
r2018r2019
5555   /* palette */
5656   UINT16 pal_ind16[16];
5757   UINT16 pal_ind256[256];
58   /* render screen */
59   const device_config *screen;
5860   /* render bitmap */
5961   bitmap_t *bitmap;
6062   /* Command unit */
r2018r2019
481483
482484***************************************************************************/
483485
484void v9938_init (running_machine *machine, int which, bitmap_t *bitmap, int model, int vram_size, void (*callback)(int) )
486void v9938_init (running_machine *machine, int which, const device_config *screen, bitmap_t *bitmap, int model, int vram_size, void (*callback)(int) )
485487{
486488   vdp = &vdps[which];
487489
r2018r2019
490492   vdp->VdpOpsCnt = 1;
491493   vdp->VdpEngine = NULL;
492494
495   vdp->screen = screen;
493496   vdp->bitmap = bitmap;
494497   vdp->model = model;
495498   vdp->vram_size = vram_size;
r2018r2019
14501453   if (vdp->size != vdp->size_old)
14511454      {
14521455      if (vdp->size == RENDER_HIGH)
1453         video_screen_set_visarea (0, 0, 512 + 32 - 1, 0, 424 + 56 - 1);
1456         video_screen_set_visarea (vdp->screen, 0, 512 + 32 - 1, 0, 424 + 56 - 1);
14541457      else
1455         video_screen_set_visarea (0, 0, 256 + 16 - 1, 0, 212 + 28 - 1);
1458         video_screen_set_visarea (vdp->screen, 0, 256 + 16 - 1, 0, 212 + 28 - 1);
14561459
14571460      vdp->size_old = vdp->size;
14581461      }
src/emu/video/v9938.h
r2018r2019
1414#define RENDER_LOW   (1)
1515#define RENDER_AUTO   (2)
1616
17void v9938_init (running_machine *, int which, bitmap_t *bitmap, int, int, void (*callback)(int));
17void v9938_init (running_machine *machine, int which, const device_config *screen, bitmap_t *bitmap, int model, int vram_size, void (*callback)(int) );
1818void v9938_reset (int which);
1919int v9938_interrupt (int which);
2020void v9938_set_sprite_limit (int which, int);
src/emu/video/mc6845.c
r2018r2019
639639
640640
641641/* device interface */
642static void *common_start(const device_config *device, int device_type)
642static void common_start(const device_config *device, int device_type)
643643{
644   mc6845_t *mc6845;
644   mc6845_t *mc6845 = get_safe_token(device);
645645   char unique_tag[30];
646646
647647   /* validate arguments */
r2018r2019
649649   assert(device->tag != NULL);
650650   assert(strlen(device->tag) < 20);
651651
652   /* allocate the object that holds the state */
653   mc6845 = auto_malloc(sizeof(*mc6845));
654   memset(mc6845, 0, sizeof(*mc6845));
655
656652   mc6845->intf = device->static_config;
657653   mc6845->device_type = device_type;
658654
r2018r2019
708704   state_save_register_item(unique_tag, 0, mc6845->light_pen_latched);
709705   state_save_register_item(unique_tag, 0, mc6845->cursor_state);
710706   state_save_register_item(unique_tag, 0, mc6845->cursor_blink_count);
711
712   return mc6845;
713707}
714708
715709static DEVICE_START( mc6845 )
716710{
717   return common_start(device, TYPE_MC6845);
711   common_start(device, TYPE_MC6845);
718712}
719713
720714static DEVICE_START( mc6845_1 )
721715{
722   return common_start(device, TYPE_MC6845_1);
716   common_start(device, TYPE_MC6845_1);
723717}
724718
725719static DEVICE_START( c6545_1 )
726720{
727   return common_start(device, TYPE_C6545_1);
721   common_start(device, TYPE_C6545_1);
728722}
729723
730724static DEVICE_START( r6545_1 )
731725{
732   return common_start(device, TYPE_R6545_1);
726   common_start(device, TYPE_R6545_1);
733727}
734728
735729static DEVICE_START( h46505 )
736730{
737   return common_start(device, TYPE_H46505);
731   common_start(device, TYPE_H46505);
738732}
739733
740734static DEVICE_START( hd6845 )
741735{
742   return common_start(device, TYPE_HD6845);
736   common_start(device, TYPE_HD6845);
743737}
744738
745739static DEVICE_START( sy6545_1 )
746740{
747   return common_start(device, TYPE_SY6545_1);
741   common_start(device, TYPE_SY6545_1);
748742}
749743
750744
r2018r2019
783777   switch (state)
784778   {
785779      /* --- the following bits of info are returned as 64-bit signed integers --- */
780      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(mc6845_t);               break;
786781      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
787782      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;         break;
788783
src/emu/watchdog.c
r2018r2019
7373static TIMER_CALLBACK( watchdog_callback )
7474{
7575   logerror("Reset caused by the watchdog!!!\n");
76
77#ifdef MAME_DEBUG
7678   popmessage("Reset caused by the watchdog!!!\n");
79#endif
80
7781   mame_schedule_soft_reset(machine);
7882}
7983
r2018r2019
117121
118122      /* register a VBLANK callback for the primary screen */
119123      if (machine->primary_screen != NULL)
120         video_screen_register_vbl_cb(machine->primary_screen, on_vblank);
124         video_screen_register_vblank_callback(machine->primary_screen, on_vblank);
121125   }
122126
123127   /* timer-based watchdog? */
src/emu/video.c
r2018r2019
3636
3737#define SUBSECONDS_PER_SPEED_UPDATE   (ATTOSECONDS_PER_SECOND / 4)
3838#define PAUSED_REFRESH_RATE         (30)
39#define MAX_VBL_CB               (10)
40#define DEFAULT_FRAME_PEIOD         ATTOTIME_IN_HZ(60)
39#define MAX_VBLANK_CALLBACKS      (10)
40#define DEFAULT_FRAME_PERIOD      ATTOTIME_IN_HZ(60)
4141
4242
4343
r2018r2019
7676   UINT64               frame_number;         /* the current frame number */
7777
7878   /* screen specific VBLANK callbacks */
79   vblank_state_changed_func vbl_cbs[MAX_VBL_CB];   /* the array of callbacks */
79   vblank_state_changed_func vblank_callback[MAX_VBLANK_CALLBACKS]; /* the array of callbacks */
8080
8181   /* movie recording */
8282   mame_file *            movie_file;            /* handle to the open movie file */
r2018r2019
8787typedef struct _video_global video_global;
8888struct _video_global
8989{
90   /* screenless systems */
91   emu_timer *            screenless_frame_timer;   /* timer to signal VBLANK start */
92
9093   /* throttling calculations */
91   osd_ticks_t            throttle_last_ticks;/* osd_ticks the last call to throttle */
92   attotime             throttle_realtime;   /* real time the last call to throttle */
93   attotime             throttle_emutime;   /* emulated time the last call to throttle */
94   UINT32                throttle_history;   /* history of frames where we were fast enough */
94   osd_ticks_t            throttle_last_ticks;   /* osd_ticks the last call to throttle */
95   attotime             throttle_realtime;      /* real time the last call to throttle */
96   attotime             throttle_emutime;      /* emulated time the last call to throttle */
97   UINT32                throttle_history;      /* history of frames where we were fast enough */
9598
9699   /* dynamic speed computation */
97   osd_ticks_t          speed_last_realtime;/* real time at the last speed calculation */
98   attotime             speed_last_emutime;   /* emulated time at the last speed calculation */
99   double                speed_percent;      /* most recent speed percentage */
100   osd_ticks_t          speed_last_realtime;   /* real time at the last speed calculation */
101   attotime             speed_last_emutime;      /* emulated time at the last speed calculation */
102   double                speed_percent;         /* most recent speed percentage */
100103   UINT32                partial_updates_this_frame;/* partial update counter this frame */
101104
102105   /* overall speed computation */
103   UINT32               overall_real_seconds;/* accumulated real seconds at normal speed */
104   osd_ticks_t            overall_real_ticks;   /* accumulated real ticks at normal speed */
105   attotime            overall_emutime;   /* accumulated emulated time at normal speed */
106   UINT32               overall_valid_counter;/* number of consecutive valid time periods */
106   UINT32               overall_real_seconds;   /* accumulated real seconds at normal speed */
107   osd_ticks_t            overall_real_ticks;      /* accumulated real ticks at normal speed */
108   attotime            overall_emutime;      /* accumulated emulated time at normal speed */
109   UINT32               overall_valid_counter;   /* number of consecutive valid time periods */
107110
108111   /* configuration */
109   UINT8               sleep;            /* flag: TRUE if we're allowed to sleep */
110   UINT8               throttle;         /* flag: TRUE if we're currently throttled */
111   UINT8               fastforward;      /* flag: TRUE if we're currently fast-forwarding */
112   UINT32               seconds_to_run;      /* number of seconds to run before quitting */
113   UINT8               auto_frameskip;      /* flag: TRUE if we're automatically frameskipping */
114   UINT32               speed;            /* overall speed (*100) */
115   UINT32               original_speed;      /* originally-specified speed */
116   UINT8               refresh_speed;      /* flag: TRUE if we max out our speed according to the refresh */
117   UINT8               update_in_pause;   /* flag: TRUE if video is updated while in pause */
112   UINT8               sleep;               /* flag: TRUE if we're allowed to sleep */
113   UINT8               throttle;            /* flag: TRUE if we're currently throttled */
114   UINT8               fastforward;         /* flag: TRUE if we're currently fast-forwarding */
115   UINT32               seconds_to_run;         /* number of seconds to run before quitting */
116   UINT8               auto_frameskip;         /* flag: TRUE if we're automatically frameskipping */
117   UINT32               speed;               /* overall speed (*100) */
118   UINT32               original_speed;         /* originally-specified speed */
119   UINT8               refresh_speed;         /* flag: TRUE if we max out our speed according to the refresh */
120   UINT8               update_in_pause;      /* flag: TRUE if video is updated while in pause */
118121
119122   /* frameskipping */
120   UINT8               empty_skip_count;   /* number of empty frames we have skipped */
121   UINT8               frameskip_level;   /* current frameskip level */
122   UINT8               frameskip_counter;   /* counter that counts through the frameskip steps */
123   UINT8               empty_skip_count;      /* number of empty frames we have skipped */
124   UINT8               frameskip_level;      /* current frameskip level */
125   UINT8               frameskip_counter;      /* counter that counts through the frameskip steps */
123126   INT8               frameskip_adjust;
124   UINT8               skipping_this_frame;/* flag: TRUE if we are skipping the current frame */
125   osd_ticks_t            average_oversleep;   /* average number of ticks the OSD oversleeps */
127   UINT8               skipping_this_frame;   /* flag: TRUE if we are skipping the current frame */
128   osd_ticks_t            average_oversleep;      /* average number of ticks the OSD oversleeps */
126129
127130   /* snapshot stuff */
128   render_target *         snap_target;      /* screen shapshot target */
129   bitmap_t *            snap_bitmap;      /* screen snapshot bitmap */
131   render_target *         snap_target;         /* screen shapshot target */
132   bitmap_t *            snap_bitmap;         /* screen snapshot bitmap */
130133};
131134
132135
r2018r2019
172175/* global rendering */
173176static TIMER_CALLBACK( vblank_begin_callback );
174177static TIMER_CALLBACK( vblank_end_callback );
178static TIMER_CALLBACK( screenless_update_callback );
175179static TIMER_CALLBACK( scanline0_callback );
176180static TIMER_CALLBACK( scanline_update_callback );
177181static int finish_screen_updates(running_machine *machine);
r2018r2019
280284void video_init(running_machine *machine)
281285{
282286   const char *filename;
283   const device_config *screen;
284287
285288   /* validate */
286289   assert(machine != NULL);
r2018r2019
339342   if ((filename[0] != 0) && (machine->primary_screen != NULL))
340343      video_movie_begin_recording(machine->primary_screen, filename);
341344
342   /* for each screen */
343   for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen))
345   /* if no screens, create a periodic timer to drive updates */
346   if (machine->primary_screen == NULL)
344347   {
345      screen_state *state = get_safe_token(screen);
346      screen_config *config = screen->inline_config;
347
348      /* configure the screen with the default parameters */
349      video_screen_configure(screen, config->width, config->height, &config->visarea, config->refresh);
350
351      /* reset VBLANK timing */
352      state->vblank_start_time = attotime_zero;
353      state->vblank_end_time = attotime_make(0, state->vblank_period);
354
355      /* start the timer to generate per-scanline updates */
356      if (machine->config->video_attributes & VIDEO_UPDATE_SCANLINE)
357         timer_adjust_oneshot(state->scanline_timer, video_screen_get_time_until_pos(screen, 0, 0), 0);
348      global.screenless_frame_timer = timer_alloc(screenless_update_callback, NULL);
349      timer_adjust_periodic(global.screenless_frame_timer, DEFAULT_FRAME_PERIOD, 0, DEFAULT_FRAME_PERIOD);
358350   }
359351}
360352
361353
362354/*-------------------------------------------------
363    screen_init - initializes the state of a
364    single screen device
365-------------------------------------------------*/
366
367static screen_state *screen_init(const device_config *screen)
368{
369   char unique_tag[40];
370   screen_state *state;
371   render_container *container;
372   screen_config *config;
373
374   /* validate some basic stuff */
375   assert(screen != NULL);
376   assert(screen->static_config == NULL);
377   assert(screen->inline_config != NULL);
378   assert(screen->machine != NULL);
379   assert(screen->machine->config != NULL);
380
381   /* get and validate that the container for this screen exists */
382   container = render_container_get_screen(screen);
383   assert(container != NULL);
384
385   /* get and validate the configuration */
386   config = screen->inline_config;
387   assert(config->width > 0);
388   assert(config->height > 0);
389   assert(config->refresh > 0);
390   assert(config->visarea.min_x >= 0);
391   assert(config->visarea.max_x < config->width);
392   assert(config->visarea.max_x > config->visarea.min_x);
393   assert(config->visarea.min_y >= 0);
394   assert(config->visarea.max_y < config->height);
395   assert(config->visarea.max_y > config->visarea.min_y);
396
397   /* everything checks out, allocate the state object */
398   state = auto_malloc(sizeof(*state));
399   memset(state, 0, sizeof(*state));
400
401   /* allocate the VBLANK timers */
402   state->vblank_begin_timer = timer_alloc(vblank_begin_callback, (void *)screen);
403   state->vblank_end_timer = timer_alloc(vblank_end_callback, (void *)screen);
404
405   /* allocate a timer to reset partial updates */
406   state->scanline0_timer = timer_alloc(scanline0_callback, (void *)screen);
407
408   /* configure the default cliparea */
409   if (config->xoffset != 0)
410      render_container_set_xoffset(container, config->xoffset);
411   if (config->yoffset != 0)
412      render_container_set_yoffset(container, config->yoffset);
413   if (config->xscale != 0)
414      render_container_set_xscale(container, config->xscale);
415   if (config->yscale != 0)
416      render_container_set_yscale(container, config->yscale);
417
418   /* allocate a timer to generate per-scanline updates */
419   if (screen->machine->config->video_attributes & VIDEO_UPDATE_SCANLINE)
420      state->scanline_timer = timer_alloc(scanline_update_callback, (void *)screen);
421
422   /* register for save states */
423   assert(strlen(screen->tag) < 30);
424   state_save_combine_module_and_tag(unique_tag, "video_screen", screen->tag);
425
426   state_save_register_item(unique_tag, 0, state->vblank_start_time.seconds);
427   state_save_register_item(unique_tag, 0, state->vblank_start_time.attoseconds);
428   state_save_register_item(unique_tag, 0, state->vblank_end_time.seconds);
429   state_save_register_item(unique_tag, 0, state->vblank_end_time.attoseconds);
430   state_save_register_item(unique_tag, 0, state->frame_number);
431
432   return state;
433}
434
435
436/*-------------------------------------------------
437355    video_exit - close down the video system
438356-------------------------------------------------*/
439357
440358static void video_exit(running_machine *machine)
441359{
442   const device_config *screen;
443360   int i;
444361
445362   /* validate */
r2018r2019
454371   for (i = 0; i < MAX_GFX_ELEMENTS; i++)
455372      freegfx(machine->gfx[i]);
456373
457   /* free all the textures and bitmaps */
458   for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen))
459   {
460      screen_state *state = get_safe_token(screen);
461
462      if (state->texture[0] != NULL)
463         render_texture_free(state->texture[0]);
464      if (state->texture[1] != NULL)
465         render_texture_free(state->texture[1]);
466      if (state->bitmap[0] != NULL)
467         bitmap_free(state->bitmap[0]);
468      if (state->bitmap[1] != NULL)
469         bitmap_free(state->bitmap[1]);
470   }
471
472374   /* free the snapshot target */
473375   if (global.snap_target != NULL)
474376      render_target_free(global.snap_target);
r2018r2019
852754    including the specified scanline
853755-------------------------------------------------*/
854756
855void video_screen_update_partial(const device_config *screen, int scanline)
757int video_screen_update_partial(const device_config *screen, int scanline)
856758{
857759   screen_state *state = get_safe_token(screen);
858760   rectangle clip = state->visarea;
761   int result = FALSE;
859762
860763   /* validate arguments */
861764   assert(scanline >= 0);
r2018r2019
869772      if (global.skipping_this_frame)
870773      {
871774         LOG_PARTIAL_UPDATES(("skipped due to frameskipping\n"));
872         return;
775         return FALSE;
873776      }
874777
875778      /* skip if this screen is not visible anywhere */
876779      if (!render_is_live_screen(screen))
877780      {
878781         LOG_PARTIAL_UPDATES(("skipped because screen not live\n"));
879         return;
782         return FALSE;
880783      }
881784   }
882785
r2018r2019
884787   if (scanline < state->last_partial_scan)
885788   {
886789      LOG_PARTIAL_UPDATES(("skipped because less than previous\n"));
887      return;
790      return FALSE;
888791   }
889792
890793   /* set the start/end scanlines */
r2018r2019
908811
909812      /* if we modified the bitmap, we have to commit */
910813      state->changed |= ~flags & UPDATE_HAS_NOT_CHANGED;
814      result = TRUE;
911815   }
912816
913817   /* remember where we left off */
914818   state->last_partial_scan = scanline + 1;
819   return result;
915820}
916821
917822
r2018r2019
11681073    if (video_screen_count(screen->machine->config) == 0)
11691074    {
11701075       assert(screen == NULL);
1171       ret = DEFAULT_FRAME_PEIOD;
1076       ret = DEFAULT_FRAME_PERIOD;
11721077   }
11731078    else
11741079    {
r2018r2019
11941099
11951100
11961101/*-------------------------------------------------
1197    video_screen_register_vbl_cb - registers a
1102    video_screen_register_vblank_callback - registers a
11981103    VBLANK callback for a specific screen
11991104-------------------------------------------------*/
12001105
1201void video_screen_register_vbl_cb(const device_config *screen, vblank_state_changed_func vbl_cb)
1106void video_screen_register_vblank_callback(const device_config *screen, vblank_state_changed_func vblank_callback)
12021107{
12031108   int i, found;
12041109   screen_state *state = get_safe_token(screen);
12051110
12061111   /* validate arguments */
1207   assert(vbl_cb != NULL);
1112   assert(vblank_callback != NULL);
12081113
12091114   /* check if we already have this callback registered */
12101115   found = FALSE;
1211   for (i = 0; i < MAX_VBL_CB; i++)
1116   for (i = 0; i < MAX_VBLANK_CALLBACKS; i++)
12121117   {
1213      if (state->vbl_cbs[i] == NULL)
1118      if (state->vblank_callback[i] == NULL)
12141119         break;
12151120
1216      if (state->vbl_cbs[i] == vbl_cb)
1121      if (state->vblank_callback[i] == vblank_callback)
12171122         found = TRUE;
12181123   }
12191124
12201125   /* check that there is room */
1221   assert(i != MAX_VBL_CB);
1126   assert(i != MAX_VBLANK_CALLBACKS);
12221127
12231128   /* if not found, register and increment count */
12241129   if (!found)
1225      state->vbl_cbs[i] = vbl_cb;
1130      state->vblank_callback[i] = vblank_callback;
12261131}
12271132
12281133
r2018r2019
12311136***************************************************************************/
12321137
12331138/*-------------------------------------------------
1234    video_screen_start - device start callback
1235    for a video screen
1139    device_start_video_screen - device start
1140    callback for a video screen
12361141-------------------------------------------------*/
12371142
12381143static DEVICE_START( video_screen )
12391144{
1240   return screen_init(device);
1145   const device_config *screen = device;
1146   char unique_tag[40];
1147   screen_state *state = get_safe_token(screen);
1148   render_container *container;
1149   screen_config *config;
1150
1151   /* validate some basic stuff */
1152   assert(screen != NULL);
1153   assert(screen->static_config == NULL);
1154   assert(screen->inline_config != NULL);
1155   assert(screen->machine != NULL);
1156   assert(screen->machine->config != NULL);
1157
1158   /* get and validate that the container for this screen exists */
1159   container = render_container_get_screen(screen);
1160   assert(container != NULL);
1161
1162   /* get and validate the configuration */
1163   config = screen->inline_config;
1164   assert(config->width > 0);
1165   assert(config->height > 0);
1166   assert(config->refresh > 0);
1167   assert(config->visarea.min_x >= 0);
1168   assert((config->visarea.max_x < config->width) || (config->type == SCREEN_TYPE_VECTOR));
1169   assert(config->visarea.max_x > config->visarea.min_x);
1170   assert(config->visarea.min_y >= 0);
1171   assert((config->visarea.max_y < config->height) || (config->type == SCREEN_TYPE_VECTOR));
1172   assert(config->visarea.max_y > config->visarea.min_y);
1173
1174   /* allocate the VBLANK timers */
1175   state->vblank_begin_timer = timer_alloc(vblank_begin_callback, (void *)screen);
1176   state->vblank_end_timer = timer_alloc(vblank_end_callback, (void *)screen);
1177
1178   /* allocate a timer to reset partial updates */
1179   state->scanline0_timer = timer_alloc(scanline0_callback, (void *)screen);
1180
1181   /* configure the default cliparea */
1182   if (config->xoffset != 0)
1183      render_container_set_xoffset(container, config->xoffset);
1184   if (config->yoffset != 0)
1185      render_container_set_yoffset(container, config->yoffset);
1186   if (config->xscale != 0)
1187      render_container_set_xscale(container, config->xscale);
1188   if (config->yscale != 0)
1189      render_container_set_yscale(container, config->yscale);
1190
1191   /* allocate a timer to generate per-scanline updates */
1192   if (screen->machine->config->video_attributes & VIDEO_UPDATE_SCANLINE)
1193      state->scanline_timer = timer_alloc(scanline_update_callback, (void *)screen);
1194
1195   /* configure the screen with the default parameters */
1196   video_screen_configure(screen, config->width, config->height, &config->visarea, config->refresh);
1197
1198   /* reset VBLANK timing */
1199   state->vblank_start_time = attotime_zero;
1200   state->vblank_end_time = attotime_make(0, state->vblank_period);
1201
1202   /* start the timer to generate per-scanline updates */
1203   if (screen->machine->config->video_attributes & VIDEO_UPDATE_SCANLINE)
1204      timer_adjust_oneshot(state->scanline_timer, video_screen_get_time_until_pos(screen, 0, 0), 0);
1205
1206   /* register for save states */
1207   assert(strlen(screen->tag) < 30);
1208   state_save_combine_module_and_tag(unique_tag, "video_screen", screen->tag);
1209
1210   state_save_register_item(unique_tag, 0, state->vblank_start_time.seconds);
1211   state_save_register_item(unique_tag, 0, state->vblank_start_time.attoseconds);
1212   state_save_register_item(unique_tag, 0, state->vblank_end_time.seconds);
1213   state_save_register_item(unique_tag, 0, state->vblank_end_time.attoseconds);
1214   state_save_register_item(unique_tag, 0, state->frame_number);
12411215}
12421216
12431217
12441218/*-------------------------------------------------
1219    device_stop_video_screen - device stop
1220    callback for a video screen
1221-------------------------------------------------*/
1222
1223static DEVICE_STOP( video_screen )
1224{
1225   const device_config *screen = device;
1226   screen_state *state = get_safe_token(screen);
1227
1228   if (state->texture[0] != NULL)
1229      render_texture_free(state->texture[0]);
1230   if (state->texture[1] != NULL)
1231      render_texture_free(state->texture[1]);
1232   if (state->bitmap[0] != NULL)
1233      bitmap_free(state->bitmap[0]);
1234   if (state->bitmap[1] != NULL)
1235      bitmap_free(state->bitmap[1]);
1236}
1237
1238
1239/*-------------------------------------------------
12451240    video_screen_set_info - device set info
12461241    callback
12471242-------------------------------------------------*/
r2018r2019
12651260   switch (state)
12661261   {
12671262      /* --- the following bits of info are returned as 64-bit signed integers --- */
1263      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(screen_state);         break;
12681264      case DEVINFO_INT_INLINE_CONFIG_BYTES:   info->i = sizeof(screen_config);      break;
12691265      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_VIDEO;         break;
12701266
12711267      /* --- the following bits of info are returned as pointers to data or functions --- */
12721268      case DEVINFO_FCT_SET_INFO:            info->set_info = DEVICE_SET_INFO_NAME(video_screen); break;
12731269      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(video_screen); break;
1274      case DEVINFO_FCT_STOP:               /* Nothing */                     break;
1270      case DEVINFO_FCT_STOP:               info->stop = DEVICE_STOP_NAME(video_screen); break;
12751271      case DEVINFO_FCT_RESET:               /* Nothing */                     break;
12761272
12771273      /* --- the following bits of info are returned as NULL-terminated strings --- */
r2018r2019
13051301   state->vblank_end_time = attotime_add_attoseconds(state->vblank_start_time, state->vblank_period);
13061302
13071303   /* call the screen specific callbacks */
1308   for (i = 0; state->vbl_cbs[i] != NULL; i++)
1309      state->vbl_cbs[i](screen, TRUE);
1304   for (i = 0; state->vblank_callback[i] != NULL; i++)
1305      (*state->vblank_callback[i])(screen, TRUE);
13101306
13111307   /* if this is the primary screen and we need to update now */
13121308   if ((screen == machine->primary_screen) && !(machine->config->video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
r2018r2019
13351331   screen_state *state = get_safe_token(screen);
13361332
13371333   /* call the screen specific callbacks */
1338   for (i = 0; state->vbl_cbs[i] != NULL; i++)
1339      state->vbl_cbs[i](screen, FALSE);
1334   for (i = 0; state->vblank_callback[i] != NULL; i++)
1335      (*state->vblank_callback[i])(screen, FALSE);
13401336
13411337   /* if this is the primary screen and we need to update now */
13421338   if ((screen == machine->primary_screen) && (machine->config->video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
r2018r2019
13481344
13491345
13501346/*-------------------------------------------------
1347    screenless_update_callback - update generator
1348    when there are no screens to drive it
1349-------------------------------------------------*/
1350
1351static TIMER_CALLBACK( screenless_update_callback )
1352{
1353   /* force an update */
1354   video_frame_update(machine, FALSE);
1355}
1356
1357
1358/*-------------------------------------------------
13511359    scanline0_callback - reset partial updates
13521360    for a screen
13531361-------------------------------------------------*/
src/emu/video.h
r2018r2019
4444
4545/* these functions are macros primarily due to include file ordering */
4646/* plus, they are very simple */
47#define video_screen_count(config)      ((config)->devicelist ? device_list_items((config)->devicelist, VIDEO_SCREEN) : 0)
48#define video_screen_first(config)      ((config)->devicelist ? device_list_first((config)->devicelist, VIDEO_SCREEN) : NULL)
47#define video_screen_count(config)      device_list_items((config)->devicelist, VIDEO_SCREEN)
48#define video_screen_first(config)      device_list_first((config)->devicelist, VIDEO_SCREEN)
4949#define video_screen_next(previous)      device_list_next((previous), VIDEO_SCREEN)
5050
5151#define video_screen_get_format(screen)   (((screen_config *)(screen)->inline_config)->format)
r2018r2019
9191
9292
9393/***************************************************************************
94    SCREEN DEVICE CONFIGURATION MACROS
95***************************************************************************/
96
97#define MDRV_SCREEN_ADD(_tag, _type) \
98   MDRV_DEVICE_ADD(_tag, VIDEO_SCREEN) \
99   MDRV_DEVICE_CONFIG_DATA32(screen_config, type, SCREEN_TYPE_##_type)
100
101#define MDRV_SCREEN_REMOVE(_tag) \
102   MDRV_DEVICE_REMOVE(_tag, VIDEO_SCREEN)
103
104#define MDRV_SCREEN_MODIFY(_tag) \
105   MDRV_DEVICE_MODIFY(_tag, VIDEO_SCREEN)
106
107#define MDRV_SCREEN_FORMAT(_format) \
108   MDRV_DEVICE_CONFIG_DATA32(screen_config, format, _format)
109
110#define MDRV_SCREEN_TYPE(_type) \
111   MDRV_DEVICE_CONFIG_DATA32(screen_config, type, SCREEN_TYPE_##_type)
112
113#define MDRV_SCREEN_RAW_PARAMS(_pixclock, _htotal, _hbend, _hbstart, _vtotal, _vbend, _vbstart) \
114   MDRV_DEVICE_CONFIG_DATA64(screen_config, refresh, HZ_TO_ATTOSECONDS(_pixclock) * (_htotal) * (_vtotal)) \
115   MDRV_DEVICE_CONFIG_DATA64(screen_config, vblank, ((HZ_TO_ATTOSECONDS(_pixclock) * (_htotal) * (_vtotal)) / (_vtotal)) * ((_vtotal) - ((_vbstart) - (_vbend)))) \
116   MDRV_DEVICE_CONFIG_DATA32(screen_config, width, _htotal)   \
117   MDRV_DEVICE_CONFIG_DATA32(screen_config, height, _vtotal)   \
118   MDRV_DEVICE_CONFIG_DATA32(screen_config, visarea.min_x, _hbend) \
119   MDRV_DEVICE_CONFIG_DATA32(screen_config, visarea.max_x, (_hbstart) - 1) \
120   MDRV_DEVICE_CONFIG_DATA32(screen_config, visarea.min_y, _vbend) \
121   MDRV_DEVICE_CONFIG_DATA32(screen_config, visarea.max_y, (_vbstart) - 1)
122
123#define MDRV_SCREEN_REFRESH_RATE(_rate) \
124   MDRV_DEVICE_CONFIG_DATA64(screen_config, refresh, HZ_TO_ATTOSECONDS(_rate))
125
126#define MDRV_SCREEN_VBLANK_TIME(_time) \
127   MDRV_DEVICE_CONFIG_DATA64(screen_config, vblank, _time) \
128   MDRV_DEVICE_CONFIG_DATA32(screen_config, oldstyle_vblank_supplied, TRUE)
129
130#define MDRV_SCREEN_SIZE(_width, _height) \
131   MDRV_DEVICE_CONFIG_DATA32(screen_config, width, _width) \
132   MDRV_DEVICE_CONFIG_DATA32(screen_config, height, _height)
133
134#define MDRV_SCREEN_VISIBLE_AREA(_minx, _maxx, _miny, _maxy) \
135   MDRV_DEVICE_CONFIG_DATA32(screen_config, visarea.min_x, _minx) \
136   MDRV_DEVICE_CONFIG_DATA32(screen_config, visarea.max_x, _maxx) \
137   MDRV_DEVICE_CONFIG_DATA32(screen_config, visarea.min_y, _miny) \
138   MDRV_DEVICE_CONFIG_DATA32(screen_config, visarea.max_y, _maxy)
139
140#define MDRV_SCREEN_DEFAULT_POSITION(_xscale, _xoffs, _yscale, _yoffs)   \
141   MDRV_DEVICE_CONFIG_DATAFP32(screen_config, xoffset, _xoffs, 24) \
142   MDRV_DEVICE_CONFIG_DATAFP32(screen_config, xscale, _xscale, 24) \
143   MDRV_DEVICE_CONFIG_DATAFP32(screen_config, yoffset, _yoffs, 24) \
144   MDRV_DEVICE_CONFIG_DATAFP32(screen_config, yscale, _yscale, 24)
145
146
147
148/***************************************************************************
94149    FUNCTION PROTOTYPES
95150***************************************************************************/
96151
r2018r2019
109164void video_screen_set_visarea(const device_config *screen, int min_x, int max_x, int min_y, int max_y);
110165
111166/* force a partial update of the screen up to and including the requested scanline */
112void video_screen_update_partial(const device_config *screen, int scanline);
167int video_screen_update_partial(const device_config *screen, int scanline);
113168
114169/* force an update from the last beam position up to the current beam position */
115170void video_screen_update_now(const device_config *screen);
r2018r2019
153208UINT64 video_screen_get_frame_number(const device_config *screen);
154209
155210/* registers a VBLANK callback for the given screen */
156void video_screen_register_vbl_cb(const device_config *screen, vblank_state_changed_func vbl_cb);
211void video_screen_register_vblank_callback(const device_config *screen, vblank_state_changed_func vblank_callback);
157212
158213
159214/* ----- video screen device interface ----- */
src/emu/inptport.c
r2018r2019
10651065   add_exit_callback(machine, input_port_exit);
10661066   add_frame_callback(machine, input_port_frame);
10671067
1068   /* reset the pointers */
1069   memset(&joystick_info, 0, sizeof(joystick_info));
1070
10681071   /* start with the raw defaults and ask the OSD to customize them in the backup array */
10691072   memcpy(default_ports_backup, default_ports_builtin, sizeof(default_ports_backup));
10701073   osd_customize_inputport_list(default_ports_backup);
r2018r2019
12641267   int portnum, bitnum;
12651268   UINT32 mask;
12661269
1267   /* reset the pointers */
1268   memset(&joystick_info, 0, sizeof(joystick_info));
1269
12701270   /* loop over the ports and identify all the analog inputs */
12711271   portnum = -1;
12721272   bitnum = 0;
src/emu/devintrf.c
r2018r2019
183183   const device_config *curdev;
184184   int count = 0;
185185
186   assert(listhead != NULL);
187186   assert(type != NULL);
188187
189188   /* locate all devices */
r2018r2019
204203{
205204   const device_config *curdev;
206205
207   assert(listhead != NULL);
208206   assert(type != NULL);
209207
210208   /* scan forward starting with the list head */
r2018r2019
247245{
248246   const device_config *curdev;
249247
250   assert(listhead != NULL);
251248   assert(type != NULL);
252249   assert(tag != NULL);
253250
r2018r2019
272269   const device_config *curdev;
273270   int index = 0;
274271
275   assert(listhead != NULL);
276272   assert(type != NULL);
277273   assert(tag != NULL);
278274
r2018r2019
298294{
299295   const device_config *curdev;
300296
301   assert(listhead != NULL);
302297   assert(type != NULL);
303298   assert(index >= 0);
304299
r2018r2019
327322   const device_config *curdev;
328323   int count = 0;
329324
330   assert(listhead != NULL);
331
332325   /* locate all devices */
333326   for (curdev = listhead; curdev != NULL; curdev = curdev->next)
334327      count += (curdev->class == class);
r2018r2019
346339{
347340   const device_config *curdev;
348341
349   assert(listhead != NULL);
350
351342   /* scan forward starting with the list head */
352343   for (curdev = listhead; curdev != NULL; curdev = curdev->next)
353344      if (curdev->class == class)
r2018r2019
386377{
387378   const device_config *curdev;
388379
389   assert(listhead != NULL);
390380   assert(tag != NULL);
391381
392382   /* find the device in the list */
r2018r2019
409399   const device_config *curdev;
410400   int index = 0;
411401
412   assert(listhead != NULL);
413402   assert(tag != NULL);
414403
415404   /* locate all devices */
r2018r2019
435424{
436425   const device_config *curdev;
437426
438   assert(listhead != NULL);
439427   assert(index >= 0);
440428
441429   /* find the device in the list */
r2018r2019
471459   /* iterate over devices and start them */
472460   for (device = (device_config *)machine->config->devicelist; device != NULL; device = device->next)
473461   {
462      UINT32 tokenlen;
463
474464      assert(device->token == NULL);
475465      assert(device->type != NULL);
476466      assert(device->start != NULL);
477467
468      /* get the size of the token data */
469      tokenlen = (UINT32)devtype_get_info_int(device->type, DEVINFO_INT_TOKEN_BYTES);
470      if (tokenlen == 0)
471         fatalerror("Device %s specifies a 0 token length!\n", devtype_name(device->type));
472
473      /* allocate memory for the token */
474      device->token = malloc_or_die(tokenlen);
475      memset(device->token, 0, tokenlen);
476
478477      /* call the start function */
479478      device->machine = machine;
480      device->token = (*device->start)(device);
481      assert(device->token != NULL);
482
483      /* fatal error if this fails */
484      if (device->token == NULL)
485         fatalerror("Error starting device: type=%s tag=%s\n", devtype_name(device->type), device->tag);
479      (*device->start)(device);
486480   }
487481}
488482
r2018r2019
508502      if (device->stop != NULL)
509503         (*device->stop)(device);
510504
511      /* clear the token to indicate we are finished */
505      /* free allocated memory for the token */
506      if (device->token != NULL)
507         free(device->token);
512508      device->token = NULL;
513509      device->machine = NULL;
514510   }
src/emu/machine/z80dma.c
r2018r2019
407407
408408static DEVICE_START( z80dma )
409409{
410   z80dma_t *z80dma;
410   z80dma_t *z80dma = device->token;
411411   char unique_tag[30];
412412
413413   /* validate arguments */
r2018r2019
415415   assert(device->tag != NULL);
416416   assert(strlen(device->tag) < 20);
417417
418   /* allocate the object that holds the state */
419   z80dma = auto_malloc(sizeof(*z80dma));
420   memset(z80dma, 0, sizeof(*z80dma));
421
422418   //z80dma->device_type = device_type;
423419   z80dma->machine = device->machine;
424420   z80dma->intf = device->static_config;
r2018r2019
442438   state_save_register_item(unique_tag, 0, z80dma->is_read);
443439   state_save_register_item(unique_tag, 0, z80dma->cur_cycle);
444440   state_save_register_item(unique_tag, 0, z80dma->latch);
445
446   return z80dma;
447441}
448442
449443static DEVICE_RESET( z80dma )
r2018r2019
472466   switch (state)
473467   {
474468      /* --- the following bits of info are returned as 64-bit signed integers --- */
469      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(z80dma_t);            break;
475470      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                     break;
476471      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;      break;
477472
src/emu/devintrf.h
r2018r2019
3030   DEVICE_CLASS_VIDEO,               /* video devices, including screens */
3131   DEVICE_CLASS_CPU_CHIP,            /* CPU chips; only CPU cores should return this class */
3232   DEVICE_CLASS_SOUND_CHIP,         /* sound chips; only sound cores should return this class */
33   DEVICE_CLASS_TIMER,               /* timer devices */
3334   DEVICE_CLASS_OTHER               /* anything else (the list may expand in the future) */
3435};
3536typedef enum _device_class device_class;
r2018r2019
4546   /* --- the following bits of info are returned as 64-bit signed integers --- */
4647   DEVINFO_INT_FIRST = 0x00000,
4748
48   DEVINFO_INT_INLINE_CONFIG_BYTES = DEVINFO_INT_FIRST,/* R/O: bytes of inline configuration */
49   DEVINFO_INT_TOKEN_BYTES = DEVINFO_INT_FIRST,      /* R/O: bytes to allocate for the token */
50   DEVINFO_INT_INLINE_CONFIG_BYTES,               /* R/O: bytes to allocate for the inline configuration */
4951   DEVINFO_INT_CLASS,                           /* R/O: the device's class */
5052
5153   DEVINFO_INT_DEVICE_SPECIFIC = 0x08000,            /* R/W: device-specific values start here */
r2018r2019
100102#define DEVICE_SET_INFO_CALL(name)   DEVICE_SET_INFO_NAME(name)(device, state, info)
101103
102104#define DEVICE_START_NAME(name)      device_start_##name
103#define DEVICE_START(name)         void *DEVICE_START_NAME(name)(const device_config *device)
105#define DEVICE_START(name)         void DEVICE_START_NAME(name)(const device_config *device)
104106#define DEVICE_START_CALL(name)      DEVICE_START_NAME(name)(device)
105107
106108#define DEVICE_STOP_NAME(name)      device_stop_##name
r2018r2019
125127/* device interface function types */
126128typedef void (*device_get_info_func)(const device_config *device, UINT32 state, deviceinfo *info);
127129typedef void (*device_set_info_func)(const device_config *device, UINT32 state, const deviceinfo *info);
128typedef void *(*device_start_func)(const device_config *device);
130typedef void (*device_start_func)(const device_config *device);
129131typedef void (*device_stop_func)(const device_config *device);
130132typedef void (*device_reset_func)(const device_config *device);
131133
src/emu/cpuexec.c
r2018r2019
964964
965965         assert(screen != NULL);
966966
967         video_screen_register_vbl_cb(screen, on_vblank);
967         video_screen_register_vblank_callback(screen, on_vblank);
968968      }
969969
970970      /* periodic interrupts */
src/emu/sound/aica.c
r2018r2019
645645   }
646646
647647   AICALFO_Init();
648   AICA->buffertmpl=(signed int*) malloc(44100*sizeof(signed int));
649   AICA->buffertmpr=(signed int*) malloc(44100*sizeof(signed int));
648   AICA->buffertmpl=(signed int*) auto_malloc(44100*sizeof(signed int));
649   AICA->buffertmpr=(signed int*) auto_malloc(44100*sizeof(signed int));
650650   memset(AICA->buffertmpl,0,44100*sizeof(signed int));
651651   memset(AICA->buffertmpr,0,44100*sizeof(signed int));
652652
r2018r2019
13001300
13011301   struct _AICA *AICA;
13021302
1303   AICA = malloc(sizeof(*AICA));
1303   AICA = auto_malloc(sizeof(*AICA));
13041304   memset(AICA, 0, sizeof(*AICA));
13051305
13061306   intf = config;
src/emu/sound/msm5232.c
r2018r2019
55
66#include "msm5232.h"
77
8#define CLOCK_RATE_DIVIDER 16
9
810/*
911    OKI MSM5232RS
1012    8 channel tone generator
r2018r2019
3436   double   rr_rate;
3537
3638   int   pitch;         /* current pitch data */
39
40   int GF;
3741} VOICE;
3842
3943
r2018r2019
6165   UINT8   control1;
6266   UINT8   control2;
6367
68   int      gate;      /* current state of the GATE output */
69
6470   int      clock;      /* chip clock in Hz */
6571   int      rate;      /* sample rate in Hz */
6672
6773   double   external_capacity[8]; /* in Farads, eg 0.39e-6 = 0.36 uF (microFarads) */
74   void (*gate_handler)(int state);   /* callback called when the GATE output pin changes state */
6875
6976} MSM5232;
7077
r2018r2019
246253static void msm5232_write(MSM5232 *chip, int ofst, int data);
247254
248255
256static void msm5232_gate_update(MSM5232 *chip)
257{
258   int new_state = (chip->control2 & 0x20) ? chip->voi[7].GF : 0;
259
260   if (chip->gate != new_state && chip->gate_handler)
261   {
262      chip->gate = new_state;
263      (*chip->gate_handler)(new_state);
264   }
265}
266
267
249268static void msm5232_reset(void *_chip)
250269{
251270   MSM5232 *chip = _chip;
r2018r2019
272291   chip->EN_out4[1]   = 0;
273292   chip->EN_out2[1]   = 0;
274293
294   msm5232_gate_update(chip);
275295}
276296
277297static void msm5232_init(MSM5232 *chip, const struct MSM5232interface *intf, int clock, int rate)
r2018r2019
286306      chip->external_capacity[j] = intf->capacity[j];
287307   }
288308
309   chip->gate_handler = intf->gate_handler;
310
289311   msm5232_init_tables( chip );
290312
291313   for (j=0; j<8; j++)
r2018r2019
321343   if (ofst < 0x08) /* pitch */
322344   {
323345      int ch = ofst&7;
346
347      chip->voi[ch].GF = ((data&0x80)>>7);
348      if (ch == 7)
349         msm5232_gate_update(chip);
350
324351      if(data&0x80)
325352      {
326353         if(data >= 0xd8)
r2018r2019
355382
356383               n = (n>0)? n-1: 0;
357384               chip->voi[ch].TG_out2  = 1<<n;
358
359385            }
360386            chip->voi[ch].mode = 0;      /* tone mode */
361387            chip->voi[ch].eg_sect = 0;   /* Key On */
r2018r2019
363389      }
364390      else
365391      {
366            if ( !chip->voi[ch].eg_arm )   /* arm = 0 */
367               chip->voi[ch].eg_sect = 2;   /* Key Off -> go to release */
368            else                     /* arm = 1 */
369               chip->voi[ch].eg_sect = 1;   /* Key Off -> go to decay */
392         if ( !chip->voi[ch].eg_arm )   /* arm = 0 */
393            chip->voi[ch].eg_sect = 2;   /* Key Off -> go to release */
394         else                     /* arm = 1 */
395            chip->voi[ch].eg_sect = 1;   /* Key Off -> go to decay */
370396      }
371397   }
372398   else
r2018r2019
423449                popmessage("msm5232: control2 ctrl=%2x\n", data);*/
424450
425451         chip->control2 = data;
452         msm5232_gate_update(chip);
426453
427454         for (i=0; i<4; i++)
428455            chip->voi[i+4].eg_arm = data&0x10;
r2018r2019
543570
544571}
545572
546static int o2,o4,o8,o16;
573static int o2,o4,o8,o16,solo8,solo16;
547574
548575INLINE void TG_group_advance(MSM5232 *chip, int groupidx)
549576{
550577   VOICE *voi = &chip->voi[groupidx*4];
551578   int i;
552579
553   o2 = o4 = o8 = o16 = 0;
580   o2 = o4 = o8 = o16 = solo8 = solo16 = 0;
554581
555582   i=4;
556583   do
r2018r2019
614641      o8  += ( (out8 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
615642      o4  += ( (out4 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
616643      o2  += ( (out2 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
644
645      if (i == 1 && groupidx == 1)
646      {
647         solo16 += ( (out16-(1<<(STEP_SH-1))) << 11) >> STEP_SH;
648         solo8  += ( (out8 -(1<<(STEP_SH-1))) << 11) >> STEP_SH;
649      }
650
617651      voi++;
618652      i--;
619653   }while (i>0);
r2018r2019
670704   MSM5232 * chip = param;
671705   stream_sample_t *buf1 = buffer[0];
672706   stream_sample_t *buf2 = buffer[1];
707   stream_sample_t *buf3 = buffer[2];
708   stream_sample_t *buf4 = buffer[3];
709   stream_sample_t *buf5 = buffer[4];
710   stream_sample_t *buf6 = buffer[5];
711   stream_sample_t *buf7 = buffer[6];
712   stream_sample_t *buf8 = buffer[7];
713   stream_sample_t *bufsolo1 = buffer[8];
714   stream_sample_t *bufsolo2 = buffer[9];
673715   int i;
674716
675717   for (i=0; i<samples; i++)
676718   {
677      int out;
678
679719      /* calculate all voices' envelopes */
680720      EG_voices_advance(chip);
681721
682722      TG_group_advance(chip,0);   /* calculate tones group 1 */
683      out = (o2+o4+o8+o16);
684      if (out>32767)
685         out = 32767;
686      else if (out<-32768)
687         out = -32768;
688      buf1[i] = out;            /* should be 4 separate outputs */
723      buf1[i] = o2;
724      buf2[i] = o4;
725      buf3[i] = o8;
726      buf4[i] = o16;
727
689728      SAVE_SINGLE_CHANNEL(0,o2)
690729      SAVE_SINGLE_CHANNEL(1,o4)
691730      SAVE_SINGLE_CHANNEL(2,o8)
692731      SAVE_SINGLE_CHANNEL(3,o16)
693732
694733      TG_group_advance(chip,1);   /* calculate tones group 2 */
695      out = (o2+o4+o8+o16);
696      if (out>32767)
697         out = 32767;
698      else if (out<-32768)
699         out = -32768;
700      buf2[i] = out;            /* should be 4 separate outputs */
734      buf5[i] = o2;
735      buf6[i] = o4;
736      buf7[i] = o8;
737      buf8[i] = o16;
738
739      bufsolo1[i] = solo8;
740      bufsolo2[i] = solo16;
741
701742      SAVE_SINGLE_CHANNEL(4,o2)
702743      SAVE_SINGLE_CHANNEL(5,o4)
703744      SAVE_SINGLE_CHANNEL(6,o8)
r2018r2019
714755            int tmp = chip->noise_rng & (1<<16);      /* store current level */
715756
716757            if (chip->noise_rng&1)
717               chip->noise_rng ^= 0x28000;
758               chip->noise_rng ^= 0x24000;
718759            chip->noise_rng>>=1;
719760
720761            if ( (chip->noise_rng & (1<<16)) != tmp )   /* level change detect */
r2018r2019
733774static void *msm5232_start(int sndindex, int clock, const void *config)
734775{
735776   const struct MSM5232interface *intf = config;
736   int rate = clock/16;
777   int rate = clock/CLOCK_RATE_DIVIDER;
737778   MSM5232 *chip;
738779
739780   chip = auto_malloc(sizeof(*chip));
r2018r2019
741782
742783   msm5232_init(chip, intf, clock, rate);
743784
744   chip->stream = stream_create(0,2,rate,chip,MSM5232_update_one);
785   chip->stream = stream_create(0,10,rate,chip,MSM5232_update_one);
745786   return chip;
746787}
747788
r2018r2019
764805   msm5232_write(chip, offset, data);
765806}
766807
808void msm5232_set_clock(void *_chip, int clock)
809{
810   MSM5232 *chip = _chip;
767811
812   if (chip->clock != clock)
813   {
814      stream_update (chip->stream);
815      chip->clock = clock;
816      chip->rate = clock/CLOCK_RATE_DIVIDER;
817      msm5232_init_tables( chip );
818      stream_set_sample_rate(chip->stream, chip->rate);
819   }
820}
768821
769822
823
770824/**************************************************************************
771825 * Generic get_info
772826 **************************************************************************/
r2018r2019
794848
795849      /* --- the following bits of info are returned as NULL-terminated strings --- */
796850      case SNDINFO_STR_NAME:                     info->s = "MSM5232";               break;
797      case SNDINFO_STR_CORE_FAMILY:               info->s = "ADPCM";                  break;
798      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
851      case SNDINFO_STR_CORE_FAMILY:               info->s = "Oki Tone";               break;
852      case SNDINFO_STR_CORE_VERSION:               info->s = "1.1";                  break;
799853      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
800854      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
801855   }
src/emu/sound/msm5232.h
r2018r2019
33
44struct MSM5232interface
55{
6   double   capacity[8];   /* in Farads, capacitors connected to pins: 24,25,26,27 and 37,38,39,40 */
6   double capacity[8];   /* in Farads, capacitors connected to pins: 24,25,26,27 and 37,38,39,40 */
7   void (*gate_handler)(int state);   /* callback called when the GATE output pin changes state */
78};
89
910WRITE8_HANDLER( MSM5232_0_w );
1011WRITE8_HANDLER( MSM5232_1_w );
1112
13void msm5232_set_clock(void *chip, int clock);
14
1215#endif
src/emu/crsshair.c
r2018r2019
136136
137137static void create_bitmap(int player)
138138{
139   char filename[20];
140
141   /* first try to load a bitmap for the crosshair */
142   sprintf(filename, "cross%d.png", player);
143   global.bitmap[player] = render_load_png(NULL, filename, NULL, NULL);
144
145   /* if that didn't work, use the built-in one */
139   /* if we don't have a bitmap for this player yet */
146140   if (global.bitmap[player] == NULL)
147141   {
142      int x, y;
143      char filename[20];
148144      rgb_t color = crosshair_colors[player];
149      int x, y;
150145
151      /* allocate a blank bitmap to start with */
152      global.bitmap[player] = bitmap_alloc(CROSSHAIR_RAW_SIZE, CROSSHAIR_RAW_SIZE, BITMAP_FORMAT_ARGB32);
153      fillbitmap(global.bitmap[player], MAKE_ARGB(0x00,0xff,0xff,0xff), NULL);
146      /* first try to load a bitmap for the crosshair */
147      sprintf(filename, "cross%d.png", player);
148      global.bitmap[player] = render_load_png(NULL, filename, NULL, NULL);
154149
155      /* extract the raw source data to it */
156      for (y = 0; y < CROSSHAIR_RAW_SIZE / 2; y++)
150      /* if that didn't work, use the built-in one */
151      if (global.bitmap[player] == NULL)
157152      {
158         /* assume it is mirrored vertically */
159         UINT32 *dest0 = BITMAP_ADDR32(global.bitmap[player], y, 0);
160         UINT32 *dest1 = BITMAP_ADDR32(global.bitmap[player], CROSSHAIR_RAW_SIZE - 1 - y, 0);
153         /* allocate a blank bitmap to start with */
154         global.bitmap[player] = bitmap_alloc(CROSSHAIR_RAW_SIZE, CROSSHAIR_RAW_SIZE, BITMAP_FORMAT_ARGB32);
155         fillbitmap(global.bitmap[player], MAKE_ARGB(0x00,0xff,0xff,0xff), NULL);
161156
162         /* extract to two rows simultaneously */
163         for (x = 0; x < CROSSHAIR_RAW_SIZE; x++)
164            if ((crosshair_raw_top[y * CROSSHAIR_RAW_ROWBYTES + x / 8] << (x % 8)) & 0x80)
165               dest0[x] = dest1[x] = MAKE_ARGB(0xff,0x00,0x00,0x00) | color;
157         /* extract the raw source data to it */
158         for (y = 0; y < CROSSHAIR_RAW_SIZE / 2; y++)
159         {
160            /* assume it is mirrored vertically */
161            UINT32 *dest0 = BITMAP_ADDR32(global.bitmap[player], y, 0);
162            UINT32 *dest1 = BITMAP_ADDR32(global.bitmap[player], CROSSHAIR_RAW_SIZE - 1 - y, 0);
163
164            /* extract to two rows simultaneously */
165            for (x = 0; x < CROSSHAIR_RAW_SIZE; x++)
166               if ((crosshair_raw_top[y * CROSSHAIR_RAW_ROWBYTES + x / 8] << (x % 8)) & 0x80)
167                  dest0[x] = dest1[x] = MAKE_ARGB(0xff,0x00,0x00,0x00) | color;
168         }
166169      }
170
171      /* create a texture to reference the bitmap */
172      global.texture[player] = render_texture_alloc(render_texture_hq_scale, NULL);
173      render_texture_set_bitmap(global.texture[player], global.bitmap[player], NULL, 0, TEXFORMAT_ARGB32);
167174   }
168
169   /* create a texture to reference the bitmap */
170   global.texture[player] = render_texture_alloc(render_texture_hq_scale, NULL);
171   render_texture_set_bitmap(global.texture[player], global.bitmap[player], NULL, 0, TEXFORMAT_ARGB32);
172175}
173176
174177
r2018r2019
179182
180183void crosshair_init(running_machine *machine)
181184{
182   int player;
183185   input_port_entry *ipt;
184186
185187   /* request a callback upon exiting */
186188   add_exit_callback(machine, crosshair_exit);
187189
188   /* nothing is used by default */
189   for (player = 0; player < MAX_PLAYERS; player++)
190      global.used[player] = FALSE;
190   /* clear all the globals */
191   memset(&global, 0, sizeof(global));
191192
192193   /* determine who needs crosshairs */
193194   for (ipt = machine->input_ports; ipt->type != IPT_END; ipt++)
r2018r2019
195196      {
196197         int player = ipt->player;
197198
199         assert(player < MAX_PLAYERS);
200
198201         /* mark as used and visible */
199202         global.used[player] = TRUE;
200203         global.visible[player] = TRUE;
r2018r2019
207210
208211   /* register the animation callback */
209212   if (machine->primary_screen != NULL)
210      video_screen_register_vbl_cb(machine->primary_screen, animate);
213      video_screen_register_vblank_callback(machine->primary_screen, animate);
211214}
212215
213216
src/emu/sound.c
r2018r2019
128128***************************************************************************/
129129
130130/*-------------------------------------------------
131    get_safe_token - makes sure that the passed
132    in device is, in fact, a timer
133-------------------------------------------------*/
134
135INLINE speaker_info *get_safe_token(const device_config *device)
136{
137   assert(device != NULL);
138   assert(device->token != NULL);
139   assert(device->type == SPEAKER_OUTPUT);
140
141   return (speaker_info *)device->token;
142}
143
144
145/*-------------------------------------------------
131146    find_speaker_by_tag - find a tagged speaker
132147-------------------------------------------------*/
133148
r2018r2019
787802
788803static DEVICE_START( speaker_output )
789804{
790   speaker_info *info;
805   speaker_info *info = device->token;
791806
792   /* allocate memory for the speaker information */
793   info = auto_malloc(sizeof(*info));
794   memset(info, 0, sizeof(*info));
795
796807   /* copy in all the relevant info */
797808   info->speaker = device->inline_config;
798809   info->tag = device->tag;
799   return info;
800810}
801811
802812
r2018r2019
841851   switch (state)
842852   {
843853      /* --- the following bits of info are returned as 64-bit signed integers --- */
854      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(speaker_info);         break;
844855      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = sizeof(speaker_config);      break;
845856      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_AUDIO;         break;
846857
src/emu/sound.h
r2018r2019
3131
3232/* these functions are macros primarily due to include file ordering */
3333/* plus, they are very simple */
34#define speaker_output_count(config)      ((config)->devicelist ? device_list_items((config)->devicelist, SPEAKER_OUTPUT) : 0)
35#define speaker_output_first(config)      ((config)->devicelist ? device_list_first((config)->devicelist, SPEAKER_OUTPUT) : NULL)
34#define speaker_output_count(config)      device_list_items((config)->devicelist, SPEAKER_OUTPUT)
35#define speaker_output_first(config)      device_list_first((config)->devicelist, SPEAKER_OUTPUT)
3636#define speaker_output_next(previous)      device_list_next((previous), SPEAKER_OUTPUT)
3737
3838
src/emu/cpuint.c
r2018r2019
2828
2929
3030
31/*************************************
32 *
33 *  Macros to help verify active CPU
34 *
35 *************************************/
3631
37#define VERIFY_ACTIVECPU(retval, name)                  \
38   int activecpu = cpu_getactivecpu();                  \
39   assert_always(activecpu >= 0, #name "() called with no active cpu!")
40
41#define VERIFY_ACTIVECPU_VOID(name)                     \
42   int activecpu = cpu_getactivecpu();                  \
43   assert_always(activecpu >= 0, #name "() called with no active cpu!")
44
45
46
4732/*************************************
4833 *
4934 *  CPU interrupt variables
src/emu/drawgfx.c
r2018r2019
121121
122122   /* packed case */
123123   if (gfx->flags & GFX_ELEMENT_PACKED)
124   {
125124      for (y = 0; y < gfx->height; y++)
126125      {
127126         for (x = 0; x < gfx->width/2; x++)
r2018r2019
129128
130129         dp += gfx->line_modulo;
131130      }
132   }
133131
134132   /* unpacked case */
135133   else
136   {
137134      for (y = 0; y < gfx->height; y++)
138135      {
139136         for (x = 0; x < gfx->width; x++)
r2018r2019
141138
142139         dp += gfx->line_modulo;
143140      }
144   }
145141
146142   /* store the final result */
147143   gfx->pen_usage[num] = usage;
r2018r2019
172168
173169   /* packed case */
174170   if (gfx->flags & GFX_ELEMENT_PACKED)
175   {
176171      for (plane = 0; plane < planes; plane++)
177172      {
178173         int planebit = 1 << (planes - 1 - plane);
r2018r2019
192187            }
193188         }
194189      }
195   }
196190
197191   /* unpacked case */
198192   else
199   {
200193      for (plane = 0; plane < planes; plane++)
201194      {
202195         int planebit = 1 << (planes - 1 - plane);
r2018r2019
212205                  dp[x] |= planebit;
213206         }
214207      }
215   }
216208
217209   /* compute pen usage */
218210   calc_penusage(gfx, num);
r2018r2019
250242      memcpy(buffer, gl->extxoffs, sizeof(gfx->layout.extxoffs[0]) * gl->width);
251243      gfx->layout.extxoffs = buffer;
252244   }
245
253246   if (gl->extyoffs != NULL)
254247   {
255248      UINT32 *buffer = malloc_or_die(sizeof(buffer[0]) * gl->height);
r2018r2019
323316
324317   /* otherwise, we get to manually decode */
325318   else
326   {
327319      for (c = first; c <= last; c++)
328320         decodechar(gfx, c, src);
329   }
330321}
331322
332323
r2018r2019
358349    BLOCKMOVE PRIMITIVES
359350***************************************************************************/
360351
361#ifdef UNUSED_FUNCTION
362INLINE void blockmove_NtoN_transpen_noremap8(
363      const UINT8 *srcdata,int srcwidth,int srcheight,int srcmodulo,
364      UINT8 *dstdata,int dstmodulo,
365      int transpen)
366{
367   UINT8 *end;
368   int trans4;
369   UINT32 *sd4;
370
371   srcmodulo -= srcwidth;
372   dstmodulo -= srcwidth;
373
374   trans4 = transpen * 0x01010101;
375
376   while (srcheight)
377   {
378      end = dstdata + srcwidth;
379      while (((FPTR)srcdata & 3) && dstdata < end)   /* longword align */
380      {
381         int col;
382
383         col = *(srcdata++);
384         if (col != transpen) *dstdata = col;
385         dstdata++;
386      }
387      sd4 = (UINT32 *)srcdata;
388      while (dstdata <= end - 4)
389      {
390         UINT32 col4;
391
392         if ((col4 = *(sd4++)) != trans4)
393         {
394            UINT32 xod4;
395
396            xod4 = col4 ^ trans4;
397            if( (xod4&0x000000ff) && (xod4&0x0000ff00) &&
398               (xod4&0x00ff0000) && (xod4&0xff000000) )
399            {
400               write_dword((UINT32 *)dstdata,col4);
401            }
402            else
403            {
404               if (xod4 & (0xff<<SHIFT0)) dstdata[0] = col4>>SHIFT0;
405               if (xod4 & (0xff<<SHIFT1)) dstdata[1] = col4>>SHIFT1;
406               if (xod4 & (0xff<<SHIFT2)) dstdata[2] = col4>>SHIFT2;
407               if (xod4 & (0xff<<SHIFT3)) dstdata[3] = col4>>SHIFT3;
408            }
409         }
410         dstdata += 4;
411      }
412      srcdata = (UINT8 *)sd4;
413      while (dstdata < end)
414      {
415         int col;
416
417         col = *(srcdata++);
418         if (col != transpen) *dstdata = col;
419         dstdata++;
420      }
421
422      srcdata += srcmodulo;
423      dstdata += dstmodulo;
424      srcheight--;
425   }
426}
427#endif
428
429#ifdef UNUSED_FUNCTION
430INLINE void blockmove_NtoN_transpen_noremap_flipx8(
431      const UINT8 *srcdata,int srcwidth,int srcheight,int srcmodulo,
432      UINT8 *dstdata,int dstmodulo,
433      int transpen)
434{
435   UINT8 *end;
436   int trans4;
437   UINT32 *sd4;
438
439   srcmodulo += srcwidth;
440   dstmodulo -= srcwidth;
441   srcdata -= 3;
442
443   trans4 = transpen * 0x01010101;
444
445   while (srcheight)
446   {
447      end = dstdata + srcwidth;
448      while (((FPTR)srcdata & 3) && dstdata < end)   /* longword align */
449      {
450         int col;
451
452         col = srcdata[3];
453         srcdata--;
454         if (col != transpen) *dstdata = col;
455         dstdata++;
456      }
457      sd4 = (UINT32 *)srcdata;
458      while (dstdata <= end - 4)
459      {
460         UINT32 col4;
461
462         if ((col4 = *(sd4--)) != trans4)
463         {
464            UINT32 xod4;
465
466            xod4 = col4 ^ trans4;
467            if (xod4 & (0xff<<SHIFT0)) dstdata[3] = (col4>>SHIFT0);
468            if (xod4 & (0xff<<SHIFT1)) dstdata[2] = (col4>>SHIFT1);
469            if (xod4 & (0xff<<SHIFT2)) dstdata[1] = (col4>>SHIFT2);
470            if (xod4 & (0xff<<SHIFT3)) dstdata[0] = (col4>>SHIFT3);
471         }
472         dstdata += 4;
473      }
474      srcdata = (UINT8 *)sd4;
475      while (dstdata < end)
476      {
477         int col;
478
479         col = srcdata[3];
480         srcdata--;
481         if (col != transpen) *dstdata = col;
482         dstdata++;
483      }
484
485      srcdata += srcmodulo;
486      dstdata += dstmodulo;
487      srcheight--;
488   }
489}
490#endif
491
492352INLINE void blockmove_NtoN_transpen_noremap16(
493353      const UINT16 *srcdata,int srcwidth,int srcheight,int srcmodulo,
494354      UINT16 *dstdata,int dstmodulo,
r2018r2019
632492      DATA_TYPE *dstdata,int dstwidth,int dstheight,int dstmodulo
633493
634494#define RAW 1
635#define COLOR_ARG unsigned int colorbase,UINT8 *pridata,UINT32 pmask
495#define COLOR_ARG int color,UINT8 *pridata,UINT32 pmask
636496#define INCREMENT_DST(n) {dstdata+=(n);pridata += (n);}
637#define LOOKUP(n) (colorbase + (n))
497#define LOOKUP(n) (color + (n))
638498#define SETPIXELCOLOR(dest,n) { if (((1 << (pridata[dest] & 0x1f)) & pmask) == 0) { if (pridata[dest] & 0x80) { dstdata[dest] = palette_shadow_table[n];} else { dstdata[dest] = (n);} } pridata[dest] = (pridata[dest] & 0x7f) | afterdrawmask; }
639499#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_raw_pri16 args body
640500#include "drawgfx.c"
r2018r2019
645505#undef RAW
646506
647507#define RAW 0
648#define COLOR_ARG const pen_t *paldata,UINT8 *pridata,UINT32 pmask
649#define LOOKUP(n) (paldata[n])
508#define COLOR_ARG int colorbase,const pen_t *paldata,UINT8 *pridata,UINT32 pmask
509#define LOOKUP(n) (colorbase + (n))
650510#define SETPIXELCOLOR(dest,n) { if (((1 << (pridata[dest] & 0x1f)) & pmask) == 0) { if (pridata[dest] & 0x80) { dstdata[dest] = palette_shadow_table[n];} else { dstdata[dest] = (n);} } pridata[dest] = (pridata[dest] & 0x7f) | afterdrawmask; }
651511#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_pri16 args body
652512#include "drawgfx.c"
r2018r2019
658518#undef RAW
659519
660520#define RAW 1
661#define COLOR_ARG unsigned int colorbase
521#define COLOR_ARG int color
662522#define INCREMENT_DST(n) {dstdata+=(n);}
663#define LOOKUP(n) (colorbase + (n))
523#define LOOKUP(n) (color + (n))
664524#define SETPIXELCOLOR(dest,n) {dstdata[dest] = (n);}
665525#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_raw16 args body
666526#include "drawgfx.c"
r2018r2019
671531#undef RAW
672532
673533#define RAW 0
674#define COLOR_ARG const pen_t *paldata
675#define LOOKUP(n) (paldata[n])
534#define COLOR_ARG int colorbase, const pen_t *paldata
535#define LOOKUP(n) (colorbase + (n))
676536#define SETPIXELCOLOR(dest,n) {dstdata[dest] = (n);}
677537#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##16 args body
678538#include "drawgfx.c"
r2018r2019
740600      DATA_TYPE *dstdata,int dstwidth,int dstheight,int dstmodulo
741601
742602#define RAW 1
743#define COLOR_ARG unsigned int colorbase,UINT8 *pridata,UINT32 pmask
603#define COLOR_ARG int color,UINT8 *pridata,UINT32 pmask
744604#define INCREMENT_DST(n) {dstdata+=(n);pridata += (n);}
745#define LOOKUP(n) (colorbase + (n))
605#define LOOKUP(n) (color + (n))
746606#define SETPIXELCOLOR(dest,n) { UINT8 r8=pridata[dest]; if(!(1<<(r8&0x1f)&pmask)){ if(afterdrawmask){ r8&=0x7f; r8|=0x1f; dstdata[dest]=(n); pridata[dest]=r8; } else if(!(r8&0x80)){ dstdata[dest]=SHADOW32(palette_shadow_table,n); pridata[dest]|=0x80; } } }
747607#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_raw_pri32 args body
748608#include "drawgfx.c"
r2018r2019
753613#undef RAW
754614
755615#define RAW 0
756#define COLOR_ARG const pen_t *paldata,UINT8 *pridata,UINT32 pmask
616#define COLOR_ARG int colorbase, const pen_t *paldata,UINT8 *pridata,UINT32 pmask
757617#define LOOKUP(n) (paldata[n])
758618#define SETPIXELCOLOR(dest,n) { UINT8 r8=pridata[dest]; if(!(1<<(r8&0x1f)&pmask)){ if(afterdrawmask){ r8&=0x7f; r8|=0x1f; dstdata[dest]=(n); pridata[dest]=r8; } else if(!(r8&0x80)){ dstdata[dest]=SHADOW32(palette_shadow_table,n); pridata[dest]|=0x80; } } }
759619#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_pri32 args body
r2018r2019
766626#undef RAW
767627
768628#define RAW 1
769#define COLOR_ARG unsigned int colorbase
629#define COLOR_ARG int color
770630#define INCREMENT_DST(n) {dstdata+=(n);}
771#define LOOKUP(n) (colorbase + (n))
631#define LOOKUP(n) (color + (n))
772632#define SETPIXELCOLOR(dest,n) {dstdata[dest] = (n);}
773633#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_raw32 args body
774634#include "drawgfx.c"
r2018r2019
779639#undef RAW
780640
781641#define RAW 0
782#define COLOR_ARG const pen_t *paldata
642#define COLOR_ARG int colorbase, const pen_t *paldata
783643#define LOOKUP(n) (paldata[n])
784644#define SETPIXELCOLOR(dest,n) {dstdata[dest] = (n);}
785645#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##32 args body
r2018r2019
871731      int transmask = 0;
872732
873733      if (transparency == TRANSPARENCY_PEN)
874      {
875734         transmask = 1 << (transparent_color & 0xff);
876      }
877735      else   /* transparency == TRANSPARENCY_PENS */
878      {
879736         transmask = transparent_color;
880      }
881737
882738      if ((gfx->pen_usage[code] & ~transmask) == 0)
883739         /* character is totally transparent, no need to draw */
r2018r2019
1020876      int col,colwidth;
1021877      rectangle myclip;
1022878
1023
1024879      colwidth = srcwidth / cols;
1025880
1026881      myclip.min_y = clip->min_y;
r2018r2019
1031886      {
1032887         int cons,scroll;
1033888
1034
1035889         /* count consecutive columns scrolled by the same amount */
1036890         scroll = colscroll[col];
1037891         cons = 1;
1038892         while (col + cons < cols &&   colscroll[col + cons] == scroll)
1039893            cons++;
1040894
1041         if (scroll < 0) scroll = srcheight - (-scroll) % srcheight;
1042         else scroll %= srcheight;
895         if (scroll < 0)
896            scroll = srcheight - (-scroll) % srcheight;
897         else
898            scroll %= srcheight;
1043899
1044900         myclip.min_x = col * colwidth;
1045901         if (myclip.min_x < clip->min_x) myclip.min_x = clip->min_x;
r2018r2019
1058914      int row,rowheight;
1059915      rectangle myclip;
1060916
1061
1062917      rowheight = srcheight / rows;
1063918
1064919      myclip.min_x = clip->min_x;
r2018r2019
1069924      {
1070925         int cons,scroll;
1071926
1072
1073927         /* count consecutive rows scrolled by the same amount */
1074928         scroll = rowscroll[row];
1075929         cons = 1;
1076930         while (row + cons < rows &&   rowscroll[row + cons] == scroll)
1077931            cons++;
1078932
1079         if (scroll < 0) scroll = srcwidth - (-scroll) % srcwidth;
1080         else scroll %= srcwidth;
933         if (scroll < 0)
934            scroll = srcwidth - (-scroll) % srcwidth;
935         else
936            scroll %= srcwidth;
1081937
1082938         myclip.min_y = row * rowheight;
1083939         if (myclip.min_y < clip->min_y) myclip.min_y = clip->min_y;
r2018r2019
1095951      /* XY scrolling playfield */
1096952      int scrollx,scrolly,sx,sy;
1097953
954      if (rowscroll[0] < 0)
955         scrollx = srcwidth - (-rowscroll[0]) % srcwidth;
956      else
957         scrollx = rowscroll[0] % srcwidth;
1098958
1099      if (rowscroll[0] < 0) scrollx = srcwidth - (-rowscroll[0]) % srcwidth;
1100      else scrollx = rowscroll[0] % srcwidth;
959      if (colscroll[0] < 0)
960         scrolly = srcheight - (-colscroll[0]) % srcheight;
961      else
962         scrolly = colscroll[0] % srcheight;
1101963
1102      if (colscroll[0] < 0) scrolly = srcheight - (-colscroll[0]) % srcheight;
1103      else scrolly = colscroll[0] % srcheight;
1104
1105964      for (sx = scrollx - srcwidth;sx < destwidth;sx += srcwidth)
1106965         for (sy = scrolly - srcheight;sy < destheight;sy += srcheight)
1107966            copybitmap_common(dest,src,0,0,sx,sy,clip,transparency,transparent_color);
r2018r2019
1113972      int scrollx;
1114973      rectangle myclip;
1115974
975      if (rowscroll[0] < 0)
976         scrollx = srcwidth - (-rowscroll[0]) % srcwidth;
977      else
978         scrollx = rowscroll[0] % srcwidth;
1116979
1117      if (rowscroll[0] < 0) scrollx = srcwidth - (-rowscroll[0]) % srcwidth;
1118      else scrollx = rowscroll[0] % srcwidth;
1119
1120980      colwidth = srcwidth / cols;
1121981
1122982      myclip.min_y = clip->min_y;
r2018r2019
1127987      {
1128988         int cons,scroll;
1129989
1130
1131990         /* count consecutive columns scrolled by the same amount */
1132991         scroll = colscroll[col];
1133992         cons = 1;
1134993         while (col + cons < cols &&   colscroll[col + cons] == scroll)
1135994            cons++;
1136995
1137         if (scroll < 0) scroll = srcheight - (-scroll) % srcheight;
1138         else scroll %= srcheight;
996         if (scroll < 0)
997            scroll = srcheight - (-scroll) % srcheight;
998         else
999            scroll %= srcheight;
11391000
11401001         myclip.min_x = col * colwidth + scrollx;
11411002         if (myclip.min_x < clip->min_x) myclip.min_x = clip->min_x;
r2018r2019
11631024      int scrolly;
11641025      rectangle myclip;
11651026
1027      if (colscroll[0] < 0)
1028         scrolly = srcheight - (-colscroll[0]) % srcheight;
1029      else
1030         scrolly = colscroll[0] % srcheight;
11661031
1167      if (colscroll[0] < 0) scrolly = srcheight - (-colscroll[0]) % srcheight;
1168      else scrolly = colscroll[0] % srcheight;
1169
11701032      rowheight = srcheight / rows;
11711033
11721034      myclip.min_x = clip->min_x;
r2018r2019
11771039      {
11781040         int cons,scroll;
11791041
1180
11811042         /* count consecutive rows scrolled by the same amount */
11821043         scroll = rowscroll[row];
11831044         cons = 1;
11841045         while (row + cons < rows &&   rowscroll[row + cons] == scroll)
11851046            cons++;
11861047
1187         if (scroll < 0) scroll = srcwidth - (-scroll) % srcwidth;
1188         else scroll %= srcwidth;
1048         if (scroll < 0)
1049            scroll = srcwidth - (-scroll) % srcwidth;
1050         else
1051            scroll %= srcwidth;
11891052
11901053         myclip.min_y = row * rowheight + scrolly;
11911054         if (myclip.min_y < clip->min_y) myclip.min_y = clip->min_y;
r2018r2019
12941157    1<<17 : double to 200%
12951158    */
12961159
1297
12981160   /* force clip to bitmap boundary */
12991161   if (clip)
13001162   {
r2018r2019
13131175      clip = &myclip;
13141176   }
13151177
1316
13171178   /* 16-bit destination bitmap */
13181179   if (dest_bmp->bpp == 16)
13191180   {
1320      const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
1181      int colorbase = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
13211182      UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
13221183
13231184      int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
r2018r2019
13351196         int x_index_base;
13361197         int y_index;
13371198
1338         if( flipx )
1199         if (flipx)
13391200         {
13401201            x_index_base = (sprite_screen_width-1)*dx;
13411202            dx = -dx;
13421203         }
13431204         else
1344         {
13451205            x_index_base = 0;
1346         }
13471206
1348         if( flipy )
1207         if (flipy)
13491208         {
13501209            y_index = (sprite_screen_height-1)*dy;
13511210            dy = -dy;
13521211         }
13531212         else
1354         {
13551213            y_index = 0;
1356         }
13571214
1358         if( clip )
1215         if (clip)
13591216         {
1360            if( sx < clip->min_x)
1217            if (sx < clip->min_x)
13611218            { /* clip left */
13621219               int pixels = clip->min_x-sx;
13631220               sx += pixels;
13641221               x_index_base += pixels*dx;
13651222            }
1366            if( sy < clip->min_y )
1223
1224            if (sy < clip->min_y)
13671225            { /* clip top */
13681226               int pixels = clip->min_y-sy;
13691227               sy += pixels;
13701228               y_index += pixels*dy;
13711229            }
1372            /* NS 980211 - fixed incorrect clipping */
1373            if( ex > clip->max_x+1 )
1230
1231            if (ex > clip->max_x + 1)
13741232            { /* clip right */
13751233               int pixels = ex-clip->max_x-1;
13761234               ex -= pixels;
13771235            }
1378            if( ey > clip->max_y+1 )
1236
1237            if (ey > clip->max_y + 1)
13791238            { /* clip bottom */
13801239               int pixels = ey-clip->max_y-1;
13811240               ey -= pixels;
13821241            }
13831242         }
13841243
1385         if( ex>sx )
1244         if (ex > sx)
13861245         { /* skip if inner loop doesn't draw anything */
13871246            int y;
13881247
r2018r2019
13921251               if (pri_buffer)
13931252               {
13941253                  if (gfx->flags & GFX_ELEMENT_PACKED)
1395                  {
1396                     for( y=sy; y<ey; y++ )
1254                     for (y = sy; y < ey; y++)
13971255                     {
13981256                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
13991257                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
14001258                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
14011259
14021260                        int x, x_index = x_index_base;
1403                        for( x=sx; x<ex; x++ )
1261                        for (x = sx; x < ex; x++)
14041262                        {
14051263                           if (((1 << pri[x]) & pri_mask) == 0)
1406                              dest[x] = pal[(source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f];
1264                              dest[x] = colorbase + ((source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f);
14071265                           pri[x] = 31;
14081266                           x_index += dx;
14091267                        }
14101268
14111269                        y_index += dy;
14121270                     }
1413                  }
14141271                  else
1415                  {
1416                     for( y=sy; y<ey; y++ )
1272                     for (y = sy; y < ey; y++)
14171273                     {
14181274                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
14191275                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
14201276                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
14211277
14221278                        int x, x_index = x_index_base;
1423                        for( x=sx; x<ex; x++ )
1279                        for (x = sx; x < ex; x++)
14241280                        {
14251281                           if (((1 << pri[x]) & pri_mask) == 0)
1426                              dest[x] = pal[source[x_index>>16]];
1282                              dest[x] = colorbase + source[x_index>>16];
14271283                           pri[x] = 31;
14281284                           x_index += dx;
14291285                        }
14301286
14311287                        y_index += dy;
14321288                     }
1433                  }
14341289               }
14351290               else
14361291               {
14371292                  if (gfx->flags & GFX_ELEMENT_PACKED)
1438                  {
1439                     for( y=sy; y<ey; y++ )
1293                     for (y = sy; y < ey; y++)
14401294                     {
14411295                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
14421296                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
14431297
14441298                        int x, x_index = x_index_base;
1445                        for( x=sx; x<ex; x++ )
1299                        for (x = sx; x < ex; x++)
14461300                        {
1447                           dest[x] = pal[(source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f];
1301                           dest[x] = colorbase + ((source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f);
14481302                           x_index += dx;
14491303                        }
14501304
14511305                        y_index += dy;
14521306                     }
1453                  }
14541307                  else
1455                  {
1456                     for( y=sy; y<ey; y++ )
1308                     for (y = sy; y < ey; y++)
14571309                     {
14581310                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
14591311                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
14601312
14611313                        int x, x_index = x_index_base;
1462                        for( x=sx; x<ex; x++ )
1314                        for (x = sx; x < ex; x++)
14631315                        {
1464                           dest[x] = pal[source[x_index>>16]];
1316                           dest[x] = colorbase + source[x_index>>16];
14651317                           x_index += dx;
14661318                        }
14671319
14681320                        y_index += dy;
14691321                     }
1470                  }
14711322               }
14721323            }
14731324
r2018r2019
14771328               if (pri_buffer)
14781329               {
14791330                  if (gfx->flags & GFX_ELEMENT_PACKED)
1480                  {
1481                     for( y=sy; y<ey; y++ )
1331                     for(y = sy; y < ey; y++)
14821332                     {
14831333                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
14841334                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
14851335                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
14861336
14871337                        int x, x_index = x_index_base;
1488                        for( x=sx; x<ex; x++ )
1338                        for (x = sx; x < ex; x++)
14891339                        {
14901340                           int c = (source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f;
1491                           if( c != transparent_color )
1341                           if (c != transparent_color)
14921342                           {
14931343                              if (((1 << pri[x]) & pri_mask) == 0)
1494                                 dest[x] = pal[c];
1344                                 dest[x] = colorbase + c;
14951345                              pri[x] = 31;
14961346                           }
14971347                           x_index += dx;
r2018r2019
14991349
15001350                        y_index += dy;
15011351                     }
1502                  }
15031352                  else
1504                  {
1505                     for( y=sy; y<ey; y++ )
1353                     for(y = sy; y < ey; y++)
15061354                     {
15071355                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
15081356                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
15091357                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
15101358
15111359                        int x, x_index = x_index_base;
1512                        for( x=sx; x<ex; x++ )
1360                        for (x = sx; x < ex; x++)
15131361                        {
15141362                           int c = source[x_index>>16];
1515                           if( c != transparent_color )
1363                           if (c != transparent_color)
15161364                           {
15171365                              if (((1 << pri[x]) & pri_mask) == 0)
1518                                 dest[x] = pal[c];
1366                                 dest[x] = colorbase + c;
15191367                              pri[x] = 31;
15201368                           }
15211369                           x_index += dx;
r2018r2019
15231371
15241372                        y_index += dy;
15251373                     }
1526                  }
15271374               }
15281375               else
15291376               {
15301377                  if (gfx->flags & GFX_ELEMENT_PACKED)
1531                  {
1532                     for( y=sy; y<ey; y++ )
1378                     for (y = sy; y < ey; y++)
15331379                     {
15341380                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
15351381                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
15361382
15371383                        int x, x_index = x_index_base;
1538                        for( x=sx; x<ex; x++ )
1384                        for (x = sx; x < ex; x++)
15391385                        {
15401386                           int c = (source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f;
1541                           if( c != transparent_color ) dest[x] = pal[c];
1387                           if (c != transparent_color) dest[x] = colorbase + c;
15421388                           x_index += dx;
15431389                        }
15441390
15451391                        y_index += dy;
15461392                     }
1547                  }
15481393                  else
1549                  {
1550                     for( y=sy; y<ey; y++ )
1394                     for (y = sy; y < ey; y++)
15511395                     {
15521396                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
15531397                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
15541398
15551399                        int x, x_index = x_index_base;
1556                        for( x=sx; x<ex; x++ )
1400                        for (x = sx; x < ex; x++)
15571401                        {
15581402                           int c = source[x_index>>16];
1559                           if( c != transparent_color ) dest[x] = pal[c];
1403                           if (c != transparent_color) dest[x] = colorbase + c;
15601404                           x_index += dx;
15611405                        }
15621406
15631407                        y_index += dy;
15641408                     }
1565                  }
15661409               }
15671410            }
15681411
r2018r2019
15701413            if (transparency == TRANSPARENCY_PEN_RAW)
15711414            {
15721415               if (pri_buffer)
1573               {
1574                  for( y=sy; y<ey; y++ )
1416                  for (y = sy; y < ey; y++)
15751417                  {
15761418                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
15771419                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
15781420                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
15791421
15801422                     int x, x_index = x_index_base;
1581                     for( x=sx; x<ex; x++ )
1423                     for (x = sx; x < ex; x++)
15821424                     {
15831425                        int c = source[x_index>>16];
1584                        if( c != transparent_color )
1426                        if (c != transparent_color)
15851427                        {
15861428                           if (((1 << pri[x]) & pri_mask) == 0)
15871429                              dest[x] = color + c;
r2018r2019
15921434
15931435                     y_index += dy;
15941436                  }
1595               }
15961437               else
1597               {
1598                  for( y=sy; y<ey; y++ )
1438                  for (y = sy; y < ey; y++)
15991439                  {
16001440                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
16011441                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
16021442
16031443                     int x, x_index = x_index_base;
1604                     for( x=sx; x<ex; x++ )
1444                     for (x = sx; x < ex; x++)
16051445                     {
16061446                        int c = source[x_index>>16];
1607                        if( c != transparent_color ) dest[x] = color + c;
1447                        if (c != transparent_color) dest[x] = color + c;
16081448                        x_index += dx;
16091449                     }
16101450
16111451                     y_index += dy;
16121452                  }
1613               }
16141453            }
16151454
16161455            /* case 2: TRANSPARENCY_PENS */
16171456            if (transparency == TRANSPARENCY_PENS)
16181457            {
16191458               if (pri_buffer)
1620               {
1621                  for( y=sy; y<ey; y++ )
1459                  for (y = sy; y < ey; y++)
16221460                  {
16231461                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
16241462                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
16251463                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
16261464
16271465                     int x, x_index = x_index_base;
1628                     for( x=sx; x<ex; x++ )
1466                     for (x = sx; x < ex; x++)
16291467                     {
16301468                        int c = source[x_index>>16];
16311469                        if (((1 << c) & transparent_color) == 0)
16321470                        {
16331471                           if (((1 << pri[x]) & pri_mask) == 0)
1634                              dest[x] = pal[c];
1472                              dest[x] = colorbase + c;
16351473                           pri[x] = 31;
16361474                        }
16371475                        x_index += dx;
r2018r2019
16391477
16401478                     y_index += dy;
16411479                  }
1642               }
16431480               else
1644               {
1645                  for( y=sy; y<ey; y++ )
1481                  for (y = sy; y < ey; y++)
16461482                  {
16471483                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
16481484                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
16491485
16501486                     int x, x_index = x_index_base;
1651                     for( x=sx; x<ex; x++ )
1487                     for (x = sx; x < ex; x++)
16521488                     {
16531489                        int c = source[x_index>>16];
16541490                        if (((1 << c) & transparent_color) == 0)
1655                           dest[x] = pal[c];
1491                           dest[x] = colorbase + c;
16561492                        x_index += dx;
16571493                     }
16581494
16591495                     y_index += dy;
16601496                  }
1661               }
16621497            }
16631498
16641499            /* case 3: TRANSPARENCY_PEN_TABLE */
r2018r2019
16691504               {
16701505                  UINT8 al = (pdrawgfx_shadow_lowpri) ? 0 : 0x80;
16711506
1672                  for( y=sy; y<ey; y++ )
1507                  for (y = sy; y < ey; y++)
16731508                  {
16741509                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
16751510                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
16761511                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
16771512
16781513                     int x, x_index = x_index_base;
1679                     for( x=sx; x<ex; x++ )
1514                     for (x = sx; x < ex; x++)
16801515                     {
16811516                        int c = source[x_index>>16];
1682                        if( c != transparent_color )
1517                        if (c != transparent_color)
16831518                        {
16841519                           UINT8 ah;
16851520
r2018r2019
16901525                              if (((1 << (ah & 0x1f)) & pri_mask) == 0)
16911526                              {
16921527                                 if (ah & 0x80)
1693                                    dest[x] = palette_shadow_table[pal[c]];
1528                                    dest[x] = palette_shadow_table[colorbase + c];
16941529                                 else
1695                                    dest[x] = pal[c];
1530                                    dest[x] = colorbase + c;
16961531                              }
16971532                              pri[x] = (ah & 0x7f) | 31;
16981533                              break;
r2018r2019
17111546               }
17121547               else
17131548               {
1714                  for( y=sy; y<ey; y++ )
1549                  for (y = sy; y < ey; y++)
17151550                  {
17161551                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
17171552                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
17181553
17191554                     int x, x_index = x_index_base;
1720                     for( x=sx; x<ex; x++ )
1555                     for (x = sx; x < ex; x++)
17211556                     {
17221557                        int c = source[x_index>>16];
1723                        if( c != transparent_color )
1558                        if (c != transparent_color)
17241559                        {
17251560                           switch(gfx_drawmode_table[c])
17261561                           {
17271562                           case DRAWMODE_SOURCE:
1728                              dest[x] = pal[c];
1563                              dest[x] = colorbase + c;
17291564                              break;
17301565                           case DRAWMODE_SHADOW:
17311566                              dest[x] = palette_shadow_table[dest[x]];
r2018r2019
17441579            if (transparency == TRANSPARENCY_ALPHA)
17451580            {
17461581               if (pri_buffer)
1747               {
1748                  for( y=sy; y<ey; y++ )
1582                  for (y = sy; y < ey; y++)
17491583                  {
17501584                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
17511585                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
17521586                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
17531587
17541588                     int x, x_index = x_index_base;
1755                     for( x=sx; x<ex; x++ )
1589                     for (x = sx; x < ex; x++)
17561590                     {
17571591                        int c = source[x_index>>16];
1758                        if( c != transparent_color )
1592                        if (c != transparent_color)
17591593                        {
17601594                           if (((1 << pri[x]) & pri_mask) == 0)
1761                              dest[x] = alpha_blend16(dest[x], pal[c]);
1595                              dest[x] = alpha_blend16(dest[x], colorbase + c);
17621596                           pri[x] = 31;
17631597                        }
17641598                        x_index += dx;
r2018r2019
17661600
17671601                     y_index += dy;
17681602                  }
1769               }
17701603               else
1771               {
1772                  for( y=sy; y<ey; y++ )
1604                  for (y = sy; y < ey; y++)
17731605                  {
17741606                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
17751607                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
17761608
17771609                     int x, x_index = x_index_base;
1778                     for( x=sx; x<ex; x++ )
1610                     for (x = sx; x < ex; x++)
17791611                     {
17801612                        int c = source[x_index>>16];
1781                        if( c != transparent_color ) dest[x] = alpha_blend16(dest[x], pal[c]);
1613                        if (c != transparent_color) dest[x] = alpha_blend16(dest[x], colorbase + c);
17821614                        x_index += dx;
17831615                     }
17841616
17851617                     y_index += dy;
17861618                  }
1787               }
17881619            }
17891620
1790            /* pjp 31/5/02 */
17911621            /* case 7: TRANSPARENCY_ALPHARANGE */
17921622            if (transparency == TRANSPARENCY_ALPHARANGE)
17931623            {
17941624               if (pri_buffer)
1795               {
1796                  for( y=sy; y<ey; y++ )
1625                  for (y = sy; y < ey; y++)
17971626                  {
17981627                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
17991628                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
18001629                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
18011630
18021631                     int x, x_index = x_index_base;
1803                     for( x=sx; x<ex; x++ )
1632                     for (x = sx; x < ex; x++)
18041633                     {
18051634                        int c = source[x_index>>16];
1806                        if( c != transparent_color )
1635                        if (c != transparent_color)
18071636                        {
18081637                           if (((1 << pri[x]) & pri_mask) == 0)
18091638                           {
1810                              if( gfx_alpharange_table[c] == 0xff )
1811                                 dest[x] = pal[c];
1639                              if (gfx_alpharange_table[c] == 0xff)
1640                                 dest[x] = colorbase + c;
18121641                              else
1813                                 dest[x] = alpha_blend_r16(dest[x], pal[c], gfx_alpharange_table[c]);
1642                                 dest[x] = alpha_blend_r16(dest[x], colorbase + c, gfx_alpharange_table[c]);
18141643                           }
18151644                           pri[x] = 31;
18161645                        }
r2018r2019
18191648
18201649                     y_index += dy;
18211650                  }
1822               }
18231651               else
1824               {
1825                  for( y=sy; y<ey; y++ )
1652                  for (y = sy; y < ey; y++)
18261653                  {
18271654                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
18281655                     UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
18291656
18301657                     int x, x_index = x_index_base;
1831                     for( x=sx; x<ex; x++ )
1658                     for (x = sx; x < ex; x++)
18321659                     {
18331660                        int c = source[x_index>>16];
1834                        if( c != transparent_color )
1661                        if (c != transparent_color)
18351662                        {
1836                           if( gfx_alpharange_table[c] == 0xff )
1837                              dest[x] = pal[c];
1663                           if (gfx_alpharange_table[c] == 0xff)
1664                              dest[x] = colorbase + c;
18381665                           else
1839                              dest[x] = alpha_blend_r16(dest[x], pal[c], gfx_alpharange_table[c]);
1666                              dest[x] = alpha_blend_r16(dest[x], colorbase + c, gfx_alpharange_table[c]);
18401667                        }
18411668                        x_index += dx;
18421669                     }
18431670
18441671                     y_index += dy;
18451672                  }
1846               }
18471673            }
18481674         }
18491675      }
r2018r2019
18701696         int x_index_base;
18711697         int y_index;
18721698
1873         if( flipx )
1699         if (flipx)
18741700         {
18751701            x_index_base = (sprite_screen_width-1)*dx;
18761702            dx = -dx;
r2018r2019
18801706            x_index_base = 0;
18811707         }
18821708
1883         if( flipy )
1709         if (flipy)
18841710         {
18851711            y_index = (sprite_screen_height-1)*dy;
18861712            dy = -dy;
r2018r2019
18901716            y_index = 0;
18911717         }
18921718
1893         if( clip )
1719         if (clip)
18941720         {
1895            if( sx < clip->min_x)
1721            if (sx < clip->min_x)
18961722            { /* clip left */
18971723               int pixels = clip->min_x-sx;
18981724               sx += pixels;
18991725               x_index_base += pixels*dx;
19001726            }
1901            if( sy < clip->min_y )
1727
1728            if (sy < clip->min_y)
19021729            { /* clip top */
19031730               int pixels = clip->min_y-sy;
19041731               sy += pixels;
19051732               y_index += pixels*dy;
19061733            }
1907            /* NS 980211 - fixed incorrect clipping */
1908            if( ex > clip->max_x+1 )
1734
1735            if (ex > clip->max_x + 1)
19091736            { /* clip right */
19101737               int pixels = ex-clip->max_x-1;
19111738               ex -= pixels;
19121739            }
1913            if( ey > clip->max_y+1 )
1740
1741            if (ey > clip->max_y + 1)
19141742            { /* clip bottom */
19151743               int pixels = ey-clip->max_y-1;
19161744               ey -= pixels;
19171745            }
19181746         }
19191747
1920         if( ex>sx )
1748         if (ex > sx)
19211749         { /* skip if inner loop doesn't draw anything */
19221750            int y;
19231751
r2018r2019
19251753            if (transparency == TRANSPARENCY_NONE)
19261754            {
19271755               if (pri_buffer)
1928               {
1929                  for( y=sy; y<ey; y++ )
1756                  for (y = sy; y < ey; y++)
19301757                  {
19311758                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
19321759                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
19331760                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
19341761
19351762                     int x, x_index = x_index_base;
1936                     for( x=sx; x<ex; x++ )
1763                     for (x = sx; x < ex; x++)
19371764                     {
19381765                        if (((1 << pri[x]) & pri_mask) == 0)
19391766                           dest[x] = pal[source[x_index>>16]];
r2018r2019
19431770
19441771                     y_index += dy;
19451772                  }
1946               }
19471773               else
1948               {
1949                  for( y=sy; y<ey; y++ )
1774                  for (y = sy; y < ey; y++)
19501775                  {
19511776                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
19521777                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
19531778
19541779                     int x, x_index = x_index_base;
1955                     for( x=sx; x<ex; x++ )
1780                     for (x = sx; x < ex; x++)
19561781                     {
19571782                        dest[x] = pal[source[x_index>>16]];
19581783                        x_index += dx;
r2018r2019
19601785
19611786                     y_index += dy;
19621787                  }
1963               }
19641788            }
19651789
19661790            /* case 1: TRANSPARENCY_PEN */
19671791            if (transparency == TRANSPARENCY_PEN)
19681792            {
19691793               if (pri_buffer)
1970               {
1971                  for( y=sy; y<ey; y++ )
1794                  for (y = sy; y < ey; y++)
19721795                  {
19731796                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
19741797                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
19751798                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
19761799
19771800                     int x, x_index = x_index_base;
1978                     for( x=sx; x<ex; x++ )
1801                     for (x = sx; x < ex; x++)
19791802                     {
19801803                        int c = source[x_index>>16];
1981                        if( c != transparent_color )
1804                        if (c != transparent_color)
19821805                        {
19831806                           if (((1 << pri[x]) & pri_mask) == 0)
19841807                              dest[x] = pal[c];
r2018r2019
19891812
19901813                     y_index += dy;
19911814                  }
1992               }
19931815               else
1994               {
1995                  for( y=sy; y<ey; y++ )
1816                  for (y = sy; y < ey; y++)
19961817                  {
19971818                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
19981819                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
19991820
20001821                     int x, x_index = x_index_base;
2001                     for( x=sx; x<ex; x++ )
1822                     for (x = sx; x < ex; x++)
20021823                     {
20031824                        int c = source[x_index>>16];
2004                        if( c != transparent_color ) dest[x] = pal[c];
1825                        if (c != transparent_color) dest[x] = pal[c];
20051826                        x_index += dx;
20061827                     }
20071828
20081829                     y_index += dy;
20091830                  }
2010               }
20111831            }
20121832
20131833            /* case 1b: TRANSPARENCY_PEN_RAW */
20141834            if (transparency == TRANSPARENCY_PEN_RAW)
20151835            {
20161836               if (pri_buffer)
2017               {
2018                  for( y=sy; y<ey; y++ )
1837                  for (y = sy; y < ey; y++)
20191838                  {
20201839                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
20211840                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
20221841                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
20231842
20241843                     int x, x_index = x_index_base;
2025                     for( x=sx; x<ex; x++ )
1844                     for (x = sx; x < ex; x++)
20261845                     {
20271846                        int c = source[x_index>>16];
2028                        if( c != transparent_color )
1847                        if (c != transparent_color)
20291848                        {
20301849                           if (((1 << pri[x]) & pri_mask) == 0)
20311850                              dest[x] = color + c;
r2018r2019
20361855
20371856                     y_index += dy;
20381857                  }
2039               }
20401858               else
2041               {
2042                  for( y=sy; y<ey; y++ )
1859                  for (y = sy; y < ey; y++)
20431860                  {
20441861                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
20451862                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
20461863
20471864                     int x, x_index = x_index_base;
2048                     for( x=sx; x<ex; x++ )
1865                     for (x = sx; x < ex; x++)
20491866                     {
20501867                        int c = source[x_index>>16];
2051                        if( c != transparent_color ) dest[x] = color + c;
1868                        if (c != transparent_color) dest[x] = color + c;
20521869                        x_index += dx;
20531870                     }
20541871
20551872                     y_index += dy;
20561873                  }
2057               }
20581874            }
20591875
20601876            /* case 2: TRANSPARENCY_PENS */
20611877            if (transparency == TRANSPARENCY_PENS)
20621878            {
20631879               if (pri_buffer)
2064               {
2065                  for( y=sy; y<ey; y++ )
1880                  for (y = sy; y < ey; y++)
20661881                  {
20671882                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
20681883                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
20691884                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
20701885
20711886                     int x, x_index = x_index_base;
2072                     for( x=sx; x<ex; x++ )
1887                     for (x = sx; x < ex; x++)
20731888                     {
20741889                        int c = source[x_index>>16];
20751890                        if (((1 << c) & transparent_color) == 0)
r2018r2019
20831898
20841899                     y_index += dy;
20851900                  }
2086               }
20871901               else
2088               {
2089                  for( y=sy; y<ey; y++ )
1902                  for (y = sy; y < ey; y++)
20901903                  {
20911904                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
20921905                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
20931906
20941907                     int x, x_index = x_index_base;
2095                     for( x=sx; x<ex; x++ )
1908                     for (x = sx; x < ex; x++)
20961909                     {
20971910                        int c = source[x_index>>16];
20981911                        if (((1 << c) & transparent_color) == 0)
r2018r2019
21021915
21031916                     y_index += dy;
21041917                  }
2105               }
21061918            }
21071919
21081920            /* case 3: TRANSPARENCY_PEN_TABLE */
r2018r2019
21161928               UINT8 al, ah;
21171929
21181930               if (pri_buffer)
2119               {
2120                  for( y=sy; y<ey; y++ )
1931                  for (y = sy; y < ey; y++)
21211932                  {
21221933                     source = source_base + (y_index>>16) * gfx->line_modulo;
21231934                     y_index += dy;
r2018r2019
21251936                     pri = BITMAP_ADDR8(pri_buffer, y, 0);
21261937                     x_index = x_index_base;
21271938
2128                     for( x=sx; x<ex; x++ )
1939                     for (x = sx; x < ex; x++)
21291940                     {
21301941                        int ebx = x_index;
21311942                        x_index += dx;
r2018r2019
21561967                        }
21571968                     }
21581969                  }
2159               }
21601970               else
2161               {
2162                  for( y=sy; y<ey; y++ )
1971                  for (y = sy; y < ey; y++)
21631972                  {
21641973                     source = source_base + (y_index>>16) * gfx->line_modulo;
21651974                     y_index += dy;
21661975                     dest = BITMAP_ADDR32(dest_bmp, y, 0);
21671976                     x_index = x_index_base;
21681977
2169                     for( x=sx; x<ex; x++ )
1978                     for (x = sx; x < ex; x++)
21701979                     {
21711980                        c = source[x_index>>16];
21721981                        x_index += dx;
r2018r2019
21781987                           dest[x] = SHADOW32(palette_shadow_table,dest[x]);
21791988                     }
21801989                  }
2181               }
21821990            }
21831991
21841992            /* case 6: TRANSPARENCY_ALPHA */
21851993            if (transparency == TRANSPARENCY_ALPHA)
21861994            {
21871995               if (pri_buffer)
2188               {
2189                  for( y=sy; y<ey; y++ )
1996                  for (y = sy; y < ey; y++)
21901997                  {
21911998                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
21921999                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
21932000                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
21942001
21952002                     int x, x_index = x_index_base;
2196                     for( x=sx; x<ex; x++ )
2003                     for (x = sx; x < ex; x++)
21972004                     {
21982005                        int c = source[x_index>>16];
2199                        if( c != transparent_color )
2006                        if (c != transparent_color)
22002007                        {
22012008                           if (((1 << pri[x]) & pri_mask) == 0)
22022009                              dest[x] = alpha_blend32(dest[x], pal[c]);
r2018r2019
22072014
22082015                     y_index += dy;
22092016                  }
2210               }
22112017               else
2212               {
2213                  for( y=sy; y<ey; y++ )
2018                  for (y = sy; y < ey; y++)
22142019                  {
22152020                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
22162021                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
22172022
22182023                     int x, x_index = x_index_base;
2219                     for( x=sx; x<ex; x++ )
2024                     for (x = sx; x < ex; x++)
22202025                     {
22212026                        int c = source[x_index>>16];
2222                        if( c != transparent_color ) dest[x] = alpha_blend32(dest[x], pal[c]);
2027                        if (c != transparent_color) dest[x] = alpha_blend32(dest[x], pal[c]);
22232028                        x_index += dx;
22242029                     }
22252030
22262031                     y_index += dy;
22272032                  }
2228               }
22292033            }
22302034
2231            /* pjp 31/5/02 */
22322035            /* case 7: TRANSPARENCY_ALPHARANGE */
22332036            if (transparency == TRANSPARENCY_ALPHARANGE)
22342037            {
22352038               if (pri_buffer)
2236               {
2237                  for( y=sy; y<ey; y++ )
2039                  for (y = sy; y < ey; y++)
22382040                  {
22392041                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
22402042                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
22412043                     UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
22422044
22432045                     int x, x_index = x_index_base;
2244                     for( x=sx; x<ex; x++ )
2046                     for (x = sx; x < ex; x++)
22452047                     {
22462048                        int c = source[x_index>>16];
2247                        if( c != transparent_color )
2049                        if (c != transparent_color)
22482050                        {
22492051                           if (((1 << pri[x]) & pri_mask) == 0)
22502052                           {
2251                              if( gfx_alpharange_table[c] == 0xff )
2053                              if (gfx_alpharange_table[c] == 0xff)
22522054                                 dest[x] = pal[c];
22532055                              else
22542056                                 dest[x] = alpha_blend_r32(dest[x], pal[c], gfx_alpharange_table[c]);
r2018r2019
22602062
22612063                     y_index += dy;
22622064                  }
2263               }
22642065               else
2265               {
2266                  for( y=sy; y<ey; y++ )
2066                  for (y = sy; y < ey; y++)
22672067                  {
22682068                     UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
22692069                     UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
22702070
22712071                     int x, x_index = x_index_base;
2272                     for( x=sx; x<ex; x++ )
2072                     for (x = sx; x < ex; x++)
22732073                     {
22742074                        int c = source[x_index>>16];
2275                        if( c != transparent_color )
2075                        if (c != transparent_color)
22762076                        {
2277                           if( gfx_alpharange_table[c] == 0xff )
2077                           if (gfx_alpharange_table[c] == 0xff)
22782078                              dest[x] = pal[c];
22792079                           else
22802080                              dest[x] = alpha_blend_r32(dest[x], pal[c], gfx_alpharange_table[c]);
r2018r2019
22842084
22852085                     y_index += dy;
22862086                  }
2287               }
22882087            }
22892088         }
22902089      }
r2018r2019
23802179
23812180
23822181#if (RAW == 0)
2383DECLARE_SWAP_RAW_PRI(blockmove_8toN_opaque,(COMMON_ARGS,
2384      COLOR_ARG),
2182DECLARE_SWAP_RAW_PRI(blockmove_8toN_opaque,(COMMON_ARGS, COLOR_ARG),
23852183{
23862184   pen_t *palette_shadow_table = Machine->shadow_table;
23872185   ADJUST_8
r2018r2019
24562254#endif
24572255
24582256#if (RAW == 0)
2459DECLARE_SWAP_RAW_PRI(blockmove_4toN_opaque,(COMMON_ARGS,
2460      COLOR_ARG),
2257DECLARE_SWAP_RAW_PRI(blockmove_4toN_opaque,(COMMON_ARGS, COLOR_ARG),
24612258{
24622259   pen_t *palette_shadow_table = Machine->shadow_table;
24632260   ADJUST_4
r2018r2019
25532350})
25542351#endif
25552352
2556DECLARE_SWAP_RAW_PRI(blockmove_8toN_transpen,(COMMON_ARGS,
2557      COLOR_ARG,int transpen),
2353DECLARE_SWAP_RAW_PRI(blockmove_8toN_transpen,(COMMON_ARGS, COLOR_ARG, int transpen),
25582354{
25592355   pen_t *palette_shadow_table = Machine->shadow_table;
25602356   ADJUST_8
r2018r2019
26652461   }
26662462})
26672463
2668DECLARE_SWAP_RAW_PRI(blockmove_4toN_transpen,(COMMON_ARGS,
2669      COLOR_ARG,int transpen),
2464DECLARE_SWAP_RAW_PRI(blockmove_4toN_transpen,(COMMON_ARGS, COLOR_ARG, int transpen),
26702465{
26712466   pen_t *palette_shadow_table = Machine->shadow_table;
26722467   ADJUST_4
r2018r2019
27442539#if (RAW == 0)
27452540#define PEN_IS_OPAQUE ((1<<col)&transmask) == 0
27462541
2747DECLARE_SWAP_RAW_PRI(blockmove_8toN_transmask,(COMMON_ARGS,
2748      COLOR_ARG,int transmask),
2542DECLARE_SWAP_RAW_PRI(blockmove_8toN_transmask,(COMMON_ARGS, COLOR_ARG, int transmask),
27492543{
27502544   pen_t *palette_shadow_table = Machine->shadow_table;
27512545   ADJUST_8
r2018r2019
28532647
28542648#if (RAW == 0)
28552649#if (DEPTH == 32)
2856DECLARE_SWAP_RAW_PRI(blockmove_8toN_pen_table,(COMMON_ARGS,
2857      COLOR_ARG,int transcolor),
2650DECLARE_SWAP_RAW_PRI(blockmove_8toN_pen_table,(COMMON_ARGS, COLOR_ARG, int transcolor),
28582651{
28592652   pen_t *palette_shadow_table = Machine->shadow_table;
28602653   ADJUST_8
r2018r2019
29312724   }
29322725})
29332726#else
2934DECLARE_SWAP_RAW_PRI(blockmove_8toN_pen_table,(COMMON_ARGS,
2935      COLOR_ARG,int transcolor),
2727DECLARE_SWAP_RAW_PRI(blockmove_8toN_pen_table,(COMMON_ARGS, COLOR_ARG, int transcolor),
29362728{
29372729   pen_t *palette_shadow_table = Machine->shadow_table;
29382730   int eax = (pdrawgfx_shadow_lowpri) ? 0 : 0x80;
r2018r2019
30142806#endif
30152807
30162808#if (RAW == 0)
3017DECLARE_SWAP_RAW_PRI(blockmove_8toN_alpha,(COMMON_ARGS,
3018      COLOR_ARG,int transpen),
2809DECLARE_SWAP_RAW_PRI(blockmove_8toN_alpha,(COMMON_ARGS, COLOR_ARG, int transpen),
30192810{
30202811   pen_t *palette_shadow_table = Machine->shadow_table;
30212812   ADJUST_8
r2018r2019
31272918})
31282919
31292920/* pjp 02/06/02 */
3130DECLARE_SWAP_RAW_PRI(blockmove_8toN_alpharange,(COMMON_ARGS,
3131      COLOR_ARG,int transpen),
2921DECLARE_SWAP_RAW_PRI(blockmove_8toN_alpharange,(COMMON_ARGS, COLOR_ARG, int transpen),
31322922{
31332923   pen_t *palette_shadow_table = Machine->shadow_table;
31342924   ADJUST_8
r2018r2019
32803070      int dw = ex-sx+1;                              /* dest width */
32813071      int dh = ey-sy+1;                              /* dest height */
32823072      int dm = dest->rowpixels;                        /* dest modulo */
3283      const pen_t *paldata = &Machine->pens[gfx->color_base + gfx->color_granularity * color];
3073      int colorbase = gfx->color_base + gfx->color_granularity * color;
3074      const pen_t *paldata = &Machine->pens[colorbase];
32843075      UINT8 *pribuf = (pri_buffer) ? BITMAP_ADDR8(pri_buffer, sy, sx) : NULL;
32853076
32863077      switch (transparency)
r2018r2019
32893080            if (gfx->flags & GFX_ELEMENT_PACKED)
32903081            {
32913082               if (pribuf)
3292                  BLOCKMOVEPRI(4toN_opaque,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,pribuf,pri_mask));
3083                  BLOCKMOVEPRI(4toN_opaque,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,colorbase,paldata,pribuf,pri_mask));
32933084               else
3294                  BLOCKMOVELU(4toN_opaque,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata));
3085                  BLOCKMOVELU(4toN_opaque,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,colorbase,paldata));
32953086            }
32963087            else
32973088            {
32983089               if (pribuf)
3299                  BLOCKMOVEPRI(8toN_opaque,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,pribuf,pri_mask));
3090                  BLOCKMOVEPRI(8toN_opaque,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,colorbase,paldata,pribuf,pri_mask));
33003091               else
3301                  BLOCKMOVELU(8toN_opaque,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata));
3092                  BLOCKMOVELU(8toN_opaque,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,colorbase,paldata));
33023093            }
33033094            break;
33043095
r2018r2019
33063097            if (gfx->flags & GFX_ELEMENT_PACKED)
33073098            {
33083099               if (pribuf)
3309                  BLOCKMOVEPRI(4toN_transpen,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,pribuf,pri_mask,transparent_color));
3100                  BLOCKMOVEPRI(4toN_transpen,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,colorbase,paldata,pribuf,pri_mask,transparent_color));
33103101               else
3311                  BLOCKMOVELU(4toN_transpen,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,transparent_color));
3102                  BLOCKMOVELU(4toN_transpen,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,colorbase,paldata,transparent_color));
33123103            }
33133104            else
33143105            {
33153106               if (pribuf)
3316                  BLOCKMOVEPRI(8toN_transpen,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,pribuf,pri_mask,transparent_color));
3107                  BLOCKMOVEPRI(8toN_transpen,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,colorbase,paldata,pribuf,pri_mask,transparent_color));
33173108               else
3318                  BLOCKMOVELU(8toN_transpen,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,transparent_color));
3109                  BLOCKMOVELU(8toN_transpen,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,colorbase,paldata,transparent_color));
33193110            }
33203111            break;
33213112
r2018r2019
33383129
33393130         case TRANSPARENCY_PENS:
33403131            if (pribuf)
3341               BLOCKMOVEPRI(8toN_transmask,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,pribuf,pri_mask,transparent_color));
3132               BLOCKMOVEPRI(8toN_transmask,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,colorbase,paldata,pribuf,pri_mask,transparent_color));
33423133            else
3343               BLOCKMOVELU(8toN_transmask,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,transparent_color));
3134               BLOCKMOVELU(8toN_transmask,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,colorbase,paldata,transparent_color));
33443135            break;
33453136
33463137         case TRANSPARENCY_PEN_TABLE:
33473138            if (pribuf)
3348               BLOCKMOVEPRI(8toN_pen_table,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,pribuf,pri_mask,transparent_color));
3139               BLOCKMOVEPRI(8toN_pen_table,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,colorbase,paldata,pribuf,pri_mask,transparent_color));
33493140            else
3350               BLOCKMOVELU(8toN_pen_table,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,transparent_color));
3141               BLOCKMOVELU(8toN_pen_table,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,colorbase,paldata,transparent_color));
33513142            break;
33523143
33533144         case TRANSPARENCY_ALPHA:
33543145            if (pribuf)
3355               BLOCKMOVEPRI(8toN_alpha,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,pribuf,pri_mask,transparent_color));
3146               BLOCKMOVEPRI(8toN_alpha,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,colorbase,paldata,pribuf,pri_mask,transparent_color));
33563147            else
3357               BLOCKMOVELU(8toN_alpha,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,transparent_color));
3148               BLOCKMOVELU(8toN_alpha,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,colorbase,paldata,transparent_color));
33583149            break;
33593150
33603151         case TRANSPARENCY_ALPHARANGE:
33613152            if (pribuf)
3362               BLOCKMOVEPRI(8toN_alpharange,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,pribuf,pri_mask,transparent_color));
3153               BLOCKMOVEPRI(8toN_alpharange,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,colorbase,paldata,pribuf,pri_mask,transparent_color));
33633154            else
3364               BLOCKMOVELU(8toN_alpharange,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,transparent_color));
3155               BLOCKMOVELU(8toN_alpharange,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,colorbase,paldata,transparent_color));
33653156            break;
33663157
33673158         default:
src/emu/render.c
r2018r2019
14051405void render_target_get_minimum_size(render_target *target, INT32 *minwidth, INT32 *minheight)
14061406{
14071407   float maxxscale = 1.0f, maxyscale = 1.0f;
1408   int screens_considered = 0;
14081409   int layer;
14091410
14101411   /* scan the current view for all screens */
r2018r2019
14501451            }
14511452
14521453            /* pick the greater */
1453            if (xscale > maxxscale)
1454               maxxscale = xscale;
1455            if (yscale > maxyscale)
1456               maxyscale = yscale;
1454            maxxscale = MAX(xscale, maxxscale);
1455            maxyscale = MAX(yscale, maxyscale);
1456            screens_considered++;
14571457         }
14581458   }
14591459
1460   /* if there were no screens considered, pick a nominal default */
1461   if (screens_considered == 0)
1462   {
1463      maxxscale = 640.0f;
1464      maxyscale = 480.0f;
1465   }
1466
14601467   /* round up */
14611468   if (minwidth != NULL)
14621469      *minwidth = render_round_nearest(maxxscale);
src/emu/clifront.c
r2018r2019
681681{
682682   int correct = 0;
683683   int incorrect = 0;
684   int notfound = 0;
684   int notfound = FALSE;
685685   int drvindex;
686686
687687   /* now iterate over drivers */
r2018r2019
700700         else
701701            continue;
702702
703         /* if not found, count that and leave it at that */
703         /* if not found, print a message and set the flag */
704704         if (res == NOTFOUND)
705            notfound++;
705         {
706            mame_printf_error("sampleset \"%s\" not found!\n", drivers[drvindex]->name);
707            notfound = TRUE;
708         }
706709
707710         /* else display information about what we discovered */
708711         else
r2018r2019
730733         }
731734      }
732735
733   /* if we didn't get anything at all, display a generic end message */
736   /* clear out any cached files */
737   zip_file_cache_clear();
738
739   /* if we didn't get anything at all because of an unsupported set, display message */
734740   if (correct + incorrect == 0)
735741   {
736      if (notfound > 0)
737         mame_printf_error("sampleset \"%s\" not found!\n", gamename);
738      else
742      if (!notfound)
739743         mame_printf_error("sampleset \"%s\" not supported!\n", gamename);
740744      return MAMERR_NO_SUCH_GAME;
741745   }
src/emu/state.c
r2018r2019
249249   if (!ss_registration_allowed)
250250   {
251251      logerror("Attempt to register save state entry after state registration is closed! module %s name %s\n",module,name);
252      if (Machine->gamedrv->flags & GAME_SUPPORTS_SAVE)
253         fatalerror("Attempt to register save state entry after state registration is closed! module %s name %s\n",module,name);
252254      ss_illegal_regs++;
253255      return;
254256   }
r2018r2019
315317   if (!ss_registration_allowed)
316318   {
317319      logerror("Attempt to register callback function after state registration is closed!");
320      if (Machine->gamedrv->flags & GAME_SUPPORTS_SAVE)
321         fatalerror("Attempt to register callback function after state registration is closed!");
318322      ss_illegal_regs++;
319323      return;
320324   }
src/emu/timer.c
r2018r2019
5757};
5858
5959
60/*-------------------------------------------------
61    timer_state - configuration of a single
62    timer device
63-------------------------------------------------*/
6064
65typedef struct _timer_state timer_state;
66struct _timer_state
67{
68   emu_timer            *timer;         /* the backing timer */
69   void                *ptr;         /* the pointer parameter passed to the timer callback */
70
71   /* periodic timers only */
72   attotime            start_delay;   /* delay before the timer fires for the first time */
73   attotime            period;         /* period of repeated timer firings */
74   INT32               param;         /* the integer parameter passed to the timer callback */
75
76   /* scanline timers only */
77   UINT32                first_time;      /* indicates that the system is starting */
78};
79
80
6181/***************************************************************************
6282    GLOBAL VARIABLES
6383***************************************************************************/
r2018r2019
195215
196216
197217/*-------------------------------------------------
218    get_safe_token - makes sure that the passed
219    in device is, in fact, a timer
220-------------------------------------------------*/
221
222INLINE timer_state *get_safe_token(const device_config *device)
223{
224   assert(device != NULL);
225   assert(device->token != NULL);
226   assert(device->type == TIMER);
227
228   return (timer_state *)device->token;
229}
230
231
232/*-------------------------------------------------
198233    timer_list_remove - remove a timer from the
199234    linked list
200235-------------------------------------------------*/
r2018r2019
479514   timer->expire = attotime_never;
480515   timer_list_insert(timer);
481516
482   /* if we're not temporary, register ourselve with the save state system */
517   /* if we're not temporary, register ourselves with the save state system */
483518   if (!temp)
484519   {
485520      timer_register_save(timer);
r2018r2019
536571}
537572
538573
574void timer_device_adjust_oneshot(const device_config *timer, attotime duration, INT32 param)
575{
576#ifndef NDEBUG
577   timer_config *config = timer->inline_config;
578
579   /* only makes sense for periodic timers */
580   assert(config->type == TIMER_TYPE_PERIODIC);
581#endif
582
583   timer_device_adjust_periodic(timer, duration, param, attotime_never);
584}
585
586
539587/*-------------------------------------------------
540588    timer_adjust_periodic - adjust the time when
541589    this timer will fire and specify a period for
542590    subsequent firings
543591-------------------------------------------------*/
544592
545void timer_adjust_periodic(emu_timer *which, attotime duration, INT32 param, attotime period)
593void timer_adjust_periodic(emu_timer *which, attotime start_delay, INT32 param, attotime period)
546594{
547595   attotime time = get_current_time();
548596
r2018r2019
555603   which->enabled = TRUE;
556604
557605   /* clamp negative times to 0 */
558   if (duration.seconds < 0)
559      duration = attotime_zero;
606   if (start_delay.seconds < 0)
607      start_delay = attotime_zero;
560608
561609   /* set the start and expire times */
562610   which->start = time;
563   which->expire = attotime_add(time, duration);
611   which->expire = attotime_add(time, start_delay);
564612   which->period = period;
565613
566614   /* remove and re-insert the timer in its new order */
r2018r2019
574622}
575623
576624
625void timer_device_adjust_periodic(const device_config *timer, attotime start_delay, INT32 param, attotime period)
626{
627   timer_state *state = get_safe_token(timer);
628#ifndef NDEBUG
629   timer_config *config = timer->inline_config;
577630
631   /* only makes sense for periodic timers */
632   assert(config->type == TIMER_TYPE_PERIODIC);
633#endif
634
635   state->start_delay = start_delay;
636   state->period = period;
637   state->param = param;
638
639   /* adjust the timer */
640   timer_adjust_periodic(state->timer, state->start_delay, 0, state->period);
641}
642
643
644
578645/***************************************************************************
579646    SIMPLIFIED ANONYMOUS TIMER MANAGEMENT
580647***************************************************************************/
r2018r2019
619686}
620687
621688
689void timer_device_reset(const device_config *timer)
690{
691   timer_state *state = get_safe_token(timer);
692#ifndef NDEBUG
693   timer_config *config = timer->inline_config;
694
695   /* only makes sense for periodic timers */
696   assert(config->type == TIMER_TYPE_PERIODIC);
697#endif
698
699   timer_adjust_periodic(state->timer, state->start_delay, 0, state->period);
700}
701
702
622703/*-------------------------------------------------
623704    timer_enable - enable/disable a timer
624705-------------------------------------------------*/
r2018r2019
639720}
640721
641722
723int timer_device_enable(const device_config *timer, int enable)
724{
725   timer_state *state = get_safe_token(timer);
726   return timer_enable(state->timer, enable);
727}
728
729
642730/*-------------------------------------------------
643731    timer_enabled - determine if a timer is
644732    enabled
r2018r2019
650738}
651739
652740
741int timer_device_enabled(const device_config *timer)
742{
743   timer_state *state = get_safe_token(timer);
744   return timer_enabled(state->timer);
745}
746
747
653748/*-------------------------------------------------
654749    timer_get_param
655750    timer_get_param_ptr - returns the callback
r2018r2019
662757}
663758
664759
760int timer_device_get_param(const device_config *timer)
761{
762   timer_state *state = get_safe_token(timer);
763#ifndef NDEBUG
764   timer_config *config = timer->inline_config;
765
766   /* only makes sense for periodic timers */
767   assert(config->type == TIMER_TYPE_PERIODIC);
768#endif
769
770   return state->param;
771}
772
773
665774void *timer_get_param_ptr(emu_timer *which)
666775{
667776   return which->ptr;
668777}
669778
670779
780void *timer_device_get_param_ptr(const device_config *timer)
781{
782   timer_state *state = get_safe_token(timer);
783   return state->ptr;
784}
671785
786
672787/***************************************************************************
673788    TIMING FUNCTIONS
674789***************************************************************************/
r2018r2019
684799}
685800
686801
802attotime timer_device_timeelapsed(const device_config *timer)
803{
804   timer_state *state = get_safe_token(timer);
805   return timer_timeelapsed(state->timer);
806}
807
808
687809/*-------------------------------------------------
688810    timer_timeleft - return the time until the
689811    next trigger
r2018r2019
695817}
696818
697819
820attotime timer_device_timeleft(const device_config *timer)
821{
822   timer_state *state = get_safe_token(timer);
823   return timer_timeleft(state->timer);
824}
825
826
698827/*-------------------------------------------------
699828    timer_get_time - return the current time
700829-------------------------------------------------*/
r2018r2019
716845}
717846
718847
848attotime timer_device_starttime(const device_config *timer)
849{
850   timer_state *state = get_safe_token(timer);
851   return timer_starttime(state->timer);
852}
853
854
719855/*-------------------------------------------------
720856    timer_firetime - return the time when this
721857    timer will fire next
r2018r2019
727863}
728864
729865
866attotime timer_device_firetime(const device_config *timer)
867{
868   timer_state *state = get_safe_token(timer);
869   return timer_firetime(state->timer);
870}
730871
872
873/*-------------------------------------------------
874    periodic_timer_device_timer_callback - calls
875    the timer device specific callback
876-------------------------------------------------*/
877
878static TIMER_CALLBACK( periodic_timer_device_timer_callback )
879{
880   const device_config *timer = ptr;
881   timer_state *state = get_safe_token(timer);
882   timer_config *config = timer->inline_config;
883
884   /* call the real callback */
885   config->callback(timer, state->ptr, state->param);
886}
887
888
889
890/*-------------------------------------------------
891    scanline_timer_device_timer_callback -
892    manages the scanline based timer's state
893-------------------------------------------------*/
894
895static TIMER_CALLBACK( scanline_timer_device_timer_callback )
896{
897   int next_vpos;
898   const device_config *timer = ptr;
899   timer_state *state = get_safe_token(timer);
900   timer_config *config = timer->inline_config;
901
902   /* get the screen device and verify it */
903   const device_config *screen = device_list_find_by_tag(timer->machine->config->devicelist, VIDEO_SCREEN, config->screen);
904   assert(screen != NULL);
905
906   /* first time, start with the first scanline, but do not call the callback */
907   if (state->first_time)
908   {
909      next_vpos = config->first_vpos;
910
911      /* indicate that we are done with the first call */
912      state->first_time = FALSE;
913   }
914
915   /* not the first time */
916   else
917   {
918      int vpos = video_screen_get_vpos(screen);
919
920      /* call the real callback */
921      config->callback(timer, state->ptr, vpos);
922
923      /* if the increment is 0 or the next scanline is larger than the screen size,
924           go back to the first one */
925        if ((config->increment == 0) ||
926            ((vpos + config->increment) >= video_screen_get_height(screen)))
927         next_vpos = config->first_vpos;
928
929      /* otherwise, increment */
930      else
931         next_vpos = vpos + config->increment;
932   }
933
934   /* adjust the timer */
935   timer_adjust_oneshot(state->timer, video_screen_get_time_until_pos(screen, next_vpos, 0), 0);
936}
937
938
939
731940/***************************************************************************
732941    DEBUGGING
733942***************************************************************************/
r2018r2019
758967   logerror("TIMER LOG STOP\n");
759968   logerror("==============\n");
760969}
970
971
972
973/***************************************************************************
974    TIMER DEVICE INTERFACE
975***************************************************************************/
976
977/*-------------------------------------------------
978    timer_start - device start callback
979    for a timer device
980-------------------------------------------------*/
981
982static DEVICE_START( timer )
983{
984   timer_state *state = get_safe_token(device);
985   char unique_tag[50];
986   timer_config *config;
987   void *param;
988
989   /* validate some basic stuff */
990   assert(device != NULL);
991   assert(device->static_config == NULL);
992   assert(device->inline_config != NULL);
993   assert(device->machine != NULL);
994   assert(device->machine->config != NULL);
995
996   /* get and validate the configuration */
997   config = device->inline_config;
998   assert((config->type == TIMER_TYPE_PERIODIC) || (config->type == TIMER_TYPE_SCANLINE));
999   assert(config->callback != NULL);
1000
1001   /* copy the pointer parameter */
1002   state->ptr = config->ptr;
1003
1004   /* create the name for save states */
1005   assert(strlen(device->tag) < 30);
1006   state_save_combine_module_and_tag(unique_tag, "timer_device", device->tag);
1007
1008   /* type based configuration */
1009   switch (config->type)
1010   {
1011      case TIMER_TYPE_PERIODIC:
1012         /* make sure that only the applicable parameters are filled in */
1013         assert(config->screen == NULL);
1014         assert(config->first_vpos == 0);
1015         assert(config->increment == 0);
1016
1017         /* validate that we have at least a start_delay or period */
1018         assert(config->period > 0);
1019
1020         /* copy the optional integer parameter */
1021         state->param = config->param;
1022
1023         /* convert the start_delay and period into attotime */
1024         state->period = UINT64_ATTOTIME_TO_ATTOTIME(config->period);
1025
1026         if (config->start_delay > 0)
1027            state->start_delay = UINT64_ATTOTIME_TO_ATTOTIME(config->start_delay);
1028         else
1029            state->start_delay = attotime_zero;
1030
1031         /* register for state saves */
1032         state_save_register_item(unique_tag, 0, state->start_delay.seconds);
1033         state_save_register_item(unique_tag, 0, state->start_delay.attoseconds);
1034         state_save_register_item(unique_tag, 0, state->period.seconds);
1035         state_save_register_item(unique_tag, 0, state->period.attoseconds);
1036         state_save_register_item(unique_tag, 0, state->param);
1037
1038         /* allocate the backing timer */
1039         param = (void *)device;
1040         state->timer = timer_alloc(periodic_timer_device_timer_callback, param);
1041
1042         /* finally, start the timer */
1043         timer_adjust_periodic(state->timer, state->start_delay, 0, state->period);
1044         break;
1045
1046      case TIMER_TYPE_SCANLINE:
1047         /* make sure that only the applicable parameters are filled in */
1048         assert(config->start_delay == 0);
1049         assert(config->period == 0);
1050         assert(config->param == 0);
1051
1052         assert(config->first_vpos >= 0);
1053         assert(config->increment >= 0);
1054
1055         /* allocate the backing timer */
1056         param = (void *)device;
1057         state->timer = timer_alloc(scanline_timer_device_timer_callback, param);
1058
1059         /* indicate that this will be the first call */
1060         state->first_time = TRUE;
1061
1062         /* register for state saves */
1063         state_save_register_item(unique_tag, 0, state->first_time);
1064
1065         /* fire it as soon as the emulation starts */
1066         timer_adjust_oneshot(state->timer, attotime_zero, 0);
1067         break;
1068
1069      default:
1070         /* we will never get here */
1071         fatalerror("Unknown timer device type");
1072         break;
1073   }
1074}
1075
1076
1077/*-------------------------------------------------
1078    timer_set_info - device set info callback
1079-------------------------------------------------*/
1080
1081static DEVICE_SET_INFO( timer )
1082{
1083   switch (state)
1084   {
1085      /* no parameters to set */
1086   }
1087}
1088
1089
1090/*-------------------------------------------------
1091    timer_get_info - device get info callback
1092-------------------------------------------------*/
1093
1094DEVICE_GET_INFO( timer )
1095{
1096   switch (state)
1097   {
1098      /* --- the following bits of info are returned as 64-bit signed integers --- */
1099      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(timer_state);         break;
1100      case DEVINFO_INT_INLINE_CONFIG_BYTES:   info->i = sizeof(timer_config);         break;
1101      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_TIMER;         break;
1102
1103      /* --- the following bits of info are returned as pointers to data or functions --- */
1104      case DEVINFO_FCT_SET_INFO:            info->set_info = DEVICE_SET_INFO_NAME(timer); break;
1105      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(timer); break;
1106      case DEVINFO_FCT_STOP:               /* Nothing */                     break;
1107      case DEVINFO_FCT_RESET:               /* Nothing */                     break;
1108
1109      /* --- the following bits of info are returned as NULL-terminated strings --- */
1110      case DEVINFO_STR_NAME:               info->s = "Generic";               break;
1111      case DEVINFO_STR_FAMILY:            info->s = "Timer";                  break;
1112      case DEVINFO_STR_VERSION:            info->s = "1.0";                  break;
1113      case DEVINFO_STR_SOURCE_FILE:         info->s = __FILE__;                  break;
1114      case DEVINFO_STR_CREDITS:            info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
1115   }
1116}
src/emu/timer.h
r2018r2019
1616#define __TIMER_H__
1717
1818#include "mamecore.h"
19#include "devintrf.h"
1920#include "attotime.h"
2021
2122
2223/***************************************************************************
24    CONSTANTS
25***************************************************************************/
26
27/* timer types */
28enum
29{
30   TIMER_TYPE_PERIODIC = 0,
31   TIMER_TYPE_SCANLINE
32};
33
34
35/***************************************************************************
2336    MACROS
2437***************************************************************************/
2538
r2018r2019
4659
4760/* macros for a timer callback functions */
4861#define TIMER_CALLBACK(name)         void name(running_machine *machine, void *ptr, int param)
62#define TIMER_DEVICE_CALLBACK(name)      void name(const device_config *timer, void *ptr, INT32 param)
4963
5064
5165
r2018r2019
5569
5670/* a timer callback looks like this */
5771typedef void (*timer_fired_func)(running_machine *machine, void *ptr, INT32 param);
72typedef void (*timer_device_fired_func)(const device_config *timer, void *ptr, INT32 param);
5873
74
75/*-------------------------------------------------
76    timer_config - configuration of a single
77    timer
78-------------------------------------------------*/
79
80typedef struct _timer_config timer_config;
81struct _timer_config
82{
83   int                  type;         /* type of timer */
84   timer_device_fired_func   callback;      /* the timer's callback function */
85   void                *ptr;         /* the pointer parameter passed to the timer callback */
86
87   /* periodic timers only */
88   UINT64               start_delay;   /* delay before the timer fires for the first time */
89   UINT64               period;         /* period of repeated timer firings */
90   INT32               param;         /* the integer parameter passed to the timer callback */
91
92   /* scanline timers only */
93   const char             *screen;      /* the name of the screen this timer tracks */
94   UINT32               first_vpos;      /* the first vertical scanline position the timer fires on */
95   UINT32               increment;      /* the number of scanlines between firings */
96};
97
98
5999/* opaque type for representing a timer */
60100typedef struct _emu_timer emu_timer;
61101
62102
63103
64104/***************************************************************************
105    TIMER DEVICE CONFIGURATION MACROS
106***************************************************************************/
107
108#define MDRV_TIMER_ADD_PERIODIC(_tag, _callback, _period) \
109   MDRV_DEVICE_ADD(_tag, TIMER) \
110   MDRV_DEVICE_CONFIG_DATA32(timer_config, type, TIMER_TYPE_PERIODIC) \
111   MDRV_DEVICE_CONFIG_DATAPTR(timer_config, callback, _callback) \
112   MDRV_DEVICE_CONFIG_DATA64(timer_config, period, UINT64_ATTOTIME_IN_##_period)
113
114#define MDRV_TIMER_ADD_SCANLINE(_tag, _callback, _screen, _first_vpos, _increment) \
115   MDRV_DEVICE_ADD(_tag, TIMER) \
116   MDRV_DEVICE_CONFIG_DATA32(timer_config, type, TIMER_TYPE_SCANLINE) \
117   MDRV_DEVICE_CONFIG_DATAPTR(timer_config, callback, _callback) \
118   MDRV_DEVICE_CONFIG_DATAPTR(timer_config, screen, _screen) \
119   MDRV_DEVICE_CONFIG_DATA32(timer_config, first_vpos, _first_vpos) \
120   MDRV_DEVICE_CONFIG_DATA32(timer_config, increment, _increment)
121
122#define MDRV_TIMER_REMOVE(_tag) \
123   MDRV_DEVICE_REMOVE(_tag, TIMER_SCREEN)
124
125#define MDRV_TIMER_MODIFY(_tag) \
126   MDRV_DEVICE_MODIFY(_tag, TIMER_SCREEN)
127
128#define MDRV_TIMER_CALLBACK(_callback) \
129   MDRV_DEVICE_CONFIG_DATAPTR(timer_config, callback, _callback)
130
131#define MDRV_TIMER_START_DELAY(_start_delay) \
132   MDRV_DEVICE_CONFIG_DATA64(timer_config, start_delay, UINT64_ATTOTIME_IN_##_start_delay)
133
134#define MDRV_TIMER_PARAM(_param) \
135   MDRV_DEVICE_CONFIG_DATA32(timer_config, param, _param)
136
137#define MDRV_TIMER_PTR(_ptr) \
138   MDRV_DEVICE_CONFIG_DATAPTR(timer_config, ptr, _ptr)
139
140
141
142/***************************************************************************
65143    GLOBAL VARIABLES
66144***************************************************************************/
67145
r2018r2019
110188
111189/* adjust the time when this timer will fire and disable any periodic firings */
112190void timer_adjust_oneshot(emu_timer *which, attotime duration, INT32 param);
191void timer_device_adjust_oneshot(const device_config *timer, attotime duration, INT32 param);
113192
114193/* adjust the time when this timer will fire and specify a period for subsequent firings */
115void timer_adjust_periodic(emu_timer *which, attotime duration, INT32 param, attotime period);
194void timer_adjust_periodic(emu_timer *which, attotime start_delay, INT32 param, attotime period);
195void timer_device_adjust_periodic(const device_config *timer, attotime start_delay, INT32 param, attotime period);
116196
117197
118198
r2018r2019
130210
131211/* reset the timing on a timer */
132212void timer_reset(emu_timer *which, attotime duration);
213void timer_device_reset(const device_config *timer);
133214
134215/* enable/disable a timer */
135216int timer_enable(emu_timer *which, int enable);
217int timer_device_enable(const device_config *timer, int enable);
136218
137219/* determine if a timer is enabled */
138220int timer_enabled(emu_timer *which);
221int timer_device_enabled(const device_config *timer);
139222
140223/* returns the callback parameter of a timer */
141224int timer_get_param(emu_timer *which);
225int timer_device_get_param(const device_config *timer);
226
142227void *timer_get_param_ptr(emu_timer *which);
228void *timer_device_get_param_ptr(const device_config *timer);
143229
144230
145231
r2018r2019
147233
148234/* return the time since the last trigger */
149235attotime timer_timeelapsed(emu_timer *which);
236attotime timer_device_timeelapsed(const device_config *timer);
150237
151238/* return the time until the next trigger */
152239attotime timer_timeleft(emu_timer *which);
240attotime timer_device_timeleft(const device_config *timer);
153241
154242/* return the current time */
155243attotime timer_get_time(void);
156244
157245/* return the time when this timer started counting */
158246attotime timer_starttime(emu_timer *which);
247attotime timer_device_starttime(const device_config *timer);
159248
160249/* return the time when this timer will fire next */
161250attotime timer_firetime(emu_timer *which);
251attotime timer_device_firetime(const device_config *timer);
162252
163253
254/* ----- timer device interface ----- */
255
256/* device get info callback */
257#define TIMER DEVICE_GET_INFO_NAME(timer)
258DEVICE_GET_INFO( timer );
259
260
164261#endif   /* __TIMER_H__ */
src/emu/mconfig.h
r2018r2019
367367   TOKEN_PTR(video_update, video_update_##_func),
368368
369369
370/* add/remove screens */
371#define MDRV_SCREEN_ADD(_tag, _type) \
372   MDRV_DEVICE_ADD(_tag, VIDEO_SCREEN) \
373   MDRV_DEVICE_CONFIG_DATA32(screen_config, type, SCREEN_TYPE_##_type)
374
375#define MDRV_SCREEN_REMOVE(_tag) \
376   MDRV_DEVICE_REMOVE(_tag, VIDEO_SCREEN)
377
378#define MDRV_SCREEN_MODIFY(_tag) \
379   MDRV_DEVICE_MODIFY(_tag, VIDEO_SCREEN)
380
381#define MDRV_SCREEN_FORMAT(_format) \
382   MDRV_DEVICE_CONFIG_DATA32(screen_config, format, _format)
383
384#define MDRV_SCREEN_TYPE(_type) \
385   MDRV_DEVICE_CONFIG_DATA32(screen_config, type, SCREEN_TYPE_##_type)
386
387#define MDRV_SCREEN_RAW_PARAMS(_pixclock, _htotal, _hbend, _hbstart, _vtotal, _vbend, _vbstart) \
388   MDRV_DEVICE_CONFIG_DATA64(screen_config, refresh, HZ_TO_ATTOSECONDS(_pixclock) * (_htotal) * (_vtotal)) \
389   MDRV_DEVICE_CONFIG_DATA64(screen_config, vblank, ((HZ_TO_ATTOSECONDS(_pixclock) * (_htotal) * (_vtotal)) / (_vtotal)) * ((_vtotal) - ((_vbstart) - (_vbend)))) \
390   MDRV_DEVICE_CONFIG_DATA32(screen_config, width, _htotal)   \
391   MDRV_DEVICE_CONFIG_DATA32(screen_config, height, _vtotal)   \
392   MDRV_DEVICE_CONFIG_DATA32(screen_config, visarea.min_x, _hbend) \
393   MDRV_DEVICE_CONFIG_DATA32(screen_config, visarea.max_x, (_hbstart) - 1) \
394   MDRV_DEVICE_CONFIG_DATA32(screen_config, visarea.min_y, _vbend) \
395   MDRV_DEVICE_CONFIG_DATA32(screen_config, visarea.max_y, (_vbstart) - 1)
396
397#define MDRV_SCREEN_REFRESH_RATE(_rate) \
398   MDRV_DEVICE_CONFIG_DATA64(screen_config, refresh, HZ_TO_ATTOSECONDS(_rate))
399
400#define MDRV_SCREEN_VBLANK_TIME(_time) \
401   MDRV_DEVICE_CONFIG_DATA64(screen_config, vblank, _time) \
402   MDRV_DEVICE_CONFIG_DATA32(screen_config, oldstyle_vblank_supplied, TRUE)
403
404#define MDRV_SCREEN_SIZE(_width, _height) \
405   MDRV_DEVICE_CONFIG_DATA32(screen_config, width, _width) \
406   MDRV_DEVICE_CONFIG_DATA32(screen_config, height, _height)
407
408#define MDRV_SCREEN_VISIBLE_AREA(_minx, _maxx, _miny, _maxy) \
409   MDRV_DEVICE_CONFIG_DATA32(screen_config, visarea.min_x, _minx) \
410   MDRV_DEVICE_CONFIG_DATA32(screen_config, visarea.max_x, _maxx) \
411   MDRV_DEVICE_CONFIG_DATA32(screen_config, visarea.min_y, _miny) \
412   MDRV_DEVICE_CONFIG_DATA32(screen_config, visarea.max_y, _maxy)
413
414#define MDRV_SCREEN_DEFAULT_POSITION(_xscale, _xoffs, _yscale, _yoffs)   \
415   MDRV_DEVICE_CONFIG_DATAFP32(screen_config, xoffset, _xoffs, 24) \
416   MDRV_DEVICE_CONFIG_DATAFP32(screen_config, xscale, _xscale, 24) \
417   MDRV_DEVICE_CONFIG_DATAFP32(screen_config, yoffset, _yoffs, 24) \
418   MDRV_DEVICE_CONFIG_DATAFP32(screen_config, yscale, _yscale, 24)
419
420
421370/* add/remove speakers */
422371#define MDRV_SPEAKER_ADD(_tag, _x, _y, _z) \
423372   MDRV_DEVICE_ADD(_tag, SPEAKER_OUTPUT) \
src/mess/video/dl1416.c
r2018r2019
123123
124124static DEVICE_START( dl1416 )
125125{
126   dl1416_t *dl1416;
126   dl1416_t *dl1416 = device->token;
127127   char unique_tag[30];
128128
129129   /* validate arguments */
130130   assert(device->tag != NULL);
131131   assert(strlen(device->tag) < 20);
132132
133   /* allocate the object that holds the state */
134   dl1416 = auto_malloc(sizeof(*dl1416));
135   memset(dl1416, 0, sizeof(*dl1416));
136
137133   dl1416->intf = device->static_config;
138134
139135   /* register for state saving */
r2018r2019
143139   state_save_register_item(unique_tag, 0, dl1416->cursor_enable);
144140   state_save_register_item(unique_tag, 0, dl1416->write_enable);
145141   state_save_register_item_array(unique_tag, 0, dl1416->cursor_ram);
146
147   return dl1416;
148142}
149143
150144
r2018r2019
179173   {
180174      /* --- the following bits of info are returned as 64-bit signed integers --- */
181175      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                     break;
176      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(dl1416_t);            break;
182177
183178      /* --- the following bits of info are returned as pointers to data or functions --- */
184179      case DEVINFO_FCT_SET_INFO:                  info->set_info = DEVICE_SET_INFO_NAME( dl1416 );      break;
src/mess/machine/ins8154.c
r2018r2019
4444
4545static DEVICE_START( ins8154 )
4646{
47   ins8154_t *ins8154;
47   ins8154_t *ins8154 = device->token;
4848   char unique_tag[30];
4949
5050   /* validate arguments */
r2018r2019
5252   assert(device->tag != NULL);
5353   assert(strlen(device->tag) < 20);
5454
55   /* allocate the object that holds the state */
56   ins8154 = auto_malloc(sizeof(*ins8154));
57   memset(ins8154, 0, sizeof(*ins8154));
58
5955   /* assign interface */
6056   ins8154->intf = device->static_config;
6157
r2018r2019
6864   state_save_register_item(unique_tag, 0, ins8154->mdr);
6965   state_save_register_item(unique_tag, 0, ins8154->odra);
7066   state_save_register_item(unique_tag, 0, ins8154->odrb);
71   
72   return ins8154;
7367}
7468
7569
r2018r2019
254248      /* --- the following bits of info are returned as 64-bit signed integers --- */
255249      case DEVINFO_INT_INLINE_CONFIG_BYTES:   info->i = 0;                           break;
256250      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_PERIPHERAL;            break;
251      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(ins8154_t);               break;
257252
258253      /* --- the following bits of info are returned as pointers to data or functions --- */
259254      case DEVINFO_FCT_SET_INFO:            info->set_info = DEVICE_SET_INFO_NAME(ins8154);   break;
src/mess/machine/geneve.c
r2018r2019
320320*/
321321VIDEO_START(geneve)
322322{
323   v9938_init(machine, 0, tmpbitmap, MODEL_V9938, /*0x20000*/0x30000, tms9901_set_int2);   /* v38 with 128 kb of video RAM */
323   v9938_init(machine, 0, machine->primary_screen, tmpbitmap, MODEL_V9938, /*0x20000*/0x30000, tms9901_set_int2);   /* v38 with 128 kb of video RAM */
324324}
325325
326326/*
src/mess/machine/68901mfp.c
r2018r2019
13021302
13031303static DEVICE_START( mc68901 )
13041304{
1305   mc68901_t *mc68901;
1305   mc68901_t *mc68901 = device->token;
13061306   char unique_tag[30];
13071307
13081308   assert(device->machine != NULL);
13091309   assert(device->tag != NULL);
13101310   assert(strlen(device->tag) < 20);
13111311
1312   // allocate the object that holds the state
1313
1314   mc68901 = auto_malloc(sizeof(*mc68901));
1315   memset(mc68901, 0, sizeof(*mc68901));
1316
13171312   //mc68901->device_type = device_type;
13181313   mc68901->intf = device->static_config;
13191314
r2018r2019
13871382   state_save_register_item(unique_tag, 0, mc68901->rxtx_stop);
13881383   state_save_register_item(unique_tag, 0, mc68901->rsr_read);
13891384   state_save_register_item(unique_tag, 0, mc68901->next_rsr);
1390
1391   return mc68901;
13921385}
13931386
13941387static DEVICE_RESET( mc68901 )
r2018r2019
14301423      /* --- the following bits of info are returned as 64-bit signed integers --- */
14311424      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
14321425      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;         break;
1426      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(mc68901_t);            break;
14331427
14341428      /* --- the following bits of info are returned as pointers to data or functions --- */
14351429      case DEVINFO_FCT_SET_INFO:                  info->set_info = DEVICE_SET_INFO_NAME(mc68901); break;
src/mess/machine/ti99_4x.c
r2018r2019
935935*/
936936VIDEO_START( ti99_4ev )
937937{
938   v9938_init(machine, 0, tmpbitmap, MODEL_V9938, 0x20000, tms9901_set_int2);   /* v38 with 128 kb of video RAM */
938   v9938_init(machine, 0, machine->primary_screen, tmpbitmap, MODEL_V9938, 0x20000, tms9901_set_int2);   /* v38 with 128 kb of video RAM */
939939}
940940
941941/*
src/mess/mess.mak
r2018r2019
406406   $(MESSOBJ)/sgi.a \
407407   $(MESSOBJ)/sharp.a \
408408   $(MESSOBJ)/sinclair.a \
409   $(MESSOBJ)/special.a \
410409   $(MESSOBJ)/sony.a \
411410   $(MESSOBJ)/sord.a \
411   $(MESSOBJ)/special.a \
412412   $(MESSOBJ)/ssystem3.a \
413413   $(MESSOBJ)/super80.a \
414414   $(MESSOBJ)/svi.a \
src/mess/drivers/msx.c
r2018r2019
712712
713713static VIDEO_START( msx2 )
714714{
715   v9938_init(machine, 0, tmpbitmap, MODEL_V9938, 0x20000, msx_vdp_interrupt);
715   v9938_init(machine, 0, machine->primary_screen, tmpbitmap, MODEL_V9938, 0x20000, msx_vdp_interrupt);
716716}
717717
718718#define MSX_XBORDER_PIXELS      15
docs/messnew.txt
r2018r2019
6565
6666Source Changes:
6767----------------
68- The core is based on MAME 0.123u5.  This incorporates all features of the
68- The core is based on MAME 0.123u6.  This incorporates all features of the
6969  update to this core.  [MAME team]
7070
7171- Updated the Motorola MC68901 Multi Function Peripheral to use the new

Previous 15994 Revisions Next


© 1998-2018 The MESS Team