Previous 15994 Revisions Next

r15200 Wednesday 16th May, 2012 at 14:13:55 UTC by Miodrag Milanović
Sync with MAME r16308 (no whatsnew)
[src/emu]ioport.c screen.c
[src/mame/drivers]aliens.c brkthru.c crimfght.c exidy440.c exprraid.c galaxian.c labyrunr.c metlclsh.c scobra.c scramble.c segas16b.c simpsons.c system1.c tryout.c vendetta.c
[src/mame/includes]galaxian.h scramble.h system1.h
[src/mame/machine]scramble.c

src/mame/machine/scramble.c
r15199r15200
99
1010#include "emu.h"
1111#include "cpu/z80/z80.h"
12#include "machine/8255ppi.h"
12#include "machine/i8255.h"
1313#include "includes/scramble.h"
1414
1515
r15199r15200
5050
5151/* state of the security PAL (6J) */
5252
53static WRITE8_DEVICE_HANDLER( scramble_protection_w )
53WRITE8_DEVICE_HANDLER( scramble_protection_w )
5454{
5555   scramble_state *state = device->machine().driver_data<scramble_state>();
5656   state->m_xb = data;
5757}
5858
59static READ8_DEVICE_HANDLER( scramble_protection_r )
59READ8_DEVICE_HANDLER( scramble_protection_r )
6060{
6161   switch (cpu_get_pc(device->machine().device("maincpu")))
6262   {
r15199r15200
116116
117117static READ8_HANDLER( cavelon_banksw_r )
118118{
119   scramble_state *state = space->machine().driver_data<scramble_state>();
119120   cavelon_banksw(space->machine());
120121
121   if      ((offset >= 0x0100) && (offset <= 0x0103))
122      return ppi8255_r(space->machine().device("ppi8255_0"), offset - 0x0100);
122   if ((offset >= 0x0100) && (offset <= 0x0103))
123      return state->m_ppi8255_0->read(*space, offset - 0x0100);
123124   else if ((offset >= 0x0200) && (offset <= 0x0203))
124      return ppi8255_r(space->machine().device("ppi8255_1"), offset - 0x0200);
125      return state->m_ppi8255_1->read(*space, offset - 0x0200);
125126
126127   return 0xff;
127128}
128129
129130static WRITE8_HANDLER( cavelon_banksw_w )
130131{
132   scramble_state *state = space->machine().driver_data<scramble_state>();
131133   cavelon_banksw(space->machine());
132134
133   if      ((offset >= 0x0100) && (offset <= 0x0103))
134      ppi8255_w(space->machine().device("ppi8255_0"), offset - 0x0100, data);
135   if ((offset >= 0x0100) && (offset <= 0x0103))
136      state->m_ppi8255_0->write(*space, offset - 0x0100, data);
135137   else if ((offset >= 0x0200) && (offset <= 0x0203))
136      ppi8255_w(space->machine().device("ppi8255_1"), offset - 0x0200, data);
138      state->m_ppi8255_1->write(*space, offset - 0x0200, data);
137139}
138140
139141
r15199r15200
147149   space->write_byte(0x1000+offset,data);
148150}
149151
150const ppi8255_interface scramble_ppi_0_intf =
151{
152   DEVCB_INPUT_PORT("IN0"),      /* Port A read */
153   DEVCB_INPUT_PORT("IN1"),      /* Port B read */
154   DEVCB_INPUT_PORT("IN2"),      /* Port C read */
155   DEVCB_NULL,                  /* Port A write */
156   DEVCB_NULL,                  /* Port B write */
157   DEVCB_NULL                  /* Port C write */
158};
159152
160const ppi8255_interface scramble_ppi_1_intf =
161{
162   DEVCB_NULL,                                    /* Port A read */
163   DEVCB_NULL,                                    /* Port B read */
164   DEVCB_NULL,                                    /* Port C read */
165   DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),   /* Port A write */
166   DEVCB_HANDLER(scramble_sh_irqtrigger_w),            /* Port B write */
167   DEVCB_NULL                                    /* Port C write */
168};
169153
170
171const ppi8255_interface stratgyx_ppi_1_intf =
172{
173   DEVCB_NULL,                                    /* Port A read */
174   DEVCB_NULL,                                    /* Port B read */
175   DEVCB_INPUT_PORT("IN3"),                        /* Port C read */
176   DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),   /* Port A write */
177   DEVCB_HANDLER(scramble_sh_irqtrigger_w),            /* Port B write */
178   DEVCB_NULL                                    /* Port C write */
179};
180
181
182const ppi8255_interface scramble_protection_ppi_1_intf =
183{
184   DEVCB_NULL,                                    /* Port A read */
185   DEVCB_NULL,                                    /* Port B read */
186   DEVCB_HANDLER(scramble_protection_r),               /* Port C read */
187   DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),   /* Port A write */
188   DEVCB_HANDLER(scramble_sh_irqtrigger_w),            /* Port B write */
189   DEVCB_HANDLER(scramble_protection_w)               /* Port C write */
190};
191
192
193const ppi8255_interface mrkougar_ppi_1_intf =
194{
195   DEVCB_NULL,                                    /* Port A read */
196   DEVCB_NULL,                                    /* Port B read */
197   DEVCB_NULL,                                    /* Port C read */
198   DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),   /* Port A write */
199   DEVCB_HANDLER(mrkougar_sh_irqtrigger_w),            /* Port B write */
200   DEVCB_NULL                                    /* Port C write */
201};
202
203
204154DRIVER_INIT( scramble_ppi )
205155{
206156}
src/mame/includes/system1.h
r15199r15200
1#include "machine/i8255.h"
2
13class system1_state : public driver_device
24{
35public:
r15199r15200
35   system1_state(const machine_config &mconfig, device_type type, const char *tag)
46      : driver_device(mconfig, type, tag) ,
7      m_ppi8255(*this, "ppi8255"),
58      m_ram(*this, "ram"),
69      m_spriteram(*this, "spriteram"),
710      m_nob_mcu_latch(*this, "nob_mcu_latch"),
811      m_nob_mcu_status(*this, "nob_mcu_status"){ }
912
13   optional_device<i8255_device>  m_ppi8255;
1014   required_shared_ptr<UINT8> m_ram;
1115   required_shared_ptr<UINT8> m_spriteram;
src/mame/includes/galaxian.h
r15199r15200
44
55***************************************************************************/
66
7#include "machine/i8255.h"
8
79/* we scale horizontally by 3 to render stars correctly */
810#define GALAXIAN_XSCALE         3
911
r15199r15200
3739public:
3840   galaxian_state(const machine_config &mconfig, device_type type, const char *tag)
3941      : driver_device(mconfig, type, tag),
40        m_spriteram(*this, "spriteram") ,
41      m_videoram(*this, "videoram"){ }
42        m_ppi8255_0(*this, "ppi8255_0"),
43        m_ppi8255_1(*this, "ppi8255_1"),
44        m_ppi8255_2(*this, "ppi8255_2"),
45        m_spriteram(*this, "spriteram"),
46        m_videoram(*this, "videoram"){ }
4247
48   optional_device<i8255_device>  m_ppi8255_0;
49   optional_device<i8255_device>  m_ppi8255_1;
50   optional_device<i8255_device>  m_ppi8255_2;
4351   required_shared_ptr<UINT8> m_spriteram;
4452   required_shared_ptr<UINT8> m_videoram;
4553
src/mame/includes/scramble.h
r15199r15200
1#include "machine/8255ppi.h"
1#include "machine/i8255.h"
22#include "includes/galaxold.h"
33
44class scramble_state : public galaxold_state
r15199r15200
66public:
77   scramble_state(const machine_config &mconfig, device_type type, const char *tag)
88      : galaxold_state(mconfig, type, tag),
9        m_ppi8255_0(*this, "ppi8255_0"),
10        m_ppi8255_1(*this, "ppi8255_1"),
911        m_soundram(*this, "soundram") { }
1012
13   optional_device<i8255_device>  m_ppi8255_0;
14   optional_device<i8255_device>  m_ppi8255_1;
1115   optional_shared_ptr<UINT8> m_soundram;
1216   UINT8 m_cavelon_bank;
1317   UINT8 m_security_2B_counter;
r15199r15200
1620   DECLARE_CUSTOM_INPUT_MEMBER(ckongs_coinage_r);
1721   DECLARE_READ8_MEMBER(hncholms_prot_r);
1822   DECLARE_READ8_MEMBER(scramble_soundram_r);
23   DECLARE_READ8_MEMBER(mars_ppi8255_0_r);
24   DECLARE_READ8_MEMBER(mars_ppi8255_1_r);
1925   DECLARE_WRITE8_MEMBER(scramble_soundram_w);
2026   DECLARE_WRITE8_MEMBER(hotshock_sh_irqtrigger_w);
2127   DECLARE_WRITE8_MEMBER(scramble_filter_w);
2228   DECLARE_WRITE8_MEMBER(frogger_filter_w);
29   DECLARE_WRITE8_MEMBER(mars_ppi8255_0_w);
30   DECLARE_WRITE8_MEMBER(mars_ppi8255_1_w);
2331};
2432
2533
2634/*----------- defined in machine/scramble.c -----------*/
2735
28extern const ppi8255_interface scramble_ppi_0_intf;
29extern const ppi8255_interface scramble_ppi_1_intf;
30extern const ppi8255_interface stratgyx_ppi_1_intf;
31extern const ppi8255_interface scramble_protection_ppi_1_intf;
32extern const ppi8255_interface mrkougar_ppi_1_intf;
36extern const i8255_interface(scramble_ppi_0_intf);
37extern const i8255_interface(scramble_ppi_1_intf);
38extern const i8255_interface(stratgyx_ppi_1_intf);
3339
34
3540DRIVER_INIT( scramble_ppi );
3641DRIVER_INIT( stratgyx );
3742DRIVER_INIT( tazmani2 );
r15199r15200
6368READ8_HANDLER( hunchbks_mirror_r );
6469WRITE8_HANDLER( hunchbks_mirror_w );
6570
71READ8_DEVICE_HANDLER( scramble_protection_r );
72WRITE8_DEVICE_HANDLER( scramble_protection_w );
6673
74
6775/*----------- defined in audio/scramble.c -----------*/
6876
6977void scramble_sh_init(running_machine &machine);
src/mame/drivers/labyrunr.c
r15199r15200
1616#include "includes/labyrunr.h"
1717
1818
19static TIMER_DEVICE_CALLBACK( labyrunr_scanline )
19static INTERRUPT_GEN( labyrunr_vblank_interrupt )
2020{
21   labyrunr_state *state = timer.machine().driver_data<labyrunr_state>();
22   int scanline = param;
21   labyrunr_state *state = device->machine().driver_data<labyrunr_state>();
22   if (k007121_ctrlram_r(state->m_k007121, 7) & 0x02)
23      device_set_input_line(device, HD6309_IRQ_LINE, HOLD_LINE);
24}
2325
24   if(scanline == 240 && k007121_ctrlram_r(state->m_k007121, 7) & 0x02) // vblank irq
25      device_set_input_line(state->m_maincpu, HD6309_IRQ_LINE, HOLD_LINE);
26   else if(((scanline % 32) == 0) && k007121_ctrlram_r(state->m_k007121, 7) & 0x01) // timer irq
27      device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, PULSE_LINE);
26static INTERRUPT_GEN( labyrunr_timer_interrupt )
27{
28   labyrunr_state *state = device->machine().driver_data<labyrunr_state>();
29   if (k007121_ctrlram_r(state->m_k007121, 7) & 0x01)
30      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
2831}
2932
33
3034WRITE8_MEMBER(labyrunr_state::labyrunr_bankswitch_w)
3135{
3236   if (data & 0xe0) popmessage("bankswitch %02x", data);
r15199r15200
192196   /* basic machine hardware */
193197   MCFG_CPU_ADD("maincpu", HD6309, 3000000*4)      /* 24MHz/8? */
194198   MCFG_CPU_PROGRAM_MAP(labyrunr_map)
195   MCFG_TIMER_ADD_SCANLINE("scantimer", labyrunr_scanline, "screen", 0, 1)
199   MCFG_CPU_VBLANK_INT("screen", labyrunr_vblank_interrupt)
200   MCFG_CPU_PERIODIC_INT(labyrunr_timer_interrupt, 4*60)
196201
197202   MCFG_MACHINE_START(labyrunr)
198203
src/mame/drivers/aliens.c
r15199r15200
1919/* prototypes */
2020static KONAMI_SETLINES_CALLBACK( aliens_banking );
2121
22static TIMER_DEVICE_CALLBACK( aliens_scanline )
22static INTERRUPT_GEN( aliens_interrupt )
2323{
24   aliens_state *state = timer.machine().driver_data<aliens_state>();
25   int scanline = param;
24   aliens_state *state = device->machine().driver_data<aliens_state>();
2625
27   if(scanline == 240 && k051960_is_irq_enabled(state->m_k051960)) // vblank irq
28      cputag_set_input_line(timer.machine(), "maincpu", KONAMI_IRQ_LINE, HOLD_LINE);
29   else if(((scanline % 32) == 0) && (k051960_is_nmi_enabled(state->m_k051960))) // timer irq
30      cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
26   if (k051960_is_irq_enabled(state->m_k051960))
27      device_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
3128}
3229
3330READ8_MEMBER(aliens_state::bankedram_r)
r15199r15200
260257
261258   /* basic machine hardware */
262259
263   MCFG_CPU_ADD("maincpu", KONAMI,XTAL_24MHz/8)      /* 052001 (verified on pcb) */
260   MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/8)      /* 052001 (verified on pcb) */
264261   MCFG_CPU_PROGRAM_MAP(aliens_map)
265   MCFG_TIMER_ADD_SCANLINE("scantimer", aliens_scanline, "screen", 0, 1)
262   MCFG_CPU_VBLANK_INT("screen", aliens_interrupt)
266263
267264   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)    /* verified on pcb */
268265   MCFG_CPU_PROGRAM_MAP(aliens_sound_map)
269266
270   MCFG_QUANTUM_TIME(attotime::from_hz(600))
271
272267   MCFG_MACHINE_START(aliens)
273268   MCFG_MACHINE_RESET(aliens)
274269
src/mame/drivers/scramble.c
r15199r15200
3232#include "sound/dac.h"
3333#include "sound/flt_rc.h"
3434#include "machine/7474.h"
35#include "machine/8255ppi.h"
35#include "machine/i8255.h"
3636#include "includes/scramble.h"
3737
3838
r15199r15200
5353   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxold_flip_screen_y_w)
5454   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
5555   AM_RANGE(0x7800, 0x7800) AM_READ(watchdog_reset_r)
56   AM_RANGE(0x8100, 0x8103) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w)
57   AM_RANGE(0x8110, 0x8113) AM_DEVREAD_LEGACY("ppi8255_0", ppi8255_r)  /* mirror for Frog */
58   AM_RANGE(0x8200, 0x8203) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w)
56   AM_RANGE(0x8100, 0x8103) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
57   AM_RANGE(0x8110, 0x8113) AM_DEVREAD("ppi8255_0", i8255_device, read)  /* mirror for Frog */
58   AM_RANGE(0x8200, 0x8203) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
5959ADDRESS_MAP_END
6060
6161
r15199r15200
7979   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_x_w)
8080   AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxold_flip_screen_y_w)
8181   /* don't know where these are */
82//  AM_RANGE(0x8100, 0x8103) AM_WRITE_LEGACY(ppi8255_0_w)
83//  AM_RANGE(0x8200, 0x8203) AM_WRITE_LEGACY(ppi8255_1_w)
82//  AM_RANGE(0x8100, 0x8103) AM_WRITE("ppi8255_0", i8255_device, write)
83//  AM_RANGE(0x8200, 0x8203) AM_WRITE("ppi8255_1", i8255_device, write)
8484
8585   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
86//  AM_RANGE(0x8100, 0x8103) AM_READ_LEGACY(ppi8255_0_r)
87//  AM_RANGE(0x8200, 0x8203) AM_READ_LEGACY(ppi8255_1_r)
86//  AM_RANGE(0x8100, 0x8103) AM_READ("ppi8255_0", i8255_device, read)
87//  AM_RANGE(0x8200, 0x8203) AM_READ("ppi8255_1", i8255_device, read)
8888
8989   AM_RANGE(0xf000, 0xffff) AM_READONLY
9090ADDRESS_MAP_END
r15199r15200
9292static ADDRESS_MAP_START( ckongs_map, AS_PROGRAM, 8, scramble_state )
9393   AM_RANGE(0x0000, 0x5fff) AM_ROM
9494   AM_RANGE(0x6000, 0x6bff) AM_RAM
95   AM_RANGE(0x7000, 0x7003) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w)
96   AM_RANGE(0x7800, 0x7803) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w)
95   AM_RANGE(0x7000, 0x7003) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
96   AM_RANGE(0x7800, 0x7803) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
9797   AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_SHARE("videoram")
9898   AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(galaxold_attributesram_w) AM_SHARE("attributesram")
9999   AM_RANGE(0x9840, 0x985f) AM_RAM AM_SHARE("spriteram")
r15199r15200
107107ADDRESS_MAP_END
108108
109109
110static READ8_DEVICE_HANDLER(mars_ppi8255_r)
110READ8_MEMBER(scramble_state::mars_ppi8255_0_r)
111111{
112   return ppi8255_r(device, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01));
112   return m_ppi8255_0->read(space, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01));
113113}
114114
115static WRITE8_DEVICE_HANDLER(mars_ppi8255_w)
115READ8_MEMBER(scramble_state::mars_ppi8255_1_r)
116116{
117   ppi8255_w(device, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01), data);
117   return m_ppi8255_1->read(space, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01));
118118}
119119
120WRITE8_MEMBER(scramble_state::mars_ppi8255_0_w)
121{
122   m_ppi8255_0->write(space, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01), data);
123}
120124
125WRITE8_MEMBER(scramble_state::mars_ppi8255_1_w)
126{
127   m_ppi8255_1->write(space, ((offset >> 2) & 0x02) | ((offset >> 1) & 0x01), data);
128}
129
121130static ADDRESS_MAP_START( mars_map, AS_PROGRAM, 8, scramble_state )
122131   AM_RANGE(0x0000, 0x3fff) AM_ROM
123132   AM_RANGE(0x4000, 0x47ff) AM_RAM
r15199r15200
135144   AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxold_flip_screen_y_w)
136145   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
137146   AM_RANGE(0x7000, 0x7000) AM_READNOP
138   AM_RANGE(0x8100, 0x810f) AM_DEVREADWRITE_LEGACY("ppi8255_0", mars_ppi8255_r, mars_ppi8255_w)
139   AM_RANGE(0x8200, 0x820f) AM_DEVREADWRITE_LEGACY("ppi8255_1", mars_ppi8255_r, mars_ppi8255_w)
147   AM_RANGE(0x8100, 0x810f) AM_READWRITE(mars_ppi8255_0_r, mars_ppi8255_0_w)
148   AM_RANGE(0x8200, 0x820f) AM_READWRITE(mars_ppi8255_1_r, mars_ppi8255_1_w)
140149ADDRESS_MAP_END
141150
142151
r15199r15200
156165   AM_RANGE(0x6809, 0x6809) AM_WRITE(galaxold_flip_screen_x_w)
157166   AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxold_flip_screen_y_w)
158167   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
159   AM_RANGE(0x8200, 0x820f) AM_DEVREADWRITE_LEGACY("ppi8255_1", mars_ppi8255_r, mars_ppi8255_w)
168   AM_RANGE(0x8200, 0x820f) AM_READWRITE(mars_ppi8255_1_r, mars_ppi8255_1_w)
160169   AM_RANGE(0xa000, 0xafff) AM_ROM
161   AM_RANGE(0xc100, 0xc10f) AM_DEVREADWRITE_LEGACY("ppi8255_0", mars_ppi8255_r, mars_ppi8255_w)
170   AM_RANGE(0xc100, 0xc10f) AM_READWRITE(mars_ppi8255_0_r, mars_ppi8255_0_w)
162171ADDRESS_MAP_END
163172
164173
r15199r15200
177186   AM_RANGE(0x6809, 0x6809) AM_WRITE(galaxold_flip_screen_x_w)
178187   AM_RANGE(0x680b, 0x680b) AM_WRITE(galaxold_flip_screen_y_w)
179188   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
180   AM_RANGE(0x8100, 0x810f) AM_DEVREADWRITE_LEGACY("ppi8255_0", mars_ppi8255_r, mars_ppi8255_w)
181   AM_RANGE(0x8200, 0x820f) AM_DEVREADWRITE_LEGACY("ppi8255_1", mars_ppi8255_r, mars_ppi8255_w)
189   AM_RANGE(0x8100, 0x810f) AM_READWRITE(mars_ppi8255_0_r, mars_ppi8255_0_w)
190   AM_RANGE(0x8200, 0x820f) AM_READWRITE(mars_ppi8255_1_r, mars_ppi8255_1_w)
182191ADDRESS_MAP_END
183192
184193
r15199r15200
208217
209218static ADDRESS_MAP_START( hunchbks_map, AS_PROGRAM, 8, scramble_state )
210219   AM_RANGE(0x0000, 0x0fff) AM_ROM
211   AM_RANGE(0x1210, 0x1213) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w)
220   AM_RANGE(0x1210, 0x1213) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
212221   AM_RANGE(0x1400, 0x143f) AM_RAM_WRITE(galaxold_attributesram_w) AM_SHARE("attributesram")
213222   AM_RANGE(0x1440, 0x145f) AM_RAM AM_SHARE("spriteram")
214223   AM_RANGE(0x1460, 0x147f) AM_RAM AM_SHARE("bulletsram")
215224   AM_RANGE(0x1480, 0x14ff) AM_RAM
216   AM_RANGE(0x1500, 0x1503) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w)
225   AM_RANGE(0x1500, 0x1503) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
217226   AM_RANGE(0x1606, 0x1606) AM_WRITE(galaxold_flip_screen_x_w)
218227   AM_RANGE(0x1607, 0x1607) AM_WRITE(galaxold_flip_screen_y_w)
219228   AM_RANGE(0x1680, 0x1680) AM_READ(watchdog_reset_r)
r15199r15200
243252   AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxold_flip_screen_x_w)
244253   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxold_flip_screen_y_w)
245254   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
246   AM_RANGE(0x8100, 0x8103) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w)
247   AM_RANGE(0x8200, 0x8203) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w)
255   AM_RANGE(0x8100, 0x8103) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
256   AM_RANGE(0x8200, 0x8203) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
248257   AM_RANGE(0xc000, 0xffff) AM_ROM
249258ADDRESS_MAP_END
250259
r15199r15200
11481157   GFXDECODE_ENTRY( "gfx1", 0x0000, ad2083_spritelayout,  0, 8 )
11491158GFXDECODE_END
11501159
1160
1161
1162I8255A_INTERFACE( scramble_ppi_0_intf )
1163{
1164   DEVCB_INPUT_PORT("IN0"),      /* Port A read */
1165   DEVCB_NULL,                  /* Port A write */
1166   DEVCB_INPUT_PORT("IN1"),      /* Port B read */
1167   DEVCB_NULL,                  /* Port B write */
1168   DEVCB_INPUT_PORT("IN2"),      /* Port C read */
1169   DEVCB_NULL                  /* Port C write */
1170};
1171
1172I8255A_INTERFACE( scramble_ppi_1_intf )
1173{
1174   DEVCB_NULL,                        /* Port A read */
1175   DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */
1176   DEVCB_NULL,                        /* Port B read */
1177   DEVCB_HANDLER(scramble_sh_irqtrigger_w),/* Port B write */
1178   DEVCB_NULL,                        /* Port C read */
1179   DEVCB_NULL                        /* Port C write */
1180};
1181
1182I8255A_INTERFACE( stratgyx_ppi_1_intf )
1183{
1184   DEVCB_NULL,                        /* Port A read */
1185   DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */
1186   DEVCB_NULL,                        /* Port B read */
1187   DEVCB_HANDLER(scramble_sh_irqtrigger_w),/* Port B write */
1188   DEVCB_INPUT_PORT("IN3"),            /* Port C read */
1189   DEVCB_NULL                        /* Port C write */
1190};
1191
1192I8255A_INTERFACE( scramble_protection_ppi_1_intf )
1193{
1194   DEVCB_NULL,                        /* Port A read */
1195   DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */
1196   DEVCB_NULL,                        /* Port B read */
1197   DEVCB_HANDLER(scramble_sh_irqtrigger_w),/* Port B write */
1198   DEVCB_HANDLER(scramble_protection_r),   /* Port C read */
1199   DEVCB_HANDLER(scramble_protection_w)   /* Port C write */
1200};
1201
1202I8255A_INTERFACE( mrkougar_ppi_1_intf )
1203{
1204   DEVCB_NULL,                        /* Port A read */
1205   DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */
1206   DEVCB_NULL,                        /* Port B read */
1207   DEVCB_HANDLER(mrkougar_sh_irqtrigger_w),/* Port B write */
1208   DEVCB_NULL,                        /* Port C read */
1209   DEVCB_NULL                        /* Port C write */
1210};
1211
1212
11511213static const ay8910_interface scramble_ay8910_interface_2 =
11521214{
11531215   AY8910_LEGACY_OUTPUT,
r15199r15200
12511313
12521314   MCFG_MACHINE_RESET(scramble)
12531315
1254   MCFG_PPI8255_ADD( "ppi8255_0", scramble_ppi_0_intf )
1255   MCFG_PPI8255_ADD( "ppi8255_1", scramble_ppi_1_intf )
1316   MCFG_I8255A_ADD( "ppi8255_0", scramble_ppi_0_intf )
1317   MCFG_I8255A_ADD( "ppi8255_1", scramble_ppi_1_intf )
12561318
12571319   /* video hardware */
12581320   MCFG_SCREEN_ADD("screen", RASTER)
r15199r15200
13201382   MCFG_CPU_MODIFY("maincpu")
13211383   MCFG_CPU_PROGRAM_MAP(mrkougar_map)
13221384
1323   MCFG_PPI8255_RECONFIG( "ppi8255_1", mrkougar_ppi_1_intf )
1385   MCFG_DEVICE_REMOVE("ppi8255_1")
1386   MCFG_I8255A_ADD( "ppi8255_1", mrkougar_ppi_1_intf )
13241387
13251388   /* video hardware */
13261389   MCFG_GFXDECODE(mrkougar)
r15199r15200
13341397   MCFG_CPU_MODIFY("maincpu")
13351398   MCFG_CPU_PROGRAM_MAP(mrkougar_map)
13361399
1337   MCFG_PPI8255_RECONFIG( "ppi8255_1", mrkougar_ppi_1_intf )
1400   MCFG_DEVICE_REMOVE("ppi8255_1")
1401   MCFG_I8255A_ADD( "ppi8255_1", mrkougar_ppi_1_intf )
13381402
13391403   /* video hardware */
13401404   MCFG_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
src/mame/drivers/exidy440.c
r15199r15200
255255INPUT_CHANGED_MEMBER(exidy440_state::coin_inserted)
256256{
257257   /* if we got a coin, set the IRQ on the main CPU */
258   if (newval)
258   if (oldval)
259259      cputag_set_input_line(machine(), "maincpu", 0, ASSERT_LINE);
260260}
261261
src/mame/drivers/brkthru.c
r15199r15200
9999INPUT_CHANGED_MEMBER(brkthru_state::coin_inserted)
100100{
101101   /* coin insertion causes an IRQ */
102   if (newval)
102   if (oldval)
103103      device_set_input_line(m_maincpu, 0, ASSERT_LINE);
104104}
105105
src/mame/drivers/tryout.c
r15199r15200
8383
8484INPUT_CHANGED_MEMBER(tryout_state::coin_inserted)
8585{
86   if (newval)
86   if (oldval)
8787      cputag_set_input_line(machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
8888}
8989
src/mame/drivers/system1.c
r15199r15200
205205#include "cpu/z80/z80.h"
206206#include "cpu/mcs51/mcs51.h"
207207#include "machine/z80pio.h"
208#include "machine/8255ppi.h"
208#include "machine/i8255.h"
209209#include "machine/segacrpt.h"
210210#include "machine/segacrp2.h"
211211#include "machine/mc8123.h"
r15199r15200
490490
491491READ8_MEMBER(system1_state::sound_data_r)
492492{
493   ppi8255_device *ppi = machine().device<ppi8255_device>("ppi");
494493   z80pio_device *pio = machine().device<z80pio_device>("pio");
495494
496495   /* if we have an 8255 PPI, get the data from the port and toggle the ack */
497   if (ppi != NULL)
496   if (m_ppi8255 != NULL)
498497   {
499      UINT8 initial_value = ppi8255_get_port_c(ppi);
500      ppi8255_set_port_c(ppi, initial_value & ~0x40);
501      ppi8255_set_port_c(ppi, initial_value |  0x40);
498      m_ppi8255->pc6_w(0);
499      m_ppi8255->pc6_w(1);
502500      return soundlatch_byte_r(space, offset);
503501   }
504502
r15199r15200
750748   AM_RANGE(0x0c, 0x0c) AM_MIRROR(0x02) AM_READ_PORT("SWA")   /* DIP2 */
751749   AM_RANGE(0x0d, 0x0d) AM_MIRROR(0x02) AM_READ_PORT("SWB")   /* DIP1 some games read it from here... */
752750   AM_RANGE(0x10, 0x10) AM_MIRROR(0x03) AM_READ_PORT("SWB")   /* DIP1 ... and some others from here but there are games which check BOTH! */
753   AM_RANGE(0x14, 0x17) AM_DEVREADWRITE_LEGACY("ppi", ppi8255_r, ppi8255_w)
751   AM_RANGE(0x14, 0x17) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
754752ADDRESS_MAP_END
755753
756754/* I/O map for systems with a Z80 PIO chip */
r15199r15200
21012099 *
21022100 *************************************/
21032101
2104static const ppi8255_interface ppi_interface =
2102static I8255A_INTERFACE( ppi8255_intf )
21052103{
2106   DEVCB_NULL,
2107   DEVCB_NULL,
2108   DEVCB_NULL,
2109   DEVCB_DRIVER_MEMBER(system1_state, soundport_w),
2110   DEVCB_DRIVER_MEMBER(system1_state, videomode_w),
2111   DEVCB_HANDLER(sound_control_w)
2104   DEVCB_NULL,                                 /* Port A read */
2105   DEVCB_DRIVER_MEMBER(system1_state, soundport_w),   /* Port A write */
2106   DEVCB_NULL,                                 /* Port B read */
2107   DEVCB_DRIVER_MEMBER(system1_state, videomode_w),   /* Port B write */
2108   DEVCB_NULL,                                 /* Port C read */
2109   DEVCB_HANDLER(sound_control_w)                  /* Port C write */
21122110};
21132111
21142112static Z80PIO_INTERFACE( pio_interface )
r15199r15200
21482146   MCFG_MACHINE_START(system1)
21492147   MCFG_MACHINE_RESET(system1)
21502148
2151   MCFG_PPI8255_ADD("ppi", ppi_interface)
2149   MCFG_I8255A_ADD( "ppi8255", ppi8255_intf )
21522150
21532151   /* video hardware */
21542152   MCFG_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)   /* needed for proper hardware collisions */
r15199r15200
21882186   MCFG_CPU_MODIFY("maincpu")
21892187   MCFG_CPU_IO_MAP(system1_pio_io_map)
21902188
2191   MCFG_DEVICE_REMOVE("ppi")
2189   MCFG_DEVICE_REMOVE("ppi8255")
21922190   MCFG_Z80PIO_ADD("pio", MASTER_CLOCK, pio_interface)
21932191MACHINE_CONFIG_END
21942192
src/mame/drivers/metlclsh.c
r15199r15200
130130
131131INPUT_CHANGED_MEMBER(metlclsh_state::coin_inserted)
132132{
133   if (newval)
133   if (oldval)
134134      cputag_set_input_line(machine(), "sub", INPUT_LINE_NMI, ASSERT_LINE);
135135}
136136
src/mame/drivers/simpsons.c
r15199r15200
307307static MACHINE_CONFIG_START( simpsons, simpsons_state )
308308
309309   /* basic machine hardware */
310   MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/2/4) /* pin 18 of konami cpu is 12Mhz, while pin 17 is 3mhz. Clock probably divided internally by 4 */
310   MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/8) /* 052001 (verified on pcb) */
311311   MCFG_CPU_PROGRAM_MAP(main_map)
312312   MCFG_CPU_VBLANK_INT("screen", simpsons_irq)   /* IRQ triggered by the 052109, FIRQ by the sprite hardware */
313313
src/mame/drivers/scobra.c
r15199r15200
3434
3535#include "emu.h"
3636#include "cpu/z80/z80.h"
37#include "machine/8255ppi.h"
37#include "machine/i8255.h"
3838#include "machine/7474.h"
3939#include "sound/ay8910.h"
4040#include "includes/scramble.h"
r15199r15200
5050   optional_shared_ptr<UINT8> m_soundram;
5151   DECLARE_READ8_MEMBER(scobra_soundram_r);
5252   DECLARE_WRITE8_MEMBER(scobra_soundram_w);
53   DECLARE_READ8_MEMBER(scobra_type2_ppi8255_0_r);
54   DECLARE_READ8_MEMBER(scobra_type2_ppi8255_1_r);
55   DECLARE_READ8_MEMBER(hustler_ppi8255_0_r);
56   DECLARE_READ8_MEMBER(hustler_ppi8255_1_r);
57   DECLARE_WRITE8_MEMBER(scobra_type2_ppi8255_0_w);
58   DECLARE_WRITE8_MEMBER(scobra_type2_ppi8255_1_w);
59   DECLARE_WRITE8_MEMBER(hustler_ppi8255_0_w);
60   DECLARE_WRITE8_MEMBER(hustler_ppi8255_1_w);
5361   DECLARE_CUSTOM_INPUT_MEMBER(stratgyx_coinage_r);
5462};
5563
r15199r15200
96104   DEVCB_NULL
97105};
98106
99static READ8_DEVICE_HANDLER(scobra_type2_ppi8255_r)
100{
101   return ppi8255_r(device, offset >> 2);
102}
107READ8_MEMBER(scobra_state::scobra_type2_ppi8255_0_r){ return m_ppi8255_0->read(space, offset >> 2); }
108READ8_MEMBER(scobra_state::scobra_type2_ppi8255_1_r){ return m_ppi8255_1->read(space, offset >> 2); }
109WRITE8_MEMBER(scobra_state::scobra_type2_ppi8255_0_w){ m_ppi8255_0->write(space, offset >> 2, data); }
110WRITE8_MEMBER(scobra_state::scobra_type2_ppi8255_1_w){ m_ppi8255_1->write(space, offset >> 2, data); }
103111
104static WRITE8_DEVICE_HANDLER(scobra_type2_ppi8255_w)
105{
106   ppi8255_w(device, offset >> 2, data);
107}
112READ8_MEMBER(scobra_state::hustler_ppi8255_0_r){ return m_ppi8255_0->read(space, offset >> 3); }
113READ8_MEMBER(scobra_state::hustler_ppi8255_1_r){ return m_ppi8255_1->read(space, offset >> 3); }
114WRITE8_MEMBER(scobra_state::hustler_ppi8255_0_w){ m_ppi8255_0->write(space, offset >> 3, data); }
115WRITE8_MEMBER(scobra_state::hustler_ppi8255_1_w){ m_ppi8255_1->write(space, offset >> 3, data); }
108116
109static READ8_DEVICE_HANDLER(hustler_ppi8255_r)
110{
111   return ppi8255_r(device, offset >> 3);
112}
113
114static WRITE8_DEVICE_HANDLER(hustler_ppi8255_w)
115{
116   ppi8255_w(device, offset >> 3, data);
117}
118
119117static ADDRESS_MAP_START( type1_map, AS_PROGRAM, 8, scobra_state )
120118   AM_RANGE(0x0000, 0x7fff) AM_ROM
121119   AM_RANGE(0x8000, 0x87ff) AM_RAM
r15199r15200
126124   AM_RANGE(0x9040, 0x905f) AM_RAM AM_SHARE("spriteram")
127125   AM_RANGE(0x9060, 0x907f) AM_RAM AM_SHARE("bulletsram")
128126   AM_RANGE(0x9080, 0x90ff) AM_RAM
129   AM_RANGE(0x9800, 0x9803) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w)
130   AM_RANGE(0xa000, 0xa003) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w)
127   AM_RANGE(0x9800, 0x9803) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
128   AM_RANGE(0xa000, 0xa003) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
131129   AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxold_nmi_enable_w)
132130   AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxold_coin_counter_w)
133131   AM_RANGE(0xa804, 0xa804) AM_WRITE(galaxold_stars_enable_w)
r15199r15200
146144   AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_SHARE("videoram")
147145   AM_RANGE(0x9400, 0x97ff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w)   /* mirror */
148146   AM_RANGE(0x9800, 0x9800) AM_READ(watchdog_reset_r)
149   AM_RANGE(0xa000, 0xa00f) AM_DEVREADWRITE_LEGACY("ppi8255_0", scobra_type2_ppi8255_r, scobra_type2_ppi8255_w)
150   AM_RANGE(0xa800, 0xa80f) AM_DEVREADWRITE_LEGACY("ppi8255_1", scobra_type2_ppi8255_r, scobra_type2_ppi8255_w)
147   AM_RANGE(0xa000, 0xa00f) AM_READWRITE(scobra_type2_ppi8255_0_r, scobra_type2_ppi8255_0_w)
148   AM_RANGE(0xa800, 0xa80f) AM_READWRITE(scobra_type2_ppi8255_1_r, scobra_type2_ppi8255_1_w)
151149   AM_RANGE(0xb000, 0xb000) AM_WRITE(galaxold_stars_enable_w)
152150   AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxold_nmi_enable_w)
153151   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_coin_counter_0_w)
r15199r15200
169167   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_y_w)
170168   AM_RANGE(0xa80e, 0xa80e) AM_WRITENOP   /* coin counters */
171169   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
172   AM_RANGE(0xd000, 0xd01f) AM_DEVREADWRITE_LEGACY("ppi8255_0", hustler_ppi8255_r, hustler_ppi8255_w)
173   AM_RANGE(0xe000, 0xe01f) AM_DEVREADWRITE_LEGACY("ppi8255_1", hustler_ppi8255_r, hustler_ppi8255_w)
170   AM_RANGE(0xd000, 0xd01f) AM_READWRITE(hustler_ppi8255_0_r, hustler_ppi8255_0_w)
171   AM_RANGE(0xe000, 0xe01f) AM_READWRITE(hustler_ppi8255_1_r, hustler_ppi8255_1_w)
174172ADDRESS_MAP_END
175173
176174static ADDRESS_MAP_START( hustlerb_map, AS_PROGRAM, 8, scobra_state )
r15199r15200
186184   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_y_w)
187185   AM_RANGE(0xa807, 0xa807) AM_WRITE(galaxold_flip_screen_x_w)
188186   AM_RANGE(0xb000, 0xb000) AM_READ(watchdog_reset_r)
189   AM_RANGE(0xc100, 0xc103) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w)
190   AM_RANGE(0xc200, 0xc203) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w)
187   AM_RANGE(0xc100, 0xc103) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
188   AM_RANGE(0xc200, 0xc203) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
191189ADDRESS_MAP_END
192190
193191static ADDRESS_MAP_START( mimonkey_map, AS_PROGRAM, 8, scobra_state )
r15199r15200
199197   AM_RANGE(0x9040, 0x905f) AM_RAM AM_SHARE("spriteram")
200198   AM_RANGE(0x9060, 0x907f) AM_RAM AM_SHARE("bulletsram")
201199   AM_RANGE(0x9080, 0x90ff) AM_RAM
202   AM_RANGE(0x9800, 0x9803) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w)
203   AM_RANGE(0xa000, 0xa003) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w)
200   AM_RANGE(0x9800, 0x9803) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
201   AM_RANGE(0xa000, 0xa003) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
204202   AM_RANGE(0xa801, 0xa801) AM_WRITE(galaxold_nmi_enable_w)
205203   AM_RANGE(0xa800, 0xa802) AM_WRITE(galaxold_gfxbank_w)
206204   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_x_w)
r15199r15200
669667
670668   MCFG_MACHINE_RESET(scramble)
671669
672   MCFG_PPI8255_ADD( "ppi8255_0", scramble_ppi_0_intf )
673   MCFG_PPI8255_ADD( "ppi8255_1", scramble_ppi_1_intf )
670   MCFG_I8255A_ADD( "ppi8255_0", scramble_ppi_0_intf )
671   MCFG_I8255A_ADD( "ppi8255_1", scramble_ppi_1_intf )
674672
675673   MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL)
676674   MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback)
r15199r15200
754752
755753   /* basic machine hardware */
756754
757   /* device config overrides */
758   MCFG_PPI8255_RECONFIG( "ppi8255_1", stratgyx_ppi_1_intf )
755   MCFG_DEVICE_REMOVE("ppi8255_1")
756   MCFG_I8255A_ADD( "ppi8255_1", stratgyx_ppi_1_intf )
759757
760758   /* video hardware */
761759   MCFG_PALETTE_LENGTH(32+64+2+8)   /* 32 for characters, 64 for stars, 2 for bullets, 8 for background */
r15199r15200
797795   MCFG_TIMER_ADD("int_timer", galaxold_interrupt_timer)
798796
799797   /* device config overrides */
800   MCFG_PPI8255_ADD( "ppi8255_0", scramble_ppi_0_intf )
801   MCFG_PPI8255_ADD( "ppi8255_1", scramble_ppi_1_intf )
798   MCFG_I8255A_ADD( "ppi8255_0", scramble_ppi_0_intf )
799   MCFG_I8255A_ADD( "ppi8255_1", scramble_ppi_1_intf )
802800
803801   /* video hardware */
804802   MCFG_SCREEN_ADD("screen", RASTER)
src/mame/drivers/galaxian.c
r15199r15200
417417#include "emu.h"
418418#include "cpu/z80/z80.h"
419419#include "cpu/s2650/s2650.h"
420#include "machine/8255ppi.h"
420#include "machine/i8255.h"
421421#include "sound/ay8910.h"
422422#include "sound/sn76496.h"
423423#include "sound/dac.h"
r15199r15200
622622}
623623
624624
625static const ppi8255_interface konami_ppi8255_0_intf =
625static I8255A_INTERFACE( konami_ppi8255_0_intf )
626626{
627   DEVCB_INPUT_PORT("IN0"),         /* Port A read */
628   DEVCB_INPUT_PORT("IN1"),         /* Port B read */
629   DEVCB_INPUT_PORT("IN2"),         /* Port C read */
630   DEVCB_NULL,                     /* Port A write */
631   DEVCB_NULL,                     /* Port B write */
632   DEVCB_HANDLER(konami_portc_0_w)      /* Port C write */
627   DEVCB_INPUT_PORT("IN0"),      /* Port A read */
628   DEVCB_NULL,                  /* Port A write */
629   DEVCB_INPUT_PORT("IN1"),      /* Port B read */
630   DEVCB_NULL,                  /* Port B write */
631   DEVCB_INPUT_PORT("IN2"),      /* Port C read */
632   DEVCB_HANDLER(konami_portc_0_w)   /* Port C write */
633633};
634634
635
636static const ppi8255_interface konami_ppi8255_1_intf =
635static I8255A_INTERFACE( konami_ppi8255_1_intf )
637636{
638   DEVCB_NULL,                                    /* Port A read */
639   DEVCB_NULL,                                    /* Port B read */
640   DEVCB_INPUT_PORT("IN3"),                        /* Port C read */
641   DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),      /* Port A write */
642   DEVCB_HANDLER(konami_sound_control_w),               /* Port B write */
643   DEVCB_HANDLER(konami_portc_1_w)                     /* Port C write */
637   DEVCB_NULL,                        /* Port A read */
638   DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */
639   DEVCB_NULL,                        /* Port B read */
640   DEVCB_HANDLER(konami_sound_control_w),   /* Port B write */
641   DEVCB_INPUT_PORT("IN3"),            /* Port C read */
642   DEVCB_HANDLER(konami_portc_1_w)         /* Port C write */
644643};
645644
646645
647
648646/*************************************
649647 *
650648 *  The End I/O
r15199r15200
655653{
656654   /* the decoding here is very simplistic, and you can address both simultaneously */
657655   UINT8 result = 0xff;
658   if (offset & 0x0100) result &= ppi8255_r(machine().device("ppi8255_0"), offset & 3);
659   if (offset & 0x0200) result &= ppi8255_r(machine().device("ppi8255_1"), offset & 3);
656   if (offset & 0x0100) result &= m_ppi8255_0->read(space, offset & 3);
657   if (offset & 0x0200) result &= m_ppi8255_1->read(space, offset & 3);
660658   return result;
661659}
662660
r15199r15200
664662WRITE8_MEMBER(galaxian_state::theend_ppi8255_w)
665663{
666664   /* the decoding here is very simplistic, and you can address both simultaneously */
667   if (offset & 0x0100) ppi8255_w(machine().device("ppi8255_0"), offset & 3, data);
668   if (offset & 0x0200) ppi8255_w(machine().device("ppi8255_1"), offset & 3, data);
665   if (offset & 0x0100) m_ppi8255_0->write(space, offset & 3, data);
666   if (offset & 0x0200) m_ppi8255_1->write(space, offset & 3, data);
669667}
670668
671669
r15199r15200
675673}
676674
677675
678static const ppi8255_interface theend_ppi8255_0_intf =
676static I8255A_INTERFACE( theend_ppi8255_0_intf )
679677{
680   DEVCB_INPUT_PORT("IN0"),         /* Port A read */
681   DEVCB_INPUT_PORT("IN1"),         /* Port B read */
682   DEVCB_INPUT_PORT("IN2"),         /* Port C read */
683   DEVCB_NULL,                     /* Port A write */
684   DEVCB_NULL,                     /* Port B write */
685   DEVCB_HANDLER(theend_coin_counter_w)/* Port C write */
678   DEVCB_INPUT_PORT("IN0"),      /* Port A read */
679   DEVCB_NULL,                  /* Port A write */
680   DEVCB_INPUT_PORT("IN1"),      /* Port B read */
681   DEVCB_NULL,                  /* Port B write */
682   DEVCB_INPUT_PORT("IN2"),      /* Port C read */
683   DEVCB_HANDLER(theend_coin_counter_w)   /* Port C write */
686684};
687685
688686
r15199r15200
736734}
737735
738736
739static const ppi8255_interface scramble_ppi8255_1_intf =
737static I8255A_INTERFACE( scramble_ppi8255_1_intf )
740738{
741   DEVCB_NULL,                                    /* Port A read */
742   DEVCB_NULL,                                    /* Port B read */
743   DEVCB_HANDLER(scramble_protection_r),               /* Port C read */
744   DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),      /* Port A write */
745   DEVCB_HANDLER(konami_sound_control_w),               /* Port B write */
746   DEVCB_HANDLER(scramble_protection_w)               /* Port C write */
739   DEVCB_NULL,                        /* Port A read */
740   DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */
741   DEVCB_NULL,                        /* Port B read */
742   DEVCB_HANDLER(konami_sound_control_w),   /* Port B write */
743   DEVCB_HANDLER(scramble_protection_r),   /* Port C read */
744   DEVCB_HANDLER(scramble_protection_w)   /* Port C write */
747745};
748746
749747
750
751748/*************************************
752749 *
753750 *  Explorer I/O
r15199r15200
779776{
780777   /* the decoding here is very simplistic, and you can address both simultaneously */
781778   UINT8 result = 0xff;
782   if (offset & 0x04) result &= ppi8255_r(machine().device("ppi8255_2"), offset & 3);
779   if (offset & 0x04) result &= m_ppi8255_2->read(space, offset & 3);
783780   return result;
784781}
785782
r15199r15200
787784WRITE8_MEMBER(galaxian_state::sfx_sample_io_w)
788785{
789786   /* the decoding here is very simplistic, and you can address both simultaneously */
790   if (offset & 0x04) ppi8255_w(machine().device("ppi8255_2"), offset & 3, data);
787   if (offset & 0x04) m_ppi8255_2->write(space, offset & 3, data);
791788   if (offset & 0x10) dac_signed_data_w(machine().device("dac"), data);
792789}
793790
r15199r15200
805802}
806803
807804
808static const ppi8255_interface sfx_ppi8255_2_intf =
805static I8255A_INTERFACE( sfx_ppi8255_2_intf )
809806{
810   DEVCB_DRIVER_MEMBER(driver_device, soundlatch2_byte_r),      /* Port A read */
811   DEVCB_NULL,                                    /* Port B read */
812   DEVCB_NULL,                                    /* Port C read */
813   DEVCB_NULL,                                    /* Port A write */
814   DEVCB_NULL,                                    /* Port B write */
815   DEVCB_NULL                                    /* Port C write */
807   DEVCB_DRIVER_MEMBER(driver_device, soundlatch2_byte_r),   /* Port A read */
808   DEVCB_NULL,                        /* Port A write */
809   DEVCB_NULL,                        /* Port B read */
810   DEVCB_NULL,                        /* Port B write */
811   DEVCB_NULL,                        /* Port C read */
812   DEVCB_NULL                        /* Port C write */
816813};
817814
818
819
820815/*************************************
821816 *
822817 *  Monster Zero I/O
r15199r15200
879874{
880875}
881876
882static const ppi8255_interface monsterz_ppi8255_1_intf =
877static I8255A_INTERFACE( monsterz_ppi8255_1_intf )
883878{
884   DEVCB_NULL,                                    /* Port A read */
885   DEVCB_NULL,                                    /* Port B read */
886   DEVCB_INPUT_PORT("IN3"),                        /* Port C read */
887   DEVCB_HANDLER(monsterz_porta_1_w),                  /* Port A write */
888   DEVCB_HANDLER(monsterz_portb_1_w),                  /* Port B write */
889   DEVCB_HANDLER(monsterz_portc_1_w)                  /* Port C write */
879   DEVCB_NULL,                     /* Port A read */
880   DEVCB_HANDLER(monsterz_porta_1_w),   /* Port A write */
881   DEVCB_NULL,                     /* Port B read */
882   DEVCB_HANDLER(monsterz_portb_1_w),   /* Port B write */
883   DEVCB_INPUT_PORT("IN3"),         /* Port C read */
884   DEVCB_HANDLER(monsterz_portc_1_w)   /* Port C write */
890885};
891886
892887
893
894888/*************************************
895889 *
896890 *  Frogger I/O
r15199r15200
901895{
902896   /* the decoding here is very simplistic, and you can address both simultaneously */
903897   UINT8 result = 0xff;
904   if (offset & 0x1000) result &= ppi8255_r(machine().device("ppi8255_1"), (offset >> 1) & 3);
905   if (offset & 0x2000) result &= ppi8255_r(machine().device("ppi8255_0"), (offset >> 1) & 3);
898   if (offset & 0x1000) result &= m_ppi8255_1->read(space, (offset >> 1) & 3);
899   if (offset & 0x2000) result &= m_ppi8255_0->read(space, (offset >> 1) & 3);
906900   return result;
907901}
908902
r15199r15200
910904WRITE8_MEMBER(galaxian_state::frogger_ppi8255_w)
911905{
912906   /* the decoding here is very simplistic, and you can address both simultaneously */
913   if (offset & 0x1000) ppi8255_w(machine().device("ppi8255_1"), (offset >> 1) & 3, data);
914   if (offset & 0x2000) ppi8255_w(machine().device("ppi8255_0"), (offset >> 1) & 3, data);
907   if (offset & 0x1000) m_ppi8255_1->write(space, (offset >> 1) & 3, data);
908   if (offset & 0x2000) m_ppi8255_0->write(space, (offset >> 1) & 3, data);
915909}
916910
917911
r15199r15200
960954{
961955   /* the decoding here is very simplistic, and you can address both simultaneously */
962956   UINT8 result = 0xff;
963   if (offset & 0x1000) result &= ppi8255_r(machine().device("ppi8255_0"), (offset >> 3) & 3);
964   if (offset & 0x2000) result &= ppi8255_r(machine().device("ppi8255_1"), (offset >> 3) & 3);
957   if (offset & 0x1000) result &= m_ppi8255_0->read(space, (offset >> 3) & 3);
958   if (offset & 0x2000) result &= m_ppi8255_1->read(space, (offset >> 3) & 3);
965959   return result;
966960}
967961
r15199r15200
969963WRITE8_MEMBER(galaxian_state::frogf_ppi8255_w)
970964{
971965   /* the decoding here is very simplistic, and you can address both simultaneously */
972   if (offset & 0x1000) ppi8255_w(machine().device("ppi8255_0"), (offset >> 3) & 3, data);
973   if (offset & 0x2000) ppi8255_w(machine().device("ppi8255_1"), (offset >> 3) & 3, data);
966   if (offset & 0x1000) m_ppi8255_0->write(space, (offset >> 3) & 3, data);
967   if (offset & 0x2000) m_ppi8255_1->write(space, (offset >> 3) & 3, data);
974968}
975969
976970
r15199r15200
981975 *
982976 *************************************/
983977
984READ8_MEMBER(galaxian_state::turtles_ppi8255_0_r){ return ppi8255_r(machine().device("ppi8255_0"), (offset >> 4) & 3); }
985READ8_MEMBER(galaxian_state::turtles_ppi8255_1_r){ return ppi8255_r(machine().device("ppi8255_1"), (offset >> 4) & 3); }
986WRITE8_MEMBER(galaxian_state::turtles_ppi8255_0_w){ ppi8255_w(machine().device("ppi8255_0"), (offset >> 4) & 3, data); }
987WRITE8_MEMBER(galaxian_state::turtles_ppi8255_1_w){ ppi8255_w(machine().device("ppi8255_1"), (offset >> 4) & 3, data); }
978READ8_MEMBER(galaxian_state::turtles_ppi8255_0_r){ return m_ppi8255_0->read(space, (offset >> 4) & 3); }
979READ8_MEMBER(galaxian_state::turtles_ppi8255_1_r){ return m_ppi8255_1->read(space, (offset >> 4) & 3); }
980WRITE8_MEMBER(galaxian_state::turtles_ppi8255_0_w){ m_ppi8255_0->write(space, (offset >> 4) & 3, data); }
981WRITE8_MEMBER(galaxian_state::turtles_ppi8255_1_w){ m_ppi8255_1->write(space, (offset >> 4) & 3, data); }
988982
989983
990984
r15199r15200
10611055   digitalker_0_wr_w(device, data & 4 ? ASSERT_LINE : CLEAR_LINE);
10621056}
10631057
1064static const ppi8255_interface scorpion_ppi8255_1_intf =
1058static I8255A_INTERFACE( scorpion_ppi8255_1_intf )
10651059{
1066   DEVCB_NULL,                                    /* Port A read */
1067   DEVCB_NULL,                                    /* Port B read */
1068   DEVCB_HANDLER(scorpion_protection_r),               /* Port C read */
1069   DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),      /* Port A write */
1070   DEVCB_HANDLER(konami_sound_control_w),               /* Port B write */
1071   DEVCB_HANDLER(scorpion_protection_w)               /* Port C write */
1060   DEVCB_NULL,                        /* Port A read */
1061   DEVCB_DRIVER_MEMBER(driver_device, soundlatch_byte_w),/* Port A write */
1062   DEVCB_NULL,                        /* Port B read */
1063   DEVCB_HANDLER(konami_sound_control_w),   /* Port B write */
1064   DEVCB_HANDLER(scorpion_protection_r),   /* Port C read */
1065   DEVCB_HANDLER(scorpion_protection_w)   /* Port C write */
10721066};
10731067
10741068
1075
10761069/*************************************
10771070 *
10781071 *  Ghostmuncher Galaxian I/O
r15199r15200
13391332}
13401333
13411334
1342static const ppi8255_interface moonwar_ppi8255_0_intf =
1335static I8255A_INTERFACE( moonwar_ppi8255_0_intf )
13431336{
13441337   DEVCB_INPUT_PORT("IN0"),            /* Port A read */
1345   DEVCB_INPUT_PORT("IN1"),            /* Port B read */
1346   DEVCB_INPUT_PORT("IN2"),            /* Port C read */
13471338   DEVCB_NULL,                        /* Port A write */
1339   DEVCB_INPUT_PORT("IN1"),            /* Port B read */
13481340   DEVCB_NULL,                        /* Port B write */
1341   DEVCB_INPUT_PORT("IN2"),            /* Port C read */
13491342   DEVCB_HANDLER(moonwar_port_select_w)   /* Port C write */
13501343};
13511344
13521345
1353
13541346/*************************************
13551347 *
13561348 *  Memory maps
r15199r15200
15511543   AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x4000) AM_RAM
15521544   AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x4400) AM_RAM_WRITE(galaxian_videoram_w) AM_SHARE("videoram")
15531545   AM_RANGE(0x9000, 0x90ff) AM_MIRROR(0x4700) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram")
1554   AM_RANGE(0x9800, 0x9803) AM_MIRROR(0x47fc) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w)
1555   AM_RANGE(0xa000, 0xa003) AM_MIRROR(0x47fc) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w)
1546   AM_RANGE(0x9800, 0x9803) AM_MIRROR(0x47fc) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
1547   AM_RANGE(0xa000, 0xa003) AM_MIRROR(0x47fc) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
15561548   AM_RANGE(0xa801, 0xa801) AM_MIRROR(0x47f8) AM_WRITE(irq_enable_w)
15571549   AM_RANGE(0xa802, 0xa802) AM_MIRROR(0x47f8) AM_WRITE(coin_count_0_w)
15581550   AM_RANGE(0xa803, 0xa803) AM_MIRROR(0x47f8) AM_WRITE(scramble_background_enable_w)
r15199r15200
15791571   AM_RANGE(0x1200, 0x12ff) AM_MIRROR(0x0100) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram")
15801572   AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x03ff) AM_READ(watchdog_reset_r)
15811573   AM_RANGE(0x4000, 0xbfff) AM_ROM
1582   AM_RANGE(0xc000, 0xc003) AM_MIRROR(0x3efc) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w)
1583   AM_RANGE(0xc100, 0xc103) AM_MIRROR(0x3efc) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w)
1574   AM_RANGE(0xc000, 0xc003) AM_MIRROR(0x3efc) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
1575   AM_RANGE(0xc100, 0xc103) AM_MIRROR(0x3efc) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
15841576ADDRESS_MAP_END
15851577
15861578
r15199r15200
15901582   AM_RANGE(0x0400, 0x0bff) AM_RAM
15911583   AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(galaxian_videoram_w) AM_SHARE("videoram")
15921584   AM_RANGE(0x2000, 0x20ff) AM_MIRROR(0x0300) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram")
1593   AM_RANGE(0x2400, 0x2403) AM_MIRROR(0x01fc) AM_DEVREADWRITE_LEGACY("ppi8255_1", ppi8255_r, ppi8255_w)
1585   AM_RANGE(0x2400, 0x2403) AM_MIRROR(0x01fc) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
15941586   AM_RANGE(0x2601, 0x2601) AM_MIRROR(0x01f8) AM_WRITE(irq_enable_w)
15951587   AM_RANGE(0x2602, 0x2602) AM_MIRROR(0x01f8) AM_WRITE(coin_count_0_w)
15961588   AM_RANGE(0x2603, 0x2603) AM_MIRROR(0x01f8) AM_WRITE(scramble_background_enable_w)
r15199r15200
16011593   AM_RANGE(0x4000, 0xbfff) AM_ROM
16021594   AM_RANGE(0x7c00, 0x7fff) AM_RAM_WRITE(galaxian_videoram_w) AM_SHARE("videoram")   /* mirror! */
16031595   AM_RANGE(0xf400, 0xf400) AM_MIRROR(0x01ff) AM_READ(watchdog_reset_r)
1604   AM_RANGE(0xf600, 0xf603) AM_MIRROR(0x01fc) AM_DEVREADWRITE_LEGACY("ppi8255_0", ppi8255_r, ppi8255_w)
1596   AM_RANGE(0xf600, 0xf603) AM_MIRROR(0x01fc) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
16051597ADDRESS_MAP_END
16061598
16071599
r15199r15200
21262118
21272119static MACHINE_CONFIG_DERIVED( konami_base, galaxian_base )
21282120
2129   MCFG_PPI8255_ADD( "ppi8255_0", konami_ppi8255_0_intf )
2130   MCFG_PPI8255_ADD( "ppi8255_1", konami_ppi8255_1_intf )
2121   MCFG_I8255A_ADD( "ppi8255_0", konami_ppi8255_0_intf )
2122   MCFG_I8255A_ADD( "ppi8255_1", konami_ppi8255_1_intf )
21312123MACHINE_CONFIG_END
21322124
21332125
r15199r15200
23872379   MCFG_CPU_MODIFY("maincpu")
23882380   MCFG_CPU_PROGRAM_MAP(theend_map)
23892381
2390   MCFG_PPI8255_ADD( "ppi8255_0", theend_ppi8255_0_intf )
2391   MCFG_PPI8255_ADD( "ppi8255_1", konami_ppi8255_1_intf )
2382   MCFG_I8255A_ADD( "ppi8255_0", theend_ppi8255_0_intf )
2383   MCFG_I8255A_ADD( "ppi8255_1", konami_ppi8255_1_intf )
23922384MACHINE_CONFIG_END
23932385
23942386
r15199r15200
23992391   MCFG_CPU_MODIFY("maincpu")
24002392   MCFG_CPU_PROGRAM_MAP(theend_map)
24012393
2402   MCFG_PPI8255_ADD( "ppi8255_0", konami_ppi8255_0_intf )
2403   MCFG_PPI8255_ADD( "ppi8255_1", scramble_ppi8255_1_intf )
2394   MCFG_I8255A_ADD( "ppi8255_0", konami_ppi8255_0_intf )
2395   MCFG_I8255A_ADD( "ppi8255_1", scramble_ppi8255_1_intf )
24042396MACHINE_CONFIG_END
24052397
24062398
r15199r15200
24282420
24292421static MACHINE_CONFIG_DERIVED( scorpion, theend )
24302422
2431   MCFG_PPI8255_RECONFIG( "ppi8255_0", konami_ppi8255_0_intf )
2432   MCFG_PPI8255_RECONFIG( "ppi8255_1", scorpion_ppi8255_1_intf )
2423   MCFG_DEVICE_REMOVE("ppi8255_0")
2424   MCFG_DEVICE_REMOVE("ppi8255_1")
2425   MCFG_I8255A_ADD( "ppi8255_0", konami_ppi8255_0_intf )
2426   MCFG_I8255A_ADD( "ppi8255_1", scorpion_ppi8255_1_intf )
24332427
24342428   /* extra AY8910 with I/O ports */
24352429   MCFG_SOUND_ADD("8910.2", AY8910, KONAMI_SOUND_CLOCK/8)
r15199r15200
24552449   MCFG_CPU_PROGRAM_MAP(sfx_sample_map)
24562450   MCFG_CPU_IO_MAP(sfx_sample_portmap)
24572451
2458   MCFG_PPI8255_ADD( "ppi8255_0", konami_ppi8255_0_intf )
2459   MCFG_PPI8255_ADD( "ppi8255_1", konami_ppi8255_1_intf )
2460   MCFG_PPI8255_ADD( "ppi8255_2", sfx_ppi8255_2_intf )
2452   MCFG_I8255A_ADD( "ppi8255_0", konami_ppi8255_0_intf )
2453   MCFG_I8255A_ADD( "ppi8255_1", konami_ppi8255_1_intf )
2454   MCFG_I8255A_ADD( "ppi8255_2", sfx_ppi8255_2_intf )
24612455
24622456   /* port on 2nd 8910 is used for communication */
24632457   MCFG_SOUND_MODIFY("8910.1")
r15199r15200
24752469   MCFG_CPU_MODIFY("maincpu")
24762470   MCFG_CPU_PROGRAM_MAP(monsterz_map)
24772471
2478   MCFG_PPI8255_RECONFIG( "ppi8255_1", monsterz_ppi8255_1_intf )
2472   MCFG_DEVICE_REMOVE("ppi8255_1")
2473   MCFG_I8255A_ADD( "ppi8255_1", monsterz_ppi8255_1_intf )
24792474
24802475   /* there are likely other differences too, but those can wait until after protection is sorted out */
24812476
r15199r15200
25182513
25192514static MACHINE_CONFIG_DERIVED( moonwar, scobra )
25202515
2521   /* device config overrides */
2522   MCFG_PPI8255_RECONFIG( "ppi8255_0", moonwar_ppi8255_0_intf )
2523   MCFG_PPI8255_RECONFIG( "ppi8255_1", konami_ppi8255_1_intf )
2516   MCFG_DEVICE_REMOVE("ppi8255_0")
2517   MCFG_DEVICE_REMOVE("ppi8255_1")
2518   MCFG_I8255A_ADD( "ppi8255_0", moonwar_ppi8255_0_intf )
2519   MCFG_I8255A_ADD( "ppi8255_1", konami_ppi8255_1_intf )
25242520
25252521   MCFG_PALETTE_INIT(moonwar) // bullets are less yellow
25262522MACHINE_CONFIG_END
src/mame/drivers/exprraid.c
r15199r15200
278278
279279INPUT_CHANGED_MEMBER(exprraid_state::coin_inserted_deco16)
280280{
281   device_set_input_line(m_maincpu, DECO16_IRQ_LINE, newval ? ASSERT_LINE : CLEAR_LINE);
281   device_set_input_line(m_maincpu, DECO16_IRQ_LINE, oldval ? ASSERT_LINE : CLEAR_LINE);
282282}
283283
284284INPUT_CHANGED_MEMBER(exprraid_state::coin_inserted_nmi)
285285{
286   device_set_input_line(m_maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
286   device_set_input_line(m_maincpu, INPUT_LINE_NMI, oldval ? ASSERT_LINE : CLEAR_LINE);
287287}
288288
289289static INPUT_PORTS_START( exprraid )
src/mame/drivers/vendetta.c
r15199r15200
503503static MACHINE_CONFIG_START( vendetta, vendetta_state )
504504
505505   /* basic machine hardware */
506   MCFG_CPU_ADD("maincpu", KONAMI, 6000000)   /* this is strange, seems an overclock but */
507//  MCFG_CPU_ADD("maincpu", KONAMI, 3000000)   /* is needed to have correct music speed */
506   MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/8)   /* 052001 (verified on pcb) */
508507   MCFG_CPU_PROGRAM_MAP(main_map)
509508   MCFG_CPU_VBLANK_INT("screen", vendetta_irq)
510509
511   MCFG_CPU_ADD("audiocpu", Z80, 3579545)   /* verified with PCB */
510   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)   /* verified with PCB */
512511   MCFG_CPU_PROGRAM_MAP(sound_map)
513512                            /* interrupts are triggered by the main CPU */
514513
r15199r15200
521520   MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
522521
523522   MCFG_SCREEN_ADD("screen", RASTER)
524   MCFG_SCREEN_REFRESH_RATE(60)
523   MCFG_SCREEN_REFRESH_RATE(59.17) /* measured on PCB */
525524   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
526525   MCFG_SCREEN_SIZE(64*8, 32*8)
527526   MCFG_SCREEN_VISIBLE_AREA(13*8, (64-13)*8-1, 2*8, 30*8-1 )
r15199r15200
537536   /* sound hardware */
538537   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
539538
540   MCFG_SOUND_ADD("ymsnd", YM2151, 3579545)   /* verified with PCB */
539   MCFG_SOUND_ADD("ymsnd", YM2151, XTAL_3_579545MHz)   /* verified with PCB */
541540   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
542541   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
543542
544   MCFG_SOUND_ADD("k053260", K053260, 3579545)   /* verified with PCB */
543   MCFG_SOUND_ADD("k053260", K053260, XTAL_3_579545MHz)   /* verified with PCB */
545544   MCFG_SOUND_ROUTE(0, "lspeaker", 0.75)
546545   MCFG_SOUND_ROUTE(1, "rspeaker", 0.75)
547546MACHINE_CONFIG_END
src/mame/drivers/segas16b.c
r15199r15200
44244424    Cotton (Japan), Sega System 16B
44254425    CPU: FD1094 (317-0179A)
44264426    ROM Board type: 171-5704
4427    Sega ID# for ROM board: 834-8022-04
44274428*/
44284429ROM_START( cottonj )
44294430   ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 code */
4430   ROM_LOAD16_BYTE( "epr-13858.a7", 0x000000, 0x20000, CRC(276f42fe) SHA1(47d2f910f6f101628cb0c660e5fd12c0e331bd99) )
4431   ROM_LOAD16_BYTE( "epr-13856.a5", 0x000001, 0x20000, CRC(14e6b5e7) SHA1(708c69cddd1c60e729a74f539d40e67b2a6d9d6f) )
4431   ROM_LOAD16_BYTE( "epr-13858a.a7", 0x000000, 0x20000, CRC(276f42fe) SHA1(47d2f910f6f101628cb0c660e5fd12c0e331bd99) )
4432   ROM_LOAD16_BYTE( "epr-13856a.a5", 0x000001, 0x20000, CRC(14e6b5e7) SHA1(708c69cddd1c60e729a74f539d40e67b2a6d9d6f) )
44324433   /* empty 0x40000 - 0x80000 */
4433   ROM_LOAD16_BYTE( "epr-13859.a8", 0x080000, 0x20000, CRC(4703ef9d) SHA1(8b03a71736a599c337ad5d95cbc812ea38b0cc43) )
4434   ROM_LOAD16_BYTE( "epr-13857.a6", 0x080001, 0x20000, CRC(de37e527) SHA1(124ce7c7eef1199c89735556cebf71255573a155) )
4434   ROM_LOAD16_BYTE( "epr-13859a.a8", 0x080000, 0x20000, CRC(4703ef9d) SHA1(8b03a71736a599c337ad5d95cbc812ea38b0cc43) )
4435   ROM_LOAD16_BYTE( "epr-13857a.a6", 0x080001, 0x20000, CRC(de37e527) SHA1(124ce7c7eef1199c89735556cebf71255573a155) )
44354436
44364437   ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
44374438   ROM_LOAD( "317-0179a.key", 0x0000, 0x2000, CRC(488096d3) SHA1(5ffe81c141e1016f6a46f8fcee3e6d79c60151c0) )
src/mame/drivers/crimfght.c
r15199r15200
2323/* prototypes */
2424static KONAMI_SETLINES_CALLBACK( crimfght_banking );
2525
26
27static TIMER_DEVICE_CALLBACK( crimfght_scanline )
26static INTERRUPT_GEN( crimfght_interrupt )
2827{
29   crimfght_state *state = timer.machine().driver_data<crimfght_state>();
30   int scanline = param;
31
32   if(scanline == 240 && k051960_is_irq_enabled(state->m_k051960)) // vblank irq
33      cputag_set_input_line(timer.machine(), "maincpu", KONAMI_IRQ_LINE, HOLD_LINE);
34   else if(((scanline % 32) == 0) && (k051960_is_nmi_enabled(state->m_k051960))) // timer irq
35      cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
28   crimfght_state *state = device->machine().driver_data<crimfght_state>();
29 
30   if (k051960_is_irq_enabled(state->m_k051960))
31      device_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
3632}
3733
3834WRITE8_MEMBER(crimfght_state::crimfght_coin_w)
r15199r15200
286282static MACHINE_CONFIG_START( crimfght, crimfght_state )
287283
288284   /* basic machine hardware */
289   MCFG_CPU_ADD("maincpu", KONAMI,XTAL_24MHz/8)      /* 052001 (verified on pcb) */
285   MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/8)      /* 052001 (verified on pcb) */
290286   MCFG_CPU_PROGRAM_MAP(crimfght_map)
291   MCFG_TIMER_ADD_SCANLINE("scantimer", crimfght_scanline, "screen", 0, 1)
287   MCFG_CPU_VBLANK_INT("screen", crimfght_interrupt)
292288
293289   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)    /* verified on pcb */
294290   MCFG_CPU_PROGRAM_MAP(crimfght_sound_map)
295291
296   MCFG_QUANTUM_TIME(attotime::from_hz(600))
297
298292   MCFG_MACHINE_START(crimfght)
299293   MCFG_MACHINE_RESET(crimfght)
300294
src/emu/ioport.c
r15199r15200
38743874   if (m_curfield == NULL)
38753875      throw emu_fatalerror("alloc_setting called with no active field (value=%X name=%s)\n", value, name);
38763876
3877   // append a new setting
3878   m_curfield->m_settinglist.append(*global_alloc(ioport_setting(*m_curfield, value & m_curfield->mask(), string_from_token(name))));
3877   m_cursetting = global_alloc(ioport_setting(*m_curfield, value & m_curfield->mask(), string_from_token(name)));
3878   // append a new setting   
3879   m_curfield->m_settinglist.append(*m_cursetting);
38793880}
38803881
38813882
src/emu/screen.c
r15199r15200
788788
789789int screen_device::vblank_port_read()
790790{
791   return vblank();
791   return vblank() ? -1 : 0;
792792}
793793
794794

Previous 15994 Revisions Next


© 1998-2018 The MESS Team