Previous 15994 Revisions Next

r3374 Friday 3rd October, 2008 at 04:37:45 UTC by Nathan Woods
Updated to MAME 0.127u6 core
[docs]messnew.txt
[src/emu]cpuint.c crsshair.c emupal.h inptport.h inpttype.h render.c render.h rendfont.c tilemap.c tilemap.h ui.c uigfx.c uimenu.c video.c
[src/emu/cpu/cubeqcpu]cubeqcpu.c
[src/emu/cpu/dsp56k]dsp56def.h dsp56k.c dsp56mem.c dsp56ops.c dsp56pcu.c
[src/emu/cpu/m68000]m68kcpu.c m68kcpu.h
[src/emu/cpu/z80]z80daisy.c
[src/emu/machine]8255ppi.c 8255ppi.h ldcore.c ldv1000.c
[src/emu/video]tms9928a.c
[src/lib/util]aviio.c palette.c palette.h vbiparse.c
[src/mame]mamedriv.c
[src/mame/audio]cchasm.c cinemat.c scramble.c segag80r.c senjyo.c turbo.c zaxxon.c
[src/mame/drivers]20pacgal.c 8080bw.c alg.c astinvad.c astrocde.c cchasm.c chqflag.c clayshoo.c cliffhgr.c couple.c cps2.c cubeqst.c dlair.c dribling.c epos.c esh.c expro02.c filetto.c findout.c firefox.c freekick.c galaxian.c gatron.c getrivia.c gpworld.c homerun.c igs_180.c imolagp.c iqblock.c istellar.c lgp.c lordgun.c lucky74.c mcr.c mcr3.c merit.c meritm.c mwarr.c nbmj9195.c neodrvr.c niyanpai.c othunder.c paradise.c pipeline.c psikyo4.c sbasketb.c scobra.c scramble.c segag80r.c segahang.c segald.c segaorun.c segas16a.c segaxbd.c seibuspi.c senjyo.c sg1000a.c shadfrce.c smstrv.c superdq.c system1.c taxidrvr.c tcl.c turbo.c tx1.c vroulet.c warpwarp.c zaccaria.c zaxxon.c
[src/mame/includes]galaxold.h mcr.h neogeo.h segag80r.h turbo.h zaxxon.h
[src/mame/machine]cps2crpt.c mcr.c neoboot.c neocrypt.c scramble.c snes.c
[src/mame/video]gottlieb.c itech32.c kaneko16.c taito_f3.c tmnt.c toobin.c
[src/mess/drivers]amstrad.c bw2.c mpf1.c sg1000.c sord.c x68k.c
[src/mess/includes]atom.h
[src/mess/machine]atom.c b2m.c compis.c irisha.c lviv.c mikro80.c msx.c mz700.c orion.c pc.c pc8801.c pmd85.c radio86.c special.c svi318.c ut88.c vector06.c
[src/mess/tools/messtest]testmess.c
[src/mess/video]hd66421.c
[src/osd/windows]window.c
[src/tools]ldverify.c

src/mame/audio/cchasm.c
r3373r3374
1313#include "sound/dac.h"
1414
1515static int sound_flags;
16static const device_config *ctc;
1617
1718READ8_HANDLER( cchasm_snd_io_r )
1819{
r3373r3374
3637
3738    case 0x41:
3839        sound_flags &= ~0x80;
39        z80ctc_0_trg2_w (machine, 0, 0);
40        z80ctc_trg2_w(ctc, 0, 0);
4041        return soundlatch2_r (machine, offset);
4142    default:
4243        logerror("Read from unmapped internal IO device at 0x%x\n", offset + 0x6000);
r3373r3374
7576        break;
7677
7778    case 0x61:
78        z80ctc_0_trg0_w (machine, 0, 0);
79        z80ctc_trg0_w(ctc, 0, 0);
7980        break;
8081
8182    default:
r3373r3374
9899      case 1:
99100         sound_flags |= 0x80;
100101         soundlatch2_w (machine, offset, data);
101         z80ctc_0_trg2_w (machine, 0, 1);
102         z80ctc_trg2_w (ctc, 0, 1);
102103         cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
103104         break;
104105      case 2:
r3373r3374
131132static int channel_active[2];
132133static int output[2];
133134
134static void ctc_interrupt (running_machine *machine, int state)
135static void ctc_interrupt (const device_config *device, int state)
135136{
136   cpunum_set_input_line(machine, 1, 0, state);
137   cpunum_set_input_line(device->machine, 1, 0, state);
137138}
138139
139static WRITE8_HANDLER( ctc_timer_1_w )
140static WRITE8_DEVICE_HANDLER( ctc_timer_1_w )
140141{
141142    if (data) /* rising edge */
142143    {
r3373r3374
146147    }
147148}
148149
149static WRITE8_HANDLER( ctc_timer_2_w )
150static WRITE8_DEVICE_HANDLER( ctc_timer_2_w )
150151{
151152    if (data) /* rising edge */
152153    {
r3373r3374
156157    }
157158}
158159
159static z80ctc_interface ctc_intf =
160z80ctc_interface cchasm_ctc_intf =
160161{
162   "audio",         /* clock from the audio CPU */
161163   0,               /* clock (filled in from the CPU 0 clock */
162164   0,               /* timer disables */
163165   ctc_interrupt,   /* interrupt handler */
r3373r3374
169171static TIMER_CALLBACK( cchasm_sh_update )
170172{
171173    if ((input_port_read(machine, "IN3") & 0x70) != 0x70)
172        z80ctc_0_trg0_w (machine, 0, 1);
174        z80ctc_trg0_w (ctc, 0, 1);
173175}
174176
175177SOUND_START( cchasm )
r3373r3374
177179    sound_flags = 0;
178180    output[0] = 0; output[1] = 0;
179181
180   ctc_intf.baseclock = cpunum_get_clock(1);
181   z80ctc_init (0, &ctc_intf);
182   ctc = devtag_get_device(machine, Z80CTC, "ctc");
182183
183184   timer_pulse(video_screen_get_frame_period(machine->primary_screen), NULL, 0, cchasm_sh_update);
184185}
src/mame/audio/cinemat.c
r3373r3374
14901490};
14911491
14921492
1493static void ctc_interrupt(running_machine *machine, int state)
1493static void ctc_interrupt(const device_config *device, int state)
14941494{
1495   cpunum_set_input_line(machine, 1, 0, state);
1495   cpunum_set_input_line(device->machine, 1, 0, state);
14961496}
14971497
14981498
14991499static z80ctc_interface demon_z80ctc_interface =
15001500{
1501   "audio",       /* clocked from the audio CPU */
15011502   0,               /* clock (filled in from the CPU clock) */
15021503   0,               /* timer disables */
15031504   ctc_interrupt,   /* interrupt handler */
r3373r3374
15121513   /* generic init */
15131514   generic_init(machine, demon_sound_w);
15141515
1515   /* initialize the CTC interface */
1516   demon_z80ctc_interface.baseclock = cpunum_get_clock(1);
1517   z80ctc_init(0, &demon_z80ctc_interface);
1518
15191516   /* reset the FIFO */
15201517   sound_fifo_in = sound_fifo_out = 0;
15211518   last_portb_write = 0xff;
r3373r3374
15431540
15441541static ADDRESS_MAP_START( demon_sound_ports, ADDRESS_SPACE_IO, 8 )
15451542   ADDRESS_MAP_GLOBAL_MASK(0xff)
1546   AM_RANGE(0x00, 0x03) AM_WRITE(z80ctc_0_w)
1547   AM_RANGE(0x1c, 0x1f) AM_WRITE(z80ctc_0_w)
1543   AM_RANGE(0x00, 0x03) AM_DEVWRITE(Z80CTC, "ctc", z80ctc_w)
1544   AM_RANGE(0x1c, 0x1f) AM_DEVWRITE(Z80CTC, "ctc", z80ctc_w)
15481545ADDRESS_MAP_END
15491546
15501547
1551static const struct z80_irq_daisy_chain daisy_chain[] =
1548static const z80_daisy_chain daisy_chain[] =
15521549{
1553   { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti, 0 },
1554   { 0,0,0,0,-1 }
1550   { Z80CTC, "ctc" },
1551   { NULL }
15551552};
15561553
15571554
r3373r3374
15631560   MDRV_CPU_PROGRAM_MAP(demon_sound_map,0)
15641561   MDRV_CPU_IO_MAP(demon_sound_ports,0)
15651562
1563   MDRV_Z80CTC_ADD("ctc", demon_z80ctc_interface)
1564
15661565   MDRV_MACHINE_RESET(demon_sound)
15671566
15681567   /* sound hardware */
src/mame/audio/zaxxon.c
r3373r3374
121121 *
122122 *************************************/
123123
124WRITE8_HANDLER( zaxxon_sound_a_w )
124WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w )
125125{
126126   UINT8 diff = data ^ sound_state[0];
127127   sound_state[0] = data;
r3373r3374
155155}
156156
157157
158WRITE8_HANDLER( zaxxon_sound_b_w )
158WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w )
159159{
160160   UINT8 diff = data ^ sound_state[1];
161161   sound_state[1] = data;
r3373r3374
171171}
172172
173173
174WRITE8_HANDLER( zaxxon_sound_c_w )
174WRITE8_DEVICE_HANDLER( zaxxon_sound_c_w )
175175{
176176   UINT8 diff = data ^ sound_state[2];
177177   sound_state[2] = data;
r3373r3374
227227 *
228228 *************************************/
229229
230WRITE8_HANDLER( congo_sound_b_w )
230WRITE8_DEVICE_HANDLER( congo_sound_b_w )
231231{
232232   UINT8 diff = data ^ sound_state[1];
233233   sound_state[1] = data;
r3373r3374
239239}
240240
241241
242WRITE8_HANDLER( congo_sound_c_w )
242WRITE8_DEVICE_HANDLER( congo_sound_c_w )
243243{
244244   UINT8 diff = data ^ sound_state[2];
245245   sound_state[2] = data;
src/mame/audio/turbo.c
r3373r3374
6969 *
7070 *************************************/
7171
72WRITE8_HANDLER( turbo_sound_a_w )
72WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
7373{
74   turbo_state *state = machine->driver_data;
74   turbo_state *state = device->machine->driver_data;
7575   UINT8 diff = data ^ state->sound_state[0];
7676   state->sound_state[0] = data;
7777
r3373r3374
117117}
118118
119119
120WRITE8_HANDLER( turbo_sound_b_w )
120WRITE8_DEVICE_HANDLER( turbo_sound_b_w )
121121{
122   turbo_state *state = machine->driver_data;
122   turbo_state *state = device->machine->driver_data;
123123   UINT8 diff = data ^ state->sound_state[1];
124124   state->sound_state[1] = data;
125125
r3373r3374
139139}
140140
141141
142WRITE8_HANDLER( turbo_sound_c_w )
142WRITE8_DEVICE_HANDLER( turbo_sound_c_w )
143143{
144   turbo_state *state = machine->driver_data;
144   turbo_state *state = device->machine->driver_data;
145145
146146   /* OSEL1-2 */
147147   state->turbo_osel = (state->turbo_osel & 1) | ((data & 3) << 1);
r3373r3374
289289 *
290290 *************************************/
291291
292WRITE8_HANDLER( subroc3d_sound_a_w )
292WRITE8_DEVICE_HANDLER( subroc3d_sound_a_w )
293293{
294   turbo_state *state = machine->driver_data;
294   turbo_state *state = device->machine->driver_data;
295295   state->sound_state[0] = data;
296296
297297   /* DIS0-3 contained in bits 0-3 */
r3373r3374
319319}
320320
321321
322WRITE8_HANDLER( subroc3d_sound_b_w )
322WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w )
323323{
324   turbo_state *state = machine->driver_data;
324   turbo_state *state = device->machine->driver_data;
325325   UINT8 diff = data ^ state->sound_state[1];
326326   state->sound_state[1] = data;
327327
r3373r3374
374374}
375375
376376
377WRITE8_HANDLER( subroc3d_sound_c_w )
377WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w )
378378{
379   turbo_state *state = machine->driver_data;
379   turbo_state *state = device->machine->driver_data;
380380   UINT8 diff = data ^ state->sound_state[2];
381381   state->sound_state[2] = data;
382382
r3373r3374
498498}
499499
500500
501WRITE8_HANDLER( buckrog_sound_a_w )
501WRITE8_DEVICE_HANDLER( buckrog_sound_a_w )
502502{
503   turbo_state *state = machine->driver_data;
503   turbo_state *state = device->machine->driver_data;
504504   UINT8 diff = data ^ state->sound_state[0];
505505   state->sound_state[0] = data;
506506
r3373r3374
523523}
524524
525525
526WRITE8_HANDLER( buckrog_sound_b_w )
526WRITE8_DEVICE_HANDLER( buckrog_sound_b_w )
527527{
528   turbo_state *state = machine->driver_data;
528   turbo_state *state = device->machine->driver_data;
529529   UINT8 diff = data ^ state->sound_state[1];
530530   state->sound_state[1] = data;
531531
src/mame/audio/senjyo.c
r3373r3374
11#include "driver.h"
22#include "deprecat.h"
3#include "cpu/z80/z80daisy.h"
34#include "machine/z80pio.h"
45#include "machine/z80ctc.h"
56#include "sound/samples.h"
67
78
9/* single tone generator */
10#define SINGLE_LENGTH 10000
11#define SINGLE_DIVIDER 8
12
13static INT16 *_single;
14static int single_rate = 1000;
15static int single_volume = 0;
16
17
18const z80_daisy_chain senjyo_daisy_chain[] =
19{
20   { Z80CTC, "z80ctc" },
21   { Z80PIO, "z80pio" },
22   { NULL }
23};
24
25
826/* z80 pio */
9static void pio_interrupt(running_machine *machine, int state)
27static void daisy_interrupt(const device_config *device, int state)
1028{
11   cpunum_set_input_line(machine, 1, 0, state);
29   cputag_set_input_line(device->machine, "sub", 0, state);
1230}
1331
14static const z80pio_interface pio_intf =
32const z80pio_interface senjyo_pio_intf =
1533{
16   pio_interrupt,
17   0,
18   0
34   daisy_interrupt,
35   NULL,
36   NULL,
37   NULL,
38   NULL,
39   NULL,
40   NULL
1941};
2042
2143/* z80 ctc */
22static void ctc_interrupt (running_machine *machine, int state)
44const z80ctc_interface senjyo_ctc_intf =
2345{
24   cpunum_set_input_line(machine, 1, 0, state);
25}
26
27static z80ctc_interface ctc_intf =
28{
46   "sub",          /* clock from sub CPU */
2947   0,               /* clock (filled in from the CPU 0 clock */
3048   NOTIMER_2,       /* timer disables */
31   ctc_interrupt,   /* interrupt handler */
32   z80ctc_0_trg1_w, /* ZC/TO0 callback */
49   daisy_interrupt, /* interrupt handler */
50   z80ctc_trg1_w,     /* ZC/TO0 callback */
3351   0,               /* ZC/TO1 callback */
3452   0                /* ZC/TO2 callback */
3553};
3654
3755
38/* single tone generator */
39#define SINGLE_LENGTH 10000
40#define SINGLE_DIVIDER 8
41
42static INT16 *_single;
43static int single_rate = 1000;
44static int single_volume = 0;
45
46
4756WRITE8_HANDLER( senjyo_volume_w )
4857{
4958   single_volume = data & 0x0f;
r3373r3374
5463static TIMER_CALLBACK( senjyo_sh_update )
5564{
5665   /* ctc2 timer single tone generator frequency */
57   attotime period = z80ctc_getperiod (0, 2);
66   attotime period = z80ctc_getperiod (devtag_get_device(machine, Z80CTC, "z80ctc"), 2);
5867   if (attotime_compare(period, attotime_zero) != 0 )
5968      single_rate = ATTOSECONDS_TO_HZ(period.attoseconds);
6069   else
r3373r3374
6877{
6978    int i;
7079
71   /* z80 ctc init */
72   ctc_intf.baseclock = cpunum_get_clock(1);
73   z80ctc_init (0, &ctc_intf);
74
75   /* z80 pio init */
76   z80pio_init (0, &pio_intf);
77
7880   _single = (INT16 *)auto_malloc(SINGLE_LENGTH*2);
7981
8082   for (i = 0;i < SINGLE_LENGTH;i++)      /* freq = ctc2 zco / 8 */
src/mame/audio/segag80r.c
r3373r3374
342342static void *sega005_custom_start(int clock, const custom_sound_interface *config);
343343static void sega005_stream_update(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
344344static TIMER_CALLBACK( sega005_auto_timer );
345static WRITE8_DEVICE_HANDLER( sega005_sound_a_w );
346static WRITE8_DEVICE_HANDLER( sega005_sound_b_w );
345347
346348/*
347349    005
r3373r3374
438440
439441MACHINE_DRIVER_START( 005_sound_board )
440442
441   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
442   MDRV_DEVICE_CONFIG( ppi8255_005_intf )
443   MDRV_PPI8255_ADD( "ppi8255", ppi8255_005_intf )
443444
444445   /* sound hardware */
445446   MDRV_SOUND_START(005)
r3373r3374
478479 *
479480 *************************************/
480481
481WRITE8_HANDLER( sega005_sound_a_w )
482static WRITE8_DEVICE_HANDLER( sega005_sound_a_w )
482483{
483484   UINT8 diff = data ^ sound_state[0];
484485   sound_state[0] = data;
r3373r3374
534535}
535536
536537
537WRITE8_HANDLER( sega005_sound_b_w )
538static WRITE8_DEVICE_HANDLER( sega005_sound_b_w )
538539{
539540   /*
540541           D6: manual timer clock (0->1)
r3373r3374
565566      sound_addr = (sound_addr & 0x780) | ((sound_addr + 1) & 0x07f);
566567
567568   /* update the sound data */
568   sega005_update_sound_data(machine);
569   sega005_update_sound_data(device->machine);
569570}
570571
571572
r3373r3374
747748 *************************************/
748749
749750static SOUND_START( monsterb );
750static WRITE8_HANDLER( monsterb_sound_a_w );
751static WRITE8_HANDLER( monsterb_sound_b_w );
752static READ8_HANDLER( n7751_status_r );
753static WRITE8_HANDLER( n7751_command_w );
751static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w );
752static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w );
753static READ8_DEVICE_HANDLER( n7751_status_r );
754static WRITE8_DEVICE_HANDLER( n7751_command_w );
754755static WRITE8_HANDLER( n7751_rom_offset_w );
755756static WRITE8_HANDLER( n7751_rom_select_w );
756757static READ8_HANDLER( n7751_rom_r );
r3373r3374
830831
831832MACHINE_DRIVER_START( monsterb_sound_board )
832833
833   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
834   MDRV_DEVICE_CONFIG( monsterb_ppi_intf )
834   MDRV_PPI8255_ADD( "ppi8255", monsterb_ppi_intf )
835835
836836   /* basic machine hardware */
837837   MDRV_CPU_ADD("audio", N7751, 6000000)
r3373r3374
876876 *
877877 *************************************/
878878
879static WRITE8_HANDLER( monsterb_sound_a_w )
879static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w )
880880{
881881   int enable_val;
882882
r3373r3374
884884   tms36xx_note_w(0, 0, data & 15);
885885
886886   /* Top four data lines address an 82S123 ROM that enables/disables voices */
887   enable_val = memory_region(machine, "prom")[(data & 0xF0) >> 4];
887   enable_val = memory_region(device->machine, "prom")[(data & 0xF0) >> 4];
888888   tms3617_enable_w(0, enable_val >> 2);
889889}
890890
r3373r3374
896896 *
897897 *************************************/
898898
899static WRITE8_HANDLER( monsterb_sound_b_w )
899static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w )
900900{
901901   UINT8 diff = data ^ sound_state[1];
902902   sound_state[1] = data;
r3373r3374
918918 *
919919 *************************************/
920920
921static READ8_HANDLER( n7751_status_r )
921static READ8_DEVICE_HANDLER( n7751_status_r )
922922{
923923   return n7751_busy << 4;
924924}
925925
926926
927static WRITE8_HANDLER( n7751_command_w )
927static WRITE8_DEVICE_HANDLER( n7751_command_w )
928928{
929929   /*
930930        Z80 7751 control port
r3373r3374
933933        D3    = /INT line
934934    */
935935   n7751_command = data & 0x07;
936   cpunum_set_input_line(machine, 1, 0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE);
936   cpunum_set_input_line(device->machine, 1, 0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE);
937937   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
938938}
939939
src/mame/audio/scramble.c
r3373r3374
8080}
8181
8282
83WRITE8_HANDLER( scramble_sh_irqtrigger_w )
83WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w )
8484{
8585   /* the complement of bit 3 is connected to the flip-flop's clock */
8686   TTL7474_clock_w(2, ~data & 0x08);
r3373r3374
9797   TTL7474_update(3);
9898}
9999
100WRITE8_HANDLER( mrkougar_sh_irqtrigger_w )
100WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w )
101101{
102102   /* the complement of bit 3 is connected to the flip-flop's clock */
103103   TTL7474_clock_w(2, ~data & 0x08);
src/mame/machine/neoboot.c
r3373r3374
998998   free( buf );
999999}
10001000
1001void samsh5bl_vx_decrypt( running_machine *machine )
1002{
1003   int vx_size = memory_region_length( machine, "ym" );
1004   UINT8 *rom = memory_region( machine, "ym" );
1005   int i;
10011006
1007   for( i = 0; i < vx_size; i++ )
1008      rom[ i ] = BITSWAP8( rom[ i ], 0, 1, 5, 4, 3, 2, 6, 7 );
1009}
1010
src/mame/machine/scramble.c
r3373r3374
6363}
6464
6565
66static READ8_HANDLER( darkplnt_input_port_1_r )
66CUSTOM_INPUT( darkplnt_custom_r )
6767{
6868   static const UINT8 remap[] = {0x03, 0x02, 0x00, 0x01, 0x21, 0x20, 0x22, 0x23,
6969                       0x33, 0x32, 0x30, 0x31, 0x11, 0x10, 0x12, 0x13,
r3373r3374
7373                       0x2b, 0x2a, 0x28, 0x29, 0x09, 0x08, 0x0a, 0x0b,
7474                       0x0f, 0x0e, 0x0c, 0x0d, 0x2d, 0x2c, 0x2e, 0x2f,
7575                       0x27, 0x26, 0x24, 0x25, 0x05, 0x04, 0x06, 0x07 };
76   UINT8 val;
76   UINT8 val = input_port_read(field->port->machine, param);
7777
78   val = input_port_read(machine, "IN1");
79
80   return ((val & 0x03) | (remap[val >> 2] << 2));
78   return remap[val >> 2];
8179}
8280
8381/* state of the security PAL (6J) */
8482static UINT8 xb;
8583
86static WRITE8_HANDLER( scramble_protection_w )
84static WRITE8_DEVICE_HANDLER( scramble_protection_w )
8785{
8886   xb = data;
8987}
9088
91static READ8_HANDLER( scramble_protection_r )
89static READ8_DEVICE_HANDLER( scramble_protection_r )
9290{
9391   switch (activecpu_get_pc())
9492   {
r3373r3374
150148   cavelon_banksw();
151149
152150   if      ((offset >= 0x0100) && (offset <= 0x0103))
153      return ppi8255_r((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset - 0x0100);
151      return ppi8255_r((device_config*)devtag_get_device(machine, PPI8255, "ppi8255_0"), offset - 0x0100);
154152   else if ((offset >= 0x0200) && (offset <= 0x0203))
155      return ppi8255_r((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset - 0x0200);
153      return ppi8255_r((device_config*)devtag_get_device(machine, PPI8255, "ppi8255_1"), offset - 0x0200);
156154
157155   return 0xff;
158156}
r3373r3374
162160   cavelon_banksw();
163161
164162   if      ((offset >= 0x0100) && (offset <= 0x0103))
165      ppi8255_w((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset - 0x0100, data);
163      ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_0"), offset - 0x0100, data);
166164   else if ((offset >= 0x0200) && (offset <= 0x0203))
167      ppi8255_w((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset - 0x0200, data);
165      ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_1"), offset - 0x0200, data);
168166}
169167
170168
r3373r3374
178176   program_write_byte(0x1000+offset,data);
179177}
180178
179static WRITE8_DEVICE_HANDLER( sound_latch_w ) { soundlatch_w(device->machine, offset, data); }
181180
182const ppi8255_interface scramble_ppi_ppi8255_intf[2] =
181const ppi8255_interface scramble_ppi_0_intf =
183182{
184   {
185      input_port_0_r,            /* Port A read */
186      input_port_1_r,            /* Port B read */
187      input_port_2_r,            /* Port C read */
188      NULL,                  /* Port A write */
189      NULL,                  /* Port B write */
190      NULL                   /* Port C write */
191   },
192   {
193      NULL,                  /* Port A read */
194      NULL,                  /* Port B read */
195      NULL,                  /* Port C read */
196      soundlatch_w,            /* Port A write */
197      scramble_sh_irqtrigger_w,   /* Port B write */
198      NULL                  /* Port C write */
199   }
183   DEVICE8_PORT("IN0"),      /* Port A read */
184   DEVICE8_PORT("IN1"),      /* Port B read */
185   DEVICE8_PORT("IN2"),      /* Port C read */
186   NULL,                  /* Port A write */
187   NULL,                  /* Port B write */
188   NULL                   /* Port C write */
200189};
201190
202
203const ppi8255_interface stratgyx_ppi8255_intf[2] =
191const ppi8255_interface scramble_ppi_1_intf =
204192{
205   {
206      input_port_0_r,            /* Port A read */
207      input_port_1_r,            /* Port B read */
208      input_port_2_r,            /* Port C read */
209      NULL,                  /* Port A write */
210      NULL,                  /* Port B write */
211      NULL                   /* Port C write */
212   },
213   {
214      NULL,                  /* Port A read */
215      NULL,                  /* Port B read */
216      input_port_3_r,            /* Port C read */
217      soundlatch_w,            /* Port A write */
218      scramble_sh_irqtrigger_w,   /* Port B write */
219      NULL                  /* Port C write */
220   }
193   NULL,                  /* Port A read */
194   NULL,                  /* Port B read */
195   NULL,                  /* Port C read */
196   sound_latch_w,            /* Port A write */
197   scramble_sh_irqtrigger_w,   /* Port B write */
198   NULL                  /* Port C write */
221199};
222200
223201
224const ppi8255_interface darkplnt_ppi8255_intf[2] =
202const ppi8255_interface stratgyx_ppi_1_intf =
225203{
226   {
227      input_port_0_r,            /* Port A read */
228      darkplnt_input_port_1_r,   /* Port B read */
229      input_port_2_r,            /* Port C read */
230      NULL,                  /* Port A write */
231      NULL,                  /* Port B write */
232      NULL                   /* Port C write */
233   },
234   {
235      NULL,                  /* Port A read */
236      NULL,                  /* Port B read */
237      NULL,                  /* Port C read */
238      soundlatch_w,            /* Port A write */
239      scramble_sh_irqtrigger_w,   /* Port B write */
240      NULL                  /* Port C write */
241   }
204   NULL,                  /* Port A read */
205   NULL,                  /* Port B read */
206   DEVICE8_PORT("IN3"),      /* Port C read */
207   sound_latch_w,            /* Port A write */
208   scramble_sh_irqtrigger_w,   /* Port B write */
209   NULL                  /* Port C write */
242210};
243211
244212
245const ppi8255_interface scramble_ppi8255_intf[2] =
213const ppi8255_interface scramble_protection_ppi_1_intf =
246214{
247   {
248      input_port_0_r,            /* Port A read */
249      input_port_1_r,            /* Port B read */
250      input_port_2_r,            /* Port C read */
251      NULL,                  /* Port A write */
252      NULL,                  /* Port B write */
253      NULL                   /* Port C write */
254   },
255   {
256      NULL,                  /* Port A read */
257      NULL,                  /* Port B read */
258      scramble_protection_r,      /* Port C read */
259      soundlatch_w,            /* Port A write */
260      scramble_sh_irqtrigger_w,   /* Port B write */
261      scramble_protection_w      /* Port C write */
262   }
215   NULL,                  /* Port A read */
216   NULL,                  /* Port B read */
217   scramble_protection_r,      /* Port C read */
218   sound_latch_w,            /* Port A write */
219   scramble_sh_irqtrigger_w,   /* Port B write */
220   scramble_protection_w      /* Port C write */
263221};
264222
265223
266const ppi8255_interface ckongs_ppi8255_intf[2] =
224const ppi8255_interface mrkougar_ppi_1_intf =
267225{
268   {
269      input_port_0_r,            /* Port A read */
270      input_port_1_r,            /* Port B read */
271      input_port_2_r,            /* Port C read */
272      NULL,                  /* Port A write */
273      NULL,                  /* Port B write */
274      NULL                   /* Port C write */
275   },
276   {
277      NULL,                  /* Port A read */
278      NULL,                  /* Port B read */
279      NULL,                  /* Port C read */
280      soundlatch_w,            /* Port A write */
281      scramble_sh_irqtrigger_w,   /* Port B write */
282      NULL                  /* Port C write */
283   }
226   NULL,                  /* Port A read */
227   NULL,                  /* Port B read */
228   NULL,                  /* Port C read */
229   sound_latch_w,            /* Port A write */
230   mrkougar_sh_irqtrigger_w,   /* Port B write */
231   NULL                  /* Port C write */
284232};
285233
286234
287const ppi8255_interface mars_ppi8255_intf[2] =
288{
289   {
290      input_port_0_r,            /* Port A read */
291      input_port_1_r,            /* Port B read */
292      input_port_2_r,            /* Port C read */
293      NULL,                  /* Port A write */
294      NULL,                  /* Port B write */
295      NULL                   /* Port C write */
296   },
297   {
298      NULL,                  /* Port A read */
299      NULL,                  /* Port B read */
300      input_port_3_r,            /* Port C read */
301      soundlatch_w,            /* Port A write */
302      scramble_sh_irqtrigger_w,   /* Port B write */
303      NULL                  /* Port C write */
304   }
305};
306
307
308const ppi8255_interface mrkougar_ppi8255_intf[2] =
309{
310   {
311      input_port_0_r,            /* Port A read */
312      input_port_1_r,            /* Port B read */
313      input_port_2_r,            /* Port C read */
314      NULL,                  /* Port A write */
315      NULL,                  /* Port B write */
316      NULL                   /* Port C write */
317   },
318   {
319      NULL,                  /* Port A read */
320      NULL,                  /* Port B read */
321      NULL,                  /* Port C read */
322      soundlatch_w,            /* Port A write */
323      mrkougar_sh_irqtrigger_w,   /* Port B write */
324      NULL                  /* Port C write */
325   }
326};
327
328
329235DRIVER_INIT( scramble_ppi )
330236{
331237}
src/mame/machine/snes.c
r3373r3374
6060
6161/*************************************
6262
63   Timers
63    Timers
6464
6565*************************************/
6666
r3373r3374
278278
279279/*************************************
280280
281   Input Handlers
281    Input Handlers
282282
283283*************************************/
284284
r3373r3374
10901090
10911091/*************************************
10921092
1093   Memory Handlers
1093    Memory Handlers
10941094
10951095*************************************/
10961096
10971097/*
10981098There are at least 4 different kind of boards for SNES carts, which we denote with
1099mode_20, mode_21, mode_22 and mode_25. Below is a layout of the memory for each of
1099mode_20, mode_21, mode_22 and mode_25. Below is a layout of the memory for each of
11001100them, as described on the SNES dev manual. Notice we mirror ROM at loading time
11011101where necessary (e.g. banks 0x80 to 0xff at address 0x8000 for mode_20).
11021102
r3373r3374
11051105address               |             |         |          |        |     |      |      |
110611060xffff  ------------------------------------------------------------------------------|
11071107             ROM      |     ROM /   |   ROM   |  ROM     |  ROM / |     | 0x00 | 0x40 |
1108                 |     DSP     |         |          |  SRAM? |     |  to  |  to  |
1108                      |     DSP     |         |          |  SRAM? |     |  to  |  to  |
110911090x8000  ----------------------------------------------------------|     | 0x3f | 0x7f |
11101110                   Reserv           |         |          |        |  W  |      |      |
1111                                  |         |          |   S    |  R  |  m   |  m   |
1111                                    |         |          |   S    |  R  |  m   |  m   |
111211120x6000  ----------------------------|         |  DSP /   |   R    |  A  |  i   |  i   |
11131113                     I/O            |  Reserv |          |   A    |  M  |  r   |  r   |
111411140x2000  ----------------------------|         |  Reserv  |   M    |     |  r   |  r   |
1115          Low RAM (from 0x7e)    |         |          |        |     |  o   |  o   |
1116                                  |         |          |        |     |  r   |  r   |
1115             Low RAM (from 0x7e)    |         |          |        |     |  o   |  o   |
1116                                    |         |          |        |     |  r   |  r   |
111711170x0000  -------------------------------------------------------------------------------
11181118
11191119MODE_22 is the same, but banks 0x40 to 0x7e at address 0x000 to 0x7fff contain ROM (of
11201120course mirrored also at 0xc0 to 0xff). Mode 22 is quite similar to the board SHVC-2P3B
11211121shown on SNES Dev manual. It is used also in SDD-1 games (only for the first blocks of
1122data). DSP data & status can be either at banks 0x20 to 0x40 at address 0x8000 or at
1122data). DSP data & status can be either at banks 0x20 to 0x40 at address 0x8000 or at
11231123banks 0x60 to 0x6f at address 0x0000.
11241124
11251125
r3373r3374
11281128address               |             |         |      |     |         |      |
112911290xffff  --------------------------------------------------------------------|
11301130                         mirror               | 0xc0 |     | mirror  |      |
1131                 upper half ROM          |  to  |     | up half |      |
1132                 from 0xc0 to 0xff        | 0xff |     |   ROM   |      |
1131                      upper half ROM          |  to  |     | up half |      |
1132                     from 0xc0 to 0xff        | 0xff |     |   ROM   |      |
113311330x8000  --------------------------------------|      |     |---------|      |
11341134             DSP /    |    Reserv   |  SRAM   |      |  W  |         |      |
1135          Reserv    |             |         |  m   |  R  |   0x00  |  R   |
1135            Reserv    |             |         |  m   |  R  |   0x00  |  R   |
113611360x6000  --------------------------------------|  i   |  A  |    to   |  O   |
1137                    I/O                 |  r   |  M  |   0x3f  |  M   |
1137                          I/O                 |  r   |  M  |   0x3f  |  M   |
113811380x2000  --------------------------------------|  r   |     |  mirror |      |
1139                Low RAM (from 0x7e)        |  o   |     |         |      |
1140                                   |  r   |     |         |      |
1139                   Low RAM (from 0x7e)        |  o   |     |         |      |
1140                                              |  r   |     |         |      |
114111410x0000  ---------------------------------------------------------------------
11421142
11431143
r3373r3374
11471147     banks 0x00      0x20      0x3e       0x40    0x7e  0x80      0xb0     0xc0    0xff
11481148address               |         |          |       |     |         |        |       |
114911490xffff  ----------------------------------------------------------------------------|
1150             mirror         |   Last   |       |     |       ROM        |       |
1151           upper half ROM    | 0.5Mbits |       |     |      mirror      |       |
1152          from 0x40 to 0x7e  |   ROM    |  ROM  |     |      up half     |  ROM  |
1150                 mirror         |   Last   |       |     |       ROM        |       |
1151              upper half ROM    | 0.5Mbits |       |     |      mirror      |       |
1152             from 0x40 to 0x7e  |   ROM    |  ROM  |     |      up half     |  ROM  |
115311530x8000  -----------------------------------|       |     |------------------|       |
11541154             DSP /    |      Reserv        | next  |  W  | Reserv  |  SRAM  | first |
1155          Reserv    |                    |       |  R  |         |        |       |
1155            Reserv    |                    |       |  R  |         |        |       |
115611560x6000  -----------------------------------|  31   |  A  |------------------|  32   |
1157                 I/O                  | Mbits |  M  |        0x00      | Mbits |
1157                      I/O                  | Mbits |  M  |        0x00      | Mbits |
115811580x2000  -----------------------------------|       |     |         to       |       |
1159             Low RAM (from 0x7e)        |       |     |        0x3f      |       |
1160                                 |       |     |       mirror     |       |
1159                Low RAM (from 0x7e)        |       |     |        0x3f      |       |
1160                                           |       |     |       mirror     |       |
116111610x0000  -----------------------------------------------------------------------------
11621162
11631163
r3373r3374
12411241/* 0x600000 - 0x6fffff */
12421242READ8_HANDLER( snes_r_bank4 )
12431243{
1244   UINT8 value = 0xff;
1244   UINT8 value = 0;
12451245   UINT16 address = offset & 0xffff;
12461246
12471247   if (snes_cart.mode & 5)                     /* Mode 20 & 22 */
r3373r3374
13731373      }
13741374      else
13751375         logerror("Attempt to write to reserved address: %X\n", offset + 0x300000);
1376   }   
1376   }
13771377   /* some dsp1 games use these banks 0x30 to 0x3f at address 0x8000 */
13781378   else if ((snes_cart.mode == SNES_MODE_20) && has_dsp1)
13791379      DSP1_setDr(data);
r3373r3374
14301430      {
14311431         if (offset < 0x300000)
14321432            snes_w_bank1(machine, offset, data);
1433         else
1433         else
14341434            snes_w_bank2(machine, offset - 0x300000, data);
14351435      }
14361436      else   /* Mode 25 has SRAM not mirrored from lower banks */
r3373r3374
14391439         {
14401440            if (offset < 0x300000)
14411441               snes_w_bank1(machine, offset, data);
1442            else
1442            else
14431443               snes_w_bank2(machine, offset - 0x300000, data);
14441444         }
14451445         else if ((offset >= 0x300000) && (snes_cart.sram > 0))
r3373r3374
14491449            snes_ram[0xb06000 + (offset & mask)] = data;
14501450         }
14511451         else   /* Area in 0x6000-0x8000 && offset < 0x300000 is Reserved! */
1452            logerror("Attempt to write to reserved address: %X\n", offset + 0x800000);     
1452            logerror("Attempt to write to reserved address: %X\n", offset + 0x800000);
14531453      }
14541454   }
14551455   else
r3373r3374
14831483
14841484/*************************************
14851485
1486   Driver Init
1486    Driver Init
14871487
14881488*************************************/
14891489
r3373r3374
16431643   total_blocks = (memory_region_length(machine, "user3") / 0x8000);
16441644   read_blocks = 0;
16451645
1646   /* Loading all the data blocks from cart, we only partially cover banks 0x00 to 0x7f. Therefore, we
1647    * have to mirror the blocks until we reach the end. E.g. for a 11Mbits image (44 blocks), we proceed
1648    * as follows:
1649    * 11 Mbits = 8 Mbits (blocks 1->32) + 2 Mbits (blocks 33->40) + 1 Mbit (blocks 41->44).
1650    * Hence, we fill memory up to 16 Mbits (banks 0x00 to 0x3f) mirroring the final part:
1651    * 8 Mbits (blocks 1->32) + 2 Mbits (blocks 33->40) + 1 Mbit (blocks 41->44) + 1 Mbit (blocks 41->44)
1652    *   + 2 Mbits (blocks 33->40) + 1 Mbit (blocks 41->44) + 1 Mbit (blocks 41->44).
1653    * And we repeat the same blocks in the second half of the banks (banks 0x40 to 0x7f).
1654    * This is likely what happens in the real SNES as well, because the unit cannot be aware of the exact
1655    * size of data in the cart (procedure confirmed by byuu)
1656    */
1646   /* Loading all the data blocks from cart, we only partially cover banks 0x00 to 0x7f. Therefore, we
1647     * have to mirror the blocks until we reach the end. E.g. for a 11Mbits image (44 blocks), we proceed
1648     * as follows:
1649     * 11 Mbits = 8 Mbits (blocks 1->32) + 2 Mbits (blocks 33->40) + 1 Mbit (blocks 41->44).
1650     * Hence, we fill memory up to 16 Mbits (banks 0x00 to 0x3f) mirroring the final part:
1651     * 8 Mbits (blocks 1->32) + 2 Mbits (blocks 33->40) + 1 Mbit (blocks 41->44) + 1 Mbit (blocks 41->44)
1652     *   + 2 Mbits (blocks 33->40) + 1 Mbit (blocks 41->44) + 1 Mbit (blocks 41->44).
1653     * And we repeat the same blocks in the second half of the banks (banks 0x40 to 0x7f).
1654     * This is likely what happens in the real SNES as well, because the unit cannot be aware of the exact
1655     * size of data in the cart (procedure confirmed by byuu)
1656     */
16571657
1658   /* LoROM carts load data in banks 0x00 to 0x7f at address 0x8000 (actually up to 0x7d, because 0x7e and
1659    * 0x7f are overwritten by WRAM). Each block is also mirrored in banks 0x80 to 0xff (up to 0xff for real)
1660    */
1658   /* LoROM carts load data in banks 0x00 to 0x7f at address 0x8000 (actually up to 0x7d, because 0x7e and
1659     * 0x7f are overwritten by WRAM). Each block is also mirrored in banks 0x80 to 0xff (up to 0xff for real)
1660     */
16611661   while (read_blocks < 128 && read_blocks < total_blocks)
16621662   {
16631663      /* Loading data */
r3373r3374
17081708
17091709   /* See above for details about the way we fill banks 0x00 to 0x7f */
17101710
1711   /* HiROM carts load data in banks 0xc0 to 0xff. Each bank is fully mirrored in banks 0x40 to 0x7f
1712    * (actually up to 0x7d, because 0x7e and 0x7f are overwritten by WRAM). The top half (address
1713    * range 0x8000 - 0xffff) of each bank is also mirrored in banks 0x00 to 0x3f and 0x80 to 0xbf.
1714    */
1711   /* HiROM carts load data in banks 0xc0 to 0xff. Each bank is fully mirrored in banks 0x40 to 0x7f
1712     * (actually up to 0x7d, because 0x7e and 0x7f are overwritten by WRAM). The top half (address
1713     * range 0x8000 - 0xffff) of each bank is also mirrored in banks 0x00 to 0x3f and 0x80 to 0xbf.
1714     */
17151715   while (read_blocks < 64 && read_blocks < total_blocks)
17161716   {
17171717      /* Loading data */
r3373r3374
17501750
17511751/*************************************
17521752
1753   HDMA
1753    HDMA
17541754
17551755*************************************/
17561756
src/mame/machine/neocrypt.c
r3373r3374
12461246}
12471247
12481248
1249void kof2003h_decrypt_68k(running_machine *machine)
1250{
1251   static const UINT8 xor1[0x20] = { 0xc2, 0x4b, 0x74, 0xfd, 0x0b, 0x34, 0xeb, 0xd7, 0x10, 0x6d, 0xf9, 0xce, 0x5d, 0xd5, 0x61, 0x29, 0xf5, 0xbe, 0x0d, 0x82, 0x72, 0x45, 0x0f, 0x24, 0xb3, 0x34, 0x1b, 0x99, 0xea, 0x09, 0xf3, 0x03 };
1252   static const UINT8 xor2[0x20] = { 0x2b, 0x09, 0xd0, 0x7f, 0x51, 0x0b, 0x10, 0x4c, 0x5b, 0x07, 0x70, 0x9d, 0x3e, 0x0b, 0xb0, 0xb6, 0x54, 0x09, 0xe0, 0xcc, 0x3d, 0x0d, 0x80, 0x99, 0x87, 0x03, 0x90, 0x82, 0xfe, 0x04, 0x20, 0x18 };
1253   int i;
1254   int ofst;
1255   int rom_size = 0x900000;
1256   UINT8 *rom = memory_region( machine, "main" );
1257   UINT8 *buf = malloc_or_die( rom_size );
1258
1259   for (i = 0; i < 0x100000; i++)
1260   {
1261      rom[ 0x800000 + i ] ^= rom[ 0x100002 | BYTE_XOR_LE(i) ];
1262   }
1263   for( i = 0; i < 0x100000; i++)
1264   {
1265      rom[ i ] ^= xor1[ (BYTE_XOR_LE(i) % 0x20) ];
1266   }
1267   for( i = 0x100000; i < 0x800000; i++)
1268   {
1269      rom[ i ] ^= xor2[ (BYTE_XOR_LE(i) % 0x20) ];
1270   }
1271   for( i = 0x100000; i < 0x800000; i += 4)
1272   {
1273      UINT16 rom16;
1274      rom16 = rom[BYTE_XOR_LE(i+1)] | rom[BYTE_XOR_LE(i+2)]<<8;
1275      rom16 = BITSWAP16( rom16, 15, 14, 13, 12, 10, 11, 8, 9, 6, 7, 4, 5, 3, 2, 1, 0 );
1276      rom[BYTE_XOR_LE(i+1)] = rom16&0xff;
1277      rom[BYTE_XOR_LE(i+2)] = rom16>>8;
1278   }
1279   for( i = 0; i < 0x0100000 / 0x10000; i++ )
1280   {
1281      ofst = (i & 0xf0) + BITSWAP8((i & 0x0f), 7, 6, 5, 4, 1, 0, 3, 2);
1282      memcpy( &buf[ i * 0x10000 ], &rom[ ofst * 0x10000 ], 0x10000 );
1283   }
1284   for( i = 0x100000; i < 0x900000; i += 0x100)
1285   {
1286      ofst = (i & 0xf000ff) + ((i & 0x000f00) ^ 0x00400) + (BITSWAP8( ((i & 0x0ff000) >> 12), 6, 7, 4, 5, 0, 1, 2, 3 ) << 12);
1287      memcpy( &buf[ i ], &rom[ ofst ], 0x100 );
1288   }
1289   memcpy (&rom[0x000000], &buf[0x000000], 0x100000);
1290   memcpy (&rom[0x100000], &buf[0x800000], 0x100000);
1291   memcpy (&rom[0x200000], &buf[0x100000], 0x700000);
1292   free( buf );
1293}
1294
1295
12491296void kof2003biosdecode(running_machine *machine)
12501297{
12511298   static const UINT8 address[0x80]={
r3373r3374
14051452};
14061453
14071454
1408int m1_address_scramble_inv(int address, UINT16 key)
1409{
1410   int block;
1411   int aux;
1412
1413   const int p1[8][16] = {
1414      {8,4,5,6,15,14,12,3,7,13,2,10,9,11,1,0},
1415      {13,1,6,7,10,8,14,0,2,5,12,3,15,9,11,4},
1416      {9,7,10,3,8,11,1,5,0,15,4,13,14,12,2,6},
1417      {10,12,0,4,5,15,9,7,1,3,11,6,13,8,14,2},
1418      {14,0,13,5,9,12,2,10,6,8,7,15,11,1,4,3},
1419      {5,11,7,2,3,13,8,4,12,6,14,0,10,15,9,1},
1420      {11,6,15,10,14,1,4,13,3,9,0,8,12,2,7,5},
1421      {3,14,4,1,6,10,15,2,11,0,9,7,5,13,8,12},
1422   };
1423
1424   block = (address>>16)&7;
1425   aux = address&0xffff;
1426
1427   aux = BITSWAP16(aux, 14,13,10,9,7,5,3,1,15,12,11,8,6,4,2,0);
1428   aux ^= m1_address_8_15_xor[aux&0xff]<<8;
1429   aux ^= m1_address_0_7_xor[(aux>>8)&0xff];
1430   aux = BITSWAP16(aux,
1431      p1[block][15],p1[block][14],p1[block][13],p1[block][12],
1432      p1[block][11],p1[block][10],p1[block][9],p1[block][8],
1433      p1[block][7],p1[block][6],p1[block][5],p1[block][4],
1434      p1[block][3],p1[block][2],p1[block][1],p1[block][0]);
1435   aux ^= key;
1436
1437   return (block<<16)|aux;
1438}
1439
1440
14411455/* The CMC50 hardware does a checksum of the first 64kb of the M1 rom,
14421456   ,and uses this checksum as the basis of the key with which to decrypt
14431457   the rom */
src/mame/machine/mcr.c
r3373r3374
7272static emu_timer *ipu_watchdog_timer;
7373
7474
75
7675/*************************************
7776 *
7877 *  Function prototypes
r3373r3374
9291static void reload_count(int counter);
9392static TIMER_CALLBACK( counter_fired_callback );
9493static TIMER_CALLBACK( ipu_watchdog_reset );
95static WRITE8_HANDLER( ipu_break_changed );
94static WRITE8_DEVICE_HANDLER( ipu_break_changed );
9695
9796
9897
r3373r3374
188187 *
189188 *************************************/
190189
191static void ctc_interrupt(running_machine *machine, int state)
190static void ctc_interrupt(const device_config *device, int state)
192191{
193   cpunum_set_input_line(machine, 0, 0, state);
192   cputag_set_input_line(device->machine, "main", 0, state);
194193}
195194
196195
197static void ipu_ctc_interrupt(running_machine *machine, int state)
196static void ipu_ctc_interrupt(const device_config *device, int state)
198197{
199   cpunum_set_input_line(machine, 3, 0, state);
198   cputag_set_input_line(device->machine, "ipu", 0, state);
200199}
201200
202201
203const struct z80_irq_daisy_chain mcr_daisy_chain[] =
202const z80_daisy_chain mcr_daisy_chain[] =
204203{
205   { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti, 0 }, /* CTC number 0 */
206   { 0, 0, 0, 0, -1 }      /* end mark */
204   { Z80CTC, "ctc" },
205   { NULL }
207206};
208207
209208
210const struct z80_irq_daisy_chain mcr_ipu_daisy_chain[] =
209const z80_daisy_chain mcr_ipu_daisy_chain[] =
211210{
212   { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti, 1 }, /* CTC number 1 */
213   { z80pio_reset, z80pio_irq_state, z80pio_irq_ack, z80pio_irq_reti, 1 }, /* PIO number 1 */
214   { z80sio_reset, z80sio_irq_state, z80sio_irq_ack, z80sio_irq_reti, 0 }, /* SIO number 0 */
215   { z80pio_reset, z80pio_irq_state, z80pio_irq_ack, z80pio_irq_reti, 0 }, /* PIO number 0 */
216   { 0, 0, 0, 0, -1 }      /* end mark */
211   { Z80CTC, "ipu_ctc" },
212   { Z80PIO, "ipu_pio1" },
213   { Z80SIO, "ipu_sio" },
214   { Z80PIO, "ipu_pio0" },
215   { NULL }
217216};
218217
219218
220static z80ctc_interface ctc_intf =
219const z80ctc_interface mcr_ctc_intf =
221220{
221   "main",            /* clock from the main CPU */
222222   0,                 /* clock (filled in from the CPU 0 clock) */
223223   0,                 /* timer disables */
224224   ctc_interrupt,     /* interrupt handler */
225   z80ctc_0_trg1_w,   /* ZC/TO0 callback */
225   z80ctc_trg1_w,      /* ZC/TO0 callback */
226226   0,                 /* ZC/TO1 callback */
227227   0                  /* ZC/TO2 callback */
228228};
229229
230230
231static z80ctc_interface nflfoot_ctc_intf =
231const z80ctc_interface nflfoot_ctc_intf =
232232{
233   "ipu",            /* clock from the IPU cpu */
233234   0,                  /* clock (filled in from the CPU 3 clock) */
234235   0,                  /* timer disables */
235236   ipu_ctc_interrupt,  /* interrupt handler */
r3373r3374
239240};
240241
241242
242static const z80pio_interface nflfoot_pio_intf =
243const z80pio_interface nflfoot_pio_intf =
243244{
244245   ipu_ctc_interrupt,
245   0,
246   0
246   NULL,
247   NULL,
248   NULL,
249   NULL,
250   NULL,
251   NULL
247252};
248253
249254
250static z80sio_interface nflfoot_sio_intf =
255const z80sio_interface nflfoot_sio_intf =
251256{
257   "ipu",            /* clock from the IPU cpu */
252258   0,                  /* clock (filled in from the CPU 3 clock) */
253259   ipu_ctc_interrupt,   /* interrupt handler */
254260   0,               /* DTR changed handler */
r3373r3374
267273
268274MACHINE_START( mcr )
269275{
270   /* initialize the CTC */
271   ctc_intf.baseclock = cpunum_get_clock(0);
272   z80ctc_init(0, &ctc_intf);
273
274276   state_save_register_global(mcr_cocktail_flip);
275277}
276278
277279
278280MACHINE_START( nflfoot )
279281{
280   /* initialize the CTC */
281   ctc_intf.baseclock = cpunum_get_clock(0);
282   z80ctc_init(0, &ctc_intf);
283
284   nflfoot_ctc_intf.baseclock = cpunum_get_clock(3);
285   z80ctc_init(1, &nflfoot_ctc_intf);
286
287   z80pio_init(0, &nflfoot_pio_intf);
288   z80pio_init(1, &nflfoot_pio_intf);
289
290   nflfoot_sio_intf.baseclock = cpunum_get_clock(3);
291   z80sio_init(0, &nflfoot_sio_intf);
292
293282   /* allocate a timer for the IPU watchdog */
294283   ipu_watchdog_timer = timer_alloc(ipu_watchdog_reset, NULL);
295284}
r3373r3374
422411
423412INTERRUPT_GEN( mcr_interrupt )
424413{
414   const device_config *ctc = devtag_get_device(machine, Z80CTC, "ctc");
415
425416   /* CTC line 2 is connected to VBLANK, which is once every 1/2 frame */
426417   /* for the 30Hz interlaced display */
427   z80ctc_0_trg2_w(machine, 0, 1);
428   z80ctc_0_trg2_w(machine, 0, 0);
418   z80ctc_trg2_w(ctc, 0, 1);
419   z80ctc_trg2_w(ctc, 0, 0);
429420
430421   /* CTC line 3 is connected to 493, which is signalled once every */
431422   /* frame at 30Hz */
432423   if (cpu_getiloops() == 0)
433424   {
434      z80ctc_0_trg3_w(machine, 0, 1);
435      z80ctc_0_trg3_w(machine, 0, 0);
425      z80ctc_trg3_w(ctc, 0, 1);
426      z80ctc_trg3_w(ctc, 0, 0);
436427   }
437428}
438429
439430
440431INTERRUPT_GEN( mcr_ipu_interrupt )
441432{
433   const device_config *ctc = devtag_get_device(machine, Z80CTC, "ipu_ctc");
434
442435   /* CTC line 3 is connected to 493, which is signalled once every */
443436   /* frame at 30Hz */
444437   if (cpu_getiloops() == 0)
445438   {
446      z80ctc_1_trg3_w(machine, 0, 1);
447      z80ctc_1_trg3_w(machine, 0, 0);
439      z80ctc_trg3_w(ctc, 0, 1);
440      z80ctc_trg3_w(ctc, 0, 0);
448441   }
449442}
450443
r3373r3374
922915 *
923916 *************************************/
924917
925static WRITE8_HANDLER( ipu_break_changed )
918static WRITE8_DEVICE_HANDLER( ipu_break_changed )
926919{
927920   /* channel B is connected to the CED player */
928921   if (offset == 1)
929922   {
930923      logerror("DTR changed -> %d\n", data);
931924      if (data == 1)
932         z80sio_receive_data(0, 1, 0);
925         z80sio_receive_data(device, 1, 0);
933926   }
934927}
935928
936929
937READ8_HANDLER( mcr_ipu_pio_0_r )
930READ8_DEVICE_HANDLER( mcr_ipu_sio_r )
938931{
939   return (offset & 2) ? z80pio_c_r(0, offset & 1) : z80pio_d_r(machine, 0, offset & 1);
932   return (offset & 2) ? z80sio_c_r(device, offset & 1) : z80sio_d_r(device, offset & 1);
940933}
941934
942935
943READ8_HANDLER( mcr_ipu_pio_1_r )
936WRITE8_DEVICE_HANDLER( mcr_ipu_sio_w )
944937{
945   return (offset & 2) ? z80pio_c_r(1, offset & 1) : z80pio_d_r(machine, 1, offset & 1);
946}
947
948
949READ8_HANDLER( mcr_ipu_sio_r )
950{
951   return (offset & 2) ? z80sio_c_r(0, offset & 1) : z80sio_d_r(machine, 0, offset & 1);
952}
953
954
955WRITE8_HANDLER( mcr_ipu_pio_0_w )
956{
957938   if (offset & 2)
958      z80pio_c_w(machine, 0, offset & 1, data);
939      z80sio_c_w(device, offset & 1, data);
959940   else
960      z80pio_d_w(machine, 0, offset & 1, data);
941      z80sio_d_w(device, offset & 1, data);
961942}
962943
963944
964WRITE8_HANDLER( mcr_ipu_pio_1_w )
965{
966   if (offset & 2)
967      z80pio_c_w(machine, 1, offset & 1, data);
968   else
969      z80pio_d_w(machine, 1, offset & 1, data);
970}
971
972
973WRITE8_HANDLER( mcr_ipu_sio_w )
974{
975   if (offset & 2)
976      z80sio_c_w(machine, 0, offset & 1, data);
977   else
978      z80sio_d_w(machine, 0, offset & 1, data);
979}
980
981
982945WRITE8_HANDLER( mcr_ipu_laserdisk_w )
983946{
984947   /* bit 3 enables (1) LD video regardless of PIX SW */
r3373r3374
993956static TIMER_CALLBACK( ipu_watchdog_reset )
994957{
995958   logerror("ipu_watchdog_reset\n");
996   cpunum_set_input_line(machine, 3, INPUT_LINE_RESET, PULSE_LINE);
997   z80ctc_reset(1);
998   z80pio_reset(0);
999   z80pio_reset(1);
1000   z80sio_reset(0);
959   cputag_set_input_line(machine, "ipu", INPUT_LINE_RESET, PULSE_LINE);
960   devtag_reset(machine, Z80CTC, "ipu_ctc");
961   devtag_reset(machine, Z80PIO, "ipu_pio0");
962   devtag_reset(machine, Z80PIO, "ipu_pio1");
963   devtag_reset(machine, Z80SIO, "ipu_sio");
1001964}
1002965
1003966
src/mame/machine/cps2crpt.c
r3373r3374
888888   { "batcira",  { 0x1e5d80cb,0x98882ec7 }, 0x200000 },   // 0C81 0097 0131  cmpi.l  #$00970131,D1
889889   { "batcirj",  { 0x00ff4dd8,0x000008e8 }, 0x200000 },   // 0C81 0097 0131  cmpi.l  #$00970131,D1
890890   { "csclub",   { 0x662e9fa0,0x4210e7c1 }, 0x200000 },   // 0C81 0097 0310  cmpi.l  #$00970310,D1
891   { "csclub1",  { 0x662e9fa0,0x4210e7c1 }, 0x200000 },   // 0C81 0097 0310  cmpi.l  #$00970310,D1
891892   { "cscluba",  { 0x1366de2a,0x9ab42937 }, 0x200000 },   // 0C81 0097 0310  cmpi.l  #$00970310,D1
892893   { "csclubj",  { 0x4a2d0be5,0x56c013c0 }, 0x200000 },   // 0C81 0097 0310  cmpi.l  #$00970310,D1
893894   { "csclubh",  { 0xf014a8a7,0x2e7794d0 }, 0x200000 },   // 0C81 0097 0310  cmpi.l  #$00970310,D1
src/mame/mamedriv.c
r3373r3374
869869   DRIVER( finfrl2j )   /* (c) 1999 */
870870
871871   /* Misc Namco games */
872   DRIVER( 20pacgal )   /* (c) 2000 */
872   DRIVER( 20pacgal )   /* (c) 2000 Ver 1.04 */
873   DRIVER( 20pacgaa )   /* (c) 2000 Ver 1.01 */
873874
874875   /* Universal games */
875876   DRIVER( cosmicg )   /* 7907 (c) 1979 */
r3373r3374
26812682   DRIVER( mshvsfa1 )   /* 20/06/1997 (c) 1997 (Asia) */
26822683   DRIVER( mshvsfb )   /* 27/08/1997 (c) 1997 (Brazil) */
26832684   DRIVER( mshvsfb1 )   /* 25/06/1997 (c) 1997 (Brazil) */
2684   DRIVER( csclub )   /* 22/07/1997 (c) 1997 (Euro) */
2685   DRIVER( csclub )   /* 17/10/1997 (c) 1997 (Euro) */
2686   DRIVER( csclub1 )   /* 22/07/1997 (c) 1997 (Euro) */
26852687   DRIVER( csclubj )   /* 22/07/1997 (c) 1997 (Japan) */
26862688   DRIVER( cscluba )   /* 22/07/1997 (c) 1997 (Asia) */
26872689   DRIVER( csclubh )   /* 22/07/1997 (c) 1997 (Hispanic) */
r3373r3374
56685670   DRIVER( pbobblen )   /* 0083 (c) 1994 Taito */
56695671   DRIVER( pbobblna )   /* 0083 (c) 1994 Taito */
56705672   DRIVER( kof95 )      /* 0084 (c) 1995 SNK */
5671   DRIVER( kof95a )   /* 0084 (c) 1995 SNK */
5673   DRIVER( kof95h )   /* 0084 (c) 1995 SNK */
56725674            /* 0085 Shinsetsu Samurai Spirits Bushidoretsuden / Samurai Shodown RPG (CD only) */
56735675   DRIVER( tws96 )      /* 0086 (c) 1996 Tecmo */
56745676   DRIVER( samsho3 )   /* 0087 (c) 1995 SNK */
5675   DRIVER( samsho3a )   /* 0087 (c) 1995 SNK */
5677   DRIVER( samsho3h )   /* 0087 (c) 1995 SNK */
56765678   DRIVER( fswords )   /* Korean hack of samsho3 */
56775679   DRIVER( stakwin )   /* 0088 (c) 1995 Saurus */
56785680   DRIVER( pulstar )   /* 0089 (c) 1995 Aicom */
r3373r3374
58105812   DRIVER( samsho5b )   /* bootleg */
58115813   DRIVER( kf2k3pcb )   /* 0271 (c) 2003 Playmore - JAMMA PCB */
58125814   DRIVER( kof2003 )   /* 0271 (c) 2003 Playmore */
5815   DRIVER( kof2003h )   /* 0271 (c) 2003 Playmore */
58135816   DRIVER( kf2k3bl )   /* bootleg */
58145817   DRIVER( kf2k3bla )   /* bootleg */
58155818   DRIVER( kf2k3pl )   /* bootleg */
src/mame/includes/turbo.h
r3373r3374
7171MACHINE_DRIVER_EXTERN( subroc3d_samples );
7272MACHINE_DRIVER_EXTERN( buckrog_samples );
7373
74WRITE8_HANDLER( turbo_sound_a_w );
75WRITE8_HANDLER( turbo_sound_b_w );
76WRITE8_HANDLER( turbo_sound_c_w );
74WRITE8_DEVICE_HANDLER( turbo_sound_a_w );
75WRITE8_DEVICE_HANDLER( turbo_sound_b_w );
76WRITE8_DEVICE_HANDLER( turbo_sound_c_w );
7777
78WRITE8_HANDLER( subroc3d_sound_a_w );
79WRITE8_HANDLER( subroc3d_sound_b_w );
80WRITE8_HANDLER( subroc3d_sound_c_w );
78WRITE8_DEVICE_HANDLER( subroc3d_sound_a_w );
79WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w );
80WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w );
8181
82WRITE8_HANDLER( buckrog_sound_a_w );
83WRITE8_HANDLER( buckrog_sound_b_w );
82WRITE8_DEVICE_HANDLER( buckrog_sound_a_w );
83WRITE8_DEVICE_HANDLER( buckrog_sound_b_w );
8484
8585
8686/*----------- defined in video/turbo.c -----------*/
src/mame/includes/zaxxon.h
r3373r3374
66
77/*----------- defined in audio/zaxxon.c -----------*/
88
9WRITE8_HANDLER( zaxxon_sound_a_w );
10WRITE8_HANDLER( zaxxon_sound_b_w );
11WRITE8_HANDLER( zaxxon_sound_c_w );
9WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w );
10WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w );
11WRITE8_DEVICE_HANDLER( zaxxon_sound_c_w );
1212
13WRITE8_HANDLER( congo_sound_b_w );
14WRITE8_HANDLER( congo_sound_c_w );
13WRITE8_DEVICE_HANDLER( congo_sound_b_w );
14WRITE8_DEVICE_HANDLER( congo_sound_c_w );
1515
1616MACHINE_DRIVER_EXTERN( zaxxon_samples );
1717MACHINE_DRIVER_EXTERN( congo_samples );
src/mame/includes/neogeo.h
r3373r3374
6161void kf2k3pcb_decrypt_68k(running_machine *machine);
6262void kf2k3pcb_decrypt_s1data(running_machine *machine);
6363void kof2003_decrypt_68k(running_machine *machine);
64void kof2003h_decrypt_68k(running_machine *machine);
6465void kof2003biosdecode(running_machine *machine);
6566void samsh5p_decrypt_68k(running_machine *machine);
6667
r3373r3374
117118void kof2k3up_install_protection(running_machine *machine);
118119void kf2k3pl_install_protection(running_machine *machine);
119120void samsh5bl_px_decrypt(running_machine *machine);
121void samsh5bl_vx_decrypt(running_machine *machine);
120122
121123
122124/*----------- defined in video/neogeo.c -----------*/
src/mame/includes/segag80r.h
r3373r3374
2020
2121WRITE8_HANDLER( astrob_sound_w );
2222
23WRITE8_HANDLER( sega005_sound_a_w );
24WRITE8_HANDLER( sega005_sound_b_w );
25
2623WRITE8_HANDLER( spaceod_sound_w );
2724
2825
src/mame/includes/mcr.h
r3373r3374
55**************************************************************************/
66
77#include "cpu/z80/z80daisy.h"
8#include "machine/z80ctc.h"
9#include "machine/z80pio.h"
10#include "machine/z80sio.h"
811
912/* constants */
1013#define MAIN_OSC_MCR_I      XTAL_19_968MHz
r3373r3374
1215
1316/*----------- defined in drivers/mcr.c -----------*/
1417
15WRITE8_HANDLER( mcr_ipu_sio_transmit );
18WRITE8_DEVICE_HANDLER( mcr_ipu_sio_transmit );
1619
1720
1821
r3373r3374
2023
2124extern attotime mcr68_timing_factor;
2225
23extern const struct z80_irq_daisy_chain mcr_daisy_chain[];
24extern const struct z80_irq_daisy_chain mcr_ipu_daisy_chain[];
26extern const z80_daisy_chain mcr_daisy_chain[];
27extern const z80_daisy_chain mcr_ipu_daisy_chain[];
28extern const z80ctc_interface mcr_ctc_intf;
29extern const z80ctc_interface nflfoot_ctc_intf;
30extern const z80pio_interface nflfoot_pio_intf;
31extern const z80sio_interface nflfoot_sio_intf;
2532extern UINT8 mcr_cocktail_flip;
2633
2734extern const gfx_layout mcr_bg_layout;
r3373r3374
5259READ16_HANDLER( mcr68_6840_upper_r );
5360READ16_HANDLER( mcr68_6840_lower_r );
5461
55READ8_HANDLER( mcr_ipu_pio_0_r );
56READ8_HANDLER( mcr_ipu_pio_1_r );
57READ8_HANDLER( mcr_ipu_sio_r );
58WRITE8_HANDLER( mcr_ipu_pio_0_w );
59WRITE8_HANDLER( mcr_ipu_pio_1_w );
60WRITE8_HANDLER( mcr_ipu_sio_w );
62READ8_DEVICE_HANDLER( mcr_ipu_sio_r );
63WRITE8_DEVICE_HANDLER( mcr_ipu_sio_w );
6164WRITE8_HANDLER( mcr_ipu_laserdisk_w );
6265READ8_HANDLER( mcr_ipu_watchdog_r );
6366WRITE8_HANDLER( mcr_ipu_watchdog_w );
src/mame/includes/galaxold.h
r3373r3374
146146
147147/*----------- defined in machine/scramble.c -----------*/
148148
149extern const ppi8255_interface scramble_ppi_ppi8255_intf[2];
150extern const ppi8255_interface stratgyx_ppi8255_intf[2];
151extern const ppi8255_interface darkplnt_ppi8255_intf[2];
152extern const ppi8255_interface scramble_ppi8255_intf[2];
153extern const ppi8255_interface ckongs_ppi8255_intf[2];
154extern const ppi8255_interface mars_ppi8255_intf[2];
155extern const ppi8255_interface mrkougar_ppi8255_intf[2];
149extern const ppi8255_interface scramble_ppi_0_intf;
150extern const ppi8255_interface scramble_ppi_1_intf;
151extern const ppi8255_interface stratgyx_ppi_1_intf;
152extern const ppi8255_interface scramble_protection_ppi_1_intf;
153extern const ppi8255_interface mrkougar_ppi_1_intf;
156154
157155
158156DRIVER_INIT( scramble_ppi );
r3373r3374
195193READ8_HANDLER( hunchbks_mirror_r );
196194WRITE8_HANDLER( hunchbks_mirror_w );
197195
196CUSTOM_INPUT( darkplnt_custom_r );
198197
198
199199/*----------- defined in audio/scramble.c -----------*/
200200
201201void scramble_sh_init(void);
r3373r3374
209209
210210READ8_HANDLER( hotshock_soundlatch_r );
211211
212WRITE8_HANDLER( scramble_sh_irqtrigger_w );
212WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w );
213213WRITE8_HANDLER( sfx_sh_irqtrigger_w );
214WRITE8_HANDLER( mrkougar_sh_irqtrigger_w );
214WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w );
215215WRITE8_HANDLER( froggrmc_sh_irqtrigger_w );
216216WRITE8_HANDLER( hotshock_sh_irqtrigger_w );
217217
src/mame/video/itech32.c
r3373r3374
271271      double intensity = (double)(data & 0xff) / (double)0x60;
272272      int i;
273273      for (i = 0; i < 8192; i++)
274         palette_set_brightness(machine, i, intensity);
274         palette_set_pen_contrast(machine, i, intensity);
275275   }
276276}
277277
src/mame/video/kaneko16.c
r3373r3374
290290
291291VIDEO_START( galsnew )
292292{
293   VIDEO_START_CALL(kaneko16_1xVIEW2);
293   VIDEO_START_CALL(kaneko16_sprites);
294
295   kaneko16_tmap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
296                               16,16, 0x20,0x20   );
297   kaneko16_tmap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
298                               16,16, 0x20,0x20   );
299
300   kaneko16_tmap_2 = 0;
301
302   kaneko16_tmap_3 = 0;
303
304   sprites_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
305
306   {
307      int dx = 0x5b, dy = 8;
308
309      int xdim = video_screen_get_width(machine->primary_screen);
310      int ydim = video_screen_get_height(machine->primary_screen);
311
312      tilemap_set_scrolldx( kaneko16_tmap_0, -dx,      xdim + dx -1        );
313      tilemap_set_scrolldx( kaneko16_tmap_1, -(dx+2),   xdim + (dx + 2) - 1 );
314
315      tilemap_set_scrolldy( kaneko16_tmap_0, -dy,      ydim + dy -1 );
316      tilemap_set_scrolldy( kaneko16_tmap_1, -dy,      ydim + dy -1 );
317
318      tilemap_set_transparent_pen(kaneko16_tmap_0, 0);
319      tilemap_set_transparent_pen(kaneko16_tmap_1, 0);
320
321      tilemap_set_scroll_rows(kaneko16_tmap_0, 0x200);   // Line Scroll
322      tilemap_set_scroll_rows(kaneko16_tmap_1, 0x200);
323   }
294324}
295325
296326/***************************************************************************
src/mame/video/tmnt.c
r3373r3374
756756
757757      // dim all colors before it
758758      for (i=0; i<cb; i++)
759         palette_set_brightness(screen->machine,i,brt);
759         palette_set_pen_contrast(screen->machine,i,brt);
760760
761761      // reset all colors in range
762762      for (i=cb; i<ce; i++)
763         palette_set_brightness(screen->machine,i,1.0);
763         palette_set_pen_contrast(screen->machine,i,1.0);
764764
765765      // dim all colors after it
766766      for (i=ce; i<2048; i++)
767         palette_set_brightness(screen->machine,i,brt);
767         palette_set_pen_contrast(screen->machine,i,brt);
768768
769769      // toggle shadow/highlight
770770      if (~dim_c & 0x10)
src/mame/video/toobin.c
r3373r3374
129129
130130      palette_set_color(machine, offset & 0x3ff, MAKE_RGB(red, green, blue));
131131      if (!(newword & 0x8000))
132         palette_set_brightness(machine, offset & 0x3ff, brightness);
132         palette_set_pen_contrast(machine, offset & 0x3ff, brightness);
133133      else
134         palette_set_brightness(machine, offset & 0x3ff, 1.0);
134         palette_set_pen_contrast(machine, offset & 0x3ff, 1.0);
135135   }
136136}
137137
r3373r3374
146146
147147      for (i = 0; i < 0x400; i++)
148148         if (!(paletteram16[i] & 0x8000))
149            palette_set_brightness(machine, i, brightness);
149            palette_set_pen_contrast(machine, i, brightness);
150150   }
151151}
152152
src/mame/video/gottlieb.c
r3373r3374
1616
1717static UINT8 background_priority = 0;
1818static UINT8 spritebank;
19static UINT8 transparent0;
1920
2021static tilemap *bg_tilemap;
2122static double weights[4];
r3373r3374
2930
3031WRITE8_HANDLER( gottlieb_paletteram_w )
3132{
32   int r, g, b, val;
33   int r, g, b, a, val;
3334
3435   paletteram[offset] = data;
3536
r3373r3374
4243   val = paletteram[offset | 1];
4344   r = combine_4_weights(weights, (val >> 0) & 1, (val >> 1) & 1, (val >> 2) & 1, (val >> 3) & 1);
4445
45   palette_set_color(machine, offset / 2, MAKE_ARGB(((offset & ~1) == 0) ? 0x00 : 0xff, r, g, b));
46   /* alpha is set to 0 if laserdisc video is enabled */
47   a = (transparent0 && offset / 2 == 0) ? 0 : 255;
48   palette_set_color(machine, offset / 2, MAKE_ARGB(a, r, g, b));
4649}
4750
4851
r3373r3374
9497   laserdisc_overlay_enable(laserdisc, (data & 0x04) ? TRUE : FALSE);
9598   laserdisc_video_enable(laserdisc, ((data & 0x0c) == 0x0c) ? TRUE : FALSE);
9699
97   render_container_set_palette_alpha(render_container_get_screen(machine->primary_screen), 0, (data & 0x08) ? 0x00 : 0xff);
100   /* configure the palette if the laserdisc is enabled */
101   transparent0 = (data >> 3) & 1;
102   gottlieb_paletteram_w(machine, 0, paletteram[0]);
98103}
99104
100105
r3373r3374
151156         4, resistances, weights, 180, 0,
152157         4, resistances, weights, 180, 0,
153158         4, resistances, weights, 180, 0);
159   transparent0 = FALSE;
154160
155161   /* configure the background tilemap */
156162   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
r3373r3374
160166   /* save some state */
161167   state_save_register_global(background_priority);
162168   state_save_register_global(spritebank);
169   state_save_register_global(transparent0);
163170}
164171
165172
src/mame/video/taito_f3.c
r3373r3374
198198Playfield tile info:
199199    0xc000 0000 - X/Y Flip
200200    0x3000 ffff - Tile index
201    0x0dff 0000 - Colour (top 2 bits use not clear, always set)
201    0x0c00 0000 - Extra planes enable (00 = 4bpp, 01 = 5bpp, 10 = unused?, 11 = 6bpp)
202202    0x0200 0000 - Alpha blend mode
203    0x01ff 0000 - Colour
203204
204205***************************************************************************/
205206
r3373r3374
219220static UINT32 f3_control_0[8];
220221static UINT32 f3_control_1[8];
221222static int flipscreen;
223static UINT8 sprite_extra_planes;
224static UINT8 sprite_pen_mask;
222225
223226static UINT8 *pivot_dirty;
224227
r3373r3374
236239   int name;
237240   int extend;
238241   int sprite_lag;
239   int sprite_bpp;
240   int tile_bpp;
241242};
242243
243244static const struct F3config *f3_game_config;
244245
245246static const struct F3config f3_config_table[] =
246247{
247   /* Name    Extend  Lag   Bpp */
248   { RINGRAGE,  0,     2,   4, 4 },
249   { ARABIANM,  0,     2,   5, 5 },   /* sprites 1200-120F contain 6bpp pixels but this seems to be a data error */
250   { RIDINGF,   1,     1,   4, 4 },
251   { GSEEKER,   0,     1,   4, 4 },
252   { COMMANDW,  1,     1,   5, 5 },
253   { SCFINALS,  0,     1,   5, 5 },
254   { TRSTAR,    1,     0,   5, 5 },
255   { GUNLOCK,   1,     2,   5, 5 },
256   { LIGHTBR,   1,     2,   5, 5 },
257   { KAISERKN,  0,     2,   5, 5 },
258   { DARIUSG,   0,     2,   5, 5 },
259   { BUBSYMPH,  1,     1,   5, 5 },
260   { SPCINVDX,  1,     1,   4, 4 },
261   { HTHERO95,  0,     1,   6, 6 },
262   { QTHEATER,  1,     1,   4, 4 },
263   { EACTION2,  1,     2,   5, 5 },
264   { RECALH,    1,     1,   4, 4 },
265   { SPCINV95,  0,     1,   5, 5 },
266   { TWINQIX,   1,     1,   4, 6 },
267   { QUIZHUHU,  1,     1,   6, 6 },
268   { PBOBBLE2,  0,     1,   4, 6 },
269   { GEKIRIDO,  0,     1,   5, 5 },
270   { KTIGER2,   0,     0,   4, 4 },
271   { BUBBLEM,   1,     1,   4, 5 },
272   { CLEOPATR,  0,     1,   4, 6 },
273   { PBOBBLE3,  0,     1,   4, 4 },
274   { ARKRETRN,  1,     1,   5, 6 },
275   { KIRAMEKI,  0,     1,   5, 6 },
276   { PUCHICAR,  1,     1,   5, 6 },
277   { PBOBBLE4,  0,     1,   4, 4 },
278   { POPNPOP,   1,     1,   6, 6 },
279   { LANDMAKR,  1,     1,   5, 6 },
248   /* Name    Extend  Lag */
249   { RINGRAGE,  0,     2 },
250   { ARABIANM,  0,     2 },
251   { RIDINGF,   1,     1 },
252   { GSEEKER,   0,     1 },
253   { COMMANDW,  1,     1 },
254   { SCFINALS,  0,     1 },
255   { TRSTAR,    1,     0 },
256   { GUNLOCK,   1,     2 },
257   { LIGHTBR,   1,     2 },
258   { KAISERKN,  0,     2 },
259   { DARIUSG,   0,     2 },
260   { BUBSYMPH,  1,     1 },
261   { SPCINVDX,  1,     1 },
262   { HTHERO95,  0,     1 },
263   { QTHEATER,  1,     1 },
264   { EACTION2,  1,     2 },
265   { RECALH,    1,     1 },
266   { SPCINV95,  0,     1 },
267   { TWINQIX,   1,     1 },
268   { QUIZHUHU,  1,     1 },
269   { PBOBBLE2,  0,     1 },
270   { GEKIRIDO,  0,     1 },
271   { KTIGER2,   0,     0 },
272   { BUBBLEM,   1,     1 },
273   { CLEOPATR,  0,     1 },
274   { PBOBBLE3,  0,     1 },
275   { ARKRETRN,  1,     1 },
276   { KIRAMEKI,  0,     1 },
277   { PUCHICAR,  1,     1 },
278   { PBOBBLE4,  0,     1 },
279   { POPNPOP,   1,     1 },
280   { LANDMAKR,  1,     1 },
280281   {0}
281282};
282283
r3373r3374
491492INLINE void get_tile_info(running_machine *machine, tile_data *tileinfo, int tile_index, UINT32 *gfx_base)
492493{
493494   UINT32 tile=gfx_base[tile_index];
494   UINT8 abtype=(tile>>(16+9))&0x1f;
495   int color_mask;
496
495   UINT8 abtype=(tile>>(16+9)) & 1;
496   // tiles can be configured to use 4, 5, or 6 bpp data.
497497   // if tiles use more than 4bpp, the bottom bits of the color code must be masked out.
498498   // This fixes (at least) the rain in round 6 of Arabian Magic.
499   color_mask = ~((1 << (f3_game_config->tile_bpp - 4)) - 1);
499   UINT8 extra_planes = ((tile>>(16+10)) & 3);   // 0 = 4bpp, 1 = 5bpp, 2 = unused?, 3 = 6bpp
500500
501501   SET_TILE_INFO(
502502         1,
503503         tile&0xffff,
504         (tile>>16) & 0x1ff & color_mask,
504         (tile>>16) & 0x1ff & (~extra_planes),
505505         TILE_FLIPYX( tile >> 30 ));
506506   tileinfo->category =  abtype&1;      /* alpha blending type */
507   tileinfo->pen_mask = (extra_planes << 4) | 0x0f;
507508}
508509
509510static TILE_GET_INFO( get_tile_info1 )
r3373r3374
695696   machine->gfx[1]->color_granularity=16;
696697   machine->gfx[2]->color_granularity=16;
697698
698   assert(f3_game_config->tile_bpp >= 4 && f3_game_config->tile_bpp <= 6);
699   assert(f3_game_config->sprite_bpp >= 4 && f3_game_config->sprite_bpp <= 6);
700
701699   flipscreen = 0;
702700   memset(spriteram32_buffered,0,spriteram_size);
703701   memset(spriteram32,0,spriteram_size);
r3373r3374
719717   {
720718      const gfx_element *sprite_gfx = machine->gfx[2];
721719      int c;
722      int bpp_mask = (1 << f3_game_config->sprite_bpp) - 1;
723720
724721      for (c = 0;c < sprite_gfx->total_elements;c++)
725722      {
r3373r3374
730727         {
731728            for (x = 0;x < sprite_gfx->width;x++)
732729            {
733               // clear unused top bits from gfx data
734               dp[x] &= bpp_mask;
735
736730               if(!dp[x]) chk_trans_or_opa|=2;
737731               else      chk_trans_or_opa|=1;
738732            }
r3373r3374
747741   {
748742      const gfx_element *pf_gfx = machine->gfx[1];
749743      int c;
750      int bpp_mask = (1 << f3_game_config->tile_bpp) - 1;
751744
752745      for (c = 0;c < pf_gfx->total_elements;c++)
753746      {
r3373r3374
758751         {
759752            for (x = 0;x < pf_gfx->width;x++)
760753            {
761               // clear unused top bits from gfx data
762               dp[x] &= bpp_mask;
763
764754               if(!dp[x]) chk_trans_or_opa|=2;
765755               else      chk_trans_or_opa|=1;
766756            }
r3373r3374
26082598/******************************************************************************/
26092599
26102600#define PSET_T               \
2611   c = *source;            \
2601   c = *source & sprite_pen_mask;   \
26122602   if(c)                  \
26132603   {                     \
26142604      p=*pri;               \
r3373r3374
26232613   p=*pri;                  \
26242614   if(!p || p==0xff)         \
26252615   {                     \
2626      *dest = pal[*source];   \
2616      *dest = pal[*source & sprite_pen_mask];   \
26272617      *pri = pri_dst;         \
26282618   }
26292619
r3373r3374
29042894                  int x, x_index = x_index_base;
29052895                  for( x=sx; x<ex; x++ )
29062896                  {
2907                     int c = source[x_index>>16];
2897                     int c = source[x_index>>16] & sprite_pen_mask;
29082898                     if(c)
29092899                     {
29102900                        UINT8 p=pri[x];
r3373r3374
29822972                cntrl&0x0020 = ???
29832973            */
29842974
2975         sprite_extra_planes = (cntrl & 0x0300) >> 8;   // 0 = 4bpp, 1 = 5bpp, 2 = unused?, 3 = 6bpp
2976         sprite_pen_mask = (sprite_extra_planes << 4) | 0x0f;
2977
29852978         /* Sprite bank select */
29862979         if (cntrl&1) {
29872980            offs=offs|0x2000;
r3373r3374
32003193{
32013194   const struct tempsprite *sprite_ptr;
32023195   const gfx_element *sprite_gfx = machine->gfx[2];
3203   int color_mask;
32043196
32053197   sprite_ptr = sprite_end;
32063198   sprite_pri_usage=0;
32073199
32083200   // if sprites use more than 4bpp, the bottom bits of the color code must be masked out.
32093201   // This fixes (at least) stage 1 battle ships and attract mode explosions in Ray Force.
3210   color_mask = ~((1 << (f3_game_config->sprite_bpp - 4)) - 1);
32113202
32123203   while (sprite_ptr != spritelist)
32133204   {
r3373r3374
32213212         f3_drawgfx(machine,
32223213               bitmap,sprite_gfx,
32233214               sprite_ptr->code,
3224               sprite_ptr->color & color_mask,
3215               sprite_ptr->color & (~sprite_extra_planes),
32253216               sprite_ptr->flipx,sprite_ptr->flipy,
32263217               sprite_ptr->x,sprite_ptr->y,
32273218               cliprect,
r3373r3374
32303221         f3_drawgfxzoom(machine,
32313222               bitmap,sprite_gfx,
32323223               sprite_ptr->code,
3233               sprite_ptr->color & color_mask,
3224               sprite_ptr->color & (~sprite_extra_planes),
32343225               sprite_ptr->flipx,sprite_ptr->flipy,
32353226               sprite_ptr->x,sprite_ptr->y,
32363227               cliprect,
src/mame/drivers/expro02.c
r3373r3374
1/* Kaneko EXPRO-02 board
2  - used by the newer revisions of Gals Panic
1/*
32
3   Kaneko EXPRO-02 board
4
5  Used by the newer revisions of Gals Panic
6
47 Notes:
5 Tile GFX seem to be encrypted / scrambled?  I can't decode them
6 Dipswitches are wrong for these sets
8  - In gfx data banking function, some strange gfx are shown. Timing issue?
79
810
911Gals Panic
r3373r3374
136138#include "sound/okim6295.h"
137139
138140static INPUT_PORTS_START( galsnew )
139   PORT_START("DSW1/P1")
141   PORT_START("DSW1")
142   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
143   PORT_DIPSETTING(      0x0002, DEF_STR( Easy ) )
144   PORT_DIPSETTING(      0x0003, DEF_STR( Normal ) )
145   PORT_DIPSETTING(      0x0001, DEF_STR( Hard ) )
146   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
147   PORT_DIPNAME( 0x000C, 0x000C, DEF_STR( Lives ) )
148   PORT_DIPSETTING(      0x0004, "2" )
149   PORT_DIPSETTING(      0x000C, "3" )
150   PORT_DIPSETTING(      0x0008, "4" )
151   PORT_DIPSETTING(      0x0000, "5" )
152   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Demo_Sounds ) )
153   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
154   PORT_DIPSETTING(      0x0010, DEF_STR( On ) )
155   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
156   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
157   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
158   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
159   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
160   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
161   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
162   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
163   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
164
165   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1)
166   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1)
167   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1)
168   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1)
169   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
170   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
171   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
172   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
173
174   PORT_START("DSW2")
140175   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unused ) )
141176   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
142177   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
143   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )   /* flip screen? */
178   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) )   /* flip screen? */
144179   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
145180   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
146   PORT_SERVICE( 0x0004, IP_ACTIVE_LOW )
147   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
148   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
181   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Test ) )
182   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
149183   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
150   /* Coinage - World (0x03ffff.b = 03) */
151   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )
152   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
153   PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )
154   PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )
155   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )
156   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )
157   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )
158   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_3C ) )
159   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_4C ) )
160   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
184   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_A ) )
185   PORT_DIPSETTING(      0x0028, DEF_STR( 2C_1C ) )
186   PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
187   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_2C ) )
188   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
189   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_4C ) )
190   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_6C ) )
191   PORT_DIPNAME( 0x0040, 0x0040, "Coin B-1" )
192   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
193   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
194   PORT_DIPNAME( 0x0080, 0x0080, "Coin B-2" )
195   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
196   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
161197   /* Coinage - Japan (0x03ffff.b = 01) and US (0x03ffff.b = 02)
162198    PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )
163199    PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
r3373r3374
170206    PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
171207    PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )
172208    */
173   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1)
174   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1)
175   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1)
176   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1)
177   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
178   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)      /* "Shot2" in "test mode" */
209   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2)
210   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2)
211   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
212   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2)
213   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
214   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)   /* "Shot2" in "test mode" */
179215   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
180216   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
181217
182   PORT_START("DSW2/P2")
218   PORT_START("DSW3")
219   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
220   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
221   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
222   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 )
223   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 )
224   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
225   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_TILT )
226   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1 )
227   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
228INPUT_PORTS_END
229
230
231static INPUT_PORTS_START( galsnewa )
232   PORT_START("DSW1")
183233   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
184234   PORT_DIPSETTING(      0x0002, DEF_STR( Easy ) )
185235   PORT_DIPSETTING(      0x0003, DEF_STR( Normal ) )
186236   PORT_DIPSETTING(      0x0001, DEF_STR( Hard ) )
187237   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
188   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) )
189   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
190   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
191   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
192   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
193   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
238   PORT_BIT( 0x000C, IP_ACTIVE_LOW, IPT_UNUSED )
194239   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) )
195240   PORT_DIPSETTING(      0x0010, "2" )
196241   PORT_DIPSETTING(      0x0030, "3" )
197242   PORT_DIPSETTING(      0x0020, "4" )
198243   PORT_DIPSETTING(      0x0000, "5" )
199   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )   /* demo sounds? - see notes */
244   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Demo_Sounds ) )
245   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
246   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )
247   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )
248   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
249   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
250
251   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1)
252   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1)
253   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1)
254   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1)
255   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
256   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
257   PORT_BIT( 0xC000, IP_ACTIVE_LOW, IPT_UNUSED )
258
259   PORT_START("DSW2")
260   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
261   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) )   /* flip screen? */
262   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
263   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
264   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Test ) )
265   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
266   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
267   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_A ) )
268   PORT_DIPSETTING(      0x0028, DEF_STR( 2C_1C ) )
269   PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
270   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_2C ) )
271   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
272   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_4C ) )
273   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_6C ) )
274   PORT_DIPNAME( 0x0040, 0x0040, "Coin B-1" )
200275   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
201276   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
202   PORT_DIPNAME( 0x0080, 0x0080, "Character Test" )
277   PORT_DIPNAME( 0x0080, 0x0080, "Coin B-2" )
203278   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
204279   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
205
280   /* Coinage - Japan (0x03ffff.b = 01) and US (0x03ffff.b = 02)
281    PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )
282    PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
283    PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )
284    PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
285    PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )
286    PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )
287    PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )
288    PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )
289    PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) )
290    PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )
291    */
206292   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2)
207293   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2)
208294   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
209295   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2)
210296   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
211   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)      /* "Shot2" in "test mode" */
297   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)   /* "Shot2" in "test mode" */
212298   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
213299   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
214300
215   PORT_START("SYSTEM")
301   PORT_START("DSW3")
216302   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
217303   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
218304   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
r3373r3374
224310   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
225311INPUT_PORTS_END
226312
227
228313static WRITE16_HANDLER( galsnew_paletteram_w )
229314{
230315   data = COMBINE_DATA(&paletteram16[offset]);
r3373r3374
240325   }
241326}
242327
328static UINT16 vram_0_bank_num = 0, vram_1_bank_num = 0;
329
330WRITE16_HANDLER(galsnew_vram_0_bank_w)
331{
332   int i;
333   if(vram_0_bank_num != data)
334   {
335      for(i = 0; i < 0x1000 / 2; i += 2)
336      {
337         if(kaneko16_vram_0[i])
338         {
339            kaneko16_vram_0_w(machine, i+1, data << 8, 0xFF00);
340         }
341      }
342      vram_0_bank_num = data;
343   }
344}
345
346WRITE16_HANDLER(galsnew_vram_1_bank_w)
347{
348   int i;
349   if(vram_1_bank_num != data)
350   {
351      for(i = 0; i < 0x1000 / 2; i += 2)
352      {
353         if(kaneko16_vram_1[i])
354         {
355            kaneko16_vram_1_w(machine, i+1, data << 8, 0xFF00);
356         }
357      }
358      vram_1_bank_num = data;
359   }
360}
361
243362static ADDRESS_MAP_START( galsnew, ADDRESS_SPACE_PROGRAM, 16 )
244363   AM_RANGE(0x000000, 0x03ffff) AM_ROM // main program
245364   AM_RANGE(0x080000, 0x0fffff) AM_ROM AM_REGION("user2",0) // other data
r3373r3374
261380
262381   AM_RANGE(0x700000, 0x700fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)    // sprites? 0x72f words tested
263382
264   AM_RANGE(0x780000, 0x78001f) AM_READWRITE(SMH_RAM,kaneko16_sprites_regs_w) AM_BASE(&kaneko16_sprites_regs   ) // sprite regs? tileregs?
383   AM_RANGE(0x780000, 0x78001f) AM_READWRITE(SMH_RAM,kaneko16_sprites_regs_w) AM_BASE(&kaneko16_sprites_regs) // sprite regs? tileregs?
265384
266   AM_RANGE(0x800000, 0x800001) AM_READ_PORT("DSW1/P1")
267   AM_RANGE(0x800002, 0x800003) AM_READ_PORT("DSW2/P2")
268   AM_RANGE(0x800004, 0x800005) AM_READ_PORT("SYSTEM")
385   AM_RANGE(0x800000, 0x800001) AM_READ_PORT("DSW1")
386   AM_RANGE(0x800002, 0x800003) AM_READ_PORT("DSW2")
387   AM_RANGE(0x800004, 0x800005) AM_READ_PORT("DSW3")
269388
270389   AM_RANGE(0x900000, 0x900001) AM_WRITE(galsnew_6295_bankswitch_w)
271390
272   AM_RANGE(0xa00000, 0xa00001) AM_WRITE(SMH_NOP)   /* ??? */
391   AM_RANGE(0xa00000, 0xa00001) AM_WRITENOP   /* ??? */
273392
274393   AM_RANGE(0xc80000, 0xc8ffff) AM_RAM
275394
276   AM_RANGE(0xd80000, 0xd80001) AM_WRITE(SMH_NOP)   /* ??? */
395   AM_RANGE(0xd80000, 0xd80001) AM_WRITE(galsnew_vram_1_bank_w)   /* ??? */
277396
278397   AM_RANGE(0xe00000, 0xe00015) AM_READWRITE(galpanib_calc_r,galpanib_calc_w) /* CALC1 MCU interaction (simulated) */
279398
280   AM_RANGE(0xe80000, 0xe80001) AM_WRITE(SMH_NOP)   /* ??? */
399   AM_RANGE(0xe80000, 0xe80001) AM_WRITE(galsnew_vram_0_bank_w)   /* ??? */
281400ADDRESS_MAP_END
282401
283402
r3373r3374
314433
315434static GFXDECODE_START( 1x4bit_1x4bit )
316435   GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x4, 0x100,       0x40 ) // [0] Sprites
317   GFXDECODE_ENTRY( "gfx2", 0, layout_16x16x4, 0,         0x40 ) // [0] bg tiles
436   GFXDECODE_ENTRY( "gfx2", 0, layout_16x16x4, 0x400,      0x40 ) // [0] bg tiles
318437GFXDECODE_END
319438
320439static MACHINE_DRIVER_START( galsnew )
r3373r3374
354473MACHINE_DRIVER_END
355474
356475/* the tile roms seem lineswapped.. but I don't know how to descramble them yet */
357static DRIVER_INIT(galsnew)
476DRIVER_INIT(galsnew)
358477{
359   UINT8 *src    = memory_region       ( machine, "gfx3" );
360   UINT8 *dst    = memory_region       ( machine, "gfx2" );
361   int x;
478   UINT32 *src = (UINT32 *)memory_region(machine, "gfx3" );
479   UINT32 *dst = (UINT32 *)memory_region(machine, "gfx2" );
480   int x, source, offset,inv;
362481
363   for (x=0; x<0x200000;x++)
482   for (x=0; x<0x80000;x++)
364483   {
365      UINT32 y;
484      inv = ~x;
485      offset = x ^ (0xC30 | (inv >> 1 & 0x10200));
486      offset = (offset & ~0x07) | ((0x02 - (offset & 0x07)) & 0x07);
487      if(x&0x0010)
488         offset = (offset & ~0x60) | (((offset & 0x60) + 0x20) & 0x60);
489      if((x&((inv >> 1 & 0x10000) | 0x2000)) == 0x02000)
490         offset ^= 0x1000;
491      if(!(x&(0x1000 | (x >> 4 & 0x2000))))
492      {
493         offset ^= 0x100;
494         if(!(x&0x20000) && (x&0x12000) == 0x02000)
495         {
496            offset = (offset & ~0x180) | (((offset & 0x180) + 0x180) & 0x180);
497            if((x&0x180) == 0x100)
498            {
499               offset ^= 0x400;
500               if((x&0x480) == 0x400)
501                  offset ^= 0x200;
502            }
503         }
504      }
505      else
506      {
507         offset = (offset & ~0x180) | (((offset & 0x180) + 0x80) & 0x180);
508         if((x&0x180) == 0x100)
509         {
510            offset ^= 0x400;
511            if((x&0x480) == 0x400)
512               offset ^= 0x200;
513         }
514      }
515      if((x&0x7) < 0x03)
516      {
517         if(!(x&0x800))
518         {
519            offset ^= 0x4000;
520            if(x&0x4000)
521            {
522               offset ^= 0x08;
523               if(x&0x08)
524                  offset = (offset & ~0x70) | (((offset & 0x70) + 0x10) & 0x70);
525            }
526         }
527         offset ^= 0x800;
528      }
529      if((x & 0x30000) == 0x10000)
530         source = x;
531      else
532         source = x ^ 0x2000;
366533
367      y = BITSWAP24(x, 23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 );
368      y = x ^ 12;
369      dst[y] = src[x];
370
534      dst[source] = (src[offset] << 4 & 0xF0F0F0F0) | (src[offset] >> 4 & 0x0F0F0F0F);
371535   }
372
373536}
374537
375
376538ROM_START( galsnew ) /* EXPRO-02 PCB */
377539   ROM_REGION( 0x40000, "main", 0 )   /* 68000 code */
378540   ROM_LOAD16_BYTE( "pm110u_u87-01.u87", 0x000000, 0x20000, CRC(b793a57d) SHA1(12d57b2b4add532f0d0453c25b30d34b3449d717) ) /* US region */
r3373r3374
398560
399561   ROM_REGION( 0x200000, "gfx2", ROMREGION_DISPOSE )   /* sprites */
400562
401   ROM_REGION( 0x200000, "gfx3", ROMREGION_DISPOSE )   /* sprites - encrypted? */
402   ROM_LOAD( "pm013e.u89", 0x180000, 0x080000, CRC(10f27b05) SHA1(0f8ade713f6b430b5a23370a17326d53229951de) )
403   ROM_LOAD( "pm014e.u90", 0x100000, 0x080000, CRC(2f367106) SHA1(1cd16e286e77e8e1b7668bbb6f2978101656b720) )
404   ROM_LOAD( "pm015e.u91", 0x080000, 0x080000, CRC(a563f8ef) SHA1(6e4171746e4d401992bf3a7619d5bed0063d57e5) )
405   ROM_LOAD( "pm016e.u92", 0x000000, 0x080000, CRC(c0b9494c) SHA1(f0b066dd78eb9fcf947da90ddb6c7b62299c5743) )
563   ROM_REGION( 0x200000, "gfx3", ROMREGION_DISPOSE )   /* sprites - encrypted */
564   ROM_LOAD( "pm013e.u89", 0x000000, 0x080000, CRC(10f27b05) SHA1(0f8ade713f6b430b5a23370a17326d53229951de) )
565   ROM_LOAD( "pm014e.u90", 0x080000, 0x080000, CRC(2f367106) SHA1(1cd16e286e77e8e1b7668bbb6f2978101656b720) )
566   ROM_LOAD( "pm015e.u91", 0x100000, 0x080000, CRC(a563f8ef) SHA1(6e4171746e4d401992bf3a7619d5bed0063d57e5) )
567   ROM_LOAD( "pm016e.u92", 0x180000, 0x080000, CRC(c0b9494c) SHA1(f0b066dd78eb9fcf947da90ddb6c7b62299c5743) )
406568
407569
408570   ROM_REGION( 0x140000, "oki", 0 )   /* OKIM6295 samples */
r3373r3374
438600
439601   ROM_REGION( 0x200000, "gfx2", ROMREGION_DISPOSE )   /* sprites */
440602
441   ROM_REGION( 0x200000, "gfx3", ROMREGION_DISPOSE )   /* tiles - encrypted? */
442   ROM_LOAD( "pm013e.u89", 0x180000, 0x080000, CRC(10f27b05) SHA1(0f8ade713f6b430b5a23370a17326d53229951de) )
443   ROM_LOAD( "pm014e.u90", 0x100000, 0x080000, CRC(2f367106) SHA1(1cd16e286e77e8e1b7668bbb6f2978101656b720) )
444   ROM_LOAD( "pm015e.u91", 0x080000, 0x080000, CRC(a563f8ef) SHA1(6e4171746e4d401992bf3a7619d5bed0063d57e5) )
445   ROM_LOAD( "pm016e.u92", 0x000000, 0x080000, CRC(c0b9494c) SHA1(f0b066dd78eb9fcf947da90ddb6c7b62299c5743) )
603   ROM_REGION( 0x200000, "gfx3", ROMREGION_DISPOSE )   /* tiles - encrypted */
604   ROM_LOAD( "pm013e.u89", 0x000000, 0x080000, CRC(10f27b05) SHA1(0f8ade713f6b430b5a23370a17326d53229951de) )
605   ROM_LOAD( "pm014e.u90", 0x080000, 0x080000, CRC(2f367106) SHA1(1cd16e286e77e8e1b7668bbb6f2978101656b720) )
606   ROM_LOAD( "pm015e.u91", 0x100000, 0x080000, CRC(a563f8ef) SHA1(6e4171746e4d401992bf3a7619d5bed0063d57e5) )
607   ROM_LOAD( "pm016e.u92", 0x180000, 0x080000, CRC(c0b9494c) SHA1(f0b066dd78eb9fcf947da90ddb6c7b62299c5743) )
446608
447609   ROM_REGION( 0x140000, "oki", 0 )   /* OKIM6295 samples */
448610   /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */
r3373r3374
477639
478640   ROM_REGION( 0x200000, "gfx2", ROMREGION_DISPOSE )   /* sprites */
479641
480   ROM_REGION( 0x200000, "gfx3", ROMREGION_DISPOSE )   /* tiles - encrypted? */
481   ROM_LOAD( "pm013e.u89", 0x180000, 0x080000, CRC(10f27b05) SHA1(0f8ade713f6b430b5a23370a17326d53229951de) )
482   ROM_LOAD( "pm014e.u90", 0x100000, 0x080000, CRC(2f367106) SHA1(1cd16e286e77e8e1b7668bbb6f2978101656b720) )
483   ROM_LOAD( "pm015e.u91", 0x080000, 0x080000, CRC(a563f8ef) SHA1(6e4171746e4d401992bf3a7619d5bed0063d57e5) )
484   ROM_LOAD( "pm016e.u92", 0x000000, 0x080000, CRC(c0b9494c) SHA1(f0b066dd78eb9fcf947da90ddb6c7b62299c5743) )
642   ROM_REGION( 0x200000, "gfx3", ROMREGION_DISPOSE )   /* tiles - encrypted */
643   ROM_LOAD( "pm013e.u89", 0x000000, 0x080000, CRC(10f27b05) SHA1(0f8ade713f6b430b5a23370a17326d53229951de) )
644   ROM_LOAD( "pm014e.u90", 0x080000, 0x080000, CRC(2f367106) SHA1(1cd16e286e77e8e1b7668bbb6f2978101656b720) )
645   ROM_LOAD( "pm015e.u91", 0x100000, 0x080000, CRC(a563f8ef) SHA1(6e4171746e4d401992bf3a7619d5bed0063d57e5) )
646   ROM_LOAD( "pm016e.u92", 0x180000, 0x080000, CRC(c0b9494c) SHA1(f0b066dd78eb9fcf947da90ddb6c7b62299c5743) )
485647
486648   ROM_REGION( 0x140000, "oki", 0 )   /* OKIM6295 samples */
487649   /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */
r3373r3374
491653ROM_END
492654
493655
494GAME( 1990, galsnew,  0,       galsnew, galsnew, galsnew, ROT90, "Kaneko", "Gals Panic (US, EXPRO-02 PCB)", GAME_NOT_WORKING )
495GAME( 1990, galsnewa, galsnew, galsnew, galsnew, galsnew, ROT90, "Kaneko", "Gals Panic (Export, EXPRO-02 PCB)", GAME_NOT_WORKING )
496GAME( 1990, galsnewj, galsnew, galsnew, galsnew, galsnew, ROT90, "Kaneko (Taito license)", "Gals Panic (Japan, EXPRO-02 PCB)", GAME_NOT_WORKING )
656GAME( 1990, galsnew,  0,       galsnew, galsnew,  galsnew, ROT90, "Kaneko", "Gals Panic (US, EXPRO-02 PCB)", 0 )
657GAME( 1990, galsnewa, galsnew, galsnew, galsnewa, galsnew, ROT90, "Kaneko", "Gals Panic (Export, EXPRO-02 PCB)", 0 )
658GAME( 1990, galsnewj, galsnew, galsnew, galsnewa, galsnew, ROT90, "Kaneko (Taito license)", "Gals Panic (Japan, EXPRO-02 PCB)", 0 )
src/mame/drivers/senjyo.c
r3373r3374
9797VIDEO_UPDATE( senjyo );
9898extern int is_senjyo, senjyo_scrollhack;
9999
100/* in audio/senjyo.c */
101extern const z80_daisy_chain senjyo_daisy_chain[];
102extern const z80pio_interface senjyo_pio_intf;
100103void senjyo_sh_start(void);
101104
102WRITE8_HANDLER( senjyo_sh_0_w );
103WRITE8_HANDLER( senjyo_sh_1_w );
104WRITE8_HANDLER( senjyo_sh_2_w );
105
106WRITE8_HANDLER( starforc_pio_w );
107READ8_HANDLER( starforc_pio_r );
108
109105WRITE8_HANDLER( senjyo_volume_w );
110106
111107
r3373r3374
199195   AM_RANGE(0xb000, 0xb7ff) AM_WRITE(senjyo_bg1videoram_w) AM_BASE(&senjyo_bg1videoram)
200196   AM_RANGE(0xb800, 0xbbff) AM_WRITE(SMH_RAM) AM_BASE(&senjyo_radarram)
201197   AM_RANGE(0xd000, 0xd000) AM_WRITE(flip_screen_w)
202   AM_RANGE(0xd004, 0xd004) AM_WRITE(z80pioA_0_p_w)
198   AM_RANGE(0xd004, 0xd004) AM_DEVWRITE(Z80PIO, "z80pio", z80pio_p_w)
203199ADDRESS_MAP_END
204200
205201
r3373r3374
257253   AM_RANGE(0xb000, 0xb7ff) AM_WRITE(senjyo_bg1videoram_w) AM_BASE(&senjyo_bg1videoram)
258254   AM_RANGE(0xb800, 0xbbff) AM_WRITE(SMH_RAM) AM_BASE(&senjyo_radarram)
259255   AM_RANGE(0xd000, 0xd000) AM_WRITE(flip_screen_w)
260   AM_RANGE(0xd004, 0xd004) AM_WRITE(z80pioA_0_p_w)
256   AM_RANGE(0xd004, 0xd004) AM_DEVWRITE(Z80PIO, "z80pio", z80pio_p_w)
261257
262258   /* these aren't used / written, left here to make sure memory is allocated */
263259   AM_RANGE(0xfe00, 0xfe1f) AM_WRITE(SMH_RAM) AM_BASE(&senjyo_fgscroll)
r3373r3374
288284   AM_RANGE(0xf000, 0xffff) AM_WRITE(SMH_RAM)
289285ADDRESS_MAP_END
290286
291static WRITE8_HANDLER( pio_w )
287static WRITE8_DEVICE_HANDLER( pio_w )
292288{
293289   if (offset & 1)
294      z80pio_c_w(machine, 0, (offset >> 1) & 1, data);
290      z80pio_c_w(device, (offset >> 1) & 1, data);
295291   else
296      z80pio_d_w(machine, 0, (offset >> 1) & 1, data);
292      z80pio_d_w(device, (offset >> 1) & 1, data);
297293}
298294
299static READ8_HANDLER( pio_r )
295static READ8_DEVICE_HANDLER( pio_r )
300296{
301   return (offset & 1) ? z80pio_c_r(0, (offset >> 1) & 1) : z80pio_d_r(machine, 0, (offset >> 1) & 1);
297   return (offset & 1) ? z80pio_c_r(device, (offset >> 1) & 1) : z80pio_d_r(device, (offset >> 1) & 1);
302298}
303299
304300static ADDRESS_MAP_START( sound_io_map, ADDRESS_SPACE_IO, 8 )
305301   ADDRESS_MAP_GLOBAL_MASK(0xff)
306   AM_RANGE(0x00, 0x03) AM_READWRITE(pio_r, pio_w)
307   AM_RANGE(0x08, 0x0b) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
302   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE(Z80PIO, "z80pio", pio_r, pio_w)
303   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE(Z80CTC, "z80ctc", z80ctc_r, z80ctc_w)
308304ADDRESS_MAP_END
309305
310306
r3373r3374
619615
620616
621617
622static const struct z80_irq_daisy_chain daisy_chain[] =
623{
624   { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti , 0 }, /* device 0 = CTC_0 , high priority */
625   { z80pio_reset, z80pio_irq_state, z80pio_irq_ack, z80pio_irq_reti , 0 }, /* device 1 = PIO_0 , low  priority */
626   { 0,0,0,0,-1}       /* end mark */
627};
628
629
630
631618static const samples_interface senjyo_samples_interface =
632619{
633620   1,
r3373r3374
636623};
637624
638625
626extern const z80ctc_interface senjyo_ctc_intf;
639627
640628static MACHINE_DRIVER_START( senjyo )
641629
r3373r3374
645633   MDRV_CPU_VBLANK_INT("main", senjyo_interrupt)
646634
647635   MDRV_CPU_ADD("sub", Z80, 2000000)   /* 2 MHz? */
648   MDRV_CPU_CONFIG(daisy_chain)
636   MDRV_CPU_CONFIG(senjyo_daisy_chain)
649637   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
650638   MDRV_CPU_IO_MAP(sound_io_map,0)
651639
652640   MDRV_MACHINE_RESET(senjyo)
653641
642   MDRV_Z80PIO_ADD( "z80pio", senjyo_pio_intf )
643   MDRV_Z80CTC_ADD( "z80ctc", senjyo_ctc_intf )
644
654645   /* video hardware */
655646   MDRV_SCREEN_ADD("main", RASTER)
656647   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/segaxbd.c
r3373r3374
8686
8787static void update_main_irqs(running_machine *machine)
8888{
89   cpunum_set_input_line(machine, 0, 2, timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
90   cpunum_set_input_line(machine, 0, 4, vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
89   int irq = 0;
9190
92   if(!gprider_hack)
93      cpunum_set_input_line(machine, 0, 6, timer_irq_state && vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
91   if (timer_irq_state)
92      irq |= 2;
93   else
94      cpunum_set_input_line(machine, 0, 2, CLEAR_LINE);
9495
95   if(timer_irq_state || vblank_irq_state)
96   if (vblank_irq_state)
97      irq |= 4;
98   else
99      cpunum_set_input_line(machine, 0, 4, CLEAR_LINE);
100
101   if (gprider_hack && irq > 4)
102      irq = 4;
103
104   if (!(irq==6))
105      cpunum_set_input_line(machine, 0, 6, CLEAR_LINE);
106
107   if (irq)
108   {
109      cpunum_set_input_line(machine, 0, irq, ASSERT_LINE);
96110      cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
111   }
97112}
98113
99114
src/mame/drivers/nbmj9195.c
r3373r3374
489489static WRITE8_HANDLER( tmpz84c011_1_dir_pe_w )   { pio_dir[9] = data; }
490490
491491
492static void ctc0_interrupt(running_machine *machine, int state)
492static void ctc0_interrupt(const device_config *device, int state)
493493{
494   cpunum_set_input_line(machine, 0, 0, state);
494   cpunum_set_input_line(device->machine, 0, 0, state);
495495}
496496
497static void ctc1_interrupt(running_machine *machine, int state)
497static void ctc1_interrupt(const device_config *device, int state)
498498{
499   cpunum_set_input_line(machine, 1, 0, state);
499   cpunum_set_input_line(device->machine, 1, 0, state);
500500}
501501
502502/* CTC of main cpu, ch0 trigger is vblank */
503503static INTERRUPT_GEN( ctc0_trg1 )
504504{
505   z80ctc_0_trg1_w(machine, 0, 1);
506   z80ctc_0_trg1_w(machine, 0, 0);
505   const device_config *ctc = devtag_get_device(machine, Z80CTC, "main_ctc");
506   z80ctc_trg1_w(ctc, 0, 1);
507   z80ctc_trg1_w(ctc, 0, 0);
507508}
508509
509static z80ctc_interface ctc_intf_1 =
510static z80ctc_interface ctc_intf_main =
510511{
512   "main",                  /* clock from main CPU */
511513   0,                     /* clock */
512514   0,                     /* timer disables */
513515   ctc0_interrupt,            /* interrupt handler */
r3373r3374
516518   0,                     /* ZC/TO2 callback */
517519};
518520
519static z80ctc_interface ctc_intf_2 =
521static z80ctc_interface ctc_intf_audio =
520522{
521   1,                     /* clock */
523   "audio",               /* clock from audio CPU */
524   0,                     /* clock */
522525   0,                     /* timer disables */
523526   ctc1_interrupt,            /* interrupt handler */
524   z80ctc_1_trg3_w,         /* ZC/TO0 callback ctc1.zc0 -> ctc1.trg3 */
527   z80ctc_trg3_w,            /* ZC/TO0 callback ctc1.zc0 -> ctc1.trg3 */
525528   0,                     /* ZC/TO1 callback */
526529   0                     /* ZC/TO2 callback */
527530};
528531
529static void tmpz84c011_init(running_machine *machine)
530{
531   // initialize the CTC
532   ctc_intf_1.baseclock = cpunum_get_clock(0);
533   ctc_intf_2.baseclock = cpunum_get_clock(1);
534   z80ctc_init(0, &ctc_intf_1);
535   z80ctc_init(1, &ctc_intf_2);
536}
537
538532static MACHINE_RESET( sailorws )
539533{
540534   int i;
r3373r3374
554548   // sound program patch
555549   ROM[0x0213] = 0x00;         // DI -> NOP
556550
557   // initialize TMPZ84C011 PIO and CTC
558   tmpz84c011_init(machine);
559
560551   // initialize sound rom bank
561552   nbmj9195_soundbank_w(machine, 0);
562553}
r3373r3374
656647
657648static ADDRESS_MAP_START( readport_mjuraden, ADDRESS_SPACE_IO, 8 )
658649   ADDRESS_MAP_GLOBAL_MASK(0xff)
659   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
650   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
660651   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
661652   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
662653   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
673664
674665static ADDRESS_MAP_START( writeport_mjuraden, ADDRESS_SPACE_IO, 8 )
675666   ADDRESS_MAP_GLOBAL_MASK(0xff)
676   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
667   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
677668   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
678669   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
679670   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
698689
699690static ADDRESS_MAP_START( readport_koinomp, ADDRESS_SPACE_IO, 8 )
700691   ADDRESS_MAP_GLOBAL_MASK(0xff)
701   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
692   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
702693   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
703694   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
704695   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
716707
717708static ADDRESS_MAP_START( writeport_koinomp, ADDRESS_SPACE_IO, 8 )
718709   ADDRESS_MAP_GLOBAL_MASK(0xff)
719   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
710   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
720711   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
721712   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
722713   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
744735
745736static ADDRESS_MAP_START( readport_patimono, ADDRESS_SPACE_IO, 8 )
746737   ADDRESS_MAP_GLOBAL_MASK(0xff)
747   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
738   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
748739   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
749740   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
750741   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
762753
763754static ADDRESS_MAP_START( writeport_patimono, ADDRESS_SPACE_IO, 8 )
764755   ADDRESS_MAP_GLOBAL_MASK(0xff)
765   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
756   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
766757   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
767758   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
768759   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
789780
790781static ADDRESS_MAP_START( readport_mmehyou, ADDRESS_SPACE_IO, 8 )
791782   ADDRESS_MAP_GLOBAL_MASK(0xff)
792   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
783   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
793784   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
794785   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
795786   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
806797
807798static ADDRESS_MAP_START( writeport_mmehyou, ADDRESS_SPACE_IO, 8 )
808799   ADDRESS_MAP_GLOBAL_MASK(0xff)
809   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
800   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
810801   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
811802   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
812803   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
831822
832823static ADDRESS_MAP_START( readport_gal10ren, ADDRESS_SPACE_IO, 8 )
833824   ADDRESS_MAP_GLOBAL_MASK(0xff)
834   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
825   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
835826   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
836827   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
837828   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
849840
850841static ADDRESS_MAP_START( writeport_gal10ren, ADDRESS_SPACE_IO, 8 )
851842   ADDRESS_MAP_GLOBAL_MASK(0xff)
852   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
843   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
853844   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
854845   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
855846   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
876867
877868static ADDRESS_MAP_START( readport_renaiclb, ADDRESS_SPACE_IO, 8 )
878869   ADDRESS_MAP_GLOBAL_MASK(0xff)
879   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
870   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
880871   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
881872   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
882873   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
894885
895886static ADDRESS_MAP_START( writeport_renaiclb, ADDRESS_SPACE_IO, 8 )
896887   ADDRESS_MAP_GLOBAL_MASK(0xff)
897   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
888   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
898889   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
899890   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
900891   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
921912
922913static ADDRESS_MAP_START( readport_mjlaman, ADDRESS_SPACE_IO, 8 )
923914   ADDRESS_MAP_GLOBAL_MASK(0xff)
924   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
915   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
925916   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
926917   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
927918   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
939930
940931static ADDRESS_MAP_START( writeport_mjlaman, ADDRESS_SPACE_IO, 8 )
941932   ADDRESS_MAP_GLOBAL_MASK(0xff)
942   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
933   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
943934   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
944935   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
945936   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
966957
967958static ADDRESS_MAP_START( readport_mkeibaou, ADDRESS_SPACE_IO, 8 )
968959   ADDRESS_MAP_GLOBAL_MASK(0xff)
969   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
960   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
970961   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
971962   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
972963   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
984975
985976static ADDRESS_MAP_START( writeport_mkeibaou, ADDRESS_SPACE_IO, 8 )
986977   ADDRESS_MAP_GLOBAL_MASK(0xff)
987   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
978   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
988979   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
989980   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
990981   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
10111002
10121003static ADDRESS_MAP_START( readport_pachiten, ADDRESS_SPACE_IO, 8 )
10131004   ADDRESS_MAP_GLOBAL_MASK(0xff)
1014   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
1005   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
10151006   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
10161007   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
10171008   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
10291020
10301021static ADDRESS_MAP_START( writeport_pachiten, ADDRESS_SPACE_IO, 8 )
10311022   ADDRESS_MAP_GLOBAL_MASK(0xff)
1032   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
1023   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
10331024   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
10341025   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
10351026   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
10561047
10571048static ADDRESS_MAP_START( readport_sailorws, ADDRESS_SPACE_IO, 8 )
10581049   ADDRESS_MAP_GLOBAL_MASK(0xff)
1059   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
1050   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
10601051   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
10611052   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
10621053   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
10741065
10751066static ADDRESS_MAP_START( writeport_sailorws, ADDRESS_SPACE_IO, 8 )
10761067   ADDRESS_MAP_GLOBAL_MASK(0xff)
1077   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
1068   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
10781069   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
10791070   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
10801071   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
11011092
11021093static ADDRESS_MAP_START( readport_sailorwr, ADDRESS_SPACE_IO, 8 )
11031094   ADDRESS_MAP_GLOBAL_MASK(0xff)
1104   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
1095   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
11051096   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
11061097   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
11071098   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
11191110
11201111static ADDRESS_MAP_START( writeport_sailorwr, ADDRESS_SPACE_IO, 8 )
11211112   ADDRESS_MAP_GLOBAL_MASK(0xff)
1122   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
1113   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
11231114   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
11241115   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
11251116   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
11461137
11471138static ADDRESS_MAP_START( readport_psailor1, ADDRESS_SPACE_IO, 8 )
11481139   ADDRESS_MAP_GLOBAL_MASK(0xff)
1149   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
1140   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
11501141   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
11511142   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
11521143   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
11641155
11651156static ADDRESS_MAP_START( writeport_psailor1, ADDRESS_SPACE_IO, 8 )
11661157   ADDRESS_MAP_GLOBAL_MASK(0xff)
1167   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
1158   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
11681159   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
11691160   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
11701161   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
11911182
11921183static ADDRESS_MAP_START( readport_psailor2, ADDRESS_SPACE_IO, 8 )
11931184   ADDRESS_MAP_GLOBAL_MASK(0xff)
1194   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
1185   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
11951186   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
11961187   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
11971188   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
12091200
12101201static ADDRESS_MAP_START( writeport_psailor2, ADDRESS_SPACE_IO, 8 )
12111202   ADDRESS_MAP_GLOBAL_MASK(0xff)
1212   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
1203   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
12131204   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
12141205   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
12151206   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
12361227
12371228static ADDRESS_MAP_START( readport_otatidai, ADDRESS_SPACE_IO, 8 )
12381229   ADDRESS_MAP_GLOBAL_MASK(0xff)
1239   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
1230   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
12401231   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
12411232   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
12421233   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
12541245
12551246static ADDRESS_MAP_START( writeport_otatidai, ADDRESS_SPACE_IO, 8 )
12561247   ADDRESS_MAP_GLOBAL_MASK(0xff)
1257   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
1248   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
12581249   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
12591250   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
12601251   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
12811272
12821273static ADDRESS_MAP_START( readport_yosimoto, ADDRESS_SPACE_IO, 8 )
12831274   ADDRESS_MAP_GLOBAL_MASK(0xff)
1284   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
1275   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
12851276   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
12861277   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
12871278   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
12991290
13001291static ADDRESS_MAP_START( writeport_yosimoto, ADDRESS_SPACE_IO, 8 )
13011292   ADDRESS_MAP_GLOBAL_MASK(0xff)
1302   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
1293   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
13031294   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
13041295   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
13051296   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
13261317
13271318static ADDRESS_MAP_START( readport_jituroku, ADDRESS_SPACE_IO, 8 )
13281319   ADDRESS_MAP_GLOBAL_MASK(0xff)
1329   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
1320   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
13301321   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
13311322   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
13321323   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
13441335
13451336static ADDRESS_MAP_START( writeport_jituroku, ADDRESS_SPACE_IO, 8 )
13461337   ADDRESS_MAP_GLOBAL_MASK(0xff)
1347   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
1338   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
13481339   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
13491340   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
13501341   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
13711362
13721363static ADDRESS_MAP_START( readport_ngpgal, ADDRESS_SPACE_IO, 8 )
13731364   ADDRESS_MAP_GLOBAL_MASK(0xff)
1374   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
1365   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
13751366   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
13761367   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
13771368   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
13881379
13891380static ADDRESS_MAP_START( writeport_ngpgal, ADDRESS_SPACE_IO, 8 )
13901381   ADDRESS_MAP_GLOBAL_MASK(0xff)
1391   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
1382   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
13921383   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
13931384   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
13941385   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
14131404
14141405static ADDRESS_MAP_START( readport_mjgottsu, ADDRESS_SPACE_IO, 8 )
14151406   ADDRESS_MAP_GLOBAL_MASK(0xff)
1416   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
1407   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
14171408   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
14181409   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
14191410   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
14301421
14311422static ADDRESS_MAP_START( writeport_mjgottsu, ADDRESS_SPACE_IO, 8 )
14321423   ADDRESS_MAP_GLOBAL_MASK(0xff)
1433   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
1424   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
14341425   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
14351426   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
14361427   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
14551446
14561447static ADDRESS_MAP_START( readport_cmehyou, ADDRESS_SPACE_IO, 8 )
14571448   ADDRESS_MAP_GLOBAL_MASK(0xff)
1458   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
1449   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
14591450   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
14601451   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
14611452   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
14721463
14731464static ADDRESS_MAP_START( writeport_cmehyou, ADDRESS_SPACE_IO, 8 )
14741465   ADDRESS_MAP_GLOBAL_MASK(0xff)
1475   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
1466   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
14761467   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
14771468   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
14781469   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
14971488
14981489static ADDRESS_MAP_START( readport_mjkoiura, ADDRESS_SPACE_IO, 8 )
14991490   ADDRESS_MAP_GLOBAL_MASK(0xff)
1500   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
1491   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
15011492   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
15021493   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
15031494   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
15141505
15151506static ADDRESS_MAP_START( writeport_mjkoiura, ADDRESS_SPACE_IO, 8 )
15161507   ADDRESS_MAP_GLOBAL_MASK(0xff)
1517   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
1508   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
15181509   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
15191510   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
15201511   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
15391530
15401531static ADDRESS_MAP_START( readport_mkoiuraa, ADDRESS_SPACE_IO, 8 )
15411532   ADDRESS_MAP_GLOBAL_MASK(0xff)
1542   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
1533   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
15431534   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
15441535   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
15451536   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
15561547
15571548static ADDRESS_MAP_START( writeport_mkoiuraa, ADDRESS_SPACE_IO, 8 )
15581549   ADDRESS_MAP_GLOBAL_MASK(0xff)
1559   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
1550   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
15601551   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
15611552   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
15621553   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
15811572
15821573static ADDRESS_MAP_START( readport_mscoutm, ADDRESS_SPACE_IO, 8 )
15831574   ADDRESS_MAP_GLOBAL_MASK(0xff)
1584   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
1575   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
15851576   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
15861577   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
15871578   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
16021593
16031594static ADDRESS_MAP_START( writeport_mscoutm, ADDRESS_SPACE_IO, 8 )
16041595   ADDRESS_MAP_GLOBAL_MASK(0xff)
1605   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
1596   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
16061597   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
16071598   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
16081599   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
16281619
16291620static ADDRESS_MAP_START( readport_imekura, ADDRESS_SPACE_IO, 8 )
16301621   ADDRESS_MAP_GLOBAL_MASK(0xff)
1631   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
1622   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
16321623   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
16331624   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
16341625   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
16491640
16501641static ADDRESS_MAP_START( writeport_imekura, ADDRESS_SPACE_IO, 8 )
16511642   ADDRESS_MAP_GLOBAL_MASK(0xff)
1652   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
1643   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
16531644   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
16541645   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
16551646   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
16751666
16761667static ADDRESS_MAP_START( readport_mjegolf, ADDRESS_SPACE_IO, 8 )
16771668   ADDRESS_MAP_GLOBAL_MASK(0xff)
1678   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_0_r)
1669   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "main_ctc", z80ctc_r)
16791670   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_0_pa_r)
16801671   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_0_pb_r)
16811672   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_0_pc_r)
r3373r3374
16961687
16971688static ADDRESS_MAP_START( writeport_mjegolf, ADDRESS_SPACE_IO, 8 )
16981689   ADDRESS_MAP_GLOBAL_MASK(0xff)
1699   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_0_w)
1690   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "main_ctc", z80ctc_w)
17001691   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_0_pa_w)
17011692   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_0_pb_w)
17021693   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_0_pc_w)
r3373r3374
17221713
17231714static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
17241715   ADDRESS_MAP_GLOBAL_MASK(0xff)
1725   AM_RANGE(0x10, 0x13) AM_READ(z80ctc_1_r)
1716   AM_RANGE(0x10, 0x13) AM_DEVREAD(Z80CTC, "audio_ctc", z80ctc_r)
17261717   AM_RANGE(0x50, 0x50) AM_READ(tmpz84c011_1_pa_r)
17271718   AM_RANGE(0x51, 0x51) AM_READ(tmpz84c011_1_pb_r)
17281719   AM_RANGE(0x52, 0x52) AM_READ(tmpz84c011_1_pc_r)
r3373r3374
17371728
17381729static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 )
17391730   ADDRESS_MAP_GLOBAL_MASK(0xff)
1740   AM_RANGE(0x10, 0x13) AM_WRITE(z80ctc_1_w)
1731   AM_RANGE(0x10, 0x13) AM_DEVWRITE(Z80CTC, "audio_ctc", z80ctc_w)
17411732   AM_RANGE(0x50, 0x50) AM_WRITE(tmpz84c011_1_pa_w)
17421733   AM_RANGE(0x51, 0x51) AM_WRITE(tmpz84c011_1_pb_w)
17431734   AM_RANGE(0x52, 0x52) AM_WRITE(tmpz84c011_1_pc_w)
r3373r3374
36393630INPUT_PORTS_END
36403631
36413632
3642static const struct z80_irq_daisy_chain daisy_chain_main[] =
3633static const z80_daisy_chain daisy_chain_main[] =
36433634{
3644   { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti, 0 },   /* device 0 = CTC_0 */
3645   { 0, 0, 0, 0, -1 }                              /* end mark */
3635   { Z80CTC, "main_ctc" },
3636   { NULL }
36463637};
36473638
3648static const struct z80_irq_daisy_chain daisy_chain_sound[] =
3639static const z80_daisy_chain daisy_chain_sound[] =
36493640{
3650   { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti, 1 },   /* device 0 = CTC_1 */
3651   { 0, 0, 0, 0, -1 }                              /* end mark */
3641   { Z80CTC, "audio_ctc" },
3642   { NULL }
36523643};
36533644
36543645
r3373r3374
36663657   MDRV_CPU_PROGRAM_MAP(sound_readmem, sound_writemem)
36673658   MDRV_CPU_IO_MAP(sound_readport, sound_writeport)
36683659
3660   MDRV_Z80CTC_ADD("main_ctc", ctc_intf_main)
3661   MDRV_Z80CTC_ADD("audio_ctc", ctc_intf_audio)
3662
36693663   MDRV_MACHINE_RESET(sailorws)
36703664
36713665   /* video hardware */
src/mame/drivers/lgp.c
r3373r3374
8383{
8484   int charx, chary;
8585
86   render_container_set_palette_alpha(render_container_get_screen(screen), 0, 0x00);
86   /* make color 0 transparent */
87   palette_set_color(screen->machine, 0, MAKE_ARGB(0,0,0,0));
8788
8889   /* clear */
8990   fillbitmap(bitmap, 0, cliprect);
src/mame/drivers/cliffhgr.c
r3373r3374
147147   int overlay = ( data & 0x10 ) ? 1 : 0;
148148
149149   /* configure pen 0 and 1 as transparent in the renderer and use it as the compositing color */
150   render_container_set_palette_alpha(render_container_get_screen(machine->primary_screen), 0, overlay ? 0x00 : 0xff );
151   render_container_set_palette_alpha(render_container_get_screen(machine->primary_screen), 1, overlay ? 0x00 : 0xff );
150   if (overlay)
151   {
152      palette_set_color(machine, 0, palette_get_color(machine, 0) & MAKE_ARGB(0,255,255,255));
153      palette_set_color(machine, 1, palette_get_color(machine, 1) & MAKE_ARGB(0,255,255,255));
154   }
155   else
156   {
157      palette_set_color(machine, 0, palette_get_color(machine, 0) | MAKE_ARGB(255,0,0,0));
158      palette_set_color(machine, 1, palette_get_color(machine, 1) | MAKE_ARGB(255,0,0,0));
159   }
152160
153161   /* audio */
154162   discrete_sound_w(machine, CLIFF_ENABLE_SND_1, sound&1);
155163   discrete_sound_w(machine, CLIFF_ENABLE_SND_2, (sound>>1)&1);
156164}
157165
158#ifdef UNUSED_FUNCTION
159static WRITE8_HANDLER( cliff_irqack_w )
160{
161   phillips_code = 0;
162}
163#endif
164
165166static WRITE8_HANDLER( cliff_ldwire_w )
166167{
167168   laserdisc_line_w(laserdisc,LASERDISC_LINE_CONTROL,(data&1) ? ASSERT_LINE : CLEAR_LINE );
src/mame/drivers/seibuspi.c
r3373r3374
11941194   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Coin") PORT_CODE(KEYCODE_7)
11951195   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_COIN1 )
11961196   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_COIN2 )
1197   PORT_BIT( 0x000000c0, IP_ACTIVE_LOW, IPT_UNUSED )
1197   PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
1198   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED )
11981199   PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED )
11991200
12001201   PORT_START("JP1")
src/mame/drivers/mwarr.c
r3373r3374
123123   brightness = (double)(data & 0xff);
124124   for (i=0;i<0x800;i++)
125125   {
126      palette_set_brightness(machine, i, brightness/255);
126      palette_set_pen_contrast(machine, i, brightness/255);
127127   }
128128}
129129
src/mame/drivers/vroulet.c
r3373r3374
230230
231231/* PPI8255 Interface */
232232
233static WRITE8_HANDLER( ppi8255_a_w ){}// watchdog ?
234static WRITE8_HANDLER( ppi8255_b_w ){}// lamps ?
235static WRITE8_HANDLER( ppi8255_c_w ){}
233static WRITE8_DEVICE_HANDLER( ppi8255_a_w ){}// watchdog ?
234static WRITE8_DEVICE_HANDLER( ppi8255_b_w ){}// lamps ?
235static WRITE8_DEVICE_HANDLER( ppi8255_c_w ){}
236236
237237static const ppi8255_interface ppi8255_intf[2] =
238238{
239239   {
240      input_port_0_r,           // Port A read
241      input_port_1_r,         // Port B read
242      input_port_2_r,         // Port C read
240      DEVICE8_PORT("IN0"),    // Port A read
241      DEVICE8_PORT("IN1"),   // Port B read
242      DEVICE8_PORT("IN2"),   // Port C read
243243      NULL,               // Port A write
244244      NULL,               // Port B write
245245      NULL               // Port C write
r3373r3374
265265
266266   MDRV_NVRAM_HANDLER(generic_1fill)
267267
268   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
269   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
268   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
269   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
270270
271   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
272   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
273
274271   // video hardware
275272
276273   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/system1.c
r3373r3374
433433   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
434434
435435   PORT_START("DSW1")
436   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SWB:1" )
436   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SWB:1")
437   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
438   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
437439   PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SWB:2" )
438440   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SWB:3" )
439441   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SWB:4" )
r3373r3374
441443   PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SWB:6" )
442444   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SWB:7" )
443445/* If you don't like the description, feel free to change it */
444   PORT_DIPNAME( 0x80, 0x80, "SW 0 Read From" ) PORT_DIPLOCATION("SWB:8")
446   PORT_DIPNAME( 0x80, 0x80, "SW 0 Read From" )      PORT_DIPLOCATION("SWB:8")
445447   PORT_DIPSETTING(   0x80, "Port $0D" )
446448   PORT_DIPSETTING(   0x00, "Port $10" )
447449
448450   PORT_START("DSW2")
449   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:1,2,3,4")
451   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SWA:1,2,3,4")
450452   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
451453   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
452454   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )
r3373r3374
463465   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
464466   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
465467/*  PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) ) Not allowed by mame coinage sorting, but valid */
466   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:5,6,7,8")
468   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SWA:5,6,7,8")
467469   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
468470   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
469471   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
r3373r3374
492494   PORT_INCLUDE( system1_generic )
493495
494496   PORT_MODIFY("DSW1")
495   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
496   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
497   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
498   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) )
497   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:2,3")
499498   PORT_DIPSETTING(   0x06, "3" )
500499   PORT_DIPSETTING(   0x04, "4" )
501500   PORT_DIPSETTING(   0x02, "5" )
502501   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
503   PORT_DIPNAME( 0x38, 0x30, DEF_STR (Bonus_Life ) )
502   PORT_DIPNAME( 0x38, 0x30, DEF_STR (Bonus_Life ) )   PORT_DIPLOCATION("SWB:4,5,6")
504503   PORT_DIPSETTING(   0x38, "Every 20k" )
505504   PORT_DIPSETTING(   0x28, "Every 30k" )
506505   PORT_DIPSETTING(   0x18, "Every 40k" )
r3373r3374
509508   PORT_DIPSETTING(   0x20, "30k, then every 40k" )
510509   PORT_DIPSETTING(   0x10, "40k, then every 50k" )
511510   PORT_DIPSETTING(   0x00, "50k, then every 60k" )
512   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
511   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:7,8")
513512   PORT_DIPSETTING(   0xc0, DEF_STR( Easy ) )
514513   PORT_DIPSETTING(   0x80, DEF_STR( Medium ) )
515514   PORT_DIPSETTING(   0x40, DEF_STR( Hard ) )
r3373r3374
520519   PORT_INCLUDE( starjack )
521520
522521   PORT_MODIFY("DSW1")
523   PORT_DIPNAME( 0x08, 0x08, "Ship" )
522   PORT_DIPNAME( 0x08, 0x08, "Ship" )         PORT_DIPLOCATION("SWB:4")
524523   PORT_DIPSETTING(   0x08, DEF_STR( Single ) )
525524   PORT_DIPSETTING(   0x00, "Multi" )
526   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
525   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5,6")
527526   PORT_DIPSETTING(   0x30, "30k, then every 40k" )
528527   PORT_DIPSETTING(   0x20, "40k, then every 50k" )
529528   PORT_DIPSETTING(   0x10, "50k, then every 60k" )
r3373r3374
534533   PORT_INCLUDE( system1_generic )
535534
536535   PORT_MODIFY("DSW1")
537   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
538   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
539   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
540   PORT_DIPNAME( 0x02, 0x02, "Unused SW 0-1" )
541   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
542   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
543   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
536   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
544537   PORT_DIPSETTING(   0x0c, "3" )
545538   PORT_DIPSETTING(   0x08, "4" )
546539   PORT_DIPSETTING(   0x04, "5" )
547540   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
548   PORT_DIPNAME( 0x10, 0x10, "Unused SW 0-4" )
549   PORT_DIPSETTING(   0x10, DEF_STR( Off ) )
550   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
551   PORT_DIPNAME( 0x20, 0x20, "Unused SW 0-5" )
552   PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
553   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
554   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
541   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:7")
555542   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
556543   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
557   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) )
544   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SWB:8")
558545   PORT_DIPSETTING(   0x80, DEF_STR( No ) )
559546   PORT_DIPSETTING(   0x00, DEF_STR( Yes ) )
560547INPUT_PORTS_END
r3373r3374
564551   PORT_INCLUDE( regulus )
565552
566553   PORT_MODIFY("DSW1")
567   PORT_DIPNAME( 0x80, 0x80, "Unused SW 0-7" )
568   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
569   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
554   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SWB:8" )
570555INPUT_PORTS_END
571556
572557static INPUT_PORTS_START( upndown )
r3373r3374
579564   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* no button 2 */
580565
581566   PORT_MODIFY("DSW1")
582   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
583   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
584   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
585   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) )
567   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:2,3")
586568   PORT_DIPSETTING(   0x06, "3" )
587569   PORT_DIPSETTING(   0x04, "4" )
588570   PORT_DIPSETTING(   0x02, "5" )
589571   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
590   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Bonus_Life ) )
572   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:4,5,6")
591573   PORT_DIPSETTING(   0x38, "10000" )
592574   PORT_DIPSETTING(   0x30, "20000" )
593575   PORT_DIPSETTING(   0x28, "30000" )
r3373r3374
596578   PORT_DIPSETTING(   0x10, "60000" )
597579   PORT_DIPSETTING(   0x08, "70000" )
598580   PORT_DIPSETTING(   0x00, DEF_STR( None ) )
599   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
581   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:7,8")
600582   PORT_DIPSETTING(   0xc0, DEF_STR( Easy ) )
601583   PORT_DIPSETTING(   0x80, DEF_STR( Medium ) )
602584   PORT_DIPSETTING(   0x40, DEF_STR( Hard ) )
r3373r3374
615597   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
616598
617599   PORT_MODIFY("DSW1")
618   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
619   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
620   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
621   PORT_DIPNAME( 0x02, 0x00, "Maximum Credits" )
600   PORT_DIPNAME( 0x02, 0x00, "Maximum Credits" )      PORT_DIPLOCATION("SWB:2")
622601   PORT_DIPSETTING(   0x02, "9" )
623602   PORT_DIPSETTING(   0x00, "99" )
624   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
603   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
625604   PORT_DIPSETTING(   0x0c, "3" )
626605   PORT_DIPSETTING(   0x08, "4" )
627606   PORT_DIPSETTING(   0x04, "5" )
628607   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
629   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
608   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5,6")
630609   PORT_DIPSETTING(   0x30, "10k, 30k then every 30k" )
631610   PORT_DIPSETTING(   0x20, "20k, 40k then every 30k" )
632611   PORT_DIPSETTING(   0x10, "30k, then every 30k" )
633612   PORT_DIPSETTING(   0x00, "40k, then every 30k" )
634   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
613   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:7")
635614   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
636615   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
637616INPUT_PORTS_END
r3373r3374
642621   PORT_INCLUDE( mrviking )
643622
644623   PORT_MODIFY("DSW1")
645   PORT_DIPNAME( 0x02, 0x02, "Unused SW 0-1" )
646   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
647   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
648   PORT_DIPNAME( 0x40, 0x40, "Unused SW 0-6" )
649   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
650   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
651   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Difficulty ) )
624   PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SWB:2" )
625   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SWB:7" )
626   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:8")
652627   PORT_DIPSETTING(   0x80, DEF_STR( Easy ) )
653628   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
654629INPUT_PORTS_END
r3373r3374
657632   PORT_INCLUDE( system1_generic )
658633
659634   PORT_MODIFY("DSW1")
660   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
661   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
662   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
663   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) )
635   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:2,3")
664636   PORT_DIPSETTING(   0x06, "3" )
665637   PORT_DIPSETTING(   0x04, "4" )
666638   PORT_DIPSETTING(   0x02, "5" )
667639   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
668   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Bonus_Life ) )
640   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:4,5,6")
669641   PORT_DIPSETTING(   0x38, "30000" )
670642   PORT_DIPSETTING(   0x30, "40000" )
671643   PORT_DIPSETTING(   0x28, "50000" )
r3373r3374
674646   PORT_DIPSETTING(   0x10, "80000" )
675647   PORT_DIPSETTING(   0x08, "90000" )
676648   PORT_DIPSETTING(   0x00, DEF_STR( None ) )
677   PORT_DIPNAME( 0x40, 0x40, "Unused SW 0-6" )
678   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
679   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
680   PORT_DIPNAME( 0x80, 0x80, "Unused SW 0-7" )
681   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
682   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
649   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SWB:8" )
683650INPUT_PORTS_END
684651
685652static INPUT_PORTS_START( flicky )
r3373r3374
700667   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
701668
702669   PORT_MODIFY("DSW1")
703   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
704   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
705   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
706   PORT_DIPNAME( 0x02, 0x02, "Unused SW 0-1" )
707   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
708   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
709   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
670   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
710671   PORT_DIPSETTING(   0x0c, "3" )
711672   PORT_DIPSETTING(   0x08, "4" )
712673   PORT_DIPSETTING(   0x04, "5" )
713674   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
714   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
675   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5,6")
715676   PORT_DIPSETTING(   0x30, "30000 80000 160000" )
716677   PORT_DIPSETTING(   0x20, "30000 100000 200000" )
717678   PORT_DIPSETTING(   0x10, "40000 120000 240000" )
718679   PORT_DIPSETTING(   0x00, "40000 140000 280000" )
719   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
680   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:7")
720681   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
721682   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
722683INPUT_PORTS_END
r3373r3374
749710   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL   /* TURN P2 */
750711
751712   PORT_MODIFY("DSW1")
752   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
753   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
754   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
755   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
713   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
756714   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
757715   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
758   PORT_DIPNAME( 0x0c, 0x0c, "Time" )
716   PORT_DIPNAME( 0x0c, 0x0c, "Time" )         PORT_DIPLOCATION("SWB:3,4")
759717   PORT_DIPSETTING(   0x0c, DEF_STR( Normal ) )
760718   PORT_DIPSETTING(   0x08, "Fast" )
761719   PORT_DIPSETTING(   0x04, "Faster" )
762720   PORT_DIPSETTING(   0x00, "Fastest" )
763   PORT_DIPNAME( 0x10, 0x10, "Unused SW 0-4" )
764   PORT_DIPSETTING(   0x10, DEF_STR( Off ) )
765   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
766   PORT_DIPNAME( 0x20, 0x20, "Unused SW 0-5" )
767   PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
768   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
769   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
721   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:7")
770722   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
771723   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
772724INPUT_PORTS_END
r3373r3374
775727   PORT_INCLUDE( system1_generic )
776728
777729   PORT_MODIFY("DSW1")
778   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
779   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
780   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
781   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
730   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
782731   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
783732   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
784   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
733   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
785734   PORT_DIPSETTING(   0x0c, "3" )
786735   PORT_DIPSETTING(   0x08, "4" )
787736   PORT_DIPSETTING(   0x04, "5" )
788737   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
789   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
738   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5,6")
790739   PORT_DIPSETTING(   0x30, "30000" )
791740   PORT_DIPSETTING(   0x20, "50000" )
792741   PORT_DIPSETTING(   0x10, "70000" )
r3373r3374
797746   PORT_INCLUDE( system1_generic )
798747
799748   PORT_MODIFY("DSW1")
800   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
801   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
802   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
803   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
749   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
804750   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
805751   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
806   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
752   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
807753   PORT_DIPSETTING(   0x08, "2" )
808754   PORT_DIPSETTING(   0x0c, "3" )
809755   PORT_DIPSETTING(   0x04, "4" )
810756   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
811   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
757   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5,6")
812758   PORT_DIPSETTING(   0x30, "40k, 120k and 480k" )
813759   PORT_DIPSETTING(   0x20, "50k and 200k" )
814760   PORT_DIPSETTING(   0x10, "100k only" )
815761   PORT_DIPSETTING(   0x00, DEF_STR( None ) )
816   PORT_DIPNAME( 0x40, 0x40, "Reset Timer/Objects On Life Loss" )
762   PORT_DIPNAME( 0x40, 0x40, "Reset Timer/Objects On Life Loss" )   PORT_DIPLOCATION("SWB:7")
817763   PORT_DIPSETTING(   0x40, DEF_STR( No ) )
818764   PORT_DIPSETTING(   0x00, DEF_STR( Yes ) )
819765INPUT_PORTS_END
r3373r3374
822768   PORT_INCLUDE( system1_generic )
823769
824770   PORT_MODIFY("DSW1")
825   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
826   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
827   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
828   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
771   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
829772   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
830773   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
831   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
774   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
832775   PORT_DIPSETTING(   0x0c, "3" )
833776   PORT_DIPSETTING(   0x08, "4" )
834777   PORT_DIPSETTING(   0x04, "5" )
835778   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
836   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )
779   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5")
837780   PORT_DIPSETTING(   0x10, "20000 50000" )
838781   PORT_DIPSETTING(   0x00, "30000 70000" )
839   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Allow_Continue ) )
782   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SWB:6")
840783   PORT_DIPSETTING(   0x20, DEF_STR( No ) )
841784   PORT_DIPSETTING(   0x00, DEF_STR( Yes ) )
842   PORT_DIPNAME( 0x40, 0x40, "Time" )
785   PORT_DIPNAME( 0x40, 0x40, "Time" )         PORT_DIPLOCATION("SWB:7")
843786   PORT_DIPSETTING(   0x00, "2 Minutes" )
844787   PORT_DIPSETTING(   0x40, "3 Minutes" )
845   PORT_DIPNAME( 0x80, 0x80, "Unused SW 0-7" )
846   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
847   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
788   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SWB:8" )
848789INPUT_PORTS_END
849790
850791static INPUT_PORTS_START( pitfallu )
851792   PORT_INCLUDE( pitfall2 )
852793
853794   PORT_MODIFY("DSW1")
854   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) )
795   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:2,3")
855796   PORT_DIPSETTING(   0x06, "3" )
856797   PORT_DIPSETTING(   0x04, "4" )
857798   PORT_DIPSETTING(   0x02, "5" )
858799   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
859   PORT_DIPNAME( 0x18, 0x18, "Starting Stage" )
800   PORT_DIPNAME( 0x18, 0x18, "Starting Stage" )      PORT_DIPLOCATION("SWB:4,5")
860801   PORT_DIPSETTING(   0x18, "1" )
861802   PORT_DIPSETTING(   0x10, "2" )
862803   PORT_DIPSETTING(   0x08, "3" )
r3373r3374
873814   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
874815
875816   PORT_MODIFY("DSW1")
876   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
877   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
878   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
879   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
817   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
880818   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
881819   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
882   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
820   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
883821   PORT_DIPSETTING(   0x08, "2" )
884822   PORT_DIPSETTING(   0x0c, "3" )
885823   PORT_DIPSETTING(   0x04, "4" )
886824   PORT_DIPSETTING(   0x00, "240" )
887   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )
825   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5")
888826   PORT_DIPSETTING(   0x10, "20k 70k 120k 170k" )
889827   PORT_DIPSETTING(   0x00, "50k 100k 150k 200k" )
890   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Allow_Continue ) )
828   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SWB:6")
891829   PORT_DIPSETTING(   0x20, DEF_STR( No ) )
892830   PORT_DIPSETTING(   0x00, DEF_STR( Yes ) )
893   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
831   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:7")
894832   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
895833   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
896834INPUT_PORTS_END
r3373r3374
899837   PORT_INCLUDE( system1_generic )
900838
901839   PORT_MODIFY("DSW1")
902   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
903   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
904   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
905   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
840   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
906841   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
907842   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
908   PORT_DIPNAME( 0x0C, 0x0C, DEF_STR( Lives ) )
843   PORT_DIPNAME( 0x0C, 0x0C, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
909844   PORT_DIPSETTING(   0x0C, "3" )
910845   PORT_DIPSETTING(   0x08, "4" )
911846   PORT_DIPSETTING(   0x04, "5" )
912847   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
913   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
848   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5,6")
914849   PORT_DIPSETTING(   0x30, "30000" )
915850   PORT_DIPSETTING(   0x20, "40000" )
916851   PORT_DIPSETTING(   0x10, "50000" )
917852   PORT_DIPSETTING(   0x00, DEF_STR( None ) )
918   PORT_DIPNAME( 0x40, 0x40, "Unused SW 0-6" )
919   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
920   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
921853INPUT_PORTS_END
922854
923855static INPUT_PORTS_START( teddybb )
r3373r3374
932864   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
933865
934866   PORT_MODIFY("DSW1")
935   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
936   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
937   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
938   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )
867   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
939868   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
940869   PORT_DIPSETTING(   0x02, DEF_STR( On ) )
941   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
870   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
942871   PORT_DIPSETTING(   0x08, "2" )
943872   PORT_DIPSETTING(   0x0c, "3" )
944873   PORT_DIPSETTING(   0x04, "4" )
945874   PORT_DIPSETTING(   0x00, "252" )
946   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
875   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5,6")
947876   PORT_DIPSETTING(   0x30, "100k 400k" )
948877   PORT_DIPSETTING(   0x20, "200k 600k" )
949878   PORT_DIPSETTING(   0x10, "400k 800k" )
950879   PORT_DIPSETTING(   0x00, "600k" )
951   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
880   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:7")
952881   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
953882   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
954883INPUT_PORTS_END
r3373r3374
965894   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
966895
967896   PORT_MODIFY("DSW1")
968   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
969   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
970   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
971   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
897   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
972898   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
973899   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
974   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
900   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
975901   PORT_DIPSETTING(   0x0c, "3" )
976902   PORT_DIPSETTING(   0x08, "4" )
977903   PORT_DIPSETTING(   0x04, "5" )
978904   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
979   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
905   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5,6")
980906   PORT_DIPSETTING(   0x30, "50000 100000" )
981907   PORT_DIPSETTING(   0x20, "60000 120000" )
982908   PORT_DIPSETTING(   0x10, "70000 150000" )
983909   PORT_DIPSETTING(   0x00, "100000" )
984   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
910   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:7")
985911   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
986912   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
987   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) )
913   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SWB:8")
988914   PORT_DIPSETTING(   0x80, DEF_STR( No ) )
989915   PORT_DIPSETTING(   0x00, DEF_STR( Yes ) )
990916INPUT_PORTS_END
r3373r3374
1001927   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1002928
1003929   PORT_MODIFY("DSW1")
1004   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1005   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1006   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1007   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
930   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
1008931   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
1009932   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1010   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
933   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
1011934   PORT_DIPSETTING(   0x0c, "3" )
1012935   PORT_DIPSETTING(   0x08, "4" )
1013936   PORT_DIPSETTING(   0x04, "5" )
1014937   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
1015   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
938   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5,6")
1016939   PORT_DIPSETTING(   0x30, "30000" )
1017940   PORT_DIPSETTING(   0x20, "50000" )
1018941   PORT_DIPSETTING(   0x10, "70000" )
1019942   PORT_DIPSETTING(   0x00, "90000" )
1020   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
943   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:7")
1021944   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
1022945   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
1023946INPUT_PORTS_END
1024947
1025static INPUT_PORTS_START( chplft )
1026   PORT_INCLUDE( system1_generic )
1027
1028   PORT_MODIFY("DSW1")
1029   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:1,2,3,4")
1030   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
1031   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
1032   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )
1033   PORT_DIPSETTING(    0x05, "2 Coins/1 Credit 5/3 6/4" )
1034   PORT_DIPSETTING(    0x04, "2 Coins/1 Credit 4/3" )
1035   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
1036   PORT_DIPSETTING(    0x01, "1 Coin/1 Credit 2/3" )
1037   PORT_DIPSETTING(    0x02, "1 Coin/1 Credit 4/5" )
1038   PORT_DIPSETTING(    0x03, "1 Coin/1 Credit 5/6" )
1039   PORT_DIPSETTING(    0x06, DEF_STR( 2C_3C ) )
1040   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
1041   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
1042   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
1043   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
1044   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
1045   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:5,6,7,8")
1046   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
1047   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
1048   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
1049   PORT_DIPSETTING(    0x50, "2 Coins/1 Credit 5/3 6/4" )
1050   PORT_DIPSETTING(    0x40, "2 Coins/1 Credit 4/3" )
1051   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
1052   PORT_DIPSETTING(    0x10, "1 Coin/1 Credit 2/3" )
1053   PORT_DIPSETTING(    0x20, "1 Coin/1 Credit 4/5" )
1054   PORT_DIPSETTING(    0x30, "1 Coin/1 Credit 5/6" )
1055   PORT_DIPSETTING(    0x60, DEF_STR( 2C_3C ) )
1056   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
1057   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
1058   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
1059   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
1060   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
1061
1062   PORT_MODIFY("DSW2")
1063   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1")
1064   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1065   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1066   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1067   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
1068   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1069   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
1070   PORT_DIPSETTING(   0x08, "2" )
1071   PORT_DIPSETTING(   0x0c, "3" )
1072   PORT_DIPSETTING(   0x04, "4" )
1073   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
1074   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:5")
1075   PORT_DIPSETTING(   0x10, "20k 70k 120k 170k" )
1076   PORT_DIPSETTING(   0x00, "50k 100k 150k 200k" )
1077   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:6")
1078   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
1079   PORT_DIPSETTING(   0x20, DEF_STR( Easy ) )
1080   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWB:7")
1081   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
1082   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1083   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWB:8")
1084   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
1085   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1086INPUT_PORTS_END
1087
1088static INPUT_PORTS_START( shtngmst )
1089   PORT_INCLUDE( chplft )
1090
1091   PORT_MODIFY("P1")
1092   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1093
1094   PORT_MODIFY("P2")
1095   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1096
1097   PORT_MODIFY("DSW2")
1098   PORT_DIPNAME( 0x01, 0x01, "DSW2" )
1099   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1100   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1101   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1102   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1103   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1104   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1105   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1106   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1107   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1108   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1109   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1110   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1111   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1112   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1113   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1114   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1115   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1116   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1117   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1118   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1119   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1120   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1121   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1122
1123   PORT_START("TRIGGER")  /* trigger is in here */
1124   PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
1125   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
1126
1127   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1128   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1129   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1130
1131   PORT_START("GUNX") /* 1c */
1132   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1)
1133
1134   PORT_START("GUNY") /* 1d */
1135   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, -1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_REVERSE
1136
1137   PORT_START("18") /* 18 */
1138   /* what is this? check the game code... */
1139   PORT_DIPNAME( 0x01, 0x01, "port 18" )
1140   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1141   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1142   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1143   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1144   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1145   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1146   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1147   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1148   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1149   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1150   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1151   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1152   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1153   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1154   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1155   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1156   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1157   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1158   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1159   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1160   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1161   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1162   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1163INPUT_PORTS_END
1164
1165948static INPUT_PORTS_START( 4dwarrio )
1166949   PORT_INCLUDE( system1_generic )
1167950
1168951   PORT_MODIFY("DSW1")
1169   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1170   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1171   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1172   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) )
952   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:2,3")
1173953   PORT_DIPSETTING(   0x06, "3" )
1174954   PORT_DIPSETTING(   0x04, "4" )
1175955   PORT_DIPSETTING(   0x02, "5" )
1176956   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
1177   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Bonus_Life ) )
957   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:4,5,6")
1178958   PORT_DIPSETTING(   0x38, "30000" )
1179959   PORT_DIPSETTING(   0x30, "40000" )
1180960   PORT_DIPSETTING(   0x28, "50000" )
r3373r3374
1183963   PORT_DIPSETTING(   0x10, "80000" )
1184964   PORT_DIPSETTING(   0x08, "90000" )
1185965   PORT_DIPSETTING(   0x00, DEF_STR( None ) )
1186   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
966   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:7")
1187967   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
1188968   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
1189969INPUT_PORTS_END
r3373r3374
1192972   PORT_INCLUDE( system1_generic )
1193973
1194974   PORT_MODIFY("DSW1")
1195   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1196   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1197   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1198   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
975   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
1199976   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
1200977   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1201   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
978   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
1202979   PORT_DIPSETTING(   0x0c, "3" )
1203980   PORT_DIPSETTING(   0x08, "4" )
1204981   PORT_DIPSETTING(   0x04, "5" )
1205982   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
1206   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
983   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:5")
1207984   PORT_DIPSETTING(   0x10, DEF_STR( Off ) )
1208985   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1209   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
986   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:6")
1210987   PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
1211988   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1212   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
989   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:7")
1213990   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
1214991   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1215   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
992   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:8")
1216993   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
1217994   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1218995INPUT_PORTS_END
r3373r3374
1221998   PORT_INCLUDE( system1_generic )
1222999
12231000   PORT_MODIFY("DSW1")
1224   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1225   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1226   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
1227   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1228   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1229   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1230   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
1231   PORT_DIPSETTING(    0x0c, "3" )
1232   PORT_DIPSETTING(    0x08, "4" )
1233   PORT_DIPSETTING(    0x04, "5" )
1234   PORT_DIPSETTING(    0x00, DEF_STR( Infinite ) )
1235   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
1236   PORT_DIPSETTING(    0x30, "5k, 20k and 30k" )
1237   PORT_DIPSETTING(    0x20, "10k, 25k and 50k" )
1238   PORT_DIPSETTING(    0x10, "15k, 30k and 60k" )
1239   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1240   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
1241   PORT_DIPSETTING(    0x40, DEF_STR( Easy ) )
1242   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
1243   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) /* Manual states "Always On" */
1244   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1245   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1001   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
1002   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
1003   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1004   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
1005   PORT_DIPSETTING(   0x0c, "3" )
1006   PORT_DIPSETTING(   0x08, "4" )
1007   PORT_DIPSETTING(   0x04, "5" )
1008   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
1009   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5,6")
1010   PORT_DIPSETTING(   0x30, "5k, 20k and 30k" )
1011   PORT_DIPSETTING(   0x20, "10k, 25k and 50k" )
1012   PORT_DIPSETTING(   0x10, "15k, 30k and 60k" )
1013   PORT_DIPSETTING(   0x00, DEF_STR( None ) )
1014   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:7")
1015   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
1016   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
1017    /* Manual states "Always On" */
1018   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:8")
1019   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
1020   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
12461021INPUT_PORTS_END
12471022
12481023static INPUT_PORTS_START( raflesia )
12491024   PORT_INCLUDE( system1_generic )
12501025
12511026   PORT_MODIFY("DSW1")
1252   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1253   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1254   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1255   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1027   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
12561028   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
12571029   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1258   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
1030   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
12591031   PORT_DIPSETTING(   0x0c, "3" )
12601032   PORT_DIPSETTING(   0x08, "4" )
12611033   PORT_DIPSETTING(   0x04, "5" )
12621034   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
1263   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
1035   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5,6")
12641036   PORT_DIPSETTING(   0x30, "20k, 70k and 120k" )
12651037   PORT_DIPSETTING(   0x20, "30k, 80k and 150k" )
12661038   PORT_DIPSETTING(   0x10, "50k, 100k and 200k" )
12671039   PORT_DIPSETTING(   0x00, DEF_STR( None ) )
1268   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) /* Manual lists this dip as "Unused" */
1269   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
1270   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
12711040INPUT_PORTS_END
12721041
12731042static INPUT_PORTS_START( wboy )
r3373r3374
12901059   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
12911060
12921061   PORT_MODIFY("DSW1")
1293   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW B:1")
1294   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1295   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1296   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW B:2")
1062   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
12971063   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
12981064   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1299   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW B:3,4")
1065   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
13001066   PORT_DIPSETTING(   0x0c, "3" )
13011067   PORT_DIPSETTING(   0x08, "4" )
13021068   PORT_DIPSETTING(   0x04, "5" )
13031069   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
1304   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW B:5")
1070   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5")
13051071   PORT_DIPSETTING(   0x10, "30k 100k 170k 240k" )
13061072   PORT_DIPSETTING(   0x00, "30k 120k 210k 300k" )
1307   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW B:6")
1073   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SWB:6")
13081074   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
13091075   PORT_DIPSETTING(   0x20, DEF_STR( Yes ) )
1310   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW B:7")
1076   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:7")
13111077   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
13121078   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
1313   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW B:8")
1314   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
1315   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1079   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SWB:8" )
13161080INPUT_PORTS_END
13171081
13181082static INPUT_PORTS_START( wboy3 )
13191083   PORT_INCLUDE( wboy )
13201084
13211085   PORT_MODIFY("DSW1")  /* DSW0 */
1322   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW B:3,4")
1086   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
13231087   PORT_DIPSETTING(   0x0c, "1" )
13241088   PORT_DIPSETTING(   0x08, "2" )
13251089   PORT_DIPSETTING(   0x04, "3" )
13261090   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
13271091INPUT_PORTS_END
13281092
1329static INPUT_PORTS_START( wboysys2 )
1330   PORT_INCLUDE( chplft )
1331
1332   PORT_MODIFY("P1")
1333   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
1334   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
1335   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* down - unused */
1336   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* up - unused */
1337   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1338   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
1339
1340   PORT_MODIFY("P2")
1341   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1342   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1343   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* down - unused */
1344   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* up - unused */
1345   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1346   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
1347
1348   PORT_MODIFY("DSW2")
1349   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW B:1")
1350   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1351   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1352   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW B:2")
1353   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
1354   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1355   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW B:3,4")
1356   PORT_DIPSETTING(   0x0c, "3" )
1357   PORT_DIPSETTING(   0x08, "4" )
1358   PORT_DIPSETTING(   0x04, "5" )
1359   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
1360   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW B:5")
1361   PORT_DIPSETTING(   0x10, "30k 100k 170k 240k" )
1362   PORT_DIPSETTING(   0x00, "30k 120k 210k 300k" )
1363   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW B:6")
1364   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
1365   PORT_DIPSETTING(   0x20, DEF_STR( Yes ) )
1366   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW B:7")
1367   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
1368   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
1369   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW B:8")
1370   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
1371   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1372INPUT_PORTS_END
1373
13741093/* same as wboy, additional Energy Consumption switch */
13751094static INPUT_PORTS_START( wbdeluxe )
13761095   PORT_INCLUDE( wboy )
13771096
13781097   PORT_MODIFY("P1")
13791098   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* Has to be 0 otherwise the game resets */
1380                                       /* if you die after level 1. */
1099                     /* if you die after level 1. */
13811100   PORT_MODIFY("DSW1")
1382   PORT_DIPNAME( 0x80, 0x00, "Energy Consumption" ) PORT_DIPLOCATION("SW B:8")
1101   PORT_DIPNAME( 0x80, 0x00, "Energy Consumption" )   PORT_DIPLOCATION("SWB:8")
13831102   PORT_DIPSETTING(   0x00, "Slow" )
13841103   PORT_DIPSETTING(   0x80, "Fast" )
13851104INPUT_PORTS_END
r3373r3374
13881107   PORT_INCLUDE( wboy )
13891108
13901109   PORT_MODIFY("DSW2")
1391   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1110   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SWB:1")
13921111   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
13931112   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1394   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) )
1113   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:2,3")
13951114   PORT_DIPSETTING(   0x00, "2" )
13961115   PORT_DIPSETTING(   0x06, "3" )
13971116   PORT_DIPSETTING(   0x04, "4" )
13981117   PORT_DIPSETTING(   0x02, "5" )
1399   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1118   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:4")
14001119   PORT_DIPSETTING(   0x08, DEF_STR( Off ) )
14011120   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1402   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1121   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:5")
14031122   PORT_DIPSETTING(   0x10, DEF_STR( Off ) )
14041123   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1405   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1124   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:6")
14061125   PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
14071126   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1408   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
1127   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:7")
14091128   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
14101129   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1411   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1130   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:8")
14121131   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
14131132   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
14141133
14151134   PORT_MODIFY("DSW1")
1416   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
1135   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SWA:1,2,3")
14171136   PORT_DIPSETTING(   0x04, DEF_STR( 4C_1C ) )
14181137   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
14191138   PORT_DIPSETTING(   0x00, DEF_STR( 4C_2C ) )
r3373r3374
14221141   PORT_DIPSETTING(   0x02, DEF_STR( 2C_2C ) )
14231142   PORT_DIPSETTING(   0x07, DEF_STR( 1C_1C ) )
14241143   PORT_DIPSETTING(   0x03, DEF_STR( 1C_2C ) )
1425   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1144   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWA:4")
14261145   PORT_DIPSETTING(   0x08, DEF_STR( Off ) )
14271146   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1428   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) )
1147   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SWA:5")
14291148   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
14301149   PORT_DIPSETTING(   0x10, DEF_STR( Yes ) )
1431   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1150   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWA:6")
14321151   PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
14331152   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1434   PORT_DIPNAME( 0xc0, 0xc0, "Mode" )
1153   PORT_DIPNAME( 0xc0, 0xc0, "Mode" )         PORT_DIPLOCATION("SWA:7,8")
14351154   PORT_DIPSETTING(   0xc0, "Normal Game" )
14361155   PORT_DIPSETTING(   0x80, DEF_STR( Free_Play ) )
14371156   PORT_DIPSETTING(   0x40, "Test Mode" )
14381157   PORT_DIPSETTING(   0x00, "Endless Game" )
14391158INPUT_PORTS_END
14401159
1160static INPUT_PORTS_START( noboranb )
1161   PORT_INCLUDE( system1_generic )
1162
1163   PORT_MODIFY("P1")
1164   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )            // shot
1165   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )            // fly
1166
1167   PORT_MODIFY("P2")
1168   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL      // shot
1169   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL      // fly
1170
1171   PORT_MODIFY("DSW2")
1172   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SWA:1,2")
1173   PORT_DIPSETTING(   0x00, DEF_STR( 2C_1C ) )
1174   PORT_DIPSETTING(   0x03, DEF_STR( 1C_1C ) )
1175   PORT_DIPSETTING(   0x02, DEF_STR( 1C_2C ) )
1176   PORT_DIPSETTING(   0x01, DEF_STR( 1C_3C ) )
1177   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SWA:3,4")
1178   PORT_DIPSETTING(   0x00, DEF_STR( 2C_1C ) )
1179   PORT_DIPSETTING(   0x0c, DEF_STR( 1C_1C ) )
1180   PORT_DIPSETTING(   0x08, DEF_STR( 1C_2C ) )
1181   PORT_DIPSETTING(   0x04, DEF_STR( 1C_3C ) )
1182   PORT_DIPNAME( 0x30, 0x20, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWA:5,6")
1183   PORT_DIPSETTING(   0x20, DEF_STR( Easy ) )
1184   PORT_DIPSETTING(   0x30, DEF_STR( Medium ) )
1185   PORT_DIPSETTING(   0x10, DEF_STR( Hard ) )
1186   PORT_DIPSETTING(   0x00, DEF_STR( Hardest ) )
1187   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SWA:7")
1188   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1189   PORT_DIPSETTING(   0x40, DEF_STR( Cocktail ) )
1190   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SWA:8")
1191   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1192   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
1193
1194   PORT_MODIFY("DSW1")
1195   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:1,2")
1196   PORT_DIPSETTING(   0x02, "2" )
1197   PORT_DIPSETTING(   0x03, "3" )
1198   PORT_DIPSETTING(   0x01, "5" )
1199   PORT_DIPSETTING(   0x00, "99" )
1200   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:3,4")
1201   PORT_DIPSETTING(   0x08, "40k, 80k, 120k and 160k" )
1202   PORT_DIPSETTING(   0x0c, "50k, 100k and 150k" )
1203   PORT_DIPSETTING(   0x04, "60k, 120k and 180k" )
1204   PORT_DIPSETTING(   0x00, DEF_STR( None ) )
1205   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SWB:5")
1206   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
1207   PORT_DIPSETTING(   0x10, DEF_STR( Yes ) )
1208   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Free_Play ) )   PORT_DIPLOCATION("SWB:6")
1209   PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
1210   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1211   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SWB:8" )
1212INPUT_PORTS_END
1213
1214static INPUT_PORTS_START( chplft )
1215   PORT_INCLUDE( system1_generic )
1216
1217   PORT_MODIFY("DSW1")
1218   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SWA:1,2,3,4")
1219   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
1220   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
1221   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )
1222   PORT_DIPSETTING(    0x05, "2 Coins/1 Credit 5/3 6/4" )
1223   PORT_DIPSETTING(    0x04, "2 Coins/1 Credit 4/3" )
1224   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
1225   PORT_DIPSETTING(    0x01, "1 Coin/1 Credit 2/3" )
1226   PORT_DIPSETTING(    0x02, "1 Coin/1 Credit 4/5" )
1227   PORT_DIPSETTING(    0x03, "1 Coin/1 Credit 5/6" )
1228   PORT_DIPSETTING(    0x06, DEF_STR( 2C_3C ) )
1229   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
1230   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
1231   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
1232   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
1233   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
1234   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SWA:5,6,7,8")
1235   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
1236   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
1237   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
1238   PORT_DIPSETTING(    0x50, "2 Coins/1 Credit 5/3 6/4" )
1239   PORT_DIPSETTING(    0x40, "2 Coins/1 Credit 4/3" )
1240   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
1241   PORT_DIPSETTING(    0x10, "1 Coin/1 Credit 2/3" )
1242   PORT_DIPSETTING(    0x20, "1 Coin/1 Credit 4/5" )
1243   PORT_DIPSETTING(    0x30, "1 Coin/1 Credit 5/6" )
1244   PORT_DIPSETTING(    0x60, DEF_STR( 2C_3C ) )
1245   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
1246   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
1247   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
1248   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
1249   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
1250
1251   PORT_MODIFY("DSW2")
1252   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SWB:1")
1253   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1254   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1255   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
1256   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
1257   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1258   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
1259   PORT_DIPSETTING(   0x08, "2" )
1260   PORT_DIPSETTING(   0x0c, "3" )
1261   PORT_DIPSETTING(   0x04, "4" )
1262   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
1263   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5")
1264   PORT_DIPSETTING(   0x10, "20k 70k 120k 170k" )
1265   PORT_DIPSETTING(   0x00, "50k 100k 150k 200k" )
1266   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:6")
1267   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
1268   PORT_DIPSETTING(   0x20, DEF_STR( Easy ) )
1269   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SWB:7" )
1270   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SWB:8" )
1271INPUT_PORTS_END
1272
1273static INPUT_PORTS_START( shtngmst )
1274   PORT_INCLUDE( chplft )
1275
1276   PORT_MODIFY("P1")
1277   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1278
1279   PORT_MODIFY("P2")
1280   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1281
1282   PORT_MODIFY("DSW2")
1283   PORT_DIPNAME( 0x01, 0x01, "DSW2" )         PORT_DIPLOCATION("SWB:1")
1284   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1285   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1286   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:2")
1287   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1288   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1289   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:3")
1290   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1291   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1292   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:4")
1293   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1294   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1295   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:5")
1296   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1297   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1298   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:6")
1299   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1300   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1301   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:7")
1302   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1303   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1304   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:8")
1305   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1306   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1307
1308   PORT_START("TRIGGER")  /* trigger is in here */
1309   PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
1310   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
1311
1312   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1313   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1314   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1315
1316   PORT_START("GUNX") /* 1c */
1317   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1)
1318
1319   PORT_START("GUNY") /* 1d */
1320   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, -1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_REVERSE
1321
1322   PORT_START("18") /* 18 */
1323   /* what is this? check the game code... */
1324   PORT_DIPNAME( 0x01, 0x01, "port 18" )
1325   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1326   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1327   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1328   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1329   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1330   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1331   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1332   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1333   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1334   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1335   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1336   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1337   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1338   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1339   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1340   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1341   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1342   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1343   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1344   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1345   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1346   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1347   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1348INPUT_PORTS_END
1349
1350static INPUT_PORTS_START( wboysys2 )
1351   PORT_INCLUDE( chplft )
1352
1353   PORT_MODIFY("P1")
1354   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
1355   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
1356   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* down - unused */
1357   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* up - unused */
1358   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1359   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
1360
1361   PORT_MODIFY("P2")
1362   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1363   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1364   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* down - unused */
1365   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* up - unused */
1366   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1367   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
1368
1369   PORT_MODIFY("DSW2")
1370   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
1371   PORT_DIPSETTING(   0x0c, "3" )
1372   PORT_DIPSETTING(   0x08, "4" )
1373   PORT_DIPSETTING(   0x04, "5" )
1374   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
1375   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5")
1376   PORT_DIPSETTING(   0x10, "30k 100k 170k 240k" )
1377   PORT_DIPSETTING(   0x00, "30k 120k 210k 300k" )
1378   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SWB:6")
1379   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
1380   PORT_DIPSETTING(   0x20, DEF_STR( Yes ) )
1381   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:7")
1382   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
1383   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
1384INPUT_PORTS_END
1385
14411386/* Notes about the bootleg version (as this is the only "working" one) :
14421387
14431388Coinage is almost the same as the other Sega games.
r3373r3374
14931438   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(60) PORT_KEYDELTA(15) PORT_REVERSE PORT_COCKTAIL
14941439
14951440   PORT_MODIFY("SYSTEM")
1441   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
14961442   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
14971443   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
14981444
14991445   PORT_MODIFY("DSW2")
1500   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1501   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1502   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1503   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )
1446   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
15041447   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
15051448   PORT_DIPSETTING(   0x02, DEF_STR( On ) )
1506   PORT_DIPNAME( 0x04, 0x04, "Unused SW 0-2" )
1507   PORT_DIPSETTING(   0x04, DEF_STR( Off ) )
1508   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1509   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) )
1449   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:4")
15101450   PORT_DIPSETTING(   0x08, "2" )
15111451   PORT_DIPSETTING(   0x00, "3" )
1512   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )
1452   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5")
15131453   PORT_DIPSETTING(   0x10, "10k 30k 60k 100k 150k" )
15141454   PORT_DIPSETTING(   0x00, "30k 50k 100k 200k 300k" )
1515   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Allow_Continue ) )
1455   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SWB:6")
15161456   PORT_DIPSETTING(   0x20, DEF_STR( No ) )
15171457   PORT_DIPSETTING(   0x00, DEF_STR( Yes ) )
1518   PORT_DIPNAME( 0x40, 0x40, "Unused SW 0-6" )
1519   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
1520   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1521   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
1458   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWB:8" )
15221459INPUT_PORTS_END
15231460
15241461static INPUT_PORTS_START( tokisens )
15251462   PORT_INCLUDE( chplft )
15261463
15271464   PORT_MODIFY("DSW2")
1528   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1529   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1530   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1531   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )
1465   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
15321466   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
15331467   PORT_DIPSETTING(   0x02, DEF_STR( On ) )
1534   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
1468   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
15351469   PORT_DIPSETTING(   0x00, "1" )
15361470   PORT_DIPSETTING(   0x08, "2" )
15371471   PORT_DIPSETTING(   0x0c, "3" )
15381472   PORT_DIPSETTING(   0x04, "4" )
1539   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1473   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:5")
15401474   PORT_DIPSETTING(   0x10, DEF_STR( Off ) )
15411475   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1542   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1476   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:6")
15431477   PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
15441478   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1545   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1479   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:7")
15461480   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
15471481   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1548   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1482   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:8")
15491483   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
15501484   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
15511485INPUT_PORTS_END
r3373r3374
15541488   PORT_INCLUDE( chplft )
15551489
15561490   PORT_MODIFY("DSW2")
1557   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1558   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1559   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1560   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )
1491   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SWB:2")
15611492   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
15621493   PORT_DIPSETTING(   0x02, DEF_STR( On ) )
1563   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
1494   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
15641495   PORT_DIPSETTING(   0x04, "3" )
15651496   PORT_DIPSETTING(   0x0c, "4" )
15661497   PORT_DIPSETTING(   0x08, "5" )
15671498/* 0x00 gives 4 lives */
1568   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )
1499   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SWB:5")
15691500   PORT_DIPSETTING(   0x10, "30000 100000 200000" )
15701501   PORT_DIPSETTING(   0x00, "50000 150000 250000" )
1571   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) )
1502   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:6")
15721503   PORT_DIPSETTING(   0x20, DEF_STR( Easy ) )
15731504   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
1574   PORT_DIPNAME( 0x40, 0x40, "Test Mode" )
1505   PORT_DIPNAME( 0x40, 0x40, "Test Mode" )         PORT_DIPLOCATION("SWB:7")
15751506   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
15761507   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1577   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1508   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:8")
15781509   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
15791510   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
15801511INPUT_PORTS_END
15811512
1582static INPUT_PORTS_START( noboranb )
1583   PORT_INCLUDE( system1_generic )
1584
1585   PORT_MODIFY("P1")
1586   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )            // shot
1587   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )            // fly
1588
1589   PORT_MODIFY("P2")
1590   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL      // shot
1591   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL      // fly
1592
1593   PORT_MODIFY("DSW2")
1594   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
1595   PORT_DIPSETTING(   0x00, DEF_STR( 2C_1C ) )
1596   PORT_DIPSETTING(   0x03, DEF_STR( 1C_1C ) )
1597   PORT_DIPSETTING(   0x02, DEF_STR( 1C_2C ) )
1598   PORT_DIPSETTING(   0x01, DEF_STR( 1C_3C ) )
1599   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
1600   PORT_DIPSETTING(   0x00, DEF_STR( 2C_1C ) )
1601   PORT_DIPSETTING(   0x0c, DEF_STR( 1C_1C ) )
1602   PORT_DIPSETTING(   0x08, DEF_STR( 1C_2C ) )
1603   PORT_DIPSETTING(   0x04, DEF_STR( 1C_3C ) )
1604   PORT_DIPNAME( 0x30, 0x20, DEF_STR( Difficulty ) )
1605   PORT_DIPSETTING(   0x20, DEF_STR( Easy ) )
1606   PORT_DIPSETTING(   0x30, DEF_STR( Medium ) )
1607   PORT_DIPSETTING(   0x10, DEF_STR( Hard ) )
1608   PORT_DIPSETTING(   0x00, DEF_STR( Hardest ) )
1609   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
1610   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1611   PORT_DIPSETTING(   0x40, DEF_STR( Cocktail ) )
1612   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Flip_Screen ) )
1613   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1614   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
1615
1616   PORT_MODIFY("DSW1")
1617   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
1618   PORT_DIPSETTING(   0x02, "2" )
1619   PORT_DIPSETTING(   0x03, "3" )
1620   PORT_DIPSETTING(   0x01, "5" )
1621   PORT_DIPSETTING(   0x00, "99" )
1622   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
1623   PORT_DIPSETTING(   0x08, "40k, 80k, 120k and 160k" )
1624   PORT_DIPSETTING(   0x0c, "50k, 100k and 150k" )
1625   PORT_DIPSETTING(   0x04, "60k, 120k and 180k" )
1626   PORT_DIPSETTING(   0x00, DEF_STR( None ) )
1627   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) )
1628   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
1629   PORT_DIPSETTING(   0x10, DEF_STR( Yes ) )
1630   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Free_Play ) )
1631   PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
1632   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1633   PORT_DIPNAME( 0x40, 0x40, "Unused SW 0-6" )
1634   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
1635   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1636   PORT_DIPNAME( 0x80, 0x80, "Unused SW 0-7" )
1637   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
1638   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1639INPUT_PORTS_END
1640
16411513/*
16421514
16431515 To enter Test Mode all DIP Switches in DSW1 must be ON (example Difficulty = Easy)
r3373r3374
16541526   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
16551527
16561528   PORT_MODIFY("DSW2")
1657   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Difficulty ) )
1529   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:1,2")
16581530   PORT_DIPSETTING(   0x00, DEF_STR( Easy ) )
16591531   PORT_DIPSETTING(   0x01, DEF_STR( Normal ) )
16601532   PORT_DIPSETTING(   0x02, DEF_STR( Hard ) )
16611533   PORT_DIPSETTING(   0x03, DEF_STR( Hardest ) )
1662   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
1534   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )      PORT_DIPLOCATION("SWB:3,4")
16631535   PORT_DIPSETTING(   0x0c, "3" )
16641536   PORT_DIPSETTING(   0x04, "4" )
16651537//  PORT_DIPSETTING(    0x08, "4" )
16661538   PORT_DIPSETTING(   0x00, "5" )
1667   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) )
1539   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SWB:5")
16681540   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
16691541   PORT_DIPSETTING(   0x10, DEF_STR( Cocktail ) )
1670   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Allow_Continue ) )
1542   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SWB:6")
16711543   PORT_DIPSETTING(   0x20, DEF_STR( No ) )
16721544   PORT_DIPSETTING(   0x00, DEF_STR( Yes ) )
1673   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1545   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SWB:7")
16741546   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
16751547   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1676   PORT_DIPNAME( 0x80, 0x80, "Invulnerability" )
1548   PORT_DIPNAME( 0x80, 0x80, "Invulnerability" )      PORT_DIPLOCATION("SWB:8")
16771549   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
16781550   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
16791551INPUT_PORTS_END
src/mame/drivers/niyanpai.c
r3373r3374
184184static WRITE8_HANDLER( tmpz84c011_0_dir_pe_w )   { pio_dir[4] = data; }
185185
186186
187static void ctc0_interrupt(running_machine *machine, int state)
187static void ctc0_interrupt(const device_config *device, int state)
188188{
189   cpunum_set_input_line(machine, 1, 0, state);
189   cputag_set_input_line(device->machine, "audio", 0, state);
190190}
191191
192192static z80ctc_interface ctc_intf =
193193{
194   1,               /* clock */
194   "audio",         /* clock from the audio CPU */
195   0,               /* clock */
195196   0,               /* timer disables */
196197   ctc0_interrupt,      /* interrupt handler */
197   z80ctc_0_trg3_w,   /* ZC/TO0 callback ctc1.zc0 -> ctc1.trg3 */
198   z80ctc_trg3_w,      /* ZC/TO0 callback ctc1.zc0 -> ctc1.trg3 */
198199   0,               /* ZC/TO1 callback */
199200   0,               /* ZC/TO2 callback */
200201};
201202
202static void tmpz84c011_init(running_machine *machine)
203{
204   // initialize the CTC
205   ctc_intf.baseclock = cpunum_get_clock(1);
206   z80ctc_init(0, &ctc_intf);
207}
208
209203static MACHINE_RESET( niyanpai )
210204{
211205   int i;
r3373r3374
232226   // sound program patch
233227   SNDROM[0x0213] = 0x00;         // DI -> NOP
234228
235   // initialize TMPZ84C011 PIO and CTC
236   tmpz84c011_init(machine);
237
238229   // initialize sound rom bank
239230   niyanpai_soundbank_w(machine, 0);
240231
r3373r3374
494485
495486static ADDRESS_MAP_START( sound_io_map, ADDRESS_SPACE_IO, 8 )
496487   ADDRESS_MAP_GLOBAL_MASK(0xff)
497   AM_RANGE(0x10, 0x13) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
488   AM_RANGE(0x10, 0x13) AM_DEVREADWRITE(Z80CTC, "ctc", z80ctc_r, z80ctc_w)
498489   AM_RANGE(0x50, 0x50) AM_READWRITE(tmpz84c011_0_pa_r, tmpz84c011_0_pa_w)
499490   AM_RANGE(0x51, 0x51) AM_READWRITE(tmpz84c011_0_pb_r, tmpz84c011_0_pb_w)
500491   AM_RANGE(0x52, 0x52) AM_READWRITE(tmpz84c011_0_pc_r, tmpz84c011_0_pc_w)
r3373r3374
866857   cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
867858}
868859
869static const struct z80_irq_daisy_chain daisy_chain_sound[] =
860static const z80_daisy_chain daisy_chain_sound[] =
870861{
871   { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti, 0 },   /* device 0 = CTC_1 */
872   { 0, 0, 0, 0, -1 }      /* end mark */
862   { Z80CTC, "ctc" },
863   { NULL }
873864};
874865
875866
r3373r3374
885876   MDRV_CPU_PROGRAM_MAP(sound_readmem, sound_writemem)
886877   MDRV_CPU_IO_MAP(sound_io_map,0)
887878
879   MDRV_Z80CTC_ADD("ctc", ctc_intf)
880
888881   MDRV_MACHINE_RESET(niyanpai)
889882   MDRV_NVRAM_HANDLER(generic_0fill)
890883
src/mame/drivers/paradise.c
r3373r3374
714714
715715   ROM_REGION( 0x100000, "gfx3", ROMREGION_DISPOSE | ROMREGION_INVERT)   /* 8x8x8 Foreground */
716716   ROM_LOAD( "pdx2_u092.bin", 0x00000, 0x80000, CRC(d6797812) SHA1(b2d463b5932501382abcbbd911c492b6671c3cf7) )
717   ROM_LOAD( "pdx2_u093.bin", 0xc0000, 0x20000, BAD_DUMP CRC(36f4f8b2) SHA1(7d6a6bdeb867ab5105097a6efbb219ce5e922bb9) ) // wrong size!
717   ROM_LOAD( "pdx2_u093.bin", 0x80000, 0x80000, CRC(7644b8e9) SHA1(5f570c565523748afddc37f9ddd276c83f6b7d19) )
718718
719719   ROM_REGION( 0x40000, "gfx4", ROMREGION_DISPOSE | ROMREGION_INVERT)   /* 8x8x8 Midground */
720720   ROM_LOAD( "pdx2_u110.bin", 0x00000, 0x20000, CRC(59e828d1) SHA1(fd76c5a74e1be22bde52bcfbce179dc73591bec3) )
src/mame/drivers/dribling.c
r3373r3374
6666 *
6767 *************************************/
6868
69static READ8_HANDLER( dsr_r )
69static READ8_DEVICE_HANDLER( dsr_r )
7070{
7171   /* return DSR0-7 */
7272   return (ds << sh) | (dr >> (8 - sh));
7373}
7474
7575
76static READ8_HANDLER( input_mux0_r )
76static READ8_DEVICE_HANDLER( input_mux0_r )
7777{
7878   /* low value in the given bit selects */
7979   if (!(input_mux & 0x01))
80      return input_port_read(machine, "MUX0");
80      return input_port_read(device->machine, "MUX0");
8181   else if (!(input_mux & 0x02))
82      return input_port_read(machine, "MUX1");
82      return input_port_read(device->machine, "MUX1");
8383   else if (!(input_mux & 0x04))
84      return input_port_read(machine, "MUX2");
84      return input_port_read(device->machine, "MUX2");
8585   return 0xff;
8686}
8787
r3373r3374
9393 *
9494 *************************************/
9595
96static WRITE8_HANDLER( misc_w )
96static WRITE8_DEVICE_HANDLER( misc_w )
9797{
9898   /* bit 7 = di */
9999   di = (data >> 7) & 1;
100100   if (!di)
101      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
101      cpunum_set_input_line(device->machine, 0, 0, CLEAR_LINE);
102102
103103   /* bit 6 = parata */
104104
r3373r3374
116116}
117117
118118
119static WRITE8_HANDLER( sound_w )
119static WRITE8_DEVICE_HANDLER( sound_w )
120120{
121121   /* bit 7 = stop palla */
122122   /* bit 6 = contrasto */
r3373r3374
130130}
131131
132132
133static WRITE8_HANDLER( pb_w )
133static WRITE8_DEVICE_HANDLER( pb_w )
134134{
135135   /* write PB0-7 */
136136   logerror("%04X:pb_w(%02X)\n", activecpu_get_previouspc(), data);
137137}
138138
139139
140static WRITE8_HANDLER( shr_w )
140static WRITE8_DEVICE_HANDLER( shr_w )
141141{
142142   /* bit 3 = watchdog */
143143   if (data & 0x08)
144      watchdog_reset(machine);
144      watchdog_reset(device->machine);
145145
146146   /* bit 2-0 = SH0-2 */
147147   sh = data & 0x07;
r3373r3374
158158static READ8_HANDLER( ioread )
159159{
160160   if (offset & 0x08)
161      return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset & 3);
161      return ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_0"), offset & 3);
162162   else if (offset & 0x10)
163      return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset & 3);
163      return ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_1"), offset & 3);
164164   return 0xff;
165165}
166166
r3373r3374
168168static WRITE8_HANDLER( iowrite )
169169{
170170   if (offset & 0x08)
171      ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset & 3, data);
171      ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_0"), offset & 3, data);
172172   else if (offset & 0x10)
173      ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset & 3, data);
173      ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_1"), offset & 3, data);
174174   else if (offset & 0x40)
175175   {
176176      dr = ds;
r3373r3374
199199   {
200200      NULL,
201201      NULL,
202      input_port_3_r,
202      DEVICE8_PORT("IN0"),
203203      sound_w,
204204      pb_w,
205205      shr_w
r3373r3374
300300   MDRV_CPU_IO_MAP(io_map,0)
301301   MDRV_CPU_VBLANK_INT("main", dribling_irq_gen)
302302
303   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
304   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
303   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
304   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
305305
306   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
307   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
308
309306   /* video hardware */
310307   MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
311308
src/mame/drivers/filetto.c
r3373r3374
420420static UINT8 port_b_data;
421421static UINT8 wss1_data,wss2_data;
422422
423static READ8_HANDLER( port_a_r )
423static READ8_DEVICE_HANDLER( port_a_r )
424424{
425425   if(!(port_b_data & 0x80))//???
426426   {
r3373r3374
436436   }
437437   else//keyboard emulation
438438   {
439      cpunum_set_input_line(machine, 0,1,PULSE_LINE);
439      cpunum_set_input_line(device->machine, 0,1,PULSE_LINE);
440440      return 0x00;//Keyboard is disconnected
441441      //return 0xaa;//Keyboard code
442442   }
443443}
444444
445static READ8_HANDLER( port_b_r )
445static READ8_DEVICE_HANDLER( port_b_r )
446446{
447447   return port_b_data;
448448}
449449
450static READ8_HANDLER( port_c_r )
450static READ8_DEVICE_HANDLER( port_c_r )
451451{
452452   return wss2_data;//???
453453}
454454
455static WRITE8_HANDLER( port_b_w )
455static WRITE8_DEVICE_HANDLER( port_b_w )
456456{
457457   port_b_data = data;
458458}
459459
460static WRITE8_HANDLER( wss_1_w )
460static WRITE8_DEVICE_HANDLER( wss_1_w )
461461{
462462   wss1_data = data;
463463}
464464
465static WRITE8_HANDLER( wss_2_w )
465static WRITE8_DEVICE_HANDLER( wss_2_w )
466466{
467467   wss2_data = data;
468468}
469469
470static WRITE8_HANDLER( sys_reset_w )
470static WRITE8_DEVICE_HANDLER( sys_reset_w )
471471{
472   cpunum_set_input_line(machine, 0,INPUT_LINE_RESET,PULSE_LINE);
472   cpunum_set_input_line(device->machine, 0,INPUT_LINE_RESET,PULSE_LINE);
473473}
474474
475475
r3373r3374
752752   MDRV_DEVICE_ADD( "pit8253", PIT8253 )
753753   MDRV_DEVICE_CONFIG( pc_pit8253_config )
754754
755   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
756   MDRV_DEVICE_CONFIG( filetto_ppi8255_intf[0] )
755   MDRV_PPI8255_ADD( "ppi8255_0", filetto_ppi8255_intf[0] )
756   MDRV_PPI8255_ADD( "ppi8255_1", filetto_ppi8255_intf[1] )
757757
758   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
759   MDRV_DEVICE_CONFIG( filetto_ppi8255_intf[1] )
760
761758   MDRV_GFXDECODE(filetto)
762759
763760   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/findout.c
r3373r3374
5959}
6060
6161
62static READ8_HANDLER( portC_r )
62static READ8_DEVICE_HANDLER( portC_r )
6363{
6464   return 4;
6565}
6666
67static READ8_HANDLER( port1_r )
67static READ8_DEVICE_HANDLER( port1_r )
6868{
69   return input_port_read(machine, "IN0") | (ticket_dispenser_0_r(machine, 0) >> 5);
69   return input_port_read(device->machine, "IN0") | (ticket_dispenser_0_r(device->machine, 0) >> 5);
7070}
7171
72static WRITE8_HANDLER( lamps_w )
72static WRITE8_DEVICE_HANDLER( lamps_w )
7373{
7474   /* 5 button lamps */
7575   set_led_status(0,data & 0x01);
r3373r3374
8383   set_led_status(7,data & 0x80);
8484}
8585
86static WRITE8_HANDLER( sound_w )
86static WRITE8_DEVICE_HANDLER( sound_w )
8787{
8888   /* bit 3 - coin lockout (lamp6 in test modes, set to lamp 10 as in getrivia.c) */
8989   coin_lockout_global_w(~data & 0x08);
9090   set_led_status(9,data & 0x08);
9191
9292   /* bit 5 - ticket out in trivia games */
93   ticket_dispenser_w(machine, 0, (data & 0x20)<< 2);
93   ticket_dispenser_w(device->machine, 0, (data & 0x20)<< 2);
9494
9595   /* bit 6 enables NMI */
96   interrupt_enable_w(machine, 0,data & 0x40);
96   interrupt_enable_w(device->machine, 0,data & 0x40);
9797
9898   /* bit 7 goes directly to the sound amplifier */
9999   dac_data_w(0,((data & 0x80) >> 7) * 255);
r3373r3374
105105static const ppi8255_interface ppi8255_intf[2] =
106106{
107107   {
108      input_port_0_r,            /* Port A read */
108      DEVICE8_PORT("DSWA"),      /* Port A read */
109109      port1_r,               /* Port B read */
110110      NULL,                  /* Port C read */
111111      NULL,                  /* Port A write */
r3373r3374
113113      sound_w,               /* Port C write */
114114   },
115115   {
116      input_port_2_r,            /* Port A read */
116      DEVICE8_PORT("IN1"),      /* Port A read */
117117      NULL,                  /* Port B read */
118118      portC_r,               /* Port C read */
119119      NULL,                  /* Port A write */
r3373r3374
471471   MDRV_VIDEO_START(generic_bitmapped)
472472   MDRV_VIDEO_UPDATE(generic_bitmapped)
473473
474   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
475   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
474   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
475   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
476476
477   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
478   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
479
480477   /* sound hardware */
481478   MDRV_SPEAKER_STANDARD_MONO("mono")
482479
src/mame/drivers/superdq.c
r3373r3374
4848
4949static VIDEO_UPDATE( superdq )
5050{
51   render_container_set_palette_alpha(render_container_get_screen(screen), 0, 0x00);
52
5351   tilemap_draw(bitmap,cliprect,superdq_tilemap,0,0);
5452
5553   return 0;
r3373r3374
142140
143141   superdq_color_bank = ( data & 2 ) ? 1 : 0;
144142
145   for( i = 0; i < sizeof( black_color_entries ); i++ )
146      render_container_set_palette_alpha(render_container_get_screen(machine->primary_screen), black_color_entries[i], (data&0x80) ? 0x00 : 0xff );
143   for( i = 0; i < ARRAY_LENGTH( black_color_entries ); i++ )
144   {
145      int index = black_color_entries[i];
146      if (data & 0x80)
147         palette_set_color(machine, index, palette_get_color(machine, index) & MAKE_ARGB(0,255,255,255));
148      else
149         palette_set_color(machine, index, palette_get_color(machine, index) | MAKE_ARGB(255,0,0,0));
150   }
147151
148152   /*
149153        bit 5 = DISP1?
src/mame/drivers/zaxxon.c
r3373r3374
933933};
934934
935935
936static READ8_DEVICE_HANDLER( sound_latch_r ) { return soundlatch_r(device->machine, offset); }
937
936938static const ppi8255_interface congo_ppi_intf =
937939{
938   soundlatch_r,
940   sound_latch_r,
939941   NULL,
940942   NULL,
941943   NULL,
r3373r3374
990992
991993   MDRV_MACHINE_START(zaxxon)
992994
993   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
994   MDRV_DEVICE_CONFIG( zaxxon_ppi_intf )
995   MDRV_PPI8255_ADD( "ppi8255", zaxxon_ppi_intf )
995996
996997   /* video hardware */
997998   MDRV_GFXDECODE(zaxxon)
r3373r3374
10491050   MDRV_CPU_MODIFY("main")
10501051   MDRV_CPU_PROGRAM_MAP(congo_map, 0)
10511052
1052   MDRV_DEVICE_MODIFY( "ppi8255", PPI8255 )
1053   MDRV_DEVICE_CONFIG( congo_ppi_intf )
1053   MDRV_PPI8255_RECONFIG( "ppi8255", congo_ppi_intf )
10541054
10551055   MDRV_CPU_ADD("audio", Z80, SOUND_CLOCK)
10561056   MDRV_CPU_PROGRAM_MAP(congo_sound_map,0)
src/mame/drivers/segaorun.c
r3373r3374
6060static READ16_HANDLER( misc_io_r );
6161static WRITE16_HANDLER( misc_io_w );
6262
63static READ8_HANDLER( unknown_porta_r );
64static READ8_HANDLER( unknown_portb_r );
65static READ8_HANDLER( unknown_portc_r );
66static WRITE8_HANDLER( unknown_porta_w );
67static WRITE8_HANDLER( unknown_portb_w );
68static WRITE8_HANDLER( video_control_w );
63static READ8_DEVICE_HANDLER( unknown_porta_r );
64static READ8_DEVICE_HANDLER( unknown_portb_r );
65static READ8_DEVICE_HANDLER( unknown_portc_r );
66static WRITE8_DEVICE_HANDLER( unknown_porta_w );
67static WRITE8_DEVICE_HANDLER( unknown_portb_w );
68static WRITE8_DEVICE_HANDLER( video_control_w );
6969
7070
7171
r3373r3374
287287}
288288
289289
290static READ8_HANDLER( unknown_porta_r )
290static READ8_DEVICE_HANDLER( unknown_porta_r )
291291{
292292   log_unknown_ppi_read(0);
293293   return 0;
294294}
295295
296296
297static READ8_HANDLER( unknown_portb_r )
297static READ8_DEVICE_HANDLER( unknown_portb_r )
298298{
299299   log_unknown_ppi_read(1);
300300   return 0;
301301}
302302
303303
304static READ8_HANDLER( unknown_portc_r )
304static READ8_DEVICE_HANDLER( unknown_portc_r )
305305{
306306   log_unknown_ppi_read(2);
307307   return 0;
308308}
309309
310310
311static WRITE8_HANDLER( unknown_porta_w )
311static WRITE8_DEVICE_HANDLER( unknown_porta_w )
312312{
313313   log_unknown_ppi_write(0, data);
314314}
315315
316316
317static WRITE8_HANDLER( unknown_portb_w )
317static WRITE8_DEVICE_HANDLER( unknown_portb_w )
318318{
319319   log_unknown_ppi_write(1, data);
320320}
321321
322322
323static WRITE8_HANDLER( video_control_w )
323static WRITE8_DEVICE_HANDLER( video_control_w )
324324{
325325   /* Output port:
326326        D7: SG1 -- connects to sprite chip
r3373r3374
330330        D1: (CONT) - affects sprite hardware
331331        D0: Sound section reset (1= normal operation, 0= reset)
332332    */
333   segaic16_set_display_enable(machine, data & 0x20);
333   segaic16_set_display_enable(device->machine, data & 0x20);
334334   adc_select = (data >> 2) & 7;
335   cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
335   cpunum_set_input_line(device->machine, 2, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
336336}
337337
338338
r3373r3374
369369   switch (offset & 0x70/2)
370370   {
371371      case 0x00/2:
372         return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), offset & 3);
372         return ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255"), offset & 3);
373373
374374      case 0x10/2:
375375      {
r3373r3374
399399   {
400400      case 0x00/2:
401401         if (ACCESSING_BITS_0_7)
402            ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), offset & 3, data);
402            ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255"), offset & 3, data);
403403         return;
404404
405405      case 0x20/2:
r3373r3374
818818   MDRV_MACHINE_RESET(outrun)
819819   MDRV_INTERLEAVE(100)
820820
821   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
822   MDRV_DEVICE_CONFIG( single_ppi_intf )
821   MDRV_PPI8255_ADD( "ppi8255", single_ppi_intf )
823822
824823   /* video hardware */
825824   MDRV_GFXDECODE(segaorun)
src/mame/drivers/20pacgal.c
r3373r3374
3131          the Z180, but the cpu core doesn't support that yet.
3232        * Is the clock divide 3 or 4?
3333
34    Versions known to exist but not dumped: v1.03 & v1.04
34    Versions known to exist but not dumped: v1.03
3535
3636***************************************************************************/
3737
r3373r3374
324324 *
325325 *************************************/
326326
327ROM_START( 20pacgal ) /* Version 1.01 */
327ROM_START( 20pacgal ) /* Version 1.04 */
328328   ROM_REGION( 0x100000, "main", 0 )
329   ROM_LOAD( "20th_104.u13", 0x00000, 0x40000, CRC(6c474d2d) SHA1(5a150fc9d2ed0e908385b9f9d532aa33cf80dba4) )
330
331   ROM_REGION( 0x8000, "proms", 0 )   /* palette */
332   ROM_LOAD( "20th_101.u14", 0x0000, 0x8000, CRC(c19d9ad0) SHA1(002581fbc2c32cdf7cfb0b0f64061591a462ec14) )
333ROM_END
334
335ROM_START( 20pacgaa ) /* Version 1.01 */
336   ROM_REGION( 0x100000, "main", 0 )
329337   ROM_LOAD( "20th_101.u13", 0x00000, 0x40000, CRC(77159582) SHA1(c05e005a941cbdc806dcd76b315069362c792a72) )
330338
331339   ROM_REGION( 0x8000, "proms", 0 )   /* palette */
r3373r3374
340348 *
341349 *************************************/
342350
343GAME( 2000, 20pacgal, 0, 20pacgal, 20pacgal, 0, ROT90, "Namco", "Ms. Pac-Man/Galaga - 20 Year Reunion", GAME_IMPERFECT_GRAPHICS )
351GAME( 2000, 20pacgal,         0, 20pacgal, 20pacgal, 0, ROT90, "Namco", "Ms. Pac-Man/Galaga - 20 Year Reunion (V1.04)", GAME_IMPERFECT_GRAPHICS )
352GAME( 2000, 20pacgaa,  20pacgal, 20pacgal, 20pacgal, 0, ROT90, "Namco", "Ms. Pac-Man/Galaga - 20 Year Reunion (V1.01)", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/mcr3.c
r3373r3374
470470   AM_RANGE(0x04, 0x04) AM_MIRROR(0x78) AM_READ_PORT("MONO.IP4")
471471   AM_RANGE(0x05, 0x05) AM_MIRROR(0x78) AM_WRITE(mcrmono_control_port_w)
472472   AM_RANGE(0x07, 0x07) AM_MIRROR(0x78) AM_WRITE(watchdog_reset_w)
473   AM_RANGE(0xf0, 0xf3) AM_MIRROR(0x0c) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
473   AM_RANGE(0xf0, 0xf3) AM_MIRROR(0x0c) AM_DEVREADWRITE(Z80CTC, "ctc", z80ctc_r, z80ctc_w)
474474ADDRESS_MAP_END
475475
476476
r3373r3374
500500   AM_RANGE(0x84, 0x86) AM_WRITE(mcr_scroll_value_w)
501501   AM_RANGE(0xe0, 0xe0) AM_WRITE(watchdog_reset_w)
502502   AM_RANGE(0xe8, 0xe8) AM_WRITE(SMH_NOP)
503   AM_RANGE(0xf0, 0xf3) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
503   AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE(Z80CTC, "ctc", z80ctc_r, z80ctc_w)
504504ADDRESS_MAP_END
505505
506506
r3373r3374
10561056   MDRV_CPU_CONFIG(mcr_daisy_chain)
10571057   MDRV_CPU_VBLANK_INT_HACK(mcr_interrupt,2)
10581058
1059   MDRV_Z80CTC_ADD("ctc", mcr_ctc_intf)
1060
10591061   MDRV_WATCHDOG_VBLANK_INIT(16)
10601062   MDRV_MACHINE_START(mcr)
10611063   MDRV_MACHINE_RESET(mcr)
src/mame/drivers/pipeline.c
r3373r3374
168168
169169INPUT_PORTS_END
170170
171static WRITE8_HANDLER(vidctrl_w)
171static WRITE8_DEVICE_HANDLER(vidctrl_w)
172172{
173173   vidctrl=data;
174174}
r3373r3374
197197   vram1[offset]=data;
198198}
199199
200static READ8_HANDLER(protection_r)
200static READ8_DEVICE_HANDLER(protection_r)
201201{
202202   return fromMCU;
203203}
r3373r3374
207207   toMCU = param;
208208}
209209
210static WRITE8_HANDLER(protection_w)
210static WRITE8_DEVICE_HANDLER(protection_w)
211211{
212212   timer_call_after_resynch(NULL, data, protection_deferred_w);
213213   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
r3373r3374
232232
233233static ADDRESS_MAP_START( sound_port, ADDRESS_SPACE_IO, 8 )
234234   ADDRESS_MAP_GLOBAL_MASK(0xff)
235   AM_RANGE(0x00, 0x03) AM_READ(z80ctc_0_r) AM_WRITE(z80ctc_0_w)
235   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE(Z80CTC, "ctc", z80ctc_r, z80ctc_w)
236236   AM_RANGE(0x06, 0x07) AM_NOP
237237ADDRESS_MAP_END
238238
r3373r3374
285285   GFXDECODE_ENTRY( "gfx2", 0, layout_8x8x3, 0x100, 32 ) // 3bpp tiles
286286GFXDECODE_END
287287
288static void ctc0_interrupt(running_machine *machine, int state)
288static void ctc0_interrupt(const device_config *device, int state)
289289{
290   cpunum_set_input_line(machine, 1, 0, state);
290   cputag_set_input_line(device->machine, "audio", 0, state);
291291}
292292
293static z80ctc_interface ctc_intf =
293static const z80ctc_interface ctc_intf =
294294{
295   1,               // clock
295   "audio",         // clock from audio CPU
296   0,               // clock
296297   0,               // timer disables
297298   ctc0_interrupt,      // interrupt handler
298299   0,               // ZC/TO0 callback
r3373r3374
300301   0,               // ZC/TO2 callback
301302};
302303
303static const struct z80_irq_daisy_chain daisy_chain_sound[] =
304static const z80_daisy_chain daisy_chain_sound[] =
304305{
305   { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti, 0 },   /* device 0 = CTC_1 */
306   { 0, 0, 0, 0, -1 }      /* end mark */
306   { Z80CTC, "ctc" },
307   { NULL }
307308};
308309
309310static const ppi8255_interface ppi8255_intf[3] =
310311{
311312   {
312      input_port_0_r,            /* Port A read */
313      DEVICE8_PORT("P1"),         /* Port A read */
313314      NULL,                  /* Port B read */
314315      NULL,                  /* Port C read */
315316      NULL,                  /* Port A write */
r3373r3374
317318      vidctrl_w               /* Port C write */
318319   },
319320   {
320      input_port_1_r,            /* Port A read */
321      input_port_2_r,            /* Port B read */
321      DEVICE8_PORT("DSW1"),      /* Port A read */
322      DEVICE8_PORT("DSW2"),      /* Port B read */
322323      protection_r,            /* Port C read */
323324      NULL,                  /* Port A write */
324325      NULL,                  /* Port B write */
r3373r3374
363364   }
364365}
365366
366static MACHINE_RESET( pipeline )
367{
368   ctc_intf.baseclock = cpunum_get_clock(0);
369   z80ctc_init(0, &ctc_intf);
370}
371
372367static MACHINE_DRIVER_START( pipeline )
373368   /* basic machine hardware */
374369
r3373r3374
384379   MDRV_CPU_ADD("mcu", M68705, 7372800/2)
385380   MDRV_CPU_PROGRAM_MAP(mcu_mem, 0)
386381
387   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
388   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
382   MDRV_Z80CTC_ADD( "ctc", ctc_intf )
389383
390   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
391   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
384   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
385   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
386   MDRV_PPI8255_ADD( "ppi8255_2", ppi8255_intf[2] )
392387
393   MDRV_DEVICE_ADD( "ppi8255_2", PPI8255 )
394   MDRV_DEVICE_CONFIG( ppi8255_intf[2] )
395
396388   /* video hardware */
397389   MDRV_SCREEN_ADD("main", RASTER)
398390   MDRV_SCREEN_REFRESH_RATE(60)
r3373r3374
403395
404396   MDRV_GFXDECODE(pipeline)
405397
406   MDRV_MACHINE_RESET(pipeline)
407
408398   MDRV_PALETTE_INIT(pipeline)
409399   MDRV_PALETTE_LENGTH(0x100+0x100)
410400
src/mame/drivers/scobra.c
r3373r3374
592592   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
593593   PORT_DIPSETTING(    0x00, "3" )
594594   PORT_DIPSETTING(    0x02, "5" )
595   PORT_BIT( 0xfc, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10)   /* scrambled dial */
595   PORT_BIT( 0xfc, 0x00, IPT_SPECIAL ) PORT_CUSTOM(darkplnt_custom_r, "DIAL")   /* scrambled dial */
596596
597597   PORT_START("IN2")
598598   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3373r3374
608608   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
609609   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
610610   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
611
612   PORT_START("DIAL")
613   PORT_BIT( 0xfc, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10)   /* scrambled dial */
611614INPUT_PORTS_END
612615
613616static INPUT_PORTS_START( tazmania )
r3373r3374
10911094
10921095   MDRV_MACHINE_RESET(scramble)
10931096
1094   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1095   MDRV_DEVICE_CONFIG( scramble_ppi_ppi8255_intf[0] )
1097   MDRV_PPI8255_ADD( "ppi8255_0", scramble_ppi_0_intf )
1098   MDRV_PPI8255_ADD( "ppi8255_1", scramble_ppi_1_intf )
10961099
1097   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1098   MDRV_DEVICE_CONFIG( scramble_ppi_ppi8255_intf[1] )
1099
11001100   /* video hardware */
11011101   MDRV_SCREEN_ADD("main", RASTER)
11021102   MDRV_SCREEN_REFRESH_RATE(16000.0/132/2)
r3373r3374
11831183   MDRV_IMPORT_FROM(type2)
11841184
11851185   /* device config overrides */
1186   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
1187   MDRV_DEVICE_CONFIG( stratgyx_ppi8255_intf[0] )
1186   MDRV_PPI8255_RECONFIG( "ppi8255_1", stratgyx_ppi_1_intf )
11881187
1189   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
1190   MDRV_DEVICE_CONFIG( stratgyx_ppi8255_intf[1] )
1191
11921188   /* video hardware */
11931189   MDRV_PALETTE_LENGTH(32+64+2+8)   /* 32 for characters, 64 for stars, 2 for bullets, 8 for background */
11941190
r3373r3374
12021198   /* basic machine hardware */
12031199   MDRV_IMPORT_FROM(type2)
12041200
1205   /* device config overrides */
1206   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
1207   MDRV_DEVICE_CONFIG( darkplnt_ppi8255_intf[0] )
1208
1209   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
1210   MDRV_DEVICE_CONFIG( darkplnt_ppi8255_intf[1] )
1211
12121201   /* video hardware */
12131202   MDRV_PALETTE_LENGTH(32+64+2) /* 32 for characters, 64 (buffer) for stars, 2 for bullets */
12141203
r3373r3374
12301219   MDRV_MACHINE_RESET(scramble)
12311220
12321221   /* device config overrides */
1233   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1234   MDRV_DEVICE_CONFIG( scramble_ppi_ppi8255_intf[0] )
1222   MDRV_PPI8255_ADD( "ppi8255_0", scramble_ppi_0_intf )
1223   MDRV_PPI8255_ADD( "ppi8255_1", scramble_ppi_1_intf )
12351224
1236   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1237   MDRV_DEVICE_CONFIG( scramble_ppi_ppi8255_intf[1] )
1238
12391225   /* video hardware */
12401226   MDRV_SCREEN_ADD("main", RASTER)
12411227   MDRV_SCREEN_REFRESH_RATE(16000.0/132/2)
src/mame/drivers/galaxian.c
r3373r3374
318318}
319319
320320
321static WRITE8_HANDLER( konami_sound_control_w )
321static WRITE8_DEVICE_HANDLER( konami_sound_control_w )
322322{
323323   UINT8 old = konami_sound_control;
324324   konami_sound_control = data;
r3373r3374
326326   /* the inverse of bit 3 clocks the flip flop to signal an INT */
327327   /* it is automatically cleared on the acknowledge */
328328   if ((old & 0x08) && !(data & 0x08))
329      cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
329      cpunum_set_input_line(device->machine, 1, 0, HOLD_LINE);
330330
331331   /* bit 4 is sound disable */
332332   sound_global_enable(~data & 0x10);
r3373r3374
386386}
387387
388388
389static READ8_HANDLER( konami_porta_0_r )
389static WRITE8_DEVICE_HANDLER( konami_portc_0_w )
390390{
391//  logerror("%04X:ppi0_porta_r\n", activecpu_get_pc());
392   return input_port_read(machine, "IN0");
391   logerror("%04X:ppi0_portc_w = %02X\n", activecpu_get_pc(), data);
393392}
394393
395394
396static READ8_HANDLER( konami_portb_0_r )
395static WRITE8_DEVICE_HANDLER( konami_portc_1_w )
397396{
398//  logerror("%04X:ppi0_portb_r\n", activecpu_get_pc());
399   return input_port_read(machine, "IN1");
397   logerror("%04X:ppi1_portc_w = %02X\n", activecpu_get_pc(), data);
400398}
401399
402400
403static READ8_HANDLER( konami_portc_0_r )
401static WRITE8_DEVICE_HANDLER( sound_latch_w )
404402{
405   logerror("%04X:ppi0_portc_r\n", activecpu_get_pc());
406   return input_port_read(machine, "IN2");
403   soundlatch_w(device->machine, offset, data);
407404}
408405
409406
410static READ8_HANDLER( konami_portc_1_r )
407static const ppi8255_interface konami_ppi8255_0_intf =
411408{
412   logerror("%04X:ppi1_portc_r\n", activecpu_get_pc());
413   return input_port_read(machine, "IN3");
414}
409   DEVICE8_PORT("IN0"),         /* Port A read */
410   DEVICE8_PORT("IN1"),         /* Port B read */
411   DEVICE8_PORT("IN2"),         /* Port C read */
412   NULL,                     /* Port A write */
413   NULL,                     /* Port B write */
414   konami_portc_0_w            /* Port C write */
415};
415416
416417
417static WRITE8_HANDLER( konami_portc_0_w )
418static const ppi8255_interface konami_ppi8255_1_intf =
418419{
419   logerror("%04X:ppi0_portc_w = %02X\n", activecpu_get_pc(), data);
420}
421
422
423static WRITE8_HANDLER( konami_portc_1_w )
424{
425   logerror("%04X:ppi1_portc_w = %02X\n", activecpu_get_pc(), data);
426}
427
428
429static const ppi8255_interface konami_ppi8255_intf[2] =
430{
431   {
432      konami_porta_0_r,            /* Port A read */
433      konami_portb_0_r,            /* Port B read */
434      konami_portc_0_r,            /* Port C read */
435      NULL,                     /* Port A write */
436      NULL,                     /* Port B write */
437      konami_portc_0_w            /* Port C write */
438   },
439   {
440      NULL,                     /* Port A read */
441      NULL,                     /* Port B read */
442      konami_portc_1_r,            /* Port C read */
443      soundlatch_w,               /* Port A write */
444      konami_sound_control_w,         /* Port B write */
445      konami_portc_1_w            /* Port C write */
446   }
420   NULL,                     /* Port A read */
421   NULL,                     /* Port B read */
422   DEVICE8_PORT("IN3"),         /* Port C read */
423   sound_latch_w,               /* Port A write */
424   konami_sound_control_w,         /* Port B write */
425   konami_portc_1_w            /* Port C write */
447426};
448427
449428
r3373r3374
458437{
459438   /* the decoding here is very simplistic, and you can address both simultaneously */
460439   UINT8 result = 0xff;
461   if (offset & 0x0100) result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset & 3);
462   if (offset & 0x0200) result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset & 3);
440   if (offset & 0x0100) result &= ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_0"), offset & 3);
441   if (offset & 0x0200) result &= ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_1"), offset & 3);
463442   return result;
464443}
465444
r3373r3374
467446static WRITE8_HANDLER( theend_ppi8255_w )
468447{
469448   /* the decoding here is very simplistic, and you can address both simultaneously */
470   if (offset & 0x0100) ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset & 3, data);
471   if (offset & 0x0200) ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset & 3, data);
449   if (offset & 0x0100) ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_0"), offset & 3, data);
450   if (offset & 0x0200) ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_1"), offset & 3, data);
472451}
473452
474453
475static WRITE8_HANDLER( theend_coin_counter_w )
454static WRITE8_DEVICE_HANDLER( theend_coin_counter_w )
476455{
477456   coin_counter_w(0, data & 0x80);
478457}
479458
480459
481static const ppi8255_interface theend_ppi8255_intf[2] =
460static const ppi8255_interface theend_ppi8255_0_intf =
482461{
483   {
484      konami_porta_0_r,            /* Port A read */
485      konami_portb_0_r,            /* Port B read */
486      konami_portc_0_r,            /* Port C read */
487      NULL,                     /* Port A write */
488      NULL,                     /* Port B write */
489      theend_coin_counter_w         /* Port C write */
490   },
491   {
492      NULL,                     /* Port A read */
493      NULL,                     /* Port B read */
494      konami_portc_1_r,            /* Port C read */
495      soundlatch_w,               /* Port A write */
496      konami_sound_control_w,         /* Port B write */
497      konami_portc_1_w            /* Port C write */
498   }
462   DEVICE8_PORT("IN0"),         /* Port A read */
463   DEVICE8_PORT("IN1"),         /* Port B read */
464   DEVICE8_PORT("IN2"),         /* Port C read */
465   NULL,                     /* Port A write */
466   NULL,                     /* Port B write */
467   theend_coin_counter_w         /* Port C write */
499468};
500469
501470
r3373r3374
506475 *
507476 *************************************/
508477
509static WRITE8_HANDLER( scramble_protection_w )
478static WRITE8_DEVICE_HANDLER( scramble_protection_w )
510479{
511480   /*
512481        This is not fully understood; the low 4 bits of port C are
r3373r3374
530499}
531500
532501
533static READ8_HANDLER( scramble_protection_r )
502static READ8_DEVICE_HANDLER( scramble_protection_r )
534503{
535504   return protection_result;
536505}
r3373r3374
547516}
548517
549518
550static const ppi8255_interface scramble_ppi8255_intf[2] =
519static const ppi8255_interface scramble_ppi8255_1_intf =
551520{
552   {
553      konami_porta_0_r,            /* Port A read */
554      konami_portb_0_r,            /* Port B read */
555      konami_portc_0_r,            /* Port C read */
556      NULL,                     /* Port A write */
557      NULL,                     /* Port B write */
558      konami_portc_0_w            /* Port C write */
559   },
560   {
561      NULL,                     /* Port A read */
562      NULL,                     /* Port B read */
563      scramble_protection_r,         /* Port C read */
564      soundlatch_w,               /* Port A write */
565      konami_sound_control_w,         /* Port B write */
566      scramble_protection_w         /* Port C write */
567   }
521   NULL,                     /* Port A read */
522   NULL,                     /* Port B read */
523   scramble_protection_r,         /* Port C read */
524   sound_latch_w,               /* Port A write */
525   konami_sound_control_w,         /* Port B write */
526   scramble_protection_w         /* Port C write */
568527};
569528
570529
530
571531/*************************************
572532 *
573533 *  Explorer I/O
r3373r3374
598558{
599559   /* the decoding here is very simplistic, and you can address both simultaneously */
600560   UINT8 result = 0xff;
601   if (offset & 0x04) result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_2" ), offset & 3);
561   if (offset & 0x04) result &= ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_2"), offset & 3);
602562   return result;
603563}
604564
r3373r3374
606566static WRITE8_HANDLER( sfx_sample_io_w )
607567{
608568   /* the decoding here is very simplistic, and you can address both simultaneously */
609   if (offset & 0x04) ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_2" ), offset & 3, data);
569   if (offset & 0x04) ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_2"), offset & 3, data);
610570   if (offset & 0x10) dac_0_signed_data_w(machine, offset, data);
611571}
612572
r3373r3374
623583}
624584
625585
626static const ppi8255_interface sfx_ppi8255_intf[3] =
586static READ8_DEVICE_HANDLER( sound_data2_r )
627587{
628   {
629      konami_porta_0_r,            /* Port A read */
630      konami_portb_0_r,            /* Port B read */
631      konami_portc_0_r,            /* Port C read */
632      NULL,                     /* Port A write */
633      NULL,                     /* Port B write */
634      konami_portc_0_w            /* Port C write */
635   },
636   {
637      NULL,                     /* Port A read */
638      NULL,                     /* Port B read */
639      konami_portc_1_r,            /* Port C read */
640      soundlatch_w,               /* Port A write */
641      konami_sound_control_w,         /* Port B write */
642      konami_portc_1_w            /* Port C write */
643   },
644   {
645      soundlatch2_r,               /* Port A read */
646      NULL,                     /* Port B read */
647      NULL,                     /* Port C read */
648      NULL,                     /* Port A write */
649      NULL,                     /* Port B write */
650      NULL                     /* Port C write */
651   }
588   return soundlatch2_r(device->machine, offset);
589}
590
591
592static const ppi8255_interface sfx_ppi8255_2_intf =
593{
594   sound_data2_r,               /* Port A read */
595   NULL,                     /* Port B read */
596   NULL,                     /* Port C read */
597   NULL,                     /* Port A write */
598   NULL,                     /* Port B write */
599   NULL                     /* Port C write */
652600};
653601
654602
r3373r3374
663611{
664612   /* the decoding here is very simplistic, and you can address both simultaneously */
665613   UINT8 result = 0xff;
666   if (offset & 0x1000) result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), (offset >> 1) & 3);
667   if (offset & 0x2000) result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), (offset >> 1) & 3);
614   if (offset & 0x1000) result &= ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_1"), (offset >> 1) & 3);
615   if (offset & 0x2000) result &= ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_0"), (offset >> 1) & 3);
668616   return result;
669617}
670618
r3373r3374
672620static WRITE8_HANDLER( frogger_ppi8255_w )
673621{
674622   /* the decoding here is very simplistic, and you can address both simultaneously */
675   if (offset & 0x1000) ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), (offset >> 1) & 3, data);
676   if (offset & 0x2000) ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), (offset >> 1) & 3, data);
623   if (offset & 0x1000) ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_1"), (offset >> 1) & 3, data);
624   if (offset & 0x2000) ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_0"), (offset >> 1) & 3, data);
677625}
678626
679627
r3373r3374
721669{
722670   /* the decoding here is very simplistic, and you can address both simultaneously */
723671   UINT8 result = 0xff;
724   if (offset & 0x1000) result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), (offset >> 3) & 3);
725   if (offset & 0x2000) result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), (offset >> 3) & 3);
672   if (offset & 0x1000) result &= ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_0"), (offset >> 3) & 3);
673   if (offset & 0x2000) result &= ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_1"), (offset >> 3) & 3);
726674   return result;
727675}
728676
r3373r3374
730678static WRITE8_HANDLER( frogf_ppi8255_w )
731679{
732680   /* the decoding here is very simplistic, and you can address both simultaneously */
733   if (offset & 0x1000) ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), (offset >> 3) & 3, data);
734   if (offset & 0x2000) ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), (offset >> 3) & 3, data);
681   if (offset & 0x1000) ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_0"), (offset >> 3) & 3, data);
682   if (offset & 0x2000) ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_1"), (offset >> 3) & 3, data);
735683}
736684
737685
r3373r3374
742690 *
743691 *************************************/
744692
745static READ8_HANDLER( turtles_ppi8255_0_r ) { return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), (offset >> 4) & 3); }
746static READ8_HANDLER( turtles_ppi8255_1_r ) { return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), (offset >> 4) & 3); }
747static WRITE8_HANDLER( turtles_ppi8255_0_w ) { ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), (offset >> 4) & 3, data); }
748static WRITE8_HANDLER( turtles_ppi8255_1_w ) { ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), (offset >> 4) & 3, data); }
693static READ8_HANDLER( turtles_ppi8255_0_r ) { return ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_0"), (offset >> 4) & 3); }
694static READ8_HANDLER( turtles_ppi8255_1_r ) { return ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_1"), (offset >> 4) & 3); }
695static WRITE8_HANDLER( turtles_ppi8255_0_w ) { ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_0"), (offset >> 4) & 3, data); }
696static WRITE8_HANDLER( turtles_ppi8255_1_w ) { ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_1"), (offset >> 4) & 3, data); }
749697
750698
751699
r3373r3374
778726}
779727
780728
781static READ8_HANDLER( scorpion_protection_r )
729static READ8_DEVICE_HANDLER( scorpion_protection_r )
782730{
783731   UINT16 paritybits;
784732   UINT8 parity = 0;
r3373r3374
793741}
794742
795743
796static WRITE8_HANDLER( scorpion_protection_w )
744static WRITE8_DEVICE_HANDLER( scorpion_protection_w )
797745{
798746   /* bit 5 low is a reset */
799747   if (!(data & 0x20))
r3373r3374
803751   if (!(data & 0x10))
804752   {
805753      /* each clock shifts left one bit and ORs in the inverse of the parity */
806      protection_state = (protection_state << 1) | (~scorpion_protection_r(machine, 0) & 1);
754      protection_state = (protection_state << 1) | (~scorpion_protection_r(device, 0) & 1);
807755   }
808756}
809757
r3373r3374
830778}
831779
832780
833static const ppi8255_interface scorpion_ppi8255_intf[2] =
781static const ppi8255_interface scorpion_ppi8255_1_intf =
834782{
835   {
836      konami_porta_0_r,            /* Port A read */
837      konami_portb_0_r,            /* Port B read */
838      konami_portc_0_r,            /* Port C read */
839      NULL,                     /* Port A write */
840      NULL,                     /* Port B write */
841      konami_portc_0_w            /* Port C write */
842   },
843   {
844      NULL,                     /* Port A read */
845      NULL,                     /* Port B read */
846      scorpion_protection_r,         /* Port C read */
847      soundlatch_w,               /* Port A write */
848      konami_sound_control_w,         /* Port B write */
849      scorpion_protection_w         /* Port C write */
850   }
783   NULL,                     /* Port A read */
784   NULL,                     /* Port B read */
785   scorpion_protection_r,         /* Port C read */
786   sound_latch_w,               /* Port A write */
787   konami_sound_control_w,         /* Port B write */
788   scorpion_protection_w         /* Port C write */
851789};
852790
853791
r3373r3374
11141052 *
11151053 *************************************/
11161054
1117static WRITE8_HANDLER( moonwar_port_select_w )
1055static WRITE8_DEVICE_HANDLER( moonwar_port_select_w )
11181056{
11191057   moonwar_port_select = data & 0x10;
11201058}
11211059
11221060
1123static READ8_HANDLER( moonwar_input_port_0_r )
1061static READ8_DEVICE_HANDLER( moonwar_input_port_0_r )
11241062{
11251063   UINT8 sign;
11261064   UINT8 delta;
11271065
1128   delta = (moonwar_port_select ? input_port_read(machine, "IN3") : input_port_read(machine, "IN4"));
1066   delta = (moonwar_port_select ? input_port_read(device->machine, "IN3") : input_port_read(device->machine, "IN4"));
11291067
11301068   sign = (delta & 0x80) >> 3;
11311069   delta &= 0x0f;
11321070
1133   return ((input_port_read(machine, "IN0") & 0xe0) | delta | sign );
1071   return ((input_port_read(device->machine, "IN0") & 0xe0) | delta | sign );
11341072}
11351073
11361074
1137static const ppi8255_interface moonwar_ppi8255_intf[2] =
1075static const ppi8255_interface moonwar_ppi8255_0_intf =
11381076{
1139   {
1140      moonwar_input_port_0_r,         /* Port A read */
1141      konami_portb_0_r,            /* Port B read */
1142      konami_portc_0_r,            /* Port C read */
1143      NULL,                     /* Port A write */
1144      NULL,                     /* Port B write */
1145      moonwar_port_select_w          /* Port C write */
1146   },
1147   {
1148      NULL,                     /* Port A read */
1149      NULL,                     /* Port B read */
1150      konami_portc_1_r,            /* Port C read */
1151      soundlatch_w,               /* Port A write */
1152      konami_sound_control_w,         /* Port B write */
1153      konami_portc_1_w            /* Port C write */
1154   }
1077   moonwar_input_port_0_r,         /* Port A read */
1078   DEVICE8_PORT("IN1"),         /* Port B read */
1079   DEVICE8_PORT("IN2"),         /* Port C read */
1080   NULL,                     /* Port A write */
1081   NULL,                     /* Port B write */
1082   moonwar_port_select_w          /* Port C write */
11551083};
11561084
1085
1086
11571087/*************************************
11581088 *
11591089 *  Memory maps
r3373r3374
17861716static MACHINE_DRIVER_START( konami_base )
17871717   MDRV_IMPORT_FROM( galaxian_base )
17881718
1789   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1790   MDRV_DEVICE_CONFIG( konami_ppi8255_intf[0] )
1791
1792   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1793   MDRV_DEVICE_CONFIG( konami_ppi8255_intf[1] )
1719   MDRV_PPI8255_ADD( "ppi8255_0", konami_ppi8255_0_intf )
1720   MDRV_PPI8255_ADD( "ppi8255_1", konami_ppi8255_1_intf )
17941721MACHINE_DRIVER_END
17951722
17961723
r3373r3374
20281955   MDRV_CPU_MODIFY("main")
20291956   MDRV_CPU_PROGRAM_MAP(theend_map,0)
20301957
2031   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
2032   MDRV_DEVICE_CONFIG( theend_ppi8255_intf[0] )
2033
2034   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
2035   MDRV_DEVICE_CONFIG( theend_ppi8255_intf[1] )
1958   MDRV_PPI8255_ADD( "ppi8255_0", theend_ppi8255_0_intf )
1959   MDRV_PPI8255_ADD( "ppi8255_1", konami_ppi8255_1_intf )
20361960MACHINE_DRIVER_END
20371961
20381962
r3373r3374
20441968   MDRV_CPU_MODIFY("main")
20451969   MDRV_CPU_PROGRAM_MAP(theend_map,0)
20461970
2047   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
2048   MDRV_DEVICE_CONFIG( scramble_ppi8255_intf[0] )
2049
2050   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
2051   MDRV_DEVICE_CONFIG( scramble_ppi8255_intf[1] )
1971   MDRV_PPI8255_ADD( "ppi8255_0", konami_ppi8255_0_intf )
1972   MDRV_PPI8255_ADD( "ppi8255_1", scramble_ppi8255_1_intf )
20521973MACHINE_DRIVER_END
20531974
20541975
r3373r3374
20781999static MACHINE_DRIVER_START( scorpion )
20792000   MDRV_IMPORT_FROM(theend)
20802001
2081   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
2082   MDRV_DEVICE_CONFIG( scorpion_ppi8255_intf[0] )
2002   MDRV_PPI8255_RECONFIG( "ppi8255_0", konami_ppi8255_0_intf )
2003   MDRV_PPI8255_RECONFIG( "ppi8255_1", scorpion_ppi8255_1_intf )
20832004
2084   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
2085   MDRV_DEVICE_CONFIG( scorpion_ppi8255_intf[1] )
2086
20872005   /* extra AY8910 with I/O ports */
20882006   MDRV_SOUND_ADD("8910.2", AY8910, KONAMI_SOUND_CLOCK/8)
20892007   MDRV_SOUND_CONFIG(scorpion_ay8910_interface)
r3373r3374
21062024   MDRV_CPU_PROGRAM_MAP(sfx_sample_map,0)
21072025   MDRV_CPU_IO_MAP(sfx_sample_portmap,0)
21082026
2109   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
2110   MDRV_DEVICE_CONFIG( sfx_ppi8255_intf[0] )
2027   MDRV_PPI8255_ADD( "ppi8255_0", konami_ppi8255_0_intf )
2028   MDRV_PPI8255_ADD( "ppi8255_1", konami_ppi8255_1_intf )
2029   MDRV_PPI8255_ADD( "ppi8255_2", sfx_ppi8255_2_intf )
21112030
2112   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
2113   MDRV_DEVICE_CONFIG( sfx_ppi8255_intf[1] )
2114
2115   MDRV_DEVICE_ADD( "ppi8255_2", PPI8255 )
2116   MDRV_DEVICE_CONFIG( sfx_ppi8255_intf[2] )
2117
21182031   /* port on 1st 8910 is used for communication */
21192032   MDRV_SOUND_MODIFY("8910.0")
21202033   MDRV_SOUND_CONFIG(sfx_ay8910_interface)
r3373r3374
21502063   MDRV_IMPORT_FROM(scobra)
21512064
21522065   /* device config overrides */
2153   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
2154   MDRV_DEVICE_CONFIG( moonwar_ppi8255_intf[0] )
2066   MDRV_PPI8255_RECONFIG( "ppi8255_0", moonwar_ppi8255_0_intf )
2067   MDRV_PPI8255_RECONFIG( "ppi8255_1", konami_ppi8255_1_intf )
21552068
2156   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
2157   MDRV_DEVICE_CONFIG( moonwar_ppi8255_intf[1] )
2158
21592069   MDRV_PALETTE_INIT(moonwar)
21602070MACHINE_DRIVER_END
21612071
src/mame/drivers/taxidrvr.c
r3373r3374
1111
1212
1313
14static WRITE8_HANDLER( p2a_w ) { taxidrvr_spritectrl_w(machine,0,data); }
15static WRITE8_HANDLER( p2b_w ) { taxidrvr_spritectrl_w(machine,1,data); }
16static WRITE8_HANDLER( p2c_w ) { taxidrvr_spritectrl_w(machine,2,data); }
17static WRITE8_HANDLER( p3a_w ) { taxidrvr_spritectrl_w(machine,3,data); }
18static WRITE8_HANDLER( p3b_w ) { taxidrvr_spritectrl_w(machine,4,data); }
19static WRITE8_HANDLER( p3c_w ) { taxidrvr_spritectrl_w(machine,5,data); }
20static WRITE8_HANDLER( p4a_w ) { taxidrvr_spritectrl_w(machine,6,data); }
21static WRITE8_HANDLER( p4b_w ) { taxidrvr_spritectrl_w(machine,7,data); }
22static WRITE8_HANDLER( p4c_w ) { taxidrvr_spritectrl_w(machine,8,data); }
14static WRITE8_DEVICE_HANDLER( p2a_w ) { taxidrvr_spritectrl_w(device->machine,0,data); }
15static WRITE8_DEVICE_HANDLER( p2b_w ) { taxidrvr_spritectrl_w(device->machine,1,data); }
16static WRITE8_DEVICE_HANDLER( p2c_w ) { taxidrvr_spritectrl_w(device->machine,2,data); }
17static WRITE8_DEVICE_HANDLER( p3a_w ) { taxidrvr_spritectrl_w(device->machine,3,data); }
18static WRITE8_DEVICE_HANDLER( p3b_w ) { taxidrvr_spritectrl_w(device->machine,4,data); }
19static WRITE8_DEVICE_HANDLER( p3c_w ) { taxidrvr_spritectrl_w(device->machine,5,data); }
20static WRITE8_DEVICE_HANDLER( p4a_w ) { taxidrvr_spritectrl_w(device->machine,6,data); }
21static WRITE8_DEVICE_HANDLER( p4b_w ) { taxidrvr_spritectrl_w(device->machine,7,data); }
22static WRITE8_DEVICE_HANDLER( p4c_w ) { taxidrvr_spritectrl_w(device->machine,8,data); }
2323
2424
2525
2626
2727static int s1,s2,s3,s4,latchA,latchB;
2828
29static READ8_HANDLER( p0a_r )
29static READ8_DEVICE_HANDLER( p0a_r )
3030{
3131   return latchA;
3232}
3333
34static READ8_HANDLER( p0c_r )
34static READ8_DEVICE_HANDLER( p0c_r )
3535{
3636   return (s1 << 7);
3737}
3838
39static WRITE8_HANDLER( p0b_w )
39static WRITE8_DEVICE_HANDLER( p0b_w )
4040{
4141   latchB = data;
4242}
4343
44static WRITE8_HANDLER( p0c_w )
44static WRITE8_DEVICE_HANDLER( p0c_w )
4545{
4646   s2 = data & 1;
4747
r3373r3374
5454//  popmessage("%02x",data&0x0f);
5555}
5656
57static READ8_HANDLER( p1b_r )
57static READ8_DEVICE_HANDLER( p1b_r )
5858{
5959   return latchB;
6060}
6161
62static READ8_HANDLER( p1c_r )
62static READ8_DEVICE_HANDLER( p1c_r )
6363{
64   return (s2 << 7) | (s4 << 6) | ((input_port_read(machine, "SERVCOIN") & 1) << 4);
64   return (s2 << 7) | (s4 << 6) | ((input_port_read(device->machine, "SERVCOIN") & 1) << 4);
6565}
6666
67static WRITE8_HANDLER( p1a_w )
67static WRITE8_DEVICE_HANDLER( p1a_w )
6868{
6969   latchA = data;
7070}
7171
72static WRITE8_HANDLER( p1c_w )
72static WRITE8_DEVICE_HANDLER( p1c_w )
7373{
7474   s1 = data & 1;
7575   s3 = (data & 2) >> 1;
r3373r3374
376376   MDRV_INTERLEAVE(100)   /* 100 CPU slices per frame - an high value to ensure proper */
377377                     /* synchronization of the CPUs */
378378
379   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
380   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
379   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
380   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
381   MDRV_PPI8255_ADD( "ppi8255_2", ppi8255_intf[2] )
382   MDRV_PPI8255_ADD( "ppi8255_3", ppi8255_intf[3] )
383   MDRV_PPI8255_ADD( "ppi8255_4", ppi8255_intf[4] )
381384
382   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
383   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
384
385   MDRV_DEVICE_ADD( "ppi8255_2", PPI8255 )
386   MDRV_DEVICE_CONFIG( ppi8255_intf[2] )
387
388   MDRV_DEVICE_ADD( "ppi8255_3", PPI8255 )
389   MDRV_DEVICE_CONFIG( ppi8255_intf[3] )
390
391   MDRV_DEVICE_ADD( "ppi8255_4", PPI8255 )
392   MDRV_DEVICE_CONFIG( ppi8255_intf[4] )
393
394385   /* video hardware */
395386   MDRV_SCREEN_ADD("main", RASTER)
396387   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/cps2.c
r3373r3374
19401940
19411941ROM_START( csclub )
19421942   ROM_REGION( CODE_SIZE, "main", 0 )      /* 68000 code */
1943   ROM_LOAD16_WORD_SWAP( "csc03a", 0x000000, 0x80000, CRC(824082be) SHA1(a44e7e17d73e089b4e7784317f2387d135d01482) )
1944   ROM_LOAD16_WORD_SWAP( "csc04a", 0x080000, 0x80000, CRC(74e6a4fe) SHA1(2a732a6e57088885e77256eb17ddd3ae523db09f) )
1945   ROM_LOAD16_WORD_SWAP( "csc05a", 0x100000, 0x80000, CRC(8ae0df19) SHA1(88e7bf1ee0e18d74748cecd875cb96524dfa01cf) )
1946   ROM_LOAD16_WORD_SWAP( "csc06a", 0x180000, 0x80000, CRC(51f2f0d3) SHA1(067a0bded69767b9f30073012ad62f4608b7610a) )
1947   ROM_LOAD16_WORD_SWAP( "csc07a", 0x200000, 0x80000, CRC(003968fd) SHA1(95f59a29a404a1c1e86d5f43526a80aa97f25621) )
1948
1949   ROM_REGION( 0x1000000, "gfx", 0 )
1950   ROM_FILL(              0x000000, 0x800000, 0 )
1951   ROMX_LOAD( "csc73",  0x800000, 0x080000, CRC(335f07c3) SHA1(44e0385120e2c81fd1072e19b7e3ff05d42be226) , ROM_GROUPWORD | ROM_SKIP(6) )
1952   ROMX_LOAD( "csc74",  0xa00000, 0x080000, CRC(ab215357) SHA1(c2600b5ba62a570f8a32de9c06f93ea8ae6cd854) , ROM_GROUPWORD | ROM_SKIP(6) )
1953   ROMX_LOAD( "csc75",  0xc00000, 0x080000, CRC(a2367381) SHA1(49d562be42c10cdf4e55e3b76c388f0b0121a967) , ROM_GROUPWORD | ROM_SKIP(6) )
1954   ROMX_LOAD( "csc76",  0xe00000, 0x080000, CRC(728aac1f) SHA1(2d04e8803f41af2372fc342fcd8a076c14338198) , ROM_GROUPWORD | ROM_SKIP(6) )
1955   ROMX_LOAD( "csc63",  0x800002, 0x080000, CRC(3711b8ca) SHA1(ff7ba4f73d227212377327f4fcbe8f555ac4b9c9) , ROM_GROUPWORD | ROM_SKIP(6) )
1956   ROMX_LOAD( "csc64",  0xa00002, 0x080000, CRC(828a06d8) SHA1(ce1d147f1d747fcd90d93f7dcca0cdd24c85a971) , ROM_GROUPWORD | ROM_SKIP(6) )
1957   ROMX_LOAD( "csc65",  0xc00002, 0x080000, CRC(86ee4569) SHA1(725d82a1669f6f78fb4ef8756ceac8b444dcbd43) , ROM_GROUPWORD | ROM_SKIP(6) )
1958   ROMX_LOAD( "csc66",  0xe00002, 0x080000, CRC(c24f577f) SHA1(d3b97091e1f0171e087feb9d497c94a48872cd21) , ROM_GROUPWORD | ROM_SKIP(6) )
1959   ROMX_LOAD( "csc83",  0x800004, 0x080000, CRC(0750d12a) SHA1(4c36cba88c58bdbfed923f56a6d489f42a4d0f6e) , ROM_GROUPWORD | ROM_SKIP(6) )
1960   ROMX_LOAD( "csc84",  0xa00004, 0x080000, CRC(90a92f39) SHA1(75bef2440147bac417b48d61ff64b71ed5b9eb67) , ROM_GROUPWORD | ROM_SKIP(6) )
1961   ROMX_LOAD( "csc85",  0xc00004, 0x080000, CRC(d08ab012) SHA1(7f2e71b6bd85c6a3efbd417977261c21f3d6cb7c) , ROM_GROUPWORD | ROM_SKIP(6) )
1962   ROMX_LOAD( "csc86",  0xe00004, 0x080000, CRC(41652583) SHA1(7132647dc9a29ce98866f489140703c5ed3d6051) , ROM_GROUPWORD | ROM_SKIP(6) )
1963   ROMX_LOAD( "csc93",  0x800006, 0x080000, CRC(a756c7f7) SHA1(d0f44f8ded12291d5c79282eac45d088cb365b09) , ROM_GROUPWORD | ROM_SKIP(6) )
1964   ROMX_LOAD( "csc94",  0xa00006, 0x080000, CRC(fb7ccc73) SHA1(763e6fe1baf73341747c74d89df9443561fca4fa) , ROM_GROUPWORD | ROM_SKIP(6) )
1965   ROMX_LOAD( "csc95",  0xc00006, 0x080000, CRC(4d014297) SHA1(df172a3723793b9955ff1f65e76fe5c20fc37b89) , ROM_GROUPWORD | ROM_SKIP(6) )
1966   ROMX_LOAD( "csc96",  0xe00006, 0x080000, CRC(6754b1ef) SHA1(ab5d62056b19999ccecd0eeec7b7c5869ca8fea8) , ROM_GROUPWORD | ROM_SKIP(6) )
1967
1968   ROM_REGION( QSOUND_SIZE, "audio", 0 ) /* 64k for the audio CPU (+banks) */
1969   ROM_LOAD( "csc.01",   0x00000, 0x08000, CRC(ee162111) SHA1(ce8d4bd32bb10ee8b0274ba6fcef05a583b39d48) )
1970   ROM_CONTINUE(         0x10000, 0x18000 )
1971
1972   ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
1973   ROM_LOAD16_WORD_SWAP( "csc51",   0x000000, 0x080000, CRC(5a52afd5) SHA1(ab873ec556933b75be82ba249357cceb01a7a0bd) )
1974   ROM_LOAD16_WORD_SWAP( "csc52",   0x080000, 0x080000, CRC(1408a811) SHA1(1d31e3cd505245b5ff4d3c55d5fa7017c0f1e168) )
1975   ROM_LOAD16_WORD_SWAP( "csc53",   0x100000, 0x080000, CRC(4fb9f57c) SHA1(093e8e3a03b62783a84fe4ae239e9eb46cbfd71e) )
1976   ROM_LOAD16_WORD_SWAP( "csc54",   0x180000, 0x080000, CRC(9a8f40ec) SHA1(c8db1ecfd6b08e9c83ae53a1d25c1387ab95535c) )
1977   ROM_LOAD16_WORD_SWAP( "csc55",   0x200000, 0x080000, CRC(91529a91) SHA1(183569100ae98e17688e0e25932850e73a41eb88) )
1978   ROM_LOAD16_WORD_SWAP( "csc56",   0x280000, 0x080000, CRC(9a345334) SHA1(330291400a73215c9797457507a86c90ba415247))
1979   ROM_LOAD16_WORD_SWAP( "csc57",   0x300000, 0x080000, CRC(aedc27f2) SHA1(55137f0f22c4823558e6a8ba76011695579a4f1f) )
1980   ROM_LOAD16_WORD_SWAP( "csc58",   0x380000, 0x080000, CRC(2300b7b3) SHA1(f5ecbb45c24f7de1c1aa435870695551d4e343ca) )
1981ROM_END
1982
1983
1984ROM_START( csclub1 )
1985   ROM_REGION( CODE_SIZE, "main", 0 )      /* 68000 code */
19431986   ROM_LOAD16_WORD_SWAP( "csce.03", 0x000000, 0x80000, CRC(f2c852ef) SHA1(bc2d403958640d7ab0785d01a3df79ec31d0c239) )
19441987   ROM_LOAD16_WORD_SWAP( "csce.04", 0x080000, 0x80000, CRC(1184530f) SHA1(18565f6a06e6078fc20dd9cf70802ac1da60c67a) )
19451988   ROM_LOAD16_WORD_SWAP( "csce.05", 0x100000, 0x80000, CRC(804e2b6b) SHA1(e638f73442e3165ace84cdb1bd2a9d419e2d8c41) )
r3373r3374
74017444GAME( 1997, mshvsfa1, mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Asia 970620)", 0 )
74027445GAME( 1997, mshvsfb,  mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Brazil 970827)", 0 )
74037446GAME( 1997, mshvsfb1, mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Brazil 970625)", 0 )
7404GAME( 1997, csclub,   0,        cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Euro 970722)", 0 )
7447GAME( 1997, csclub,   0,        cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Euro 971017)", 0 )
7448GAME( 1997, csclub1,  csclub,   cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Euro 970722)", 0 )
74057449GAME( 1997, cscluba,  csclub,   cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Asia 970722)", 0 )
74067450GAME( 1997, csclubj,  csclub,   cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Japan 970722)", 0 )
74077451GAME( 1997, csclubh,  csclub,   cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Hispanic 970722)", 0 )
src/mame/drivers/lordgun.c
r3373r3374
100100
101101***************************************************************************/
102102
103static WRITE8_HANDLER(fake_w)
103static WRITE8_DEVICE_HANDLER(fake_w)
104104{
105105}
106static WRITE8_HANDLER(fake2_w)
106static WRITE8_DEVICE_HANDLER(fake2_w)
107107{
108108//  popmessage("%02x",data);
109109}
110110
111static READ8_HANDLER( lordgun_port_0_r )
111static WRITE8_DEVICE_HANDLER( lordgun_eeprom_w )
112112{
113   return input_port_read(machine, "IN0");
114}
115
116static WRITE8_HANDLER( lordgun_eeprom_w )
117{
118113   static UINT8 old;
119114   int i;
120115
r3373r3374
129124   // Update light guns positions
130125   for (i = 0; i < 2; i++)
131126      if ( (data & (0x04 << i)) && !(old & (0x04 << i)) )
132         lordgun_update_gun(machine, i);
127         lordgun_update_gun(device->machine, i);
133128
134129   // latch the bit
135130   eeprom_write_bit(data & 0x40);
r3373r3374
409404static const ppi8255_interface ppi8255_intf[2] =
410405{
411406   {
412      lordgun_port_0_r,         // Port A read
407      DEVICE8_PORT("IN0"),      // Port A read
413408      NULL,                  // Port B read
414      input_port_3_r,            // Port C read
409      DEVICE8_PORT("IN3"),      // Port C read
415410      fake_w,                  // Port A write
416411      lordgun_eeprom_w,         // Port B write
417412      fake2_w                  // Port C write
418413   },
419414   {
420      input_port_1_r,            // Port A read
421      input_port_2_r,            // Port B read
422      input_port_4_r,            // Port C read
415      DEVICE8_PORT("IN1"),      // Port A read
416      DEVICE8_PORT("IN2"),      // Port B read
417      DEVICE8_PORT("IN4"),      // Port C read
423418      fake_w,                  // Port A write
424419      fake_w,                  // Port B write
425420      fake_w                  // Port C write
r3373r3374
445440   MDRV_CPU_PROGRAM_MAP(lordgun_soundmem_map,0)
446441   MDRV_CPU_IO_MAP(lordgun_soundio_map,0)
447442
448   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
449   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
443   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
444   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
450445
451   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
452   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
453
454446   MDRV_NVRAM_HANDLER(93C46)
455447
456448   MDRV_GFXDECODE(lordgun)
src/mame/drivers/segag80r.c
r3373r3374
300300 *
301301 *************************************/
302302
303static READ8_HANDLER( sindbadm_portb_r )
303static WRITE8_DEVICE_HANDLER( sindbadm_soundport_w )
304304{
305   return input_port_read(machine, "FC");
306}
307
308
309static WRITE8_HANDLER( sindbadm_soundport_w )
310{
311   soundlatch_w(machine,0,data);
312   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
305   soundlatch_w(device->machine,0,data);
306   cpunum_set_input_line(device->machine, 1, INPUT_LINE_NMI, PULSE_LINE);
313307   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(50));
314308}
315309
316310
317static WRITE8_HANDLER( sindbadm_misc_w )
311static WRITE8_DEVICE_HANDLER( sindbadm_misc_w )
318312{
319313   coin_counter_w(0, data & 0x02);
320314//  mame_printf_debug("Unknown = %02X\n", data);
r3373r3374
344338static const ppi8255_interface sindbadm_ppi_intf =
345339{
346340   NULL,
347   sindbadm_portb_r,
341   DEVICE8_PORT("FC"),
348342   NULL,
349343   sindbadm_soundport_w,
350344   NULL,
r3373r3374
954948   MDRV_CPU_IO_MAP(sindbadm_portmap,0)
955949   MDRV_CPU_VBLANK_INT("main", sindbadm_vblank_start)
956950
957   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
958   MDRV_DEVICE_CONFIG( sindbadm_ppi_intf )
951   MDRV_PPI8255_ADD( "ppi8255", sindbadm_ppi_intf )
959952
960953   /* video hardware */
961954   MDRV_GFXDECODE(monsterb)
src/mame/drivers/scramble.c
r3373r3374
18531853
18541854   MDRV_MACHINE_RESET(scramble)
18551855
1856   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1857   MDRV_DEVICE_CONFIG( scramble_ppi_ppi8255_intf[0] )
1856   MDRV_PPI8255_ADD( "ppi8255_0", scramble_ppi_0_intf )
1857   MDRV_PPI8255_ADD( "ppi8255_1", scramble_ppi_1_intf )
18581858
1859   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1860   MDRV_DEVICE_CONFIG( scramble_ppi_ppi8255_intf[1] )
1861
18621859   /* video hardware */
18631860   MDRV_SCREEN_ADD("main", RASTER)
18641861   MDRV_SCREEN_REFRESH_RATE(16000.0/132/2)
r3373r3374
19531950   MDRV_CPU_MODIFY("main")
19541951   MDRV_CPU_PROGRAM_MAP(mars_readmem,mars_writemem)
19551952
1956   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
1957   MDRV_DEVICE_CONFIG( mars_ppi8255_intf[0] )
1958
1959   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
1960   MDRV_DEVICE_CONFIG( mars_ppi8255_intf[1] )
1961
19621953   /* video hardware */
19631954   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
19641955   MDRV_PALETTE_INIT(galaxold)
r3373r3374
19841975   MDRV_CPU_MODIFY("main")
19851976   MDRV_CPU_PROGRAM_MAP(newsin7_readmem,newsin7_writemem)
19861977
1987   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
1988   MDRV_DEVICE_CONFIG( mars_ppi8255_intf[0] )
1989
1990   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
1991   MDRV_DEVICE_CONFIG( mars_ppi8255_intf[1] )
1992
19931978   /* video hardware */
19941979   MDRV_GFXDECODE(newsin7)
19951980   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
r3373r3374
20041989   MDRV_CPU_MODIFY("main")
20051990   MDRV_CPU_PROGRAM_MAP(mars_readmem,mrkougar_writemem)
20061991
2007   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
2008   MDRV_DEVICE_CONFIG( mrkougar_ppi8255_intf[0] )
1992   MDRV_PPI8255_RECONFIG( "ppi8255_1", mrkougar_ppi_1_intf )
20091993
2010   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
2011   MDRV_DEVICE_CONFIG( mrkougar_ppi8255_intf[1] )
2012
20131994   /* video hardware */
20141995   MDRV_GFXDECODE(mrkougar)
20151996   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
r3373r3374
20232004   MDRV_CPU_MODIFY("main")
20242005   MDRV_CPU_PROGRAM_MAP(mars_readmem,mrkougar_writemem)
20252006
2026   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
2027   MDRV_DEVICE_CONFIG( mrkougar_ppi8255_intf[0] )
2007   MDRV_PPI8255_RECONFIG( "ppi8255_1", mrkougar_ppi_1_intf )
20282008
2029   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
2030   MDRV_DEVICE_CONFIG( mrkougar_ppi8255_intf[1] )
2031
20322009   /* video hardware */
20332010   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
20342011   MDRV_PALETTE_INIT(galaxold)
r3373r3374
20412018   MDRV_CPU_MODIFY("main")
20422019   MDRV_CPU_PROGRAM_MAP(ckongs_readmem,ckongs_writemem)
20432020
2044   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
2045   MDRV_DEVICE_CONFIG( ckongs_ppi8255_intf[0] )
2046
2047   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
2048   MDRV_DEVICE_CONFIG( ckongs_ppi8255_intf[1] )
2049
20502021   /* video hardware */
20512022   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
20522023   MDRV_PALETTE_INIT(galaxold)
r3373r3374
20602031   MDRV_CPU_MODIFY("main")
20612032   MDRV_CPU_PROGRAM_MAP(hotshock_readmem,hotshock_writemem)
20622033
2063   MDRV_DEVICE_REMOVE( "ppi8255_0", PPI8255 )
2064   MDRV_DEVICE_REMOVE( "ppi8255_1", PPI8255 )
2034   MDRV_PPI8255_REMOVE( "ppi8255_0" )
2035   MDRV_PPI8255_REMOVE( "ppi8255_1" )
20652036
20662037   MDRV_CPU_MODIFY("audio")
20672038   MDRV_CPU_IO_MAP(hotshock_sound_io_map,0)
src/mame/drivers/iqblock.c
r3373r3374
9292}
9393
9494
95static WRITE8_HANDLER( port_C_w )
95static WRITE8_DEVICE_HANDLER( port_C_w )
9696{
9797   /* bit 4 unknown; it is pulsed at the end of every NMI */
9898
r3373r3374
107107
108108static const ppi8255_interface ppi8255_intf =
109109{
110   input_port_0_r,         /* Port A read */
111   input_port_1_r,         /* Port B read */
112   input_port_2_r,         /* Port C read */
110   DEVICE8_PORT("P1"),      /* Port A read */
111   DEVICE8_PORT("P2"),      /* Port B read */
112   DEVICE8_PORT("EXTRA"),   /* Port C read */
113113   NULL,               /* Port A write */
114114   NULL,               /* Port B write */
115115   port_C_w            /* Port C write */
r3373r3374
276276   MDRV_CPU_IO_MAP(main_portmap,0)
277277   MDRV_CPU_VBLANK_INT_HACK(iqblock_interrupt,16)
278278
279   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
280   MDRV_DEVICE_CONFIG( ppi8255_intf )
279   MDRV_PPI8255_ADD( "ppi8255", ppi8255_intf )
281280
282281   /* video hardware */
283282   MDRV_SCREEN_ADD("main", RASTER)
r3373r3374
308307   MDRV_CPU_IO_MAP(main_portmap,0)
309308   MDRV_CPU_VBLANK_INT_HACK(iqblock_interrupt,16)
310309
311   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
312   MDRV_DEVICE_CONFIG( ppi8255_intf )
310   MDRV_PPI8255_ADD( "ppi8255", ppi8255_intf )
313311
314312   /* video hardware */
315313   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/cchasm.c
r3373r3374
5454
5555static ADDRESS_MAP_START( sound_portmap, ADDRESS_SPACE_IO, 8 )
5656   ADDRESS_MAP_GLOBAL_MASK(0xff)
57   AM_RANGE(0x00, 0x03) AM_READWRITE(z80ctc_0_r,z80ctc_0_w)
57   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE(Z80CTC, "ctc", z80ctc_r, z80ctc_w)
5858ADDRESS_MAP_END
5959
6060static void cchasm_6840_irq(running_machine *machine, int state)
r3373r3374
134134 *
135135 *************************************/
136136
137static const struct z80_irq_daisy_chain daisy_chain[] =
137static const z80_daisy_chain daisy_chain[] =
138138{
139   { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti, 0 }, /* CTC number 0 */
140   { 0,0,0,0,-1 }       /* end mark */
139   { Z80CTC, "ctc" },
140   { NULL }
141141};
142142
143143
r3373r3374
148148 *
149149 *************************************/
150150
151extern z80ctc_interface cchasm_ctc_intf;
152
151153static MACHINE_DRIVER_START( cchasm )
152154
153   MDRV_MACHINE_START(cchasm)
154155   /* basic machine hardware */
155156   MDRV_CPU_ADD("main", M68000,CCHASM_68K_CLOCK)   /* 8 MHz (from schematics) */
156157   MDRV_CPU_PROGRAM_MAP(memmap,0)
r3373r3374
160161   MDRV_CPU_PROGRAM_MAP(sound_memmap,0)
161162   MDRV_CPU_IO_MAP(sound_portmap,0)
162163
164   MDRV_Z80CTC_ADD("ctc", cchasm_ctc_intf)
165
166   MDRV_MACHINE_START(cchasm)
167
163168   /* video hardware */
164169   MDRV_SCREEN_ADD("main", VECTOR)
165170   MDRV_SCREEN_REFRESH_RATE(40)
src/mame/drivers/sbasketb.c
r3373r3374
8282   AM_RANGE(0x3e01, 0x3e01) AM_READ_PORT("P1")
8383   AM_RANGE(0x3e02, 0x3e02) AM_READ_PORT("P2")
8484   AM_RANGE(0x3e03, 0x3e03) AM_READ(SMH_NOP)
85   AM_RANGE(0x3e80, 0x3e80) AM_READ_PORT("DSW1")
86   AM_RANGE(0x3f00, 0x3f00) AM_READ_PORT("DSW2")
85   AM_RANGE(0x3e80, 0x3e80) AM_READ_PORT("DSW2")
86   AM_RANGE(0x3f00, 0x3f00) AM_READ_PORT("DSW1")
8787   AM_RANGE(0x6000, 0xffff) AM_READ(SMH_ROM)
8888ADDRESS_MAP_END
8989
src/mame/drivers/smstrv.c
r3373r3374
9292INPUT_PORTS_EXTERN(ettrivia);
9393
9494
95static READ8_HANDLER( r1 )
95static READ8_DEVICE_HANDLER( r1 )
9696{
9797   int pc = activecpu_get_pc();
9898   if(pc != 0x81cb)
9999      printf("r1 @ %X\n",activecpu_get_pc());
100   return mame_rand(machine);
100   return mame_rand(device->machine);
101101}
102static READ8_HANDLER( r2 )
102static READ8_DEVICE_HANDLER( r2 )
103103{
104104   int pc = activecpu_get_pc();
105105   if(pc != 0x81cb)
106106      printf("r2 @ %X\n",activecpu_get_pc());
107   return mame_rand(machine);
107   return mame_rand(device->machine);
108108}
109static READ8_HANDLER( r3 )
109static READ8_DEVICE_HANDLER( r3 )
110110{
111111   int pc = activecpu_get_pc();
112112   if(pc != 0x81cb && pc != 0x90fa && pc != 0x911b && pc != 0x90d3 && pc != 0x90c4)
113113      printf("r3 @ %X\n",activecpu_get_pc());
114   return mame_rand(machine) & ~1; //with 1 jumps back (infinite loop): a status ready for something?
114   return mame_rand(device->machine) & ~1; //with 1 jumps back (infinite loop): a status ready for something?
115115}
116static READ8_HANDLER( r4 )
116static READ8_DEVICE_HANDLER( r4 )
117117{
118118   int pc = activecpu_get_pc();
119119   if(pc != 0x81cb)
120120      printf("r4 @ %X\n",activecpu_get_pc());
121   return mame_rand(machine);
121   return mame_rand(device->machine);
122122}
123static READ8_HANDLER( r5 )
123static READ8_DEVICE_HANDLER( r5 )
124124{
125125   int pc = activecpu_get_pc();
126126   if(pc != 0x81cb)
127127      printf("r5 @ %X\n",activecpu_get_pc());
128   return mame_rand(machine);
128   return mame_rand(device->machine);
129129}
130static READ8_HANDLER( r6 )
130static READ8_DEVICE_HANDLER( r6 )
131131{
132132   int pc = activecpu_get_pc();
133133   if(pc != 0x81cb)
134134      printf("r6 @ %X\n",activecpu_get_pc());
135135
136   return mame_rand(machine);
136   return mame_rand(device->machine);
137137}
138138
139static WRITE8_HANDLER( w1 )
139static WRITE8_DEVICE_HANDLER( w1 )
140140{
141141   /*
142142    static int old = 0;
r3373r3374
144144        printf("w1 = %02X\n",old=data);
145145        */
146146}
147static WRITE8_HANDLER( w2 )
147static WRITE8_DEVICE_HANDLER( w2 )
148148{
149149   /*
150150    static int old = 0;
r3373r3374
152152        printf("w2 = %02X\n",old=data);
153153        */
154154}
155static WRITE8_HANDLER( w3 )
155static WRITE8_DEVICE_HANDLER( w3 )
156156{
157157   /*
158158    static int old = 0;
r3373r3374
160160        printf("w3 = %02X\n",old=data);
161161        */
162162}
163static WRITE8_HANDLER( w4 )
163static WRITE8_DEVICE_HANDLER( w4 )
164164{
165165   /*
166166    static int old = 0;
r3373r3374
168168        printf("w4 = %02X\n",old=data);
169169        */
170170}
171static WRITE8_HANDLER( w5 )
171static WRITE8_DEVICE_HANDLER( w5 )
172172{
173173   /*
174174    static int old = 0;
r3373r3374
176176        printf("w5 = %02X\n",old=data);
177177        */
178178}
179static WRITE8_HANDLER( w6 )
179static WRITE8_DEVICE_HANDLER( w6 )
180180{
181181   /*
182182    static int old = 0;
r3373r3374
233233
234234//  MDRV_NVRAM_HANDLER(generic_0fill)
235235
236   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
237   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
236   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
237   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
238238
239   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
240   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
241
242239   /* video hardware */
243240   MDRV_SCREEN_ADD("main", RASTER)
244241   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/epos.c
r3373r3374
113113   There's a separate ROM check for banked U04 at 30F3.
114114   It looks like dealer/revenger uses ppi8255 to control bankswitching.
115115*/
116static WRITE8_HANDLER( write_prtc )
116static WRITE8_DEVICE_HANDLER( write_prtc )
117117{
118   UINT8 *rom = memory_region(machine, "main");
118   UINT8 *rom = memory_region(device->machine, "main");
119119   memory_set_bankptr(2, rom + 0x6000 + (0x1000 * (data & 1)));
120120}
121121
122122static const ppi8255_interface ppi8255_intf =
123123{
124   input_port_2_r,   /* Port A read */
124   DEVICE8_PORT("INPUTS"),      /* Port A read */
125125   NULL,         /* Port B read */
126126   NULL,         /* Port C read */
127127   NULL,         /* Port A write */
r3373r3374
409409   MDRV_CPU_IO_MAP(dealer_io_map,0)
410410   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
411411
412   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
413   MDRV_DEVICE_CONFIG( ppi8255_intf )
412   MDRV_PPI8255_ADD( "ppi8255", ppi8255_intf )
414413
415414   /* video hardware */
416415   MDRV_VIDEO_UPDATE(epos)
src/mame/drivers/couple.c
r3373r3374
128128static const ppi8255_interface ppi8255_intf[2] =
129129{
130130   {
131      input_port_0_r,            /* Port A read */
132      input_port_2_r,            /* Port B read */
131      DEVICE8_PORT("P1"),         /* Port A read */
132      DEVICE8_PORT("SYSTEM"),      /* Port B read */
133133      NULL,                  /* Port C read */
134134      NULL,                  /* Port A write */
135135      NULL,                  /* Port B write */
136136      NULL                  /* Port C write */
137137   },
138138   {
139      input_port_1_r,            /* Port A read */
140      input_port_3_r,            /* Port B read */
141      input_port_4_r,            /* Port C read */
139      DEVICE8_PORT("DSW"),      /* Port A read */
140      DEVICE8_PORT("IN3"),      /* Port B read */
141      DEVICE8_PORT("IN4"),      /* Port C read */
142142      NULL,                  /* Port A write */
143143      NULL,                  /* Port B write */
144144      NULL                  /* Port C write */
r3373r3374
360360   MDRV_CPU_IO_MAP(merit_io,0)
361361   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
362362
363   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
364   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
363   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
364   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
365365
366   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
367   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
368
369366   /* video hardware */
370367   MDRV_SCREEN_ADD("main", RASTER)
371368   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/tcl.c
r3373r3374
127127   MDRV_VIDEO_START(tcl)
128128   MDRV_VIDEO_UPDATE(tcl)
129129
130   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
131   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
130   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
131   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
132132
133   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
134   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
135
136133   /* sound hardware */
137134   MDRV_SPEAKER_STANDARD_MONO("mono")
138135
src/mame/drivers/freekick.c
r3373r3374
550550 *
551551 *************************************/
552552
553static WRITE8_HANDLER( snd_rom_addr_l_w )
553static WRITE8_DEVICE_HANDLER( snd_rom_addr_l_w )
554554{
555555   romaddr = (romaddr & 0xff00) | data;
556556}
557557
558static WRITE8_HANDLER( snd_rom_addr_h_w )
558static WRITE8_DEVICE_HANDLER( snd_rom_addr_h_w )
559559{
560560   romaddr = (romaddr & 0x00ff) | (data << 8);
561561}
562562
563static READ8_HANDLER( snd_rom_r )
563static READ8_DEVICE_HANDLER( snd_rom_r )
564564{
565   return memory_region(machine, "user1")[romaddr & 0x7fff];
565   return memory_region(device->machine, "user1")[romaddr & 0x7fff];
566566}
567567
568568static const ppi8255_interface ppi8255_intf[2] =
r3373r3374
576576      NULL                     /* Port C write */
577577   },
578578   {
579      input_port_0_r,               /* Port A read */
580      input_port_1_r,               /* Port B read */
581      input_port_2_r,               /* Port C read */
579      DEVICE8_PORT("DSW1"),         /* Port A read */
580      DEVICE8_PORT("DSW2"),         /* Port B read */
581      DEVICE8_PORT("DSW3"),         /* Port C read */
582582      NULL,                     /* Port A write */
583583      NULL,                     /* Port B write */
584584      NULL                     /* Port C write */
r3373r3374
681681   MDRV_CPU_PROGRAM_MAP(freekckb_readmem,freekckb_writemem)
682682   MDRV_CPU_IO_MAP(freekckb_io_map,0)
683683
684   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
685   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
684   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
685   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
686686
687   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
688   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
689
690687   MDRV_VIDEO_UPDATE(freekick)
691688MACHINE_DRIVER_END
692689
src/mame/drivers/getrivia.c
r3373r3374
119119   if (mask & 0x01) *BITMAP_ADDR16(tmpbitmap, sy, sx+7) = (bits & 0x01) ? fg : bg;
120120}
121121
122static READ8_HANDLER( port1_r )
122static WRITE8_DEVICE_HANDLER( lamps_w )
123123{
124   return input_port_read(machine, "IN0") | (ticket_dispenser_0_r(machine, 0) >> 5);
125}
126
127static WRITE8_HANDLER( lamps_w )
128{
129124   /* 5 button lamps */
130125   set_led_status(0,data & 0x01);
131126   set_led_status(1,data & 0x02);
r3373r3374
140135   set_led_status(6,data & 0x80);
141136}
142137
143static WRITE8_HANDLER( sound_w )
138static WRITE8_DEVICE_HANDLER( sound_w )
144139{
145140   /* bit 3 - coin lockout, lamp10 in poker / lamp6 in trivia test modes */
146141   coin_lockout_global_w(~data & 0x08);
147142   set_led_status(9,data & 0x08);
148143
149144   /* bit 5 - ticket out in trivia games */
150   ticket_dispenser_w(machine,0, (data & 0x20)<< 2);
145   ticket_dispenser_w(device->machine,0, (data & 0x20)<< 2);
151146
152147   /* bit 6 enables NMI */
153   interrupt_enable_w(machine,0,data & 0x40);
148   interrupt_enable_w(device->machine,0,data & 0x40);
154149
155150   /* bit 7 goes directly to the sound amplifier */
156151   dac_data_w(0,((data & 0x80) >> 7) * 255);
157152}
158153
159static WRITE8_HANDLER( sound2_w )
154static WRITE8_DEVICE_HANDLER( sound2_w )
160155{
161156   /* bit 3,6 - coin lockout, lamp10+11 in selection test mode */
162157   coin_lockout_w(0, ~data & 0x08);
r3373r3374
173168   dac_data_w(0,((data & 0x80) >> 7) * 255);
174169}
175170
176static WRITE8_HANDLER( lamps2_w )
171static WRITE8_DEVICE_HANDLER( lamps2_w )
177172{
178173   /* bit 4 - play/raise button lamp, lamp 9 in poker test mode  */
179174   set_led_status(8,data & 0x10);
180175}
181176
182static WRITE8_HANDLER( nmi_w )
177static WRITE8_DEVICE_HANDLER( nmi_w )
183178{
184179   /* bit 4 - play/raise button lamp, lamp 9 in selection test mode  */
185180   set_led_status(8,data & 0x10);
186181
187182   /* bit 6 enables NMI */
188   interrupt_enable_w(machine,0,data & 0x40);
183   interrupt_enable_w(device->machine,0,data & 0x40);
189184}
190185
191186static WRITE8_HANDLER( banksel_1_1_w )
r3373r3374
390385   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x00) PORT_NAME ("Start in no coins mode")
391386   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x40)
392387   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x00)
393   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )      /* ticket status */
388   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ticket_dispenser_0_port_r, 0)      /* ticket status */
394389   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
395390   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
396391   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3373r3374
417412INPUT_PORTS_END
418413
419414
420
421415static const ppi8255_interface getrivia_ppi8255_intf[2] =
422416{
423417   {
424      input_port_0_r,         /* Port A read */
425      port1_r,            /* Port B read */
418      DEVICE8_PORT("DSWA"),   /* Port A read */
419      DEVICE8_PORT("IN0"),   /* Port B read */
426420      NULL,               /* Port C read */
427421      NULL,               /* Port A write */
428422      NULL,               /* Port B write */
429423      sound_w               /* Port C write */
430424   },
431425   {
432      input_port_2_r,         /* Port A read */
426      DEVICE8_PORT("IN1"),   /* Port A read */
433427      NULL,               /* Port B read */
434428      NULL,               /* Port C read */
435429      NULL,               /* Port A write */
r3373r3374
441435static const ppi8255_interface gselect_ppi8255_intf[2] =
442436{
443437   {
444      input_port_0_r,         /* Port A read */
445      input_port_1_r,         /* Port B read */
438      DEVICE8_PORT("DSWA"),   /* Port A read */
439      DEVICE8_PORT("IN0"),   /* Port B read */
446440      NULL,               /* Port C read */
447441      NULL,               /* Port A write */
448442      NULL,               /* Port B write */
449443      sound2_w            /* Port C write */
450444   },
451445   {
452      input_port_2_r,         /* Port A read */
446      DEVICE8_PORT("IN1"),   /* Port A read */
453447      NULL,               /* Port B read */
454      input_port_3_r,         /* Port C read */
448      DEVICE8_PORT("IN2"),   /* Port C read */
455449      NULL,               /* Port A write */
456450      lamps_w,            /* Port B write */
457451      nmi_w               /* Port C write */
r3373r3374
488482   MDRV_VIDEO_START(generic_bitmapped)
489483   MDRV_VIDEO_UPDATE(generic_bitmapped)
490484
491   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
492   MDRV_DEVICE_CONFIG( getrivia_ppi8255_intf[0] )
485   MDRV_PPI8255_ADD( "ppi8255_0", getrivia_ppi8255_intf[0] )
486   MDRV_PPI8255_ADD( "ppi8255_1", getrivia_ppi8255_intf[1] )
493487
494   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
495   MDRV_DEVICE_CONFIG( getrivia_ppi8255_intf[1] )
496
497488   /* sound hardware */
498489   MDRV_SPEAKER_STANDARD_MONO("mono")
499490
r3373r3374
511502
512503   MDRV_MACHINE_RESET(gselect)
513504
514   MDRV_DEVICE_MODIFY( "ppi8255_0", PPI8255 )
515   MDRV_DEVICE_CONFIG( gselect_ppi8255_intf[0] )
516
517   MDRV_DEVICE_MODIFY( "ppi8255_1", PPI8255 )
518   MDRV_DEVICE_CONFIG( gselect_ppi8255_intf[1] )
505   MDRV_PPI8255_RECONFIG( "ppi8255_0", gselect_ppi8255_intf[0] )
506   MDRV_PPI8255_RECONFIG( "ppi8255_1", gselect_ppi8255_intf[1] )
519507MACHINE_DRIVER_END
520508
521509static MACHINE_DRIVER_START( amuse )
src/mame/drivers/zaccaria.c
r3373r3374
5454
5555static int dsw;
5656
57static WRITE8_HANDLER( zaccaria_dsw_sel_w )
57static WRITE8_DEVICE_HANDLER( zaccaria_dsw_sel_w )
5858{
5959   switch (data & 0xf0)
6060   {
r3373r3374
233233
234234static const ppi8255_interface ppi8255_intf =
235235{
236   input_port_3_r,               /* Port A read */
237   input_port_4_r,               /* Port B read */
238   input_port_5_r,               /* Port C read */
236   DEVICE8_PORT("P1"),            /* Port A read */
237   DEVICE8_PORT("P2"),            /* Port B read */
238   DEVICE8_PORT("SYSTEM"),         /* Port C read */
239239   NULL,                     /* Port A write */
240240   NULL,                     /* Port B write */
241241   zaccaria_dsw_sel_w,          /* Port C write */
r3373r3374
580580   MDRV_MACHINE_START(zaccaria)
581581   MDRV_MACHINE_RESET(zaccaria)
582582
583   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
584   MDRV_DEVICE_CONFIG( ppi8255_intf )
583   MDRV_PPI8255_ADD( "ppi8255", ppi8255_intf )
585584
586585   /* video hardware */
587586   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/shadfrce.c
r3373r3374
225225      double brt = (data & 0xff) / 255.0;
226226
227227      for (i = 0; i < 0x4000; i++)
228         palette_set_brightness(machine,i,brt);
228         palette_set_pen_contrast(machine,i,brt);
229229   }
230230}
231231
src/mame/drivers/clayshoo.c
r3373r3374
3333 *
3434 *************************************/
3535
36static WRITE8_HANDLER( input_port_select_w )
36static WRITE8_DEVICE_HANDLER( input_port_select_w )
3737{
3838   input_port_select = data;
3939}
r3373r3374
5757}
5858
5959
60static READ8_HANDLER( input_port_r )
60static READ8_DEVICE_HANDLER( input_port_r )
6161{
6262   UINT8 ret = 0;
6363
6464   switch (input_port_select)
6565   {
66   case 0x01:   ret = input_port_read(machine, "IN0"); break;
67   case 0x02:   ret = input_port_read(machine, "IN1"); break;
68   case 0x04:   ret = (input_port_read(machine, "IN2") & 0xf0) |
69                  difficulty_input_port_r(machine, 0) |
70                 (difficulty_input_port_r(machine, 3) << 2); break;
71   case 0x08:   ret = input_port_read(machine, "IN3"); break;
66   case 0x01:   ret = input_port_read(device->machine, "IN0"); break;
67   case 0x02:   ret = input_port_read(device->machine, "IN1"); break;
68   case 0x04:   ret = (input_port_read(device->machine, "IN2") & 0xf0) |
69                  difficulty_input_port_r(device->machine, 0) |
70                 (difficulty_input_port_r(device->machine, 3) << 2); break;
71   case 0x08:   ret = input_port_read(device->machine, "IN3"); break;
7272   case 0x10:
7373   case 0x20:   break;   /* these two are not really used */
7474   default: logerror("Unexpected port read: %02X\n", input_port_select);
r3373r3374
320320   MDRV_SCREEN_REFRESH_RATE(60)
321321   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
322322
323   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
324   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
325
326   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
327   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
323   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
324   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
328325MACHINE_DRIVER_END
329326
330327
src/mame/drivers/warpwarp.c
r3373r3374
198198         coin_counter_w(0,data & 1);
199199         break;
200200      case 4:
201         coin_lockout_global_w(~data & 1);
201         if (strcmp(machine->gamedrv->name, "geebeeb"))
202            coin_lockout_global_w(~data & 1);
202203         break;
203204      case 5:
204205         if( geebee_bgw != (data & 1) )
r3373r3374
357358   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
358359   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
359360   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail) )
360   PORT_DIPNAME( 0x32, 0x10, "Lives/Bonus Life" )
361   PORT_DIPSETTING(    0x10, "3/40k 80k" )
362   PORT_DIPSETTING(    0x20, "3/70k 140k" )
363   PORT_DIPSETTING(    0x30, "3/100k 200k" )
364   PORT_DIPSETTING(    0x00, "3/None" )
365   PORT_DIPSETTING(    0x12, "5/60k 120k" )
366   PORT_DIPSETTING(    0x22, "5/100k 200k" )
367   PORT_DIPSETTING(    0x32, "5/150k 300k" )
368   PORT_DIPSETTING(    0x02, "5/None" )
361   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
362   PORT_DIPSETTING(   0x00, "3" )
363   PORT_DIPSETTING(   0x02, "5" )
369364   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
370365   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
371366   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
372367   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
373368   PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
369   PORT_DIPNAME( 0x30, 0x10, "Replay" )      // awards 1 credit
370   PORT_DIPSETTING(    0x10, "40k 80k" )      PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
371   PORT_DIPSETTING(    0x20, "70k 140k" )      PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
372   PORT_DIPSETTING(    0x30, "100k 200k" )      PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
373   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
374   PORT_DIPSETTING(    0x10, "60k 120k" )      PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
375   PORT_DIPSETTING(    0x20, "100k 200k" )      PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
376   PORT_DIPSETTING(    0x30, "150k 300k" )      PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
377   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
374378   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
375379
376380   PORT_START("IN1")
r3373r3374
380384   PORT_BIT( 0xff, 0x58, IPT_PADDLE ) PORT_MINMAX(0x10,0xa0) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_CENTERDELTA(0) PORT_REVERSE PORT_COCKTAIL
381385INPUT_PORTS_END
382386
387static INPUT_PORTS_START( geebeeb )
388   PORT_INCLUDE( geebee )
389
390   PORT_MODIFY("DSW2")
391   PORT_DIPNAME( 0x30, 0x10, "Replay" )      // awards 1 credit
392   PORT_DIPSETTING(    0x10, "40k" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
393   PORT_DIPSETTING(    0x20, "70k" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
394   PORT_DIPSETTING(    0x30, "100k" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
395   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
396   PORT_DIPSETTING(    0x10, "60k" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
397   PORT_DIPSETTING(    0x20, "100k" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
398   PORT_DIPSETTING(    0x30, "150k" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
399   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
400INPUT_PORTS_END
401
383402static INPUT_PORTS_START( navarone )
384403   PORT_START("SW0")
385404   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1   )
r3373r3374
397416   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
398417   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
399418   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail) )
400   PORT_DIPNAME( 0x0e, 0x06, "Lives/Bonus Life" )
401   PORT_DIPSETTING(   0x04, "2/5000" )
402   PORT_DIPSETTING(   0x08, "2/6000" )
403   PORT_DIPSETTING(   0x0c, "2/7000" )
404   PORT_DIPSETTING(   0x00, "2/None" )
405   PORT_DIPSETTING(   0x06, "3/6000" )
406   PORT_DIPSETTING(   0x0a, "3/7000" )
407   PORT_DIPSETTING(   0x0e, "3/8000" )
408   PORT_DIPSETTING(   0x02, "3/None" )
419   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Lives ) )
420   PORT_DIPSETTING(   0x00, "2" )
421   PORT_DIPSETTING(   0x02, "3" )
422   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Bonus_Life ) )
423   PORT_DIPSETTING(    0x04, "5000" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
424   PORT_DIPSETTING(    0x08, "6000" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
425   PORT_DIPSETTING(    0x0c, "7000" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
426   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
427   PORT_DIPSETTING(    0x04, "6000" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
428   PORT_DIPSETTING(    0x08, "7000" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
429   PORT_DIPSETTING(    0x0c, "8000" )         PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
430   PORT_DIPSETTING(    0x00, DEF_STR( None ) )   PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
409431   PORT_DIPNAME( 0x30, 0x10, DEF_STR( Coinage ) )
410432   PORT_DIPSETTING(   0x30, DEF_STR( 2C_1C ) )
411433   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )
r3373r3374
630652   PORT_DIPSETTING(   0x04, "3" )
631653   PORT_DIPSETTING(   0x08, "4" )
632654   PORT_DIPSETTING(   0x0c, "5" )
633   /* Bonus Lives when "Lives" Dip Switch is set to "2", "3" or "4" */
634655   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) )
635   PORT_DIPSETTING(   0x00, "8000 30000" )
636   PORT_DIPSETTING(   0x10, "10000 40000" )
637   PORT_DIPSETTING(   0x20, "15000 60000" )
638   PORT_DIPSETTING(   0x30, DEF_STR( None ) )
639   /* Bonus Lives when "Lives" Dip Switch is set to "5"
640    PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) )
641    PORT_DIPSETTING(    0x00, "30000" )
642    PORT_DIPSETTING(    0x10, "40000" )
643    PORT_DIPSETTING(    0x20, "60000" )
644    PORT_DIPSETTING(    0x30, DEF_STR( None ) )
645    */
656   PORT_DIPSETTING(   0x00, "8k 30k 30k+" )   PORT_CONDITION("DSW1", 0x0c, PORTCOND_NOTEQUALS, 0x0c)
657   PORT_DIPSETTING(   0x10, "10k 40k 40k+" )   PORT_CONDITION("DSW1", 0x0c, PORTCOND_NOTEQUALS, 0x0c)
658   PORT_DIPSETTING(   0x20, "15k 60k 60k+" )   PORT_CONDITION("DSW1", 0x0c, PORTCOND_NOTEQUALS, 0x0c)
659   PORT_DIPSETTING(   0x30, DEF_STR( None ) )   PORT_CONDITION("DSW1", 0x0c, PORTCOND_NOTEQUALS, 0x0c)
660    PORT_DIPSETTING(    0x00, "30k" )         PORT_CONDITION("DSW1", 0x0c, PORTCOND_EQUALS, 0x0c)
661    PORT_DIPSETTING(    0x10, "40k" )         PORT_CONDITION("DSW1", 0x0c, PORTCOND_EQUALS, 0x0c)
662    PORT_DIPSETTING(    0x20, "60k" )         PORT_CONDITION("DSW1", 0x0c, PORTCOND_EQUALS, 0x0c)
663    PORT_DIPSETTING(    0x30, DEF_STR( None ) )   PORT_CONDITION("DSW1", 0x0c, PORTCOND_EQUALS, 0x0c)
646664   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
647665   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
648666   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
r3373r3374
9901008
9911009/* B & W games */
9921010GAMEL(1978, geebee,   0,        geebee,   geebee,   geebee,   ROT90, "Namco", "Gee Bee", 0, layout_geebee )
993GAMEL(1978, geebeeb,  geebee,   geebee,   geebee,   geebee,   ROT90, "[Namco] (F.lli Bertolino license)", "Gee Bee (F.lli Bertolino license)", 0, layout_geebee )
1011GAMEL(1978, geebeeb,  geebee,   geebee,   geebeeb,  geebee,   ROT90, "[Namco] (F.lli Bertolino license)", "Gee Bee (F.lli Bertolino license)", 0, layout_geebee )
9941012GAMEL(1978, geebeeg,  geebee,   geebee,   geebee,   geebee,   ROT90, "[Namco] (Gremlin license)", "Gee Bee (Gremlin)", 0, layout_geebee )
9951013GAME( 1980, navarone, 0,        navarone, navarone, navarone, ROT90, "Namco", "Navarone", GAME_IMPERFECT_SOUND )
9961014GAME( 1980, kaitei,   0,        navarone, kaitei,   kaitei,   ROT90, "Namco", "Kaitei Takara Sagashi", 0 )
src/mame/drivers/turbo.c
r3373r3374
176176
177177
178178
179static READ8_HANDLER( turbo_analog_r );
179static READ8_DEVICE_HANDLER( turbo_analog_r );
180180
181181
182182
r3373r3374
208208        3 = IC6 - CPU Board, Sheet 5, D7
209209*/
210210
211static WRITE8_HANDLER( turbo_ppi0a_w )
211static WRITE8_DEVICE_HANDLER( turbo_ppi0a_w )
212212{
213213   /* bit0-7 = 0PA0-7 */
214   turbo_state *state = machine->driver_data;
214   turbo_state *state = device->machine->driver_data;
215215   state->turbo_opa = data;
216216}
217217
218218
219static WRITE8_HANDLER( turbo_ppi0b_w )
219static WRITE8_DEVICE_HANDLER( turbo_ppi0b_w )
220220{
221221   /* bit0-7 = 0PB0-7 */
222   turbo_state *state = machine->driver_data;
222   turbo_state *state = device->machine->driver_data;
223223   state->turbo_opb = data;
224224}
225225
226226
227static WRITE8_HANDLER( turbo_ppi0c_w )
227static WRITE8_DEVICE_HANDLER( turbo_ppi0c_w )
228228{
229229   /* bit0-7 = 0PC0-7 */
230   turbo_state *state = machine->driver_data;
230   turbo_state *state = device->machine->driver_data;
231231   state->turbo_opc = data;
232232}
233233
234234
235static WRITE8_HANDLER( turbo_ppi1a_w )
235static WRITE8_DEVICE_HANDLER( turbo_ppi1a_w )
236236{
237237   /* bit0-7 = 1PA0-7 */
238   turbo_state *state = machine->driver_data;
238   turbo_state *state = device->machine->driver_data;
239239   state->turbo_ipa = data;
240240}
241241
242242
243static WRITE8_HANDLER( turbo_ppi1b_w )
243static WRITE8_DEVICE_HANDLER( turbo_ppi1b_w )
244244{
245245   /* bit0-7 = 1PB0-7 */
246   turbo_state *state = machine->driver_data;
246   turbo_state *state = device->machine->driver_data;
247247   state->turbo_ipb = data;
248248}
249249
250250
251static WRITE8_HANDLER( turbo_ppi1c_w )
251static WRITE8_DEVICE_HANDLER( turbo_ppi1c_w )
252252{
253253   /* bit0-7 = 1PC0-7 */
254   turbo_state *state = machine->driver_data;
254   turbo_state *state = device->machine->driver_data;
255255   state->turbo_ipc = data;
256256}
257257
258258
259static WRITE8_HANDLER( turbo_ppi3c_w )
259static WRITE8_DEVICE_HANDLER( turbo_ppi3c_w )
260260{
261261   /* bit 0-3 = PLA0-3 */
262262   /* bit 4-6 = COL0-2 */
263263   /* bit   7 = n/c */
264   turbo_state *state = machine->driver_data;
264   turbo_state *state = device->machine->driver_data;
265265   state->turbo_fbpla = data & 0x0f;
266266   state->turbo_fbcol = (data >> 4) & 0x07;
267267}
r3373r3374
295295   },
296296   {
297297      turbo_analog_r,
298      input_port_2_r,
298      DEVICE8_PORT("DSW2"),
299299      NULL,
300300      NULL,
301301      NULL,
r3373r3374
317317        1 = IC119 - CPU Board, Sheet 3, A5
318318*/
319319
320static WRITE8_HANDLER( subroc3d_ppi0a_w )
320static WRITE8_DEVICE_HANDLER( subroc3d_ppi0a_w )
321321{
322322   /* bit 0-3 = PLY0-3 */
323323   /* bit 4-7 = n/c */
324   turbo_state *state = machine->driver_data;
324   turbo_state *state = device->machine->driver_data;
325325   state->subroc3d_ply = data & 0x0f;
326326}
327327
328328
329static WRITE8_HANDLER( subroc3d_ppi0c_w )
329static WRITE8_DEVICE_HANDLER( subroc3d_ppi0c_w )
330330{
331331   /* bit 0-3 = COL0-3 */
332   turbo_state *state = machine->driver_data;
332   turbo_state *state = device->machine->driver_data;
333333   state->subroc3d_col = data & 0x0f;
334334}
335335
336336
337static WRITE8_HANDLER( subroc3d_ppi0b_w )
337static WRITE8_DEVICE_HANDLER( subroc3d_ppi0b_w )
338338{
339339   /* bit 0 = COM1 (COIN METER 1) */
340340   /* bit 1 = COM2 (COIN METER 2) */
341341   /* bit 2 = STLA (START LAMP) */
342342   /* bit 3 = NOUSE (n/c) */
343343   /* bit 4 = FLIP (not really flip, just offset) */
344   turbo_state *state = machine->driver_data;
344   turbo_state *state = device->machine->driver_data;
345345   coin_counter_w(0, data & 0x01);
346346   coin_counter_w(1, data & 0x02);
347347   set_led_status(0, data & 0x04);
r3373r3374
377377 *
378378 *************************************/
379379
380static WRITE8_HANDLER( buckrog_ppi0a_w )
380static WRITE8_DEVICE_HANDLER( buckrog_ppi0a_w )
381381{
382382   /* bit 0-7 = data to be read on the /IOREQ */
383   turbo_state *state = machine->driver_data;
383   turbo_state *state = device->machine->driver_data;
384384   state->buckrog_command = data;
385385}
386386
387387
388static WRITE8_HANDLER( buckrog_ppi0b_w )
388static WRITE8_DEVICE_HANDLER( buckrog_ppi0b_w )
389389{
390390   /* bit 0-5 = MOV0-5 */
391391   /* bit 6-7 = n/c */
392   turbo_state *state = machine->driver_data;
392   turbo_state *state = device->machine->driver_data;
393393   state->buckrog_mov = data & 0x3f;
394394}
395395
396396
397static WRITE8_HANDLER( buckrog_ppi0c_w )
397static WRITE8_DEVICE_HANDLER( buckrog_ppi0c_w )
398398{
399399   /* bit 0-2 = FCHG0 */
400400   /* bit 3-5 = n/c */
401401   /* bit   6 = /IOREQ on the 2nd CPU */
402402   /* bit   7 = /INT on the 2nd CPU */
403   turbo_state *state = machine->driver_data;
403   turbo_state *state = device->machine->driver_data;
404404   state->buckrog_fchg = data & 0x07;
405   cpunum_set_input_line(machine, 1, 0, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
405   cpunum_set_input_line(device->machine, 1, 0, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
406406}
407407
408408
409static WRITE8_HANDLER( buckrog_ppi1c_w )
409static WRITE8_DEVICE_HANDLER( buckrog_ppi1c_w )
410410{
411411   /* bit 0-2 = OBCH0-2 */
412412   /* bit   3 = n/c */
r3373r3374
414414   /* bit   5 = COM2 (COIN METER 2) */
415415   /* bit   6 = STLA (START LAMP) */
416416   /* bit   7 = NOUSE (BODY SONIC) */
417   turbo_state *state = machine->driver_data;
417   turbo_state *state = device->machine->driver_data;
418418   state->buckrog_obch = data & 0x07;
419419   coin_counter_w(0, data & 0x10);
420420   coin_counter_w(1, data & 0x20);
r3373r3374
637637}
638638
639639
640static READ8_HANDLER( turbo_analog_r )
640static READ8_DEVICE_HANDLER( turbo_analog_r )
641641{
642   turbo_state *state = machine->driver_data;
643   return input_port_read(machine, "DIAL") - state->turbo_last_analog;
642   turbo_state *state = device->machine->driver_data;
643   return input_port_read(device->machine, "DIAL") - state->turbo_last_analog;
644644}
645645
646646
r3373r3374
679679{
680680   /* assert ACK */
681681   turbo_state *state = machine->driver_data;
682   ppi8255_set_portC(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), 0x00);
682   ppi8255_set_port_c(devtag_get_device(machine, PPI8255, "ppi8255_0"), 0x00);
683683   return state->buckrog_command;
684684}
685685
r3373r3374
718718
719719static TIMER_CALLBACK( delayed_ppi8255_w )
720720{
721    ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), param >> 8, param & 0xff);
721    ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_0"), param >> 8, param & 0xff);
722722}
723723
724724
r3373r3374
10811081   MDRV_CPU_PROGRAM_MAP(turbo_map,0)
10821082   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
10831083
1084   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1085   MDRV_DEVICE_CONFIG( turbo_8255_intf[0] )
1084   MDRV_PPI8255_ADD( "ppi8255_0", turbo_8255_intf[0] )
1085   MDRV_PPI8255_ADD( "ppi8255_1", turbo_8255_intf[1] )
1086   MDRV_PPI8255_ADD( "ppi8255_2", turbo_8255_intf[2] )
1087   MDRV_PPI8255_ADD( "ppi8255_3", turbo_8255_intf[3] )
10861088
1087   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1088   MDRV_DEVICE_CONFIG( turbo_8255_intf[1] )
1089
1090   MDRV_DEVICE_ADD( "ppi8255_2", PPI8255 )
1091   MDRV_DEVICE_CONFIG( turbo_8255_intf[2] )
1092
1093   MDRV_DEVICE_ADD( "ppi8255_3", PPI8255 )
1094   MDRV_DEVICE_CONFIG( turbo_8255_intf[3] )
1095
10961089   /* video hardware */
10971090   MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
10981091   MDRV_GFXDECODE(turbo)
r3373r3374
11191112   MDRV_CPU_PROGRAM_MAP(subroc3d_map,0)
11201113   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
11211114
1122   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1123   MDRV_DEVICE_CONFIG( subroc3d_8255_intf[0] )
1115   MDRV_PPI8255_ADD( "ppi8255_0", subroc3d_8255_intf[0] )
1116   MDRV_PPI8255_ADD( "ppi8255_1", subroc3d_8255_intf[1] )
11241117
1125   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1126   MDRV_DEVICE_CONFIG( subroc3d_8255_intf[1] )
1127
11281118   /* video hardware */
11291119   MDRV_GFXDECODE(turbo)
11301120   MDRV_PALETTE_LENGTH(256)
r3373r3374
11571147   MDRV_INTERLEAVE(10)
11581148   MDRV_MACHINE_RESET(buckrog)
11591149
1160   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1161   MDRV_DEVICE_CONFIG( buckrog_8255_intf[0] )
1150   MDRV_PPI8255_ADD( "ppi8255_0", buckrog_8255_intf[0] )
1151   MDRV_PPI8255_ADD( "ppi8255_1", buckrog_8255_intf[1] )
11621152
1163   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1164   MDRV_DEVICE_CONFIG( buckrog_8255_intf[1] )
1165
11661153   /* video hardware */
11671154   MDRV_GFXDECODE(turbo)
11681155   MDRV_PALETTE_LENGTH(1024)
src/mame/drivers/alg.c
r3373r3374
7171   VIDEO_START_CALL(amiga);
7272
7373   /* configure pen 4096 as transparent in the renderer and use it for the genlock color */
74   render_container_set_palette_alpha(render_container_get_screen(machine->primary_screen), 4096, 0x00);
74   palette_set_color(machine, 4096, MAKE_ARGB(0,0,0,0));
7575   amiga_set_genlock_color(4096);
7676}
7777
src/mame/drivers/gatron.c
r3373r3374
297297}
298298
299299
300static WRITE8_HANDLER( output_port_1_w )
300static WRITE8_DEVICE_HANDLER( output_port_1_w )
301301{
302302/*  ----------------
303303    Lamps & Counters
r3373r3374
323323
324324static const ppi8255_interface ppi8255_intf =
325325{
326   input_port_0_r,      /* Port A read */
327   input_port_1_r,      /* Port B read */
326   DEVICE8_PORT("IN0"),/* Port A read */
327   DEVICE8_PORT("IN1"),/* Port B read */
328328   NULL,            /* Port C read */
329329   NULL,            /* Port A write */
330330   NULL,            /* Port B write */
r3373r3374
441441
442442   MDRV_NVRAM_HANDLER(generic_0fill)
443443
444   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
445   MDRV_DEVICE_CONFIG( ppi8255_intf )
444   MDRV_PPI8255_ADD( "ppi8255", ppi8255_intf )
446445
447446   /* video hardware */
448447   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/firefox.c
r3373r3374
153153   int sprite;
154154   int gfxtop = video_screen_get_visible_area(screen)->min_y;
155155
156   fillbitmap( bitmap, 256, cliprect );
156   fillbitmap( bitmap, palette_get_color(screen->machine, 256), cliprect );
157157
158158   for( y = 0; y < 64; y++ )
159159   {
r3373r3374
203203   int b = palette_ram[ index + 512 ];
204204   int a = ( b & 3 ) * 0x55;
205205
206   palette_set_color( machine, start + index, MAKE_RGB( r, g, b ) );
207   render_container_set_palette_alpha(render_container_get_screen(machine->primary_screen), start + index, a);
206   palette_set_color( machine, start + index, MAKE_ARGB( a, r, g, b ) );
208207}
209208
210209static WRITE8_HANDLER( tile_palette_w )
r3373r3374
654653   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_HZ((double)MASTER_XTAL/8/16/16/16/16))
655654
656655   /* video hardware */
657   MDRV_LASERDISC_SCREEN_ADD_NTSC("main", BITMAP_FORMAT_INDEXED16)
656   MDRV_LASERDISC_SCREEN_ADD_NTSC("main", BITMAP_FORMAT_RGB32)
658657
659658   MDRV_GFXDECODE(firefox)
660659   MDRV_PALETTE_LENGTH(512)
661660
662661   MDRV_LASERDISC_ADD("laserdisc", PHILLIPS_22VP931, "main", "ldsound")
663   MDRV_LASERDISC_OVERLAY(firefox, 64*8, 525, BITMAP_FORMAT_INDEXED16)
662   MDRV_LASERDISC_OVERLAY(firefox, 64*8, 525, BITMAP_FORMAT_RGB32)
664663   MDRV_LASERDISC_OVERLAY_CLIP(7*8, 53*8-1, 44, 480+44)
665664
666665   MDRV_DEVICE_ADD("nvram_1c",X2212)
src/mame/drivers/astrocde.c
r3373r3374
490490 *
491491 *************************************/
492492
493static void ctc_interrupt(running_machine *machine, int state)
493static void ctc_interrupt(const device_config *device, int state)
494494{
495   cpunum_set_input_line(machine, 1, 0, state);
495   cputag_set_input_line(device->machine, "sub", 0, state);
496496}
497497
498498
499499static z80ctc_interface ctc_intf =
500500{
501   "sub",            /* clock comes from sub CPU */
501502   0,                 /* clock (filled in from the CPU 0 clock) */
502503   0,                 /* timer disables */
503504   ctc_interrupt,     /* interrupt handler */
r3373r3374
518519};
519520
520521
521static MACHINE_START( tenpindx )
522{
523   /* initialize the CTC */
524   ctc_intf.baseclock = cpunum_get_clock(0);
525   z80ctc_init(0, &ctc_intf);
526   MACHINE_START_CALL(astrocde);
527}
528
529
530522static WRITE8_HANDLER( tenpindx_sound_w )
531523{
532524   soundlatch_w(machine, offset, data);
533   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
525   cputag_set_input_line(machine, "sub", INPUT_LINE_NMI, PULSE_LINE);
534526}
535527
536528
r3373r3374
714706
715707static ADDRESS_MAP_START( tenpin_sub_io_map, ADDRESS_SPACE_IO, 8 )
716708   ADDRESS_MAP_GLOBAL_MASK(0xff)
717   AM_RANGE(0x90, 0x93) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
709   AM_RANGE(0x90, 0x93) AM_DEVREADWRITE(Z80CTC, "ctc", z80ctc_r, z80ctc_w)
718710   AM_RANGE(0x97, 0x97) AM_READ(soundlatch_r)
719711   AM_RANGE(0x98, 0x98) AM_WRITE(ay8910_control_port_0_w)
720712   AM_RANGE(0x98, 0x98) AM_READ(ay8910_read_port_0_r)
r3373r3374
12431235 *
12441236 *************************************/
12451237
1246static const struct z80_irq_daisy_chain tenpin_daisy_chain[] =
1238static const z80_daisy_chain tenpin_daisy_chain[] =
12471239{
1248   { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti, 0 }, /* CTC number 0 */
1249   { 0, 0, 0, 0, -1 }      /* end mark */
1240   { Z80CTC, "ctc" },
1241   { NULL }
12501242};
12511243
12521244
r3373r3374
14701462   MDRV_CPU_PROGRAM_MAP(tenpin_sub_map,0)
14711463   MDRV_CPU_IO_MAP(tenpin_sub_io_map,0)
14721464
1473   MDRV_MACHINE_START(tenpindx)
1465   MDRV_Z80CTC_ADD("ctc", ctc_intf)
14741466
14751467   /* sound hardware */
14761468   MDRV_SPEAKER_STANDARD_MONO("mono")
src/mame/drivers/sg1000a.c
r3373r3374
241241   vdp_interrupt
242242};
243243
244static WRITE8_HANDLER( sg1000a_coin_counter_w )
244static WRITE8_DEVICE_HANDLER( sg1000a_coin_counter_w )
245245{
246246   coin_counter_w(0, data & 0x01);
247247}
248248
249249static const ppi8255_interface ppi8255_intf =
250250{
251   input_port_0_r,
252   input_port_1_r,
253   input_port_2_r,
251   DEVICE8_PORT("P1"),
252   DEVICE8_PORT("P2"),
253   DEVICE8_PORT("DSW"),
254254   NULL,
255255   NULL,
256256   sg1000a_coin_counter_w
r3373r3374
269269   MDRV_CPU_IO_MAP(io_map, 0)
270270   MDRV_CPU_VBLANK_INT("main", sg1000a_interrupt)
271271
272   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
273   MDRV_DEVICE_CONFIG( ppi8255_intf )
272   MDRV_PPI8255_ADD( "ppi8255", ppi8255_intf )
274273
275274   /* video hardware */
276275   MDRV_IMPORT_FROM(tms9928a)
src/mame/drivers/istellar.c
r3373r3374
4444{
4545   int charx, chary;
4646
47   render_container_set_palette_alpha(render_container_get_screen(screen), 0, 0x00);
48
4947   /* clear */
5048   fillbitmap(bitmap, 0, cliprect);
5149
r3373r3374
291289
292290      palette_set_color(machine,i,MAKE_RGB(r,g,b));
293291   }
292
293   /* make color 0 transparent */
294   palette_set_color(machine, 0, MAKE_ARGB(0,0,0,0));
294295}
295296
296297static const gfx_layout istellar_gfx_layout =
src/mame/drivers/8080bw.c
r3373r3374
229229    MDRV_CPU_MODIFY("main")
230230    MDRV_CPU_IO_MAP(invadpt2_io_map,0)
231231
232    /* 60 Hz signal clocks two LS161. Ripple carry will */
233    /* reset circuit, if LS161 not cleared before.      */
234    MDRV_WATCHDOG_VBLANK_INIT(255)
235
232236   /* video hardware */
233237   MDRV_VIDEO_UPDATE(invadpt2)
234238
src/mame/drivers/othunder.c
r3373r3374
247247                INTERRUPTS
248248***********************************************************/
249249
250static int vblank_irq, ad_irq, last_irq_level;
250static int vblank_irq, ad_irq;
251251
252252static MACHINE_RESET( othunder )
253253{
254254   vblank_irq = 0;
255255   ad_irq = 0;
256   last_irq_level = 0;
257256}
258257
259258static void update_irq(running_machine *machine)
260259{
261   int curr_level;
262
263   if (ad_irq)
264      curr_level = 6;
265   else if (vblank_irq)
266      curr_level = 5;
267   else
268      curr_level = 0;
269
270   if (curr_level != last_irq_level)
271   {
272      cpunum_set_input_line(machine, 0,curr_level,curr_level ? ASSERT_LINE : CLEAR_LINE);
273      last_irq_level = curr_level;
274   }
260   cpunum_set_input_line(machine, 0, 6, ad_irq ? ASSERT_LINE : CLEAR_LINE);
261   cpunum_set_input_line(machine, 0, 5, vblank_irq ? ASSERT_LINE : CLEAR_LINE);
275262}
276263
277264static WRITE16_HANDLER( irq_ack_w )
src/mame/drivers/meritm.c
r3373r3374
9393#define UART_CLK   XTAL_18_432MHz
9494
9595static UINT8* meritm_ram;
96static const device_config *meritm_z80pio[2];
9697
98
9799/*************************************
98100 *
99101 *  DS1204 Electronic Key
r3373r3374
297299         meritm_vint |= 0x08;
298300
299301      if(i)
300         z80pio_p_w(machine, 0, 0, meritm_vint);
302         z80pio_p_w(meritm_z80pio[0], 0, meritm_vint);
301303   }
302304}
303305
r3373r3374
312314         meritm_vint |= 0x10;
313315
314316      if(i)
315         z80pio_p_w(machine, 0, 0, meritm_vint);
317         z80pio_p_w(meritm_z80pio[0], 0, meritm_vint);
316318   }
317319}
318320
r3373r3374
556558   AM_RANGE(0x22, 0x22) AM_WRITE(v9938_1_palette_w)
557559   AM_RANGE(0x23, 0x23) AM_WRITE(v9938_1_register_w)
558560   AM_RANGE(0x30, 0x33) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
559   AM_RANGE(0x40, 0x43) AM_READWRITE(z80pio_0_r, z80pio_0_w)
560   AM_RANGE(0x50, 0x53) AM_READWRITE(z80pio_1_r, z80pio_1_w)
561   AM_RANGE(0x40, 0x43) AM_DEVREADWRITE(Z80PIO, "z80pio_0", z80pio_r, z80pio_w)
562   AM_RANGE(0x50, 0x53) AM_DEVREADWRITE(Z80PIO, "z80pio_1", z80pio_r, z80pio_w)
561563   AM_RANGE(0x80, 0x80) AM_READWRITE(ay8910_read_port_0_r, ay8910_control_port_0_w)
562564   AM_RANGE(0x81, 0x81) AM_WRITE(ay8910_write_port_0_w)
563565   AM_RANGE(0xff, 0xff) AM_WRITE(meritm_crt250_bank_w)
r3373r3374
582584   AM_RANGE(0x22, 0x22) AM_WRITE(v9938_1_palette_w)
583585   AM_RANGE(0x23, 0x23) AM_WRITE(v9938_1_register_w)
584586   AM_RANGE(0x30, 0x33) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
585   AM_RANGE(0x40, 0x43) AM_READWRITE(z80pio_0_r, z80pio_0_w)
586   AM_RANGE(0x50, 0x53) AM_READWRITE(z80pio_1_r, z80pio_1_w)
587   AM_RANGE(0x40, 0x43) AM_DEVREADWRITE(Z80PIO, "z80pio_0", z80pio_r, z80pio_w)
588   AM_RANGE(0x50, 0x53) AM_DEVREADWRITE(Z80PIO, "z80pio_1", z80pio_r, z80pio_w)
587589   AM_RANGE(0x60, 0x67) AM_READWRITE(pc16552d_0_r,pc16552d_0_w)
588590   AM_RANGE(0x80, 0x80) AM_READWRITE(ay8910_read_port_0_r, ay8910_control_port_0_w)
589591   AM_RANGE(0x81, 0x81) AM_WRITE(ay8910_write_port_0_w)
r3373r3374
670672 *
671673 *************************************/
672674
673static READ8_HANDLER(meritm_8255_port_c_r)
675static READ8_DEVICE_HANDLER(meritm_8255_port_c_r)
674676{
675677   //logerror( "8255 port C read\n" );
676678   return 0xff;
677679};
678680
679static WRITE8_HANDLER(meritm_crt250_port_b_w)
681static WRITE8_DEVICE_HANDLER(meritm_crt250_port_b_w)
680682{
681683   //popmessage("Lamps: %d %d %d %d %d %d %d", BIT(data,0), BIT(data,1), BIT(data,2), BIT(data,3), BIT(data,4), BIT(data,5), BIT(data,6) );
682684   output_set_value("P1 DISC 1 LAMP", !BIT(data,0));
r3373r3374
745747 *
746748 *************************************/
747749
748static void meritm_audio_pio_interrupt(running_machine *machine, int state)
750static void meritm_audio_pio_interrupt(const device_config *device, int state)
749751{
750752   //logerror( "PIO(0) interrupt line: %d, V = %d, H = %d\n", state, video_screen_get_vpos(0), video_screen_get_hpos(0) );
751   cpunum_set_input_line(machine, 0, 0, state);
753   cpunum_set_input_line(device->machine, 0, 0, state);
752754}
753755
754static void meritm_io_pio_interrupt(running_machine *machine, int state)
756static void meritm_io_pio_interrupt(const device_config *device, int state)
755757{
756758   //logerror( "PIO(1) interrupt line: %d, V = %d, H = %d\n", state, video_screen_get_vpos(0), video_screen_get_hpos(0) );
757   cpunum_set_input_line(machine, 0, 0, state);
759   cpunum_set_input_line(device->machine, 0, 0, state);
758760}
759761
760762
761static READ8_HANDLER(meritm_audio_pio_port_a_r)
763static READ8_DEVICE_HANDLER(meritm_audio_pio_port_a_r)
762764{
763765   return meritm_vint;
764766};
765767
766static READ8_HANDLER(meritm_audio_pio_port_b_r)
768static READ8_DEVICE_HANDLER(meritm_audio_pio_port_b_r)
767769{
768770   return ds1204_r();
769771};
770772
771static WRITE8_HANDLER(meritm_audio_pio_port_a_w)
773static WRITE8_DEVICE_HANDLER(meritm_audio_pio_port_a_w)
772774{
773775   meritm_bank = (data & 7) | ((data >> 2) & 0x18);
774776   //logerror("Writing BANK with %x (raw = %x)\n", meritm_bank, data);
775777};
776778
777static WRITE8_HANDLER(meritm_audio_pio_port_b_w)
779static WRITE8_DEVICE_HANDLER(meritm_audio_pio_port_b_w)
778780{
779781   ds1204_w((data & 0x4) >> 2, (data & 0x2) >> 1, data & 0x01);
780782};
781783
782static READ8_HANDLER(meritm_io_pio_port_a_r)
784static READ8_DEVICE_HANDLER(meritm_io_pio_port_a_r)
783785{
784   return input_port_read(machine, "PIO1_PORTA");
786   return input_port_read(device->machine, "PIO1_PORTA");
785787};
786788
787static READ8_HANDLER(meritm_io_pio_port_b_r)
789static READ8_DEVICE_HANDLER(meritm_io_pio_port_b_r)
788790{
789   return input_port_read(machine, "PIO1_PORTB");
791   return input_port_read(device->machine, "PIO1_PORTB");
790792};
791793
792static WRITE8_HANDLER(meritm_io_pio_port_a_w)
794static WRITE8_DEVICE_HANDLER(meritm_io_pio_port_a_w)
793795{
794796};
795797
796static WRITE8_HANDLER(meritm_io_pio_port_b_w)
798static WRITE8_DEVICE_HANDLER(meritm_io_pio_port_b_w)
797799{
798800};
799801
r3373r3374
826828}
827829#endif
828830
829static const struct z80_irq_daisy_chain meritm_daisy_chain[] =
831static const z80_daisy_chain meritm_daisy_chain[] =
830832{
831   { z80pio_reset, z80pio_irq_state, z80pio_irq_ack, z80pio_irq_reti, 1 }, /* PIO number 1 */
832   { z80pio_reset, z80pio_irq_state, z80pio_irq_ack, z80pio_irq_reti, 0 }, /* PIO number 0 */
833   { 0, 0, 0, 0, -1 }      /* end mark */
833   { Z80PIO, "z80pio_1" },
834   { Z80PIO, "z80pio_0" },
835   { NULL }
834836};
835837
836838static MACHINE_START(merit_common)
837839{
838   z80pio_init(0, &meritm_audio_pio_intf);
839   z80pio_init(1, &meritm_io_pio_intf);
840   meritm_z80pio[0] = devtag_get_device( machine, Z80PIO, "z80pio_0" );
841   meritm_z80pio[1] = devtag_get_device( machine, Z80PIO, "z80pio_1" );
840842   //input_port_set_changed_callback(port_tag_to_index("PIO1_PORTB"), 0xff, meritm_pio1_portb_input_changed_callback, NULL);
841843
842844};
r3373r3374
904906
905907   MDRV_MACHINE_START(meritm_crt250)
906908
907   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
908   MDRV_DEVICE_CONFIG( crt250_ppi8255_intf )
909   MDRV_PPI8255_ADD( "ppi8255", crt250_ppi8255_intf )
909910
911   MDRV_Z80PIO_ADD( "z80pio_0", meritm_audio_pio_intf )
912   MDRV_Z80PIO_ADD( "z80pio_1", meritm_io_pio_intf )
913
910914   MDRV_NVRAM_HANDLER(generic_0fill)
911915
912916   MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
r3373r3374
945949   MDRV_CPU_PROGRAM_MAP(meritm_map,0)
946950   MDRV_CPU_IO_MAP(meritm_io_map,0)
947951
948   MDRV_DEVICE_MODIFY( "ppi8255", PPI8255 )
949   MDRV_DEVICE_CONFIG( crt260_ppi8255_intf )
952   MDRV_PPI8255_RECONFIG( "ppi8255", crt260_ppi8255_intf )
950953
951954   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_MSEC(1200))   // DS1232, TD connected to VCC
952955   MDRV_MACHINE_START(meritm_crt260)
src/mame/drivers/lucky74.c
r3373r3374
755755*    Lamps    *
756756**************/
757757
758static WRITE8_HANDLER(lamps_a_w)
758static WRITE8_DEVICE_HANDLER(lamps_a_w)
759759{
760760/*  LAMPSA:
761761
r3373r3374
770770   output_set_lamp_value(11, (data >> 3) & 1);      /* SMALL */
771771}
772772
773static WRITE8_HANDLER(lamps_b_w)
773static WRITE8_DEVICE_HANDLER(lamps_b_w)
774774{
775775/*  LAMPSB:
776776
r3373r3374
11731173static const ppi8255_interface ppi8255_intf[4] =
11741174{
11751175   {   /* A & B set as input */
1176      input_port_0_r,         /* Port A read, IN0 */
1177      input_port_1_r,         /* Port B read, IN1 */
1176      DEVICE8_PORT("IN0"),   /* Port A read, IN0 */
1177      DEVICE8_PORT("IN1"),   /* Port B read, IN1 */
11781178      NULL,               /* Port C read */
11791179      NULL,               /* Port A write */
11801180      NULL,               /* Port B write */
11811181      NULL               /* Port C writes: 0x00 after reset, 0xff during game, and 0xfd when tap F2 for percentage and run count */
11821182   },
11831183   {   /* A & C set as input */
1184      input_port_2_r,         /* Port A read, IN2 */
1184      DEVICE8_PORT("IN2"),   /* Port A read, IN2 */
11851185      NULL,               /* Port B read */
1186      input_port_4_r,         /* Port C read, IN4 */
1186      DEVICE8_PORT("IN4"),   /* Port C read, IN4 */
11871187      NULL,               /* Port A write */
11881188      NULL,               /* Port B write */
11891189      NULL               /* Port C write */
11901190   },
11911191   {   /* A, B & C set as input */
1192      input_port_5_r,         /* Port A read, DSW1 */
1193      input_port_6_r,         /* Port B read, DSW2 */
1194      input_port_7_r,         /* Port C read, DSW3 */
1192      DEVICE8_PORT("DSW1"),   /* Port A read, DSW1 */
1193      DEVICE8_PORT("DSW2"),   /* Port B read, DSW2 */
1194      DEVICE8_PORT("DSW3"),   /* Port C read, DSW3 */
11951195      NULL,               /* Port A write */
11961196      NULL,               /* Port B write */
11971197      NULL               /* Port C write */
11981198   },
11991199   {   /* A set as input */
1200      input_port_8_r,         /* Port A read, DSW4 */
1200      DEVICE8_PORT("DSW4"),   /* Port A read, DSW4 */
12011201      NULL,               /* Port B read */
12021202      NULL,               /* Port C read */
12031203      NULL,               /* Port A write */
r3373r3374
12441244
12451245   MDRV_SOUND_START(lucky74)
12461246
1247
12481247   /* 2x 82c255 (4x 8255) */
1249   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
1250   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
1248   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
1249   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
1250   MDRV_PPI8255_ADD( "ppi8255_2", ppi8255_intf[2] )
1251   MDRV_PPI8255_ADD( "ppi8255_3", ppi8255_intf[3] )
12511252
1252   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
1253   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
1254
1255   MDRV_DEVICE_ADD( "ppi8255_2", PPI8255 )
1256   MDRV_DEVICE_CONFIG( ppi8255_intf[2] )
1257
1258   MDRV_DEVICE_ADD( "ppi8255_3", PPI8255 )
1259   MDRV_DEVICE_CONFIG( ppi8255_intf[3] )
1260
12611253   /* video hardware */
12621254   MDRV_SCREEN_ADD("main", RASTER)
12631255   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/psikyo4.c
r3373r3374
299299         int i;
300300
301301         for (i = 0; i < 0x800; i++)
302            palette_set_brightness(machine,i,brt1);
302            palette_set_pen_contrast(machine,i,brt1);
303303
304304         oldbrt1 = brt1;
305305      }
r3373r3374
326326         int i;
327327
328328         for (i = 0x800; i < 0x1000; i++)
329            palette_set_brightness(machine,i,brt2);
329            palette_set_pen_contrast(machine,i,brt2);
330330
331331         oldbrt2 = brt2;
332332      }
src/mame/drivers/tx1.c
r3373r3374
414414   return z80_ram[offset];
415415}
416416
417static WRITE8_HANDLER( tx1_coin_cnt )
417static WRITE8_DEVICE_HANDLER( tx1_coin_cnt )
418418{
419419   coin_counter_w(0, data & 0x80);
420420   coin_counter_w(1, data & 0x40);
r3373r3374
426426   tx1_ppi_latch_b = input_port_read(machine, "AN_STEERING");
427427}
428428
429static READ8_HANDLER( tx1_ppi_porta_r )
429static READ8_DEVICE_HANDLER( tx1_ppi_porta_r )
430430{
431431   return tx1_ppi_latch_a;
432432}
433433
434static READ8_HANDLER( tx1_ppi_portb_r )
434static READ8_DEVICE_HANDLER( tx1_ppi_portb_r )
435435{
436   return input_port_read(machine, "PPI_PORTD") | tx1_ppi_latch_b;
436   return input_port_read(device->machine, "PPI_PORTD") | tx1_ppi_latch_b;
437437}
438438
439439/* TODO */
r3373r3374
463463/* Buggy Boy uses an 8255 PPI instead of YM2149 ports for inputs! */
464464static const ppi8255_interface buggyboy_ppi8255_intf =
465465{
466   input_port_1_r,
466   DEVICE8_PORT("PPI_PORTA"),
467467   NULL,
468   input_port_2_r,
468   DEVICE8_PORT("PPI_PORTC"),
469469   NULL,
470470   NULL,
471471   NULL
r3373r3374
476476{
477477   tx1_ppi_porta_r,
478478   tx1_ppi_portb_r,
479   input_port_4_r,
479   DEVICE8_PORT("PPI_PORTC"),
480480   NULL,
481481   NULL,
482482   tx1_coin_cnt
r3373r3374
695695   MDRV_MACHINE_START(tx1)
696696   MDRV_NVRAM_HANDLER(generic_0fill)
697697
698   MDRV_DEVICE_ADD("ppi8255", PPI8255)
699   MDRV_DEVICE_CONFIG(tx1_ppi8255_intf)
698   MDRV_PPI8255_ADD("ppi8255", tx1_ppi8255_intf)
700699
701700   MDRV_PALETTE_LENGTH(256)
702701   MDRV_PALETTE_INIT(tx1)
r3373r3374
751750   MDRV_MACHINE_START(buggyboy)
752751   MDRV_NVRAM_HANDLER(generic_0fill)
753752
754   MDRV_DEVICE_ADD("ppi8255", PPI8255)
755   MDRV_DEVICE_CONFIG(buggyboy_ppi8255_intf)
753   MDRV_PPI8255_ADD("ppi8255", buggyboy_ppi8255_intf)
756754
757755   MDRV_DEFAULT_LAYOUT(layout_triphsxs)
758756
src/mame/drivers/merit.c
r3373r3374
88  - Some other missing categories romsets and new / old revision
99
1010  TODO:
11  - finish video emulation (colors and flipped tiles?)
11  - add flipscreen according to schematics
12  - pitboss: dip switches
13  - general - add named output notifiers
1214
1315Notes: it's important that "user1" is 0xa0000 bytes with empty space filled
1416       with 0xff, because the built-in roms test checks how many question roms
r3373r3374
3335#include "driver.h"
3436#include "machine/8255ppi.h"
3537#include "sound/ay8910.h"
38#include "video/mc6845.h"
3639
37static tilemap *bg_tilemap;
38static UINT8 *phrcraze_attr;
40#define MASTER_CLOCK         (XTAL_10MHz)
41#define CPU_CLOCK            (MASTER_CLOCK / 4)
42#define PIXEL_CLOCK            (MASTER_CLOCK / 1)
43#define CRTC_CLOCK            (MASTER_CLOCK / 8)
3944
45#define NUM_PENS            (16)
46#define RAM_PALETTE_SIZE      (1024)
47
48static pen_t pens[NUM_PENS];
49
50static UINT8 *ram_attr;
51static UINT8 *ram_video;
52
53static UINT8 *ram_palette;
54
55static UINT8 lscnblk;
4056static int extra_video_bank_bit;
4157
42static int question_address = 0;
58static int question_address;
4359static int decryption_key;
4460
61static MACHINE_START(merit)
62{
63   question_address = 0;
64   ram_palette = auto_malloc(RAM_PALETTE_SIZE);
65
66   state_save_register_global_pointer(ram_palette, RAM_PALETTE_SIZE);
67   state_save_register_global(lscnblk);
68   state_save_register_global(extra_video_bank_bit);
69   state_save_register_global(question_address);
70   state_save_register_global(decryption_key);
71}
72
73
4574static READ8_HANDLER( questions_r )
4675{
4776   UINT8 *questions = memory_region(machine, "user1");
r3373r3374
79108      case 0x18: address = 0x90000;
80109         break;
81110
82// not used? only 10 roms are tested in service mode
83// b0 b1 b2 b3 b4 b5 b6 b7 a8 98
84//      case 0xb0: address = 0xa0000;
85//          break;
111/* not used? only 10 roms are tested in service mode
112 * b0 b1 b2 b3 b4 b5 b6 b7 a8 98
113 *      case 0xb0: address = 0xa0000;
114 *          break;
115 */
86116
87117      default: logerror("read unknown question rom: %02X\n",question_address >> 16);
88118         return 0xff;
r3373r3374
113143   question_address = (question_address & 0x00ffff) | (offset << 16);
114144}
115145
116static WRITE8_HANDLER( phrcraze_attr_w )
146static READ8_HANDLER( palette_r )
117147{
118   phrcraze_attr[offset] = data;
119   tilemap_mark_tile_dirty(bg_tilemap,offset);
148   int co;
149
150   co = ((ram_attr[offset] & 0x7F) << 3) | (offset & 0x07);
151   return ram_palette[co];
120152}
121153
122static WRITE8_HANDLER( phrcraze_bg_w )
154static WRITE8_HANDLER( palette_w )
123155{
124   videoram[offset] = data;
125   tilemap_mark_tile_dirty(bg_tilemap,offset);
156   int co;
157
158   video_screen_update_now(machine->primary_screen);
159   data &= 0x0f;
160
161   co = ((ram_attr[offset] & 0x7F) << 3) | (offset & 0x07);
162   ram_palette[co] = data;
163
126164}
127165
128// I think this looks more like a colortable than a palette
129static WRITE8_HANDLER( palette_w )
166
167static MC6845_BEGIN_UPDATE( begin_update )
130168{
131169   int i;
170   int dim, bit0, bit1, bit2;
132171
133   paletteram[offset] = data & 0x0f;
134   for (i = 0; i < 0x100; i++)
172   for (i=0; i < NUM_PENS; i++)
135173   {
136//      int bit = (i & 0x300)>>8;
137      offset = ((i & 0x7f)<<3) | ((i & 0x80) >> 5);
174      dim = BIT(i,3) ? 255 : 127;
175      bit0 = BIT(i,0);
176      bit1 = BIT(i,1);
177      bit2 = BIT(i,2);
178      pens[i] = MAKE_RGB(dim*bit0, dim*bit1, dim*bit2);
179   }
138180
139      palette_set_color_rgb(machine,i,
140            pal4bit(BIT(paletteram[offset],0)*0x1 + BIT(paletteram[offset+1],0)*0x2 + BIT(paletteram[offset+2],0)*0x4 + BIT(paletteram[offset+3],0)*0x8),
141            pal4bit(BIT(paletteram[offset],1)*0x1 + BIT(paletteram[offset+1],1)*0x2 + BIT(paletteram[offset+2],1)*0x4 + BIT(paletteram[offset+3],1)*0x8),
142            pal4bit(BIT(paletteram[offset],2)*0x1 + BIT(paletteram[offset+1],2)*0x2 + BIT(paletteram[offset+2],2)*0x4 + BIT(paletteram[offset+3],2)*0x8));
181   return pens;
182}
183
184
185static MC6845_UPDATE_ROW( update_row )
186{
187   UINT8 cx;
188
189   pen_t *pens = (pen_t *)param;
190   UINT8 *gfx[2];
191   UINT16 x = 0;
192   int rlen;
193
194   gfx[0] = memory_region(device->machine, "gfx1");
195   gfx[1] = memory_region(device->machine, "gfx2");
196   rlen = memory_region_length(device->machine, "gfx2");
197
198   //ma = ma ^ 0x7ff;
199   for (cx = 0; cx < x_count; cx++)
200   {
201      int i;
202      int attr = ram_attr[ma];
203      int region = (attr & 0x40) >> 6;
204      int addr = ((ram_video[ma] | ((attr & 0x80) << 1) | (extra_video_bank_bit)) << 4) | (ra & 0x0f);
205      int colour = (attr & 0x7f) << 3;
206      UINT8   *data;
207
208      addr &= (rlen-1);
209      data = gfx[region];
210
211      for (i = 7; i>=0; i--)
212      {
213         int col = colour;
214
215         col |= (BIT(data[0x0000 | addr],i)<<2);
216         if (region==0)
217         {
218            col |= (BIT(data[rlen | addr],i)<<1);
219            col |= (BIT(data[rlen<<1 | addr],i)<<0);
220         }
221         else
222            col |= 0x03;
223
224         col = ram_palette[col & 0x3ff];
225         *BITMAP_ADDR32(bitmap, y, x) = pens[col ? col : (lscnblk ? 8 : 0)];
226
227         x++;
228      }
229      ma++;
143230   }
144231}
145232
146static WRITE8_HANDLER( led1_w )
233
234MC6845_ON_HSYNC_CHANGED(hsync_changed)
147235{
236   /* update any video up to the current scanline */
237   video_screen_update_now(device->machine->primary_screen);
238}
239
240MC6845_ON_VSYNC_CHANGED(vsync_changed)
241{
242   cpunum_set_input_line(device->machine, 0, 0, vsync ? ASSERT_LINE : CLEAR_LINE);
243}
244
245static const mc6845_interface mc6845_intf =
246{
247   "main",               /* screen we are acting on */
248   CRTC_CLOCK,          /* the clock (pin 21) of the chip */
249   8,                  /* number of pixels per video memory address */
250   begin_update,         /* before pixel update callback */
251   update_row,            /* row update callback */
252   0,                  /* after pixel update callback */
253   0,                  /* callback for display state changes */
254   hsync_changed,         /* HSYNC callback */
255   vsync_changed         /* VSYNC callback */
256};
257
258static WRITE8_DEVICE_HANDLER( led1_w )
259{
148260   /* 5 button lamps player 1 */
149261   set_led_status(0,~data & 0x01);
150262   set_led_status(1,~data & 0x02);
r3373r3374
166278   coin_counter_w(0,0x80-(data & 0x80));
167279}
168280
169static WRITE8_HANDLER( misc_w )
281static WRITE8_DEVICE_HANDLER( misc_w )
170282{
171283   flip_screen_set(~data & 0x10);
172284   extra_video_bank_bit = (data & 2) << 8;
285   lscnblk = (data >> 3) & 1;
173286
174   // other bits unknown
287   /* other bits unknown */
175288}
176289
177290static ADDRESS_MAP_START( pitboss_map, ADDRESS_SPACE_PROGRAM, 8 )
178291   AM_RANGE(0x0000, 0x5fff) AM_ROM
179   AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
292   AM_RANGE(0x6000, 0x67ff) AM_RAM
180293   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN1")
181294   AM_RANGE(0xa001, 0xa001) AM_READ_PORT("IN0")
182   AM_RANGE(0xa002, 0xa002) AM_NOP //dips ?
183//  AM_RANGE(0xc000, 0xc002) AM_NOP
184   AM_RANGE(0xe000, 0xe001) AM_WRITENOP // 6845 crt
185   AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(phrcraze_attr_w) AM_BASE(&phrcraze_attr)
186   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(phrcraze_bg_w) AM_BASE(&videoram)
187   AM_RANGE(0xf800, 0xfbff) AM_WRITE(palette_w) AM_BASE(&paletteram)
295   AM_RANGE(0xa002, 0xa002) AM_NOP /* dips ? */
296/*  AM_RANGE(0xc000, 0xc002) AM_NOP */
297   AM_RANGE(0xe000, 0xe000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
298   AM_RANGE(0xe001, 0xe001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
299   AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(&ram_attr)
300   AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(&ram_video)
301   AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w)
188302ADDRESS_MAP_END
189303
190304static ADDRESS_MAP_START( bigappg_map, ADDRESS_SPACE_PROGRAM, 8 )
191305   AM_RANGE(0x0000, 0x5fff) AM_ROM
192   AM_RANGE(0xa000, 0xafff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
306   AM_RANGE(0xa000, 0xafff) AM_RAM
193307   AM_RANGE(0xc004, 0xc007) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
194308   AM_RANGE(0xc008, 0xc00b) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
195   AM_RANGE(0xe000, 0xe001) AM_WRITENOP // 6845 crt
196   AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(phrcraze_attr_w) AM_BASE(&phrcraze_attr)
197   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(phrcraze_bg_w) AM_BASE(&videoram)
198   AM_RANGE(0xf800, 0xfbff) AM_WRITE(palette_w) AM_BASE(&paletteram)
309   AM_RANGE(0xe000, 0xe000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
310   AM_RANGE(0xe001, 0xe001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
311   AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(&ram_attr)
312   AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(&ram_video)
313   AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w)
199314ADDRESS_MAP_END
200315
201316
r3373r3374
204319   AM_RANGE(0x4c00, 0x4cff) AM_READWRITE(questions_r, high_offset_w)
205320   AM_RANGE(0x5400, 0x54ff) AM_WRITE(low_offset_w)
206321   AM_RANGE(0x5800, 0x58ff) AM_WRITE(med_offset_w)
207   AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
322   AM_RANGE(0x6000, 0x67ff) AM_RAM
208323   AM_RANGE(0xa000, 0xa003) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
209324   AM_RANGE(0xc000, 0xc003) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
210   AM_RANGE(0xe000, 0xe001) AM_WRITENOP // 6845 crt
211   AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(phrcraze_attr_w) AM_BASE(&phrcraze_attr)
212   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(phrcraze_bg_w) AM_BASE(&videoram)
213   AM_RANGE(0xf800, 0xfbff) AM_WRITE(palette_w) AM_BASE(&paletteram)
325   AM_RANGE(0xe000, 0xe000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
326   AM_RANGE(0xe001, 0xe001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
327   AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(&ram_attr)
328   AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(&ram_video)
329   AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w)
214330ADDRESS_MAP_END
215331
216332static ADDRESS_MAP_START( trvwhiz_io_map, ADDRESS_SPACE_IO, 8 )
r3373r3374
221337
222338static ADDRESS_MAP_START( phrcraze_map, ADDRESS_SPACE_PROGRAM, 8 )
223339   AM_RANGE(0x0000, 0x7fff) AM_ROM
224   AM_RANGE(0xa000, 0xbfff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
340   AM_RANGE(0xa000, 0xbfff) AM_RAM
225341   AM_RANGE(0xc008, 0xc00b) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
226342   AM_RANGE(0xc00c, 0xc00f) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
227343   AM_RANGE(0xce00, 0xceff) AM_READWRITE(questions_r, high_offset_w)
228344   AM_RANGE(0xd600, 0xd6ff) AM_WRITE(low_offset_w)
229345   AM_RANGE(0xda00, 0xdaff) AM_WRITE(med_offset_w)
230   AM_RANGE(0xe000, 0xe001) AM_WRITENOP // 6845 crt
231   AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(phrcraze_attr_w) AM_BASE(&phrcraze_attr)
232   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(phrcraze_bg_w) AM_BASE(&videoram)
233   AM_RANGE(0xf800, 0xfbff) AM_WRITE(palette_w) AM_BASE(&paletteram)
346   AM_RANGE(0xe000, 0xe000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
347   AM_RANGE(0xe001, 0xe001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
348   AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(&ram_attr)
349   AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(&ram_video)
350   AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w)
234351ADDRESS_MAP_END
235352
236353static ADDRESS_MAP_START( phrcraze_io_map, ADDRESS_SPACE_IO, 8 )
r3373r3374
241358
242359static ADDRESS_MAP_START( tictac_map, ADDRESS_SPACE_PROGRAM, 8 )
243360   AM_RANGE(0x0000, 0x7fff) AM_ROM
244   AM_RANGE(0x8000, 0x9fff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
361   AM_RANGE(0x8000, 0x9fff) AM_RAM
245362   AM_RANGE(0xc004, 0xc007) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
246363   AM_RANGE(0xc008, 0xc00b) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
247364   AM_RANGE(0xce00, 0xceff) AM_READWRITE(questions_r, high_offset_w)
248365   AM_RANGE(0xd600, 0xd6ff) AM_WRITE(low_offset_w)
249366   AM_RANGE(0xda00, 0xdaff) AM_WRITE(med_offset_w)
250   AM_RANGE(0xe000, 0xe001) AM_WRITENOP // 6845 crt
251   AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(phrcraze_attr_w) AM_BASE(&phrcraze_attr)
252   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(phrcraze_bg_w) AM_BASE(&videoram)
253   AM_RANGE(0xf800, 0xfbff) AM_WRITE(palette_w) AM_BASE(&paletteram)
367   AM_RANGE(0xe000, 0xe000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
368   AM_RANGE(0xe001, 0xe001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
369   AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(&ram_attr)
370   AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(&ram_video)
371   AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w)
254372ADDRESS_MAP_END
255373
256374static ADDRESS_MAP_START( tictac_io_map, ADDRESS_SPACE_IO, 8 )
r3373r3374
261379
262380static ADDRESS_MAP_START( trvwhziv_map, ADDRESS_SPACE_PROGRAM, 8 )
263381   AM_RANGE(0x0000, 0x7fff) AM_ROM
264   AM_RANGE(0xa000, 0xbfff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
382   AM_RANGE(0xa000, 0xbfff) AM_RAM
265383   AM_RANGE(0xc004, 0xc007) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
266384   AM_RANGE(0xc008, 0xc00b) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
267385   AM_RANGE(0xce00, 0xceff) AM_READWRITE(questions_r, high_offset_w)
268386   AM_RANGE(0xd600, 0xd6ff) AM_WRITE(low_offset_w)
269387   AM_RANGE(0xda00, 0xdaff) AM_WRITE(med_offset_w)
270   AM_RANGE(0xe000, 0xe001) AM_WRITENOP // 6845 crt
271   AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(phrcraze_attr_w) AM_BASE(&phrcraze_attr)
272   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(phrcraze_bg_w) AM_BASE(&videoram)
273   AM_RANGE(0xf800, 0xfbff) AM_WRITE(palette_w) AM_BASE(&paletteram)
388   AM_RANGE(0xe000, 0xe000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
389   AM_RANGE(0xe001, 0xe001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
390   AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(&ram_attr)
391   AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(&ram_video)
392   AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w)
274393ADDRESS_MAP_END
275394
276395
277396
278// in service mode:
279// keep service test button pressed to clear the coin counter.
280// keep it pressed for 10 seconds to clear all the memory.
281// to enter hidden test mode enable "Enable Test Mode", enable "Reset High Scores"
397/* in service mode:
398 * keep service test button pressed to clear the coin counter.
399 * keep it pressed for 10 seconds to clear all the memory.
400 * to enter hidden test mode enable "Enable Test Mode", enable "Reset High Scores"
401 */
282402static INPUT_PORTS_START( phrcraze )
283403   PORT_START("IN0")
284404   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
r3373r3374
345465   PORT_DIPSETTING(    0xc0, "Upright 1 Player" )
346466   PORT_DIPSETTING(    0x00, "Upright 2 Players" )
347467   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
348//  PORT_DIPSETTING(    0x40, "Upright 1 Player" )
468   /*  PORT_DIPSETTING(    0x40, "Upright 1 Player" ) */
349469INPUT_PORTS_END
350470
351// in service mode:
352// keep service test button pressed to clear the coin counter.
353// keep it pressed for 10 seconds to clear all the memory.
354// to enter hidden test mode enable "Enable Test Mode", enable "Reset High Scores"
471/* in service mode:
472 * keep service test button pressed to clear the coin counter.
473 * keep it pressed for 10 seconds to clear all the memory.
474 * to enter hidden test mode enable "Enable Test Mode", enable "Reset High Scores"
475 */
355476static INPUT_PORTS_START( phrcrazs )
356477   PORT_START("IN0")
357478   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
r3373r3374
416537   PORT_DIPSETTING(    0xc0, "Upright 1 Player" )
417538   PORT_DIPSETTING(    0x00, "Upright 2 Players" )
418539   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
419// PORT_DIPSETTING(    0x40, "Upright 1 Player" )
540/* PORT_DIPSETTING(    0x40, "Upright 1 Player" ) */
420541INPUT_PORTS_END
421542
422// keep service test button pressed to clear the coin counter.
423// To enter hidden test-mode in service mode:
424// enable "Reset High Scores" then press "Service Mode"
543/* keep service test button pressed to clear the coin counter.
544 * To enter hidden test-mode in service mode:
545 * enable "Reset High Scores" then press "Service Mode"
546 */
425547static INPUT_PORTS_START( tictac )
426548   PORT_START("IN0")
427549   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
r3373r3374
486608   PORT_DIPSETTING(    0xc0, "Upright 1 Player" )
487609   PORT_DIPSETTING(    0x00, "Upright 2 Players" )
488610   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
489//  PORT_DIPSETTING(    0x40, "Upright 1 Player" )
611/*  PORT_DIPSETTING(    0x40, "Upright 1 Player" ) */
490612INPUT_PORTS_END
491613
492614static INPUT_PORTS_START( trivia )
r3373r3374
557679   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
558680INPUT_PORTS_END
559681
560// in service mode:
561// keep service test button pressed to clear the coin counter.
562// keep it pressed for 10 seconds to clear all the memory.
563// to enter hidden test mode enable "Enable Test Mode", enable "Reset High Scores"
682/* in service mode:
683 * keep service test button pressed to clear the coin counter.
684 * keep it pressed for 10 seconds to clear all the memory.
685 * to enter hidden test mode enable "Enable Test Mode", enable "Reset High Scores"
686*/
564687static INPUT_PORTS_START( trvwhziv )
565688   PORT_INCLUDE( trivia )
566689
r3373r3374
596719   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
597720
598721   PORT_START("IN1")
599   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) //z
600   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) //x
601   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON7 ) //c
602   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON8 ) //v
603   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON9 ) //b
722   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) /* z */
723   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) /* x */
724   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON7 ) /* c */
725   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON8 ) /* v */
726   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON9 ) /* b */
604727
605728   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
606729   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )
r3373r3374
716839   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
717840INPUT_PORTS_END
718841
719static TILE_GET_INFO( get_tile_info_bg )
842static VIDEO_UPDATE( merit )
720843{
721   int attr = phrcraze_attr[tile_index];
722   int region = (attr & 0x40) >> 6;
723   int code = videoram[tile_index] | ((attr & 0x80) << 1);
844   const device_config *mc6845 = device_list_find_by_tag(screen->machine->config->devicelist, MC6845, "crtc");
845   mc6845_update(mc6845, bitmap, cliprect);
724846
725   if(region == 0)
726      code |= extra_video_bank_bit;
727
728   SET_TILE_INFO(region, code, 0, 0);
729}
730
731
732static VIDEO_START( merit )
733{
734   bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,8,8,64,32);
735}
736
737static VIDEO_UPDATE( merit )
738{
739   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
740847   return 0;
741848}
742849
743static const gfx_layout tiles8x8x3_layout =
744{
745   8,8,
746   RGN_FRAC(1,3),
747   3,
748   { RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3) },
749   { 0, 1, 2, 3, 4, 5, 6, 7 },
750   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
751   16*8
752};
753
754static const gfx_layout tiles8x8x1_layout =
755{
756   8,8,
757   RGN_FRAC(1,1),
758   1,
759   { 0 },
760   { 0, 1, 2, 3, 4, 5, 6, 7 },
761   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
762   16*8
763};
764
765static GFXDECODE_START( merit )
766   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8x3_layout, 0,  32 )
767   GFXDECODE_ENTRY( "gfx2", 0, tiles8x8x1_layout, 0, 128 )
768   GFXDECODE_ENTRY( "gfx1", 8, tiles8x8x3_layout, 0,  32 ) // flipped tiles
769   GFXDECODE_ENTRY( "gfx2", 8, tiles8x8x1_layout, 0, 128 ) // flipped tiles
770GFXDECODE_END
771
772850static const ppi8255_interface ppi8255_intf[2] =
773851{
774852   {
775      input_port_0_r,            /* Port A read */
776      input_port_1_r,            /* Port B read */
777      input_port_2_r,            /* Port C read */
853      DEVICE8_PORT("IN0"),      /* Port A read */
854      DEVICE8_PORT("IN1"),      /* Port B read */
855      DEVICE8_PORT("IN2"),      /* Port C read */
778856      NULL,                  /* Port A write */
779857      NULL,                  /* Port B write */
780858      NULL                  /* Port C write */
781859   },
782860   {
783      input_port_3_r,            /* Port A read */
861      DEVICE8_PORT("IN3"),      /* Port A read */
784862      NULL,                  /* Port B read */
785863      NULL,                  /* Port C read */
786864      NULL,                  /* Port A write */
r3373r3374
799877
800878
801879static MACHINE_DRIVER_START( pitboss )
802   MDRV_CPU_ADD("main",Z80,2500000)      /* ?? */
880   MDRV_CPU_ADD("main",Z80, CPU_CLOCK)
803881   MDRV_CPU_PROGRAM_MAP(pitboss_map,0)
804882   MDRV_CPU_IO_MAP(trvwhiz_io_map,0)
805   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
806883
807   MDRV_NVRAM_HANDLER(generic_0fill)
884   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
885   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
808886
809   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
810   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
887   MDRV_MACHINE_START(merit)
888   /* video hardware */
811889
812   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
813   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
814
815   /* video hardware */
816890   MDRV_SCREEN_ADD("main", RASTER)
817   MDRV_SCREEN_REFRESH_RATE(60)
818   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
819   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
820   MDRV_SCREEN_SIZE(64*8, 32*8)
821   MDRV_SCREEN_VISIBLE_AREA(0, 64*8-1, 1*8, 32*8-1)
891   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
892   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 512, 0, 512, 256, 0, 256)   /* temporary, CRTC will configure screen */
822893
823   MDRV_GFXDECODE(merit)
824   MDRV_PALETTE_LENGTH(0x100)
894   MDRV_DEVICE_ADD("crtc", MC6845)
895   MDRV_DEVICE_CONFIG(mc6845_intf)
825896
826   MDRV_VIDEO_START(merit)
827897   MDRV_VIDEO_UPDATE(merit)
828898
829899   /* sound hardware */
830900   MDRV_SPEAKER_STANDARD_MONO("mono")
831901
832   MDRV_SOUND_ADD("ay", AY8910, 2500000)
902   MDRV_SOUND_ADD("ay", AY8910, CRTC_CLOCK)
833903   MDRV_SOUND_CONFIG(merit_ay8912_interface)
834904   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
835905MACHINE_DRIVER_END
r3373r3374
9311001   ROM_REGION( 0x2000, "gfx2", 0 )
9321002   ROM_LOAD( "trivia.u40",   0x0000, 0x2000, CRC(cea7319f) SHA1(663cd18a4699dfd5ad1d3357094eff247e9b4a47) )
9331003
934   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) // questions
1004   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
9351005   ROM_LOAD( "trivia.ent",   0x08000, 0x8000, CRC(ff45d92b) SHA1(10356bc6a04b2c53ecaf76cb0cba3ec70b4ba612) )
9361006   ROM_LOAD( "trivia1.ent",  0x18000, 0x8000, CRC(902e26f7) SHA1(f13b816bfc507fb429fb3f44531de346a82c780d) )
9371007   ROM_LOAD( "trivia.gen",   0x28000, 0x8000, CRC(1d8d353f) SHA1(6bd0cc5c67da81a48737f32bc49cbf235648c4c6) )
r3373r3374
9531023   ROM_REGION( 0x2000, "gfx2", 0 )
9541024   ROM_LOAD( "trivia.u40",   0x0000, 0x2000, CRC(cea7319f) SHA1(663cd18a4699dfd5ad1d3357094eff247e9b4a47) )
9551025
956   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) // questions
1026   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
9571027   ROM_LOAD( "trivia.spo",   0x08000, 0x8000, CRC(64181d34) SHA1(f84e28fc589b86ca6a596815871ed26602bcc095) )
9581028   ROM_LOAD( "trivia1.spo",  0x18000, 0x8000, CRC(ae111429) SHA1(ff551d7ac7ad367338e908805aeb78c59a747919) )
9591029   ROM_LOAD( "trivia2.spo",  0x28000, 0x8000, CRC(ee9263b3) SHA1(1644ab01f17e3af1e193e509d64dcbb243d3eb80) )
r3373r3374
9721042   ROM_REGION( 0x2000, "gfx2", 0 )
9731043   ROM_LOAD( "u40.bin",      0x0000, 0x2000, CRC(1f0ff6e0) SHA1(5a31afde34aeb6f851389d093bb426e5cfdedbf2) )
9741044
975   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) // questions
1045   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
9761046   ROM_LOAD( "ent_001_01.bin", 0x08000, 0x8000, CRC(c68ce954) SHA1(bf70fe64f095d5cfcf5347d83651b78c6c8bf05f) )
9771047   ROM_LOAD( "ent_001_02.bin", 0x18000, 0x8000, CRC(aac4ff63) SHA1(d68c4408b4dad976e317a33f2a4eaee39d90dbed) )
9781048   ROM_LOAD( "gen_001_01.bin", 0x28000, 0x8000, CRC(5deb1900) SHA1(b7e9407c37481ef8953e8283d45949d951302e92) )
r3373r3374
9941064   ROM_REGION( 0x2000, "gfx2", 0 )
9951065   ROM_LOAD( "u40.bin",      0x0000, 0x2000, CRC(1f0ff6e0) SHA1(5a31afde34aeb6f851389d093bb426e5cfdedbf2) )
9961066
997   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) // questions
1067   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
9981068   ROM_LOAD( "spo_001_01.bin", 0x08000, 0x8000, CRC(7b56315d) SHA1(4c8c63b80176bfac9594958a7043627012baada3) )
9991069   ROM_LOAD( "spo_001_02.bin", 0x18000, 0x8000, CRC(148b63ee) SHA1(9f3b222d979f23b313f379cbc06cc00d88d08c56) )
10001070   ROM_LOAD( "spo_001_03.bin", 0x28000, 0x8000, CRC(a6af8e41) SHA1(64f672bfa5fb2c0575103614986e53e238c5984f) )
r3373r3374
10131083   ROM_REGION( 0x2000, "gfx2", 0 )
10141084   ROM_LOAD( "u40a",         0x0000, 0x2000, CRC(fbfae092) SHA1(b8569819952a5c805f11b6854d64b3ae9c857f97) )
10151085
1016   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) // questions
1086   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
10171087   ROM_LOAD( "ent_101.01a",  0x08000, 0x8000, CRC(3825ac47) SHA1(d0da047c4d30a26f496b3663cfda77c229279be8) )
10181088   ROM_LOAD( "ent_101.02a",  0x18000, 0x8000, CRC(a0153407) SHA1(e669957a5d4775bfa2c16960a2a909a3505c078b) )
10191089   ROM_LOAD( "ent_101.03a",  0x28000, 0x8000, CRC(755b16ab) SHA1(277ea4110479ecdb2c772299ea04f4918cf7f561) )
r3373r3374
10391109   ROM_REGION( 0x2000, "gfx2", 0 )
10401110   ROM_LOAD( "u40",          0x0000, 0x2000, CRC(e829473f) SHA1(ba754d9377d955b409970494e1a14dbe1d359ee5) )
10411111
1042   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) // questions
1112   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
10431113   ROM_LOAD( "7",            0x08000, 0x8000, CRC(974dca96) SHA1(eb4a745c84307a1bbb220659877f97c28cd515ac) )
10441114   ROM_LOAD( "8",            0x18000, 0x8000, CRC(e15ef8d0) SHA1(51c946311ffe507aa9031044bc34e5ae8d3473ab) )
10451115   ROM_LOAD( "9",            0x28000, 0x8000, CRC(503115a1) SHA1(5e6630191465b3d2a590fab08b4f47f7408ecc44) )
r3373r3374
10641134   ROM_REGION( 0x2000, "gfx2", 0 )
10651135   ROM_LOAD( "u40",   0x0000, 0x2000, CRC(fbfae092) SHA1(b8569819952a5c805f11b6854d64b3ae9c857f97) )
10661136
1067   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) // questions
1137   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
10681138   ROM_LOAD( "10",    0x08000, 0x8000, CRC(15d16703) SHA1(9184f63669e9ec93e88276777e1b7f209543c3e3) )
10691139   ROM_LOAD( "8",     0x18000, 0x8000, CRC(647f3394) SHA1(636647ae620fd2f985b82e3516451e3bffd44040) )
10701140   ROM_LOAD( "7",     0x28000, 0x8000, CRC(974dca96) SHA1(eb4a745c84307a1bbb220659877f97c28cd515ac) )
r3373r3374
10891159   ROM_REGION( 0x2000, "gfx2", 0 )
10901160   ROM_LOAD( "u40.bin",      0x0000, 0x2000, CRC(fbfae092) SHA1(b8569819952a5c805f11b6854d64b3ae9c857f97) )
10911161
1092   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) // questions
1162   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
10931163   ROM_LOAD( "ent_4_1.bin",  0x08000, 0x8000, CRC(1b317149) SHA1(94e882e9cc041ac8f292136c1ce2d21340ac5e7f) )
10941164   ROM_LOAD( "ent_4_2.bin",  0x18000, 0x8000, CRC(43d51697) SHA1(7af3f16f9519184ae63d8818bbc52a2ba897f275) )
10951165   ROM_LOAD( "rnp_4_1.bin",  0x28000, 0x8000, CRC(e54fc4bc) SHA1(4607974ed2bf83c475396fc1cbb1e09ad084ace8) )
r3373r3374
11371207   ROM_REGION( 0x2000, "gfx2", 0 )
11381208   ROM_LOAD( "merit.u40",    0x00000, 0x2000, CRC(ab0088eb) SHA1(23a05a4dc11a8497f4fc7e4a76085af15ff89cea) )
11391209
1140   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) // questions
1210   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
11411211   ROM_LOAD( "merit.pb1",    0x08000, 0x8000, CRC(d1584173) SHA1(7a2190203f478f446cc70c473c345e7cc332e049) )
11421212   ROM_LOAD( "merit.pb2",    0x18000, 0x8000, CRC(d00ab1fd) SHA1(c94269c8a478e88f71aeca94c6f20fc05a9c62bd) )
11431213   ROM_LOAD( "merit.pb3",    0x28000, 0x8000, CRC(71b398a9) SHA1(5ea07c409afd52c7d08592b30ff0ff3b72c3f8c3) )
r3373r3374
11541224   ROM_REGION( 0x10000, "main", 0 )
11551225   ROM_LOAD( "phrz.11",      0x00000, 0x8000, CRC(ccd33a0c) SHA1(869b66af4369f3b4bc19336ca2b8104c7f652de7) )
11561226
1157   // probably over-dumped
1227   // probably over-dumped, 1st and 2nd half identical
11581228   ROM_REGION( 0x18000, "gfx1", 0 )
1159   ROM_LOAD( "phrz.10",      0x00000, 0x8000, CRC(bfa78b67) SHA1(1b51c0e00240f798fe717624e706cb15700bc2f9) )
1160   ROM_LOAD( "phrz.8",       0x08000, 0x8000, CRC(9ce22cb3) SHA1(b653afb8f13decd993e434aaad69a6e09ab65f83) )
1161   ROM_LOAD( "phrz.7",       0x10000, 0x8000, CRC(237e221a) SHA1(7aa69375c2b9a9e73e0e4ed207bf595368b2deb2) )
1229   ROM_LOAD( "phrz.7",       0x00000, 0x8000, CRC(237e221a) SHA1(7aa69375c2b9a9e73e0e4ed207bf595368b2deb2) )
1230   ROM_LOAD( "phrz.10",      0x08000, 0x8000, CRC(bfa78b67) SHA1(1b51c0e00240f798fe717624e706cb15700bc2f9) )
1231   ROM_LOAD( "phrz.8",       0x10000, 0x8000, CRC(9ce22cb3) SHA1(b653afb8f13decd993e434aaad69a6e09ab65f83) )
11621232
11631233   // probably over-dumped
1164   ROM_REGION( 0x8000, "gfx2", 0 )
1234   ROM_REGION( 0x08000, "gfx2", 0 )
11651235   ROM_LOAD( "phrz.9",       0x00000, 0x8000, CRC(17dcddd4) SHA1(51682bdbfb67cd0ccf20b97e8fa12d72f0fe82ed) )
11661236
11671237   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) // questions
r3373r3374
11781248   ROM_LOAD( "u5.bin",       0x00000, 0x8000, CRC(6122b5bb) SHA1(9952b14334287a992eefefbdc887b9a9215304ef) )
11791249
11801250   ROM_REGION( 0xc000, "gfx1", 0 )
1181   ROM_LOAD( "u39.bin",      0x00000, 0x4000, CRC(adbd2cdc) SHA1(a1e9481bd6ee0f8915cea43eaad3ebdd54438eed) )
1182   ROM_LOAD( "u38.bin",      0x04000, 0x4000, CRC(3578f00d) SHA1(c6780a6ee1b5eb00258a89bceabbbe380d79d299) )
1183   ROM_LOAD( "u37.bin",      0x08000, 0x4000, CRC(962f18a3) SHA1(ec1c3e470c59905c0f56fce2703f6ff586849512) )
1251   ROM_LOAD( "u39.bin",      0x00000, 0x4000, BAD_DUMP CRC(adbd2cdc) SHA1(a1e9481bd6ee0f8915cea43eaad3ebdd54438eed) )
1252   ROM_LOAD( "u38.bin",      0x04000, 0x4000, BAD_DUMP CRC(3578f00d) SHA1(c6780a6ee1b5eb00258a89bceabbbe380d79d299) )
1253   ROM_LOAD( "u37.bin",      0x08000, 0x4000, BAD_DUMP CRC(962f18a3) SHA1(ec1c3e470c59905c0f56fce2703f6ff586849512) )
11841254
11851255   ROM_REGION( 0x4000, "gfx2", 0 )
1186   ROM_LOAD( "u40.bin",      0x00000, 0x4000, CRC(493172c8) SHA1(a76ff5d0d3dd56b0ee4352f03c9ce92f107d34ec) )
1256   ROM_LOAD( "u40.bin",      0x00000, 0x4000, BAD_DUMP CRC(493172c8) SHA1(a76ff5d0d3dd56b0ee4352f03c9ce92f107d34ec) )
11871257
1188   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) // questions
1258   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
11891259   ROM_LOAD( "std1.bin",     0x00000, 0x8000, CRC(0a016c5e) SHA1(1a24ecd7fe59b08c75a1b4575c7fe467cc7f0cf8) )
11901260   ROM_LOAD( "std2.bin",     0x10000, 0x8000, CRC(e67dc49e) SHA1(5265af228531dc16db7f7ee78da6e51ef9a1d772) )
11911261   ROM_LOAD( "std3.bin",     0x20000, 0x8000, CRC(5c79a653) SHA1(85a904465b347564e937074e2b18159604c83e51) )
r3373r3374
11931263   ROM_LOAD( "std5.bin",     0x40000, 0x8000, CRC(dc9d8682) SHA1(46973da4298d0ed149c651498527c91b8ba57e0a) )
11941264   ROM_LOAD( "std6.bin",     0x50000, 0x8000, CRC(48e24f17) SHA1(f50c85505f6ab2360f0885494001f174224f8575) )
11951265   /* empty space as per instructions for other "sex" category roms */
1196   //"Sex" questions revision A
1266   /* "Sex" questions revision A */
11971267   ROM_LOAD( "sex1_2a.bin",  0x80000, 0x8000, CRC(7ef3bca7) SHA1(f25cd01f996882a500e1a800d924759cd1de255d) )
11981268   ROM_LOAD( "sex1_1a.bin",  0x90000, 0x8000, CRC(ed7604b8) SHA1(b1e841b50b8ef6ae95fafac1c34b6d0337a05d18) )
11991269ROM_END
r3373r3374
12121282   ROM_LOAD( "dodge.u38",    0x08000, 0x8000, CRC(654d5b00) SHA1(9e16330b2dc8821fc20a39eb42176fda23085bfc) )
12131283   ROM_LOAD( "dodge.u37",    0x10000, 0x8000, CRC(bc9e63d4) SHA1(2320f5a0545f18e1e42a3a45fedce912c36fbe13) )
12141284
1215   ROM_REGION( 0x2000, "gfx2", ROMREGION_ERASEFF )
1285   ROM_REGION( 0x8000, "gfx2", ROMREGION_ERASEFF )
12161286    /* socket at position u40 is unpopulated */
12171287ROM_END
12181288
r3373r3374
12431313   decryption_key = 7;
12441314}
12451315
1246GAME( 1983, pitboss,  0,       pitboss,  pitboss,  0,      ROT0,  "Merit", "Pit Boss",                                    GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
1247GAME( 1983, casino5,  0,       pitboss,  pitboss,  0,      ROT0,  "Merit", "Casino 5",                                    GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
1248GAME( 1985, trvwzh,   0,       trvwhiz,  trivia,   key_0,  ROT0,  "Merit", "Trivia ? Whiz (Horizontal - Question set 1)", GAME_WRONG_COLORS )
1249GAME( 1985, trvwzha,  trvwzh,  trvwhiz,  trivia,   key_0,  ROT0,  "Merit", "Trivia ? Whiz (Horizontal - Question set 2)", GAME_WRONG_COLORS )
1250GAME( 1985, trvwzv,   0,       trvwhiz,  trivia,   key_0,  ROT90, "Merit", "Trivia ? Whiz (Vertical - Question set 1)",   GAME_WRONG_COLORS )
1251GAME( 1985, trvwzva,  trvwzv,  trvwhiz,  trivia,   key_0,  ROT90, "Merit", "Trivia ? Whiz (Vertical - Question set 2)",   GAME_WRONG_COLORS )
1252GAME( 1985, trvwz2,   0,       trvwhiz,  trivia,   key_2,  ROT90, "Merit", "Trivia ? Whiz (Edition 2)",                   GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS )
1253GAME( 1985, trvwz3h,  0,       trvwhiz,  trivia,   key_0,  ROT0,  "Merit", "Trivia ? Whiz (Edition 3 - Horizontal)",      GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS )
1254GAME( 1985, trvwz3v,  0,       trvwhiz,  trivia,   key_0,  ROT90, "Merit", "Trivia ? Whiz (Edition 3 - Vertical)",        GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS )
1255GAME( 1985, trvwz4,   0,       trvwhziv, trvwhziv, key_5,  ROT90, "Merit", "Trivia ? Whiz (Edition 4)",                   GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS )
1256GAME( 1985, tictac,   0,       tictac,   tictac,   key_4,  ROT0,  "Merit", "Tic Tac Trivia",                              GAME_WRONG_COLORS )
1257GAME( 1986, phrcraze, 0,       phrcraze, phrcraze, key_7,  ROT0,  "Merit", "Phraze Craze",                                GAME_WRONG_COLORS )
1258GAME( 1986, phrcrazs, 0,       phrcraze, phrcrazs, key_7,  ROT90, "Merit", "Phraze Craze (Sex Kit)",                      GAME_WRONG_COLORS )
1259GAME( 1986, bigappg,  0,       bigappg,  bigappg,  0,      ROT0,  "Merit", "Big Apple Games ?",                           GAME_WRONG_COLORS | GAME_NOT_WORKING )
1260GAME( 1986, dodge,    0,       bigappg,  bigappg,  0,      ROT0,  "Merit", "Dodge City",                                  GAME_WRONG_COLORS | GAME_NOT_WORKING )
1316GAME( 1983, pitboss,  0,       pitboss,  pitboss,  0,      ROT0,  "Merit", "Pit Boss",                                    GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS )
1317GAME( 1983, casino5,  0,       pitboss,  pitboss,  0,      ROT0,  "Merit", "Casino 5",                                    GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
1318GAME( 1985, trvwzh,   0,       trvwhiz,  trivia,   key_0,  ROT0,  "Merit", "Trivia ? Whiz (Horizontal - Question set 1)", GAME_SUPPORTS_SAVE )
1319GAME( 1985, trvwzha,  trvwzh,  trvwhiz,  trivia,   key_0,  ROT0,  "Merit", "Trivia ? Whiz (Horizontal - Question set 2)", GAME_SUPPORTS_SAVE )
1320GAME( 1985, trvwzv,   0,       trvwhiz,  trivia,   key_0,  ROT90, "Merit", "Trivia ? Whiz (Vertical - Question set 1)",   GAME_SUPPORTS_SAVE )
1321GAME( 1985, trvwzva,  trvwzv,  trvwhiz,  trivia,   key_0,  ROT90, "Merit", "Trivia ? Whiz (Vertical - Question set 2)",   GAME_SUPPORTS_SAVE )
1322GAME( 1985, trvwz2,   0,       trvwhiz,  trivia,   key_2,  ROT90, "Merit", "Trivia ? Whiz (Edition 2)",                   GAME_SUPPORTS_SAVE )
1323GAME( 1985, trvwz3h,  0,       trvwhiz,  trivia,   key_0,  ROT0,  "Merit", "Trivia ? Whiz (Edition 3 - Horizontal)",      GAME_SUPPORTS_SAVE )
1324GAME( 1985, trvwz3v,  0,       trvwhiz,  trivia,   key_0,  ROT90, "Merit", "Trivia ? Whiz (Edition 3 - Vertical)",        GAME_SUPPORTS_SAVE )
1325GAME( 1985, trvwz4,   0,       trvwhziv, trvwhziv, key_5,  ROT90, "Merit", "Trivia ? Whiz (Edition 4)",                   GAME_SUPPORTS_SAVE )
1326GAME( 1985, tictac,   0,       tictac,   tictac,   key_4,  ROT0,  "Merit", "Tic Tac Trivia",                              GAME_SUPPORTS_SAVE )
1327GAME( 1986, phrcraze, 0,       phrcraze, phrcraze, key_7,  ROT0,  "Merit", "Phraze Craze",                                GAME_SUPPORTS_SAVE )
1328GAME( 1986, phrcrazs, 0,       phrcraze, phrcrazs, key_7,  ROT90, "Merit", "Phraze Craze (Sex Kit)",                      GAME_SUPPORTS_SAVE )
1329GAME( 1986, bigappg,  0,       bigappg,  bigappg,  0,      ROT0,  "Merit", "Big Apple Games ?",                           GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
1330GAME( 1986, dodge,    0,       bigappg,  bigappg,  0,      ROT0,  "Merit", "Dodge City",                                  GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
src/mame/drivers/igs_180.c
r3373r3374
669669// Dips are read through the 8255
670670static const ppi8255_interface ppi8255_intf =
671671{
672   input_port_0_r,   // Port A read
673   input_port_1_r,   // Port B read
674   input_port_2_r,   // Port C read
672   DEVICE8_PORT("DSW0"),         // Port A read
673   DEVICE8_PORT("DSW1"),         // Port B read
674   DEVICE8_PORT("DSW2"),         // Port C read
675675   0,            // Port A write
676676   0,            // Port B write
677677   0,            // Port C write
r3373r3374
691691   MDRV_CPU_IO_MAP(igs_180_portmap,0)
692692   MDRV_CPU_VBLANK_INT_HACK(igs_180_interrupt,2)
693693
694   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
695   MDRV_DEVICE_CONFIG( ppi8255_intf )
694   MDRV_PPI8255_ADD( "ppi8255", ppi8255_intf )
696695
697696   MDRV_MACHINE_RESET(igs_180)
698697
src/mame/drivers/astinvad.c
r3373r3374
6262 *
6363 *************************************/
6464
65static WRITE8_HANDLER( astinvad_sound1_w );
66static WRITE8_HANDLER( astinvad_sound2_w );
65static WRITE8_DEVICE_HANDLER( astinvad_sound1_w );
66static WRITE8_DEVICE_HANDLER( astinvad_sound2_w );
6767
6868static const ppi8255_interface ppi8255_intf[2] =
6969{
7070   {
71      input_port_0_r,
72      input_port_1_r,
73      input_port_2_r,
71      DEVICE8_PORT("IN0"),
72      DEVICE8_PORT("IN1"),
73      DEVICE8_PORT("IN2"),
7474      NULL,
7575      NULL,
7676      NULL
7777   },
7878   {
7979      NULL,
80      input_port_3_r,
80      DEVICE8_PORT("CABINET"),
8181      NULL,
8282      astinvad_sound1_w,
8383      astinvad_sound2_w,
r3373r3374
230230
231231   /* the address lines are used for /CS; yes, they can overlap! */
232232   if (!(offset & 4))
233      result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset);
233      result &= ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_0"), offset);
234234   if (!(offset & 8))
235      result &= ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset);
235      result &= ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_1"), offset);
236236   return result;
237237}
238238
r3373r3374
241241{
242242   /* the address lines are used for /CS; yes, they can overlap! */
243243   if (!(offset & 4))
244      ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset, data);
244      ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_0"), offset, data);
245245   if (!(offset & 8))
246      ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset, data);
246      ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_1"), offset, data);
247247}
248248
249249
r3373r3374
254254 *
255255 *************************************/
256256
257static WRITE8_HANDLER( astinvad_sound1_w )
257static WRITE8_DEVICE_HANDLER( astinvad_sound1_w )
258258{
259259   int bits_gone_hi = data & ~sound_state[0];
260260   sound_state[0] = data;
r3373r3374
270270}
271271
272272
273static WRITE8_HANDLER( astinvad_sound2_w )
273static WRITE8_DEVICE_HANDLER( astinvad_sound2_w )
274274{
275275   int bits_gone_hi = data & ~sound_state[1];
276276   sound_state[1] = data;
r3373r3374
281281   if (bits_gone_hi & 0x08) sample_start(5, SND_FLEET4, 0);
282282   if (bits_gone_hi & 0x10) sample_start(4, SND_UFOHIT, 0);
283283
284   screen_flip = (input_port_read(machine, "CABINET") & data & 0x20) ? 0xff : 0x00;
284   screen_flip = (input_port_read(device->machine, "CABINET") & data & 0x20) ? 0xff : 0x00;
285285}
286286
287287
r3373r3374
514514
515515   MDRV_MACHINE_START(kamikaze)
516516
517   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
518   MDRV_DEVICE_CONFIG( ppi8255_intf[0] )
517   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
518   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
519519
520   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
521   MDRV_DEVICE_CONFIG( ppi8255_intf[1] )
522
523520   /* video hardware */
524521   MDRV_VIDEO_UPDATE(astinvad)
525522
src/mame/drivers/esh.c
r3373r3374
4242{
4343   int charx, chary;
4444
45   render_container_set_palette_alpha(render_container_get_screen(screen), 0, 0x00);
46
4745   /* clear */
4846   fillbitmap(bitmap, 0, cliprect);
4947
r3373r3374
239237
240238      palette_set_color(machine,i,MAKE_RGB(r,g,b));
241239   }
240
241   /* make color 0 transparent */
242   palette_set_color(machine, 0, MAKE_ARGB(0,0,0,0));
242243}
243244
244245static const gfx_layout esh_gfx_layout =
src/mame/drivers/neodrvr.c
r3373r3374
2525INPUT_PORTS_END
2626
2727
28static INPUT_PORTS_START( ms5pcb )
29   STANDARD_IN0
30
31   STANDARD_IN1
32
33   STANDARD_IN2
34
35   STANDARD_IN3
36
37   STANDARD_IN4
38
39   /* the rom banking is tied directly to the dipswitch?, or is there a bank write somewhere? */
40   PORT_START("HARDDIP")
41   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Region ) ) PORT_DIPLOCATION("HARDDIP:3")
42   PORT_DIPSETTING(   0x00, DEF_STR( Asia ) )
43   PORT_DIPSETTING(   0x01, DEF_STR( Japan ) )
44INPUT_PORTS_END
45
46
2847static INPUT_PORTS_START( kog )
2948   STANDARD_IN0
3049
r3373r3374
323342/* note you'll have to modify the last for lines of each block to use the extra bios roms,
324343   they're hacks / homebrew / console bios roms so MAME doesn't list them by default */
325344
345/******************************************************************************
326346
347    The current Neo-Geo MVS system set (SFIX/SM1/000-LO) used is from a NEO-MVH MV1FS board.
348    Other boards (MV1xx / MV2x / MV4 /MV6) other system sets?
349
350    Zoom ROM (LO)    128K   TC531000CP      1x 128Kx8   Zoom look-up table ROM
351    Fix ROM (SFIX)   128K   27C1000         1x 128Kx8   Text layer graphics ROM
352    Sound ROM (SM1)  128K   27C1000/23C1000 1x 128Kx8   Z80 program ROM
353
354******************************************************************************/
355
327356#define NEO_BIOS_AUDIO_64K(name, hash)                                                          \
328357   NEOGEO_BIOS                                                                         \
329358                                                                                    \
330359   ROM_REGION( 0x20000, "audiobios", 0 )                                          \
331   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )      \
360   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) )      \
332361                                                                                    \
333362   ROM_REGION( 0x20000, "audio", 0 )                                       \
334363   ROM_LOAD( name,     0x00000, 0x10000, hash )                                                \
r3373r3374
339368   NEOGEO_BIOS                                                                         \
340369                                                                                    \
341370   ROM_REGION( 0x20000, "audiobios", 0 )                                          \
342   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )      \
371   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) )      \
343372                                                                                    \
344373   ROM_REGION( 0x30000, "audio", 0 )                                       \
345374   ROM_LOAD( name,     0x00000, 0x20000, hash )                                                \
r3373r3374
350379   NEOGEO_BIOS                                                                         \
351380                                                                                    \
352381   ROM_REGION( 0x20000, "audiobios", 0 )                                          \
353   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )      \
382   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) )      \
354383                                                                                    \
355384   ROM_REGION( 0x50000, "audio", 0 )                                       \
356385   ROM_LOAD( name,     0x00000, 0x40000, hash )                                                \
r3373r3374
361390   NEOGEO_BIOS                                                                         \
362391                                                                                    \
363392   ROM_REGION( 0x20000, "audiobios", 0 )                                          \
364   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )      \
393   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) )      \
365394                                                                                    \
366395   ROM_REGION( 0x90000, "audio", 0 )                                       \
367396   ROM_LOAD( name,     0x00000, 0x80000, hash )                                                \
r3373r3374
370399#define NEO_BIOS_AUDIO_ENCRYPTED_512K(name, hash) \
371400   NEOGEO_BIOS \
372401   ROM_REGION( 0x20000, "audiobios", 0 ) \
373   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) ) \
402   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) ) \
374403   ROM_REGION( 0x90000, "audio", ROMREGION_ERASEFF ) \
375404   ROM_REGION( 0x80000, "audiocrypt", 0 ) \
376405   ROM_LOAD( name,     0x00000, 0x80000, hash ) \
r3373r3374
378407#define NEO_BIOS_AUDIO_ENCRYPTED_256K(name, hash) \
379408   NEOGEO_BIOS \
380409   ROM_REGION( 0x20000, "audiobios", 0 ) \
381   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) ) \
410   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) ) \
382411   ROM_REGION( 0x90000, "audio", ROMREGION_ERASEFF ) \
383412   ROM_REGION( 0x80000, "audiocrypt", 0 ) \
384413   ROM_LOAD( name,     0x00000, 0x40000, hash ) \
r3373r3374
386415#define NEO_BIOS_AUDIO_ENCRYPTED_128K(name, hash) \
387416   NEOGEO_BIOS \
388417   ROM_REGION( 0x20000, "audiobios", 0 ) \
389   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) ) \
418   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) ) \
390419   ROM_REGION( 0x90000, "audio", ROMREGION_ERASEFF ) \
391420   ROM_REGION( 0x80000, "audiocrypt", 0 ) \
392421   ROM_LOAD( name,     0x00000, 0x20000, hash ) \
r3373r3374
400429   ROM_LOAD( name,       0x000000, 0x08000, hash )                                              \
401430                                                                                    \
402431   ROM_REGION( 0x20000, "fixedbios", 0 )                                        \
403   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )      \
432   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )      \
404433                                                                                    \
405434   ROM_Y_ZOOM
406435
r3373r3374
410439   ROM_LOAD( name,       0x000000, 0x10000, hash )                                              \
411440                                                                                    \
412441   ROM_REGION( 0x20000, "fixedbios", 0 )                                        \
413   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )      \
442   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )      \
414443                                                                                    \
415444   ROM_Y_ZOOM
416445
r3373r3374
420449   ROM_LOAD( name,       0x000000, 0x20000, hash )                                              \
421450                                                                                    \
422451   ROM_REGION( 0x20000, "fixedbios", 0 )                                        \
423   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )      \
452   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )      \
424453                                                                                    \
425454   ROM_Y_ZOOM
426455
427456
428457#define ROM_Y_ZOOM                                                                        \
429   ROM_REGION( 0x10000, "zoomy", 0 )                                          \
430   ROM_LOAD( "000-lo.lo", 0x00000, 0x10000, CRC(e09e253c) SHA1(2b1c719531dac9bb503f22644e6e4236b91e7cfc) )
458   ROM_REGION( 0x20000, "zoomy", 0 )                                          \
459   ROM_LOAD( "000-lo.lo", 0x00000, 0x20000, CRC(5a86cff2) SHA1(5992277debadeb64d1c1c64b0a92d9293eaf7e4a) )
431460
432461/***************************************************************************
433462
r3373r3374
452481    . SNK-9201
453482
454483    PROG:
455    . ALTERA
484    . 0103 (QFP144)
485    . ALTERA (EPM7128SQC100-15)
456486    . NEO-COMA
457487    . NEO-PCM2 (SNK 1999)
458488    . NEO-PCM2 (PLAYMORE 2002)
r3373r3374
497527    . NEO-MVS PROG 4096
498528    . NEO-MVS PROG 4096 B
499529    . NEO-MVS PROGGSC
500    . NEO-MVS PROGGS3
530    . NEO-MVS PROGSM
531    . NEO-MVS PROGSS3
501532    . NEO-MVS PROGTOP
502533    . NEO-MVS PROGSF1 (1998.6.17)
503534    . NEO-MVS PROGEOP (1999.2.2)
r3373r3374
555586    . NEO-AEG PROGBK2 (2002.4.1)
556587    -- SNKPLAYMORE --
557588    . NEO-AEG PROGBK3R (2003.8.29) - NEO-HYCS (2003.9.29)
589    . NEO-AEG PROGBK2S (2003.10.16)
558590
559591
560592    Cartridge colours:
r3373r3374
564596
565597    Known cartridge colours:
566598    . Black
599    . Blue
567600    . Green
568601    . Grey
602    . Red
569603    . Transparent
570604    . Transparent Blue
571605    . Transparent Green
r3373r3374
575609    The above listed only covers SNK / PLAYMORE / SNKPLAYMORE pcb's. There also exists a
576610    wide range of 'bootleg' pcb's.
577611
612
578613    Neo-Geo game pcb infos by Johnboy
579614
580615****************************************************************************/
r3373r3374
13161351   ROM_LOAD16_BYTE( "030-c4.bin", 0x200001, 0x100000, CRC(780d1c4e) SHA1(2e2cf9de828e3b48642dd2203637103438c62142) ) /* Plane 2,3 */
13171352ROM_END
13181353
1319ROM_START( 2020bba ) /* AES VERSION */
1354ROM_START( 2020bba ) /* MVS AND AES VERSION */
13201355   ROM_REGION( 0x100000, "main", 0 )
13211356   ROM_LOAD16_WORD_SWAP( "030-epr.p1", 0x000000, 0x080000, CRC(c59be3dd) SHA1(4fbd462c1c18e85a252c58b04b54fd3b82b46cb0) )
13221357   /* P1 on eprom, correct chip label unknown */
r3373r3374
24892524   ROM_REGION( 0x20000, "fixed", 0 )
24902525   ROM_FILL(                 0x000000, 0x20000, 0 )
24912526   ROM_REGION( 0x20000, "fixedbios", 0 )
2492   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
2527   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
24932528
24942529   NEO_BIOS_AUDIO_128K( "070-m1.bin", CRC(5a3b3191) SHA1(fa9a9930e18c64e598841fb344c4471d3d2c1964) )
24952530
r3373r3374
25582593
25592594   NEO_BIOS_AUDIO_128K( "075-m1.bin", CRC(bb828df1) SHA1(eab8e2868173bdaac7c7ed97305a9aa1033fd303) )
25602595
2561   ROM_REGION( 0x280000, "ym", 0 )
2596   ROM_REGION( 0x300000, "ym", 0 )
25622597   ROM_LOAD( "075-v1.bin", 0x000000, 0x200000, CRC(7577e949) SHA1(3ba9f11094dd0cf519f33a16016cfae0d2c6629c) )
2563   ROM_LOAD( "075-v2.bin", 0x200000, 0x080000, CRC(6d0a728e) SHA1(9d226b9af855d0ae1a91ace7c362fa51ced8b243) )
2598   ROM_LOAD( "075-v2.bin", 0x200000, 0x100000, CRC(021760cd) SHA1(8a24e38f1d4982c4dcd82718995571ac94cbb390) )
25642599
25652600   NO_DELTAT_REGION
25662601
r3373r3374
27652800
27662801ROM_START( kof95 )
27672802   ROM_REGION( 0x200000, "main", 0 )
2768   ROM_LOAD16_WORD_SWAP( "084-p1.bin", 0x100000, 0x100000, CRC(5e54cf95) SHA1(41abe2042fdbb1526e92a0789976a9b1ac5e60f0) )
2803   ROM_LOAD16_WORD_SWAP( "084-p1.bin",0x100000, 0x100000, CRC(2cba2716) SHA1(f6c2d0537c9c3e0938065c65b1797c47198fcff8) )
27692804   ROM_CONTINUE(                  0x000000, 0x100000 )
27702805
27712806   NEO_SFIX_128K( "084-s1.bin", CRC(de716f8a) SHA1(f7386454a943ed5caf625f67ee1d0197b1c6fa13) )
r3373r3374
27732808   NEO_BIOS_AUDIO_128K( "084-m1.bin", CRC(6f2d7429) SHA1(6f8462e4f07af82a5ca3197895d5dcbb67bdaa61) )
27742809
27752810   ROM_REGION( 0x900000, "ym", 0 )
2776   // ROM_LOAD( "084-v1.bin", 0x000000, 0x400000, CRC(21469561) SHA1(f35c72d31f026efc9e74bc4f198a123999ab3fc3) ) // bad old rom ?
2777    ROM_LOAD( "084-v1.bin", 0x000000, 0x400000, CRC(84861b56) SHA1(1b6c91ddaed01f45eb9b7e49d9c2b9b479d50da6) )
2811   ROM_LOAD( "084-v1.bin", 0x000000, 0x400000, CRC(84861b56) SHA1(1b6c91ddaed01f45eb9b7e49d9c2b9b479d50da6) )
27782812   ROM_LOAD( "084-v2.bin", 0x400000, 0x200000, CRC(b38a2803) SHA1(dbc2c8606ca09ed7ff20906b022da3cf053b2f09) )
27792813   /* 600000-7fffff empty */
27802814   ROM_LOAD( "084-v3.bin", 0x800000, 0x100000, CRC(d683a338) SHA1(eb9866b4b286edc09963cb96c43ce0a8fb09adbb) )
r3373r3374
27822816   NO_DELTAT_REGION
27832817
27842818   ROM_REGION( 0x1a00000, "sprites", ROMREGION_DISPOSE )
2785   /* old set had the roms like this */
2786#if 0
2787   ROM_LOAD16_BYTE( "084-c1.bin", 0x0400000, 0x200000, CRC(33bf8657) SHA1(79b0f0eb4e5c172f36c296ccabeb474804f7645a) ) /* Plane 0,1 */
2788   ROM_CONTINUE(                  0x0000000, 0x200000 )
2789   ROM_LOAD16_BYTE( "084-c2.bin", 0x0400001, 0x200000, CRC(f21908a4) SHA1(a0bec5961396e62af553ba5293b1007cdf9fbf62) ) /* Plane 2,3 */
2790   ROM_CONTINUE(                  0x0000001, 0x200000 )
2791   ROM_LOAD16_BYTE( "084-c3.bin", 0x0c00000, 0x200000, CRC(0cee1ddb) SHA1(f63c05020c5bee37c2598fd235d76157baea6c68) ) /* Plane 0,1 */
2792   ROM_CONTINUE(                  0x0800000, 0x200000 )
2793   ROM_LOAD16_BYTE( "084-c4.bin", 0x0c00001, 0x200000, CRC(729db15d) SHA1(6167a601463d7aaba1c8d470b346a82e9aef8bb5) ) /* Plane 2,3 */
2794   ROM_CONTINUE(                  0x0800001, 0x200000 )
2795#endif
2796    ROM_LOAD16_BYTE( "084-c1.bin", 0x0000000, 0x400000, CRC(fe087e32) SHA1(e8e89faa616027e4fb9b8a865c1a67f409c93bdf) ) /* Plane 0,1 */
2797    ROM_LOAD16_BYTE( "084-c2.bin", 0x0000001, 0x400000, CRC(07864e09) SHA1(0817fcfd75d0735fd8ff27561eaec371e4ff5829) ) /* Plane 2,3 */
2798    ROM_LOAD16_BYTE( "084-c3.bin", 0x0800000, 0x400000, CRC(a4e65d1b) SHA1(740a405b40b3a4b324697d2652cae29ffe0ac0bd) ) /* Plane 0,1 */
2799    ROM_LOAD16_BYTE( "084-c4.bin", 0x0800001, 0x400000, CRC(c1ace468) SHA1(74ea2a3cfd7b744f0988a05baaff10016ca8f625) ) /* Plane 2,3 */
2800
2819   ROM_LOAD16_BYTE( "084-c1.bin", 0x0000000, 0x400000, CRC(fe087e32) SHA1(e8e89faa616027e4fb9b8a865c1a67f409c93bdf) ) /* Plane 0,1 */
2820   ROM_LOAD16_BYTE( "084-c2.bin", 0x0000001, 0x400000, CRC(07864e09) SHA1(0817fcfd75d0735fd8ff27561eaec371e4ff5829) ) /* Plane 2,3 */
2821   ROM_LOAD16_BYTE( "084-c3.bin", 0x0800000, 0x400000, CRC(a4e65d1b) SHA1(740a405b40b3a4b324697d2652cae29ffe0ac0bd) ) /* Plane 0,1 */
2822   ROM_LOAD16_BYTE( "084-c4.bin", 0x0800001, 0x400000, CRC(c1ace468) SHA1(74ea2a3cfd7b744f0988a05baaff10016ca8f625) ) /* Plane 2,3 */
28012823   ROM_LOAD16_BYTE( "084-c5.bin", 0x1000000, 0x200000, CRC(8a2c1edc) SHA1(67866651bc0ce27122285a66b0aab108acf3d065) ) /* Plane 0,1 */
28022824   ROM_LOAD16_BYTE( "084-c6.bin", 0x1000001, 0x200000, CRC(f593ac35) SHA1(302c92c63f092a8d49429c3331e5e5678f0ea48d) ) /* Plane 2,3 */
28032825   /* 1400000-17fffff empty */
r3373r3374
28052827   ROM_LOAD16_BYTE( "084-c8.bin", 0x1800001, 0x100000, CRC(78eb0f9b) SHA1(2925ea21ed2ce167f08a25589e94f28643379034) ) /* Plane 2,3 */
28062828ROM_END
28072829
2808ROM_START( kof95a )
2830ROM_START( kof95h ) /* MVS AND AES VERSION */
2831   /* There also exists a MVS version with 4x eprom (EP1~EP4); board used is NEO-MVS PROGSM */
28092832   ROM_REGION( 0x200000, "main", 0 )
2810    ROM_LOAD16_WORD_SWAP( "084a-p1.bin",0x100000, 0x100000, CRC(2cba2716) SHA1(f6c2d0537c9c3e0938065c65b1797c47198fcff8) )
2833   ROM_LOAD16_WORD_SWAP( "084-pg1.bin", 0x100000, 0x100000, CRC(5e54cf95) SHA1(41abe2042fdbb1526e92a0789976a9b1ac5e60f0) )
28112834   ROM_CONTINUE(                  0x000000, 0x100000 )
28122835
28132836   NEO_SFIX_128K( "084-s1.bin", CRC(de716f8a) SHA1(f7386454a943ed5caf625f67ee1d0197b1c6fa13) )
r3373r3374
28152838   NEO_BIOS_AUDIO_128K( "084-m1.bin", CRC(6f2d7429) SHA1(6f8462e4f07af82a5ca3197895d5dcbb67bdaa61) )
28162839
28172840   ROM_REGION( 0x900000, "ym", 0 )
2818    ROM_LOAD( "084-v1.bin", 0x000000, 0x400000, CRC(84861b56) SHA1(1b6c91ddaed01f45eb9b7e49d9c2b9b479d50da6) )
2841   ROM_LOAD( "084-v1.bin", 0x000000, 0x400000, CRC(84861b56) SHA1(1b6c91ddaed01f45eb9b7e49d9c2b9b479d50da6) )
28192842   ROM_LOAD( "084-v2.bin", 0x400000, 0x200000, CRC(b38a2803) SHA1(dbc2c8606ca09ed7ff20906b022da3cf053b2f09) )
28202843   /* 600000-7fffff empty */
28212844   ROM_LOAD( "084-v3.bin", 0x800000, 0x100000, CRC(d683a338) SHA1(eb9866b4b286edc09963cb96c43ce0a8fb09adbb) )
r3373r3374
28232846   NO_DELTAT_REGION
28242847
28252848   ROM_REGION( 0x1a00000, "sprites", ROMREGION_DISPOSE )
2826    ROM_LOAD16_BYTE( "084-c1.bin", 0x0000000, 0x400000, CRC(fe087e32) SHA1(e8e89faa616027e4fb9b8a865c1a67f409c93bdf) ) /* Plane 0,1 */
2827    ROM_LOAD16_BYTE( "084-c2.bin", 0x0000001, 0x400000, CRC(07864e09) SHA1(0817fcfd75d0735fd8ff27561eaec371e4ff5829) ) /* Plane 2,3 */
2828    ROM_LOAD16_BYTE( "084-c3.bin", 0x0800000, 0x400000, CRC(a4e65d1b) SHA1(740a405b40b3a4b324697d2652cae29ffe0ac0bd) ) /* Plane 0,1 */
2829    ROM_LOAD16_BYTE( "084-c4.bin", 0x0800001, 0x400000, CRC(c1ace468) SHA1(74ea2a3cfd7b744f0988a05baaff10016ca8f625) ) /* Plane 2,3 */
2849   ROM_LOAD16_BYTE( "084-c1.bin", 0x0000000, 0x400000, CRC(fe087e32) SHA1(e8e89faa616027e4fb9b8a865c1a67f409c93bdf) ) /* Plane 0,1 */
2850   ROM_LOAD16_BYTE( "084-c2.bin", 0x0000001, 0x400000, CRC(07864e09) SHA1(0817fcfd75d0735fd8ff27561eaec371e4ff5829) ) /* Plane 2,3 */
2851   ROM_LOAD16_BYTE( "084-c3.bin", 0x0800000, 0x400000, CRC(a4e65d1b) SHA1(740a405b40b3a4b324697d2652cae29ffe0ac0bd) ) /* Plane 0,1 */
2852   ROM_LOAD16_BYTE( "084-c4.bin", 0x0800001, 0x400000, CRC(c1ace468) SHA1(74ea2a3cfd7b744f0988a05baaff10016ca8f625) ) /* Plane 2,3 */
28302853   ROM_LOAD16_BYTE( "084-c5.bin", 0x1000000, 0x200000, CRC(8a2c1edc) SHA1(67866651bc0ce27122285a66b0aab108acf3d065) ) /* Plane 0,1 */
28312854   ROM_LOAD16_BYTE( "084-c6.bin", 0x1000001, 0x200000, CRC(f593ac35) SHA1(302c92c63f092a8d49429c3331e5e5678f0ea48d) ) /* Plane 2,3 */
28322855   /* 1400000-17fffff empty */
r3373r3374
28552878   ROM_LOAD16_BYTE( "086-c4.bin", 0x800001, 0x100000, CRC(7a6e7d82) SHA1(b1bb82cec3d68367d5e01e63c44c11b67e577411) ) /* Plane 2,3 */
28562879ROM_END
28572880
2858ROM_START( samsho3 )
2881ROM_START( samsho3 ) /* MVS VERSION */
28592882   ROM_REGION( 0x300000, "main", 0 )
2860   ROM_LOAD16_WORD_SWAP( "087-p1.bin", 0x000000, 0x100000, CRC(282a336e) SHA1(e062f1939d36a45f185b5dbd726cdd833dc7c28c) )
2861   ROM_LOAD16_WORD_SWAP( "087-p2.bin", 0x100000, 0x200000, CRC(9bbe27e0) SHA1(b18117102159903c8e8f4e4226e1cc91a400e816) )
2883   ROM_LOAD16_WORD_SWAP( "087-ep1.bin", 0x000000, 0x080000, CRC(23e09bb8) SHA1(79da99fa50a639fce9d1266699b5e53c9ac55642) )
2884   ROM_LOAD16_WORD_SWAP( "087-ep2.bin", 0x080000, 0x080000, CRC(256f5302) SHA1(e2d21b413a6059194a994b7902b2a7df98a15151) )
2885   ROM_LOAD16_WORD_SWAP( "087-ep3.bin", 0x100000, 0x080000, CRC(bf2db5dd) SHA1(b4fa1dc1eccc9eb1ce74f0a06992ef89b1cbc732) )
2886   ROM_LOAD16_WORD_SWAP( "087-ep4.bin", 0x180000, 0x080000, CRC(53e60c58) SHA1(f975e81cab6322d3260348402721c673023259fa) )
2887   ROM_LOAD16_WORD_SWAP( "087-p5.bin",  0x200000, 0x100000, CRC(e86ca4af) SHA1(5246acbab77ac2f232b88b8522187764ff0872f0) )
28622888
28632889   NEO_SFIX_128K( "087-s1.bin", CRC(74ec7d9f) SHA1(d79c479838a7ca51735a44f91f1968ec5b3c6b91) )
28642890
r3373r3374
28812907   ROM_LOAD16_BYTE( "087-c8.bin", 0x1800001, 0x100000, CRC(a9e82717) SHA1(e39ee15d5140dbe7f06eea945cce9984a5e8b06a) ) /* Plane 2,3 */
28822908ROM_END
28832909
2884ROM_START( samsho3a ) /* MVS VERSION */
2910ROM_START( samsho3h ) /* AES VERSION */
28852911   ROM_REGION( 0x300000, "main", 0 )
2886   ROM_LOAD16_WORD_SWAP( "087-ep1.bin", 0x000000, 0x080000, CRC(23e09bb8) SHA1(79da99fa50a639fce9d1266699b5e53c9ac55642) )
2887   ROM_LOAD16_WORD_SWAP( "087-ep2.bin", 0x080000, 0x080000, CRC(256f5302) SHA1(e2d21b413a6059194a994b7902b2a7df98a15151) )
2888   ROM_LOAD16_WORD_SWAP( "087-ep3.bin", 0x100000, 0x080000, CRC(bf2db5dd) SHA1(b4fa1dc1eccc9eb1ce74f0a06992ef89b1cbc732) )
2889   ROM_LOAD16_WORD_SWAP( "087-ep4.bin", 0x180000, 0x080000, CRC(53e60c58) SHA1(f975e81cab6322d3260348402721c673023259fa) )
2890   ROM_LOAD16_WORD_SWAP( "087-p5.bin",  0x200000, 0x100000, CRC(e86ca4af) SHA1(5246acbab77ac2f232b88b8522187764ff0872f0) )
2912   ROM_LOAD16_WORD_SWAP( "087-pg1.bin", 0x000000, 0x100000, CRC(282a336e) SHA1(e062f1939d36a45f185b5dbd726cdd833dc7c28c) )
2913   ROM_LOAD16_WORD_SWAP( "087-p2.bin",  0x100000, 0x200000, CRC(9bbe27e0) SHA1(b18117102159903c8e8f4e4226e1cc91a400e816) )
28912914
28922915   NEO_SFIX_128K( "087-s1.bin", CRC(74ec7d9f) SHA1(d79c479838a7ca51735a44f91f1968ec5b3c6b91) )
28932916
r3373r3374
38333856   ROM_LOAD16_BYTE( "231-c4.bin", 0x400001, 0x080000, CRC(1694f171) SHA1(a6af5d3f1e0b3f73da275e04d4434c6c9c7b9208) ) /* Plane 2,3 */
38343857ROM_END
38353858
3836ROM_START( kof97 )
3859ROM_START( kof97 ) /* MVS VERSION */
38373860   ROM_REGION( 0x500000, "main", 0 )
38383861   ROM_LOAD16_WORD_SWAP( "232-p1.bin", 0x000000, 0x100000, CRC(7db81ad9) SHA1(8bc42be872fd497eb198ca13bf004852b88eb1dc) )
38393862   ROM_LOAD16_WORD_SWAP( "232-p2.bin", 0x100000, 0x400000, CRC(158b23f6) SHA1(9744620a70513490aaf9c5eda33e5ec31222be19) )
r3373r3374
40364059   ROM_LOAD16_WORD_SWAP("236-bios.bin", 0x00000, 0x020000, CRC(853e6b96) SHA1(de369cb4a7df147b55168fa7aaf0b98c753b735e) )
40374060
40384061   ROM_REGION( 0x20000, "audiobios", 0 )
4039   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )
4062   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) )
40404063
40414064   ROM_REGION( 0x50000, "audio", 0 )
40424065   ROM_LOAD( "236-m1.bin", 0x00000, 0x20000, CRC(880a1abd) SHA1(905afa157aba700e798243b842792e50729b19a0) )  /* so overwrite it with the real thing */
r3373r3374
41544177   ROM_LOAD16_WORD_SWAP( "240-p1.bin", 0x000000, 0x100000, CRC(80e41205) SHA1(8f83eb8ff54be4ec40f8a0dd2cbe56c54908d00a) )
41554178   ROM_LOAD16_WORD_SWAP( "240-p2.bin", 0x100000, 0x400000, CRC(960aa88d) SHA1(3d9e785891871af90313f178dca2724633406674) )
41564179
4157   NEO_SFIX_128K( "240-s1.bin", CRC(da3b40de) SHA1(e6bf74e057ac6fe1f249a7547f13ba7fbc694561) )
4180   NEO_SFIX_128K( "240-s1.bin", CRC(da3b40de) SHA1(e6bf74e057ac6fe1f249a7547f13ba7fbc694561) )
41584181
4182   /* TC532000DP */
41594183   NEO_BIOS_AUDIO_256K( "240-m1.bin", CRC(ed482791) SHA1(1f54a45967cb7842c33aa24be322c9f33ff75ac3) )
41604184
41614185   ROM_REGION( 0x0e00000, "ym", 0 )
r3373r3374
41794203ROM_START( rbff2h ) /* AES VERSION */
41804204   ROM_REGION( 0x500000, "main", 0 )
41814205   ROM_LOAD16_WORD_SWAP( "240-pg1.bin", 0x000000, 0x100000, CRC(b6969780) SHA1(e3373d18e0f0724d69efb8024a27cca121f1b5b2) )
4182   ROM_LOAD16_WORD_SWAP( "240-p2.bin", 0x100000, 0x400000, CRC(960aa88d) SHA1(3d9e785891871af90313f178dca2724633406674) )
4206   ROM_LOAD16_WORD_SWAP( "240-p2.bin", 0x100000, 0x400000, CRC(960aa88d) SHA1(3d9e785891871af90313f178dca2724633406674) )
41834207
4184   NEO_SFIX_128K( "240-s1.bin", CRC(da3b40de) SHA1(e6bf74e057ac6fe1f249a7547f13ba7fbc694561) )
4208   NEO_SFIX_128K( "240-s1.bin", CRC(da3b40de) SHA1(e6bf74e057ac6fe1f249a7547f13ba7fbc694561) )
41854209
4210   /* TC532000DP */
41864211   NEO_BIOS_AUDIO_256K( "240-m1.bin", CRC(ed482791) SHA1(1f54a45967cb7842c33aa24be322c9f33ff75ac3) )
41874212
41884213   ROM_REGION( 0x0e00000, "ym", 0 )
r3373r3374
42034228   ROM_LOAD16_BYTE( "240-c6.bin", 0x2000001, 0x800000, CRC(4609e507) SHA1(bb17f50a377dddb77c1eeda5944a7bcbf0cca5f7) ) /* Plane 2,3 */
42044229ROM_END
42054230
4206ROM_START( rbff2k )
4231ROM_START( rbff2k ) /* KOREAN VERSION */
42074232   ROM_REGION( 0x500000, "main", 0 )
42084233   ROM_LOAD16_WORD_SWAP( "140-p1k.bin", 0x000000, 0x100000, CRC(965edee1) SHA1(7f4b947b19ccfee32fc73e4fd89645eb313b5c77) )
4209   ROM_LOAD16_WORD_SWAP( "240-p2.bin", 0x100000, 0x400000, CRC(960aa88d) SHA1(3d9e785891871af90313f178dca2724633406674) )
4234   ROM_LOAD16_WORD_SWAP( "240-p2.bin", 0x100000, 0x400000, CRC(960aa88d) SHA1(3d9e785891871af90313f178dca2724633406674) )
42104235
4211   NEO_SFIX_128K( "240-s1.bin", CRC(da3b40de) SHA1(e6bf74e057ac6fe1f249a7547f13ba7fbc694561) )
4236   NEO_SFIX_128K( "240-s1.bin", CRC(da3b40de) SHA1(e6bf74e057ac6fe1f249a7547f13ba7fbc694561) )
42124237
4238   /* TC532000DP */
42134239   NEO_BIOS_AUDIO_256K( "240-m1.bin", CRC(ed482791) SHA1(1f54a45967cb7842c33aa24be322c9f33ff75ac3) )
42144240
42154241   ROM_REGION( 0x0e00000, "ym", 0 )
r3373r3374
42594285
42604286   NEO_SFIX_128K( "242-s1.bin", CRC(7f7b4805) SHA1(80ee6e5d0ece9c34ebca54b043a7cb33f9ff6b92) )
42614287
4262   NEO_BIOS_AUDIO_256K( "242-m1a.bin", CRC(4ef7016b) SHA1(4182235e963bd70d398a79abeb54ab4d62887c48) )
4288   /* TC532000DP */
4289   NEO_BIOS_AUDIO_256K( "242-m1.bin", CRC(4ef7016b) SHA1(4182235e963bd70d398a79abeb54ab4d62887c48) )
42634290
42644291   ROM_REGION( 0x1000000, "ym", 0 )
42654292   ROM_LOAD( "242-v1.bin", 0x000000, 0x400000, CRC(b9ea8051) SHA1(49606f64eb249263b3341b4f50cc1763c390b2af) )
r3373r3374
42874314
42884315   NEO_SFIX_128K( "242-s1.bin", CRC(7f7b4805) SHA1(80ee6e5d0ece9c34ebca54b043a7cb33f9ff6b92) )
42894316
4317   /* Correct chip label */
42904318   NEO_BIOS_AUDIO_256K( "242-m1k.bin", CRC(ce12da0c) SHA1(e7c01dae2852d543d1a58d55735239f6a5aa05a5) )
42914319
42924320   ROM_REGION( 0x1000000, "ym", 0 )
r3373r3374
43114339ROM_START( kof98n )
43124340   ROM_REGION( 0x500000, "main", 0 )
43134341   ROM_LOAD16_WORD_SWAP( "242-pn1.bin", 0x000000, 0x100000, CRC(61ac868a) SHA1(26577264aa72d6af272952a876fcd3775f53e3fa) )
4314   ROM_LOAD16_WORD_SWAP( "242-p2.bin", 0x100000, 0x400000, CRC(980aba4c) SHA1(5e735929ec6c3ca5b2efae3c7de47bcbb8ade2c5) )
4342   ROM_LOAD16_WORD_SWAP( "242-p2.bin", 0x100000, 0x400000, CRC(980aba4c) SHA1(5e735929ec6c3ca5b2efae3c7de47bcbb8ade2c5) )
43154343
43164344   NEO_SFIX_128K( "242-s1.bin", CRC(7f7b4805) SHA1(80ee6e5d0ece9c34ebca54b043a7cb33f9ff6b92) )
43174345
4318   NEO_BIOS_AUDIO_256K( "242-m1.bin", CRC(4e7a6b1b) SHA1(b54d08f88713ed0271aa06f9f7c9c572ef555b1a) )
4346   /* TC532000DP */
4347   NEO_BIOS_AUDIO_256K( "242-mg1.bin", CRC(4e7a6b1b) SHA1(b54d08f88713ed0271aa06f9f7c9c572ef555b1a) )
43194348
43204349   ROM_REGION( 0x1000000, "ym", 0 )
43214350   ROM_LOAD( "242-v1.bin", 0x000000, 0x400000, CRC(b9ea8051) SHA1(49606f64eb249263b3341b4f50cc1763c390b2af) )
r3373r3374
45534582   ROM_REGION( 0x20000, "fixed", 0 )
45544583   ROM_FILL(                 0x000000, 0x20000, 0 )
45554584   ROM_REGION( 0x20000, "fixedbios", 0 )
4556   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
4585   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
45574586
45584587   NEO_BIOS_AUDIO_128K( "251-m1.bin", CRC(5e74539c) SHA1(6f49a9343cbd026b2c6720ff3fa2e5b1f85e80da) )
45594588
r3373r3374
45894618   ROM_REGION( 0x20000, "fixed", 0 )
45904619   ROM_FILL(                 0x000000, 0x20000, 0 )
45914620   ROM_REGION( 0x20000, "fixedbios", 0 )
4592   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
4621   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
45934622
45944623   NEO_BIOS_AUDIO_128K( "251-m1.bin", CRC(5e74539c) SHA1(6f49a9343cbd026b2c6720ff3fa2e5b1f85e80da) )
45954624
r3373r3374
46274656   ROM_REGION( 0x20000, "fixed", 0 )
46284657   ROM_FILL(                 0x000000, 0x20000, 0 )
46294658   ROM_REGION( 0x20000, "fixedbios", 0 )
4630   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
4659   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
46314660
46324661   NEO_BIOS_AUDIO_128K( "251-m1.bin", CRC(5e74539c) SHA1(6f49a9343cbd026b2c6720ff3fa2e5b1f85e80da) )
46334662
r3373r3374
46634692   ROM_REGION( 0x20000, "fixed", 0 )
46644693   ROM_FILL(                 0x000000, 0x20000, 0 )
46654694   ROM_REGION( 0x20000, "fixedbios", 0 )
4666   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
4695   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
46674696
46684697   NEO_BIOS_AUDIO_128K( "251-m1.bin", CRC(5e74539c) SHA1(6f49a9343cbd026b2c6720ff3fa2e5b1f85e80da) )
46694698
r3373r3374
47294758   ROM_REGION( 0x20000, "fixed", 0 )
47304759   ROM_FILL(                 0x000000, 0x20000, 0 )
47314760   ROM_REGION( 0x20000, "fixedbios", 0 )
4732   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
4761   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
47334762
47344763   NEO_BIOS_AUDIO_128K( "252-m1.bin", CRC(30cc4099) SHA1(46453b7aac41855a92724a785372f8daf931d8d4) )
47354764
r3373r3374
47584787   ROM_REGION( 0x80000, "fixed", 0 )   /* larger char set */
47594788   ROM_FILL(                 0x000000, 0x20000, 0 )
47604789   ROM_REGION( 0x20000, "fixedbios", 0 )
4761   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
4790   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
47624791
47634792   NEO_BIOS_AUDIO_256K( "253-m1.bin", CRC(36a806be) SHA1(90fb44dc0c3fb57946a0f35716056abb84a0f191) )
47644793
r3373r3374
47944823   ROM_REGION( 0x80000, "fixed", 0 )   /* larger char set */
47954824   ROM_FILL(                 0x000000, 0x20000, 0 )
47964825   ROM_REGION( 0x20000, "fixedbios", 0 )
4797   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
4826   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
47984827
47994828   NEO_BIOS_AUDIO_256K( "253-m1.bin", CRC(36a806be) SHA1(90fb44dc0c3fb57946a0f35716056abb84a0f191) )
48004829
r3373r3374
48824911   ROM_REGION( 0x20000, "fixed", 0 )
48834912   ROM_FILL(                 0x000000, 0x20000, 0 )
48844913   ROM_REGION( 0x20000, "fixedbios", 0 )
4885   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
4914   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
48864915
48874916   NEO_BIOS_AUDIO_128K( "254-m1.bin", CRC(994b4487) SHA1(a4e645a3ababa48a8325980ff022e04a8b51b017) )
48884917
r3373r3374
49164945   ROM_REGION( 0x20000, "fixed", 0 )
49174946   ROM_FILL(                 0x000000, 0x20000, 0 )
49184947   ROM_REGION( 0x20000, "fixedbios", 0 )
4919   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
4948   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
49204949
49214950   NEO_BIOS_AUDIO_128K( "255-m1.bin", CRC(8efd4014) SHA1(5b73809b6e4e49264d281ef3e5004ac8a9de296d) )
49224951
r3373r3374
49484977   ROM_REGION( 0x80000, "fixed", 0 ) /* larger char set */
49494978   ROM_FILL(                 0x000000, 0x20000, 0 )
49504979   ROM_REGION( 0x20000, "fixedbios", 0 )
4951   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
4980   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
49524981
49534982   NEO_BIOS_AUDIO_512K( "256-m1.bin", CRC(eaeec116) SHA1(54419dbb21edc8c4b37eaac2e7ad9496d2de037a) )
49544983
r3373r3374
49835012   ROM_REGION( 0x80000, "fixed", 0 ) /* larger char set */
49845013   ROM_FILL(                 0x000000, 0x20000, 0 )
49855014   ROM_REGION( 0x20000, "fixedbios", 0 )
4986   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5015   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
49875016
49885017   NEO_BIOS_AUDIO_512K( "256-m1.bin", CRC(eaeec116) SHA1(54419dbb21edc8c4b37eaac2e7ad9496d2de037a) )
49895018
r3373r3374
50205049   ROM_REGION( 0x80000, "fixed", 0 )   /* larger char set */
50215050   ROM_FILL(                 0x000000, 0x20000, 0 )
50225051   ROM_REGION( 0x20000, "fixedbios", 0 )
5023   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5052   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
50245053
50255054   /* Encrypted */
50265055   NEO_BIOS_AUDIO_ENCRYPTED_256K( "257-m1.bin", CRC(4b749113) SHA1(2af2361146edd0ce3966614d90165a5c1afb8de4) )
r3373r3374
50555084   ROM_REGION( 0x80000, "fixed", 0 )   /* larger char set */
50565085   ROM_FILL(                 0x000000, 0x20000, 0 )
50575086   ROM_REGION( 0x20000, "fixedbios", 0 )
5058   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5087   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
50595088
50605089   /* Encrypted */
50615090   NEO_BIOS_AUDIO_ENCRYPTED_256K( "257-m1.bin", CRC(4b749113) SHA1(2af2361146edd0ce3966614d90165a5c1afb8de4) )
r3373r3374
50905119   ROM_REGION( 0x20000, "fixed", 0 )
50915120   ROM_FILL(                 0x000000, 0x20000, 0 )
50925121   ROM_REGION( 0x20000, "fixedbios", 0 )
5093   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5122   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
50945123
50955124   NEO_BIOS_AUDIO_128K( "259-m1.bin", CRC(85668ee9) SHA1(7d3f51710cf90c097cd3faaeeef10ceb85cbb3e8) )
50965125
r3373r3374
51435172   ROM_REGION( 0x20000, "fixed", 0 )
51445173   ROM_FILL(                 0x000000, 0x20000, 0 )
51455174   ROM_REGION( 0x20000, "fixedbios", 0 )
5146   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5175   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
51475176
51485177   NEO_BIOS_AUDIO_512K( "260-m1.bin", CRC(6407c5e5) SHA1(d273e154cc905b63205a17a1a6d419cac3485a92) )
51495178
r3373r3374
51925221   ROM_REGION( 0x20000, "fixed", 0 )
51935222   ROM_FILL(                 0x000000, 0x20000, 0 )
51945223   ROM_REGION( 0x20000, "fixedbios", 0 )
5195   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5224   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
51965225
51975226   NEO_BIOS_AUDIO_128K( "261-m1.bin", CRC(36ed9cdd) SHA1(78a7d755e9e9f52255ac6228d9d402fd6a02c126) )
51985227
r3373r3374
52225251   ROM_REGION( 0x20000, "fixed", 0 )
52235252   ROM_FILL(                 0x000000, 0x20000, 0 )
52245253   ROM_REGION( 0x20000, "fixedbios", 0 )
5225   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5254   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
52265255
52275256   /* Encrypted */
52285257   NEO_BIOS_AUDIO_ENCRYPTED_256K( "265-262-m1.bin", CRC(a7f8119f) SHA1(71805b39b8b09c32425cf39f9de59b2f755976c2) ) /* yes it really does have a strange name */
r3373r3374
52585287   ROM_REGION( 0x20000, "fixed", 0 )
52595288   ROM_FILL(                 0x000000, 0x20000, 0 )
52605289   ROM_REGION( 0x20000, "fixedbios", 0 )
5261   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5290   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
52625291
52635292   /* Encrypted */
52645293   NEO_BIOS_AUDIO_ENCRYPTED_256K( "265-262-m1.bin", CRC(a7f8119f) SHA1(71805b39b8b09c32425cf39f9de59b2f755976c2) ) /* yes it really does have a strange name */
r3373r3374
52945323   ROM_REGION( 0x80000, "fixed", 0 )   /* larger char set */
52955324   ROM_FILL(                 0x000000, 0x20000, 0 )
52965325   ROM_REGION( 0x20000, "fixedbios", 0 )
5297   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5326   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
52985327
52995328   /* Encrypted */
53005329   NEO_BIOS_AUDIO_ENCRYPTED_128K( "263-m1.bin", CRC(46ac8228) SHA1(5aeea221050c98e4bb0f16489ce772bf1c80f787) )
r3373r3374
53535382   ROM_REGION( 0x20000, "fixed", 0 )
53545383   ROM_FILL( 0x000000, 0x20000, 0 )
53555384   ROM_REGION( 0x20000, "fixedbios", 0 )
5356   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5385   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
53575386
53585387   /* Encrypted */
53595388   NEO_BIOS_AUDIO_ENCRYPTED_128K( "264-m1.bin", CRC(4dbd7b43) SHA1(6b63756b0d2d30bbf13fbd219833c81fd060ef96) )
r3373r3374
53885417   ROM_REGION( 0x20000, "fixed", 0 )
53895418   ROM_FILL( 0x000000, 0x20000, 0 )
53905419   ROM_REGION( 0x20000, "fixedbios", 0 )
5391   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5420   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
53925421
53935422   /* Encrypted */
53945423   NEO_BIOS_AUDIO_ENCRYPTED_128K( "265-m1.bin", CRC(85aaa632) SHA1(744fba4ca3bc3a5873838af886efb97a8a316104) )
r3373r3374
55355564   ROM_REGION( 0x80000, "fixed", 0 )
55365565   ROM_FILL( 0x000000, 0x80000, 0 )
55375566   ROM_REGION( 0x20000, "fixedbios", 0 )
5538   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5567   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
55395568
55405569   /* Encrypted */
55415570   NEO_BIOS_AUDIO_ENCRYPTED_128K( "266-m1.bin", CRC(456c3e6c) SHA1(5a07d0186198a18d2dda1331093cf29b0b9b2984) )
r3373r3374
55695598   ROM_REGION( 0x20000, "fixed", 0 )
55705599   ROM_FILL( 0x000000, 0x20000, 0 )
55715600   ROM_REGION( 0x20000, "fixedbios", 0 )
5572   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5601   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
55735602
55745603   /* Encrypted */
55755604   NEO_BIOS_AUDIO_ENCRYPTED_512K( "267-m1.bin", CRC(c7853ccd) SHA1(1b7a4c5093cf0fe3861ce44fd1d3b30c71ad0abe) )
r3373r3374
55975626   ROM_REGION( 0x20000, "fixed", 0 )
55985627   ROM_FILL( 0x000000, 0x20000, 0 )
55995628   ROM_REGION( 0x20000, "fixedbios", 0 )
5600   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5629   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
56015630
56025631   /* Encrypted */
56035632   NEO_BIOS_AUDIO_ENCRYPTED_512K( "268-m1.bin", CRC(4a5a6e0e) SHA1(df0f660f2465e1db7be5adfcaf5e88ad61a74a42) )
r3373r3374
56325661   ROM_REGION( 0x20000, "fixed", 0 )
56335662   ROM_FILL( 0x000000, 0x20000, 0 )
56345663   ROM_REGION( 0x20000, "fixedbios", 0 )
5635   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5664   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
56365665
56375666   /* Encrypted */
56385667   NEO_BIOS_AUDIO_ENCRYPTED_512K( "268-m1h.bin", CRC(4a5a6e0e) SHA1(df0f660f2465e1db7be5adfcaf5e88ad61a74a42) ) /* Same as MVS above, but different label */
r3373r3374
56565685   ROM_LOAD16_BYTE( "268-c8c.bin", 0x3000001, 0x800000, CRC(551d720e) SHA1(ebf69e334fcaba0fda6fd432fd0970283a365d12) ) /* Plane 2,3 */
56575686ROM_END
56585687
5659/* program roms are the same on the PCB version, GFX roms etc. are different arrangement */
5660ROM_START( ms5pcb ) /* Encrypted Set */
5661   ROM_REGION( 0x800000, "main", 0 )
5662   ROM_LOAD32_WORD_SWAP( "268-p1.bin", 0x000000, 0x400000, CRC(d0466792) SHA1(880819933d997fab398f91061e9dbccb959ae8a1) )
5663   ROM_LOAD32_WORD_SWAP( "268-p2.bin", 0x000002, 0x400000, CRC(fbf6b61e) SHA1(9ec743d5988b5e3183f37f8edf45c72a8c0c893e) )
5664
5665   /* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
5666   ROM_REGION( 0x20000, "fixed", 0 )
5667   ROM_FILL( 0x000000, 0x20000, 0 )
5668   ROM_REGION( 0x20000, "fixedbios", 0 )
5669   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5670
5671   ROM_REGION16_BE( 0x80000, "mainbios", 0 )
5672   /* this contains both an ASIA and JAPAN bios, HARDDIP3 on the PCB selects which to use */
5673   ROM_LOAD16_WORD_SWAP( "268-bios.bin", 0x00000, 0x80000, CRC(b4590283) SHA1(47047ed5b6062babc0a0bebcc30e4b3f021e115a) )
5674
5675
5676   /* Encrypted */
5677   ROM_REGION( 0x80000, "audiocrypt", 0 )
5678   ROM_LOAD( "268-m1.bin", 0x00000, 0x80000, CRC(4a5a6e0e) SHA1(df0f660f2465e1db7be5adfcaf5e88ad61a74a42) )
5679   ROM_REGION( 0x90000, "audio", ROMREGION_ERASEFF )
5680
5681
5682   /* Encrypted */
5683
5684   ROM_Y_ZOOM
5685
5686   ROM_REGION( 0x1000000, "ym", 0 )
5687   /* Encrypted */
5688   ROM_LOAD( "268-v1.bin", 0x000000, 0x1000000, CRC(8458afe5) SHA1(62b4c6e7db763e9ff2697bbcdb43dc5a56b48c68) )
5689
5690   NO_DELTAT_REGION
5691
5692   ROM_REGION( 0x4000000, "sprites", ROMREGION_DISPOSE )
5693   /* Encrypted */
5694   ROM_LOAD32_WORD( "268-c1.bin", 0x0000000, 0x1000000, CRC(802042e8) SHA1(ff028b65f60f0b51b255a380cc47ec19fdc0c0cf) ) /* Plane 0,1 */
5695   ROM_LOAD32_WORD( "268-c2.bin", 0x0000002, 0x1000000, CRC(3b89fb9f) SHA1(cbc0729aae961f683b105ec3e1cda58b3f985abc) ) /* Plane 2,3 */
5696   ROM_LOAD32_WORD( "268-c3.bin", 0x2000000, 0x1000000, CRC(0f3f59e3) SHA1(8cc751dc7d4e94864a9ce3346f23b8f011082fcc) ) /* Plane 0,1 */
5697   ROM_LOAD32_WORD( "268-c4.bin", 0x2000002, 0x1000000, CRC(3ad8435a) SHA1(b333c8993c9b4c4ea59450ad0a3560e0b28056bc) ) /* Plane 2,3 */
5698ROM_END
5699
57005688ROM_START( ms5plus )
57015689   ROM_REGION( 0x500000, "main", 0 )
57025690   ROM_LOAD16_WORD_SWAP( "268-p1p.bin", 0x000000, 0x100000, CRC(106b276f) SHA1(0e840df95f3813145e5043573483c7610d2d3e68) )
r3373r3374
57085696   ROM_REGION( 0x20000, "fixed", 0 )
57095697   ROM_LOAD("268-s1p.bin", 0x000000, 0x20000, CRC(21e04432) SHA1(10057a2aa487087f7143d1d69fdad978a6bef0f7) )
57105698   ROM_REGION( 0x20000, "fixedbios", 0 )
5711   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5699   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
57125700
57135701   /* Correct to use Decrypted Rom? */
57145702   NEO_BIOS_AUDIO_64K( "268-m1_bootleg.bin",  CRC(3c0655a7) SHA1(ae839d4c2b87a7aa3dd8e5caddc43eb75ee9b732) ) /* not a 100% match for encrypted version */
r3373r3374
57325720   ROM_LOAD16_BYTE( "268-c8c.bin", 0x3000001, 0x800000, CRC(551d720e) SHA1(ebf69e334fcaba0fda6fd432fd0970283a365d12) ) /* Plane 2,3 */
57335721ROM_END
57345722
5735ROM_START( svcpcb ) /* Encrypted Set, JAMMA PCB */
5736   ROM_REGION( 0x2000000, "main", 0 )
5737   ROM_LOAD16_WORD_SWAP( "269-p1.bin", 0x000000, 0x2000000, CRC(432cfdfc) SHA1(19b40d32188a8bace6d2d570c6cf3d2f1e31e379) )
5738
5739   ROM_REGION( 0x80000, "fixed", 0 ) /* larger char set */
5740   ROM_FILL( 0x000000, 0x80000, 0 )
5741   ROM_REGION( 0x20000, "fixedbios", 0 )
5742   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5743
5744   ROM_REGION16_BE( 0x80000, "mainbios", 0 )
5745   /* this contains both an ASIA and JAPAN bios, HARDDIP3 on the PCB selects which to use */
5746   ROM_LOAD16_WORD_SWAP( "sp-4x.sp1", 0x00000, 0x80000, CRC(b4590283) SHA1(47047ed5b6062babc0a0bebcc30e4b3f021e115a) )
5747
5748   /* Encrypted */
5749   ROM_REGION( 0x80000, "audiocrypt", 0 )
5750   ROM_LOAD( "269-m1.bin", 0x00000, 0x80000, CRC(f6819d00) SHA1(d3bbe09df502464f104e53501708ac6e2c1832c6) )
5751   ROM_REGION( 0x90000, "audio", ROMREGION_ERASEFF )
5752
5753   ROM_Y_ZOOM
5754
5755   ROM_REGION( 0x1000000, "ym", 0 )
5756   /* Encrypted */
5757   ROM_LOAD( "269-v1.bin", 0x000000, 0x800000, CRC(c659b34c) SHA1(1931e8111ef43946f68699f8707334c96f753a1e) )
5758   ROM_LOAD( "269-v2.bin", 0x800000, 0x800000, CRC(dd903835) SHA1(e58d38950a7a8697bb22a1cc7a371ae6664ae8f9) )
5759
5760   ROM_REGION( 0x4000000, "sprites", ROMREGION_DISPOSE )
5761   /* Encrypted */
5762   ROM_LOAD( "269-c1.bin", 0x0000000, 0x2000000, CRC(1b608f9c) SHA1(4e70ad182da2ca18815bd3936efb04a06ebce01e) ) /* Plane 0,1 */
5763   ROM_LOAD( "269-c2.bin", 0x2000000, 0x2000000, CRC(5a95f294) SHA1(6123cc7b20b494076185d27c2ffea910e124b195) ) /* Plane 0,1 */
5764ROM_END
5765
5766   /* alt PCB version, this one has the same program roms as the MVS set, and different GFX / Sound rom arrangements */
5767ROM_START( svcpcba ) /* Encrypted Set, JAMMA PCB */
5768   ROM_REGION( 0x800000, "main", 0 )
5769   ROM_LOAD32_WORD_SWAP( "269-p1a.bin", 0x000000, 0x400000, CRC(38e2005e) SHA1(1b902905916a30969282f1399a756e32ff069097)  )
5770   ROM_LOAD32_WORD_SWAP( "269-p2a.bin", 0x000002, 0x400000, CRC(6d13797c) SHA1(3cb71a95cea6b006b44cac0f547df88aec0007b7)  )
5771
5772   ROM_REGION( 0x80000, "fixed", 0 ) /* larger char set */
5773   ROM_FILL( 0x000000, 0x80000, 0 )
5774   ROM_REGION( 0x20000, "fixedbios", 0 )
5775   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5776
5777   ROM_REGION16_BE( 0x80000, "mainbios", 0 )
5778   /* this contains both an ASIA and JAPAN bios, HARDDIP3 on the PCB selects which to use */
5779   ROM_LOAD16_WORD_SWAP( "sp-4x.sp1", 0x00000, 0x80000, CRC(b4590283) SHA1(47047ed5b6062babc0a0bebcc30e4b3f021e115a) )
5780
5781   /* Encrypted */
5782   ROM_REGION( 0x80000, "audiocrypt", 0 )
5783   ROM_LOAD( "269-m1.bin", 0x00000, 0x80000, CRC(f6819d00) SHA1(d3bbe09df502464f104e53501708ac6e2c1832c6) )
5784   ROM_REGION( 0x90000, "audio", ROMREGION_ERASEFF )
5785
5786   ROM_Y_ZOOM
5787
5788   ROM_REGION( 0x1000000, "ym", 0 )
5789   /* Encrypted */
5790   ROM_LOAD( "269-v1a.bin", 0x000000, 0x1000000, CRC(a6af4753) SHA1(ec4f61a526b707a7faec4653b773beb3bf3a17ba) )
5791
5792   ROM_REGION( 0x4000000, "sprites", ROMREGION_DISPOSE )
5793   /* Encrypted */
5794   ROM_LOAD32_WORD( "269-c1a.bin", 0x0000000, 0x1000000, CRC(e64d2b0c) SHA1(0714198c400e5c273181e4c6f906b49e35fef75d) ) /* Plane 0,1 */
5795   ROM_LOAD32_WORD( "269-c2a.bin", 0x0000002, 0x1000000, CRC(249089c2) SHA1(1c0ca19e330efe1a74b2d35a1a9a8d61481e16a9) ) /* Plane 2,3 */
5796   ROM_LOAD32_WORD( "269-c3a.bin", 0x2000000, 0x1000000, CRC(d32f2fab) SHA1(273d58cb3c9075075b1ca39a3b247a2cd545fbe7) ) /* Plane 0,1 */
5797   ROM_LOAD32_WORD( "269-c4a.bin", 0x2000002, 0x1000000, CRC(bf77e878) SHA1(e6e76f8eed0d04ee9ad39bf38ce305930b10e2c1) ) /* Plane 2,3 */
5798ROM_END
5799
58005723ROM_START( svc ) /* Encrypted Set */ /* MVS AND AES VERSION */
58015724   ROM_REGION( 0x800000, "main", 0 )
58025725   ROM_LOAD32_WORD_SWAP( "269-p1.bin", 0x000000, 0x400000, CRC(38e2005e) SHA1(1b902905916a30969282f1399a756e32ff069097) )
r3373r3374
58085731   ROM_REGION( 0x80000, "fixed", 0 ) /* larger char set */
58095732   ROM_FILL( 0x000000, 0x80000, 0 )
58105733   ROM_REGION( 0x20000, "fixedbios", 0 )
5811   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5734   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
58125735
58135736   /* Encrypted */
58145737   NEO_BIOS_AUDIO_ENCRYPTED_512K( "269-m1.bin", CRC(f6819d00) SHA1(d3bbe09df502464f104e53501708ac6e2c1832c6) )
r3373r3374
58385761   ROM_LOAD( "svc-s1.bin", 0x10000, 0x10000, CRC(70b44df1) SHA1(52ae3f264d7b33e94e770e6b2d0cf35a64e7dda4) )
58395762   ROM_CONTINUE(         0x00000, 0x10000 )
58405763   ROM_REGION( 0x20000, "fixedbios", 0 )
5841   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5764   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
58425765
58435766   NEOGEO_BIOS
58445767
58455768   ROM_REGION( 0x20000, "audiobios", 0 )
5846   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )
5769   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) )
58475770
58485771   ROM_REGION( 0x50000, "audio", 0 )
58495772   ROM_LOAD( "svc-m1.bin", 0x20000, 0x10000, CRC(804328c3) SHA1(f931636c563b0789d4812033a77b47bf663db43f) )
r3373r3374
58825805   NEOGEO_BIOS
58835806
58845807   ROM_REGION( 0x20000, "audiobios", 0 )
5885   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )
5808   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) )
58865809
58875810   ROM_REGION( 0x50000, "audio", 0 )
58885811   ROM_LOAD( "svc-m1.bin", 0x20000, 0x10000, CRC(804328c3) SHA1(f931636c563b0789d4812033a77b47bf663db43f) )
r3373r3374
59175840   ROM_LOAD( "svc-s1pl.bin", 0x10000, 0x10000, CRC(ca3c735e) SHA1(aebd15253c90432a2e0a4c40f37110c1e2176ee4) )
59185841   ROM_CONTINUE(         0x00000, 0x10000 )
59195842   ROM_REGION( 0x20000, "fixedbios", 0 )
5920   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5843   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
59215844
59225845   NEOGEO_BIOS
59235846
59245847   ROM_REGION( 0x20000, "audiobios", 0 )
5925   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )
5848   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) )
59265849
59275850   ROM_REGION( 0x50000, "audio", 0 )
59285851   ROM_LOAD( "svc-m1.bin", 0x20000, 0x10000, CRC(804328c3) SHA1(f931636c563b0789d4812033a77b47bf663db43f) )
r3373r3374
59605883   NEOGEO_BIOS
59615884
59625885   ROM_REGION( 0x20000, "audiobios", 0 )
5963   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )
5886   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) )
59645887
59655888   ROM_REGION( 0x50000, "audio", 0 )
59665889   ROM_LOAD( "svc-m1.bin", 0x20000, 0x10000, CRC(804328c3) SHA1(f931636c563b0789d4812033a77b47bf663db43f) )
r3373r3374
59945917   ROM_Y_ZOOM
59955918
59965919   /* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
5997   ROM_REGION( 0x80000, "fixed", 0 ) /* larger char set */
5998   ROM_FILL( 0x000000, 0x80000, 0 )
5920   ROM_REGION( 0x20000, "fixed", 0 )
5921   ROM_FILL( 0x000000, 0x20000, 0 )
59995922   ROM_REGION( 0x20000, "fixedbios", 0 )
6000   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5923   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
60015924
60025925   /* Encrypted */
60035926   NEO_BIOS_AUDIO_ENCRYPTED_512K( "270-m1.bin", CRC(49c9901a) SHA1(2623e9765a0eba58fee2de72851e9dc502344a3d) )
r3373r3374
60215944   ROM_LOAD16_BYTE( "270-c8.bin", 0x3000001, 0x800000, CRC(02c530a6) SHA1(7a3fafa6075506c6ef78cc4ec2cb72118ec83cb9) ) /* Plane 2,3 */
60225945ROM_END
60235946
6024ROM_START( samsho5h ) /* Encrypted Set, Alternate Set */
5947ROM_START( samsho5h ) /* Encrypted Set, Alternate Set */ /* AES VERSION */
60255948   ROM_REGION( 0x800000, "main", 0 )
60265949   ROM_LOAD16_WORD_SWAP( "270-p1c.bin", 0x000000, 0x400000, CRC(bf956089) SHA1(c538289069bf338b9fa7ecc5c9143763dbb776a8) )
60275950   ROM_LOAD16_WORD_SWAP( "270-p2c.bin", 0x400000, 0x400000, CRC(943a6b1d) SHA1(12bd02fc197456da6ee86f066086094cef0f4bf9) )
r3373r3374
60295952   ROM_Y_ZOOM
60305953
60315954   /* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
6032   ROM_REGION( 0x80000, "fixed", 0 ) /* larger char set */
6033   ROM_FILL( 0x000000, 0x80000, 0 )
5955   ROM_REGION( 0x20000, "fixed", 0 )
5956   ROM_FILL( 0x000000, 0x20000, 0 )
60345957   ROM_REGION( 0x20000, "fixedbios", 0 )
6035   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5958   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
60365959
60375960   /* Encrypted */
60385961   NEO_BIOS_AUDIO_ENCRYPTED_512K( "270-m1.bin", CRC(49c9901a) SHA1(2623e9765a0eba58fee2de72851e9dc502344a3d) )
r3373r3374
60585981
60595982ROM_START( samsho5b ) /* bootleg */
60605983   ROM_REGION( 0x800000, "main", 0 )
6061   ROM_LOAD16_WORD_SWAP( "270-p2bl.bin", 0x000000, 0x400000, CRC(5023067f) SHA1(b1d682fa7d158f19664356a919da6572e8cfeee0) )
6062   ROM_LOAD16_WORD_SWAP( "270-p1bl.bin", 0x400000, 0x400000, CRC(b6cbe386) SHA1(99c2407361116c2b2c5fe72df53e05c5f99163c1) )
5984   ROM_LOAD16_WORD_SWAP( "ssv-p2.bin", 0x000000, 0x400000, CRC(5023067f) SHA1(b1d682fa7d158f19664356a919da6572e8cfeee0) )
5985   ROM_LOAD16_WORD_SWAP( "ssv-p1.bin", 0x400000, 0x400000, CRC(b6cbe386) SHA1(99c2407361116c2b2c5fe72df53e05c5f99163c1) )
60635986
6064   ROM_Y_ZOOM
5987   NEO_SFIX_128K( "ssv-s1.bin", CRC(70f667d0) SHA1(6d7ce62bb77eb215cc22d6c3c677accfd740aa83) )
60655988
6066   /* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
6067   ROM_REGION( 0x80000, "fixed", 0 ) /* larger char set */
6068   ROM_FILL( 0x000000, 0x80000, 0 )
6069   ROM_REGION( 0x20000, "fixedbios", 0 )
6070   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
5989   NEO_BIOS_AUDIO_128K( "ssv-m1.bin", CRC(18114fb1) SHA1(016dc2f328340f3637a9bff373a20973df29f6b8) )
60715990
6072   /* 0xf800 area doesn't match encrypted rom */
6073   NEO_BIOS_AUDIO_256K( "270-m1_bootleg.bin", CRC(e94a5e2b) SHA1(53ef2ad6583060af69fdde73576e09ba88affa55) ) /* not a 100% match for encrypted version */
6074
6075   /* should this set use decrypted roms? */
6076
60775991   ROM_REGION( 0x1000000, "ym", 0 )
6078   /* Encrypted */
6079   ROM_LOAD( "270-v1.bin", 0x000000, 0x800000, CRC(62e434eb) SHA1(1985f5e88f8e866f9683b6cea901aa28c04b80bf) )
6080   ROM_LOAD( "270-v2.bin", 0x800000, 0x800000, CRC(180f3c9a) SHA1(6d7dc2605ead6e78704efa127e7e0dfe621e2c54) )
5992   ROM_LOAD( "ssv-v1.bin", 0x000000, 0x400000, CRC(a3609761) SHA1(6dce1dbfd228c739b3716ae1cf08fd7f925d8650) )
5993   ROM_LOAD( "ssv-v2.bin", 0x400000, 0x400000, CRC(cbd6ebd5) SHA1(00211be3fa32035b0947ac65920ea8acae7bfae2) )
5994   ROM_LOAD( "ssv-v3.bin", 0x800000, 0x400000, CRC(6f1c2703) SHA1(8015df3d788cb7926ebbcda64a96964fe102ba27) )
5995   ROM_LOAD( "ssv-v4.bin", 0xc00000, 0x400000, CRC(5020c055) SHA1(bd1e68d1b0a47b0e2b365159e210048f8b22823a) )
60815996
60825997   NO_DELTAT_REGION
60835998
60845999   ROM_REGION( 0x4000000, "sprites", ROMREGION_DISPOSE )
6085   /* Encrypted */
6086   ROM_LOAD16_BYTE( "270-c1.bin", 0x0000000, 0x800000, CRC(14ffffac) SHA1(2ccebfdd0c7907679ae95bf6eca85b8d322441e2) ) /* Plane 0,1 */
6087   ROM_LOAD16_BYTE( "270-c2.bin", 0x0000001, 0x800000, CRC(401f7299) SHA1(94e48cdf1682b1250f53c59f3f71d995e928d17b) ) /* Plane 2,3 */
6088   ROM_LOAD16_BYTE( "270-c3.bin", 0x1000000, 0x800000, CRC(838f0260) SHA1(d5c8d3c6e7221d04e0b20882a847752e5ba95635) ) /* Plane 0,1 */
6089   ROM_LOAD16_BYTE( "270-c4.bin", 0x1000001, 0x800000, CRC(041560a5) SHA1(d165e533699f15b1e079c82f97db3542b3a7dd66) ) /* Plane 2,3 */
6090   ROM_LOAD16_BYTE( "270-c5.bin", 0x2000000, 0x800000, CRC(bd30b52d) SHA1(9f8282e684415b4045218cf764ef7d75a70e3240) ) /* Plane 0,1 */
6091   ROM_LOAD16_BYTE( "270-c6.bin", 0x2000001, 0x800000, CRC(86a69c70) SHA1(526732cdb408cf680af9da39057bce6a4dfb5e13) ) /* Plane 2,3 */
6092   ROM_LOAD16_BYTE( "270-c7.bin", 0x3000000, 0x800000, CRC(d28fbc3c) SHA1(a82a6ba6760fad14d9309f9147cb7d80bd6f70fc) ) /* Plane 0,1 */
6093   ROM_LOAD16_BYTE( "270-c8.bin", 0x3000001, 0x800000, CRC(02c530a6) SHA1(7a3fafa6075506c6ef78cc4ec2cb72118ec83cb9) ) /* Plane 2,3 */
6000   ROM_LOAD16_BYTE( "ssv-c1.bin", 0x0000000, 0x1000000, CRC(9c564a01) SHA1(99dc8900fd8f56ae04fff72b34ddcaa8abe4c1be) ) /* Plane 0,1 */
6001   ROM_LOAD16_BYTE( "ssv-c2.bin", 0x0000001, 0x1000000, CRC(4b73b8da) SHA1(a8b626de74cf57bbd8c222e8e24c953c9e8680f4) ) /* Plane 0,1 */
6002   ROM_LOAD16_BYTE( "ssv-c3.bin", 0x2000000, 0x1000000, CRC(029f9bb5) SHA1(6296c879aa0bbd22383ceeeac0326805cbc8b4ec) ) /* Plane 2,3 */
6003   ROM_LOAD16_BYTE( "ssv-c4.bin", 0x2000001, 0x1000000, CRC(75722430) SHA1(30594c30a167e75463670249df7744755e39e75b) ) /* Plane 2,3 */
60946004ROM_END
60956005
6096ROM_START( kf2k3pcb ) /* Encrypted Set, JAMMA PCB */
6006ROM_START( kof2003 ) /* Encrypted Code + Sound + GFX Roms */ /* MVS VERSION */
60976007   ROM_REGION( 0x900000, "main", 0 )
6098   ROM_LOAD32_WORD_SWAP( "271-p1.bin", 0x000000, 0x400000, CRC(b9da070c) SHA1(1a26325af142a4dd221c336061761468598c4634) )
6099   ROM_LOAD32_WORD_SWAP( "271-p2.bin", 0x000002, 0x400000, CRC(da3118c4) SHA1(582e4f44f03276adecb7b2848d3b96bf6da57f1e) )
6100   ROM_LOAD16_WORD_SWAP( "271-p3.bin", 0x800000, 0x100000, CRC(5cefd0d2) SHA1(cddc3164629fed4b6f715e12b109ad35d1009355) )
6008   ROM_LOAD32_WORD_SWAP( "271-p1c.bin", 0x000000, 0x400000, CRC(530ecc14) SHA1(812cf7e9902af3f5e9e330b7c05c2171b139ad2b) )
6009   ROM_LOAD32_WORD_SWAP( "271-p2c.bin", 0x000002, 0x400000, CRC(fd568da9) SHA1(46364906a1e81dc251117e91a1a7b43af1373ada) )
6010   ROM_LOAD16_WORD_SWAP( "271-p3c.bin", 0x800000, 0x100000, CRC(aec5b4a9) SHA1(74087f785590eda5898ce146029818f86ced42b6) ) // Encrypted
61016011
6102   ROM_REGION( 0x100000, "fixed", 0 ) /* larger char set */
6103   ROM_FILL( 0x000000, 0x100000, 0 )
6012   ROM_Y_ZOOM
6013
6014   /* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
6015   ROM_REGION( 0x80000, "fixed", 0 ) /* larger char set */
6016   ROM_FILL( 0x000000, 0x80000, 0 )
61046017   ROM_REGION( 0x20000, "fixedbios", 0 )
6105   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
6018   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
61066019
6107   ROM_REGION16_BE( 0x80000, "mainbios", 0 )
6108   ROM_LOAD16_WORD_SWAP( "271-bios.bin", 0x00000, 0x080000, CRC(148dd727) SHA1(2cf592a16c7157de02a989675d47965f2b3a44dd) ) // encrypted
6109
61106020   /* Encrypted */
6111   ROM_REGION( 0x80000, "audiocrypt", 0 )
6112   ROM_LOAD( "271-m1.bin", 0x00000, 0x80000, CRC(d6bcf2bc) SHA1(df78bc95990eb8e8f3638dde6e1876354df7fe84) )
6113   ROM_REGION( 0x90000, "audio", ROMREGION_ERASEFF )
6021   NEO_BIOS_AUDIO_ENCRYPTED_512K( "271-m1c.bin", CRC(f5515629) SHA1(7516bf1b0207a3c8d41dc30c478f8d8b1f71304b) )
61146022
6115   ROM_Y_ZOOM
6116
61176023   ROM_REGION( 0x1000000, "ym", 0 )
61186024   /* Encrypted */
6119   ROM_LOAD( "271-v1.bin", 0x000000, 0x1000000, CRC(1d96154b) SHA1(1d4e262b0d30cee79a4edc83bb9706023c736668) )
6025   ROM_LOAD( "271-v1c.bin", 0x000000, 0x800000, CRC(ffa3f8c7) SHA1(7cf4a933973ca23b7f87c81151d8659e6ec4bd20) )
6026   ROM_LOAD( "271-v2c.bin", 0x800000, 0x800000, CRC(5382c7d1) SHA1(1bf999705eda80ba1e7b0d6bdd010d9bfb18bd76) )
61206027
61216028   NO_DELTAT_REGION
61226029
6123   ROM_REGION( 0x6000000, "sprites", ROMREGION_DISPOSE )
6030   ROM_REGION( 0x4000000, "sprites", ROMREGION_DISPOSE )
61246031   /* Encrypted */
6125   ROM_LOAD32_WORD( "271-c1.bin", 0x0000000, 0x1000000, CRC(f5ebb327) SHA1(e4f799a54b09adcca13b1b0cf95971a1f4291b61) ) /* Plane 0,1 */
6126   ROM_LOAD32_WORD( "271-c2.bin", 0x0000002, 0x1000000, CRC(2be21620) SHA1(872c658f53bbc558e90f18d5db9cbaa82e748a6a) ) /* Plane 2,3 */
6127   ROM_LOAD32_WORD( "271-c3.bin", 0x2000000, 0x1000000, CRC(ddded4ff) SHA1(ff7b356125bc9e6637b164f5e81b13eabeb8d804) ) /* Plane 0,1 */
6128   ROM_LOAD32_WORD( "271-c4.bin", 0x2000002, 0x1000000, CRC(d85521e6) SHA1(62278fa8690972ed32aca07a4f7f97e7203d9f3a) ) /* Plane 2,3 */
6129   ROM_LOAD32_WORD( "271-c5.bin", 0x4000000, 0x1000000, CRC(18aa3540) SHA1(15e0a8c4e0927b1f7eb9bee8f532acea6818d5eb) ) /* Plane 0,1 */
6130   ROM_LOAD32_WORD( "271-c6.bin", 0x4000002, 0x1000000, CRC(1c40de87) SHA1(8d6425aed43ff6a96c88194e203df6a783286373) ) /* Plane 2,3 */
6032   ROM_LOAD16_BYTE( "271-c1c.bin", 0x0000000, 0x800000, CRC(b1dc25d0) SHA1(50adc3c60d5b4b3abd10a49db2267306c6dbd772) ) /* Plane 0,1 */
6033   ROM_LOAD16_BYTE( "271-c2c.bin", 0x0000001, 0x800000, CRC(d5362437) SHA1(66db36522dc09106388c707252df9fe1c88b4856) ) /* Plane 2,3 */
6034   ROM_LOAD16_BYTE( "271-c3c.bin", 0x1000000, 0x800000, CRC(0a1fbeab) SHA1(9fe30d36ba98d00fda010832ff2f27783dd577c1) ) /* Plane 0,1 */
6035   ROM_LOAD16_BYTE( "271-c4c.bin", 0x1000001, 0x800000, CRC(87b19a0c) SHA1(b72a8e7d9124ce859b5149bb4381ba481c161ea5) ) /* Plane 2,3 */
6036   ROM_LOAD16_BYTE( "271-c5c.bin", 0x2000000, 0x800000, CRC(704ea371) SHA1(e75b80422f0d72eac826f8ffadf79efeccaab124) ) /* Plane 0,1 */
6037   ROM_LOAD16_BYTE( "271-c6c.bin", 0x2000001, 0x800000, CRC(20a1164c) SHA1(c9843b37612a16fc95f6851793b1cfb5d49d811d) ) /* Plane 2,3 */
6038   ROM_LOAD16_BYTE( "271-c7c.bin", 0x3000000, 0x800000, CRC(189aba7f) SHA1(7152195a57ad36b28290810fe87ed8c206262ba9) ) /* Plane 0,1 */
6039   ROM_LOAD16_BYTE( "271-c8c.bin", 0x3000001, 0x800000, CRC(20ec4fdc) SHA1(deb5f7ec5a090e419b9d1a6a74877bee081198e2) ) /* Plane 2,3 */
61316040ROM_END
61326041
6133ROM_START( kof2003 ) /* Encrypted Code + Sound + GFX Roms */ /* MVS VERSION */
6042ROM_START( kof2003h ) /* Encrypted Code + Sound + GFX Roms */
61346043   ROM_REGION( 0x900000, "main", 0 )
6135   ROM_LOAD32_WORD_SWAP( "271-p1c.bin", 0x000000, 0x400000, CRC(530ecc14) SHA1(812cf7e9902af3f5e9e330b7c05c2171b139ad2b) )
6136   ROM_LOAD32_WORD_SWAP( "271-p2c.bin", 0x000002, 0x400000, CRC(fd568da9) SHA1(46364906a1e81dc251117e91a1a7b43af1373ada) )
6137   ROM_LOAD16_WORD_SWAP( "271-p3c.bin", 0x800000, 0x100000, CRC(aec5b4a9) SHA1(74087f785590eda5898ce146029818f86ced42b6) ) // Encrypted
6044   ROM_LOAD32_WORD_SWAP( "271-p1k.bin", 0x000000, 0x400000, CRC(d0d0ae3e) SHA1(538d054ac50c91694fbbfefcce548b063713e14e) )
6045   ROM_LOAD32_WORD_SWAP( "271-p2k.bin", 0x000002, 0x400000, CRC(fb3f79d9) SHA1(f253d10e732d6e23ae82d74ac9269d21f69ddb4d) )
6046   ROM_LOAD16_WORD_SWAP( "271-p3k.bin", 0x800000, 0x100000, CRC(232702ad) SHA1(6045046027dac1cbd4cbd14b5c1ece522bc6197f) ) // Encrypted
61386047
61396048   ROM_Y_ZOOM
61406049
r3373r3374
61426051   ROM_REGION( 0x80000, "fixed", 0 ) /* larger char set */
61436052   ROM_FILL( 0x000000, 0x80000, 0 )
61446053   ROM_REGION( 0x20000, "fixedbios", 0 )
6145   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
6054   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
61466055
61476056   /* Encrypted */
6148   NEO_BIOS_AUDIO_ENCRYPTED_512K( "271-m1c.bin", CRC(f5515629) SHA1(7516bf1b0207a3c8d41dc30c478f8d8b1f71304b) )
6057   NEO_BIOS_AUDIO_ENCRYPTED_512K( "271-m1k.bin", CRC(48d9affe) SHA1(68f01560b91bbada39001ce01bdeeed5c9bb29f2) )
61496058
61506059   ROM_REGION( 0x1000000, "ym", 0 )
61516060   /* Encrypted */
r3373r3374
61566065
61576066   ROM_REGION( 0x4000000, "sprites", ROMREGION_DISPOSE )
61586067   /* Encrypted */
6159   ROM_LOAD16_BYTE( "271-c1c.bin", 0x0000000, 0x800000, CRC(b1dc25d0) SHA1(50adc3c60d5b4b3abd10a49db2267306c6dbd772) ) /* Plane 0,1 */
6160   ROM_LOAD16_BYTE( "271-c2c.bin", 0x0000001, 0x800000, CRC(d5362437) SHA1(66db36522dc09106388c707252df9fe1c88b4856) ) /* Plane 2,3 */
6161   ROM_LOAD16_BYTE( "271-c3c.bin", 0x1000000, 0x800000, CRC(0a1fbeab) SHA1(9fe30d36ba98d00fda010832ff2f27783dd577c1) ) /* Plane 0,1 */
6162   ROM_LOAD16_BYTE( "271-c4c.bin", 0x1000001, 0x800000, CRC(87b19a0c) SHA1(b72a8e7d9124ce859b5149bb4381ba481c161ea5) ) /* Plane 2,3 */
6163   ROM_LOAD16_BYTE( "271-c5c.bin", 0x2000000, 0x800000, CRC(704ea371) SHA1(e75b80422f0d72eac826f8ffadf79efeccaab124) ) /* Plane 0,1 */
6164   ROM_LOAD16_BYTE( "271-c6c.bin", 0x2000001, 0x800000, CRC(20a1164c) SHA1(c9843b37612a16fc95f6851793b1cfb5d49d811d) ) /* Plane 2,3 */
6165   ROM_LOAD16_BYTE( "271-c7c.bin", 0x3000000, 0x800000, CRC(189aba7f) SHA1(7152195a57ad36b28290810fe87ed8c206262ba9) ) /* Plane 0,1 */
6166   ROM_LOAD16_BYTE( "271-c8c.bin", 0x3000001, 0x800000, CRC(20ec4fdc) SHA1(deb5f7ec5a090e419b9d1a6a74877bee081198e2) ) /* Plane 2,3 */
6068   ROM_LOAD16_BYTE( "271-c1k.bin", 0x0000000, 0x800000, CRC(efb9dd24) SHA1(1c6fe10fdbfc3306c3b7321c731f28ffdbfb15b8) ) /* Plane 0,1 */
6069   ROM_LOAD16_BYTE( "271-c2k.bin", 0x0000001, 0x800000, CRC(3fb90447) SHA1(04d196de7c54c77bc75eba56d3060d46efc2d406) ) /* Plane 2,3 */
6070   ROM_LOAD16_BYTE( "271-c3k.bin", 0x1000000, 0x800000, CRC(27950f28) SHA1(924f4de61c86b9efde6f1104b986886f1117055d) ) /* Plane 0,1 */
6071   ROM_LOAD16_BYTE( "271-c4k.bin", 0x1000001, 0x800000, CRC(735177f8) SHA1(c95da1bc256995a7f44c9cc3312879ab6cbc15d6) ) /* Plane 2,3 */
6072   ROM_LOAD16_BYTE( "271-c5k.bin", 0x2000000, 0x800000, CRC(a51b7c0f) SHA1(53dcf692b35b8d32abe5962ac799b8d641f04710) ) /* Plane 0,1 */
6073   ROM_LOAD16_BYTE( "271-c6k.bin", 0x2000001, 0x800000, CRC(d5cae4e0) SHA1(248cd9eaac7a04d6b5d80c7534de90b057d566d7) ) /* Plane 2,3 */
6074   ROM_LOAD16_BYTE( "271-c7k.bin", 0x3000000, 0x800000, CRC(e65ae2d0) SHA1(39744e10697d7ac539ecfcfa597e75597f321955) ) /* Plane 0,1 */
6075   ROM_LOAD16_BYTE( "271-c8k.bin", 0x3000001, 0x800000, CRC(312f528c) SHA1(b4ad75f54f730ada6cb00112b74022250f055725) ) /* Plane 2,3 */
61676076ROM_END
61686077
61696078ROM_START( kf2k3bl ) /* bootleg */
r3373r3374
62946203   ROM_REGION( 0x20000, "fixed", 0 )
62956204   ROM_FILL( 0x000000, 0x20000, 0 )
62966205   ROM_REGION( 0x20000, "fixedbios", 0 )
6297   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
6206   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
62986207
62996208   NEO_BIOS_AUDIO_ENCRYPTED_512K( "272-m1.bin", CRC(adeebf40) SHA1(8cbd63dda3fff4de38060405bf70cd9308c9e66e) )
63006209
r3373r3374
63286237   ROM_REGION( 0x20000, "fixed", 0 )
63296238   ROM_FILL( 0x000000, 0x20000, 0 )
63306239   ROM_REGION( 0x20000, "fixedbios", 0 )
6331   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
6240   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
63326241
63336242   /* Encrypted */
63346243   NEO_BIOS_AUDIO_ENCRYPTED_512K( "272-m1.bin", CRC(adeebf40) SHA1(8cbd63dda3fff4de38060405bf70cd9308c9e66e) )
r3373r3374
63636272   ROM_REGION( 0x20000, "fixed", 0 )
63646273   ROM_FILL( 0x000000, 0x20000, 0 )
63656274   ROM_REGION( 0x20000, "fixedbios", 0 )
6366   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
6275   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
63676276
63686277   /* Encrypted */
63696278   NEO_BIOS_AUDIO_ENCRYPTED_512K( "272-m1.bin", CRC(adeebf40) SHA1(8cbd63dda3fff4de38060405bf70cd9308c9e66e) )
r3373r3374
63986307   ROM_REGION( 0x20000, "fixed", 0 )
63996308   ROM_FILL( 0x000000, 0x20000, 0 )
64006309   ROM_REGION( 0x20000, "fixedbios", 0 )
6401   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
6310   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
64026311
64036312   /* Encrypted */
64046313   NEO_BIOS_AUDIO_ENCRYPTED_512K( "jgp-m1.bin", CRC(d163c690) SHA1(1dfd04d20c5985037f07cd01000d0b04f3a8f4f4) )
r3373r3374
64486357   ROM_LOAD16_BYTE( "vl_c2.rom", 0x000001, 0x80000, CRC(efe9b33e) SHA1(910c651aadce9bf59e51c338ceef62287756d2e8) ) /* Plane 2,3 */
64496358ROM_END
64506359
6360/* Jamma PCB sets */
6361
6362/******************************************************************************
6363    The following Jamma PCB boards are known:
6364
6365    SNK vs. CAPCOM SVC CHAOS (svcpcb)
6366    NEO-MVH MVO 2003.6.5
6367
6368    SNK vs. CAPCOM SVC CHAOS (svcpcba)
6369    NEO-MVH MVOB 2003.7.9
6370
6371    Metal Slug 5
6372    NEO-MVH MVOBR 2003.8.4
6373
6374    The King of Fighters 2003
6375    NEO-MVH MVOC 2003.11.3
6376******************************************************************************/
6377
6378
6379/* comlete redump required */
6380ROM_START( ms5pcb ) /* Encrypted Set */
6381   ROM_REGION( 0x800000, "main", 0 )
6382   ROM_LOAD32_WORD_SWAP( "268-p1r.bin", 0x000000, 0x400000, NO_DUMP )
6383   ROM_LOAD32_WORD_SWAP( "268-p2r.bin", 0x000002, 0x400000, NO_DUMP )
6384
6385   /* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
6386   ROM_REGION( 0x20000, "fixed", 0 )
6387   ROM_FILL( 0x000000, 0x20000, 0 )
6388   ROM_REGION( 0x20000, "fixedbios", 0 )
6389   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
6390
6391   ROM_REGION16_BE( 0x80000, "mainbios", 0 )
6392   /* this contains both an ASIA and JAPAN bios, HARDDIP3 on the PCB selects which to use */
6393   ROM_LOAD16_WORD_SWAP( "sp-4x.sp1", 0x00000, 0x80000, CRC(b4590283) SHA1(47047ed5b6062babc0a0bebcc30e4b3f021e115a) )
6394
6395   /* Encrypted */
6396   ROM_REGION( 0x80000, "audiocrypt", 0 )
6397   ROM_LOAD( "268-m1.bin", 0x00000, 0x80000, CRC(4a5a6e0e) SHA1(df0f660f2465e1db7be5adfcaf5e88ad61a74a42) )
6398   ROM_REGION( 0x90000, "audio", ROMREGION_ERASEFF )
6399
6400   /* Encrypted */
6401
6402   ROM_Y_ZOOM
6403
6404   ROM_REGION( 0x1000000, "ym", 0 )
6405   /* Encrypted */
6406   ROM_LOAD( "268-v1.bin", 0x000000, 0x1000000, CRC(8458afe5) SHA1(62b4c6e7db763e9ff2697bbcdb43dc5a56b48c68) )
6407
6408   NO_DELTAT_REGION
6409
6410   ROM_REGION( 0x4000000, "sprites", ROMREGION_DISPOSE )
6411   /* Encrypted */
6412   ROM_LOAD32_WORD( "268-c1.bin", 0x0000000, 0x1000000, CRC(802042e8) SHA1(ff028b65f60f0b51b255a380cc47ec19fdc0c0cf) ) /* Plane 0,1 */
6413   ROM_LOAD32_WORD( "268-c2.bin", 0x0000002, 0x1000000, CRC(3b89fb9f) SHA1(cbc0729aae961f683b105ec3e1cda58b3f985abc) ) /* Plane 2,3 */
6414   ROM_LOAD32_WORD( "268-c3.bin", 0x2000000, 0x1000000, CRC(0f3f59e3) SHA1(8cc751dc7d4e94864a9ce3346f23b8f011082fcc) ) /* Plane 0,1 */
6415   ROM_LOAD32_WORD( "268-c4.bin", 0x2000002, 0x1000000, CRC(3ad8435a) SHA1(b333c8993c9b4c4ea59450ad0a3560e0b28056bc) ) /* Plane 2,3 */
6416ROM_END
6417
6418ROM_START( svcpcb ) /* Encrypted Set, JAMMA PCB */
6419   ROM_REGION( 0x2000000, "main", 0 )
6420   ROM_LOAD16_WORD_SWAP( "269-p1.bin", 0x000000, 0x2000000, CRC(432cfdfc) SHA1(19b40d32188a8bace6d2d570c6cf3d2f1e31e379) )
6421
6422   ROM_REGION( 0x80000, "fixed", 0 ) /* larger char set */
6423   ROM_FILL( 0x000000, 0x80000, 0 )
6424   ROM_REGION( 0x20000, "fixedbios", 0 )
6425   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
6426
6427   ROM_REGION16_BE( 0x80000, "mainbios", 0 )
6428   /* this contains both an ASIA and JAPAN bios, HARDDIP3 on the PCB selects which to use */
6429   ROM_LOAD16_WORD_SWAP( "sp-4x.sp1", 0x00000, 0x80000, CRC(b4590283) SHA1(47047ed5b6062babc0a0bebcc30e4b3f021e115a) )
6430
6431   /* Encrypted */
6432   ROM_REGION( 0x80000, "audiocrypt", 0 )
6433   ROM_LOAD( "269-m1.bin", 0x00000, 0x80000, CRC(f6819d00) SHA1(d3bbe09df502464f104e53501708ac6e2c1832c6) )
6434   ROM_REGION( 0x90000, "audio", ROMREGION_ERASEFF )
6435
6436   ROM_Y_ZOOM
6437
6438   ROM_REGION( 0x1000000, "ym", 0 )
6439   /* Encrypted */
6440   ROM_LOAD( "269-v1.bin", 0x000000, 0x800000, CRC(c659b34c) SHA1(1931e8111ef43946f68699f8707334c96f753a1e) )
6441   ROM_LOAD( "269-v2.bin", 0x800000, 0x800000, CRC(dd903835) SHA1(e58d38950a7a8697bb22a1cc7a371ae6664ae8f9) )
6442
6443   ROM_REGION( 0x4000000, "sprites", ROMREGION_DISPOSE )
6444   /* Encrypted */
6445   ROM_LOAD( "269-c1.bin", 0x0000000, 0x2000000, CRC(1b608f9c) SHA1(4e70ad182da2ca18815bd3936efb04a06ebce01e) ) /* Plane 0,1 */
6446   ROM_LOAD( "269-c2.bin", 0x2000000, 0x2000000, CRC(5a95f294) SHA1(6123cc7b20b494076185d27c2ffea910e124b195) ) /* Plane 0,1 */
6447ROM_END
6448
6449/* alt PCB version, this one has the same program roms as the MVS set, and different GFX / Sound rom arrangements */
6450ROM_START( svcpcba ) /* Encrypted Set, JAMMA PCB */
6451   ROM_REGION( 0x800000, "main", 0 )
6452   ROM_LOAD32_WORD_SWAP( "269-p1a.bin", 0x000000, 0x400000, CRC(38e2005e) SHA1(1b902905916a30969282f1399a756e32ff069097)  )
6453   ROM_LOAD32_WORD_SWAP( "269-p2a.bin", 0x000002, 0x400000, CRC(6d13797c) SHA1(3cb71a95cea6b006b44cac0f547df88aec0007b7)  )
6454
6455   ROM_REGION( 0x80000, "fixed", 0 ) /* larger char set */
6456   ROM_FILL( 0x000000, 0x80000, 0 )
6457   ROM_REGION( 0x20000, "fixedbios", 0 )
6458   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
6459
6460   ROM_REGION16_BE( 0x80000, "mainbios", 0 )
6461   /* this contains both an ASIA and JAPAN bios, HARDDIP3 on the PCB selects which to use */
6462   ROM_LOAD16_WORD_SWAP( "sp-4x.sp1", 0x00000, 0x80000, CRC(b4590283) SHA1(47047ed5b6062babc0a0bebcc30e4b3f021e115a) )
6463
6464   /* Encrypted */
6465   ROM_REGION( 0x80000, "audiocrypt", 0 )
6466   ROM_LOAD( "269-m1.bin", 0x00000, 0x80000, CRC(f6819d00) SHA1(d3bbe09df502464f104e53501708ac6e2c1832c6) )
6467   ROM_REGION( 0x90000, "audio", ROMREGION_ERASEFF )
6468
6469   ROM_Y_ZOOM
6470
6471   ROM_REGION( 0x1000000, "ym", 0 )
6472   /* Encrypted */
6473   ROM_LOAD( "269-v1a.bin", 0x000000, 0x1000000, CRC(a6af4753) SHA1(ec4f61a526b707a7faec4653b773beb3bf3a17ba) )
6474
6475   ROM_REGION( 0x4000000, "sprites", ROMREGION_DISPOSE )
6476   /* Encrypted */
6477   ROM_LOAD32_WORD( "269-c1a.bin", 0x0000000, 0x1000000, CRC(e64d2b0c) SHA1(0714198c400e5c273181e4c6f906b49e35fef75d) ) /* Plane 0,1 */
6478   ROM_LOAD32_WORD( "269-c2a.bin", 0x0000002, 0x1000000, CRC(249089c2) SHA1(1c0ca19e330efe1a74b2d35a1a9a8d61481e16a9) ) /* Plane 2,3 */
6479   ROM_LOAD32_WORD( "269-c3a.bin", 0x2000000, 0x1000000, CRC(d32f2fab) SHA1(273d58cb3c9075075b1ca39a3b247a2cd545fbe7) ) /* Plane 0,1 */
6480   ROM_LOAD32_WORD( "269-c4a.bin", 0x2000002, 0x1000000, CRC(bf77e878) SHA1(e6e76f8eed0d04ee9ad39bf38ce305930b10e2c1) ) /* Plane 2,3 */
6481ROM_END
6482
6483ROM_START( kf2k3pcb ) /* Encrypted Set, JAMMA PCB */
6484   ROM_REGION( 0x900000, "main", 0 )
6485   ROM_LOAD32_WORD_SWAP( "271-p1.bin", 0x000000, 0x400000, CRC(b9da070c) SHA1(1a26325af142a4dd221c336061761468598c4634) )
6486   ROM_LOAD32_WORD_SWAP( "271-p2.bin", 0x000002, 0x400000, CRC(da3118c4) SHA1(582e4f44f03276adecb7b2848d3b96bf6da57f1e) )
6487   ROM_LOAD16_WORD_SWAP( "271-p3.bin", 0x800000, 0x100000, CRC(5cefd0d2) SHA1(cddc3164629fed4b6f715e12b109ad35d1009355) )
6488
6489   ROM_REGION( 0x100000, "fixed", 0 ) /* larger char set */
6490   ROM_FILL( 0x000000, 0x100000, 0 )
6491   ROM_REGION( 0x20000, "fixedbios", 0 )
6492   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
6493
6494   ROM_REGION16_BE( 0x80000, "mainbios", 0 )
6495   ROM_LOAD16_WORD_SWAP( "271-bios.bin", 0x00000, 0x080000, CRC(148dd727) SHA1(2cf592a16c7157de02a989675d47965f2b3a44dd) ) // encrypted
6496
6497   /* Encrypted */
6498   ROM_REGION( 0x80000, "audiocrypt", 0 )
6499   ROM_LOAD( "271-m1.bin", 0x00000, 0x80000, CRC(d6bcf2bc) SHA1(df78bc95990eb8e8f3638dde6e1876354df7fe84) )
6500   ROM_REGION( 0x90000, "audio", ROMREGION_ERASEFF )
6501
6502   ROM_Y_ZOOM
6503
6504   ROM_REGION( 0x1000000, "ym", 0 )
6505   /* Encrypted */
6506   ROM_LOAD( "271-v1.bin", 0x000000, 0x1000000, CRC(1d96154b) SHA1(1d4e262b0d30cee79a4edc83bb9706023c736668) )
6507
6508   NO_DELTAT_REGION
6509
6510   ROM_REGION( 0x6000000, "sprites", ROMREGION_DISPOSE )
6511   /* Encrypted */
6512   ROM_LOAD32_WORD( "271-c1.bin", 0x0000000, 0x1000000, CRC(f5ebb327) SHA1(e4f799a54b09adcca13b1b0cf95971a1f4291b61) ) /* Plane 0,1 */
6513   ROM_LOAD32_WORD( "271-c2.bin", 0x0000002, 0x1000000, CRC(2be21620) SHA1(872c658f53bbc558e90f18d5db9cbaa82e748a6a) ) /* Plane 2,3 */
6514   ROM_LOAD32_WORD( "271-c3.bin", 0x2000000, 0x1000000, CRC(ddded4ff) SHA1(ff7b356125bc9e6637b164f5e81b13eabeb8d804) ) /* Plane 0,1 */
6515   ROM_LOAD32_WORD( "271-c4.bin", 0x2000002, 0x1000000, CRC(d85521e6) SHA1(62278fa8690972ed32aca07a4f7f97e7203d9f3a) ) /* Plane 2,3 */
6516   ROM_LOAD32_WORD( "271-c5.bin", 0x4000000, 0x1000000, CRC(18aa3540) SHA1(15e0a8c4e0927b1f7eb9bee8f532acea6818d5eb) ) /* Plane 0,1 */
6517   ROM_LOAD32_WORD( "271-c6.bin", 0x4000002, 0x1000000, CRC(1c40de87) SHA1(8d6425aed43ff6a96c88194e203df6a783286373) ) /* Plane 2,3 */
6518ROM_END
6519
64516520/* Various Bootlegs */
64526521
64536522ROM_START( kog )
r3373r3374
65136582   ROM_REGION( 0x40000, "fixed", 0 )
65146583   ROM_LOAD( "5003-s1sp.bin", 0x00000, 0x40000, CRC(6c355ab4) SHA1(71ac2bcd3dbda8402baecc56dabc2297b148a900) )
65156584   ROM_REGION( 0x20000, "fixedbios", 0 )
6516   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
6585   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
65176586
65186587   NEO_BIOS_AUDIO_128K( "5003-m1.bin", CRC(1a8c274b) SHA1(5f6f9c533f4a296a18c741ce59a69cf6f5c836b9) )
65196588
r3373r3374
65496618   ROM_LOAD( "5003-s1sa.bin", 0x00000, 0x20000, CRC(4e1f7eae) SHA1(3302ad290804272447ccd2e8edd3ce968f043db1) )
65506619   /* S1 needs redump, correct? */
65516620   ROM_REGION( 0x20000, "fixedbios", 0 )
6552   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
6621   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
65536622
65546623   NEO_BIOS_AUDIO_128K( "5003-m1.bin", CRC(1a8c274b) SHA1(5f6f9c533f4a296a18c741ce59a69cf6f5c836b9) )
65556624
r3373r3374
66106679   ROM_REGION( 0x40000, "fixed", 0 ) // modified
66116680   ROM_FILL(              0x000000, 0x40000, 0 ) // modified
66126681   ROM_REGION( 0x20000, "fixedbios", 0 )
6613   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
6682   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
66146683
66156684   NEO_BIOS_AUDIO_128K( "kf10-m1.bin", CRC(f6fab859) SHA1(0184aa1394b9f9946d610278b53b846020dd88dc) )
66166685
r3373r3374
67676836   ROM_REGION( 0x100000, "main", ROMREGION_ERASEFF )
67686837
67696838   ROM_REGION( 0x20000, "audiobios", 0 )
6770   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )
6839   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) )
67716840
67726841   ROM_REGION( 0x50000, "audio", 0 )
6773   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )
6842   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) )
67746843
67756844   ROM_Y_ZOOM
67766845
67776846   ROM_REGION( 0x20000, "fixed", ROMREGION_ERASEFF )
67786847
67796848   ROM_REGION( 0x20000, "fixedbios", 0 )
6780   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
6849   ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) )
67816850
67826851   ROM_REGION( 0x10000, "ym", ROMREGION_ERASEFF )
67836852
r3373r3374
69677036   neo_pcm2_swap(machine, 0);
69687037   neogeo_cmc50_m1_decrypt(machine);
69697038   kof2000_neogeo_gfx_decrypt(machine, 0xec);
6970
6971
6972
6973
69747039   DRIVER_INIT_CALL(neogeo);
69757040}
69767041
r3373r3374
70347099   install_pvc_protection(machine);
70357100}
70367101
7102static TIMER_CALLBACK( ms5pcb_bios_timer_callback )
7103{
7104   int harddip3 = input_port_read(machine, "HARDDIP") & 1;
7105   memory_set_bankptr(NEOGEO_BANK_BIOS, memory_region(machine, "mainbios")+0x20000+harddip3*0x20000);
7106}
7107
70377108static DRIVER_INIT( ms5pcb )
70387109{
7110   /* start a timer that will check the BIOS select DIP every second */
7111   timer_set(attotime_zero, NULL, 0, ms5pcb_bios_timer_callback);
7112   timer_pulse(ATTOTIME_IN_MSEC(1000), NULL, 0, ms5pcb_bios_timer_callback);
7113
70397114   mslug5_decrypt_68k(machine);
70407115   svcpcb_gfx_decrypt(machine);
70417116   neogeo_cmc50_m1_decrypt(machine);
r3373r3374
71477222
71487223static DRIVER_INIT( samsho5b )
71497224{
7150   neo_pcm2_swap(machine, 4);
7151   neogeo_fixed_layer_bank_type = 1;
7152   kof2000_neogeo_gfx_decrypt(machine, 0x0f);
71537225   samsh5bl_px_decrypt(machine);
7226   samsh5bl_vx_decrypt(machine);
7227   neogeo_bootleg_sx_decrypt(machine, 1);
7228   neogeo_bootleg_cx_decrypt(machine);
71547229   DRIVER_INIT_CALL(neogeo);
71557230}
71567231
r3373r3374
71937268   neogeo_fixed_layer_bank_type = 2;
71947269   neogeo_cmc50_m1_decrypt(machine);
71957270   kof2000_neogeo_gfx_decrypt(machine, 0x9d);
7271   DRIVER_INIT_CALL(neogeo);
7272   install_pvc_protection(machine);
7273}
71967274
7275static DRIVER_INIT( kof2003h )
7276{
7277   kof2003h_decrypt_68k(machine);
7278   neo_pcm2_swap(machine, 5);
7279   neogeo_fixed_layer_bank_type = 2;
7280   neogeo_cmc50_m1_decrypt(machine);
7281   kof2000_neogeo_gfx_decrypt(machine, 0x9d);
71977282   DRIVER_INIT_CALL(neogeo);
71987283   install_pvc_protection(machine);
71997284}
r3373r3374
74177502GAME( 1995, fatfury3, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Fatal Fury 3 - Road to the Final Victory / Garou Densetsu 3 - haruka-naru tatakai", 0 )
74187503GAME( 1995, ssideki3, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Super Sidekicks 3 - The Next Glory / Tokuten Ou 3 - eikoue no michi", 0 )
74197504GAME( 1995, kof95,    neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "The King of Fighters '95 (set 1)", 0 )
7420GAME( 1995, kof95a,   kof95,    neogeo,   neogeo,   neogeo,   ROT0, "SNK", "The King of Fighters '95 (set 2)", 0 )
7505GAME( 1995, kof95h,   kof95,    neogeo,   neogeo,   neogeo,   ROT0, "SNK", "The King of Fighters '95 (set 2)", 0 )
74217506GAME( 1995, samsho3,  neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (set 1)", 0 )
7422GAME( 1995, samsho3a, samsho3,  neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (set 2)", 0 )
7507GAME( 1995, samsho3h, samsho3,  neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (set 2)", 0 )
74237508GAME( 1995, fswords,  samsho3,  neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Fighters Swords (Korean release of Samurai Shodown III)", 0 )
74247509GAME( 1995, rbff1,    neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Real Bout Fatal Fury / Real Bout Garou Densetsu", 0 )
74257510GAME( 1995, rbff1a,   rbff1,    neogeo,   neogeo,   neogeo,   ROT0, "SNK", "Real Bout Fatal Fury / Real Bout Garou Densetsu (bug fix revision)", 0 )
r3373r3374
74827567GAME( 2004, kof2k4se, kof2002,  neogeo,   neogeo,   kof2k4se, ROT0, "bootleg", "The King of Fighters Special Edition 2004 (The King of Fighters 2002 bootleg)", 0 ) /* Hack / Bootleg of kof2002 */
74837568GAME( 2003, mslug5,   neogeo,   neogeo,   neogeo,   mslug5,   ROT0, "SNK Playmore", "Metal Slug 5", 0 )
74847569GAME( 2003, mslug5h,  mslug5,   neogeo,   neogeo,   mslug5,   ROT0, "SNK Playmore", "Metal Slug 5 (AES Cart)", 0 ) /* Also found in later MVS carts */
7485GAME( 2003, ms5pcb,   0,        neogeo,   neogeo,   ms5pcb,   ROT0, "SNK Playmore", "Metal Slug 5 (JAMMA PCB)", 0 )
7570GAME( 2003, ms5pcb,   0,        neogeo,   ms5pcb,   ms5pcb,   ROT0, "SNK Playmore", "Metal Slug 5 (JAMMA PCB)", 0 )
74867571GAME( 2003, ms5plus,  mslug5,   neogeo,   neogeo,   ms5plus,  ROT0, "bootleg", "Metal Slug 5 Plus (bootleg)",0 )
74877572GAME( 2003, svcpcb,   0,        neogeo,   svcpcb,   svcpcb,   ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS (JAMMA PCB, set 1)", 0 ) // not a clone of neogeo because it's NOT a neogeo cart.
74887573GAME( 2003, svcpcba,  svcpcb,   neogeo,   svcpcb,   svcpcb,   ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS (JAMMA PCB, set 2)" , 0 ) /* Encrypted Code */
r3373r3374
74967581GAME( 2003, samsho5b, samsho5,  neogeo,   neogeo,   samsho5b, ROT0, "bootleg", "Samurai Shodown V / Samurai Spirits Zero (bootleg)", 0 ) // different program scrambling
74977582GAME( 2003, kf2k3pcb, 0,        neogeo,   neogeo,   kf2k3pcb, ROT0, "SNK Playmore", "The King of Fighters 2003 (Japan, JAMMA PCB)", 0 ) // not a clone of neogeo because it's NOT a neogeo cart.
74987583GAME( 2003, kof2003,  neogeo,   neogeo,   neogeo,   kof2003,  ROT0, "SNK Playmore", "The King of Fighters 2003", 0 )
7584GAME( 2003, kof2003h, kof2003,  neogeo,   neogeo,   kof2003h,  ROT0, "SNK Playmore", "The King of Fighters 2003 (set 2)", 0 )
74997585GAME( 2003, kf2k3bl,  kof2003,  neogeo,   neogeo,   kof2003b, ROT0, "bootleg", "The King of Fighters 2003 (bootleg set 1)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart (unless it was a bootleg pcb with the new bios?)
75007586GAME( 2003, kf2k3bla, kof2003,  neogeo,   neogeo,   kof2k3pl, ROT0, "bootleg", "The King of Fighters 2003 (bootleg set 2)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart
75017587GAME( 2003, kf2k3pl,  kof2003,  neogeo,   neogeo,   kof2k3pl, ROT0, "bootleg", "The King of Fighters 2004 Plus / Hero (The King of Fighters 2003 bootleg)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart
src/mame/drivers/dlair.c
r3373r3374
8282 *
8383 *************************************/
8484
85static void dleuro_interrupt(running_machine *machine, int state)
85static void dleuro_interrupt(const device_config *device, int state)
8686{
87   cpunum_set_input_line(machine, 0, 0, state);
87   cpunum_set_input_line(device->machine, 0, 0, state);
8888}
8989
9090
91static WRITE8_HANDLER( serial_transmit )
91static WRITE8_DEVICE_HANDLER( serial_transmit )
9292{
9393   laserdisc_data_w(laserdisc, data);
9494}
9595
9696
97static int serial_receive(int ch)
97static int serial_receive(const device_config *device, int channel)
9898{
9999   /* if we still have data to send, do it now */
100   if (ch == 0 && laserdisc_line_r(laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
100   if (channel == 0 && laserdisc_line_r(laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
101101      return laserdisc_data_r(laserdisc);
102102
103103   return -1;
104104}
105105
106106
107static z80ctc_interface ctc_intf =
107static const z80ctc_interface ctc_intf =
108108{
109   0,                 /* clock (filled in from the CPU 0 clock) */
109   "main",            /* clock comes from main CPU's clock */
110   0,                  /* clock (filled in from the CPU clock) */
110111   0,                 /* timer disables */
111112   dleuro_interrupt,     /* interrupt handler */
112113   0,               /* ZC/TO0 callback */
r3373r3374
115116};
116117
117118
118static z80sio_interface sio_intf =
119static const z80sio_interface sio_intf =
119120{
120   0,                  /* clock (filled in from the CPU 3 clock) */
121   "main",            /* clock comes from main CPU's clock */
122   0,                  /* clock (filled in from the CPU clock) */
121123   dleuro_interrupt,   /* interrupt handler */
122124   0,               /* DTR changed handler */
123125   0,               /* RTS changed handler */
r3373r3374
127129};
128130
129131
130static const struct z80_irq_daisy_chain dleuro_daisy_chain[] =
132static const z80_daisy_chain dleuro_daisy_chain[] =
131133{
132   { z80sio_reset, z80sio_irq_state, z80sio_irq_ack, z80sio_irq_reti, 0 },
133   { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti, 0 },
134   { 0, 0, 0, 0, -1 }      /* end mark */
134   { Z80SIO, "sio" },
135   { Z80CTC, "ctc" },
136   { NULL }
135137};
136138
137139
r3373r3374
190192}
191193
192194
193static MACHINE_START( dleuro )
194{
195   laserdisc = device_list_find_by_tag(machine->config->devicelist, LASERDISC, "laserdisc");
196
197   /* initialize the CTC and SIO peripherals */
198   ctc_intf.baseclock = cpunum_get_clock(0);
199   sio_intf.baseclock = cpunum_get_clock(0);
200   z80ctc_init(0, &ctc_intf);
201   z80sio_init(0, &sio_intf);
202}
203
204
205195static MACHINE_RESET( dlair )
206196{
207197   /* determine the laserdisc player from the DIP switches */
r3373r3374
225215   /* also update the speaker on the European version */
226216   if (sndti_exists(SOUND_BEEP, 0))
227217   {
218      const device_config *ctc = devtag_get_device(machine, Z80CTC, "ctc");
228219      beep_set_state(0, 1);
229      beep_set_frequency(0, ATTOSECONDS_TO_HZ(z80ctc_getperiod(0, 0).attoseconds));
220      beep_set_frequency(0, ATTOSECONDS_TO_HZ(z80ctc_getperiod(ctc, 0).attoseconds));
230221   }
231222}
232223
r3373r3374
362353 *
363354 *************************************/
364355
365static READ8_HANDLER( sio_r )
356static READ8_DEVICE_HANDLER( sio_r )
366357{
367   return (offset & 1) ? z80sio_c_r(0, (offset >> 1) & 1) : z80sio_d_r(machine, 0, (offset >> 1) & 1);
358   return (offset & 1) ? z80sio_c_r(device, (offset >> 1) & 1) : z80sio_d_r(device, (offset >> 1) & 1);
368359}
369360
370361
371static WRITE8_HANDLER( sio_w )
362static WRITE8_DEVICE_HANDLER( sio_w )
372363{
373364   if (offset & 1)
374      z80sio_c_w(machine, 0, (offset >> 1) & 1, data);
365      z80sio_c_w(device, (offset >> 1) & 1, data);
375366   else
376      z80sio_d_w(machine, 0, (offset >> 1) & 1, data);
367      z80sio_d_w(device, (offset >> 1) & 1, data);
377368}
378369
379370
r3373r3374
431422/* complete memory map derived from schematics */
432423static ADDRESS_MAP_START( dleuro_io_map, ADDRESS_SPACE_IO, 8 )
433424   ADDRESS_MAP_GLOBAL_MASK(0xff)
434   AM_RANGE(0x00, 0x03) AM_MIRROR(0x7c) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
435   AM_RANGE(0x80, 0x83) AM_MIRROR(0x7c) AM_READWRITE(sio_r, sio_w)
425   AM_RANGE(0x00, 0x03) AM_MIRROR(0x7c) AM_DEVREADWRITE(Z80CTC, "ctc", z80ctc_r, z80ctc_w)
426   AM_RANGE(0x80, 0x83) AM_MIRROR(0x7c) AM_DEVREADWRITE(Z80SIO, "sio", sio_r, sio_w)
436427ADDRESS_MAP_END
437428
438429
r3373r3374
752743   MDRV_CPU_IO_MAP(dleuro_io_map,0)
753744   MDRV_CPU_VBLANK_INT("main", vblank_callback)
754745
746   MDRV_Z80CTC_ADD("ctc", ctc_intf)
747   MDRV_Z80SIO_ADD("sio", sio_intf)
748
755749   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_HZ(MASTER_CLOCK_EURO/(16*16*16*16*16*8)))
756750
757   MDRV_MACHINE_START(dleuro)
751   MDRV_MACHINE_START(dlair)
758752   MDRV_MACHINE_RESET(dlair)
759753
760754   MDRV_LASERDISC_ADD("laserdisc", PHILLIPS_22VP932, "main", "ldsound")
src/mame/drivers/segas16a.c
r3373r3374
182182static READ16_HANDLER( misc_io_r );
183183static WRITE16_HANDLER( misc_io_w );
184184
185static WRITE8_HANDLER( video_control_w );
186static WRITE8_HANDLER( tilemap_sound_w );
185static WRITE8_DEVICE_HANDLER( sound_latch_w );
186static WRITE8_DEVICE_HANDLER( video_control_w );
187static WRITE8_DEVICE_HANDLER( tilemap_sound_w );
187188
188189
189190
r3373r3374
198199   NULL,
199200   NULL,
200201   NULL,
201   soundlatch_w,
202   sound_latch_w,
202203   video_control_w,
203204   tilemap_sound_w
204205};
r3373r3374
259260
260261static TIMER_CALLBACK( delayed_ppi8255_w )
261262{
262   ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), param >> 8, param & 0xff);
263   ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255"), param >> 8, param & 0xff);
263264}
264265
265266
r3373r3374
269270   switch (offset & (0x3000/2))
270271   {
271272      case 0x0000/2:
272         return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), offset & 3);
273         return ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255"), offset & 3);
273274
274275      case 0x1000/2:
275276      {
r3373r3374
326327 *
327328 *************************************/
328329
329static WRITE8_HANDLER( video_control_w )
330static WRITE8_DEVICE_HANDLER( video_control_w )
330331{
331332   /*
332333        PPI port B
r3373r3374
345346   video_control = data;
346347   segaic16_tilemap_set_flip(0, data & 0x80);
347348   segaic16_sprites_set_flip(0, data & 0x80);
348   segaic16_set_display_enable(machine, data & 0x10);
349   segaic16_set_display_enable(device->machine, data & 0x10);
349350   set_led_status(1, data & 0x08);
350351   set_led_status(0, data & 0x04);
351352   coin_counter_w(1, data & 0x02);
r3373r3374
360361 *
361362 *************************************/
362363
363static WRITE8_HANDLER( tilemap_sound_w )
364static WRITE8_DEVICE_HANDLER( sound_latch_w )
364365{
366   soundlatch_w(device->machine, offset, data);
367}
368
369
370static WRITE8_DEVICE_HANDLER( tilemap_sound_w )
371{
365372   /*
366373        PPI port C
367374
r3373r3374
376383             0= Sound is disabled
377384             1= sound is enabled
378385    */
379   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
386   cpunum_set_input_line(device->machine, 1, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
380387   segaic16_tilemap_set_colscroll(0, ~data & 0x04);
381388   segaic16_tilemap_set_rowscroll(0, ~data & 0x02);
382389}
r3373r3374
392399static READ8_HANDLER( sound_data_r )
393400{
394401   /* assert ACK */
395   ppi8255_set_portC(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x00);
402   ppi8255_set_port_c(devtag_get_device(machine, PPI8255, "ppi8255"), 0x00);
396403   return soundlatch_r(machine, offset);
397404}
398405
r3373r3374
17801787   MDRV_MACHINE_RESET(system16a)
17811788   MDRV_NVRAM_HANDLER(system16a)
17821789
1783   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
1784   MDRV_DEVICE_CONFIG( single_ppi_intf )
1790   MDRV_PPI8255_ADD( "ppi8255", single_ppi_intf )
17851791
17861792   /* video hardware */
17871793   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/segahang.c
r3373r3374
5050 *
5151 *************************************/
5252
53static WRITE8_HANDLER( video_lamps_w );
54static WRITE8_HANDLER( tilemap_sound_w );
55static WRITE8_HANDLER( sub_control_adc_w );
53static WRITE8_DEVICE_HANDLER( sound_latch_w );
54static WRITE8_DEVICE_HANDLER( video_lamps_w );
55static WRITE8_DEVICE_HANDLER( tilemap_sound_w );
56static WRITE8_DEVICE_HANDLER( sub_control_adc_w );
5657
57static READ8_HANDLER( adc_status_r );
58static READ8_DEVICE_HANDLER( adc_status_r );
5859
5960
6061
r3373r3374
7071      NULL,
7172      NULL,
7273      NULL,
73      soundlatch_w,
74      sound_latch_w,
7475      video_lamps_w,
7576      tilemap_sound_w
7677   },
r3373r3374
145146
146147static TIMER_CALLBACK( delayed_ppi8255_w )
147148{
148   ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), param >> 8, param & 0xff);
149   ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_0"), param >> 8, param & 0xff);
149150}
150151
151152
r3373r3374
154155   switch (offset & 0x3020/2)
155156   {
156157      case 0x0000/2: /* PPI @ 4B */
157         return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset & 3);
158         return ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_0"), offset & 3);
158159
159160      case 0x1000/2: /* Input ports and DIP switches */
160161      {
r3373r3374
163164      }
164165
165166      case 0x3000/2: /* PPI @ 4C */
166         return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset & 3);
167         return ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_1"), offset & 3);
167168
168169      case 0x3020/2: /* ADC0804 data output */
169170      {
r3373r3374
189190            return;
190191
191192         case 0x3000/2: /* PPI @ 4C */
192            ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset & 3, data & 0xff);
193            ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_1"), offset & 3, data & 0xff);
193194            return;
194195
195196         case 0x3020/2: /* ADC0804 */
r3373r3374
205206   switch (offset & 0x0030/2)
206207   {
207208      case 0x0000/2:
208         return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), offset & 3);
209         return ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_0"), offset & 3);
209210
210211      case 0x0010/2: /* Input ports and DIP switches */
211212      {
r3373r3374
215216
216217      case 0x0020/2: /* PPI @ 4C */
217218         if (offset == 2) return 0;
218         return ppi8255_r(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset & 3);
219         return ppi8255_r(devtag_get_device(machine, PPI8255, "ppi8255_1"), offset & 3);
219220
220221      case 0x0030/2: /* ADC0804 data output */
221222      {
r3373r3374
241242            return;
242243
243244         case 0x0020/2: /* PPI @ 4C */
244            ppi8255_w(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_1" ), offset & 3, data & 0xff);
245            ppi8255_w(devtag_get_device(machine, PPI8255, "ppi8255_1"), offset & 3, data & 0xff);
245246            return;
246247
247248         case 0x0030/2: /* ADC0804 */
r3373r3374
259260 *
260261 *************************************/
261262
262static WRITE8_HANDLER( video_lamps_w )
263static WRITE8_DEVICE_HANDLER( sound_latch_w )
263264{
265   soundlatch_w(device->machine, offset, data);
266}
267
268
269static WRITE8_DEVICE_HANDLER( video_lamps_w )
270{
264271   /* Port B : Miscellaneous outputs */
265272   /* D7 : FLIPC (1= flip screen, 0= normal orientation) */
266273   /* D6 : SHADE0 (1= highlight, 0= shadow) */
r3373r3374
272279   segaic16_tilemap_set_flip(0, data & 0x80);
273280   segaic16_sprites_set_flip(0, data & 0x80);
274281   segaic16_sprites_set_shadow(0, ~data & 0x40);
275   segaic16_set_display_enable(machine, data & 0x10);
282   segaic16_set_display_enable(device->machine, data & 0x10);
276283   set_led_status(1, data & 0x08);
277284   set_led_status(0, data & 0x04);
278285   coin_counter_w(1, data & 0x02);
r3373r3374
280287}
281288
282289
283static WRITE8_HANDLER( tilemap_sound_w )
290static WRITE8_DEVICE_HANDLER( tilemap_sound_w )
284291{
285292   /* Port C : Tilemap origin and audio mute */
286293   /* D7 : Port A handshaking signal /OBF */
r3373r3374
291298   /* D2 : SCONT1 - Tilemap origin bit 1 */
292299   /* D1 : SCONT0 - Tilemap origin bit 0 */
293300   /* D0 : MUTE (1= audio on, 0= audio off) */
294   cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
301   cpunum_set_input_line(device->machine, 2, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
295302   segaic16_tilemap_set_colscroll(0, ~data & 0x04);
296303   segaic16_tilemap_set_rowscroll(0, ~data & 0x02);
297304   sound_global_enable(data & 0x01);
298305}
299306
300307
301static WRITE8_HANDLER( sub_control_adc_w )
308static WRITE8_DEVICE_HANDLER( sub_control_adc_w )
302309{
303310   /* Port A : S.CPU control and ADC channel select */
304311   /* D6 : INTR line on second CPU */
305312   /* D5 : RESET line on second CPU */
306313   /* D3-D2 : ADC_SELECT */
307   cpunum_set_input_line(machine, 1, 4, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
308   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
314   cpunum_set_input_line(device->machine, 1, 4, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
315   cpunum_set_input_line(device->machine, 1, INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
309316   adc_select = (data >> 2) & 3;
310317}
311318
312319
313static READ8_HANDLER( adc_status_r )
320static READ8_DEVICE_HANDLER( adc_status_r )
314321{
315322   /* D7 = 0 (left open) */
316323   /* D6 = /INTR of ADC0804 */
r3373r3374
365372static READ8_HANDLER( sound_data_r )
366373{
367374   /* assert ACK */
368   ppi8255_set_portC(device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255_0" ), 0x00);
375   ppi8255_set_port_c(devtag_get_device(machine, PPI8255, "ppi8255_0"), 0x00);
369376   return soundlatch_r(machine, offset);
370377}
371378
r3373r3374
880887   MDRV_MACHINE_RESET(hangon)
881888   MDRV_INTERLEAVE(100)
882889
883   MDRV_DEVICE_ADD( "ppi8255_0", PPI8255 )
884   MDRV_DEVICE_CONFIG( hangon_ppi_intf[0] )
890   MDRV_PPI8255_ADD( "ppi8255_0", hangon_ppi_intf[0] )
891   MDRV_PPI8255_ADD( "ppi8255_1", hangon_ppi_intf[1] )
885892
886   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
887   MDRV_DEVICE_CONFIG( hangon_ppi_intf[1] )
888
889893   /* video hardware */
890894   MDRV_GFXDECODE(segahang)
891895   MDRV_PALETTE_LENGTH(2048*3)
src/mame/drivers/gpworld.c
r3373r3374
203203
204204static VIDEO_UPDATE( gpworld )
205205{
206   render_container_set_palette_alpha(render_container_get_screen(screen), 0, 0x00);
207
208206   fillbitmap(bitmap, 0, cliprect);
209207
210208   gpworld_draw_tiles(screen->machine, bitmap, cliprect);
r3373r3374
245243static WRITE8_HANDLER( palette_write )
246244{
247245   /* This is all just a (bad) guess */
248   int pal_index, r, g, b;
246   int pal_index, r, g, b, a;
249247
250248   palette_RAM[offset] = data;
251249
r3373r3374
255253   b = (palette_RAM[pal_index]   & 0xf0) << 0;
256254   g = (palette_RAM[pal_index]   & 0x0f) << 4;
257255   r = (palette_RAM[pal_index+1] & 0x0f) << 4;
258   /* int dunno = (palette_RAM[pal_index+1] & 0x80) >> 7; */
256   a = (palette_RAM[pal_index+1] & 0x80) ? 0 : 255;   /* guess */
259257
260258   /* logerror("PAL WRITE index : %x  rgb : %d %d %d (real %x) at %x\n", pal_index, r,g,b, data, offset); */
261259
262   palette_set_color(machine, pal_index, MAKE_RGB(r, g, b));
260   palette_set_color(machine, pal_index, MAKE_ARGB(a, r, g, b));
263261}
264262
265263/* PROGRAM MAP */
src/mame/drivers/imolagp.c
r3373r3374
417417
418418   MDRV_INTERLEAVE(100)
419419
420   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
421   MDRV_DEVICE_CONFIG( ppi8255_intf )
420   MDRV_PPI8255_ADD( "ppi8255", ppi8255_intf )
422421
423422   MDRV_SCREEN_ADD("main", RASTER)
424423   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/segald.c
r3373r3374
8080
8181static VIDEO_UPDATE( astron )
8282{
83   render_container_set_palette_alpha(render_container_get_screen(screen), 0, 0x00);
84
8583   fillbitmap(bitmap, 0, cliprect);
8684
8785   astron_draw_characters(screen->machine, bitmap, cliprect);
r3373r3374
178176
179177static WRITE8_HANDLER( astron_COLOR_write )
180178{
181   UINT8 r, g, b;
179   UINT8 r, g, b, a;
182180   UINT8 highBits, lowBits;
183181   const UINT8 palIndex = offset >> 1;
184182
r3373r3374
193191   r = (lowBits  & 0x0f);
194192   g = (lowBits  & 0xf0) >> 4;
195193   b = (highBits & 0x0f);
194   a = (highBits & 0x80) ? 0 : 255;
196195
197   /* palette_set_color(machine, palIndex, r, g, b); */
196   palette_set_color(machine, palIndex, MAKE_ARGB(a, r, g, b));
198197   logerror("COLOR write : 0x%04x @   0x%04x [0x%x]\n", data, offset, activecpu_get_pc());
199198}
200199
src/mame/drivers/homerun.c
r3373r3374
3030VIDEO_START(homerun);
3131VIDEO_UPDATE(homerun);
3232
33static WRITE8_HANDLER(pa_w){homerun_xpa=data;}
34static WRITE8_HANDLER(pb_w){homerun_xpb=data;}
35static WRITE8_HANDLER(pc_w){homerun_xpc=data;}
33static WRITE8_DEVICE_HANDLER(pa_w){homerun_xpa=data;}
34static WRITE8_DEVICE_HANDLER(pb_w){homerun_xpb=data;}
35static WRITE8_DEVICE_HANDLER(pc_w){homerun_xpc=data;}
3636
3737static const ppi8255_interface ppi8255_intf =
3838{
r3373r3374
194194
195195   MDRV_MACHINE_RESET(homerun)
196196
197   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
198   MDRV_DEVICE_CONFIG( ppi8255_intf )
197   MDRV_PPI8255_ADD( "ppi8255", ppi8255_intf )
199198
200199   /* video hardware */
201200   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/mcr.c
r3373r3374
498498 *
499499 *************************************/
500500
501WRITE8_HANDLER( mcr_ipu_sio_transmit )
501WRITE8_DEVICE_HANDLER( mcr_ipu_sio_transmit )
502502{
503503   logerror("ipu_sio_transmit: %02X\n", data);
504504
r3373r3374
531531
532532static WRITE8_HANDLER( nflfoot_op4_w )
533533{
534   const device_config *sio = devtag_get_device(machine, Z80SIO, "ipu_sio");
535
534536   /* bit 7 = J3-7 on IPU board = /RXDA on SIO */
535537   logerror("%04X:op4_w(%d%d%d)\n", activecpu_get_pc(), (data >> 7) & 1, (data >> 6) & 1, (data >> 5) & 1);
536538
r3373r3374
559561      {
560562         logerror(" -- stop bit = %d; final value = %02X\n", (data >> 7) & 1, nflfoot_serial_out_bits);
561563         nflfoot_serial_out_active = FALSE;
562         z80sio_receive_data(0, 0, nflfoot_serial_out_bits);
564         z80sio_receive_data(sio, 0, nflfoot_serial_out_bits);
563565      }
564566   }
565567
566568   /* bit 6 = J3-3 on IPU board = CTSA on SIO */
567   z80sio_set_cts(0, 0, (data >> 6) & 1);
569   z80sio_set_cts(sio, 0, (data >> 6) & 1);
568570
569571   /* bit 4 = SEL0 (J1-8) on squawk n talk board */
570572   /* bits 3-0 = MD3-0 connected to squawk n talk (J1-4,3,2,1) */
r3373r3374
624626   SSIO_INPUT_PORTS
625627   AM_RANGE(0xe0, 0xe0) AM_WRITE(watchdog_reset_w)
626628   AM_RANGE(0xe8, 0xe8) AM_WRITE(SMH_NOP)
627   AM_RANGE(0xf0, 0xf3) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
629   AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE(Z80CTC, "ctc", z80ctc_r, z80ctc_w)
628630ADDRESS_MAP_END
629631
630632
r3373r3374
651653   SSIO_INPUT_PORTS
652654   AM_RANGE(0xe0, 0xe0) AM_WRITE(watchdog_reset_w)
653655   AM_RANGE(0xe8, 0xe8) AM_WRITE(SMH_NOP)
654   AM_RANGE(0xf0, 0xf3) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
656   AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE(Z80CTC, "ctc", z80ctc_r, z80ctc_w)
655657ADDRESS_MAP_END
656658
657659
r3373r3374
679681   SSIO_INPUT_PORTS
680682   AM_RANGE(0xe0, 0xe0) AM_WRITE(watchdog_reset_w)
681683   AM_RANGE(0xe8, 0xe8) AM_WRITE(SMH_NOP)
682   AM_RANGE(0xf0, 0xf3) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
684   AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE(Z80CTC, "ctc", z80ctc_r, z80ctc_w)
683685ADDRESS_MAP_END
684686
685687
r3373r3374
701703static ADDRESS_MAP_START( ipu_91695_portmap, ADDRESS_SPACE_IO, 8 )
702704   ADDRESS_MAP_UNMAP_HIGH
703705   ADDRESS_MAP_GLOBAL_MASK(0xff)
704   AM_RANGE(0x00, 0x03) AM_MIRROR(0xe0) AM_READWRITE(mcr_ipu_pio_0_r, mcr_ipu_pio_0_w)
705   AM_RANGE(0x04, 0x07) AM_MIRROR(0xe0) AM_READWRITE(mcr_ipu_sio_r, mcr_ipu_sio_w)
706   AM_RANGE(0x08, 0x0b) AM_MIRROR(0xe0) AM_READWRITE(z80ctc_1_r, z80ctc_1_w)
707   AM_RANGE(0x0c, 0x0f) AM_MIRROR(0xe0) AM_READWRITE(mcr_ipu_pio_1_r, mcr_ipu_pio_1_w)
706   AM_RANGE(0x00, 0x03) AM_MIRROR(0xe0) AM_DEVREADWRITE(Z80PIO, "ipu_pio0", z80pio_r, z80pio_w)
707   AM_RANGE(0x04, 0x07) AM_MIRROR(0xe0) AM_DEVREADWRITE(Z80SIO, "ipu_sio", mcr_ipu_sio_r, mcr_ipu_sio_w)
708   AM_RANGE(0x08, 0x0b) AM_MIRROR(0xe0) AM_DEVREADWRITE(Z80CTC, "ipu_ctc", z80ctc_r, z80ctc_w)
709   AM_RANGE(0x0c, 0x0f) AM_MIRROR(0xe0) AM_DEVREADWRITE(Z80PIO, "ipu_pio1", z80pio_r, z80pio_w)
708710   AM_RANGE(0x10, 0x13) AM_MIRROR(0xe0) AM_WRITE(mcr_ipu_laserdisk_w)
709711   AM_RANGE(0x1c, 0x1f) AM_MIRROR(0xe0) AM_READWRITE(mcr_ipu_watchdog_r, mcr_ipu_watchdog_w)
710712ADDRESS_MAP_END
r3373r3374
15141516   MDRV_CPU_IO_MAP(cpu_90009_portmap,0)
15151517   MDRV_CPU_VBLANK_INT_HACK(mcr_interrupt,2)
15161518
1519   MDRV_Z80CTC_ADD("ctc", mcr_ctc_intf)
1520
15171521   MDRV_WATCHDOG_VBLANK_INIT(16)
15181522   MDRV_MACHINE_START(mcr)
15191523   MDRV_MACHINE_RESET(mcr)
r3373r3374
16011605   MDRV_CPU_PROGRAM_MAP(ipu_91695_map,0)
16021606   MDRV_CPU_IO_MAP(ipu_91695_portmap,0)
16031607   MDRV_CPU_VBLANK_INT_HACK(mcr_ipu_interrupt,2)
1608
1609   MDRV_Z80CTC_ADD("ipu_ctc", nflfoot_ctc_intf)
1610   MDRV_Z80PIO_ADD("ipu_pio0", nflfoot_pio_intf)
1611   MDRV_Z80PIO_ADD("ipu_pio1", nflfoot_pio_intf)
1612   MDRV_Z80SIO_ADD("ipu_sio", nflfoot_sio_intf)
16041613MACHINE_DRIVER_END
16051614
16061615
src/mame/drivers/chqflag.c
r3373r3374
105105
106106      /* only affect the background */
107107      for (i = 512;i < 1024;i++)
108         palette_set_brightness(machine,i,brt);
108         palette_set_pen_contrast(machine,i,brt);
109109   }
110110
111111//if ((data & 0xf8) && (data & 0xf8) != 0x88)
src/mame/drivers/cubeqst.c
r3373r3374
8181{
8282   video_field = 0;
8383   depth_buffer = auto_malloc(512);
84
85   render_container_set_palette_alpha(render_container_get_screen(machine->primary_screen), ALPHA_PEN, 0);
8684}
8785
8886/* TODO: Use resistor values */
r3373r3374
10199
102100      palette_set_color_rgb(machine, i, y*r, y*g, y*b);
103101   }
102
103   /* use pen 8192 for transparent */
104   palette_set_color(machine, 8192, MAKE_ARGB(0,0,0,0));
104105}
105106
106107/* TODO: This is a simplified version of what actually happens */
src/tools/ldverify.c
r3373r3374
4747    GLOBAL VARIABLES
4848***************************************************************************/
4949
50static UINT8 *chdbuffer;
5150static UINT8 chdinterlaced;
5251
5352static int video_first_whitefield = -1;
r3373r3374
213212      info->height *= 2;
214213   }
215214
216   /* allocate a buffer */
217   chdbuffer = malloc(chd_get_header(chd)->hunkbytes);
218   if (chdbuffer == NULL)
219   {
220      fprintf(stderr, "Out of memory allocating chd buffer\n");
221      chd_close(chd);
222      return NULL;
223   }
224
225215   return chd;
226216}
227217
r3373r3374
232222
233223static int read_chd(void *file, int frame, bitmap_t *bitmap, INT16 *lsound, INT16 *rsound, int *samples)
234224{
225   av_codec_decompress_config avconfig = { 0 };
235226   int interlace_factor = chdinterlaced ? 2 : 1;
236   int fieldnum, chnum, sampnum, x, y;
237   int channels, width, height;
227   bitmap_t fakebitmap;
228   UINT32 numsamples;
238229   chd_error chderr;
239   UINT8 *source;
230   int fieldnum;
240231
241232   /* loop over fields */
242233   *samples = 0;
243234   for (fieldnum = 0; fieldnum < interlace_factor; fieldnum++)
244235   {
245      int startsamples = *samples;
236      /* make a fake bitmap for this field */
237      fakebitmap = *bitmap;
238      fakebitmap.base = BITMAP_ADDR16(&fakebitmap, fieldnum, 0);
239      fakebitmap.rowpixels *= interlace_factor;
240      fakebitmap.height /= interlace_factor;
246241
242      /* configure the codec */
243      avconfig.video = &fakebitmap;
244      avconfig.maxsamples = 48000;
245      avconfig.actsamples = &numsamples;
246      avconfig.audio[0] = &lsound[*samples];
247      avconfig.audio[1] = &rsound[*samples];
248
249      /* configure the decompressor for this frame */
250      chd_codec_config(file, AV_CODEC_DECOMPRESS_CONFIG, &avconfig);
251
247252      /* read the frame */
248      chderr = chd_read(file, frame * interlace_factor + fieldnum, chdbuffer);
253      chderr = chd_read(file, frame * interlace_factor + fieldnum, NULL);
249254      if (chderr != CHDERR_NONE)
250255         return FALSE;
251256
252      /* parse out the info */
253      channels = chdbuffer[5];
254      *samples += (chdbuffer[6] << 8) | chdbuffer[7];
255      width = (chdbuffer[8] << 8) | chdbuffer[9];
256      height = ((chdbuffer[10] << 8) | chdbuffer[11]) & 0x7fff;
257      source = chdbuffer + 12 + chdbuffer[4];
258
259      /* make sure the data makes sense */
260      if (width != bitmap->width || height != bitmap->height / interlace_factor)
261      {
262         fprintf(stderr, "Inconsistent frame width/height!\n");
263         return FALSE;
264      }
265
266      /* copy in sample data */
267      for (chnum = 0; chnum < channels; chnum++)
268      {
269         INT16 *dest = (chnum == 0) ? lsound : rsound;
270         for (sampnum = startsamples; sampnum < *samples; sampnum++)
271         {
272            INT16 sample = *source++ << 8;
273            dest[sampnum] = sample | *source++;
274         }
275      }
276
277      /* copy in the bitmap data */
278      for (y = fieldnum; y < height * interlace_factor; y += interlace_factor)
279      {
280         UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
281         for (x = 0; x < width; x++)
282         {
283            UINT16 pixel = *source++;
284            *dest++ = pixel | (*source++ << 8);
285         }
286      }
257      /* account for samples read */
258      *samples += numsamples;
287259   }
288260   return TRUE;
289261}
r3373r3374
295267
296268static void close_chd(void *file)
297269{
298   if (chdbuffer != NULL)
299      free(chdbuffer);
300270   chd_close(file);
301271}
302272
r3373r3374
341311      }
342312
343313      /* is this a lead-in code? */
344      if (metadata.line1718 == 0x88ffff)
314      if (metadata.line1718 == VBI_CODE_LEADIN)
345315      {
346316         /* if we haven't seen lead-in yet, detect it */
347317         if (!video_saw_leadin)
r3373r3374
356326      }
357327
358328      /* is this a lead-out code? */
359      if (metadata.line1718 == 0x80eeee)
329      if (metadata.line1718 == VBI_CODE_LEADOUT)
360330      {
361331         /* if we haven't seen lead-in yet, detect it */
362332         if (!video_saw_leadout)
r3373r3374
375345      }
376346
377347      /* is this a frame code? */
378      if ((metadata.line1718 & 0xf80000) == 0xf80000)
348      if ((metadata.line1718 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE)
379349      {
380         int framenum = ((metadata.line1718 >> 0) & 15) * 1 + ((metadata.line1718 >> 4) & 15) * 10 + ((metadata.line1718 >> 8) & 15) * 100 + ((metadata.line1718 >> 12) & 15) * 1000 + ((metadata.line1718 >> 16) & 7) * 10000;
350         int framenum = VBI_CAV_PICTURE(metadata.line1718);
381351
382352         /* did we see any leadin? */
383353         if (!video_saw_leadin)
r3373r3374
407377
408378         /* remember the frame number */
409379         video_last_frame = framenum;
380
381         /* if we've seen a white flag before, but it's not here, warn */
382         if (video_first_whitefield != -1 && !metadata.white)
383               printf("%6d.%d: detected frame number but no white flag (WARNING)\n", frame, fieldnum);
410384      }
411385
412386      /* is the whiteflag set? */
r3373r3374
419393             printf("%6d.%d: first white flag seen\n", frame, fieldnum);
420394          }
421395
396         /* if we've seen frame numbers before, but not here, warn */
397         if (video_last_frame != -1 && (metadata.line1718 & VBI_MASK_CAV_PICTURE) != VBI_CODE_CAV_PICTURE)
398               printf("%6d.%d: detected white flag but no frame number (WARNING)\n", frame, fieldnum);
399       }
400
401       /* if this is the start of a frame, handle cadence */
402       if (metadata.white || (metadata.line1718 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE)
403       {
422404          /* if we've seen frames, but we're not yet to the lead-out, check the cadence */
423405          if (video_last_frame != -1 && !video_saw_leadout)
424406          {
r3373r3374
490472
491473        /* remove the top/bottom 0.1% of Y */
492474        remaining = pixels / 1000;
493        for (yminval = 0; remaining >= 0; yminval++)
494           remaining -= yhisto[yminval];
475        for (yminval = 0; (remaining -= yhisto[yminval]) >= 0; yminval++) ;
495476        remaining = pixels / 1000;
496        for (ymaxval = 255; remaining >= 0; ymaxval--)
497           remaining -= yhisto[ymaxval];
477        for (ymaxval = 255; (remaining -= yhisto[ymaxval]) >= 0; ymaxval--) ;
498478
499479        /* remove the top/bottom 0.1% of Cb */
500480        remaining = pixels / 500;
501        for (cbminval = 0; remaining >= 0; cbminval++)
502           remaining -= cbhisto[cbminval];
481        for (cbminval = 0; (remaining -= cbhisto[cbminval]) >= 0; cbminval++) ;
503482        remaining = pixels / 500;
504        for (cbmaxval = 255; remaining >= 0; cbmaxval--)
505           remaining -= cbhisto[cbmaxval];
483        for (cbmaxval = 255; (remaining -= cbhisto[cbmaxval]) >= 0; cbmaxval--) ;
506484
507485        /* remove the top/bottom 0.1% of Cr */
508486        remaining = pixels / 500;
509        for (crminval = 0; remaining >= 0; crminval++)
510           remaining -= crhisto[crminval];
487        for (crminval = 0; (remaining -= crhisto[crminval]) >= 0; crminval++) ;
511488        remaining = pixels / 500;
512        for (crmaxval = 255; remaining >= 0; crmaxval--)
513           remaining -= crhisto[crmaxval];
489        for (crmaxval = 255; (remaining -= crhisto[crmaxval]) >= 0; crmaxval--) ;
514490
515491        /* track blank frames */
516492      if (ymaxval - yminval < 10 && cbmaxval - cbminval < 10 && crmaxval - cbmaxval < 10)
r3373r3374
535511        video_max_overall = MAX(ymaxval, video_max_overall);
536512
537513        /* track low fields */
538        if (yminval < 16)
514        if (yminval <= 0)
539515        {
540516           if (video_first_low_frame == -1)
541517           {
r3373r3374
552528        }
553529
554530        /* track high fields */
555        if (ymaxval > 236)
531        if (ymaxval >= 255)
556532        {
557533           if (video_first_high_frame == -1)
558534           {
r3373r3374
582558
583559   /* did we ever see any white flags? */
584560   if (video_first_whitefield == -1)
585      printf("Track %6d.%d: never saw any white flags; no cadence detection done (WARNING)\n", field / fields_per_frame, 0);
561      printf("Track %6d.%d: never saw any white flags (WARNING)\n", field / fields_per_frame, 0);
586562
587563    /* did we ever see any lead-out? */
588564   if (!video_saw_leadout)
src/osd/windows/window.c
r3373r3374
605605   window->render_lock = osd_lock_alloc();
606606
607607   // load the layout
608   window->target = render_target_alloc(NULL, 0);
608   window->target = render_target_alloc(machine, NULL, 0);
609609   if (window->target == NULL)
610610      fatalerror("Error creating render target for window %d", index);
611611
src/emu/cpu/m68000/m68kcpu.h
r3373r3374
333333#define FLAG_INT_MASK    m68ki_cpu.int_mask
334334
335335#define CPU_INT_LEVEL    m68ki_cpu.int_level /* ASG: changed from CPU_INTS_PENDING */
336#define CPU_INT_CYCLES   m68ki_cpu.int_cycles /* ASG */
337336#define CPU_STOPPED      m68ki_cpu.stopped
338337#define CPU_PREF_ADDR    m68ki_cpu.pref_addr
339338#define CPU_PREF_DATA    m68ki_cpu.pref_data
r3373r3374
562561         if(CPU_STOPPED) \
563562         { \
564563            SET_CYCLES(0); \
565            CPU_INT_CYCLES = 0; \
566564            return m68ki_initial_cycles; \
567565         } \
568566      }
r3373r3374
877875   uint c_flag;       /* Carry */
878876   uint int_mask;     /* I0-I2 */
879877   uint int_level;    /* State of interrupt pins IPL0-IPL2 -- ASG: changed from ints_pending */
880   uint int_cycles;   /* ASG: extra cycles from generated interrupts */
881878   uint stopped;      /* Stopped state */
882879   uint pref_addr;    /* Last prefetch address */
883880   uint pref_data;    /* Data in the prefetch queue */
r3373r3374
899896
900897   /* Virtual IRQ lines state */
901898   uint virq_state;
899   uint nmi_pending;
902900
903901   const uint8* cyc_instruction;
904902   const uint8* cyc_exception;
r3373r3374
20262024   m68ki_jump(new_pc);
20272025
20282026   /* Defer cycle counting until later */
2029   CPU_INT_CYCLES += CYC_EXCEPTION[vector];
2027   USE_CYCLES(CYC_EXCEPTION[vector]);
20302028
20312029#if !M68K_EMULATE_INT_ACK
20322030   /* Automatically clear IRQ if we are not using an acknowledge scheme */
r3373r3374
20382036/* ASG: Check for interrupts */
20392037INLINE void m68ki_check_interrupts(void)
20402038{
2041   if(CPU_INT_LEVEL > FLAG_INT_MASK)
2039   if(m68ki_cpu.nmi_pending)
2040   {
2041      m68ki_cpu.nmi_pending = FALSE;
2042      m68ki_exception_interrupt(7);
2043   }
2044   else if(CPU_INT_LEVEL > FLAG_INT_MASK)
20422045      m68ki_exception_interrupt(CPU_INT_LEVEL>>8);
20432046}
20442047
src/emu/cpu/m68000/m68kcpu.c
r3373r3374
783783/* ASG: removed per-instruction interrupt checks */
784784int m68k_execute(int num_cycles)
785785{
786   /* Set our pool of clock cycles available */
787   SET_CYCLES(num_cycles);
788   m68ki_initial_cycles = num_cycles;
789
790   /* See if interrupts came in */
791   m68ki_check_interrupts();
792
786793   /* Make sure we're not stopped */
787794   if(!CPU_STOPPED)
788795   {
789      /* Set our pool of clock cycles available */
790      SET_CYCLES(num_cycles);
791      m68ki_initial_cycles = num_cycles;
792
793      /* ASG: update cycles */
794      USE_CYCLES(CPU_INT_CYCLES);
795      CPU_INT_CYCLES = 0;
796
797796      /* Return point if we had an address error */
798797      m68ki_set_address_error_trap(); /* auto-disable (see m68kcpu.h) */
799798
r3373r3374
823822
824823      /* set previous PC to current PC for the next entry into the loop */
825824      REG_PPC = REG_PC;
826
827      /* ASG: update cycles */
828      USE_CYCLES(CPU_INT_CYCLES);
829      CPU_INT_CYCLES = 0;
830
831      /* return how many clocks we used */
832      return m68ki_initial_cycles - GET_CYCLES();
833825   }
826   else
827      SET_CYCLES(0);
834828
835   /* We get here if the CPU is stopped or halted */
836   SET_CYCLES(0);
837   CPU_INT_CYCLES = 0;
838
839   return num_cycles;
829   /* return how many clocks we used */
830   return m68ki_initial_cycles - GET_CYCLES();
840831}
841832
842833
r3373r3374
877868   /* A transition from < 7 to 7 always interrupts (NMI) */
878869   /* Note: Level 7 can also level trigger like a normal IRQ */
879870   if(old_level != 0x0700 && CPU_INT_LEVEL == 0x0700)
880      m68ki_exception_interrupt(7); /* Edge triggered level 7 (NMI) */
881   else
882      m68ki_check_interrupts(); /* Level triggered (IRQ) */
871      m68ki_cpu.nmi_pending = TRUE;
883872}
884873
885874void m68k_set_virq(unsigned int level, unsigned int active)
r3373r3374
10341023   state_save_register_item(type, index, REG_CAAR);
10351024   state_save_register_item(type, index, m68k_substate.sr);
10361025   state_save_register_item(type, index, CPU_INT_LEVEL);
1037   state_save_register_item(type, index, CPU_INT_CYCLES);
10381026   state_save_register_item(type, index, m68k_substate.stopped);
10391027   state_save_register_item(type, index, m68k_substate.halted);
10401028   state_save_register_item(type, index, CPU_PREF_ADDR);
src/emu/cpu/cubeqcpu/cubeqcpu.c
r3373r3374
15201520               vflag = (((r & 0x7ff) + (s & 0x7ff) + ci) >> 11) ^ cflag;
15211521               break;
15221522            case SUBR:
1523               res = ~r + s + ci;
1523               res = (r ^ 0x0FFF) + s + ci;
15241524               cflag = (res >> 12) & 1;
15251525               vflag = (((s & 0x7ff) + (~r & 0x7ff) + ci) >> 11) ^ cflag;
15261526               break;
15271527            case SUBS:
1528               res = r + ~s + ci;
1528               res = r + (s ^ 0x0FFF) + ci;
15291529               cflag = (res >> 12) & 1;
15301530               vflag = (((r & 0x7ff) + (~s & 0x7ff) + ci) >> 11) ^ cflag;
15311531               break;
src/emu/cpu/dsp56k/dsp56mem.c
r3373r3374
99   IPR = value;
1010}
1111
12static INT8 irqa_ipl(void)  { return ((IPR & 0x0003) >> 0) - 1; }
13static UINT8 irqa_trigger(void) { return (IPR & 0x0004) >> 2; }
14static INT8 irqb_ipl(void)  { return ((IPR & 0x0018) >> 3) - 1; }
15static UINT8 irqb_trigger(void) { return (IPR & 0x0002) >> 5; }
16static INT8 codec_ipl(void) { return ((IPR & 0x00c0) >> 6) - 1;  }
17static INT8 host_ipl(void)  { return ((IPR & 0x0300) >> 8) - 1;  }
18static INT8 ssi0_ipl(void)  { return ((IPR & 0x0c00) >> 10) - 1; }
19static INT8 ssi1_ipl(void)  { return ((IPR & 0x3000) >> 12) - 1; }
20static INT8 tm_ipl(void)    { return ((IPR & 0xc000) >> 14) - 1; }
12static INT8  irqa_ipl(void)      { return ((IPR & 0x0003) >> 0) - 1;  }
13static UINT8 irqa_trigger(void)   { return  (IPR & 0x0004) >> 2;       }
14static INT8  irqb_ipl(void)      { return ((IPR & 0x0018) >> 3) - 1;  }
15static UINT8 irqb_trigger(void)   { return  (IPR & 0x0002) >> 5;       }
16static INT8  codec_ipl(void)   { return ((IPR & 0x00c0) >> 6) - 1;  }
17static INT8  host_ipl(void)      { return ((IPR & 0x0300) >> 8) - 1;  }
18static INT8  ssi0_ipl(void)      { return ((IPR & 0x0c00) >> 10) - 1; }
19static INT8  ssi1_ipl(void)      { return ((IPR & 0x3000) >> 12) - 1; }
20static INT8  tm_ipl(void)      { return ((IPR & 0xc000) >> 14) - 1; }
2121
2222static void mem_reset(void)
2323{
r3373r3374
795795/* BCR */
796796static void BCR_set(UINT16 value)
797797{
798   RH_bit_set((value & 0x0001) >> 15);
799   BS_bit_set((value & 0x0001) >> 14);
798   RH_bit_set((value & 0x8000) >> 15);
799   BS_bit_set((value & 0x4000) >> 14);
800800   external_x_wait_states_set((value & 0x03e0) >> 5);
801801   external_p_wait_states_set((value & 0x001f) >> 0);
802802}
r3373r3374
923923
924924static void dsp56k_io_reset(void)
925925{
926   /* The BCR */
926   /* The BCR = 0x43ff */
927927   RH_bit_set(0);
928928   BS_bit_set(1);
929929   external_x_wait_states_set(0x1f);
src/emu/cpu/dsp56k/dsp56ops.c
r3373r3374
66
77***************************************************************************/
88
9// NOTES For register setting:
10// FM.3-4 : When A2 or B2 is read, the register contents occupy the low-order portion
11//          (bits 7-0) of the word; the high-order portion (bits 16-8) is sign-extended. When A2 or B2
12//          is written, the register receives the low-order portion of the word; the high-order portion is not used
13//        : ...much more!
14//        : ...shifter/limiter/overflow notes too.
15//
16//
17
918// Helper functions and macros
1019#define BITS(CUR,MASK) (Dsp56kOpMask(CUR,MASK))
1120static UINT16 Dsp56kOpMask(UINT16 op, UINT16 mask) ;
src/emu/cpu/dsp56k/dsp56def.h
r3373r3374
7676#define ST15   (SS[15].d)
7777
7878/* 1-25 STATUS REGISTER (SR) BITS */
79/* MR */
7980static UINT8 LF_bit(void);
8081static UINT8 FV_bit(void);
8182//static UINT8 S_bits(void); #define s1BIT ((SR & 0x0800) != 0) #define s0BIT ((SR & 0x0400) != 0)
8283static UINT8 I_bits(void);
84/* CCR */
8385static UINT8 S_bit(void);
8486static UINT8 L_bit(void);
8587static UINT8 E_bit(void);
r3373r3374
8991static UINT8 V_bit(void);
9092static UINT8 C_bit(void);
9193
94/* MR */
9295static void LF_bit_set(UINT8 value);
93//static void FV_bit_set(UINT8 value); #define fvBIT_CLEAR() (SR &= (~0x4000))
94//static void S_bits_set(UINT8 value); #define s1BIT_CLEAR() (SR &= (~0x0800)) #define s0BIT_CLEAR() (SR &= (~0x0400))
95//static void I_bits_set(UINT8 value);
96//static void S_bit_set(UINT8 value); #define sBIT_CLEAR()  (SR &= (~0x0080))
97//static void L_bit_set(UINT8 value); #define lBIT_CLEAR()  (SR &= (~0x0040))
98//static void E_bit_set(UINT8 value); #define eBIT_CLEAR()  (SR &= (~0x0020))
99//static void U_bit_set(UINT8 value); #define uBIT_CLEAR()  (SR &= (~0x0010))
96static void FV_bit_set(UINT8 value);
97static void S_bits_set(UINT8 value);
98static void I_bits_set(UINT8 value);
99/* CCR */
100static void S_bit_set(UINT8 value);
101static void L_bit_set(UINT8 value);
102static void E_bit_set(UINT8 value);
103static void U_bit_set(UINT8 value);
100104static void N_bit_set(UINT8 value);
101105static void Z_bit_set(UINT8 value);
102106static void V_bit_set(UINT8 value);
r3373r3374
113117static UINT8 MB_bit(void);
114118static UINT8 MA_bit(void);
115119
116//static UINT8 CD_bit_set(UINT8 value); #define cdBIT_CLEAR() (OMR &= (~0x0080))
117//static UINT8 SD_bit_set(UINT8 value); #define sdBIT_CLEAR() (OMR &= (~0x0040))
118//static UINT8 R_bit_set(UINT8 value);  #define rBIT_CLEAR()  (OMR &= (~0x0020))
119//static UINT8 SA_bit_set(UINT8 value); #define saBIT_CLEAR() (OMR &= (~0x0010))
120static void CD_bit_set(UINT8 value);
121static void SD_bit_set(UINT8 value);
122static void R_bit_set(UINT8 value);
123static void SA_bit_set(UINT8 value);
120124static void MC_bit_set(UINT8 value);
121125static void MB_bit_set(UINT8 value);
122126static void MA_bit_set(UINT8 value);
r3373r3374
380384
381385/* Port C Dtaa Register (PCD) */
382386static void PCD_set(UINT16 value);
387
src/emu/cpu/dsp56k/dsp56pcu.c
r3373r3374
1818   SR &= ~(0x8000);
1919   SR |=  (value << 15);
2020}
21//static UINT8 I_bits_set(void) {    }
21static void FV_bit_set(UINT8 value)
22{
23   value = value & 0x01;
24   SR &= ~(0x4000);
25   SR |=  (value << 14);
26}
27static void S_bits_set(UINT8 value)
28{
29   value = value & 0x03;
30   SR &= ~(0x0c00);
31   SR |=  (value << 10);
32}
33static void I_bits_set(UINT8 value)
34{
35   value = value & 0x03;
36   SR &= ~(0x0300);
37   SR |=  (value << 8);
38}
39static void S_bit_set(UINT8 value)
40{
41   value = value & 0x01;
42   SR &= ~(0x0080);
43   SR |=  (value << 7);
44}
45static void L_bit_set(UINT8 value)
46{
47   value = value & 0x01;
48   SR &= ~(0x0040);
49   SR |=  (value << 6);
50}
51static void E_bit_set(UINT8 value)
52{
53   value = value & 0x01;
54   SR &= ~(0x0020);
55   SR |=  (value << 5);
56}
57static void U_bit_set(UINT8 value)
58{
59   value = value & 0x01;
60   SR &= ~(0x0010);
61   SR |=  (value << 4);
62}
2263static void N_bit_set(UINT8 value)
2364{
2465   value = value & 0x01;
r3373r3374
4990static UINT8 MB_bit(void) { return ((OMR & 0x0002) != 0); } // #define mbBIT ((OMR & 0x0002) != 0)
5091static UINT8 MA_bit(void) { return ((OMR & 0x0001) != 0); } // #define maBIT ((OMR & 0x0001) != 0)
5192
52static void MC_bit_set(UINT8 value) { if (value) (OMR |= 0x0004); else (OMR &= (~0x0004)); } //#define mcBIT_CLEAR() (OMR &= (~0x0004)) //#define mcBIT_SET() (OMR |= 0x0004)
53static void MB_bit_set(UINT8 value) { if (value) (OMR |= 0x0002); else (OMR &= (~0x0002)); } //#define mbBIT_CLEAR() (OMR &= (~0x0002)) //#define mbBIT_SET() (OMR |= 0x0002)
54static void MA_bit_set(UINT8 value) { if (value) (OMR |= 0x0001); else (OMR &= (~0x0001)); } //#define maBIT_CLEAR() (OMR &= (~0x0001)) //#define maBIT_SET() (OMR |= 0x0001)
93static void CD_bit_set(UINT8 value) { if (value) (OMR |= 0x0080); else (OMR &= (~0x0080)); }
94static void SD_bit_set(UINT8 value) { if (value) (OMR |= 0x0040); else (OMR &= (~0x0040)); }
95static void R_bit_set(UINT8 value)  { if (value) (OMR |= 0x0020); else (OMR &= (~0x0020)); }
96static void SA_bit_set(UINT8 value) { if (value) (OMR |= 0x0010); else (OMR &= (~0x0010)); }
97static void MC_bit_set(UINT8 value) { if (value) (OMR |= 0x0004); else (OMR &= (~0x0004)); }
98static void MB_bit_set(UINT8 value) { if (value) (OMR |= 0x0002); else (OMR &= (~0x0002)); }
99static void MA_bit_set(UINT8 value) { if (value) (OMR |= 0x0001); else (OMR &= (~0x0001)); }
55100
56101
57102/* Stack Pointer */
r3373r3374
165210   // 1-17 Clear Interrupt Priority Register (IPR)
166211   IPR = 0x0000;
167212
213   // FM.5-4
214//  I_bits_set(0x03); This is what the manual says, but i'm dubious!  Polygonet's HI interrupt wouldn't happen with the I bits set.
215   I_bits_set(0x00);
216   S_bits_set(0);
217   L_bit_set(0);
218   S_bit_set(0);
219   FV_bit_set(0);
220
221   // FM.7-25
222   E_bit_set(0);
223   U_bit_set(0);
224   N_bit_set(0);
225   V_bit_set(0);
226   Z_bit_set(0);
227
228   // FM.5-4+
229   C_bit_set(0);
230   LF_bit_set(0);
231   SP = 0x0000;
232
233   // FM.5-14 (OMR)
234   SA_bit_set(0);
235   R_bit_set(0);
236   SD_bit_set(0);
237   CD_bit_set(0);
238
168239   // Clear out the pending interrupt list
169240   dsp56k_clear_pending_interrupts();
170241}
src/emu/cpu/dsp56k/dsp56k.c
r3373r3374
125125   // Used in loop processing
126126   UINT16 temp;
127127
128   // FM.4-5 - hmmm?
129   // UINT8 status;
130
128131   // Basics
129132} dsp56k_agu;
130133
r3373r3374
398401   //core.irq_callback = irqcallback;
399402}
400403
404static void agu_reset(void)
405{
406   // FM.4-3
407   R0 = 0x0000;
408   R1 = 0x0000;
409   R2 = 0x0000;
410   R3 = 0x0000;
411
412   N0 = 0x0000;
413   N1 = 0x0000;
414   N2 = 0x0000;
415   N3 = 0x0000;
416
417   M0 = 0xffff;
418   M1 = 0xffff;
419   M2 = 0xffff;
420   M3 = 0xffff;
421
422   TEMP = 0x0000;
423}
424
425static void alu_reset(void)
426{
427   X = 0x00000000;
428   Y = 0x00000000;
429   A = 0x0000000000;
430   B = 0x0000000000;
431}
432
433
401434static void dsp56k_reset(void)
402435{
403436   logerror("Dsp56k reset\n");
r3373r3374
410443
411444   pcu_reset();
412445   mem_reset();
413   //agu_reset();
414   //alu_reset();
446   agu_reset();
447   alu_reset();
415448
416449   /* HACK - Put a jump to 0x0000 at 0x0000 - this keeps the CPU put in MAME */
417450   program_write_word_16le(0x0000, 0x0124);
src/emu/cpu/z80/z80daisy.c
r3373r3374
2525   z80_daisy_state *head = NULL;
2626   z80_daisy_state **tailptr = &head;
2727
28   /* create a linked list of devices */   
28   /* create a linked list of devices */
2929   for ( ; daisy->devtype != NULL; daisy++)
3030   {
3131      *tailptr = auto_malloc(sizeof(**tailptr));
r3373r3374
3636      (*tailptr)->irq_reti = (z80_daisy_irq_reti)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_IRQ_RETI);
3737      tailptr = &(*tailptr)->next;
3838   }
39   
39
4040   return head;
4141}
4242
src/emu/uigfx.c
r3373r3374
702702      /* allocate new stuff */
703703      state->bitmap = bitmap_alloc(cellxpix * xcells, cellypix * ycells, BITMAP_FORMAT_ARGB32);
704704      state->texture = render_texture_alloc(NULL, NULL);
705      render_texture_set_bitmap(state->texture, state->bitmap, NULL, 0, TEXFORMAT_ARGB32);
705      render_texture_set_bitmap(state->texture, state->bitmap, NULL, TEXFORMAT_ARGB32, NULL);
706706
707707      /* force a redraw */
708708      state->bitmap_dirty = TRUE;
r3373r3374
750750      }
751751
752752      /* reset the texture to force an update */
753      render_texture_set_bitmap(state->texture, state->bitmap, NULL, 0, TEXFORMAT_ARGB32);
753      render_texture_set_bitmap(state->texture, state->bitmap, NULL, TEXFORMAT_ARGB32, NULL);
754754      state->bitmap_dirty = FALSE;
755755   }
756756}
r3373r3374
10341034static void tilemap_update_bitmap(running_machine *machine, ui_gfx_state *state, int width, int height)
10351035{
10361036   bitmap_format screen_format = video_screen_get_format(machine->primary_screen);
1037   palette_t *palette = NULL;
10371038   int screen_texformat;
10381039
10391040   /* convert the screen format to a texture format */
10401041   switch (screen_format)
10411042   {
1042      case BITMAP_FORMAT_INDEXED16:   screen_texformat = TEXFORMAT_PALETTE16;      break;
1043      case BITMAP_FORMAT_RGB15:      screen_texformat = TEXFORMAT_RGB15;         break;
1044      case BITMAP_FORMAT_RGB32:      screen_texformat = TEXFORMAT_RGB32;         break;
1045      default:                  fatalerror("Invalid bitmap format!");      break;
1043      case BITMAP_FORMAT_INDEXED16:   screen_texformat = TEXFORMAT_PALETTE16;   palette = machine->palette;   break;
1044      case BITMAP_FORMAT_RGB15:      screen_texformat = TEXFORMAT_RGB15;      palette = NULL;            break;
1045      case BITMAP_FORMAT_RGB32:      screen_texformat = TEXFORMAT_RGB32;      palette = NULL;            break;
1046      default:                  fatalerror("Invalid bitmap format!");                        break;
10461047   }
10471048
10481049   /* swap the coordinates back if they were talking about a rotated surface */
r3373r3374
10611062      /* allocate new stuff */
10621063      state->bitmap = bitmap_alloc(width, height, screen_format);
10631064      state->texture = render_texture_alloc(NULL, NULL);
1064      render_texture_set_bitmap(state->texture, state->bitmap, NULL, 0, screen_texformat);
1065      render_texture_set_bitmap(state->texture, state->bitmap, NULL, screen_texformat, palette);
10651066
10661067      /* force a redraw */
10671068      state->bitmap_dirty = TRUE;
r3373r3374
10731074      tilemap_draw_by_index(state->bitmap, state->tilemap.which, state->tilemap.xoffs, state->tilemap.yoffs);
10741075
10751076      /* reset the texture to force an update */
1076      render_texture_set_bitmap(state->texture, state->bitmap, NULL, 0, screen_texformat);
1077      render_texture_set_bitmap(state->texture, state->bitmap, NULL, screen_texformat, palette);
10771078      state->bitmap_dirty = FALSE;
10781079   }
10791080}
src/emu/video/tms9928a.c
r3373r3374
392392*/
393393VIDEO_UPDATE( tms9928a )
394394{
395    INT32 BackColour = tms.Regs[7] & 15; if (!BackColour) BackColour=1;
396    palette_set_color(screen->machine, 0, TMS9928A_palette[BackColour]);
395    INT32 BackColour = tms.Regs[7] & 15;
396    rgb_t oldcolor = palette_get_color(screen->machine, 0);
397397
398    if (!BackColour) BackColour=1;
399    /* note we preserve the alpha here; this is so that it can be controlled independently */
400    /* see cliffhgr.c for an example */
401    palette_set_color(screen->machine, 0, (TMS9928A_palette[BackColour] & MAKE_ARGB(0,255,255,255)) | (oldcolor & MAKE_ARGB(255,0,0,0)));
402
398403   if (! (tms.Regs[1] & 0x40))
399404      fillbitmap(bitmap, screen->machine->pens[BackColour], cliprect);
400405   else
src/emu/tilemap.c
r3373r3374
149149/* tile rendering */
150150static void pixmap_update(tilemap *tmap, const rectangle *cliprect);
151151static void tile_update(tilemap *tmap, tilemap_logical_index logindex, UINT32 cached_col, UINT32 cached_row);
152static UINT8 tile_draw(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags);
152static UINT8 tile_draw(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags, UINT8 pen_mask);
153153static UINT8 tile_apply_bitmask(tilemap *tmap, const UINT8 *maskdata, UINT32 x0, UINT32 y0, UINT8 category, UINT8 flags);
154154
155155/* drawing helpers */
r3373r3374
315315   /* set up the tile map callbacks */
316316   tmap->tile_get_info = tile_get_info;
317317
318   /* set up the default pen mask */
319   tmap->tileinfo.pen_mask = 0xff;
320
318321   /* initialize global states */
319322   tmap->enable = TRUE;
320323   tmap->all_tiles_dirty = TRUE;
r3373r3374
12651268   flags = tmap->tileinfo.flags ^ (tmap->attributes & 0x03);
12661269
12671270   /* draw the tile, using either direct or transparent */
1268   tmap->tileflags[logindex] = tile_draw(tmap, tmap->tileinfo.pen_data + tmap->pen_data_offset, x0, y0, tmap->tileinfo.palette_base, tmap->tileinfo.category, tmap->tileinfo.group, flags);
1271   tmap->tileflags[logindex] = tile_draw(tmap, tmap->tileinfo.pen_data + tmap->pen_data_offset, x0, y0,
1272      tmap->tileinfo.palette_base, tmap->tileinfo.category, tmap->tileinfo.group, flags, tmap->tileinfo.pen_mask);
12691273
12701274   /* if mask data is specified, apply it */
12711275   if ((flags & (TILE_FORCE_LAYER0 | TILE_FORCE_LAYER1 | TILE_FORCE_LAYER2)) == 0 && tmap->tileinfo.mask_data != NULL)
r3373r3374
12821286    the palette_base
12831287-------------------------------------------------*/
12841288
1285static UINT8 tile_draw(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags)
1289static UINT8 tile_draw(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags, UINT8 pen_mask)
12861290{
12871291   const UINT8 *penmap = tmap->pen_to_flags + group * MAX_PEN_TO_FLAGS;
12881292   bitmap_t *flagsmap = tmap->flagsmap;
r3373r3374
13321336      {
13331337         for (tx = 0; tx < width; tx++)
13341338         {
1335            UINT8 pen = *pendata++;
1339            UINT8 pen = (*pendata++) & pen_mask;
13361340            UINT8 map = penmap[pen];
13371341            pixptr[xoffs] = palette_base + pen;
13381342            flagsptr[xoffs] = map | category;
r3373r3374
13501354            UINT8 data = *pendata++;
13511355            UINT8 pen, map;
13521356
1353            pen = data & 0x0f;
1357            pen = (data & 0x0f) & pen_mask;
13541358            map = penmap[pen];
13551359            pixptr[xoffs] = palette_base + pen;
13561360            flagsptr[xoffs] = map | category;
r3373r3374
13581362            ormask |= map;
13591363            xoffs += dx0;
13601364
1361            pen = data >> 4;
1365            pen = (data >> 4) & pen_mask;
13621366            map = penmap[pen];
13631367            pixptr[xoffs] = palette_base + pen;
13641368            flagsptr[xoffs] = map | category;
src/emu/tilemap.h
r3373r3374
390390typedef struct _tile_data tile_data;
391391struct _tile_data
392392{
393   const UINT8 *   pen_data;      /* required */
394   const UINT8 *   mask_data;      /* required */
393   const UINT8*   pen_data;      /* required */
394   const UINT8*   mask_data;      /* required */
395395   pen_t         palette_base;   /* defaults to 0 */
396   UINT8          category;      /* defaults to 0; range from 0..15 */
396   UINT8         category;      /* defaults to 0; range from 0..15 */
397397   UINT8         group;         /* defaults to 0; range from 0..TILEMAP_NUM_GROUPS */
398   UINT8          flags;         /* defaults to 0; one or more of TILE_* flags above */
398   UINT8         flags;         /* defaults to 0; one or more of TILE_* flags above */
399   UINT8         pen_mask;      /* defaults to 0xff; mask to apply to pen_data while rendering the tile */
399400};
400401
401402
src/emu/uimenu.c
r3373r3374
384384      *BITMAP_ADDR32(hilight_bitmap, 0, x) = MAKE_ARGB(alpha,0xff,0xff,0xff);
385385   }
386386   hilight_texture = render_texture_alloc(NULL, NULL);
387   render_texture_set_bitmap(hilight_texture, hilight_bitmap, NULL, 0, TEXFORMAT_ARGB32);
387   render_texture_set_bitmap(hilight_texture, hilight_bitmap, NULL, TEXFORMAT_ARGB32, NULL);
388388
389389   /* create a texture for arrow icons */
390390   arrow_texture = render_texture_alloc(menu_render_triangle, NULL);
src/emu/video.c
r3373r3374
356356   /* the native target is hard-coded to our internal layout and has all options disabled */
357357   if (global.snap_native)
358358   {
359      global.snap_target = render_target_alloc(layout_snap, RENDER_CREATE_SINGLE_FILE | RENDER_CREATE_HIDDEN);
359      global.snap_target = render_target_alloc(machine, layout_snap, RENDER_CREATE_SINGLE_FILE | RENDER_CREATE_HIDDEN);
360360      assert(global.snap_target != NULL);
361361      render_target_set_layer_config(global.snap_target, 0);
362362   }
r3373r3374
364364   /* other targets select the specified view and turn off effects */
365365   else
366366   {
367      global.snap_target = render_target_alloc(NULL, RENDER_CREATE_HIDDEN);
367      global.snap_target = render_target_alloc(machine, NULL, RENDER_CREATE_HIDDEN);
368368      assert(global.snap_target != NULL);
369369      render_target_set_view(global.snap_target, video_get_view_for_target(machine, global.snap_target, viewname, 0, 1));
370370      render_target_set_layer_config(global.snap_target, render_target_get_layer_config(global.snap_target) & ~LAYER_CONFIG_ENABLE_SCREEN_OVERLAY);
r3373r3374
722722      if (state->width > curwidth || state->height > curheight)
723723      {
724724         bitmap_format screen_format = config->format;
725         palette_t *palette;
725726
726727         /* free what we have currently */
727728         if (state->texture[0] != NULL)
r3373r3374
740741         /* choose the texture format - convert the screen format to a texture format */
741742         switch (screen_format)
742743         {
743            case BITMAP_FORMAT_INDEXED16:   state->texture_format = TEXFORMAT_PALETTE16;      break;
744            case BITMAP_FORMAT_RGB15:      state->texture_format = TEXFORMAT_RGB15;         break;
745            case BITMAP_FORMAT_RGB32:      state->texture_format = TEXFORMAT_RGB32;         break;
746            default:                  fatalerror("Invalid bitmap format!");   break;
744            case BITMAP_FORMAT_INDEXED16:   state->texture_format = TEXFORMAT_PALETTE16;   palette = screen->machine->palette;   break;
745            case BITMAP_FORMAT_RGB15:      state->texture_format = TEXFORMAT_RGB15;      palette = NULL;                  break;
746            case BITMAP_FORMAT_RGB32:      state->texture_format = TEXFORMAT_RGB32;      palette = NULL;                  break;
747            default:                  fatalerror("Invalid bitmap format!");                                    break;
747748         }
748749
749750         /* allocate bitmaps */
r3373r3374
754755
755756         /* allocate textures */
756757         state->texture[0] = render_texture_alloc(NULL, NULL);
757         render_texture_set_bitmap(state->texture[0], state->bitmap[0], &state->visarea, 0, state->texture_format);
758         render_texture_set_bitmap(state->texture[0], state->bitmap[0], &state->visarea, state->texture_format, palette);
758759         state->texture[1] = render_texture_alloc(NULL, NULL);
759         render_texture_set_bitmap(state->texture[1], state->bitmap[1], &state->visarea, 0, state->texture_format);
760         render_texture_set_bitmap(state->texture[1], state->bitmap[1], &state->visarea, state->texture_format, palette);
760761      }
761762   }
762763}
r3373r3374
15721573            {
15731574               bitmap_t *bitmap = state->bitmap[state->curbitmap];
15741575               rectangle fixedvis = *video_screen_get_visible_area(screen);
1576               palette_t *palette = (state->texture_format == TEXFORMAT_PALETTE16) ? machine->palette : NULL;
1577
15751578               fixedvis.max_x++;
15761579               fixedvis.max_y++;
1577               render_texture_set_bitmap(state->texture[state->curbitmap], bitmap, &fixedvis, 0, state->texture_format);
1580               render_texture_set_bitmap(state->texture[state->curbitmap], bitmap, &fixedvis, state->texture_format, palette);
15781581               state->curtexture = state->curbitmap;
15791582               state->curbitmap = 1 - state->curbitmap;
15801583            }
r3373r3374
25392542   info.video_depth = 24;
25402543
25412544   info.audio_format = 0;
2542   info.audio_timescale = 1;
2543   info.audio_sampletime = machine->sample_rate;
2545   info.audio_timescale = machine->sample_rate;
2546   info.audio_sampletime = 1;
25442547   info.audio_numsamples = 0;
25452548   info.audio_channels = 2;
25462549   info.audio_samplebits = 16;
src/emu/rendfont.c
r3373r3374
276276
277277   /* wrap a texture around the bitmap */
278278   ch->texture = render_texture_alloc(render_texture_hq_scale, NULL);
279   render_texture_set_bitmap(ch->texture, ch->bitmap, NULL, 0, TEXFORMAT_ARGB32);
279   render_texture_set_bitmap(ch->texture, ch->bitmap, NULL, TEXFORMAT_ARGB32, NULL);
280280}
281281
282282
src/emu/inpttype.h
r3373r3374
524524
525525   INPUT_PORT_DIGITAL_TYPE( 0, OTHER,   KEYBOARD,            "Keyboard",               SEQ_DEF_0 )
526526
527   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_ON_SCREEN_DISPLAY,"On Screen Display",      SEQ_DEF_1(KEYCODE_TILDE) )
528527   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_DEBUG_BREAK,      "Break in Debugger",      SEQ_DEF_1(KEYCODE_TILDE) )
529528   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_CONFIGURE,        "Config Menu",            SEQ_DEF_1(KEYCODE_TAB) )
530529   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_PAUSE,            "Pause",                  SEQ_DEF_1(KEYCODE_P) )
r3373r3374
563562   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_TOGGLE_DEBUG,     "Toggle Debugger",        SEQ_DEF_1(KEYCODE_F5) )
564563   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_SAVE_STATE,       "Save State",             SEQ_DEF_2(KEYCODE_F7, KEYCODE_LSHIFT) )
565564   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_LOAD_STATE,       "Load State",             SEQ_DEF_3(KEYCODE_F7, SEQCODE_NOT, KEYCODE_LSHIFT) )
566   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_ADD_CHEAT,        "Add Cheat",              SEQ_DEF_1(KEYCODE_A) )
567   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_DELETE_CHEAT,     "Delete Cheat",           SEQ_DEF_1(KEYCODE_D) )
568   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_SAVE_CHEAT,       "Save Cheat",             SEQ_DEF_1(KEYCODE_S) )
569   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_WATCH_VALUE,      "Watch Value",            SEQ_DEF_1(KEYCODE_W) )
570   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_EDIT_CHEAT,       "Edit Cheat",             SEQ_DEF_1(KEYCODE_E) )
571   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_RELOAD_CHEAT,     "Reload Database",        SEQ_DEF_1(KEYCODE_L) )
572565   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_TOGGLE_CROSSHAIR, "Toggle Crosshair",       SEQ_DEF_1(KEYCODE_F1) )
573566
574567   INPUT_PORT_DIGITAL_TYPE( 0, UI,      OSD_1,               NULL,                     SEQ_DEF_0 )
src/emu/machine/8255ppi.c
r3373r3374
9999{
100100   const ppi8255_interface   *intf;
101101
102   read8_machine_func port_read[3];
103   write8_machine_func port_write[3];
102   read8_device_func port_read[3];
103   write8_device_func port_write[3];
104104
105105   /* mode flags */
106   UINT8 groupA_mode;
107   UINT8 groupB_mode;
108   UINT8 portA_dir;
109   UINT8 portB_dir;
110   UINT8 portCH_dir;
111   UINT8 portCL_dir;
106   UINT8 group_a_mode;
107   UINT8 group_b_mode;
108   UINT8 port_a_dir;
109   UINT8 port_b_dir;
110   UINT8 port_ch_dir;
111   UINT8 port_cl_dir;
112112
113113   /* handshake signals (1=asserted; 0=non-asserted) */
114114   UINT8 obf_a;
r3373r3374
144144   UINT8 mask = 0x00;
145145
146146   /* group A */
147   if (ppi8255->groupA_mode == 1)
147   if (ppi8255->group_a_mode == 1)
148148   {
149      if (ppi8255->portA_dir)
149      if (ppi8255->port_a_dir)
150150      {
151151         handshake |= ppi8255->ibf_a ? 0x20 : 0x00;
152152         handshake |= (ppi8255->ibf_a && ppi8255->inte_a) ? 0x08 : 0x00;
r3373r3374
159159         mask |= 0x88;
160160      }
161161   }
162   else if (ppi8255->groupA_mode == 2)
162   else if (ppi8255->group_a_mode == 2)
163163     {
164164      handshake |= ppi8255->inte_a ? 0x08 : 0x00;
165165      handshake |= ppi8255->obf_a ? 0x00 : 0x80;
r3373r3374
168168   }
169169
170170   /* group B */
171   if (ppi8255->groupB_mode == 1)
171   if (ppi8255->group_b_mode == 1)
172172     {
173      if (ppi8255->portA_dir)
173      if (ppi8255->port_a_dir)
174174      {
175175         handshake |= ppi8255->ibf_b ? 0x02 : 0x00;
176176         handshake |= (ppi8255->ibf_b && ppi8255->inte_b) ? 0x01 : 0x00;
r3373r3374
200200   /* port C is special */
201201   if (port == 2)
202202   {
203      if (((ppi8255->groupA_mode == 1) && (ppi8255->portA_dir == 0)) || (ppi8255->groupA_mode == 2))
203      if (((ppi8255->group_a_mode == 1) && (ppi8255->port_a_dir == 0)) || (ppi8255->group_a_mode == 2))
204204      {
205205         /* is !ACKA asserted? */
206206         if (ppi8255->obf_a && !(data & 0x40))
r3373r3374
210210         }
211211      }
212212
213      if ((ppi8255->groupB_mode == 1) && (ppi8255->portB_dir == 0))
213      if ((ppi8255->group_b_mode == 1) && (ppi8255->port_b_dir == 0))
214214      {
215215         /* is !ACKB asserted? */
216216         if (ppi8255->obf_b && !(data & 0x04))
r3373r3374
234234
235235   if (ppi8255->in_mask[port])
236236   {
237      if (ppi8255->port_read[port])
238         ppi8255_input(device, port, ppi8255->port_read[port](device->machine, 0));
237      if (ppi8255->port_read[port] != NULL)
238         ppi8255_input(device, port, CALL_DEVICE8_READ(ppi8255->port_read[port], device, 0));
239239
240240      result |= ppi8255->read[port] & ppi8255->in_mask[port];
241241   }
r3373r3374
287287      ppi8255_get_handshake_signals(ppi8255, 0, &write_data);
288288
289289   ppi8255->output[port] = write_data;
290   if (ppi8255->port_write[port])
291      ppi8255->port_write[port](device->machine, 0, write_data);
290   if (ppi8255->port_write[port] != NULL)
291      (*ppi8255->port_write[port])(device, 0, write_data);
292292}
293293
294294
r3373r3374
310310         switch(offset)
311311         {
312312            case 0:
313               if (!ppi8255->portA_dir && (ppi8255->groupA_mode != 0))
313               if (!ppi8255->port_a_dir && (ppi8255->group_a_mode != 0))
314314               {
315315                  ppi8255->obf_a = 1;
316316                  ppi8255_write_port(device, 2);
r3373r3374
318318               break;
319319
320320            case 1:
321               if (!ppi8255->portB_dir && (ppi8255->groupB_mode != 0))
321               if (!ppi8255->port_b_dir && (ppi8255->group_b_mode != 0))
322322               {
323323                  ppi8255->obf_b = 1;
324324                  ppi8255_write_port(device, 2);
r3373r3374
351351}
352352
353353
354void ppi8255_set_portAread(const device_config *device, read8_machine_func portAread)
354void ppi8255_set_port_a_read(const device_config *device, read8_device_func port_a_read)
355355{
356356   ppi8255_t   *ppi8255 = get_safe_token(device);
357357
358   ppi8255->port_read[0] = portAread;
358   ppi8255->port_read[0] = port_a_read;
359359}
360360
361void ppi8255_set_portBread(const device_config *device, read8_machine_func portBread)
361void ppi8255_set_port_b_read(const device_config *device, read8_device_func port_b_read)
362362{
363363   ppi8255_t   *ppi8255 = get_safe_token(device);
364364
365   ppi8255->port_read[1] = portBread;
365   ppi8255->port_read[1] = port_b_read;
366366}
367367
368void ppi8255_set_portCread(const device_config *device, read8_machine_func portCread)
368void ppi8255_set_port_c_read(const device_config *device, read8_device_func port_c_read)
369369{
370370   ppi8255_t   *ppi8255 = get_safe_token(device);
371371
372   ppi8255->port_read[2] = portCread;
372   ppi8255->port_read[2] = port_c_read;
373373}
374374
375375
376void ppi8255_set_portAwrite(const device_config *device, write8_machine_func portAwrite)
376void ppi8255_set_port_a_write(const device_config *device, write8_device_func port_a_write)
377377{
378378   ppi8255_t   *ppi8255 = get_safe_token(device);
379379
380   ppi8255->port_write[0] = portAwrite;
380   ppi8255->port_write[0] = port_a_write;
381381}
382382
383void ppi8255_set_portBwrite(const device_config *device, write8_machine_func portBwrite)
383void ppi8255_set_port_b_write(const device_config *device, write8_device_func port_b_write)
384384{
385385   ppi8255_t   *ppi8255 = get_safe_token(device);
386386
387   ppi8255->port_write[1] = portBwrite;
387   ppi8255->port_write[1] = port_b_write;
388388}
389389
390void ppi8255_set_portCwrite(const device_config *device, write8_machine_func portCwrite)
390void ppi8255_set_port_c_write(const device_config *device, write8_device_func port_c_write)
391391{
392392   ppi8255_t   *ppi8255 = get_safe_token(device);
393393
394   ppi8255->port_write[2] = portCwrite;
394   ppi8255->port_write[2] = port_c_write;
395395}
396396
397397
r3373r3374
401401   int i;
402402
403403   /* parse out mode */
404   ppi8255->groupA_mode = (data >> 5) & 3;
405   ppi8255->groupB_mode = (data >> 2) & 1;
406   ppi8255->portA_dir = (data >> 4) & 1;
407   ppi8255->portB_dir = (data >> 1) & 1;
408   ppi8255->portCH_dir = (data >> 3) & 1;
409   ppi8255->portCL_dir = (data >> 0) & 1;
404   ppi8255->group_a_mode = (data >> 5) & 3;
405   ppi8255->group_b_mode = (data >> 2) & 1;
406   ppi8255->port_a_dir = (data >> 4) & 1;
407   ppi8255->port_b_dir = (data >> 1) & 1;
408   ppi8255->port_ch_dir = (data >> 3) & 1;
409   ppi8255->port_cl_dir = (data >> 0) & 1;
410410
411   /* normalize groupA_mode */
412   if (ppi8255->groupA_mode == 3)
413      ppi8255->groupA_mode = 2;
411   /* normalize group_a_mode */
412   if (ppi8255->group_a_mode == 3)
413      ppi8255->group_a_mode = 2;
414414
415415     /* Port A direction */
416   if (ppi8255->portA_dir)
416   if (ppi8255->port_a_dir)
417417      ppi8255->in_mask[0] = 0xFF, ppi8255->out_mask[0] = 0x00;   /* input */
418418    else
419419      ppi8255->in_mask[0] = 0x00, ppi8255->out_mask[0] = 0xFF;    /* output */
420420
421421     /* Port B direction */
422   if (ppi8255->portB_dir)
422   if (ppi8255->port_b_dir)
423423      ppi8255->in_mask[1] = 0xFF, ppi8255->out_mask[1] = 0x00;   /* input */
424424   else
425425      ppi8255->in_mask[1] = 0x00, ppi8255->out_mask[1] = 0xFF;    /* output */
426426
427427   /* Port C upper direction */
428   if (ppi8255->portCH_dir)
428   if (ppi8255->port_ch_dir)
429429      ppi8255->in_mask[2] = 0xF0, ppi8255->out_mask[2] = 0x00;   /* input */
430430   else
431431      ppi8255->in_mask[2] = 0x00, ppi8255->out_mask[2] = 0xF0;   /* output */
432432
433433     /* Port C lower direction */
434   if (ppi8255->portCL_dir)
434   if (ppi8255->port_cl_dir)
435435      ppi8255->in_mask[2] |= 0x0F;   /* input */
436436   else
437437      ppi8255->out_mask[2] |= 0x0F;   /* output */
438438
439439   /* now depending on the group modes, certain Port C lines may be replaced
440440     * with varying control signals */
441   switch(ppi8255->groupA_mode)
441   switch(ppi8255->group_a_mode)
442442   {
443443      case 0:   /* Group A mode 0 */
444444         /* no changes */
r3373r3374
457457         break;
458458   }
459459
460   switch(ppi8255->groupB_mode)
460   switch(ppi8255->group_b_mode)
461461   {
462462      case 0:   /* Group B mode 0 */
463463         /* no changes */
r3373r3374
481481}
482482
483483
484void ppi8255_set_portA( const device_config *device, UINT8 data ) { ppi8255_input(device, 0, data); }
485void ppi8255_set_portB( const device_config *device, UINT8 data ) { ppi8255_input(device, 1, data); }
486void ppi8255_set_portC( const device_config *device, UINT8 data ) { ppi8255_input(device, 2, data); }
484void ppi8255_set_port_a( const device_config *device, UINT8 data ) { ppi8255_input(device, 0, data); }
485void ppi8255_set_port_b( const device_config *device, UINT8 data ) { ppi8255_input(device, 1, data); }
486void ppi8255_set_port_c( const device_config *device, UINT8 data ) { ppi8255_input(device, 2, data); }
487487
488UINT8 ppi8255_get_portA( const device_config *device ) {
488UINT8 ppi8255_get_port_a( const device_config *device ) {
489489   ppi8255_t   *ppi8255 = get_safe_token(device);
490490
491491   return ppi8255->output[0];
492492}
493493
494UINT8 ppi8255_get_portB( const device_config *device ) {
494UINT8 ppi8255_get_port_b( const device_config *device ) {
495495   ppi8255_t   *ppi8255 = get_safe_token(device);
496496
497497   return ppi8255->output[1];
498498}
499499
500UINT8 ppi8255_get_portC( const device_config *device ) {
500UINT8 ppi8255_get_port_c( const device_config *device ) {
501501   ppi8255_t   *ppi8255 = get_safe_token(device);
502502
503503   return ppi8255->output[2];
r3373r3374
510510
511511   ppi8255->intf = device->static_config;
512512
513   ppi8255->port_read[0] = ppi8255->intf->portAread;
514   ppi8255->port_read[1] = ppi8255->intf->portBread;
515   ppi8255->port_read[2] = ppi8255->intf->portCread;
513   ppi8255->port_read[0] = ppi8255->intf->port_a_read;
514   ppi8255->port_read[1] = ppi8255->intf->port_b_read;
515   ppi8255->port_read[2] = ppi8255->intf->port_c_read;
516516
517   ppi8255->port_write[0] = ppi8255->intf->portAwrite;
518   ppi8255->port_write[1] = ppi8255->intf->portBwrite;
519   ppi8255->port_write[2] = ppi8255->intf->portCwrite;
517   ppi8255->port_write[0] = ppi8255->intf->port_a_write;
518   ppi8255->port_write[1] = ppi8255->intf->port_b_write;
519   ppi8255->port_write[2] = ppi8255->intf->port_c_write;
520520
521521   /* register for state saving */
522522   state_save_combine_module_and_tag(unique_tag, "ppi8255", device->tag);
523523
524   state_save_register_item(unique_tag, 0, ppi8255->groupA_mode);
525   state_save_register_item(unique_tag, 0, ppi8255->groupB_mode);
526   state_save_register_item(unique_tag, 0, ppi8255->portA_dir);
527   state_save_register_item(unique_tag, 0, ppi8255->portB_dir);
528   state_save_register_item(unique_tag, 0, ppi8255->portCH_dir);
529   state_save_register_item(unique_tag, 0, ppi8255->portCL_dir);
524   state_save_register_item(unique_tag, 0, ppi8255->group_a_mode);
525   state_save_register_item(unique_tag, 0, ppi8255->group_b_mode);
526   state_save_register_item(unique_tag, 0, ppi8255->port_a_dir);
527   state_save_register_item(unique_tag, 0, ppi8255->port_b_dir);
528   state_save_register_item(unique_tag, 0, ppi8255->port_ch_dir);
529   state_save_register_item(unique_tag, 0, ppi8255->port_cl_dir);
530530   state_save_register_item(unique_tag, 0, ppi8255->obf_a);
531531   state_save_register_item(unique_tag, 0, ppi8255->obf_b);
532532   state_save_register_item(unique_tag, 0, ppi8255->ibf_a);
r3373r3374
546546   ppi8255_t   *ppi8255 = get_safe_token(device);
547547   int         i;
548548
549   ppi8255->groupA_mode = 0;
550   ppi8255->groupB_mode = 0;
551   ppi8255->portA_dir = 0;
552   ppi8255->portB_dir = 0;
553   ppi8255->portCH_dir = 0;
554   ppi8255->portCL_dir = 0;
549   ppi8255->group_a_mode = 0;
550   ppi8255->group_b_mode = 0;
551   ppi8255->port_a_dir = 0;
552   ppi8255->port_b_dir = 0;
553   ppi8255->port_ch_dir = 0;
554   ppi8255->port_cl_dir = 0;
555555   ppi8255->obf_a = ppi8255->ibf_a = ppi8255->inte_a = 0;
556556   ppi8255->obf_b = ppi8255->ibf_b = ppi8255->inte_b = 0;
557557
src/emu/machine/8255ppi.h
r3373r3374
1212#define PPI8255      DEVICE_GET_INFO_NAME(ppi8255)
1313
1414
15typedef struct
15/***************************************************************************
16    TYPE DEFINITIONS
17***************************************************************************/
18
19typedef struct _ppi8255_interface ppi8255_interface;
20struct _ppi8255_interface
1621{
17   read8_machine_func portAread;
18   read8_machine_func portBread;
19   read8_machine_func portCread;
20   write8_machine_func portAwrite;
21   write8_machine_func portBwrite;
22   write8_machine_func portCwrite;
23} ppi8255_interface;
22   read8_device_func port_a_read;
23   read8_device_func port_b_read;
24   read8_device_func port_c_read;
25   write8_device_func port_a_write;
26   write8_device_func port_b_write;
27   write8_device_func port_c_write;
28};
2429
2530
31/***************************************************************************
32    DEVICE CONFIGURATION MACROS
33***************************************************************************/
34
35#define MDRV_PPI8255_ADD(_tag, _intrf) \
36   MDRV_DEVICE_ADD(_tag, PPI8255) \
37   MDRV_DEVICE_CONFIG(_intrf)
38
39#define MDRV_PPI8255_RECONFIG(_tag, _intrf) \
40   MDRV_DEVICE_MODIFY(_tag, PPI8255) \
41   MDRV_DEVICE_CONFIG(_intrf)
42
43#define MDRV_PPI8255_REMOVE(_tag) \
44   MDRV_DEVICE_REMOVE(_tag, PPI8255)
45
46
47
2648/* device interface */
2749DEVICE_GET_INFO(ppi8255);
2850
r3373r3374
3052WRITE8_DEVICE_HANDLER( ppi8255_w );
3153
3254
33void ppi8255_set_portAread( const device_config *device, read8_machine_func portAread );
34void ppi8255_set_portBread( const device_config *device, read8_machine_func portBread );
35void ppi8255_set_portCread( const device_config *device, read8_machine_func portCread );
55void ppi8255_set_port_a_read( const device_config *device, read8_device_func port_a_read );
56void ppi8255_set_port_b_read( const device_config *device, read8_device_func port_b_read );
57void ppi8255_set_port_c_read( const device_config *device, read8_device_func port_c_read );
3658
37void ppi8255_set_portAwrite( const device_config *device, write8_machine_func portAwrite );
38void ppi8255_set_portBwrite( const device_config *device, write8_machine_func portBwrite );
39void ppi8255_set_portCwrite( const device_config *device, write8_machine_func portCwrite );
59void ppi8255_set_port_a_write( const device_config *device, write8_device_func port_a_write );
60void ppi8255_set_port_b_write( const device_config *device, write8_device_func port_b_write );
61void ppi8255_set_port_c_write( const device_config *device, write8_device_func port_c_write );
4062
41void ppi8255_set_portA( const device_config *device, UINT8 data );
42void ppi8255_set_portB( const device_config *device, UINT8 data );
43void ppi8255_set_portC( const device_config *device, UINT8 data );
63void ppi8255_set_port_a( const device_config *device, UINT8 data );
64void ppi8255_set_port_b( const device_config *device, UINT8 data );
65void ppi8255_set_port_c( const device_config *device, UINT8 data );
4466
45UINT8 ppi8255_get_portA( const device_config *device );
46UINT8 ppi8255_get_portB( const device_config *device );
47UINT8 ppi8255_get_portC( const device_config *device );
67UINT8 ppi8255_get_port_a( const device_config *device );
68UINT8 ppi8255_get_port_b( const device_config *device );
69UINT8 ppi8255_get_port_c( const device_config *device );
4870
4971#endif /* __8255PPI_H_ */
src/emu/machine/ldcore.c
r3373r3374
107107   /* video updating */
108108   UINT8            videoenable;         /* is video enabled? */
109109   render_texture *   videotex;            /* texture for the video */
110   palette_t *         videopalette;         /* palette for the video */
110111   UINT8            overenable;            /* is the overlay enabled? */
111112   bitmap_t *         overbitmap[2];         /* overlay bitmaps */
112113   int               overindex;            /* index of the overlay bitmap */
r3373r3374
889890   ldcore_data *ldcore = ld->core;
890891   UINT32 tracknum = ldcore->curtrack;
891892   UINT32 fieldnum = ldcore->fieldnum;
892   UINT32 curfield = tracknum * 2 + fieldnum;
893   vbi_metadata vbidata;
893894   frame_data *frame;
894895   UINT32 vbiframe;
895896   UINT32 readhunk;
896897   INT32 chdtrack;
897898
898   frame = &ldcore->frame[ldcore->videoindex];
899   /* compute the chdhunk number we are going to read */
900   chdtrack = tracknum - 1 - VIRTUAL_LEAD_IN_TRACKS;
901   chdtrack = MAX(chdtrack, 0);
902   chdtrack = MIN(chdtrack, ldcore->chdtracks - 1);
903   readhunk = chdtrack * 2 + fieldnum;
899904
900   /* special cases for playing forward */
901   if (curfield == frame->lastfield + 1)
902   {
903      /* if the previous field had a frame number, force the new field to pair with the previous one */
904      if ((ldcore->metadata[fieldnum ^ 1].line1718 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE)
905         frame->numfields = 1;
905   /* cheat and look up the metadata we are about to retrieve */
906   if (ldcore->vbidata != NULL)
907      vbi_metadata_unpack(&vbidata, NULL, &ldcore->vbidata[readhunk * VBI_PACKED_BYTES]);
906908
907      /* if the twice-previous field was a frame number, and we've moved one since then, consider this one done */
908      else if (frame->numfields >= 2 && (ldcore->metadata[fieldnum].line1718 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE)
909      {
910         ldcore->videoindex = (ldcore->videoindex + 1) % ARRAY_LENGTH(ldcore->frame);
911         frame = &ldcore->frame[ldcore->videoindex];
912         frame->numfields = 0;
913      }
914   }
915
916   /* all other cases */
917   else
909   /* if we're about to read the first field in a frame, advance */
910   frame = &ldcore->frame[ldcore->videoindex];
911   if ((vbidata.line1718 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE)
918912   {
919      /* otherwise, keep the frames in sync with the absolute field numbers */
920      if (frame->numfields == 2 && fieldnum != 0)
921         frame->numfields--;
922
923      /* if we already have both fields on the current videoindex, advance */
924      else if (frame->numfields >= 2)
925      {
913      if (frame->numfields >= 2)
926914         ldcore->videoindex = (ldcore->videoindex + 1) % ARRAY_LENGTH(ldcore->frame);
927         frame = &ldcore->frame[ldcore->videoindex];
928         frame->numfields = 0;
929      }
915      frame = &ldcore->frame[ldcore->videoindex];
916      frame->numfields = 0;
930917   }
931918
932919   /* if we're squelched, reset the frame counter */
r3373r3374
962949   ldcore->avconfig.actsamples = &ldcore->audiocursamples;
963950   ldcore->audiocursamples = 0;
964951
965   /* compute the chdhunk number we are going to read */
966   chdtrack = tracknum - 1 - VIRTUAL_LEAD_IN_TRACKS;
967   chdtrack = MAX(chdtrack, 0);
968   chdtrack = MIN(chdtrack, ldcore->chdtracks - 1);
969   readhunk = chdtrack * 2 + fieldnum;
970
971952   /* set the VBI data for the new field from our precomputed data */
972953   if (ldcore->vbidata != NULL)
973954      vbi_metadata_unpack(&ldcore->metadata[fieldnum], &vbiframe, &ldcore->vbidata[readhunk * VBI_PACKED_BYTES]);
r3373r3374
13631344      /* if this is the last update, do the rendering */
13641345      if (cliprect->max_y == visarea->max_y)
13651346      {
1366         float x0, y0, x1, y1;
1367
13681347         /* update the texture with the overlay contents */
13691348         if (overbitmap != NULL)
13701349         {
13711350            if (overbitmap->format == BITMAP_FORMAT_INDEXED16)
1372               render_texture_set_bitmap(ldcore->overtex, overbitmap, &ldcore->config.overclip, 0, TEXFORMAT_PALETTEA16);
1351               render_texture_set_bitmap(ldcore->overtex, overbitmap, &ldcore->config.overclip, TEXFORMAT_PALETTEA16, laserdisc->machine->palette);
13731352            else if (overbitmap->format == BITMAP_FORMAT_RGB32)
1374               render_texture_set_bitmap(ldcore->overtex, overbitmap, &ldcore->config.overclip, 0, TEXFORMAT_ARGB32);
1353               render_texture_set_bitmap(ldcore->overtex, overbitmap, &ldcore->config.overclip, TEXFORMAT_ARGB32, NULL);
13751354         }
13761355
13771356         /* get the laserdisc video */
13781357         laserdisc_get_video(laserdisc, &vidbitmap);
13791358         if (vidbitmap != NULL)
1380            render_texture_set_bitmap(ldcore->videotex, vidbitmap, NULL, 0, TEXFORMAT_YUY16);
1359            render_texture_set_bitmap(ldcore->videotex, vidbitmap, NULL, TEXFORMAT_YUY16, ldcore->videopalette);
13811360
13821361         /* reset the screen contents */
13831362         render_container_empty(render_container_get_screen(screen));
r3373r3374
13891368         /* add the overlay */
13901369         if (ldcore->overenable && overbitmap != NULL)
13911370         {
1392            x0 = 0.5f - 0.5f * ldcore->config.overscalex + ldcore->config.overposx;
1393            y0 = 0.5f - 0.5f * ldcore->config.overscaley + ldcore->config.overposy;
1394            x1 = x0 + ldcore->config.overscalex;
1395            y1 = y0 + ldcore->config.overscaley;
1371            float x0 = 0.5f - 0.5f * ldcore->config.overscalex + ldcore->config.overposx;
1372            float y0 = 0.5f - 0.5f * ldcore->config.overscaley + ldcore->config.overposy;
1373            float x1 = x0 + ldcore->config.overscalex;
1374            float y1 = y0 + ldcore->config.overscaley;
13961375            render_screen_add_quad(screen, x0, y0, x1, y1, MAKE_ARGB(0xff,0xff,0xff,0xff), ldcore->overtex, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_SCREENTEX(1));
13971376         }
13981377
r3373r3374
15421521   if (ldcore->videotex == NULL)
15431522      fatalerror("Out of memory allocating video texture");
15441523
1524   /* allocate palette for applying brightness/contrast/gamma */
1525   ldcore->videopalette = palette_alloc(256, 1);
1526   if (ldcore->videopalette == NULL)
1527      fatalerror("Out of memory allocating video palette");
1528   for (index = 0; index < 256; index++)
1529      palette_entry_set_color(ldcore->videopalette, index, MAKE_RGB(index, index, index));
1530
15451531   /* allocate overlay */
15461532   if (ldcore->config.overwidth > 0 && ldcore->config.overheight > 0 && ldcore->config.overupdate != NULL)
15471533   {
r3373r3374
16621648   if (ldcore->disc != NULL)
16631649      chd_async_complete(ldcore->disc);
16641650
1665   /* free any textures */
1651   /* free any textures and palettes */
16661652   if (ldcore->videotex != NULL)
16671653      render_texture_free(ldcore->videotex);
1654   if (ldcore->videopalette != NULL)
1655      palette_deref(ldcore->videopalette);
16681656   if (ldcore->overtex != NULL)
16691657      render_texture_free(ldcore->overtex);
16701658}
src/emu/machine/ldv1000.c
r3373r3374
2020#define PRINTF_COMMANDS            1
2121#define CMDPRINTF(x)            do { if (PRINTF_COMMANDS) mame_printf_debug x; } while (0)
2222
23#define EMULATE_ROM               0
2324
2425
26
2527/***************************************************************************
2628    CONSTANTS
2729***************************************************************************/
r3373r3374
9193
9294
9395/***************************************************************************
96    22VP931 ROM AND MACHINE INTERFACES
97***************************************************************************/
98
99#if EMULATE_ROM
100static WRITE8_HANDLER( ld_controls )
101{
102   switch (offset)
103   {
104      case 0:
105         // write $00 at startup/reject
106         break;
107
108      case 2:
109         // write $06 at startup/reject
110         break;
111
112      case 3:
113         // write $8A at startup
114         break;
115
116      case 5:
117         // write $9F at startup/reject
118         break;
119
120      case 6:
121         // write $C3 at startup/reject
122         break;
123
124      case 7:
125         // write $90 at startup
126         break;
127   }
128}
129
130
131static READ8_HANDLER( ld_controls )
132{
133   switch (offset)
134   {
135      case 4:
136
137   }
138}
139
140
141static WRITE8_HANDLER( unknown_port_w )
142{
143   // Writes to $00/$02/$00
144   // Values:
145   //  $04/$09/$0F
146   //  $04/$0E/$0F
147   //  $04/   /$0F
148}
149
150
151static ADDRESS_MAP_START( ldv1000_map, ADDRESS_SPACE_PROGRAM, 8 )
152   AM_RANGE(0x0000, 0x1fff) AM_ROM
153   AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x400) AM_RAM
154   AM_RANGE(0xc000, 0xc007) AM_READWRITE(ld_controls)
155ADDRESS_MAP_END
156
157
158static ADDRESS_MAP_START( ldv1000_portmap, ADDRESS_SPACE_PROGRAM, 8 )
159   ADDRESS_MAP_GLOBAL_MASK(0xff)
160   AM_RANGE(0x00, 0x03) AM_WRITE(unknown_port_w)
161   AM_RANGE(0xc0, 0xc3) AM_DEVREADWRITE(Z80CTC, "ctc", z80ctc_r, z80ctc_w)
162ADDRESS_MAP_END
163
164
165static MACHINE_DRIVER_START( ldv1000 )
166   MDRV_CPU_ADD("ldv1000", Z80, 4000000)
167   MDRV_CPU_PROGRAM_MAP(ldv1000_map,0)
168MACHINE_DRIVER_END
169
170
171ROM_START( ldv1000 )
172   ROM_REGION( 0x2000, "ldv1000", ROMREGION_LOADBYNAME )
173   ROM_LOAD( "z03_1001_vyw-053_v1-0.bin", 0x0000, 0x2000, CRC(31ec4687) SHA1(52f91c304a878ba02b2fa1cda1a9489d6dd5a34f) )
174ROM_END
175#endif
176
177
178
179/***************************************************************************
94180    INTERFACES
95181***************************************************************************/
96182
r3373r3374
99185   LASERDISC_TYPE_PIONEER_LDV1000,            /* type of the player */
100186   sizeof(ldplayer_data),                  /* size of the state */
101187   "Pioneer LD-V1000",                     /* name of the player */
102   NULL,                              /* pointer to ROM region information */
103   NULL,                              /* pointer to machine configuration */
188#if EMULATE_ROM
189   rom_ldv1000,                        /* pointer to ROM region information */
190   machine_config_ldv1000,                  /* pointer to machine configuration */
191#else
192   NULL,
193   NULL,
194#endif
104195   ldv1000_init,                        /* initialization callback */
105196   NULL,                              /* vsync callback */
106197   ldv1000_update,                        /* update callback */
src/emu/inptport.h
r3373r3374
683683/* macro for wrapping a default string */
684684#define DEF_STR(str_num) ((const char *)INPUT_STRING_##str_num)
685685
686/* macros for referencing input ports in place of read handlers */
687#define HANDLER_PORT(name, type)      ((type)("\0\0\0\0" name))
688#define DEVICE8_PORT(name)            HANDLER_PORT(name, read8_device_func)
689#define MACHINE8_PORT(name)            HANDLER_PORT(name, read8_machine_func)
690#define IS_HANDLER_PORT(ptr)         (((const char *)(ptr))[0] == 0 && ((const char *)(ptr))[1] == 0 && ((const char *)(ptr))[2] == 0 && ((const char *)(ptr))[3] == 0)
691#define CALL_DEVICE8_READ(ptr,d,offs)   (IS_HANDLER_PORT(ptr) ? input_port_read((d)->machine, ((const char *)(ptr)) + 4) : (*ptr)(d, offs))
692#define CALL_MACHINE8_READ(ptr,m,offs)   (IS_HANDLER_PORT(ptr) ? input_port_read((m), ((const char *)(ptr)) + 4) : (*ptr)(m, offs))
686693
687694
695
688696/***************************************************************************
689697    MACROS FOR BUILDING INPUT PORTS
690698***************************************************************************/
src/emu/ui.c
r3373r3374
9595static slider_state *slider_list;
9696static slider_state *slider_current;
9797
98static int display_rescale_message;
99static int allow_rescale;
10098
10199
102
103100/***************************************************************************
104101    FUNCTION PROTOTYPES
105102***************************************************************************/
106103
107104static void ui_exit(running_machine *machine);
108static int rescale_notifier(running_machine *machine, int width, int height);
109105
110106/* text generators */
111107static astring *disclaimer_string(running_machine *machine, astring *buffer);
r3373r3374
229225   /* reset globals */
230226   single_step = FALSE;
231227   ui_set_handler(handler_messagebox, 0);
232
233   /* request callbacks when the renderer does resizing */
234   render_set_rescale_notify(machine, rescale_notifier);
235   allow_rescale = 0;
236   display_rescale_message = FALSE;
237228   return 0;
238229}
239230
r3373r3374
257248
258249
259250/*-------------------------------------------------
260    rescale_notifier - notifier to trigger a
261    rescale message during long operations
262-------------------------------------------------*/
263
264static int rescale_notifier(running_machine *machine, int width, int height)
265{
266   /* always allow rescaling for a "small" area and for screenless drivers */
267   if (width < 500 || height < 500 || machine->primary_screen == NULL)
268      return TRUE;
269
270   /* if we've currently disallowed rescaling, turn on a message next frame */
271   if (allow_rescale == 0)
272      display_rescale_message = TRUE;
273
274   /* only allow rescaling once we're sure the message is visible */
275   return (allow_rescale == 1);
276}
277
278
279/*-------------------------------------------------
280251    ui_display_startup_screens - display the
281252    various startup screens
282253-------------------------------------------------*/
r3373r3374
423394   /* cancel takes us back to the ingame handler */
424395   if (ui_handler_param == UI_HANDLER_CANCEL)
425396      ui_set_handler(handler_ingame, 0);
426
427   /* add a message if we are rescaling */
428   if (display_rescale_message)
429   {
430      display_rescale_message = FALSE;
431      if (allow_rescale == 0)
432         allow_rescale = 2;
433      ui_draw_text_box("Updating Artwork...", JUSTIFY_CENTER, 0.5f, 0.5f, messagebox_backcolor);
434   }
435
436   /* decrement the frame counter if it is non-zero */
437   else if (allow_rescale != 0)
438      allow_rescale--;
439397}
440398
441399
src/emu/crsshair.c
r3373r3374
170170
171171      /* create a texture to reference the bitmap */
172172      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);
173      render_texture_set_bitmap(global.texture[player], global.bitmap[player], NULL, TEXFORMAT_ARGB32, NULL);
174174   }
175175}
176176
src/emu/cpuint.c
r3373r3374
283283
284284void cpunum_set_input_line_and_vector(running_machine *machine, int cpunum, int line, int state, int vector)
285285{
286#ifdef MAME_DEBUG
287   /* catch errors where people use PULSE_LINE for CPUs that don't support it */
288   if (state == PULSE_LINE && line != INPUT_LINE_NMI && line != INPUT_LINE_RESET)
289   {
290      switch (machine->config->cpu[cpunum].type)
291      {
292         case CPU_Z80:
293         case CPU_Z180:
294         case CPU_M68000:
295         case CPU_M68008:
296         case CPU_M68010:
297         case CPU_M68EC020:
298         case CPU_M68020:
299         case CPU_M68040:
300         case CPU_R4600BE:
301         case CPU_R4600LE:
302         case CPU_R4650BE:
303         case CPU_R4650LE:
304         case CPU_R4700BE:
305         case CPU_R4700LE:
306         case CPU_R5000BE:
307         case CPU_R5000LE:
308         case CPU_QED5271BE:
309         case CPU_QED5271LE:
310         case CPU_RM7000BE:
311         case CPU_RM7000LE:
312         case CPU_PPC403GA:
313         case CPU_PPC403GCX:
314         case CPU_PPC601:
315         case CPU_PPC602:
316         case CPU_PPC603:
317         case CPU_PPC603E:
318         case CPU_PPC603R:
319         case CPU_PPC604:
320         case CPU_I8035:
321         case CPU_I8041:
322         case CPU_I8048:
323         case CPU_I8648:
324         case CPU_I8748:
325         case CPU_MB8884:
326         case CPU_N7751:
327         case CPU_TMS34010:
328         case CPU_TMS34020:
329         case CPU_TMS32010:
330         case CPU_TMS32025:
331         case CPU_TMS32026:
332            fatalerror("CPU %s: PULSE_LINE used with level-detected IRQ %d\n", machine->config->cpu[cpunum].tag, line);
333            break;
334
335         default:
336            break;
337      }
338   }
339#endif
340
286341   if (line >= 0 && line < MAX_INPUT_LINES)
287342   {
288343      INT32 input_event = (state & 0xff) | (vector << 8);
src/emu/render.c
r3373r3374
4444#include "config.h"
4545#include "output.h"
4646#include "xmlfile.h"
47#include "deprecat.h"
4847
4948
5049
r3373r3374
5554#define MAX_TEXTURE_SCALES      8
5655#define TEXTURE_GROUP_SIZE      256
5756
58#define NUM_PRIMLISTS         2
57#define NUM_PRIMLISTS         3
5958
6059#define MAX_CLEAR_EXTENTS      1000
6160
r3373r3374
133132   render_texture *   base;            /* pointer to base of texture group */
134133   bitmap_t *         bitmap;            /* pointer to the original bitmap */
135134   rectangle         sbounds;         /* source bounds within the bitmap */
136   UINT32            palettebase;      /* palette base within the system palette */
135   palette_t *         palette;         /* palette associated with the texture */
137136   int               format;            /* format of the texture data */
138137   texture_scaler_func   scaler;            /* scaling callback */
139138   void *            param;            /* scaling callback parameter */
140139   UINT32            curseq;            /* current sequence number */
141140   scaled_texture      scaled[MAX_TEXTURE_SCALES];   /* array of scaled variants of this texture */
141   rgb_t *            bcglookup;         /* dynamically allocated B/C/G lookup table */
142   UINT32            bcglookup_entries;   /* number of B/C/G lookup entries allocated */
142143};
143144
144145
r3373r3374
146147struct _render_target
147148{
148149   render_target *      next;            /* keep a linked list of targets */
150   running_machine *   machine;         /* pointer to the machine we are connected with */
149151   layout_view *      curview;         /* current view */
150152   layout_file *      filelist;         /* list of layout files */
151153   UINT32            flags;            /* creation flags */
r3373r3374
213215static render_target *targetlist;
214216static render_target *ui_target;
215217
216/* notifier callbacks */
217static int (*rescale_notify)(running_machine *, int, int);
218
219218/* free lists */
220219static render_primitive *render_primitive_free_list;
221220static container_item *container_item_free_list;
r3373r3374
270269static void invalidate_all_render_ref(void *refptr);
271270
272271/* render textures */
273static int render_texture_get_scaled(render_texture *texture, UINT32 dwidth, UINT32 dheight, render_texinfo *texinfo, render_ref **reflist);
272static int texture_get_scaled(render_texture *texture, UINT32 dwidth, UINT32 dheight, render_texinfo *texinfo, render_ref **reflist);
273static const rgb_t *texture_get_adjusted_palette(render_texture *texture, render_container *container);
274274
275275/* render containers */
276static render_container *render_container_alloc(void);
276static render_container *render_container_alloc(running_machine *machine);
277277static void render_container_free(render_container *container);
278278static container_item *render_container_item_add_generic(render_container *container, UINT8 type, float x0, float y0, float x1, float y1, rgb_t argb);
279279static void render_container_overlay_scale(bitmap_t *dest, const bitmap_t *source, const rectangle *sbounds, void *param);
r3373r3374
557557   ui_target = NULL;
558558
559559   /* create a UI container */
560   ui_container = render_container_alloc();
560   ui_container = render_container_alloc(machine);
561561
562562   /* create a container for each screen and determine its orientation */
563563   for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen))
564564   {
565      render_container *screen_container = render_container_alloc();
565      render_container *screen_container = render_container_alloc(machine);
566566      render_container **temp = &screen_container->next;
567567      render_container_user_settings settings;
568568
r3373r3374
947947
948948
949949/*-------------------------------------------------
950    render_set_rescale_notify - set a notifier
951    that we call before doing long scaling
952    operations
953-------------------------------------------------*/
954
955void render_set_rescale_notify(running_machine *machine, int (*notifier)(running_machine *, int, int))
956{
957   rescale_notify = notifier;
958}
959
960
961/*-------------------------------------------------
962950    render_is_live_screen - return if the screen
963951    is 'live'
964952-------------------------------------------------*/
r3373r3374
10781066    target
10791067-------------------------------------------------*/
10801068
1081render_target *render_target_alloc(const char *layoutfile, UINT32 flags)
1069render_target *render_target_alloc(running_machine *machine, const char *layoutfile, UINT32 flags)
10821070{
10831071   render_target *target;
10841072   render_target **nextptr;
r3373r3374
10931081   *nextptr = target;
10941082
10951083   /* fill in the basics with reasonable defaults */
1084   target->machine = machine;
10961085   target->flags = flags;
10971086   target->width = 640;
10981087   target->height = 480;
r3373r3374
11121101   /* determine the base orientation based on options */
11131102   target->orientation = ROT0;
11141103   if (!options_get_bool(mame_options(), OPTION_ROTATE))
1115      target->base_orientation = orientation_reverse(Machine->gamedrv->flags & ORIENTATION_MASK);
1104      target->base_orientation = orientation_reverse(machine->gamedrv->flags & ORIENTATION_MASK);
11161105
11171106   /* rotate left/right */
1118   if (options_get_bool(mame_options(), OPTION_ROR) || (options_get_bool(mame_options(), OPTION_AUTOROR) && (Machine->gamedrv->flags & ORIENTATION_SWAP_XY)))
1107   if (options_get_bool(mame_options(), OPTION_ROR) || (options_get_bool(mame_options(), OPTION_AUTOROR) && (machine->gamedrv->flags & ORIENTATION_SWAP_XY)))
11191108      target->base_orientation = orientation_add(ROT90, target->base_orientation);
1120   if (options_get_bool(mame_options(), OPTION_ROL) || (options_get_bool(mame_options(), OPTION_AUTOROL) && (Machine->gamedrv->flags & ORIENTATION_SWAP_XY)))
1109   if (options_get_bool(mame_options(), OPTION_ROL) || (options_get_bool(mame_options(), OPTION_AUTOROL) && (machine->gamedrv->flags & ORIENTATION_SWAP_XY)))
11211110      target->base_orientation = orientation_add(ROT270, target->base_orientation);
11221111
11231112   /* flip X/Y */
r3373r3374
11311120   target->layerconfig = target->base_layerconfig;
11321121
11331122   /* allocate a lock for the primitive list */
1134   for (listnum = 0; listnum < NUM_PRIMLISTS; listnum++)
1123   for (listnum = 0; listnum < ARRAY_LENGTH(target->primlist); listnum++)
11351124      target->primlist[listnum].lock = osd_lock_alloc();
11361125
11371126   /* load the layout files */
r3373r3374
11661155   *curr = target->next;
11671156
11681157   /* free any primitives */
1169   for (listnum = 0; listnum < NUM_PRIMLISTS; listnum++)
1158   for (listnum = 0; listnum < ARRAY_LENGTH(target->primlist); listnum++)
11701159   {
11711160      release_render_list(&target->primlist[listnum]);
11721161      osd_lock_free(target->primlist[listnum].lock);
r3373r3374
14781467      for (item = target->curview->itemlist[layer]; item != NULL; item = item->next)
14791468         if (item->element == NULL)
14801469         {
1481            const device_config *screen = device_list_find_by_index(Machine->config->devicelist, VIDEO_SCREEN, item->index);
1470            const device_config *screen = device_list_find_by_index(target->machine->config->devicelist, VIDEO_SCREEN, item->index);
14821471            const screen_config *scrconfig = screen->inline_config;
14831472            const rectangle vectorvis = { 0, 639, 0, 479 };
14841473            const rectangle *visarea = NULL;
r3373r3374
14861475            render_bounds bounds;
14871476            float xscale, yscale;
14881477
1489            /* we may be called very early, before Machine->visible_area is initialized; handle that case */
1478            /* we may be called very early, before machine->visible_area is initialized; handle that case */
14901479            if (scrconfig->type == SCREEN_TYPE_VECTOR)
14911480               visarea = &vectorvis;
14921481            else if (screen->token != NULL)
r3373r3374
15511540
15521541   /* switch to the next primitive list */
15531542   listnum = target->listindex;
1554   target->listindex = (target->listindex + 1) % NUM_PRIMLISTS;
1543   target->listindex = (target->listindex + 1) % ARRAY_LENGTH(target->primlist);
15551544   osd_lock_acquire(target->primlist[listnum].lock);
15561545
15571546   /* free any previous primitives */
r3373r3374
15691558   root_xform.orientation = target->orientation;
15701559
15711560   /* iterate over layers back-to-front, but only if we're running */
1572   if (mame_get_phase(Machine) >= MAME_PHASE_RESET)
1561   if (mame_get_phase(target->machine) >= MAME_PHASE_RESET)
15731562      for (layernum = 0; layernum < ITEM_LAYER_MAX; layernum++)
15741563      {
15751564         int blendmode;
r3373r3374
16101599                     state = output_get_value(item->output_name);
16111600                  else if (item->input_tag[0] != 0)
16121601                  {
1613                     const input_field_config *field = input_field_by_tag_and_mask(Machine->portconfig, item->input_tag, item->input_mask);
1602                     const input_field_config *field = input_field_by_tag_and_mask(target->machine->portconfig, item->input_tag, item->input_mask);
16141603                     if (field != NULL)
1615                        state = ((input_port_read_safe(Machine, item->input_tag, 0) ^ field->defvalue) & item->input_mask) ? 1 : 0;
1604                        state = ((input_port_read_safe(target->machine, item->input_tag, 0) ^ field->defvalue) & item->input_mask) ? 1 : 0;
16161605                  }
16171606                  add_element_primitives(target, &target->primlist[listnum], &item_xform, item->element, state, blendmode);
16181607               }
r3373r3374
17961785   /* if there's an explicit file, load that first */
17971786   if (layoutfile != NULL)
17981787   {
1799      *nextfile = layout_file_load(Machine->basename, layoutfile);
1788      *nextfile = layout_file_load(target->machine->basename, layoutfile);
18001789      if (*nextfile != NULL)
18011790         nextfile = &(*nextfile)->next;
18021791   }
r3373r3374
18061795      return (nextfile == &target->filelist) ? 1 : 0;
18071796
18081797   /* try to load a file based on the driver name */
1809   *nextfile = layout_file_load(Machine->basename, Machine->gamedrv->name);
1798   *nextfile = layout_file_load(target->machine->basename, target->machine->gamedrv->name);
18101799   if (*nextfile == NULL)
1811      *nextfile = layout_file_load(Machine->basename, "default");
1800      *nextfile = layout_file_load(target->machine->basename, "default");
18121801   if (*nextfile != NULL)
18131802      nextfile = &(*nextfile)->next;
18141803
18151804   /* if a default view has been specified, use that as a fallback */
1816   if (Machine->gamedrv->default_layout != NULL)
1805   if (target->machine->gamedrv->default_layout != NULL)
18171806   {
1818      *nextfile = layout_file_load(NULL, Machine->gamedrv->default_layout);
1807      *nextfile = layout_file_load(NULL, target->machine->gamedrv->default_layout);
18191808      if (*nextfile != NULL)
18201809         nextfile = &(*nextfile)->next;
18211810   }
1822   if (Machine->config->default_layout != NULL)
1811   if (target->machine->config->default_layout != NULL)
18231812   {
1824      *nextfile = layout_file_load(NULL, Machine->config->default_layout);
1813      *nextfile = layout_file_load(NULL, target->machine->config->default_layout);
18251814      if (*nextfile != NULL)
18261815         nextfile = &(*nextfile)->next;
18271816   }
18281817
18291818   /* try to load another file based on the parent driver name */
1830   cloneof = driver_get_clone(Machine->gamedrv);
1819   cloneof = driver_get_clone(target->machine->gamedrv);
18311820   if (cloneof != NULL)
18321821   {
18331822      *nextfile = layout_file_load(cloneof->name, cloneof->name);
r3373r3374
18381827   }
18391828
18401829   /* now do the built-in layouts for single-screen games */
1841   if (video_screen_count(Machine->config) == 1)
1830   if (video_screen_count(target->machine->config) == 1)
18421831   {
1843      if (Machine->gamedrv->flags & ORIENTATION_SWAP_XY)
1832      if (target->machine->gamedrv->flags & ORIENTATION_SWAP_XY)
18441833         *nextfile = layout_file_load(NULL, layout_vertical);
18451834      else
18461835         *nextfile = layout_file_load(NULL, layout_horizont);
r3373r3374
19921981               height = (finalorient & ORIENTATION_SWAP_XY) ? (prim->bounds.x1 - prim->bounds.x0) : (prim->bounds.y1 - prim->bounds.y0);
19931982               width = MIN(width, target->maxtexwidth);
19941983               height = MIN(height, target->maxtexheight);
1995               if (render_texture_get_scaled(item->texture, width, height, &prim->texture, &list->reflist))
1984               if (texture_get_scaled(item->texture, width, height, &prim->texture, &list->reflist))
19961985               {
1997                  /* override the palette with our adjusted palette */
1998                  switch (item->texture->format)
1999                  {
2000                     case TEXFORMAT_PALETTE16:   prim->texture.palette = &container->bcglookup[prim->texture.palette - palette_entry_list_adjusted(Machine->palette)]; break;
2001                     case TEXFORMAT_PALETTEA16:   prim->texture.palette = &container->bcglookup[prim->texture.palette - palette_entry_list_adjusted(Machine->palette)]; break;
2002                     case TEXFORMAT_RGB15:      prim->texture.palette = &container->bcglookup32[0];      break;
2003                     case TEXFORMAT_RGB32:      prim->texture.palette = &container->bcglookup256[0];   break;
2004                     case TEXFORMAT_ARGB32:      prim->texture.palette = &container->bcglookup256[0];   break;
2005                     case TEXFORMAT_YUY16:      prim->texture.palette = &container->bcglookup256[0];   break;
2006                     default:               assert(FALSE);
2007                  }
1986                  /* set the palette */
1987                  prim->texture.palette = texture_get_adjusted_palette(item->texture, container);
20081988
20091989                  /* determine UV coordinates and apply clipping */
20101990                  prim->texcoords = oriented_texcoords[finalorient];
r3373r3374
20552035      prim->color = container_xform.color;
20562036      width = render_round_nearest(prim->bounds.x1) - render_round_nearest(prim->bounds.x0);
20572037      height = render_round_nearest(prim->bounds.y1) - render_round_nearest(prim->bounds.y0);
2058      if (render_texture_get_scaled(container->overlaytexture,
2038      if (texture_get_scaled(container->overlaytexture,
20592039            (container_xform.orientation & ORIENTATION_SWAP_XY) ? height : width,
20602040            (container_xform.orientation & ORIENTATION_SWAP_XY) ? width : height, &prim->texture, &list->reflist))
20612041      {
r3373r3374
21112091      height = MIN(height, target->maxtexheight);
21122092
21132093      /* get the scaled texture and append it */
2114      if (render_texture_get_scaled(texture, width, height, &prim->texture, &list->reflist))
2094      if (texture_get_scaled(texture, width, height, &prim->texture, &list->reflist))
21152095      {
21162096         /* compute the clip rect */
21172097         cliprect.x0 = render_round_nearest(xform->xoffs);
r3373r3374
24192399
24202400   /* loop over targets */
24212401   for (target = targetlist; target != NULL; target = target->next)
2422      for (listnum = 0; listnum < NUM_PRIMLISTS; listnum++)
2402      for (listnum = 0; listnum < ARRAY_LENGTH(target->primlist); listnum++)
24232403      {
24242404         render_primitive_list *list = &target->primlist[listnum];
24252405         osd_lock_acquire(list->lock);
r3373r3374
24952475   if (texture->bitmap != NULL)
24962476      invalidate_all_render_ref(texture->bitmap);
24972477
2478   /* release palette references */
2479   if (texture->palette != NULL)
2480      palette_deref(texture->palette);
2481
2482   /* free any B/C/G lookup tables */
2483   if (texture->bcglookup != NULL)
2484      free(texture->bcglookup);
2485
24982486   /* add ourself back to the free list */
24992487   base_save = texture->base;
25002488   memset(texture, 0, sizeof(*texture));
r3373r3374
25092497    bitmap
25102498-------------------------------------------------*/
25112499
2512void render_texture_set_bitmap(render_texture *texture, bitmap_t *bitmap, const rectangle *sbounds, UINT32 palettebase, int format)
2500void render_texture_set_bitmap(render_texture *texture, bitmap_t *bitmap, const rectangle *sbounds, int format, palette_t *palette)
25132501{
25142502   int scalenum;
25152503
2504   /* ensure we have a valid palette for palettized modes */
2505   if (format == TEXFORMAT_PALETTE16 || format == TEXFORMAT_PALETTEA16)
2506      assert(palette != NULL);
2507
25162508   /* invalidate references to the old bitmap */
25172509   if (bitmap != texture->bitmap && texture->bitmap != NULL)
25182510      invalidate_all_render_ref(texture->bitmap);
25192511
2512   /* if the palette is different, adjust references */
2513   if (palette != texture->palette)
2514   {
2515      if (texture->palette != NULL)
2516         palette_deref(texture->palette);
2517      if (palette != NULL)
2518         palette_ref(palette);
2519   }
2520
25202521   /* set the new bitmap/palette */
25212522   texture->bitmap = bitmap;
25222523   texture->sbounds.min_x = (sbounds != NULL) ? sbounds->min_x : 0;
25232524   texture->sbounds.min_y = (sbounds != NULL) ? sbounds->min_y : 0;
25242525   texture->sbounds.max_x = (sbounds != NULL) ? sbounds->max_x : (bitmap != NULL) ? bitmap->width : 1000;
25252526   texture->sbounds.max_y = (sbounds != NULL) ? sbounds->max_y : (bitmap != NULL) ? bitmap->height : 1000;
2526   texture->palettebase = palettebase;
2527   texture->palette = palette;
25272528   texture->format = format;
25282529
25292530   /* invalidate all scaled versions */
r3373r3374
25412542
25422543
25432544/*-------------------------------------------------
2544    render_texture_get_scaled - get a scaled
2545    texture_get_scaled - get a scaled
25452546    bitmap (if we can)
25462547-------------------------------------------------*/
25472548
2548static int render_texture_get_scaled(render_texture *texture, UINT32 dwidth, UINT32 dheight, render_texinfo *texinfo, render_ref **reflist)
2549static int texture_get_scaled(render_texture *texture, UINT32 dwidth, UINT32 dheight, render_texinfo *texinfo, render_ref **reflist)
25492550{
25502551   UINT8 bpp = (texture->format == TEXFORMAT_PALETTE16 || texture->format == TEXFORMAT_PALETTEA16 || texture->format == TEXFORMAT_RGB15 || texture->format == TEXFORMAT_YUY16) ? 16 : 32;
2551   const rgb_t *palbase = (texture->format == TEXFORMAT_PALETTE16 || texture->format == TEXFORMAT_PALETTEA16) ? palette_entry_list_adjusted(Machine->palette) + texture->palettebase : NULL;
2552   const rgb_t *palbase = (texture->format == TEXFORMAT_PALETTE16 || texture->format == TEXFORMAT_PALETTEA16) ? palette_entry_list_adjusted(texture->palette) : NULL;
25522553   scaled_texture *scaled = NULL;
25532554   int swidth, sheight;
25542555   int scalenum;
r3373r3374
25902591   {
25912592      int lowest = -1;
25922593
2593      /* ask our notifier if we can scale now */
2594      if (rescale_notify != NULL && !(*rescale_notify)(Machine, dwidth, dheight))
2595         return FALSE;
2596
25972594      /* didn't find one -- take the entry with the lowest seqnum */
25982595      for (scalenum = 0; scalenum < ARRAY_LENGTH(texture->scaled); scalenum++)
25992596         if ((lowest == -1 || texture->scaled[scalenum].seqid < texture->scaled[lowest].seqid) && !has_render_ref(*reflist, texture->scaled[scalenum].bitmap))
r3373r3374
26402637}
26412638
26422639
2640/*-------------------------------------------------
2641    texture_get_adjusted_palette - return the
2642    adjusted palette for a texture
2643-------------------------------------------------*/
26432644
2645static const rgb_t *texture_get_adjusted_palette(render_texture *texture, render_container *container)
2646{
2647   const rgb_t *adjusted;
2648   int numentries;
2649   int index;
2650
2651   /* override the palette with our adjusted palette */
2652   switch (texture->format)
2653   {
2654      case TEXFORMAT_PALETTE16:
2655      case TEXFORMAT_PALETTEA16:
2656
2657         /* if no adjustment necessary, return the raw palette */
2658         assert(texture->palette != NULL);
2659         adjusted = palette_entry_list_adjusted(texture->palette);
2660         if (container->brightness == 1.0f && container->contrast == 1.0f && container->gamma == 1.0f)
2661            return adjusted;
2662
2663         /* if this is the machine palette, return our precomputed adjusted palette */
2664         if (container->palclient != NULL && palette_client_get_palette(container->palclient) == texture->palette)
2665            return container->bcglookup;
2666
2667         /* otherwise, ensure we have memory allocated and compute the adjusted result ourself */
2668         numentries = palette_get_num_colors(texture->palette) * palette_get_num_groups(texture->palette);
2669         if (texture->bcglookup == NULL || texture->bcglookup_entries < numentries)
2670         {
2671            texture->bcglookup = realloc(texture->bcglookup, numentries * sizeof(*texture->bcglookup));
2672            texture->bcglookup_entries = numentries;
2673         }
2674         for (index = 0; index < numentries; index++)
2675         {
2676            UINT8 r = apply_brightness_contrast_gamma(RGB_RED(adjusted[index]), container->brightness, container->contrast, container->gamma);
2677            UINT8 g = apply_brightness_contrast_gamma(RGB_GREEN(adjusted[index]), container->brightness, container->contrast, container->gamma);
2678            UINT8 b = apply_brightness_contrast_gamma(RGB_BLUE(adjusted[index]), container->brightness, container->contrast, container->gamma);
2679            texture->bcglookup[index] = MAKE_ARGB(RGB_ALPHA(adjusted[index]), r, g, b);
2680         }
2681         return texture->bcglookup;
2682
2683      case TEXFORMAT_RGB15:
2684
2685         /* if no adjustment necessary, return NULL */
2686         if (container->brightness == 1.0f && container->contrast == 1.0f && container->gamma == 1.0f && texture->palette == NULL)
2687            return NULL;
2688
2689         /* if no palette, return the standard lookups */
2690         if (texture->palette == NULL)
2691            return container->bcglookup32;
2692
2693         /* otherwise, ensure we have memory allocated and compute the adjusted result ourself */
2694         assert(palette_get_num_colors(texture->palette) == 32);
2695         adjusted = palette_entry_list_adjusted(texture->palette);
2696         if (texture->bcglookup == NULL || texture->bcglookup_entries < 4 * 32)
2697         {
2698            texture->bcglookup = realloc(texture->bcglookup, 4 * 32 * sizeof(*texture->bcglookup));
2699            texture->bcglookup_entries = 4 * 32;
2700         }
2701
2702         /* otherwise, return the 32-entry BCG lookups */
2703         for (index = 0; index < 32; index++)
2704         {
2705            UINT8 val = apply_brightness_contrast_gamma(RGB_GREEN(adjusted[index]), container->brightness, container->contrast, container->gamma);
2706            texture->bcglookup[0x00 + index] = val << 0;
2707            texture->bcglookup[0x20 + index] = val << 8;
2708            texture->bcglookup[0x40 + index] = val << 16;
2709            texture->bcglookup[0x60 + index] = val << 24;
2710         }
2711         return texture->bcglookup;
2712
2713      case TEXFORMAT_RGB32:
2714      case TEXFORMAT_ARGB32:
2715      case TEXFORMAT_YUY16:
2716
2717         /* if no adjustment necessary, return NULL */
2718         if (container->brightness == 1.0f && container->contrast == 1.0f && container->gamma == 1.0f && texture->palette == NULL)
2719            return NULL;
2720
2721         /* if no palette, return the standard lookups */
2722         if (texture->palette == NULL)
2723            return container->bcglookup256;
2724
2725         /* otherwise, ensure we have memory allocated and compute the adjusted result ourself */
2726         assert(palette_get_num_colors(texture->palette) == 256);
2727         adjusted = palette_entry_list_adjusted(texture->palette);
2728         if (texture->bcglookup == NULL || texture->bcglookup_entries < 4 * 256)
2729         {
2730            texture->bcglookup = realloc(texture->bcglookup, 4 * 256 * sizeof(*texture->bcglookup));
2731            texture->bcglookup_entries = 4 * 256;
2732         }
2733
2734         /* otherwise, return the 32-entry BCG lookups */
2735         for (index = 0; index < 256; index++)
2736         {
2737            UINT8 val = apply_brightness_contrast_gamma(RGB_GREEN(adjusted[index]), container->brightness, container->contrast, container->gamma);
2738            texture->bcglookup[0x000 + index] = val << 0;
2739            texture->bcglookup[0x100 + index] = val << 8;
2740            texture->bcglookup[0x200 + index] = val << 16;
2741            texture->bcglookup[0x300 + index] = val << 24;
2742         }
2743         return texture->bcglookup;
2744
2745      default:
2746         assert(FALSE);
2747   }
2748
2749   return NULL;
2750}
2751
2752
2753
26442754/***************************************************************************
26452755    RENDER CONTAINERS
26462756***************************************************************************/
r3373r3374
26502760    container
26512761-------------------------------------------------*/
26522762
2653static render_container *render_container_alloc(void)
2763static render_container *render_container_alloc(running_machine *machine)
26542764{
26552765   render_container *container;
26562766   int color;
r3373r3374
26742784   render_container_empty(container);
26752785
26762786   /* allocate a client to the main palette */
2677   if (Machine->palette != NULL)
2678      container->palclient = palette_client_alloc(Machine->palette);
2787   if (machine->palette != NULL)
2788      container->palclient = palette_client_alloc(machine->palette);
26792789   render_container_recompute_lookups(container);
26802790   return container;
26812791}
r3373r3374
27882898   if (container->overlaybitmap != NULL)
27892899   {
27902900      container->overlaytexture = render_texture_alloc(render_container_overlay_scale, NULL);
2791      render_texture_set_bitmap(container->overlaytexture, bitmap, NULL, 0, TEXFORMAT_ARGB32);
2901      render_texture_set_bitmap(container->overlaytexture, bitmap, NULL, TEXFORMAT_ARGB32, NULL);
27922902   }
27932903}
27942904
r3373r3374
28272937
28282938
28292939/*-------------------------------------------------
2830    render_container_set_palette_alpha - set the
2831    opacity of a given palette entry
2832-------------------------------------------------*/
2833
2834void render_container_set_palette_alpha(render_container *container, UINT32 entry, UINT8 alpha)
2835{
2836   assert(entry < ARRAY_LENGTH(container->bcglookup));
2837   container->bcglookup[entry] = (alpha << 24) | (container->bcglookup[entry] & 0x00ffffff);
2838}
2839
2840
2841/*-------------------------------------------------
28422940    render_container_item_add_generic - add a
28432941    generic item to a container
28442942-------------------------------------------------*/
r3373r3374
29843082      for (i = 0; i < colors; i++)
29853083      {
29863084         pen_t newval = adjusted_palette[i];
2987         container->bcglookup[i] = (container->bcglookup[i] & 0xff000000) |
3085         container->bcglookup[i] = (newval & 0xff000000) |
29883086                             container->bcglookup256[0x200 + RGB_RED(newval)] |
29893087                             container->bcglookup256[0x100 + RGB_GREEN(newval)] |
29903088                             container->bcglookup256[0x000 + RGB_BLUE(newval)];
r3373r3374
30293127               {
30303128                  UINT32 finalentry = entry32 * 32 + entry;
30313129                  rgb_t newval = adjusted_palette[finalentry];
3032                  container->bcglookup[finalentry] = (container->bcglookup[finalentry] & 0xff000000) |
3130                  container->bcglookup[finalentry] = (newval & 0xff000000) |
30333131                                         container->bcglookup256[0x200 + RGB_RED(newval)] |
30343132                                         container->bcglookup256[0x100 + RGB_GREEN(newval)] |
30353133                                         container->bcglookup256[0x000 + RGB_BLUE(newval)];
src/emu/render.h
r3373r3374
8888/* texture formats */
8989enum
9090{
91   TEXFORMAT_UNDEFINED = 0,            /* require a format to be specified */
92   TEXFORMAT_PALETTE16,            /* 16bpp palettized, alpha ignored */
93   TEXFORMAT_PALETTEA16,            /* 16bpp palettized, alpha respected */
94   TEXFORMAT_RGB15,            /* 16bpp 5-5-5 RGB */
95   TEXFORMAT_RGB32,            /* 32bpp 8-8-8 RGB */
96   TEXFORMAT_ARGB32,            /* 32bpp 8-8-8-8 ARGB */
97   TEXFORMAT_YUY16               /* 16bpp 8-8 Y/Cb, Y/Cr in sequence */
91   TEXFORMAT_UNDEFINED = 0,                  /* require a format to be specified */
92   TEXFORMAT_PALETTE16,                     /* 16bpp palettized, alpha ignored */
93   TEXFORMAT_PALETTEA16,                     /* 16bpp palettized, alpha respected */
94   TEXFORMAT_RGB15,                        /* 16bpp 5-5-5 RGB */
95   TEXFORMAT_RGB32,                        /* 32bpp 8-8-8 RGB */
96   TEXFORMAT_ARGB32,                        /* 32bpp 8-8-8-8 ARGB */
97   TEXFORMAT_YUY16                           /* 16bpp 8-8 Y/Cb, Y/Cr in sequence */
9898};
9999
100100/* blending modes */
101101enum
102102{
103   BLENDMODE_NONE = 0,            /* no blending */
104   BLENDMODE_ALPHA,            /* standard alpha blend */
105   BLENDMODE_RGB_MULTIPLY,            /* apply source alpha to source pix, then multiply RGB values */
106   BLENDMODE_ADD               /* apply source alpha to source pix, then add to destination */
103   BLENDMODE_NONE = 0,                        /* no blending */
104   BLENDMODE_ALPHA,                        /* standard alpha blend */
105   BLENDMODE_RGB_MULTIPLY,                     /* apply source alpha to source pix, then multiply RGB values */
106   BLENDMODE_ADD                           /* apply source alpha to source pix, then add to destination */
107107};
108108
109109
r3373r3374
350350/* ----- render target management ----- */
351351
352352/* allocate a new render target */
353render_target *render_target_alloc(const char *layout, UINT32 flags);
353render_target *render_target_alloc(running_machine *machine, const char *layout, UINT32 flags);
354354
355355/* free memory for a render target */
356356void render_target_free(render_target *target);
r3373r3374
424424void render_texture_free(render_texture *texture);
425425
426426/* set a new source bitmap */
427void render_texture_set_bitmap(render_texture *texture, bitmap_t *bitmap, const rectangle *sbounds, UINT32 palettebase, int format);
427void render_texture_set_bitmap(render_texture *texture, bitmap_t *bitmap, const rectangle *sbounds, int format, palette_t *palette);
428428
429429/* generic high quality resampling scaler */
430430void render_texture_hq_scale(bitmap_t *dest, const bitmap_t *source, const rectangle *sbounds, void *param);
r3373r3374
454454/* return a pointer to the container for the given screen */
455455render_container *render_container_get_screen(const device_config *screen);
456456
457/* set the opacity of a given palette entry */
458void render_container_set_palette_alpha(render_container *container, UINT32 entry, UINT8 alpha);
459
460457/* add a line item to the specified container */
461458void render_container_add_line(render_container *container, float x0, float y0, float x1, float y1, float width, rgb_t argb, UINT32 flags);
462459
src/emu/emupal.h
r3373r3374
225225
226226
227227/*-------------------------------------------------
228    palette_set_brightness - set the per-pen
229    brightness factor
228    palette_set_pen_contrast - set the per-pen
229    contrast factor
230230-------------------------------------------------*/
231231
232INLINE void palette_set_brightness(running_machine *machine, pen_t pen, double bright)
232INLINE void palette_set_pen_contrast(running_machine *machine, pen_t pen, double bright)
233233{
234234   palette_entry_set_contrast(machine->palette, pen, bright);
235235}
src/lib/util/palette.c
r3373r3374
1010******************************************************************************/
1111
1212#include "palette.h"
13#include <math.h>
1314
1415
1516
r3373r3374
4445   UINT32         numcolors;               /* number of colors in the palette */
4546   UINT32         numgroups;               /* number of groups in the palette */
4647
48   float         brightness;               /* overall brightness value */
49   float         contrast;               /* overall contrast value */
50   float         gamma;                  /* overall gamma value */
51   UINT8         gamma_map[256];            /* gamma map */
52
4753   rgb_t *         entry_color;            /* array of raw colors */
4854   float *         entry_contrast;            /* contrast value for each entry */
4955   rgb_t *         adjusted_color;            /* array of adjusted colors */
r3373r3374
7581    entry for brightness
7682-------------------------------------------------*/
7783
78INLINE rgb_t adjust_palette_entry(rgb_t entry, float brightness, float contrast)
84INLINE rgb_t adjust_palette_entry(rgb_t entry, float brightness, float contrast, const UINT8 *gamma_map)
7985{
80   int r = rgb_clamp((float)RGB_RED(entry) * contrast + brightness);
81   int g = rgb_clamp((float)RGB_GREEN(entry) * contrast + brightness);
82   int b = rgb_clamp((float)RGB_BLUE(entry) * contrast + brightness);
83   return MAKE_RGB(r,g,b);
86   int r = rgb_clamp((float)gamma_map[RGB_RED(entry)] * contrast + brightness);
87   int g = rgb_clamp((float)gamma_map[RGB_GREEN(entry)] * contrast + brightness);
88   int b = rgb_clamp((float)gamma_map[RGB_BLUE(entry)] * contrast + brightness);
89   int a = RGB_ALPHA(entry);
90   return MAKE_ARGB(a,r,g,b);
8491}
8592
8693
r3373r3374
105112      goto error;
106113   memset(palette, 0, sizeof(*palette));
107114
115   /* initialize overall controls */
116   palette->brightness = 0.0f;
117   palette->contrast = 1.0f;
118   palette->gamma = 1.0f;
119   for (index = 0; index < 256; index++)
120      palette->gamma_map[index] = index;
121
108122   /* allocate an array of palette entries and individual contrasts for each */
109123   palette->entry_color = malloc(sizeof(*palette->entry_color) * numcolors);
110124   palette->entry_contrast = malloc(sizeof(*palette->entry_contrast) * numcolors);
r3373r3374
461475***************************************************************************/
462476
463477/*-------------------------------------------------
478    palette_set_brightness - set the overall
479    brightness for the palette
480-------------------------------------------------*/
481
482void palette_set_brightness(palette_t *palette, float brightness)
483{
484   int groupnum, index;
485
486   /* convert incoming value to normalized result */
487   brightness = (brightness - 1.0f) * 256.0f;
488
489   /* set the global brightness if changed */
490   if (palette->brightness == brightness)
491      return;
492   palette->brightness = brightness;
493
494   /* update across all indices in all groups */
495   for (groupnum = 0; groupnum < palette->numgroups; groupnum++)
496      for (index = 0; index < palette->numcolors; index++)
497         update_adjusted_color(palette, groupnum, index);
498}
499
500
501/*-------------------------------------------------
502    palette_set_contrast - set the overall
503    contrast for the palette
504-------------------------------------------------*/
505
506void palette_set_contrast(palette_t *palette, float contrast)
507{
508   int groupnum, index;
509
510   /* set the global contrast if changed */
511   if (palette->contrast == contrast)
512      return;
513   palette->contrast = contrast;
514
515   /* update across all indices in all groups */
516   for (groupnum = 0; groupnum < palette->numgroups; groupnum++)
517      for (index = 0; index < palette->numcolors; index++)
518         update_adjusted_color(palette, groupnum, index);
519}
520
521
522/*-------------------------------------------------
523    palette_set_gamma - set the overall
524    gamma for the palette
525-------------------------------------------------*/
526
527void palette_set_gamma(palette_t *palette, float gamma)
528{
529   int groupnum, index;
530
531   /* set the global gamma if changed */
532   if (palette->gamma == gamma)
533      return;
534   palette->gamma = gamma;
535
536   /* recompute the gamma map */
537   gamma = 1.0f / gamma;
538   for (index = 0; index < 256; index++)
539   {
540      float fval = (float)index * (1.0f / 255.0f);
541      float fresult = pow(fval, gamma);
542      palette->gamma_map[index] = rgb_clamp(255.0f * fresult);
543   }
544
545   /* update across all indices in all groups */
546   for (groupnum = 0; groupnum < palette->numgroups; groupnum++)
547      for (index = 0; index < palette->numcolors; index++)
548         update_adjusted_color(palette, groupnum, index);
549}
550
551
552/*-------------------------------------------------
464553    palette_entry_set_contrast - set the contrast
465554    adjustment for a single palette index
466555-------------------------------------------------*/
r3373r3374
502591{
503592   int index;
504593
594   /* convert incoming value to normalized result */
595   brightness = (brightness - 1.0f) * 256.0f;
596
505597   /* if out of range, or unchanged, ignore */
506598   if (group >= palette->numgroups || palette->group_bright[group] == brightness)
507599      return;
r3373r3374
631723   rgb_t adjusted;
632724
633725   /* compute the adjusted value */
634   adjusted = adjust_palette_entry(palette->entry_color[index], palette->group_bright[group], palette->group_contrast[group] * palette->entry_contrast[index]);
726   adjusted = adjust_palette_entry(palette->entry_color[index],
727            palette->group_bright[group] + palette->brightness,
728            palette->group_contrast[group] * palette->entry_contrast[index] * palette->contrast,
729            palette->gamma_map);
635730
636731   /* if not different, ignore */
637732   if (palette->adjusted_color[finalindex] == adjusted)
src/lib/util/palette.h
r3373r3374
4040***************************************************************************/
4141
4242/* macros to assemble rgb_t values */
43#define MAKE_RGB(r,g,b)    ((((rgb_t)(r) & 0xff) << 16) | (((rgb_t)(g) & 0xff) << 8) | ((rgb_t)(b) & 0xff))
44#define MAKE_ARGB(a,r,g,b)   (MAKE_RGB(r,g,b) | (((rgb_t)(a) & 0xff) << 24))
43#define MAKE_ARGB(a,r,g,b)    ((((rgb_t)(a) & 0xff) << 24) | (((rgb_t)(r) & 0xff) << 16) | (((rgb_t)(g) & 0xff) << 8) | ((rgb_t)(b) & 0xff))
44#define MAKE_RGB(r,g,b)      (MAKE_ARGB(255,r,g,b))
4545
4646/* macros to extract components from rgb_t values */
4747#define RGB_ALPHA(rgb)      (((rgb) >> 24) & 0xff)
r3373r3374
5050#define RGB_BLUE(rgb)      ((rgb) & 0xff)
5151
5252/* common colors */
53#define RGB_BLACK         (MAKE_RGB(0,0,0))
54#define RGB_WHITE         (MAKE_RGB(255,255,255))
53#define RGB_BLACK         (MAKE_ARGB(255,0,0,0))
54#define RGB_WHITE         (MAKE_ARGB(255,255,255,255))
5555
5656
5757
r3373r3374
129129
130130/* ----- palette adjustments ----- */
131131
132/* set the overall brightness for the palette */
133void palette_set_brightness(palette_t *palette, float brightness);
134
135/* set the overall contrast for the palette */
136void palette_set_contrast(palette_t *palette, float contrast);
137
138/* set the overall gamma for the palette */
139void palette_set_gamma(palette_t *palette, float gamma);
140
132141/* set the contrast adjustment for a single palette index */
133142void palette_entry_set_contrast(palette_t *palette, UINT32 index, float contrast);
134143
src/lib/util/aviio.c
r3373r3374
643643      if (avierr == AVIERR_NONE && file->riffbase == 0)
644644         avierr = write_idx1_chunk(file);
645645
646      /* close the RIFF chunk */
647      if (avierr == AVIERR_NONE)
648         avierr = chunk_close(file);
649
650      /* update the avih chunk */
651      if (avierr == AVIERR_NONE)
652         avierr = write_avih_chunk(file, FALSE);
653
654646      /* update the strh and indx chunks for each stream */
655647      for (strnum = 0; strnum < file->streams; strnum++)
656648      {
r3373r3374
659651         if (avierr == AVIERR_NONE)
660652            avierr = write_indx_chunk(file, &file->stream[strnum], FALSE);
661653      }
654
655      /* update the avih chunk */
656      if (avierr == AVIERR_NONE)
657         avierr = write_avih_chunk(file, FALSE);
658
659      /* close the RIFF chunk */
660      if (avierr == AVIERR_NONE)
661         avierr = chunk_close(file);
662662   }
663663
664664   /* close the file */
r3373r3374
17161716{
17171717   file_error filerr;
17181718   avi_error avierr;
1719   UINT32 idxreserve;
17191720   UINT32 written;
17201721
1722   /* if we are the first RIFF, we must reserve enough space for the IDX chunk */
1723   idxreserve = 0;
1724   if (file->riffbase == 0 && type != CHUNKTYPE_IDX1)
1725      idxreserve = compute_idx1_size(file);
1726
17211727   /* if we are getting too big, split the RIFF */
17221728   /* note that we ignore writes before the current RIFF base, as those are assumed to be
17231729       overwrites of a chunk from the previous RIFF */
1724   if ((file->riffbase == 0 && file->writeoffs + length + compute_idx1_size(file) >= MAX_RIFF_SIZE) ||
1725      (file->writeoffs >= file->riffbase && file->writeoffs + length - file->riffbase >= MAX_RIFF_SIZE))
1730   if (file->writeoffs >= file->riffbase && file->writeoffs + length + idxreserve - file->riffbase >= MAX_RIFF_SIZE)
17261731   {
17271732      /* close the movi list */
17281733      avierr = chunk_close(file);
src/lib/util/vbiparse.c
r3373r3374
367367
368368void vbi_metadata_unpack(vbi_metadata *vbi, UINT32 *framenum, const UINT8 *source)
369369{
370   *framenum = (source[0] << 16) | (source[1] << 8) | source[2];
370   if (framenum != NULL)
371      *framenum = (source[0] << 16) | (source[1] << 8) | source[2];
371372   vbi->white = source[3];
372373   vbi->line16 = (source[4] << 16) | (source[5] << 8) | source[6];
373374   vbi->line17 = (source[7] << 16) | (source[8] << 8) | source[9];
src/mess/tools/messtest/testmess.c
r3373r3374
438438void osd_init(running_machine *machine)
439439{
440440   add_exit_callback(machine, testmess_exit);
441   target = render_target_alloc(NULL, 0);
441   target = render_target_alloc(machine, NULL, 0);
442442   render_target_set_orientation(target, 0);
443443}
444444
src/mess/video/hd66421.c
r3373r3374
108108   {
109109      palette_set_color( machine, i, RGB_WHITE);
110110      #ifndef BRIGHTNESS_DOES_NOT_WORK
111      palette_set_brightness( machine, i, 1.0 * i / (4 - 1));
111      palette_set_pen_contrast( machine, i, 1.0 * i / (4 - 1));
112112      #endif
113113   }
114114}
r3373r3374
148148      #ifdef BRIGHTNESS_DOES_NOT_WORK
149149      palette_set_color( screen->machine, pen[i], 255 * bright, 255 * bright, 255 * bright);
150150      #else
151      palette_set_brightness( screen->machine, pen[i], bright);
151      palette_set_pen_contrast( screen->machine, pen[i], bright);
152152      #endif
153153   }
154154   // draw bitmap (bottom to top)
src/mess/includes/atom.h
r3373r3374
2020
2121MACHINE_RESET( atom );
2222QUICKLOAD_LOAD( atom );
23READ8_HANDLER (atom_8255_porta_r);
24READ8_HANDLER (atom_8255_portb_r);
25READ8_HANDLER (atom_8255_portc_r);
26WRITE8_HANDLER (atom_8255_porta_w );
27WRITE8_HANDLER (atom_8255_portb_w );
28WRITE8_HANDLER (atom_8255_portc_w );
23READ8_DEVICE_HANDLER (atom_8255_porta_r);
24READ8_DEVICE_HANDLER (atom_8255_portb_r);
25READ8_DEVICE_HANDLER (atom_8255_portc_r);
26WRITE8_DEVICE_HANDLER (atom_8255_porta_w );
27WRITE8_DEVICE_HANDLER (atom_8255_portb_w );
28WRITE8_DEVICE_HANDLER (atom_8255_portc_w );
2929
3030/* for floppy disc interface */
3131READ8_HANDLER (atom_8271_r);
src/mess/machine/radio86.c
r3373r3374
4343   radio_ram_disk = auto_malloc(0x20000);
4444   memset(radio_ram_disk,0,0x20000);
4545}
46static READ8_HANDLER (radio86_8255_portb_r2 )
46static READ8_DEVICE_HANDLER (radio86_8255_portb_r2 )
4747{
4848   UINT8 key = 0xff;
49   if ((radio86_keyboard_mask & 0x01)!=0) { key &= input_port_read(machine,"LINE0"); }
50   if ((radio86_keyboard_mask & 0x02)!=0) { key &= input_port_read(machine,"LINE1"); }
51   if ((radio86_keyboard_mask & 0x04)!=0) { key &= input_port_read(machine,"LINE2"); }
52   if ((radio86_keyboard_mask & 0x08)!=0) { key &= input_port_read(machine,"LINE3"); }
53   if ((radio86_keyboard_mask & 0x10)!=0) { key &= input_port_read(machine,"LINE4"); }
54   if ((radio86_keyboard_mask & 0x20)!=0) { key &= input_port_read(machine,"LINE5"); }
55   if ((radio86_keyboard_mask & 0x40)!=0) { key &= input_port_read(machine,"LINE6"); }
56   if ((radio86_keyboard_mask & 0x80)!=0) { key &= input_port_read(machine,"LINE7"); }
49   if ((radio86_keyboard_mask & 0x01)!=0) { key &= input_port_read(device->machine,"LINE0"); }
50   if ((radio86_keyboard_mask & 0x02)!=0) { key &= input_port_read(device->machine,"LINE1"); }
51   if ((radio86_keyboard_mask & 0x04)!=0) { key &= input_port_read(device->machine,"LINE2"); }
52   if ((radio86_keyboard_mask & 0x08)!=0) { key &= input_port_read(device->machine,"LINE3"); }
53   if ((radio86_keyboard_mask & 0x10)!=0) { key &= input_port_read(device->machine,"LINE4"); }
54   if ((radio86_keyboard_mask & 0x20)!=0) { key &= input_port_read(device->machine,"LINE5"); }
55   if ((radio86_keyboard_mask & 0x40)!=0) { key &= input_port_read(device->machine,"LINE6"); }
56   if ((radio86_keyboard_mask & 0x80)!=0) { key &= input_port_read(device->machine,"LINE7"); }
5757   return key;
5858}
5959
60static READ8_HANDLER (radio86_8255_portc_r2 )
60static READ8_DEVICE_HANDLER (radio86_8255_portc_r2 )
6161{
62   double level = cassette_input(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ));                                               
63   UINT8 dat = input_port_read(machine,"LINE8");
62   double level = cassette_input(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ));                                               
63   UINT8 dat = input_port_read(device->machine, "LINE8");
6464   if (level <  0) {
6565      dat ^= radio86_tape_value;
6666    }   
6767   return dat;   
6868}
6969
70static WRITE8_HANDLER (radio86_8255_porta_w2 )
70static WRITE8_DEVICE_HANDLER (radio86_8255_porta_w2 )
7171{
7272   radio86_keyboard_mask = data ^ 0xff;
7373}
7474
75static WRITE8_HANDLER (radio86_8255_portc_w2 )
75static WRITE8_DEVICE_HANDLER (radio86_8255_portc_w2 )
7676{
77   cassette_output(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ),data & 0x01 ? 1 : -1);   
77   cassette_output(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ),data & 0x01 ? 1 : -1);   
7878}
7979
8080
r3373r3374
100100
101101
102102
103static READ8_HANDLER (rk7007_8255_portc_r )
103static READ8_DEVICE_HANDLER (rk7007_8255_portc_r )
104104{
105   double level = cassette_input(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ));                                               
105   double level = cassette_input(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ));                                               
106106   UINT8 key = 0xff;
107   if ((radio86_keyboard_mask & 0x01)!=0) { key &= input_port_read(machine,"CLINE0"); }
108   if ((radio86_keyboard_mask & 0x02)!=0) { key &= input_port_read(machine,"CLINE1"); }
109   if ((radio86_keyboard_mask & 0x04)!=0) { key &= input_port_read(machine,"CLINE2"); }
110   if ((radio86_keyboard_mask & 0x08)!=0) { key &= input_port_read(machine,"CLINE3"); }
111   if ((radio86_keyboard_mask & 0x10)!=0) { key &= input_port_read(machine,"CLINE4"); }
112   if ((radio86_keyboard_mask & 0x20)!=0) { key &= input_port_read(machine,"CLINE5"); }
113   if ((radio86_keyboard_mask & 0x40)!=0) { key &= input_port_read(machine,"CLINE6"); }
114   if ((radio86_keyboard_mask & 0x80)!=0) { key &= input_port_read(machine,"CLINE7"); }
107   if ((radio86_keyboard_mask & 0x01)!=0) { key &= input_port_read(device->machine,"CLINE0"); }
108   if ((radio86_keyboard_mask & 0x02)!=0) { key &= input_port_read(device->machine,"CLINE1"); }
109   if ((radio86_keyboard_mask & 0x04)!=0) { key &= input_port_read(device->machine,"CLINE2"); }
110   if ((radio86_keyboard_mask & 0x08)!=0) { key &= input_port_read(device->machine,"CLINE3"); }
111   if ((radio86_keyboard_mask & 0x10)!=0) { key &= input_port_read(device->machine,"CLINE4"); }
112   if ((radio86_keyboard_mask & 0x20)!=0) { key &= input_port_read(device->machine,"CLINE5"); }
113   if ((radio86_keyboard_mask & 0x40)!=0) { key &= input_port_read(device->machine,"CLINE6"); }
114   if ((radio86_keyboard_mask & 0x80)!=0) { key &= input_port_read(device->machine,"CLINE7"); }
115115   key &= 0xe0;
116116   if (level <  0) {
117117      key ^= radio86_tape_value;
r3373r3374
198198   disk_sel = data;
199199}
200200
201static READ8_HANDLER (radio86_romdisk_porta_r )
201static READ8_DEVICE_HANDLER (radio86_romdisk_porta_r )
202202{
203   UINT8 *romdisk = memory_region(machine, "main") + 0x10000;   
203   UINT8 *romdisk = memory_region(device->machine, "main") + 0x10000;   
204204   if ((disk_sel & 0x0f) ==0) {
205205      return romdisk[romdisk_msb*256+romdisk_lsb];   
206206   } else {
r3373r3374
212212   }
213213}
214214
215static WRITE8_HANDLER (radio86_romdisk_portb_w )
215static WRITE8_DEVICE_HANDLER (radio86_romdisk_portb_w )
216216{   
217217   romdisk_lsb = data;
218218}
219219
220static WRITE8_HANDLER (radio86_romdisk_portc_w )
220static WRITE8_DEVICE_HANDLER (radio86_romdisk_portc_w )
221221{     
222222   romdisk_msb = data;   
223223}
r3373r3374
232232   radio86_romdisk_portc_w
233233};
234234
235static WRITE8_HANDLER (mikrosha_8255_font_page_w )
235static WRITE8_DEVICE_HANDLER (mikrosha_8255_font_page_w )
236236{
237237   mikrosha_font_page = (data  > 7) & 1;
238238}
src/mess/machine/b2m.c
r3373r3374
197197   }
198198};
199199
200static WRITE8_HANDLER (b2m_8255_porta_w )
200static WRITE8_DEVICE_HANDLER (b2m_8255_porta_w )
201201{   
202202   b2m_8255_porta = data;
203203}
204static WRITE8_HANDLER (b2m_8255_portb_w )
204static WRITE8_DEVICE_HANDLER (b2m_8255_portb_w )
205205{   
206206   b2m_video_scroll = data;
207207}
208208
209static WRITE8_HANDLER (b2m_8255_portc_w )
209static WRITE8_DEVICE_HANDLER (b2m_8255_portc_w )
210210{   
211211   b2m_8255_portc = data;
212   b2m_set_bank(machine,b2m_8255_portc & 7);
212   b2m_set_bank(device->machine, b2m_8255_portc & 7);
213213   b2m_video_page = (b2m_8255_portc >> 7) & 1;
214214}
215215
216static READ8_HANDLER (b2m_8255_porta_r )
216static READ8_DEVICE_HANDLER (b2m_8255_porta_r )
217217{
218218   return 0xff;
219219}
220static READ8_HANDLER (b2m_8255_portb_r )
220static READ8_DEVICE_HANDLER (b2m_8255_portb_r )
221221{
222222   return b2m_video_scroll;
223223}
224static READ8_HANDLER (b2m_8255_portc_r )
224static READ8_DEVICE_HANDLER (b2m_8255_portc_r )
225225{
226226   return 0xff;
227227}
r3373r3374
236236};
237237
238238
239static WRITE8_HANDLER (b2m_ext_8255_porta_w )
239static WRITE8_DEVICE_HANDLER (b2m_ext_8255_porta_w )
240240{   
241241}
242static WRITE8_HANDLER (b2m_ext_8255_portb_w )
242static WRITE8_DEVICE_HANDLER (b2m_ext_8255_portb_w )
243243{   
244244}
245245
246static WRITE8_HANDLER (b2m_ext_8255_portc_w )
246static WRITE8_DEVICE_HANDLER (b2m_ext_8255_portc_w )
247247{     
248248   UINT8 drive = ((data >> 1) & 1) ^ 1;
249249   UINT8 side  = (data  & 1) ^ 1;
r3373r3374
258258   }
259259}
260260
261static READ8_HANDLER (b2m_ext_8255_porta_r )
261static READ8_DEVICE_HANDLER (b2m_ext_8255_porta_r )
262262{
263263   return 0xff;
264264}
265static READ8_HANDLER (b2m_ext_8255_portb_r )
265static READ8_DEVICE_HANDLER (b2m_ext_8255_portb_r )
266266{
267267   return 0xff;
268268}
269static READ8_HANDLER (b2m_ext_8255_portc_r )
269static READ8_DEVICE_HANDLER (b2m_ext_8255_portc_r )
270270{
271271   return 0xff;
272272}
r3373r3374
281281   b2m_ext_8255_portc_w
282282};
283283
284static READ8_HANDLER (b2m_romdisk_porta_r )
284static READ8_DEVICE_HANDLER (b2m_romdisk_porta_r )
285285{
286   UINT8 *romdisk = memory_region(machine, "main") + 0x12000;     
286   UINT8 *romdisk = memory_region(device->machine, "main") + 0x12000;     
287287   return romdisk[b2m_romdisk_msb*256+b2m_romdisk_lsb];   
288288}
289289
290static WRITE8_HANDLER (b2m_romdisk_portb_w )
290static WRITE8_DEVICE_HANDLER (b2m_romdisk_portb_w )
291291{   
292292   b2m_romdisk_lsb = data;
293293}
294294
295static WRITE8_HANDLER (b2m_romdisk_portc_w )
295static WRITE8_DEVICE_HANDLER (b2m_romdisk_portc_w )
296296{         
297297   b2m_romdisk_msb = data & 0x7f;   
298298}
src/mess/machine/pmd85.c
r3373r3374
224224
225225*******************************************************************************/
226226
227static  READ8_HANDLER ( pmd85_ppi_0_porta_r )
227static  READ8_DEVICE_HANDLER ( pmd85_ppi_0_porta_r )
228228{
229229   return 0xff;
230230}
231231
232static  READ8_HANDLER ( pmd85_ppi_0_portb_r )
232static  READ8_DEVICE_HANDLER ( pmd85_ppi_0_portb_r )
233233{
234234   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7",
235235                              "KEY8", "KEY9", "KEY10", "KEY11", "KEY12", "KEY13", "KEY14", "KEY15" };
236236
237   return input_port_read(machine, keynames[(pmd85_ppi_port_outputs[0][0] & 0x0f)]) & input_port_read(machine, "KEY15");
237   return input_port_read(device->machine, keynames[(pmd85_ppi_port_outputs[0][0] & 0x0f)]) & input_port_read(device->machine, "KEY15");
238238}
239239
240static  READ8_HANDLER ( pmd85_ppi_0_portc_r )
240static  READ8_DEVICE_HANDLER ( pmd85_ppi_0_portc_r )
241241{
242242   return 0xff;
243243}
244244
245static WRITE8_HANDLER ( pmd85_ppi_0_porta_w )
245static WRITE8_DEVICE_HANDLER ( pmd85_ppi_0_porta_w )
246246{
247247   pmd85_ppi_port_outputs[0][0] = data;
248248}
249249
250static WRITE8_HANDLER ( pmd85_ppi_0_portb_w )
250static WRITE8_DEVICE_HANDLER ( pmd85_ppi_0_portb_w )
251251{
252252   pmd85_ppi_port_outputs[0][1] = data;
253253}
254254
255static WRITE8_HANDLER ( pmd85_ppi_0_portc_w )
255static WRITE8_DEVICE_HANDLER ( pmd85_ppi_0_portc_w )
256256{
257257   pmd85_ppi_port_outputs[0][2] = data;
258258   set_led_status(PMD85_LED_2, (data & 0x08) ? 1 : 0);
r3373r3374
267267
268268*******************************************************************************/
269269
270static  READ8_HANDLER ( mato_ppi_0_portb_r )
270static  READ8_DEVICE_HANDLER ( mato_ppi_0_portb_r )
271271{
272272   int i;
273273   UINT8 data = 0xff;
r3373r3374
276276   for (i = 0; i < 8; i++)
277277   {
278278      if (!(pmd85_ppi_port_outputs[0][0] & (1 << i)))
279         data &= input_port_read(machine, keynames[i]);
279         data &= input_port_read(device->machine, keynames[i]);
280280   }
281281   return data;
282282}
283283
284static  READ8_HANDLER ( mato_ppi_0_portc_r )
284static  READ8_DEVICE_HANDLER ( mato_ppi_0_portc_r )
285285{
286   return input_port_read(machine, "KEY8") | 0x8f;
286   return input_port_read(device->machine, "KEY8") | 0x8f;
287287}
288288
289static WRITE8_HANDLER ( mato_ppi_0_portc_w )
289static WRITE8_DEVICE_HANDLER ( mato_ppi_0_portc_w )
290290{
291291   pmd85_ppi_port_outputs[0][2] = data;
292292   set_led_status(PMD85_LED_2, (data & 0x08) ? 1 : 0);
r3373r3374
301301
302302*******************************************************************************/
303303
304static READ8_HANDLER ( pmd85_ppi_1_porta_r )
304static READ8_DEVICE_HANDLER ( pmd85_ppi_1_porta_r )
305305{
306306   return 0xff;
307307}
308308
309static READ8_HANDLER ( pmd85_ppi_1_portb_r )
309static READ8_DEVICE_HANDLER ( pmd85_ppi_1_portb_r )
310310{
311311   return 0xff;
312312}
313313
314static READ8_HANDLER ( pmd85_ppi_1_portc_r )
314static READ8_DEVICE_HANDLER ( pmd85_ppi_1_portc_r )
315315{
316316   return 0xff;
317317}
318318
319static WRITE8_HANDLER ( pmd85_ppi_1_porta_w )
319static WRITE8_DEVICE_HANDLER ( pmd85_ppi_1_porta_w )
320320{
321321   pmd85_ppi_port_outputs[1][0] = data;
322322}
323323
324static WRITE8_HANDLER ( pmd85_ppi_1_portb_w )
324static WRITE8_DEVICE_HANDLER ( pmd85_ppi_1_portb_w )
325325{
326326   pmd85_ppi_port_outputs[1][1] = data;
327327}
328328
329static WRITE8_HANDLER ( pmd85_ppi_1_portc_w )
329static WRITE8_DEVICE_HANDLER ( pmd85_ppi_1_portc_w )
330330{
331331   pmd85_ppi_port_outputs[1][2] = data;
332332}
r3373r3374
343343
344344*******************************************************************************/
345345
346static READ8_HANDLER ( pmd85_ppi_2_porta_r )
346static READ8_DEVICE_HANDLER ( pmd85_ppi_2_porta_r )
347347{
348348   return 0xff;
349349}
350350
351static READ8_HANDLER ( pmd85_ppi_2_portb_r )
351static READ8_DEVICE_HANDLER ( pmd85_ppi_2_portb_r )
352352{
353353   return 0xff;
354354}
355355
356static READ8_HANDLER ( pmd85_ppi_2_portc_r )
356static READ8_DEVICE_HANDLER ( pmd85_ppi_2_portc_r )
357357{
358358   return 0xff;
359359}
360360
361static WRITE8_HANDLER ( pmd85_ppi_2_porta_w )
361static WRITE8_DEVICE_HANDLER ( pmd85_ppi_2_porta_w )
362362{
363363   pmd85_ppi_port_outputs[2][0] = data;
364364}
365365
366static WRITE8_HANDLER ( pmd85_ppi_2_portb_w )
366static WRITE8_DEVICE_HANDLER ( pmd85_ppi_2_portb_w )
367367{
368368   pmd85_ppi_port_outputs[2][1] = data;
369369}
370370
371static WRITE8_HANDLER ( pmd85_ppi_2_portc_w )
371static WRITE8_DEVICE_HANDLER ( pmd85_ppi_2_portc_w )
372372{
373373   pmd85_ppi_port_outputs[2][2] = data;
374374}
r3373r3374
435435
436436*******************************************************************************/
437437
438static READ8_HANDLER ( pmd85_ppi_3_porta_r )
438static READ8_DEVICE_HANDLER ( pmd85_ppi_3_porta_r )
439439{
440   return memory_region(machine, "user1")[pmd85_ppi_port_outputs[3][1]|(pmd85_ppi_port_outputs[3][2]<<8)];
440   return memory_region(device->machine, "user1")[pmd85_ppi_port_outputs[3][1]|(pmd85_ppi_port_outputs[3][2]<<8)];
441441}
442442
443static READ8_HANDLER ( pmd85_ppi_3_portb_r )
443static READ8_DEVICE_HANDLER ( pmd85_ppi_3_portb_r )
444444{
445445   return 0xff;
446446}
447447
448static READ8_HANDLER ( pmd85_ppi_3_portc_r )
448static READ8_DEVICE_HANDLER ( pmd85_ppi_3_portc_r )
449449{
450450   return 0xff;
451451}
452452
453static WRITE8_HANDLER ( pmd85_ppi_3_porta_w )
453static WRITE8_DEVICE_HANDLER ( pmd85_ppi_3_porta_w )
454454{
455455   pmd85_ppi_port_outputs[3][0] = data;
456456}
457457
458static WRITE8_HANDLER ( pmd85_ppi_3_portb_w )
458static WRITE8_DEVICE_HANDLER ( pmd85_ppi_3_portb_w )
459459{
460460   pmd85_ppi_port_outputs[3][1] = data;
461461}
462462
463static WRITE8_HANDLER ( pmd85_ppi_3_portc_w )
463static WRITE8_DEVICE_HANDLER ( pmd85_ppi_3_portc_w )
464464{
465465   pmd85_ppi_port_outputs[3][2] = data;
466466}
src/mess/machine/vector06.c
r3373r3374
2121   memset(mess_ram,0,64*1024);
2222}
2323 
24READ8_HANDLER (vector06_8255_portb_r )
24READ8_DEVICE_HANDLER (vector06_8255_portb_r )
2525{
2626   UINT8 key = 0xff;
27   if ((vector06_keyboard_mask & 0x01)!=0) { key &= input_port_read(machine,"LINE0"); }
28   if ((vector06_keyboard_mask & 0x02)!=0) { key &= input_port_read(machine,"LINE1"); }
29   if ((vector06_keyboard_mask & 0x04)!=0) { key &= input_port_read(machine,"LINE2"); }
30   if ((vector06_keyboard_mask & 0x08)!=0) { key &= input_port_read(machine,"LINE3"); }
31   if ((vector06_keyboard_mask & 0x10)!=0) { key &= input_port_read(machine,"LINE4"); }
32   if ((vector06_keyboard_mask & 0x20)!=0) { key &= input_port_read(machine,"LINE5"); }
33   if ((vector06_keyboard_mask & 0x40)!=0) { key &= input_port_read(machine,"LINE6"); }
34   if ((vector06_keyboard_mask & 0x80)!=0) { key &= input_port_read(machine,"LINE7"); }
27   if ((vector06_keyboard_mask & 0x01)!=0) { key &= input_port_read(device->machine,"LINE0"); }
28   if ((vector06_keyboard_mask & 0x02)!=0) { key &= input_port_read(device->machine,"LINE1"); }
29   if ((vector06_keyboard_mask & 0x04)!=0) { key &= input_port_read(device->machine,"LINE2"); }
30   if ((vector06_keyboard_mask & 0x08)!=0) { key &= input_port_read(device->machine,"LINE3"); }
31   if ((vector06_keyboard_mask & 0x10)!=0) { key &= input_port_read(device->machine,"LINE4"); }
32   if ((vector06_keyboard_mask & 0x20)!=0) { key &= input_port_read(device->machine,"LINE5"); }
33   if ((vector06_keyboard_mask & 0x40)!=0) { key &= input_port_read(device->machine,"LINE6"); }
34   if ((vector06_keyboard_mask & 0x80)!=0) { key &= input_port_read(device->machine,"LINE7"); }
3535   return key;
3636}
3737 
38READ8_HANDLER (vector06_8255_portc_r )
38READ8_DEVICE_HANDLER (vector06_8255_portc_r )
3939{
40   return input_port_read(machine,"LINE8");
40   return input_port_read(device->machine, "LINE8");
4141}
4242 
43WRITE8_HANDLER (vector06_8255_porta_w )
43WRITE8_DEVICE_HANDLER (vector06_8255_porta_w )
4444{
4545   vector06_keyboard_mask = data ^ 0xff;
4646}
4747 
48WRITE8_HANDLER (vector06_8255_portb_w )
48WRITE8_DEVICE_HANDLER (vector06_8255_portb_w )
4949{
5050   vector_color_index = data;
5151}
src/mess/machine/irisha.c
r3373r3374
4444                     "LINE4", "LINE5", "LINE6", "LINE7",
4545                     "LINE8", "LINE9"};
4646 
47READ8_HANDLER (irisha_8255_portb_r )
47READ8_DEVICE_HANDLER (irisha_8255_portb_r )
4848{
4949  if (irisha_keypressed==1) {
5050     irisha_keypressed =0;
r3373r3374
5454   return 0x00;
5555}
5656 
57READ8_HANDLER (irisha_8255_portc_r )
57READ8_DEVICE_HANDLER (irisha_8255_portc_r )
5858{
5959   logerror("irisha_8255_portc_r\n");
6060   return 0;
r3373r3374
7272   return keycode;
7373}
7474 
75WRITE8_HANDLER (irisha_8255_porta_w )
75WRITE8_DEVICE_HANDLER (irisha_8255_porta_w )
7676{
7777   logerror("irisha_8255_porta_w %02x\n",data);
7878}
7979 
80WRITE8_HANDLER (irisha_8255_portb_w )
80WRITE8_DEVICE_HANDLER (irisha_8255_portb_w )
8181{
8282   logerror("irisha_8255_portb_w %02x\n",data);
8383}
8484 
85WRITE8_HANDLER (irisha_8255_portc_w )
85WRITE8_DEVICE_HANDLER (irisha_8255_portc_w )
8686{
8787   //logerror("irisha_8255_portc_w %02x\n",data);
8888}
src/mess/machine/orion.c
r3373r3374
3636
3737UINT8 orion_video_mode_mask;
3838
39static READ8_HANDLER (orion_romdisk_porta_r )
39static READ8_DEVICE_HANDLER (orion_romdisk_porta_r )
4040{
41   UINT8 *romdisk = memory_region(machine, "main") + 0x10000;     
41   UINT8 *romdisk = memory_region(device->machine, "main") + 0x10000;     
4242   return romdisk[romdisk_msb*256+romdisk_lsb];   
4343}
4444
45static WRITE8_HANDLER (orion_romdisk_portb_w )
45static WRITE8_DEVICE_HANDLER (orion_romdisk_portb_w )
4646{   
4747   romdisk_lsb = data;
4848}
4949
50static WRITE8_HANDLER (orion_romdisk_portc_w )
50static WRITE8_DEVICE_HANDLER (orion_romdisk_portc_w )
5151{     
5252   romdisk_msb = data;   
5353}
src/mess/machine/svi318.c
r3373r3374
165165  8  CASR     Cassette, Read data
166166*/
167167
168static READ8_HANDLER ( svi318_ppi_port_a_r )
168static READ8_DEVICE_HANDLER ( svi318_ppi_port_a_r )
169169{
170170   int data = 0x0f;
171171
172   if (cassette_input(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" )) > 0.0038)
172   if (cassette_input(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" )) > 0.0038)
173173      data |= 0x80;
174174   if (!svi318_cassette_present(0))
175175      data |= 0x40;
176   data |= input_port_read(machine, "BUTTONS") & 0x30;
176   data |= input_port_read(device->machine, "BUTTONS") & 0x30;
177177
178178   return data;
179179}
r3373r3374
191191  8  IN7  Keyboard, Column status of selected line
192192*/
193193
194static READ8_HANDLER ( svi318_ppi_port_b_r )
194static READ8_DEVICE_HANDLER ( svi318_ppi_port_b_r )
195195{
196196   int row;
197197   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5",
r3373r3374
199199
200200   row = svi.keyboard_row;
201201   if (row <= 10)
202      return input_port_read(machine, keynames[row]);
202      return input_port_read(device->machine, keynames[row]);
203203
204204   return 0xff;
205205}
r3373r3374
217217  8  SOUND  Keyboard, Click sound bit (pulse)
218218*/
219219
220static WRITE8_HANDLER ( svi318_ppi_port_c_w )
220static WRITE8_DEVICE_HANDLER ( svi318_ppi_port_c_w )
221221{
222222   int val;
223223
r3373r3374
230230   if (svi318_cassette_present(0))
231231   {
232232      cassette_change_state(
233         device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ),
233         device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ),
234234         (data & 0x10) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED,
235235         CASSETTE_MOTOR_DISABLED);
236236   }
237237
238238   /* cassette signal write */
239   cassette_output(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ), (data & 0x20) ? -1.0 : +1.0);
239   cassette_output(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ), (data & 0x20) ? -1.0 : +1.0);
240240
241241   svi.keyboard_row = data & 0x0F;
242242}
src/mess/machine/compis.c
r3373r3374
396396/* Bit 6: J7-8 Centronics D6                                            */
397397/* Bit 7: J7-9 Centronics D7                                           */
398398/*-------------------------------------------------------------------------*/
399static WRITE8_HANDLER ( compis_ppi_port_a_w )
399static WRITE8_DEVICE_HANDLER ( compis_ppi_port_a_w )
400400{
401401   compis.printer.data = data;
402402}
r3373r3374
410410/* Bit 6: J7-13 Centronics SELECT                            */
411411/* Bit 7: Tmr0                                                     */
412412/*-------------------------------------------------------------------------*/
413static READ8_HANDLER ( compis_ppi_port_b_r )
413static READ8_DEVICE_HANDLER ( compis_ppi_port_b_r )
414414{
415415   UINT8 data;
416416
417417   /* DIP switch - Test mode */
418   data = input_port_read(machine, "DSW0");
418   data = input_port_read(device->machine, "DSW0");
419419
420420   /* Centronics busy */
421   if (!printer_is_ready(printer_device(machine)))
421   if (!printer_is_ready(printer_device(device->machine)))
422422      data |= 0x20;
423423
424424   return    data;
r3373r3374
433433/* Bit 6: V2-4 Floppy Soft reset                               */
434434/* Bit 7: V2-3 Floppy Terminal count                                    */
435435/*-------------------------------------------------------------------------*/
436static WRITE8_HANDLER ( compis_ppi_port_c_w )
436static WRITE8_DEVICE_HANDLER ( compis_ppi_port_c_w )
437437{
438438   /* Centronics Strobe */
439439   if ((compis.printer.strobe) && !(data & 0x20))
440      printer_output(printer_device(machine), compis.printer.data);
440      printer_output(printer_device(device->machine), compis.printer.data);
441441   compis.printer.strobe = ((data & 0x20)?1:0);
442442
443443   /* FDC Reset */
444444   if (data & 0x40)
445      compis_fdc_reset(machine);
445      compis_fdc_reset(device->machine);
446446
447447   /* FDC Terminal count */
448   compis_fdc_tc(machine, (data & 0x80)?1:0);
448   compis_fdc_tc(device->machine, (data & 0x80)?1:0);
449449}
450450
451451const ppi8255_interface compis_ppi_interface =
src/mess/machine/msx.c
r3373r3374
322322   msx_ch_reset_core (machine);
323323}
324324
325static WRITE8_HANDLER ( msx_ppi_port_a_w );
326static WRITE8_HANDLER ( msx_ppi_port_c_w );
327static READ8_HANDLER (msx_ppi_port_b_r );
325static WRITE8_DEVICE_HANDLER ( msx_ppi_port_a_w );
326static WRITE8_DEVICE_HANDLER ( msx_ppi_port_c_w );
327static READ8_DEVICE_HANDLER (msx_ppi_port_b_r );
328328
329329const ppi8255_interface msx_ppi8255_interface =
330330{
r3373r3374
691691** The PPI functions
692692*/
693693
694static WRITE8_HANDLER ( msx_ppi_port_a_w )
694static WRITE8_DEVICE_HANDLER ( msx_ppi_port_a_w )
695695{
696696   msx1.primary_slot = data;
697697
698698   if (VERBOSE)
699699      logerror ("write to primary slot select: %02x\n", msx1.primary_slot);
700   msx_memory_map_all (machine);
700   msx_memory_map_all (device->machine);
701701}
702702
703static WRITE8_HANDLER ( msx_ppi_port_c_w )
703static WRITE8_DEVICE_HANDLER ( msx_ppi_port_c_w )
704704{
705705   static int old_val = 0xff;
706706
r3373r3374
714714
715715   /* cassette motor on/off */
716716   if ( (old_val ^ data) & 0x10)
717      cassette_change_state(cassette_device_image(machine),
717      cassette_change_state(cassette_device_image(device->machine),
718718                  (data & 0x10) ? CASSETTE_MOTOR_DISABLED :
719719                              CASSETTE_MOTOR_ENABLED,
720720                  CASSETTE_MASK_MOTOR);
721721
722722   /* cassette signal write */
723723   if ( (old_val ^ data) & 0x20)
724      cassette_output(cassette_device_image(machine), (data & 0x20) ? -1.0 : 1.0);
724      cassette_output(cassette_device_image(device->machine), (data & 0x20) ? -1.0 : 1.0);
725725
726726   old_val = data;
727727}
728728
729static READ8_HANDLER( msx_ppi_port_b_r )
729static READ8_DEVICE_HANDLER( msx_ppi_port_b_r )
730730{
731731   UINT8 result = 0xff;
732732   int row, data;
733733   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
734734
735   row = ppi8255_r( (device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 2) & 0x0f;
735   row = ppi8255_r(device, 2) & 0x0f;
736736   if (row <= 10)
737737   {
738      data = input_port_read(machine, keynames[row / 2]);
738      data = input_port_read(device->machine, keynames[row / 2]);
739739
740740      if (row & 1)
741741         data >>= 8;
src/mess/machine/mz700.c
r3373r3374
3838
3939static UINT8 mz700_motor_on = 0;   /* cassette motor key (play key) */
4040
41static  READ8_HANDLER ( pio_port_a_r );
42static  READ8_HANDLER ( pio_port_b_r );
43static  READ8_HANDLER ( pio_port_c_r );
44static WRITE8_HANDLER ( pio_port_a_w );
45static WRITE8_HANDLER ( pio_port_b_w );
46static WRITE8_HANDLER ( pio_port_c_w );
41static READ8_DEVICE_HANDLER ( pio_port_a_r );
42static READ8_DEVICE_HANDLER ( pio_port_b_r );
43static READ8_DEVICE_HANDLER ( pio_port_c_r );
44static WRITE8_DEVICE_HANDLER ( pio_port_a_w );
45static WRITE8_DEVICE_HANDLER ( pio_port_b_w );
46static WRITE8_DEVICE_HANDLER ( pio_port_c_w );
4747
4848const ppi8255_interface mz700_ppi8255_interface = {
4949   pio_port_a_r,
r3373r3374
127127
128128/************************ PIO ************************************************/
129129
130static READ8_HANDLER ( pio_port_a_r )
130static READ8_DEVICE_HANDLER ( pio_port_a_r )
131131{
132132   UINT8 data = pio_port_a_output;
133133   LOG(2,"mz700_pio_port_a_r",("%02X\n", data));
r3373r3374
135135}
136136
137137/* read keyboard row - indexed by a demux LS145 which is connected to PA0-3 */
138static READ8_HANDLER ( pio_port_b_r )
138static READ8_DEVICE_HANDLER ( pio_port_b_r )
139139{
140140   UINT8 demux_LS145, data = 0xff;
141141   static const char *keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5",
142142                              "ROW6", "ROW7", "ROW8", "ROW9", "ROW10" };
143143
144144    demux_LS145 = pio_port_a_output & 15;
145    data = input_port_read(machine, keynames[demux_LS145]);
145    data = input_port_read(device->machine, keynames[demux_LS145]);
146146   LOG(2,"mz700_pio_port_b_r",("%02X\n", data));
147147
148148    return data;
149149}
150150
151static READ8_HANDLER (pio_port_c_r )
151static READ8_DEVICE_HANDLER (pio_port_c_r )
152152{
153153    UINT8 data = pio_port_c_output & 0x0f;
154154
r3373r3374
161161    if (mz700_motor_on)
162162        data |= 0x10;
163163
164    if (cassette_input(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" )) > 0.0038)
164    if (cassette_input(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" )) > 0.0038)
165165        data |= 0x20;       /* set the RDATA status */
166166
167167   if (ne556_out[0])
168168        data |= 0x40;           /* set the 556OUT status */
169169
170    data |= input_port_read(machine, "STATUS");   /* get VBLANK in bit 7 */
170    data |= input_port_read(device->machine, "STATUS");   /* get VBLANK in bit 7 */
171171
172172   LOG(2,"mz700_pio_port_c_r",("%02X\n", data));
173173
174174    return data;
175175}
176176
177static WRITE8_HANDLER (pio_port_a_w )
177static WRITE8_DEVICE_HANDLER (pio_port_a_w )
178178{
179179   LOG(2,"mz700_pio_port_a_w",("%02X\n", data));
180180   pio_port_a_output = data;
181181}
182182
183static WRITE8_HANDLER ( pio_port_b_w )
183static WRITE8_DEVICE_HANDLER ( pio_port_b_w )
184184{
185185   /*
186186    * bit 7   NE556 reset
r3373r3374
198198    timer_enable(ne556_timer[0], (data & 0x80) ? 0 : 1);
199199}
200200
201static WRITE8_HANDLER ( pio_port_c_w )
201static WRITE8_DEVICE_HANDLER ( pio_port_c_w )
202202{
203203    /*
204204     * bit 3 out    motor control (0 = on)
r3373r3374
210210   pio_port_c_output = data;
211211
212212   cassette_change_state(
213      device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ),
213      device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ),
214214      ((data & 0x08) && mz700_motor_on) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED,
215215      CASSETTE_MOTOR_DISABLED);
216216
217    cassette_output(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ), (data & 0x02) ? +1.0 : -1.0);
217    cassette_output(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ), (data & 0x02) ? +1.0 : -1.0);
218218}
219219
220220/************************ MMIO ***********************************************/
src/mess/machine/lviv.c
r3373r3374
5353   return address;
5454}
5555
56static READ8_HANDLER ( lviv_ppi_0_porta_r )
56static READ8_DEVICE_HANDLER ( lviv_ppi_0_porta_r )
5757{
5858   return 0xff;
5959}
6060
61static READ8_HANDLER ( lviv_ppi_0_portb_r )
61static READ8_DEVICE_HANDLER ( lviv_ppi_0_portb_r )
6262{
6363   return 0xff;
6464}
6565
66static READ8_HANDLER ( lviv_ppi_0_portc_r )
66static READ8_DEVICE_HANDLER ( lviv_ppi_0_portc_r )
6767{
6868   UINT8 data = lviv_ppi_port_outputs[0][2] & 0x0f;
69   if (cassette_input(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" )) > 0.038)
69   if (cassette_input(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" )) > 0.038)
7070      data |= 0x10;
71   if (lviv_ppi_port_outputs[0][0] & input_port_read(machine, "JOY"))
71   if (lviv_ppi_port_outputs[0][0] & input_port_read(device->machine, "JOY"))
7272      data |= 0x80;
7373   return data;
7474}
7575
76static WRITE8_HANDLER ( lviv_ppi_0_porta_w )
76static WRITE8_DEVICE_HANDLER ( lviv_ppi_0_porta_w )
7777{
7878   lviv_ppi_port_outputs[0][0] = data;
7979}
8080
81static WRITE8_HANDLER ( lviv_ppi_0_portb_w )
81static WRITE8_DEVICE_HANDLER ( lviv_ppi_0_portb_w )
8282{
8383   lviv_ppi_port_outputs[0][1] = data;
8484   lviv_update_palette (data&0x7f);
8585}
8686
87static WRITE8_HANDLER ( lviv_ppi_0_portc_w )   /* tape in/out, video memory on/off */
87static WRITE8_DEVICE_HANDLER ( lviv_ppi_0_portc_w )   /* tape in/out, video memory on/off */
8888{
8989   lviv_ppi_port_outputs[0][2] = data;
9090   if (lviv_ppi_port_outputs[0][1]&0x80)
9191      speaker_level_w(0, data&0x01);
92   cassette_output(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ), (data & 0x01) ? -1.0 : 1.0);
92   cassette_output(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ), (data & 0x01) ? -1.0 : 1.0);
9393   lviv_update_memory();
9494}
9595
96static READ8_HANDLER ( lviv_ppi_1_porta_r )
96static READ8_DEVICE_HANDLER ( lviv_ppi_1_porta_r )
9797{
9898   return 0xff;
9999}
100100
101static READ8_HANDLER ( lviv_ppi_1_portb_r )   /* keyboard reading */
101static READ8_DEVICE_HANDLER ( lviv_ppi_1_portb_r )   /* keyboard reading */
102102{
103   return   ((lviv_ppi_port_outputs[1][0] & 0x01) ? 0xff : input_port_read(machine, "KEY0")) &
104      ((lviv_ppi_port_outputs[1][0] & 0x02) ? 0xff : input_port_read(machine, "KEY1")) &
105      ((lviv_ppi_port_outputs[1][0] & 0x04) ? 0xff : input_port_read(machine, "KEY2")) &
106      ((lviv_ppi_port_outputs[1][0] & 0x08) ? 0xff : input_port_read(machine, "KEY3")) &
107      ((lviv_ppi_port_outputs[1][0] & 0x10) ? 0xff : input_port_read(machine, "KEY4")) &
108      ((lviv_ppi_port_outputs[1][0] & 0x20) ? 0xff : input_port_read(machine, "KEY5")) &
109      ((lviv_ppi_port_outputs[1][0] & 0x40) ? 0xff : input_port_read(machine, "KEY6")) &
110      ((lviv_ppi_port_outputs[1][0] & 0x80) ? 0xff : input_port_read(machine, "KEY7"));
103   return   ((lviv_ppi_port_outputs[1][0] & 0x01) ? 0xff : input_port_read(device->machine, "KEY0")) &
104      ((lviv_ppi_port_outputs[1][0] & 0x02) ? 0xff : input_port_read(device->machine, "KEY1")) &
105      ((lviv_ppi_port_outputs[1][0] & 0x04) ? 0xff : input_port_read(device->machine, "KEY2")) &
106      ((lviv_ppi_port_outputs[1][0] & 0x08) ? 0xff : input_port_read(device->machine, "KEY3")) &
107      ((lviv_ppi_port_outputs[1][0] & 0x10) ? 0xff : input_port_read(device->machine, "KEY4")) &
108      ((lviv_ppi_port_outputs[1][0] & 0x20) ? 0xff : input_port_read(device->machine, "KEY5")) &
109      ((lviv_ppi_port_outputs[1][0] & 0x40) ? 0xff : input_port_read(device->machine, "KEY6")) &
110      ((lviv_ppi_port_outputs[1][0] & 0x80) ? 0xff : input_port_read(device->machine, "KEY7"));
111111}
112112
113static READ8_HANDLER ( lviv_ppi_1_portc_r )     /* keyboard reading */
113static READ8_DEVICE_HANDLER ( lviv_ppi_1_portc_r )     /* keyboard reading */
114114{
115   return   ((lviv_ppi_port_outputs[1][2] & 0x01) ? 0xff : input_port_read(machine, "KEY8")) &
116      ((lviv_ppi_port_outputs[1][2] & 0x02) ? 0xff : input_port_read(machine, "KEY9" )) &
117      ((lviv_ppi_port_outputs[1][2] & 0x04) ? 0xff : input_port_read(machine, "KEY10")) &
118      ((lviv_ppi_port_outputs[1][2] & 0x08) ? 0xff : input_port_read(machine, "KEY11"));
115   return   ((lviv_ppi_port_outputs[1][2] & 0x01) ? 0xff : input_port_read(device->machine, "KEY8")) &
116      ((lviv_ppi_port_outputs[1][2] & 0x02) ? 0xff : input_port_read(device->machine, "KEY9" )) &
117      ((lviv_ppi_port_outputs[1][2] & 0x04) ? 0xff : input_port_read(device->machine, "KEY10")) &
118      ((lviv_ppi_port_outputs[1][2] & 0x08) ? 0xff : input_port_read(device->machine, "KEY11"));
119119}
120120
121static WRITE8_HANDLER ( lviv_ppi_1_porta_w )   /* kayboard scaning */
121static WRITE8_DEVICE_HANDLER ( lviv_ppi_1_porta_w )   /* kayboard scaning */
122122{
123123   lviv_ppi_port_outputs[1][0] = data;
124124}
125125
126static WRITE8_HANDLER ( lviv_ppi_1_portb_w )
126static WRITE8_DEVICE_HANDLER ( lviv_ppi_1_portb_w )
127127{
128128   lviv_ppi_port_outputs[1][1] = data;
129129}
130130
131static WRITE8_HANDLER ( lviv_ppi_1_portc_w )   /* kayboard scaning */
131static WRITE8_DEVICE_HANDLER ( lviv_ppi_1_portc_w )   /* kayboard scaning */
132132{
133133   lviv_ppi_port_outputs[1][2] = data;
134134}
src/mess/machine/pc8801.c
r3373r3374
724724
725725static UINT8 load_8255_A(running_machine *machine, int chip)
726726{
727   return use_5FD ? ppi8255_get_portB((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, chip ? "ppi8255_0" : "ppi8255_1" ) ) : 0xff;
727   return use_5FD ? ppi8255_get_port_b((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, chip ? "ppi8255_0" : "ppi8255_1" ) ) : 0xff;
728728}
729729
730730static UINT8 load_8255_B(running_machine *machine, int chip)
731731{
732   return use_5FD ? ppi8255_get_portA((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, chip ? "ppi8255_0" : "ppi8255_1" ) ) : 0xff;
732   return use_5FD ? ppi8255_get_port_a((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, chip ? "ppi8255_0" : "ppi8255_1" ) ) : 0xff;
733733}
734734
735735static UINT8 load_8255_C(running_machine *machine, int chip)
r3373r3374
739739
740740   if (use_5FD)
741741   {
742      port_c = ppi8255_get_portC((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, chip ? "ppi8255_0" : "ppi8255_1" ) );
742      port_c = ppi8255_get_port_c((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, chip ? "ppi8255_0" : "ppi8255_1" ) );
743743      result = ((port_c >> 4) & 0x0F) | ((port_c << 4) & 0xF0);
744744   }
745745
r3373r3374
766766   return result;
767767}
768768
769static READ8_HANDLER( load_8255_chip0_A )   { return load_8255_A(machine, 0); }
770static READ8_HANDLER( load_8255_chip1_A )   { return load_8255_A(machine, 1); }
771static READ8_HANDLER( load_8255_chip0_B )   { return load_8255_B(machine, 0); }
772static READ8_HANDLER( load_8255_chip1_B )   { return load_8255_B(machine, 1); }
773static READ8_HANDLER( load_8255_chip0_C )   { return load_8255_C(machine, 0); }
774static READ8_HANDLER( load_8255_chip1_C )   { return load_8255_C(machine, 1); }
769static READ8_DEVICE_HANDLER( load_8255_chip0_A )   { return load_8255_A(device->machine, 0); }
770static READ8_DEVICE_HANDLER( load_8255_chip1_A )   { return load_8255_A(device->machine, 1); }
771static READ8_DEVICE_HANDLER( load_8255_chip0_B )   { return load_8255_B(device->machine, 0); }
772static READ8_DEVICE_HANDLER( load_8255_chip1_B )   { return load_8255_B(device->machine, 1); }
773static READ8_DEVICE_HANDLER( load_8255_chip0_C )   { return load_8255_C(device->machine, 0); }
774static READ8_DEVICE_HANDLER( load_8255_chip1_C )   { return load_8255_C(device->machine, 1); }
775775
776776
777777const ppi8255_interface pc8801_8255_config_0 =
src/mess/machine/atom.c
r3373r3374
347347}
348348
349349
350 READ8_HANDLER (atom_8255_porta_r )
350READ8_DEVICE_HANDLER (atom_8255_porta_r )
351351{
352352   /* logerror("8255: Read port a\n"); */
353353   return (atom_8255_porta);
354354}
355355
356 READ8_HANDLER ( atom_8255_portb_r )
356READ8_DEVICE_HANDLER ( atom_8255_portb_r )
357357{
358358   int row;
359359   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5",
r3373r3374
362362   row = atom_8255_porta & 0x0f;
363363   /* logerror("8255: Read port b: %02X %02X\n", input_port_read(machine, port),
364364                           input_port_read(machine, "KEY10") & 0xc0); */
365   return ((input_port_read(machine, keynames[row]) & 0x3f) | (input_port_read(machine, "KEY10") & 0xc0));
365   return ((input_port_read(device->machine, keynames[row]) & 0x3f) | (input_port_read(device->machine, "KEY10") & 0xc0));
366366}
367367
368READ8_HANDLER ( atom_8255_portc_r )
368READ8_DEVICE_HANDLER ( atom_8255_portc_r )
369369{
370370   atom_8255_portc &= 0x0f;
371371
372372   /* cassette input */
373   if (cassette_input(cassette_device_image(machine)) > 0.0)
373   if (cassette_input(cassette_device_image(device->machine)) > 0.0)
374374   {
375375      atom_8255_portc |= (1<<5);
376376   }
r3373r3374
382382   }
383383
384384   atom_8255_portc |= (m6847_get_field_sync() ? 0x00 : 0x80);
385   atom_8255_portc |= (input_port_read(machine, "KEY11") & 0x40);
385   atom_8255_portc |= (input_port_read(device->machine, "KEY11") & 0x40);
386386   /* logerror("8255: Read port c (%02X)\n",atom_8255.atom_8255_portc); */
387387   return (atom_8255_portc);
388388}
r3373r3374
401401
402402*/
403403
404WRITE8_HANDLER ( atom_8255_porta_w )
404WRITE8_DEVICE_HANDLER ( atom_8255_porta_w )
405405{
406406   atom_8255_porta = data;
407407}
408408
409WRITE8_HANDLER ( atom_8255_portb_w )
409WRITE8_DEVICE_HANDLER ( atom_8255_portb_w )
410410{
411411   atom_8255_portb = data;
412412}
413413
414WRITE8_HANDLER (atom_8255_portc_w)
414WRITE8_DEVICE_HANDLER (atom_8255_portc_w)
415415{
416416   atom_8255_portc = data;
417417   speaker_level_w(0, (data & 0x04) >> 2);
r3373r3374
419419
420420
421421/* KT- I've assumed that the atom 8271 is linked in exactly the same way as on the bbc */
422 READ8_HANDLER(atom_8271_r)
422READ8_HANDLER(atom_8271_r)
423423{
424424   switch (offset)
425425   {
src/mess/machine/special.c
r3373r3374
3535   memory_configure_bank(1, 0, 2, RAM, 0xc000);   
3636}
3737
38static READ8_HANDLER (specialist_8255_porta_r )
38static READ8_DEVICE_HANDLER (specialist_8255_porta_r )
3939{
40   if (input_port_read(machine, "LINE0")!=0xff) return 0xfe;
41   if (input_port_read(machine, "LINE1")!=0xff) return 0xfd;
42   if (input_port_read(machine, "LINE2")!=0xff) return 0xfb;
43   if (input_port_read(machine, "LINE3")!=0xff) return 0xf7;
44   if (input_port_read(machine, "LINE4")!=0xff) return 0xef;
45   if (input_port_read(machine, "LINE5")!=0xff) return 0xdf;
46   if (input_port_read(machine, "LINE6")!=0xff) return 0xbf;
47   if (input_port_read(machine, "LINE7")!=0xff) return 0x7f;   
40   if (input_port_read(device->machine, "LINE0")!=0xff) return 0xfe;
41   if (input_port_read(device->machine, "LINE1")!=0xff) return 0xfd;
42   if (input_port_read(device->machine, "LINE2")!=0xff) return 0xfb;
43   if (input_port_read(device->machine, "LINE3")!=0xff) return 0xf7;
44   if (input_port_read(device->machine, "LINE4")!=0xff) return 0xef;
45   if (input_port_read(device->machine, "LINE5")!=0xff) return 0xdf;
46   if (input_port_read(device->machine, "LINE6")!=0xff) return 0xbf;
47   if (input_port_read(device->machine, "LINE7")!=0xff) return 0x7f;   
4848   return 0xff;
4949}
5050
51static READ8_HANDLER (specialist_8255_portb_r )
51static READ8_DEVICE_HANDLER (specialist_8255_portb_r )
5252{
5353   
5454   int dat = 0;
5555   double level;   
56   
57  if ((specialist_8255_porta & 0x01)==0) dat ^= (input_port_read(machine, "LINE0") ^ 0xff);
58  if ((specialist_8255_porta & 0x02)==0) dat ^= (input_port_read(machine, "LINE1") ^ 0xff);
59  if ((specialist_8255_porta & 0x04)==0) dat ^= (input_port_read(machine, "LINE2") ^ 0xff);
60  if ((specialist_8255_porta & 0x08)==0) dat ^= (input_port_read(machine, "LINE3") ^ 0xff);
61  if ((specialist_8255_porta & 0x10)==0) dat ^= (input_port_read(machine, "LINE4") ^ 0xff);
62  if ((specialist_8255_porta & 0x20)==0) dat ^= (input_port_read(machine, "LINE5") ^ 0xff);
63  if ((specialist_8255_porta & 0x40)==0) dat ^= (input_port_read(machine, "LINE6") ^ 0xff);
64  if ((specialist_8255_porta & 0x80)==0) dat ^= (input_port_read(machine, "LINE7") ^ 0xff);
65  if ((specialist_8255_portc & 0x01)==0) dat ^= (input_port_read(machine, "LINE8") ^ 0xff);
66  if ((specialist_8255_portc & 0x02)==0) dat ^= (input_port_read(machine, "LINE9") ^ 0xff);
67  if ((specialist_8255_portc & 0x04)==0) dat ^= (input_port_read(machine, "LINE10") ^ 0xff);
68  if ((specialist_8255_portc & 0x08)==0) dat ^= (input_port_read(machine, "LINE11") ^ 0xff);
56
57   if ((specialist_8255_porta & 0x01)==0) dat ^= (input_port_read(device->machine, "LINE0") ^ 0xff);
58   if ((specialist_8255_porta & 0x02)==0) dat ^= (input_port_read(device->machine, "LINE1") ^ 0xff);
59   if ((specialist_8255_porta & 0x04)==0) dat ^= (input_port_read(device->machine, "LINE2") ^ 0xff);
60   if ((specialist_8255_porta & 0x08)==0) dat ^= (input_port_read(device->machine, "LINE3") ^ 0xff);
61   if ((specialist_8255_porta & 0x10)==0) dat ^= (input_port_read(device->machine, "LINE4") ^ 0xff);
62   if ((specialist_8255_porta & 0x20)==0) dat ^= (input_port_read(device->machine, "LINE5") ^ 0xff);
63   if ((specialist_8255_porta & 0x40)==0) dat ^= (input_port_read(device->machine, "LINE6") ^ 0xff);
64   if ((specialist_8255_porta & 0x80)==0) dat ^= (input_port_read(device->machine, "LINE7") ^ 0xff);
65   if ((specialist_8255_portc & 0x01)==0) dat ^= (input_port_read(device->machine, "LINE8") ^ 0xff);
66   if ((specialist_8255_portc & 0x02)==0) dat ^= (input_port_read(device->machine, "LINE9") ^ 0xff);
67   if ((specialist_8255_portc & 0x04)==0) dat ^= (input_port_read(device->machine, "LINE10") ^ 0xff);
68   if ((specialist_8255_portc & 0x08)==0) dat ^= (input_port_read(device->machine, "LINE11") ^ 0xff);
6969     
7070   dat = (dat  << 2) ^0xff;   
71   if (input_port_read(machine, "LINE12")!=0xff) dat ^= 0x02;
71   if (input_port_read(device->machine, "LINE12")!=0xff) dat ^= 0x02;
7272     
73   level = cassette_input(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ));                                               
73   level = cassette_input(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ));                                               
7474   if (level >=  0) {
7575         dat ^= 0x01;
7676    }     
7777   return dat & 0xff;
7878}
7979
80static READ8_HANDLER (specialist_8255_portc_r )
80static READ8_DEVICE_HANDLER (specialist_8255_portc_r )
8181{
82   if (input_port_read(machine, "LINE8")!=0xff) return 0x0e;
83   if (input_port_read(machine, "LINE9")!=0xff) return 0x0d;
84   if (input_port_read(machine, "LINE10")!=0xff) return 0x0b;
85   if (input_port_read(machine, "LINE11")!=0xff) return 0x07;
82   if (input_port_read(device->machine, "LINE8")!=0xff) return 0x0e;
83   if (input_port_read(device->machine, "LINE9")!=0xff) return 0x0d;
84   if (input_port_read(device->machine, "LINE10")!=0xff) return 0x0b;
85   if (input_port_read(device->machine, "LINE11")!=0xff) return 0x07;
8686   return 0x0f;
8787}
8888
89static WRITE8_HANDLER (specialist_8255_porta_w )
89static WRITE8_DEVICE_HANDLER (specialist_8255_porta_w )
9090{   
9191   specialist_8255_porta = data;
9292}
9393
94static WRITE8_HANDLER (specialist_8255_portb_w )
94static WRITE8_DEVICE_HANDLER (specialist_8255_portb_w )
9595{   
9696   specialist_8255_portb = data;
9797}
98static WRITE8_HANDLER (specialist_8255_portc_w )
98static WRITE8_DEVICE_HANDLER (specialist_8255_portc_w )
9999{     
100100   specialist_8255_portc = data;
101101   
102   cassette_output(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ),data & 0x80 ? 1 : -1);   
102   cassette_output(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ),data & 0x80 ? 1 : -1);   
103103
104104   dac_data_w(0,data & 0x20); //beeper
105105   
src/mess/machine/mikro80.c
r3373r3374
6060{
6161}
6262
63static READ8_DEVICE_HANDLER( mikro80_8255_portb_device_r ) { return mikro80_8255_portb_r(device->machine, offset); }
64static READ8_DEVICE_HANDLER( mikro80_8255_portc_device_r ) { return mikro80_8255_portc_r(device->machine, offset); }
65static WRITE8_DEVICE_HANDLER( mikro80_8255_porta_device_w ) { mikro80_8255_porta_w(device->machine, offset, data); }
66
6367const ppi8255_interface mikro80_ppi8255_interface =
6468{
6569   NULL,
66   mikro80_8255_portb_r,
67   mikro80_8255_portc_r,
68   mikro80_8255_porta_w,
70   mikro80_8255_portb_device_r,
71   mikro80_8255_portc_device_r,
72   mikro80_8255_porta_device_w,
6973   NULL,
7074   NULL,
7175};
src/mess/machine/ut88.c
r3373r3374
2626   memory_configure_bank(1, 0, 2, RAM, 0xf800);
2727}
2828
29static READ8_HANDLER (ut88_8255_portb_r )
29static READ8_DEVICE_HANDLER (ut88_8255_portb_r )
3030{
3131   UINT8 key = 0xff;
32   if ((ut88_keyboard_mask & 0x01)!=0) { key &= input_port_read(machine,"LINE0"); }
33   if ((ut88_keyboard_mask & 0x02)!=0) { key &= input_port_read(machine,"LINE1"); }
34   if ((ut88_keyboard_mask & 0x04)!=0) { key &= input_port_read(machine,"LINE2"); }
35   if ((ut88_keyboard_mask & 0x08)!=0) { key &= input_port_read(machine,"LINE3"); }
36   if ((ut88_keyboard_mask & 0x10)!=0) { key &= input_port_read(machine,"LINE4"); }
37   if ((ut88_keyboard_mask & 0x20)!=0) { key &= input_port_read(machine,"LINE5"); }
38   if ((ut88_keyboard_mask & 0x40)!=0) { key &= input_port_read(machine,"LINE6"); }
39   if ((ut88_keyboard_mask & 0x80)!=0) { key &= input_port_read(machine,"LINE7"); }
32   if ((ut88_keyboard_mask & 0x01)!=0) { key &= input_port_read(device->machine,"LINE0"); }
33   if ((ut88_keyboard_mask & 0x02)!=0) { key &= input_port_read(device->machine,"LINE1"); }
34   if ((ut88_keyboard_mask & 0x04)!=0) { key &= input_port_read(device->machine,"LINE2"); }
35   if ((ut88_keyboard_mask & 0x08)!=0) { key &= input_port_read(device->machine,"LINE3"); }
36   if ((ut88_keyboard_mask & 0x10)!=0) { key &= input_port_read(device->machine,"LINE4"); }
37   if ((ut88_keyboard_mask & 0x20)!=0) { key &= input_port_read(device->machine,"LINE5"); }
38   if ((ut88_keyboard_mask & 0x40)!=0) { key &= input_port_read(device->machine,"LINE6"); }
39   if ((ut88_keyboard_mask & 0x80)!=0) { key &= input_port_read(device->machine,"LINE7"); }
4040   return key;
4141}
4242
43static READ8_HANDLER (ut88_8255_portc_r )
43static READ8_DEVICE_HANDLER (ut88_8255_portc_r )
4444{
45   return input_port_read(machine, "LINE8");   
45   return input_port_read(device->machine, "LINE8");   
4646}
4747
48static WRITE8_HANDLER (ut88_8255_porta_w )
48static WRITE8_DEVICE_HANDLER (ut88_8255_porta_w )
4949{
5050   ut88_keyboard_mask = data ^ 0xff;   
5151}
src/mess/machine/pc.c
r3373r3374
629629} pc_ppi={ 0 };
630630
631631
632static READ8_HANDLER (ibm5150_ppi_porta_r)
632static READ8_DEVICE_HANDLER (ibm5150_ppi_porta_r)
633633{
634634   int data = 0xFF;
635635
r3373r3374
645645       *      01 - color 40x25
646646       * 6-7  The number of floppy disk drives
647647       */
648      data = input_port_read(machine, "DSW0");
648      data = input_port_read(device->machine, "DSW0");
649649   }
650650   else
651651   {
r3373r3374
656656}
657657
658658
659static READ8_HANDLER (ibm5150_ppi_portb_r )
659static READ8_DEVICE_HANDLER (ibm5150_ppi_portb_r )
660660{
661661   int data;
662662
r3373r3374
666666}
667667
668668
669static READ8_HANDLER ( ibm5150_ppi_portc_r )
669static READ8_DEVICE_HANDLER ( ibm5150_ppi_portc_r )
670670{
671671   int timer2_output = pit8253_get_output( pc_devices.pit8253, 2 );
672672   int data=0xff;
r3373r3374
677677   if (pc_ppi.portc_switch_high)
678678   {
679679      /* read hi nibble of S2 */
680      data = (data & 0xf0) | ((input_port_read(machine, "DSW0") >> 4) & 0x0f);
680      data = (data & 0xf0) | ((input_port_read(device->machine, "DSW0") >> 4) & 0x0f);
681681      PIO_LOG(1,"PIO_C_r (hi)",("$%02x\n", data));
682682   }
683683   else
684684   {
685685      /* read lo nibble of S2 */
686      data = (data & 0xf0) | (input_port_read(machine, "DSW0") & 0x0f);
686      data = (data & 0xf0) | (input_port_read(device->machine, "DSW0") & 0x0f);
687687      PIO_LOG(1,"PIO_C_r (lo)",("$%02x\n", data));
688688   }
689689
690690   if ( ! ( pc_ppi.portb & 0x08 ) )
691691   {
692      double tap_val = cassette_input( device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ) );
692      double tap_val = cassette_input( device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ) );
693693
694694      if ( tap_val < 0 )
695695      {
r3373r3374
713713}
714714
715715
716static WRITE8_HANDLER ( ibm5150_ppi_porta_w )
716static WRITE8_DEVICE_HANDLER ( ibm5150_ppi_porta_w )
717717{
718718   /* KB controller port A */
719719   PIO_LOG(1,"PIO_A_w",("$%02x\n", data));
720720}
721721
722722
723static WRITE8_HANDLER ( ibm5150_ppi_portb_w )
723static WRITE8_DEVICE_HANDLER ( ibm5150_ppi_portb_w )
724724{
725725   /* KB controller port B */
726726   pc_ppi.portb = data;
r3373r3374
730730   pit8253_gate_w( pc_devices.pit8253, 2, data & 1);
731731   pc_speaker_set_spkrdata( data & 0x02 );
732732
733   cassette_change_state( device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ), ( data & 0x08 ) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
733   cassette_change_state( device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ), ( data & 0x08 ) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
734734
735735   pc_ppi.clock_signal = ( pc_ppi.keyb_clock ) ? 1 : 0;
736736
737   pc_ppi.clock_callback( machine, 0, pc_ppi.clock_signal );
737   pc_ppi.clock_callback( device->machine, 0, pc_ppi.clock_signal );
738738
739739   /* If PB7 is set clear the shift register and reset the IRQ line */
740740   if ( pc_ppi.keyboard_clear )
r3373r3374
746746}
747747
748748
749static WRITE8_HANDLER ( ibm5150_ppi_portc_w )
749static WRITE8_DEVICE_HANDLER ( ibm5150_ppi_portc_w )
750750{
751751   /* KB controller port C */
752752   PIO_LOG(1,"PIO_C_w",("$%02x\n", data));
r3373r3374
812812};
813813
814814
815static READ8_HANDLER (ibm5160_ppi_porta_r)
815static READ8_DEVICE_HANDLER (ibm5160_ppi_porta_r)
816816{
817817   int data = 0xFF;
818818
r3373r3374
828828       *      01 - color 40x25
829829       * 6-7  The number of floppy disk drives
830830       */
831      data = input_port_read(machine, "DSW0");
831      data = input_port_read(device->machine, "DSW0");
832832   }
833833   else
834834   {
r3373r3374
842842}
843843
844844
845static READ8_HANDLER ( ibm5160_ppi_portc_r )
845static READ8_DEVICE_HANDLER ( ibm5160_ppi_portc_r )
846846{
847847   int timer2_output = pit8253_get_output( pc_devices.pit8253, 2 );
848848   int data=0xff;
r3373r3374
854854   if (pc_ppi.portc_switch_high)
855855   {
856856      /* read hi nibble of S2 */
857      data = (data & 0xf0) | ((input_port_read(machine, "DSW0") >> 4) & 0x0f);
857      data = (data & 0xf0) | ((input_port_read(device->machine, "DSW0") >> 4) & 0x0f);
858858      PIO_LOG(1,"PIO_C_r (hi)",("$%02x\n", data));
859859   }
860860   else
861861   {
862862      /* read lo nibble of S2 */
863      data = (data & 0xf0) | (input_port_read(machine, "DSW0") & 0x0f);
863      data = (data & 0xf0) | (input_port_read(device->machine, "DSW0") & 0x0f);
864864      PIO_LOG(1,"PIO_C_r (lo)",("$%02x\n", data));
865865   }
866866
r3373r3374
874874}
875875
876876
877static WRITE8_HANDLER( ibm5160_ppi_portb_w )
877static WRITE8_DEVICE_HANDLER( ibm5160_ppi_portb_w )
878878{
879879   pc_ppi.portb = data;
880880   pc_ppi.portc_switch_high = data & 0x08;
r3373r3374
900900};
901901
902902
903static WRITE8_HANDLER ( pcjr_ppi_portb_w )
903static WRITE8_DEVICE_HANDLER ( pcjr_ppi_portb_w )
904904{
905905   /* KB controller port B */
906906   pc_ppi.portb = data;
907907   pc_ppi.portc_switch_high = data & 0x08;
908   pit8253_gate_w( device_list_find_by_tag( machine->config->devicelist, PIT8253, "pit8253" ), 2, data & 1);
908   pit8253_gate_w( device_list_find_by_tag( device->machine->config->devicelist, PIT8253, "pit8253" ), 2, data & 1);
909909   pc_speaker_set_spkrdata( data & 0x02 );
910910
911   cassette_change_state( device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ), ( data & 0x08 ) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
911   cassette_change_state( device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ), ( data & 0x08 ) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
912912}
913913
914914
915915/*
916916 * On a PCJR none of the port A bits are connected.
917917 */
918static READ8_HANDLER (pcjr_ppi_porta_r )
918static READ8_DEVICE_HANDLER (pcjr_ppi_porta_r )
919919{
920920   int data;
921921
r3373r3374
936936 * PC6 - KYBD IN
937937 * PC7 - (keyboard) CABLE CONNECTED
938938 */
939static READ8_HANDLER ( pcjr_ppi_portc_r )
939static READ8_DEVICE_HANDLER ( pcjr_ppi_portc_r )
940940{
941   int timer2_output = pit8253_get_output( device_list_find_by_tag( machine->config->devicelist, PIT8253, "pit8253" ), 2 );
941   int timer2_output = pit8253_get_output( device_list_find_by_tag( device->machine->config->devicelist, PIT8253, "pit8253" ), 2 );
942942   int data=0xff;
943943
944944   data&=~0x80;
r3373r3374
946946   data = ( data & ~0x01 ) | ( pcjr_keyb.latch ? 0x01: 0x00 );
947947   if ( ! ( pc_ppi.portb & 0x08 ) )
948948   {
949      double tap_val = cassette_input( device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ) );
949      double tap_val = cassette_input( device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ) );
950950
951951      if ( tap_val < 0 )
952952      {
src/mess/drivers/sord.c
r3373r3374
9393
9494   LOG(("fd5 0x010 r: %02x %04x\n",fd5_databus,activecpu_get_pc()));
9595
96   ppi8255_set_portC((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
97   ppi8255_set_portC((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x10);
98   ppi8255_set_portC((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
96   ppi8255_set_port_c((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
97   ppi8255_set_port_c((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x10);
98   ppi8255_set_port_c((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
9999
100100   return fd5_databus;
101101}
r3373r3374
107107   fd5_databus = data;
108108
109109   /* set stb on data write */
110   ppi8255_set_portC((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
111   ppi8255_set_portC((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x40);
112   ppi8255_set_portC((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
110   ppi8255_set_port_c((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
111   ppi8255_set_port_c((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x40);
112   ppi8255_set_port_c((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
113113
114114   cpu_yield();
115115}
r3373r3374
182182   floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 1), FLOPPY_DRIVE_SS_40);
183183   sord_fd5_init(machine);
184184   MACHINE_RESET_CALL(sord_m5);
185   ppi8255_set_portC((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
185   ppi8255_set_port_c((device_config*)device_list_find_by_tag( machine->config->devicelist, PPI8255, "ppi8255" ), 0x50);
186186}
187187
188188
r3373r3374
194194/*********************************************************************************************/
195195/* PI-5 */
196196
197static READ8_HANDLER(sord_ppi_porta_r)
197static READ8_DEVICE_HANDLER(sord_ppi_porta_r)
198198{
199199   cpu_yield();
200200
201201   return fd5_databus;
202202}
203203
204static READ8_HANDLER(sord_ppi_portb_r)
204static READ8_DEVICE_HANDLER(sord_ppi_portb_r)
205205{
206206   cpu_yield();
207207
r3373r3374
210210   return 0x0ff;
211211}
212212
213static READ8_HANDLER(sord_ppi_portc_r)
213static READ8_DEVICE_HANDLER(sord_ppi_portc_r)
214214{
215215   cpu_yield();
216216
r3373r3374
241241         );
242242}
243243
244static WRITE8_HANDLER(sord_ppi_porta_w)
244static WRITE8_DEVICE_HANDLER(sord_ppi_porta_w)
245245{
246246   cpu_yield();
247247
248248   fd5_databus = data;
249249}
250250
251static WRITE8_HANDLER(sord_ppi_portb_w)
251static WRITE8_DEVICE_HANDLER(sord_ppi_portb_w)
252252{
253253   cpu_yield();
254254
r3373r3374
258258
259259   if (data==0x0f0)
260260   {
261      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
262      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
261      cpunum_set_input_line(device->machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
262      cpunum_set_input_line(device->machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
263263   }
264264   LOG(("m5 write to pi5 port b: %02x %04x\n",data,activecpu_get_pc()));
265265}
r3373r3374
270270/* C,H,N */
271271
272272
273static WRITE8_HANDLER(sord_ppi_portc_w)
273static WRITE8_DEVICE_HANDLER(sord_ppi_portc_w)
274274{
275275   obfa = (data & 0x80) ? 1 : 0;
276276   intra = (data & 0x08) ? 1 : 0;
src/mess/drivers/x68k.c
r3373r3374
654654}
655655
656656// Judging from the XM6 source code, PPI ports A and B are joystick inputs
657static READ8_HANDLER( ppi_port_a_r )
657static READ8_DEVICE_HANDLER( ppi_port_a_r )
658658{
659659   // Joystick 1
660660   if(sys.joy.joy1_enable == 0)
661      return input_port_read(machine, "joy1");
661      return input_port_read(device->machine, "joy1");
662662   else
663663      return 0xff;
664664}
665665
666static READ8_HANDLER( ppi_port_b_r )
666static READ8_DEVICE_HANDLER( ppi_port_b_r )
667667{
668668   // Joystick 2
669669   if(sys.joy.joy2_enable == 0)
670      return input_port_read(machine, "joy2");
670      return input_port_read(device->machine, "joy2");
671671   else
672672      return 0xff;
673673}
674674
675static READ8_HANDLER( ppi_port_c_r )
675static READ8_DEVICE_HANDLER( ppi_port_c_r )
676676{
677677   return ppi_port[2];
678678}
679679
680#ifdef UNUSED_FUNCTION
681WRITE8_HANDLER( ppi_port_a_w )
682{
683   ppi_port[0] = data;
684}
685
686WRITE8_HANDLER( ppi_port_b_w )
687{
688   ppi_port[1] = data;
689}
690#endif
691
692680/* PPI port C (Joystick control, R/W)
693681   bit 7    - IOC7 - Function B operation of joystick 1 (?)
694682   bit 6    - IOC6 - Function A operation of joystick 1 (?)
r3373r3374
697685   bits 3,2 - ADPCM Sample rate
698686   bits 1,0 - ADPCM Pan
699687*/
700static WRITE8_HANDLER( ppi_port_c_w )
688static WRITE8_DEVICE_HANDLER( ppi_port_c_w )
701689{
702690   // ADPCM / Joystick control
703691   ppi_port[2] = data;
src/mess/drivers/mpf1.c
r3373r3374
390390//  PA7 = tape EAR = INPUT, meant to be connected to the earphone jacket of a taperecorder
391391// ~PC7 = tape MIC = OUTPUT, meant to be connected to the microphone jacket of a taperecorder
392392
393static READ8_HANDLER( mpf1_porta_r )
393static READ8_DEVICE_HANDLER( mpf1_porta_r )
394394{
395395   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5" };
396396
r3373r3374
403403   verboselog( 0, "Key column for kbd read: %02x\n", keycol );
404404   if( keycol != 6 )
405405   {
406      retval = input_port_read(machine, keynames[keycol]);
406      retval = input_port_read(device->machine, keynames[keycol]);
407407   }
408408   else
409409   {
r3373r3374
415415
416416
417417
418static READ8_HANDLER( mpf1_portb_r )
418static READ8_DEVICE_HANDLER( mpf1_portb_r )
419419{
420420   verboselog( 0, "PPI port B read\n" );
421421   return 0;
r3373r3374
423423
424424
425425
426static READ8_HANDLER( mpf1_portc_r )
426static READ8_DEVICE_HANDLER( mpf1_portc_r )
427427{
428428   verboselog( 0, "PPI port C read\n" );
429429   return 0;
r3373r3374
431431
432432
433433
434static WRITE8_HANDLER( mpf1_porta_w )
434static WRITE8_DEVICE_HANDLER( mpf1_porta_w )
435435{
436436   verboselog( 0, "PPI port A write: %02x\n", data );
437437}
438438
439439
440440
441static WRITE8_HANDLER( mpf1_portb_w )
441static WRITE8_DEVICE_HANDLER( mpf1_portb_w )
442442{
443443    //int i;
444444   /*  A   0x08
r3373r3374
475475
476476
477477
478static WRITE8_HANDLER( mpf1_portc_w )
478static WRITE8_DEVICE_HANDLER( mpf1_portc_w )
479479{
480480   kbdlatch = ~data;
481481
r3373r3374
493493   data = ~kbdlatch;
494494
495495   // watchdog reset
496   watchdog_reset(machine);
496   watchdog_reset(device->machine);
497497
498498   // TONE led & speaker
499499   led_tone = (~data & 0x80) >> 7;
src/mess/drivers/sg1000.c
r3373r3374
481481
482482static int keylatch;
483483
484static READ8_HANDLER( sc3000_ppi8255_a_r )
484static READ8_DEVICE_HANDLER( sc3000_ppi8255_a_r )
485485{
486486   static const char *keynames[] = { "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7" };
487487
r3373r3374
498498        PA7     Keyboard input
499499    */
500500
501   return input_port_read(machine, keynames[keylatch]);
501   return input_port_read(device->machine, keynames[keylatch]);
502502}
503503
504static READ8_HANDLER( sc3000_ppi8255_b_r )
504static READ8_DEVICE_HANDLER( sc3000_ppi8255_b_r )
505505{
506506   static const char *keynames[] = { "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7" };
507507
r3373r3374
519519    */
520520
521521   /* keyboard */
522   UINT8 data = input_port_read(machine, keynames[keylatch]);
522   UINT8 data = input_port_read(device->machine, keynames[keylatch]);
523523
524524   /* cartridge contact */
525525   data |= 0x10;
r3373r3374
528528   data |= 0x60;
529529
530530   /* tape input */
531   if (cassette_input(cassette_device_image(machine)) > +0.0) data |= 0x80;
531   if (cassette_input(cassette_device_image(device->machine)) > +0.0) data |= 0x80;
532532
533533   return data;
534534}
535535
536static WRITE8_HANDLER( sc3000_ppi8255_c_w )
536static WRITE8_DEVICE_HANDLER( sc3000_ppi8255_c_w )
537537{
538538   /*
539539        Signal  Description
r3373r3374
552552   keylatch = data & 0x07;
553553
554554   /* cassette */
555   cassette_output(cassette_device_image(machine), BIT(data, 4) ? +1.0 : -1.0);
555   cassette_output(cassette_device_image(device->machine), BIT(data, 4) ? +1.0 : -1.0);
556556
557557   /* printer */
558558}
r3373r3374
585585static int sf7000_fdc_int;
586586static int sf7000_fdc_index;
587587
588static READ8_HANDLER( sf7000_ppi8255_a_r )
588static READ8_DEVICE_HANDLER( sf7000_ppi8255_a_r )
589589{
590590   /*
591591        Signal  Description
r3373r3374
611611   return (sf7000_fdc_index << 2) | busy | sf7000_fdc_int;
612612}
613613
614static WRITE8_HANDLER( sf7000_ppi8255_b_w )
614static WRITE8_DEVICE_HANDLER( sf7000_ppi8255_b_w )
615615{
616616   /*
617617        Signal  Description
r3373r3374
629629   centronics_write_data(1, data);
630630}
631631
632static WRITE8_HANDLER( sf7000_ppi8255_c_w )
632static WRITE8_DEVICE_HANDLER( sf7000_ppi8255_c_w )
633633{
634634   /*
635635        Signal  Description
r3373r3374
649649   floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 0), 1, 0);
650650
651651   /* FDC terminal count */
652   nec765_set_tc_state(machine, data & 0x04);
652   nec765_set_tc_state(device->machine, data & 0x04);
653653
654654   /* FDC reset */
655655   if (data & 0x08)
656656   {
657      nec765_reset(machine, 0);
657      nec765_reset(device->machine, 0);
658658   }
659659
660660   /* ROM selection */
src/mess/drivers/bw2.c
r3373r3374
386386
387387/* PPI */
388388
389static WRITE8_HANDLER( bw2_ppi8255_a_w )
389static WRITE8_DEVICE_HANDLER( bw2_ppi8255_a_w )
390390{
391391   /*
392392
r3373r3374
420420   centronics_write_handshake(0, BIT(data, 7) ? 0 : CENTRONICS_STROBE, CENTRONICS_STROBE);
421421}
422422
423static READ8_HANDLER( bw2_ppi8255_b_r )
423static READ8_DEVICE_HANDLER( bw2_ppi8255_b_r )
424424{
425425   /*
426426
r3373r3374
441441   row = keyboard_row;
442442
443443   if (row <= 9)
444      return input_port_read(machine, rownames[row]);
444      return input_port_read(device->machine, rownames[row]);
445445
446446   return 0xff;
447447}
448448
449static WRITE8_HANDLER( bw2_ppi8255_c_w )
449static WRITE8_DEVICE_HANDLER( bw2_ppi8255_c_w )
450450{
451451   /*
452452
r3373r3374
457457
458458   */
459459
460   if (get_ramdisk_size(machine) > 0)
460   if (get_ramdisk_size(device->machine) > 0)
461461   {
462      ramcard_set_banks(machine, data & 0x07);
462      ramcard_set_banks(device->machine, data & 0x07);
463463   }
464464   else
465465   {
466      bw2_set_banks(machine, data & 0x07);
466      bw2_set_banks(device->machine, data & 0x07);
467467   }
468468}
469469
470static READ8_HANDLER( bw2_ppi8255_c_r )
470static READ8_DEVICE_HANDLER( bw2_ppi8255_c_r )
471471{
472472   /*
473473
src/mess/drivers/amstrad.c
r3373r3374
285285}
286286
287287/* Read/Write 8255 PPI port A (connected to AY-3-8912 databus) */
288static READ8_HANDLER ( amstrad_ppi_porta_r )
288static READ8_DEVICE_HANDLER ( amstrad_ppi_porta_r )
289289{
290   update_psg(machine);
290   update_psg(device->machine);
291291   return ppi_port_inputs[amstrad_ppi_PortA];
292292}
293293
294static WRITE8_HANDLER ( amstrad_ppi_porta_w )
294static WRITE8_DEVICE_HANDLER ( amstrad_ppi_porta_w )
295295{
296296   ppi_port_outputs[amstrad_ppi_PortA] = data;
297   update_psg(machine);
297   update_psg(device->machine);
298298}
299299
300300/* - Read PPI Port B -
r3373r3374
322322  On the CPC this can be used by a expansion device to report it's presence. "1" = device connected, "0" = device not connected. This is not always used by all expansion devices.
323323*/
324324
325static READ8_HANDLER (amstrad_ppi_portb_r)
325static READ8_DEVICE_HANDLER (amstrad_ppi_portb_r)
326326{
327327   int data = 0;
328328/* Set b7 with cassette tape input */
329329   if(amstrad_system_type != SYSTEM_GX4000)
330330   {
331      if (cassette_input(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" )) > 0.03) {
331      if (cassette_input(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" )) > 0.03) {
332332         data |= (1<<7);
333333      }
334334   }
335335/* Set b6 with Parallel/Printer port ready */
336336   if(amstrad_system_type != SYSTEM_GX4000)
337337   {
338      if (printer_is_ready(printer_device(machine))==0 ) {
338      if (printer_is_ready(printer_device(device->machine))==0 ) {
339339         data |= (1<<6);
340340      }
341341   }
r3373r3374
371371/* previous_ppi_portc_w value */
372372static int previous_ppi_portc_w;
373373
374static WRITE8_HANDLER ( amstrad_ppi_portc_w )
374static WRITE8_DEVICE_HANDLER ( amstrad_ppi_portc_w )
375375{
376376   int changed_data;
377377
r3373r3374
388388   aleste_rtc_function = data & 0x07;
389389
390390/* Perform PSG function */
391   update_psg(machine);
391   update_psg(device->machine);
392392
393393/* b5 Cassette Write data */
394394   if(amstrad_system_type != SYSTEM_GX4000)
395395   {
396396      if ((changed_data & 0x20) != 0) {
397         cassette_output(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ),
397         cassette_output(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ),
398398            ((data & 0x20) ? -1.0 : +1.0));
399399      }
400400   }
r3373r3374
403403   if(amstrad_system_type != SYSTEM_GX4000)
404404   {
405405      if ((changed_data & 0x10) != 0) {
406         cassette_change_state(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ),
406         cassette_change_state(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ),
407407            ((data & 0x10) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED),
408408            CASSETTE_MASK_MOTOR);
409409      }
docs/messnew.txt
r3373r3374
3333- Yamaha CX5M/CX5M-128/CX5MII/YIS303/YIS503/YIS503II/YIS503M [Miodrag Milanovic]
3434- Yashica YC-64 [Miodrag Milanovic]
3535
36
37
3638System Driver Changes:
3739----------------------
3840
r3373r3374
186188
187189- BIOS selection from MESSUI is now possible. (bug #1681) [Curt Coder]
188190
191
192
189193Imgtool Changes:
190194----------------
191195(none)
r3373r3374
194198
195199Source Changes:
196200----------------
197- The core is based on MAME 0.127u5.  This incorporates all features of the
201- The core is based on MAME 0.127u6.  This incorporates all features of the
198202  update to this core.  [MAME team]
199203
200204- Refactored ZIP path code out of src/mess/image.c, made more testable.  [Nate

Previous 15994 Revisions Next


© 1998-2018 The MESS Team