Previous 199869 Revisions Next

r18572 Wednesday 17th October, 2012 at 09:24:23 UTC by Aaron Giles
Initial round of atarigen cleanup.
[src/mame/audio]atarijsa.c atarijsa.h
[src/mame/drivers]arcadecl.c atarig1.c atarig42.c atarigt.c atarigx2.c atarisy1.c atarisy2.c badlands.c batman.c beathead.c blstroid.c cyberbal.c eprom.c foodf.c gauntlet.c harddriv.c klax.c offtwall.c rampart.c relief.c shuuz.c skullxbo.c thunderj.c toobin.c vindictr.c xybots.c
[src/mame/includes]arcadecl.h atarig1.h atarig42.h atarigt.h atarigx2.h atarisy1.h atarisy2.h badlands.h batman.h beathead.h blstroid.h cyberbal.h eprom.h foodf.h gauntlet.h harddriv.h klax.h liberatr.h offtwall.h rampart.h relief.h shuuz.h skullxbo.h thunderj.h toobin.h vindictr.h xybots.h
[src/mame/machine]atarigen.c atarigen.h harddriv.c
[src/mame/video]atarig1.c atarig42.c atarigt.c atarigx2.c atarisy1.c batman.c blstroid.c cyberbal.c eprom.c vindictr.c

trunk/src/mame/drivers/klax.c
r18571r18572
3131 *
3232 *************************************/
3333
34static void update_interrupts(running_machine &machine)
34void klax_state::update_interrupts()
3535{
36   klax_state *state = machine.driver_data<klax_state>();
37   machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state || state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
36   subdevice("maincpu")->execute().set_input_line(4, m_video_int_state || m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
3837}
3938
4039
41static void scanline_update(screen_device &screen, int scanline)
40void klax_state::scanline_update(screen_device &screen, int scanline)
4241{
4342   /* generate 32V signals */
44   if ((scanline & 32) == 0 && !(screen.machine().root_device().ioport("P1")->read() & 0x800))
45      atarigen_scanline_int_gen(screen.machine().device("maincpu"));
43   if ((scanline & 32) == 0 && !(ioport("P1")->read() & 0x800))
44      scanline_int_gen(*subdevice("maincpu"));
4645}
4746
4847
4948WRITE16_MEMBER(klax_state::interrupt_ack_w)
5049{
51   atarigen_scanline_int_ack_w(space, offset, data, mem_mask);
50   scanline_int_ack_w(space, offset, data, mem_mask);
5251   atarigen_video_int_ack_w(space, offset, data, mem_mask);
5352}
5453
r18571r18572
6059 *
6160 *************************************/
6261
63MACHINE_START_MEMBER(klax_state,klax)
64{
65   atarigen_init(machine());
66}
67
68
6962MACHINE_RESET_MEMBER(klax_state,klax)
7063{
71
72   atarigen_eeprom_reset(this);
73   atarigen_interrupt_reset(this, update_interrupts);
74   atarigen_scanline_timer_reset(*machine().primary_screen, scanline_update, 32);
64   atarigen_state::machine_reset();
65   scanline_timer_reset(*machine().primary_screen, 32);
7566}
7667
7768
r18571r18572
171162   MCFG_CPU_PROGRAM_MAP(klax_map)
172163   MCFG_CPU_VBLANK_INT("screen", atarigen_video_int_gen)
173164
174   MCFG_MACHINE_START_OVERRIDE(klax_state,klax)
175165   MCFG_MACHINE_RESET_OVERRIDE(klax_state,klax)
176166   MCFG_NVRAM_ADD_1FILL("eeprom")
177167
trunk/src/mame/drivers/xybots.c
r18571r18572
3232 *
3333 *************************************/
3434
35static void update_interrupts(running_machine &machine)
35void xybots_state::update_interrupts()
3636{
37   xybots_state *state = machine.driver_data<xybots_state>();
38   machine.device("maincpu")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
39   machine.device("maincpu")->execute().set_input_line(2, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
37   subdevice("maincpu")->execute().set_input_line(1, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
38   subdevice("maincpu")->execute().set_input_line(2, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
4039}
4140
4241
43MACHINE_START_MEMBER(xybots_state,xybots)
44{
45   atarigen_init(machine());
46}
47
48
4942MACHINE_RESET_MEMBER(xybots_state,xybots)
5043{
51
52   atarigen_eeprom_reset(this);
53   atarigen_slapstic_reset(this);
54   atarigen_interrupt_reset(this, update_interrupts);
55   atarijsa_reset();
44   atarigen_state::machine_reset();
45   atarijsa_reset(machine());
5646}
5747
5848
r18571r18572
9282   AM_RANGE(0xffb000, 0xffbfff) AM_MIRROR(0x7f8000) AM_RAM_WRITE_LEGACY(atarigen_playfield_w) AM_SHARE("playfield")
9383   AM_RANGE(0xffc000, 0xffc7ff) AM_MIRROR(0x7f8800) AM_RAM_WRITE(paletteram_IIIIRRRRGGGGBBBB_word_w) AM_SHARE("paletteram")
9484   AM_RANGE(0xffd000, 0xffdfff) AM_MIRROR(0x7f8000) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom")
95   AM_RANGE(0xffe000, 0xffe0ff) AM_MIRROR(0x7f8000) AM_READ_LEGACY(atarigen_sound_r)
85   AM_RANGE(0xffe000, 0xffe0ff) AM_MIRROR(0x7f8000) AM_READ8(sound_r, 0x00ff)
9686   AM_RANGE(0xffe100, 0xffe1ff) AM_MIRROR(0x7f8000) AM_READ_PORT("FFE100")
9787   AM_RANGE(0xffe200, 0xffe2ff) AM_MIRROR(0x7f8000) AM_READ(special_port1_r)
9888   AM_RANGE(0xffe800, 0xffe8ff) AM_MIRROR(0x7f8000) AM_WRITE_LEGACY(atarigen_eeprom_enable_w)
99   AM_RANGE(0xffe900, 0xffe9ff) AM_MIRROR(0x7f8000) AM_WRITE_LEGACY(atarigen_sound_w)
89   AM_RANGE(0xffe900, 0xffe9ff) AM_MIRROR(0x7f8000) AM_WRITE8(sound_w, 0x00ff)
10090   AM_RANGE(0xffea00, 0xffeaff) AM_MIRROR(0x7f8000) AM_WRITE(watchdog_reset16_w)
10191   AM_RANGE(0xffeb00, 0xffebff) AM_MIRROR(0x7f8000) AM_WRITE_LEGACY(atarigen_video_int_ack_w)
102   AM_RANGE(0xffee00, 0xffeeff) AM_MIRROR(0x7f8000) AM_WRITE_LEGACY(atarigen_sound_reset_w)
92   AM_RANGE(0xffee00, 0xffeeff) AM_MIRROR(0x7f8000) AM_WRITE(sound_reset_w)
10393ADDRESS_MAP_END
10494
10595
r18571r18572
197187   MCFG_CPU_PROGRAM_MAP(main_map)
198188   MCFG_CPU_VBLANK_INT("screen", atarigen_video_int_gen)
199189
200   MCFG_MACHINE_START_OVERRIDE(xybots_state,xybots)
201190   MCFG_MACHINE_RESET_OVERRIDE(xybots_state,xybots)
202191   MCFG_NVRAM_ADD_1FILL("eeprom")
203192
r18571r18572
391380DRIVER_INIT_MEMBER(xybots_state,xybots)
392381{
393382   m_h256 = 0x0400;
394   atarigen_slapstic_init(machine().device("maincpu"), 0x008000, 0, 107);
383   slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x008000, 0, 107);
395384   atarijsa_init(machine(), "FFE200", 0x0100);
396385}
397386
trunk/src/mame/drivers/toobin.c
r18571r18572
3434 *
3535 *************************************/
3636
37static void update_interrupts(running_machine &machine)
37void toobin_state::update_interrupts()
3838{
39   toobin_state *state = machine.driver_data<toobin_state>();
40   machine.device("maincpu")->execute().set_input_line(1, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
41   machine.device("maincpu")->execute().set_input_line(2, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
42   machine.device("maincpu")->execute().set_input_line(3, state->m_scanline_int_state && state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
39   subdevice("maincpu")->execute().set_input_line(1, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
40   subdevice("maincpu")->execute().set_input_line(2, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
41   subdevice("maincpu")->execute().set_input_line(3, m_scanline_int_state && m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
4342}
4443
4544
46MACHINE_START_MEMBER(toobin_state,toobin)
47{
48   atarigen_init(machine());
49}
50
51
5245MACHINE_RESET_MEMBER(toobin_state,toobin)
5346{
54
55   atarigen_eeprom_reset(this);
56   atarigen_interrupt_reset(this, update_interrupts);
57   atarijsa_reset();
47   atarigen_state::machine_reset();
48   atarijsa_reset(machine());
5849}
5950
6051
r18571r18572
7566   if (oldword != newword)
7667   {
7768      m_interrupt_scan[offset] = newword;
78      atarigen_scanline_int_set(*machine().primary_screen, newword & 0x1ff);
69      scanline_int_set(*machine().primary_screen, newword & 0x1ff);
7970   }
8071}
8172
r18571r18572
113104   AM_RANGE(0xc10000, 0xc107ff) AM_MIRROR(0x047800) AM_RAM_WRITE_LEGACY(toobin_paletteram_w) AM_SHARE("paletteram")
114105   AM_RANGE(0xff6000, 0xff6001) AM_READNOP      /* who knows? read at controls time */
115106   AM_RANGE(0xff8000, 0xff8001) AM_MIRROR(0x4500fe) AM_WRITE(watchdog_reset16_w)
116   AM_RANGE(0xff8100, 0xff8101) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(atarigen_sound_w)
107   AM_RANGE(0xff8100, 0xff8101) AM_MIRROR(0x4500fe) AM_WRITE8(sound_w, 0x00ff)
117108   AM_RANGE(0xff8300, 0xff8301) AM_MIRROR(0x45003e) AM_WRITE_LEGACY(toobin_intensity_w)
118109   AM_RANGE(0xff8340, 0xff8341) AM_MIRROR(0x45003e) AM_WRITE(interrupt_scan_w) AM_SHARE("interrupt_scan")
119110   AM_RANGE(0xff8380, 0xff8381) AM_MIRROR(0x45003e) AM_READWRITE_LEGACY(atarimo_0_slipram_r, toobin_slip_w)
120   AM_RANGE(0xff83c0, 0xff83c1) AM_MIRROR(0x45003e) AM_WRITE_LEGACY(atarigen_scanline_int_ack_w)
121   AM_RANGE(0xff8400, 0xff8401) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(atarigen_sound_reset_w)
111   AM_RANGE(0xff83c0, 0xff83c1) AM_MIRROR(0x45003e) AM_WRITE(scanline_int_ack_w)
112   AM_RANGE(0xff8400, 0xff8401) AM_MIRROR(0x4500fe) AM_WRITE(sound_reset_w)
122113   AM_RANGE(0xff8500, 0xff8501) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(atarigen_eeprom_enable_w)
123114   AM_RANGE(0xff8600, 0xff8601) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(toobin_xscroll_w) AM_SHARE("xscroll")
124115   AM_RANGE(0xff8700, 0xff8701) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(toobin_yscroll_w) AM_SHARE("yscroll")
125116   AM_RANGE(0xff8800, 0xff8801) AM_MIRROR(0x4507fe) AM_READ_PORT("FF8800")
126117   AM_RANGE(0xff9000, 0xff9001) AM_MIRROR(0x4507fe) AM_READ(special_port1_r)
127   AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x4507fe) AM_READ_LEGACY(atarigen_sound_r)
118   AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x4507fe) AM_READ8(sound_r, 0x00ff)
128119   AM_RANGE(0xffa000, 0xffafff) AM_MIRROR(0x451000) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom")
129120   AM_RANGE(0xffc000, 0xffffff) AM_MIRROR(0x450000) AM_RAM
130121ADDRESS_MAP_END
r18571r18572
227218   MCFG_CPU_ADD("maincpu", M68010, MASTER_CLOCK/4)
228219   MCFG_CPU_PROGRAM_MAP(main_map)
229220
230   MCFG_MACHINE_START_OVERRIDE(toobin_state,toobin)
231221   MCFG_MACHINE_RESET_OVERRIDE(toobin_state,toobin)
232222   MCFG_NVRAM_ADD_1FILL("eeprom")
233223   MCFG_WATCHDOG_VBLANK_INIT(8)
trunk/src/mame/drivers/arcadecl.c
r18571r18572
8282 *
8383 *************************************/
8484
85static void update_interrupts(running_machine &machine)
85void arcadecl_state::update_interrupts()
8686{
87   arcadecl_state *state = machine.driver_data<arcadecl_state>();
88   machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
87   machine().device("maincpu")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
8988}
9089
9190
92static void scanline_update(screen_device &screen, int scanline)
91void arcadecl_state::scanline_update(screen_device &screen, int scanline)
9392{
9493   /* generate 32V signals */
9594   if ((scanline & 32) == 0)
96      atarigen_scanline_int_gen(screen.machine().device("maincpu"));
95      scanline_int_gen(*subdevice("maincpu"));
9796}
9897
9998
r18571r18572
104103 *
105104 *************************************/
106105
107MACHINE_START_MEMBER(arcadecl_state,arcadecl)
108{
109   atarigen_init(machine());
110}
111
112
113106MACHINE_RESET_MEMBER(arcadecl_state,arcadecl)
114107{
115
116   atarigen_eeprom_reset(this);
117   atarigen_interrupt_reset(this, update_interrupts);
118   atarigen_scanline_timer_reset(*machine().primary_screen, scanline_update, 32);
108   atarigen_state::machine_reset();
109   scanline_timer_reset(*machine().primary_screen, 32);
119110}
120111
121112
r18571r18572
139130   {
140131      okim6295_device *oki = machine().device<okim6295_device>("oki");
141132      oki->set_bank_base((data & 0x80) ? 0x40000 : 0x00000);
142      atarigen_set_oki6295_vol(machine(), (data & 0x001f) * 100 / 0x1f);
133      set_oki6295_volume((data & 0x001f) * 100 / 0x1f);
143134   }
144135}
145136
r18571r18572
170161   AM_RANGE(0x640060, 0x64006f) AM_WRITE_LEGACY(atarigen_eeprom_enable_w)
171162   AM_RANGE(0x641000, 0x641fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom")
172163   AM_RANGE(0x642000, 0x642001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0xff00)
173   AM_RANGE(0x646000, 0x646fff) AM_WRITE_LEGACY(atarigen_scanline_int_ack_w)
164   AM_RANGE(0x646000, 0x646fff) AM_WRITE(scanline_int_ack_w)
174165   AM_RANGE(0x647000, 0x647fff) AM_WRITE(watchdog_reset16_w)
175166ADDRESS_MAP_END
176167
r18571r18572
330321   MCFG_CPU_PROGRAM_MAP(main_map)
331322   MCFG_CPU_VBLANK_INT("screen", atarigen_video_int_gen)
332323
333   MCFG_MACHINE_START_OVERRIDE(arcadecl_state,arcadecl)
334324   MCFG_MACHINE_RESET_OVERRIDE(arcadecl_state,arcadecl)
335325   MCFG_NVRAM_ADD_1FILL("eeprom")
336326
trunk/src/mame/drivers/skullxbo.c
r18571r18572
3131 *
3232 *************************************/
3333
34static void update_interrupts(running_machine &machine)
34void skullxbo_state::update_interrupts()
3535{
36   skullxbo_state *state = machine.driver_data<skullxbo_state>();
37   machine.device("maincpu")->execute().set_input_line(1, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
38   machine.device("maincpu")->execute().set_input_line(2, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
39   machine.device("maincpu")->execute().set_input_line(4, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
36   subdevice("maincpu")->execute().set_input_line(1, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
37   subdevice("maincpu")->execute().set_input_line(2, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
38   subdevice("maincpu")->execute().set_input_line(4, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
4039}
4140
4241
4342TIMER_CALLBACK_MEMBER(skullxbo_state::irq_gen)
4443{
45   atarigen_scanline_int_gen(machine().device("maincpu"));
44   scanline_int_gen(*subdevice("maincpu"));
4645}
4746
4847
49static void alpha_row_update(screen_device &screen, int scanline)
48void skullxbo_state::scanline_update(screen_device &screen, int scanline)
5049{
51   skullxbo_state *state = screen.machine().driver_data<skullxbo_state>();
52   UINT16 *check = &state->m_alpha[(scanline / 8) * 64 + 42];
50   UINT16 *check = &m_alpha[(scanline / 8) * 64 + 42];
5351
5452   /* check for interrupts in the alpha ram */
5553   /* the interrupt occurs on the HBLANK of the 6th scanline following */
56   if (check < &state->m_alpha[0x7c0] && (*check & 0x8000))
54   if (check < &m_alpha[0x7c0] && (*check & 0x8000))
5755   {
5856      int   width = screen.width();
5957      attotime period = screen.time_until_pos(screen.vpos() + 6, width * 0.9);
60      screen.machine().scheduler().timer_set(period, timer_expired_delegate(FUNC(skullxbo_state::irq_gen),state));
58      machine().scheduler().timer_set(period, timer_expired_delegate(FUNC(skullxbo_state::irq_gen), this));
6159   }
6260
6361   /* update the playfield and motion objects */
64   skullxbo_scanline_update(screen.machine(), scanline);
62   skullxbo_scanline_update(machine(), scanline);
6563}
6664
6765
6866WRITE16_MEMBER(skullxbo_state::skullxbo_halt_until_hblank_0_w)
6967{
70   atarigen_halt_until_hblank_0(*machine().primary_screen);
68   halt_until_hblank_0(space.device(), *machine().primary_screen);
7169}
7270
7371
74MACHINE_START_MEMBER(skullxbo_state,skullxbo)
75{
76   atarigen_init(machine());
77}
78
79
8072MACHINE_RESET_MEMBER(skullxbo_state,skullxbo)
8173{
82
83   atarigen_eeprom_reset(this);
84   atarigen_interrupt_reset(this, update_interrupts);
85   atarigen_scanline_timer_reset(*machine().primary_screen, alpha_row_update, 8);
86   atarijsa_reset();
74   atarigen_state::machine_reset();
75   scanline_timer_reset(*machine().primary_screen, 8);
76   atarijsa_reset(machine());
8777}
8878
8979
r18571r18572
129119   AM_RANGE(0xff0800, 0xff0bff) AM_WRITE(skullxbo_halt_until_hblank_0_w)
130120   AM_RANGE(0xff0c00, 0xff0fff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w)
131121   AM_RANGE(0xff1000, 0xff13ff) AM_WRITE_LEGACY(atarigen_video_int_ack_w)
132   AM_RANGE(0xff1400, 0xff17ff) AM_WRITE_LEGACY(atarigen_sound_w)
133   AM_RANGE(0xff1800, 0xff1bff) AM_WRITE_LEGACY(atarigen_sound_reset_w)
122   AM_RANGE(0xff1400, 0xff17ff) AM_WRITE8(sound_w, 0x00ff)
123   AM_RANGE(0xff1800, 0xff1bff) AM_WRITE(sound_reset_w)
134124   AM_RANGE(0xff1c00, 0xff1c7f) AM_WRITE_LEGACY(skullxbo_playfieldlatch_w)
135125   AM_RANGE(0xff1c80, 0xff1cff) AM_WRITE_LEGACY(skullxbo_xscroll_w) AM_SHARE("xscroll")
136   AM_RANGE(0xff1d00, 0xff1d7f) AM_WRITE_LEGACY(atarigen_scanline_int_ack_w)
126   AM_RANGE(0xff1d00, 0xff1d7f) AM_WRITE(scanline_int_ack_w)
137127   AM_RANGE(0xff1d80, 0xff1dff) AM_WRITE(watchdog_reset16_w)
138128   AM_RANGE(0xff1e00, 0xff1e7f) AM_WRITE_LEGACY(skullxbo_playfieldlatch_w)
139129   AM_RANGE(0xff1e80, 0xff1eff) AM_WRITE_LEGACY(skullxbo_xscroll_w)
140   AM_RANGE(0xff1f00, 0xff1f7f) AM_WRITE_LEGACY(atarigen_scanline_int_ack_w)
130   AM_RANGE(0xff1f00, 0xff1f7f) AM_WRITE(scanline_int_ack_w)
141131   AM_RANGE(0xff1f80, 0xff1fff) AM_WRITE(watchdog_reset16_w)
142132   AM_RANGE(0xff2000, 0xff2fff) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram")
143133   AM_RANGE(0xff4000, 0xff47ff) AM_WRITE_LEGACY(skullxbo_yscroll_w) AM_SHARE("yscroll")
144134   AM_RANGE(0xff4800, 0xff4fff) AM_WRITE(skullxbo_mobwr_w)
145135   AM_RANGE(0xff6000, 0xff6fff) AM_WRITE_LEGACY(atarigen_eeprom_w) AM_SHARE("eeprom")
146   AM_RANGE(0xff5000, 0xff5001) AM_READ_LEGACY(atarigen_sound_r)
136   AM_RANGE(0xff5000, 0xff5001) AM_READ8(sound_r, 0x00ff)
147137   AM_RANGE(0xff5800, 0xff5801) AM_READ_PORT("FF5800")
148138   AM_RANGE(0xff5802, 0xff5803) AM_READ(special_port1_r)
149139   AM_RANGE(0xff6000, 0xff6fff) AM_READ_LEGACY(atarigen_eeprom_r)
r18571r18572
259249   MCFG_CPU_PROGRAM_MAP(main_map)
260250   MCFG_CPU_VBLANK_INT("screen", atarigen_video_int_gen)
261251
262   MCFG_MACHINE_START_OVERRIDE(skullxbo_state,skullxbo)
263252   MCFG_MACHINE_RESET_OVERRIDE(skullxbo_state,skullxbo)
264253   MCFG_NVRAM_ADD_1FILL("eeprom")
265254
trunk/src/mame/drivers/atarisy1.c
r18571r18572
207207 *
208208 *************************************/
209209
210static void update_interrupts(running_machine &machine)
210void atarisy1_state::update_interrupts()
211211{
212   atarisy1_state *state = machine.driver_data<atarisy1_state>();
213   machine.device("maincpu")->execute().set_input_line(2, state->m_joystick_int && state->m_joystick_int_enable ? ASSERT_LINE : CLEAR_LINE);
214   machine.device("maincpu")->execute().set_input_line(3, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
215   machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
216   machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
212   machine().device("maincpu")->execute().set_input_line(2, m_joystick_int && m_joystick_int_enable ? ASSERT_LINE : CLEAR_LINE);
213   machine().device("maincpu")->execute().set_input_line(3, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
214   machine().device("maincpu")->execute().set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
215   machine().device("maincpu")->execute().set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
217216}
218217
219218
220219MACHINE_START_MEMBER(atarisy1_state,atarisy1)
221220{
222   atarigen_init(machine());
221   atarigen_state::machine_start();
223222
224223   save_item(NAME(m_joystick_int));
225224   save_item(NAME(m_joystick_int_enable));
r18571r18572
229228
230229MACHINE_RESET_MEMBER(atarisy1_state,atarisy1)
231230{
231   atarigen_state::machine_reset();
232232
233   /* initialize the system */
234   atarigen_eeprom_reset(this);
235   atarigen_slapstic_reset(this);
236   atarigen_interrupt_reset(this, update_interrupts);
237   atarigen_sound_io_reset(machine().device("audiocpu"));
238
239233   /* reset the joystick parameters */
240234   m_joystick_value = 0;
241235   m_joystick_int = 0;
r18571r18572
254248{
255249   m_joystick_value = param;
256250   m_joystick_int = 1;
257   atarigen_update_interrupts(machine());
251   update_interrupts();
258252}
259253
260254
r18571r18572
281275   /* clear any existing interrupt and set a timer for a new one */
282276   m_joystick_int = 0;
283277   m_joystick_timer->adjust(attotime::from_usec(50), newval);
284   atarigen_update_interrupts(machine());
278   update_interrupts();
285279
286280   return m_joystick_value;
287281}
r18571r18572
485479   AM_RANGE(0xf20000, 0xf20007) AM_READ(trakball_r)
486480   AM_RANGE(0xf40000, 0xf4001f) AM_READWRITE(joystick_r, joystick_w)
487481   AM_RANGE(0xf60000, 0xf60003) AM_READ(port4_r)
488   AM_RANGE(0xf80000, 0xf80001) AM_WRITE_LEGACY(atarigen_sound_w)   /* used by roadbls2 */
489   AM_RANGE(0xfc0000, 0xfc0001) AM_READ_LEGACY(atarigen_sound_r)
490   AM_RANGE(0xfe0000, 0xfe0001) AM_WRITE_LEGACY(atarigen_sound_w)
482   AM_RANGE(0xf80000, 0xf80001) AM_WRITE8(sound_w, 0x00ff)   /* used by roadbls2 */
483   AM_RANGE(0xfc0000, 0xfc0001) AM_READ8(sound_r, 0x00ff)
484   AM_RANGE(0xfe0000, 0xfe0001) AM_WRITE8(sound_w, 0x00ff)
491485ADDRESS_MAP_END
492486
493487
r18571r18572
502496   AM_RANGE(0x0000, 0x0fff) AM_RAM
503497   AM_RANGE(0x1000, 0x100f) AM_DEVREADWRITE("via6522_0", via6522_device, read, write)
504498   AM_RANGE(0x1800, 0x1801) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
505   AM_RANGE(0x1810, 0x1810) AM_READWRITE_LEGACY(atarigen_6502_sound_r, atarigen_6502_sound_w)
499   AM_RANGE(0x1810, 0x1810) AM_READWRITE(m6502_sound_r, m6502_sound_w)
506500   AM_RANGE(0x1820, 0x1820) AM_READ(switch_6502_r)
507501   AM_RANGE(0x1824, 0x1825) AM_WRITE(led_w)
508502   AM_RANGE(0x1870, 0x187f) AM_DEVREADWRITE("pokey", pokey_device, read, write)
r18571r18572
23262320
23272321DRIVER_INIT_MEMBER(atarisy1_state,marble)
23282322{
2323   slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x080000, 0, 103);
23292324
2330   atarigen_slapstic_init(machine().device("maincpu"), 0x080000, 0, 103);
2331
23322325   m_joystick_type = 0;   /* none */
23332326   m_trackball_type = 1;   /* rotated */
23342327}
r18571r18572
23362329
23372330DRIVER_INIT_MEMBER(atarisy1_state,peterpak)
23382331{
2332   slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x080000, 0, 107);
23392333
2340   atarigen_slapstic_init(machine().device("maincpu"), 0x080000, 0, 107);
2341
23422334   m_joystick_type = 1;   /* digital */
23432335   m_trackball_type = 0;   /* none */
23442336}
r18571r18572
23462338
23472339DRIVER_INIT_MEMBER(atarisy1_state,indytemp)
23482340{
2341   slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x080000, 0, 105);
23492342
2350   atarigen_slapstic_init(machine().device("maincpu"), 0x080000, 0, 105);
2351
23522343   m_joystick_type = 1;   /* digital */
23532344   m_trackball_type = 0;   /* none */
23542345}
r18571r18572
23562347
23572348DRIVER_INIT_MEMBER(atarisy1_state,roadrunn)
23582349{
2350   slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x080000, 0, 108);
23592351
2360   atarigen_slapstic_init(machine().device("maincpu"), 0x080000, 0, 108);
2361
23622352   m_joystick_type = 2;   /* analog */
23632353   m_trackball_type = 0;   /* none */
23642354}
r18571r18572
23662356
23672357DRIVER_INIT_MEMBER(atarisy1_state,roadb109)
23682358{
2359   slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x080000, 0, 109);
23692360
2370   atarigen_slapstic_init(machine().device("maincpu"), 0x080000, 0, 109);
2371
23722361   m_joystick_type = 3;   /* pedal */
23732362   m_trackball_type = 2;   /* steering wheel */
23742363}
r18571r18572
23762365
23772366DRIVER_INIT_MEMBER(atarisy1_state,roadb110)
23782367{
2368   slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x080000, 0, 110);
23792369
2380   atarigen_slapstic_init(machine().device("maincpu"), 0x080000, 0, 110);
2381
23822370   m_joystick_type = 3;   /* pedal */
23832371   m_trackball_type = 2;   /* steering wheel */
23842372}
trunk/src/mame/drivers/atarig42.c
r18571r18572
3131 *
3232 *************************************/
3333
34static void update_interrupts(running_machine &machine)
34void atarig42_state::update_interrupts()
3535{
36   atarig42_state *state = machine.driver_data<atarig42_state>();
37   machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
38   machine.device("maincpu")->execute().set_input_line(5, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
36   machine().device("maincpu")->execute().set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
37   machine().device("maincpu")->execute().set_input_line(5, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
3938}
4039
4140
4241MACHINE_START_MEMBER(atarig42_state,atarig42)
4342{
44   atarigen_init(machine());
43   atarigen_state::machine_start();
4544
4645   save_item(NAME(m_analog_data));
4746   save_item(NAME(m_sloop_bank));
r18571r18572
5352
5453MACHINE_RESET_MEMBER(atarig42_state,atarig42)
5554{
56
57   atarigen_eeprom_reset(this);
58   atarigen_interrupt_reset(this, update_interrupts);
59   atarigen_scanline_timer_reset(*machine().primary_screen, atarig42_scanline_update, 8);
60   atarijsa_reset();
55   atarigen_state::machine_reset();
56   scanline_timer_reset(*machine().primary_screen, 8);
57   atarijsa_reset(machine());
6158}
6259
6360
r18571r18572
110107   {
111108      /* bit 4 resets the sound CPU */
112109      machine().device("jsa")->execute().set_input_line(INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
113      if (!(data & 0x10)) atarijsa_reset();
110      if (!(data & 0x10)) atarijsa_reset(machine());
114111
115112      /* bit 5 is /XRESET, probably related to the ASIC */
116113
r18571r18572
343340   AM_RANGE(0xe00010, 0xe00011) AM_READ(special_port2_r)
344341   AM_RANGE(0xe00012, 0xe00013) AM_READ_PORT("JSAIII")
345342   AM_RANGE(0xe00020, 0xe00027) AM_READWRITE(a2d_data_r, a2d_select_w)
346   AM_RANGE(0xe00030, 0xe00031) AM_READ_LEGACY(atarigen_sound_r)
347   AM_RANGE(0xe00040, 0xe00041) AM_WRITE_LEGACY(atarigen_sound_w)
343   AM_RANGE(0xe00030, 0xe00031) AM_READ8(sound_r, 0x00ff)
344   AM_RANGE(0xe00040, 0xe00041) AM_WRITE8(sound_w, 0x00ff)
348345   AM_RANGE(0xe00050, 0xe00051) AM_WRITE(io_latch_w)
349346   AM_RANGE(0xe00060, 0xe00061) AM_WRITE_LEGACY(atarigen_eeprom_enable_w)
350347   AM_RANGE(0xe03000, 0xe03001) AM_WRITE_LEGACY(atarigen_video_int_ack_w)
trunk/src/mame/drivers/vindictr.c
r18571r18572
3131 *
3232 *************************************/
3333
34static void update_interrupts(running_machine &machine)
34void vindictr_state::update_interrupts()
3535{
36   vindictr_state *state = machine.driver_data<vindictr_state>();
37   machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
38   machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
36   subdevice("maincpu")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
37   subdevice("maincpu")->execute().set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
3938}
4039
4140
42MACHINE_START_MEMBER(vindictr_state,vindictr)
43{
44   atarigen_init(machine());
45}
46
47
4841MACHINE_RESET_MEMBER(vindictr_state,vindictr)
4942{
50
51   atarigen_eeprom_reset(this);
52   atarigen_interrupt_reset(this, update_interrupts);
53   atarigen_scanline_timer_reset(*machine().primary_screen, vindictr_scanline_update, 8);
54   atarijsa_reset();
43   atarigen_state::machine_reset();
44   scanline_timer_reset(*machine().primary_screen, 8);
45   atarijsa_reset(machine());
5546}
5647
5748
r18571r18572
8879   AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
8980   AM_RANGE(0x260010, 0x26001f) AM_READ(port1_r)
9081   AM_RANGE(0x260020, 0x26002f) AM_READ_PORT("260020")
91   AM_RANGE(0x260030, 0x260031) AM_READ_LEGACY(atarigen_sound_r)
82   AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff)
9283   AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w)
93   AM_RANGE(0x360000, 0x360001) AM_WRITE_LEGACY(atarigen_scanline_int_ack_w)
84   AM_RANGE(0x360000, 0x360001) AM_WRITE(scanline_int_ack_w)
9485   AM_RANGE(0x360010, 0x360011) AM_WRITENOP
95   AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w)
96   AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w)
86   AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w)
87   AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff)
9788   AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM_WRITE_LEGACY(vindictr_paletteram_w) AM_SHARE("paletteram")
9889   AM_RANGE(0x3f0000, 0x3f1fff) AM_MIRROR(0x8000) AM_RAM_WRITE_LEGACY(atarigen_playfield_w) AM_SHARE("playfield")
9990   AM_RANGE(0x3f2000, 0x3f3fff) AM_MIRROR(0x8000) AM_READWRITE_LEGACY(atarimo_0_spriteram_r, atarimo_0_spriteram_w)
r18571r18572
198189   MCFG_CPU_ADD("maincpu", M68010, ATARI_CLOCK_14MHz/2)
199190   MCFG_CPU_PROGRAM_MAP(main_map)
200191
201   MCFG_MACHINE_START_OVERRIDE(vindictr_state,vindictr)
202192   MCFG_MACHINE_RESET_OVERRIDE(vindictr_state,vindictr)
203193   MCFG_NVRAM_ADD_1FILL("eeprom")
204194
trunk/src/mame/drivers/atarig1.c
r18571r18572
3232 *
3333 *************************************/
3434
35static void update_interrupts(running_machine &machine)
35void atarig1_state::update_interrupts()
3636{
37   atarig1_state *state = machine.driver_data<atarig1_state>();
38   machine.device("maincpu")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
39   machine.device("maincpu")->execute().set_input_line(2, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
37   machine().device("maincpu")->execute().set_input_line(1, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
38   machine().device("maincpu")->execute().set_input_line(2, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
4039}
4140
4241
4342MACHINE_START_MEMBER(atarig1_state,atarig1)
4443{
45   atarigen_init(machine());
44   atarigen_state::machine_start();
4645   save_item(NAME(m_which_input));
4746}
4847
4948
5049MACHINE_RESET_MEMBER(atarig1_state,atarig1)
5150{
52
53   atarigen_eeprom_reset(this);
54   atarigen_slapstic_reset(this);
55   atarigen_interrupt_reset(this, update_interrupts);
56   atarigen_scanline_timer_reset(*machine().primary_screen, atarig1_scanline_update, 8);
57   atarijsa_reset();
51   atarigen_state::machine_reset();
52   scanline_timer_reset(*machine().primary_screen, 8);
53   atarijsa_reset(machine());
5854}
5955
6056
r18571r18572
209205   AM_RANGE(0x078000, 0x07ffff) AM_ROM   /* hydra slapstic goes here */
210206   AM_RANGE(0xf80000, 0xf80001) AM_WRITE(watchdog_reset16_w)
211207   AM_RANGE(0xf88000, 0xf8ffff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w)
212   AM_RANGE(0xf90000, 0xf90001) AM_WRITE_LEGACY(atarigen_sound_upper_w)
213   AM_RANGE(0xf98000, 0xf98001) AM_WRITE_LEGACY(atarigen_sound_reset_w)
208   AM_RANGE(0xf90000, 0xf90001) AM_WRITE8(sound_w, 0xff00)
209   AM_RANGE(0xf98000, 0xf98001) AM_WRITE(sound_reset_w)
214210   AM_RANGE(0xfa0000, 0xfa0001) AM_WRITE(mo_control_w)
215211   AM_RANGE(0xfb0000, 0xfb0001) AM_WRITE_LEGACY(atarigen_video_int_ack_w)
216212   AM_RANGE(0xfc0000, 0xfc0001) AM_READ(special_port0_r)
217213   AM_RANGE(0xfc8000, 0xfc8007) AM_READWRITE(a2d_data_r, a2d_select_w)
218   AM_RANGE(0xfd0000, 0xfd0001) AM_READ_LEGACY(atarigen_sound_upper_r)
214   AM_RANGE(0xfd0000, 0xfd0001) AM_READ8(sound_r, 0xff00)
219215   AM_RANGE(0xfd8000, 0xfdffff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom")
220216/*  AM_RANGE(0xfe0000, 0xfe7fff) AM_READ_LEGACY(from_r)*/
221217   AM_RANGE(0xfe8000, 0xfe89ff) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram")
r18571r18572
12221218      machine.save().register_postload(save_prepost_delegate(FUNC(pitfightb_state_postload), &machine));
12231219   }
12241220   else if (slapstic != 0)
1225      atarigen_slapstic_init(machine.device("maincpu"), slapstic_base, 0, slapstic);
1221      state->slapstic_configure(*machine.device<cpu_device>("maincpu"), slapstic_base, 0, slapstic);
12261222   atarijsa_init(machine, "IN0", 0x4000);
12271223
12281224   state->m_is_pitfight = is_pitfight;
trunk/src/mame/drivers/foodf.c
r18571r18572
104104 *
105105 *************************************/
106106
107static void update_interrupts(running_machine &machine)
107void foodf_state::update_interrupts()
108108{
109   foodf_state *state = machine.driver_data<foodf_state>();
110   machine.device("maincpu")->execute().set_input_line(1, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
111   machine.device("maincpu")->execute().set_input_line(2, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
112   machine.device("maincpu")->execute().set_input_line(3, state->m_scanline_int_state && state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
109   subdevice("maincpu")->execute().set_input_line(1, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
110   subdevice("maincpu")->execute().set_input_line(2, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
111   subdevice("maincpu")->execute().set_input_line(3, m_scanline_int_state && m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
113112}
114113
115114
116TIMER_DEVICE_CALLBACK_MEMBER(foodf_state::scanline_update)
115TIMER_DEVICE_CALLBACK_MEMBER(foodf_state::scanline_update_timer)
117116{
118117   int scanline = param;
119118
r18571r18572
123122       mystery yet */
124123
125124   /* INT 1 is on 32V */
126   atarigen_scanline_int_gen(machine().device("maincpu"));
125   scanline_int_gen(*subdevice("maincpu"));
127126
128127   /* advance to the next interrupt */
129128   scanline += 64;
r18571r18572
137136
138137MACHINE_START_MEMBER(foodf_state,foodf)
139138{
140   atarigen_init(machine());
139   atarigen_state::machine_start();
141140   save_item(NAME(m_whichport));
142141}
143142
144143
145144MACHINE_RESET_MEMBER(foodf_state,foodf)
146145{
147   atarigen_interrupt_reset(this, update_interrupts);
148146   timer_device *scan_timer = machine().device<timer_device>("scan_timer");
149147   scan_timer->adjust(machine().primary_screen->time_until_pos(0));
150148}
r18571r18572
164162   m_nvram->store(data & 0x02);
165163
166164   if (!(data & 0x04))
167      atarigen_scanline_int_ack_w(space,0,0,0xffff);
165      scanline_int_ack_w(space,0,0);
168166   if (!(data & 0x08))
169167      atarigen_video_int_ack_w(space,0,0,0xffff);
170168
r18571r18572
363361
364362   MCFG_WATCHDOG_VBLANK_INIT(8)
365363
366   MCFG_TIMER_DRIVER_ADD("scan_timer", foodf_state, scanline_update)
364   MCFG_TIMER_DRIVER_ADD("scan_timer", foodf_state, scanline_update_timer)
367365
368366   /* video hardware */
369367   MCFG_GFXDECODE(foodf)
trunk/src/mame/drivers/blstroid.c
r18571r18572
3232 *
3333 *************************************/
3434
35static void update_interrupts(running_machine &machine)
35void blstroid_state::update_interrupts()
3636{
37   blstroid_state *state = machine.driver_data<blstroid_state>();
38   machine.device("maincpu")->execute().set_input_line(1, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
39   machine.device("maincpu")->execute().set_input_line(2, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
40   machine.device("maincpu")->execute().set_input_line(4, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
37   machine().device("maincpu")->execute().set_input_line(1, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
38   machine().device("maincpu")->execute().set_input_line(2, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
39   machine().device("maincpu")->execute().set_input_line(4, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
4140}
4241
4342
4443WRITE16_MEMBER(blstroid_state::blstroid_halt_until_hblank_0_w)
4544{
46   atarigen_halt_until_hblank_0(*machine().primary_screen);
45   halt_until_hblank_0(space.device(), *machine().primary_screen);
4746}
4847
4948
50MACHINE_START_MEMBER(blstroid_state,blstroid)
51{
52   atarigen_init(machine());
53}
54
55
5649MACHINE_RESET_MEMBER(blstroid_state,blstroid)
5750{
58
59   atarigen_eeprom_reset(this);
60   atarigen_interrupt_reset(this, update_interrupts);
61   atarigen_scanline_timer_reset(*machine().primary_screen, blstroid_scanline_update, 8);
62   atarijsa_reset();
51   atarigen_state::machine_reset();
52   scanline_timer_reset(*machine().primary_screen, 8);
53   atarijsa_reset(machine());
6354}
6455
6556
r18571r18572
9384   ADDRESS_MAP_UNMAP_HIGH
9485   AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0x7c0000) AM_ROM
9586   AM_RANGE(0xff8000, 0xff8001) AM_MIRROR(0x7f81fe) AM_WRITE(watchdog_reset16_w)
96   AM_RANGE(0xff8200, 0xff8201) AM_MIRROR(0x7f81fe) AM_WRITE_LEGACY(atarigen_scanline_int_ack_w)
87   AM_RANGE(0xff8200, 0xff8201) AM_MIRROR(0x7f81fe) AM_WRITE(scanline_int_ack_w)
9788   AM_RANGE(0xff8400, 0xff8401) AM_MIRROR(0x7f81fe) AM_WRITE_LEGACY(atarigen_video_int_ack_w)
9889   AM_RANGE(0xff8600, 0xff8601) AM_MIRROR(0x7f81fe) AM_WRITE_LEGACY(atarigen_eeprom_enable_w)
9990   AM_RANGE(0xff8800, 0xff89ff) AM_MIRROR(0x7f8000) AM_WRITEONLY AM_SHARE("priorityram")
100   AM_RANGE(0xff8a00, 0xff8a01) AM_MIRROR(0x7f81fe) AM_WRITE_LEGACY(atarigen_sound_w)
101   AM_RANGE(0xff8c00, 0xff8c01) AM_MIRROR(0x7f81fe) AM_WRITE_LEGACY(atarigen_sound_reset_w)
91   AM_RANGE(0xff8a00, 0xff8a01) AM_MIRROR(0x7f81fe) AM_WRITE8(sound_w, 0x00ff)
92   AM_RANGE(0xff8c00, 0xff8c01) AM_MIRROR(0x7f81fe) AM_WRITE(sound_reset_w)
10293   AM_RANGE(0xff8e00, 0xff8e01) AM_MIRROR(0x7f81fe) AM_WRITE(blstroid_halt_until_hblank_0_w)
103   AM_RANGE(0xff9400, 0xff9401) AM_MIRROR(0x7f83fe) AM_READ_LEGACY(atarigen_sound_r)
94   AM_RANGE(0xff9400, 0xff9401) AM_MIRROR(0x7f83fe) AM_READ8(sound_r, 0x00ff)
10495   AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x7f83f8) AM_READ_PORT("DIAL0")
10596   AM_RANGE(0xff9804, 0xff9805) AM_MIRROR(0x7f83f8) AM_READ_PORT("DIAL1")
10697   AM_RANGE(0xff9c00, 0xff9c03) AM_MIRROR(0x7f83fc) AM_READ(inputs_r)
r18571r18572
206197   MCFG_CPU_PROGRAM_MAP(main_map)
207198   MCFG_CPU_VBLANK_INT("screen", atarigen_video_int_gen)
208199
209   MCFG_MACHINE_START_OVERRIDE(blstroid_state,blstroid)
210200   MCFG_MACHINE_RESET_OVERRIDE(blstroid_state,blstroid)
211201   MCFG_NVRAM_ADD_1FILL("eeprom")
212202
trunk/src/mame/drivers/harddriv.c
r18571r18572
471471static ADDRESS_MAP_START( multisync_68k_map, AS_PROGRAM, 16, harddriv_state )
472472   ADDRESS_MAP_UNMAP_HIGH
473473   AM_RANGE(0x000000, 0x0fffff) AM_ROM
474   AM_RANGE(0x600000, 0x603fff) AM_READWRITE_LEGACY(atarigen_sound_upper_r, atarigen_sound_upper_w)
474   AM_RANGE(0x600000, 0x603fff) AM_READWRITE8(sound_r, sound_w, 0xff00)
475475   AM_RANGE(0x604000, 0x607fff) AM_READWRITE_LEGACY(hd68k_sound_reset_r, hd68k_nwr_w)
476476   AM_RANGE(0x608000, 0x60bfff) AM_WRITE(watchdog_reset16_w)
477477   AM_RANGE(0x60c000, 0x60ffff) AM_READWRITE_LEGACY(hd68k_port0_r, hd68k_irq_ack_w)
trunk/src/mame/drivers/thunderj.c
r18571r18572
3232 *
3333 *************************************/
3434
35static void update_interrupts(running_machine &machine)
35void thunderj_state::update_interrupts()
3636{
37   thunderj_state *state = machine.driver_data<thunderj_state>();
38   machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
39   machine.device("extra")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
40   machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
37   subdevice("maincpu")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
38   subdevice("extra")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
39   subdevice("maincpu")->execute().set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
4140}
4241
4342
4443MACHINE_START_MEMBER(thunderj_state,thunderj)
4544{
46   atarigen_init(machine());
47
45   atarigen_state::machine_start();
4846   save_item(NAME(m_alpha_tile_bank));
4947}
5048
5149
5250MACHINE_RESET_MEMBER(thunderj_state,thunderj)
5351{
54
55   atarigen_eeprom_reset(this);
56   atarigen_interrupt_reset(this, update_interrupts);
52   atarigen_state::machine_reset();
5753   atarivc_reset(*machine().primary_screen, m_atarivc_eof_data, 2);
58   atarijsa_reset();
54   atarijsa_reset(machine());
5955}
6056
6157
r18571r18572
155151   AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
156152   AM_RANGE(0x260010, 0x260011) AM_READ_PORT("260010")
157153   AM_RANGE(0x260012, 0x260013) AM_READ(special_port2_r)
158   AM_RANGE(0x260030, 0x260031) AM_READ_LEGACY(atarigen_sound_r)
154   AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff)
159155   AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w)
160156   AM_RANGE(0x360010, 0x360011) AM_WRITE(latch_w)
161   AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w)
162   AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w)
157   AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w)
158   AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff)
163159   AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram")
164160   AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE(thunderj_atarivc_r, thunderj_atarivc_w) AM_SHARE("atarivc_data")
165161   AM_RANGE(0x3f0000, 0x3f1fff) AM_RAM_WRITE_LEGACY(atarigen_playfield2_latched_msb_w) AM_SHARE("playfield2")
r18571r18572
187183   AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
188184   AM_RANGE(0x260010, 0x260011) AM_READ_PORT("260010")
189185   AM_RANGE(0x260012, 0x260013) AM_READ(special_port2_r)
190   AM_RANGE(0x260030, 0x260031) AM_READ_LEGACY(atarigen_sound_r)
186   AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff)
191187   AM_RANGE(0x360000, 0x360001) AM_WRITE_LEGACY(atarigen_video_int_ack_w)
192188   AM_RANGE(0x360010, 0x360011) AM_WRITE(latch_w)
193   AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w)
194   AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w)
189   AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w)
190   AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff)
195191ADDRESS_MAP_END
196192
197193
trunk/src/mame/drivers/atarigx2.c
r18571r18572
3333 *
3434 *************************************/
3535
36static void update_interrupts(running_machine &machine)
36void atarigx2_state::update_interrupts()
3737{
38   atarigx2_state *state = machine.driver_data<atarigx2_state>();
39   machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
40   machine.device("maincpu")->execute().set_input_line(5, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
38   machine().device("maincpu")->execute().set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
39   machine().device("maincpu")->execute().set_input_line(5, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
4140}
4241
4342
44MACHINE_START_MEMBER(atarigx2_state,atarigx2)
45{
46   atarigen_init(machine());
47}
48
49
5043MACHINE_RESET_MEMBER(atarigx2_state,atarigx2)
5144{
52
53   atarigen_eeprom_reset(this);
54   atarigen_interrupt_reset(this, update_interrupts);
55   atarigen_scanline_timer_reset(*machine().primary_screen, atarigx2_scanline_update, 8);
56   atarijsa_reset();
45   atarigen_state::machine_reset();
46   scanline_timer_reset(*machine().primary_screen, 8);
47   atarijsa_reset(machine());
5748}
5849
5950
r18571r18572
11571148   AM_RANGE(0xd7a200, 0xd7a203) AM_WRITE(mo_command_w) AM_SHARE("mo_command")
11581149   AM_RANGE(0xd70000, 0xd7ffff) AM_RAM
11591150   AM_RANGE(0xd80000, 0xd9ffff) AM_WRITE_LEGACY(atarigen_eeprom_enable32_w)
1160   AM_RANGE(0xe06000, 0xe06003) AM_WRITE_LEGACY(atarigen_sound_upper32_w)
1151   AM_RANGE(0xe06000, 0xe06003) AM_WRITE8(sound_w, 0xff000000)
11611152   AM_RANGE(0xe08000, 0xe08003) AM_WRITE(latch_w)
11621153   AM_RANGE(0xe0c000, 0xe0c003) AM_WRITE_LEGACY(atarigen_video_int_ack32_w)
11631154   AM_RANGE(0xe0e000, 0xe0e003) AM_WRITENOP//watchdog_reset_w },
11641155   AM_RANGE(0xe80000, 0xe80003) AM_READ_PORT("P1_P2")
11651156   AM_RANGE(0xe82000, 0xe82003) AM_READ(special_port2_r)
11661157   AM_RANGE(0xe82004, 0xe82007) AM_READ(special_port3_r)
1167   AM_RANGE(0xe86000, 0xe86003) AM_READ_LEGACY(atarigen_sound_upper32_r)
1158   AM_RANGE(0xe86000, 0xe86003) AM_READ8(sound_r, 0xff000000)
11681159   AM_RANGE(0xff8000, 0xffffff) AM_RAM
11691160ADDRESS_MAP_END
11701161
r18571r18572
14331424   MCFG_CPU_PROGRAM_MAP(main_map)
14341425   MCFG_CPU_VBLANK_INT("screen", atarigen_video_int_gen)
14351426
1436   MCFG_MACHINE_START_OVERRIDE(atarigx2_state,atarigx2)
14371427   MCFG_MACHINE_RESET_OVERRIDE(atarigx2_state,atarigx2)
14381428   MCFG_NVRAM_ADD_1FILL("eeprom")
14391429
trunk/src/mame/drivers/batman.c
r18571r18572
3131 *
3232 *************************************/
3333
34static void update_interrupts(running_machine &machine)
34void batman_state::update_interrupts()
3535{
36   batman_state *state = machine.driver_data<batman_state>();
37   machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
38   machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
36   subdevice("maincpu")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
37   subdevice("maincpu")->execute().set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
3938}
4039
4140
4241MACHINE_START_MEMBER(batman_state,batman)
4342{
44   atarigen_init(machine());
43   atarigen_state::machine_start();
4544
4645   save_item(NAME(m_latch_data));
4746   save_item(NAME(m_alpha_tile_bank));
r18571r18572
5049
5150MACHINE_RESET_MEMBER(batman_state,batman)
5251{
53
54   atarigen_eeprom_reset(this);
55   atarigen_interrupt_reset(this, update_interrupts);
52   atarigen_state::machine_reset();
5653   atarivc_reset(*machine().primary_screen, m_atarivc_eof_data, 2);
57   atarigen_scanline_timer_reset(*machine().primary_screen, batman_scanline_update, 8);
58   atarijsa_reset();
54   scanline_timer_reset(*machine().primary_screen, 8);
55   atarijsa_reset(machine());
5956}
6057
6158
r18571r18572
134131   AM_RANGE(0x260000, 0x260001) AM_MIRROR(0x11ff8c) AM_READ_PORT("260000")
135132   AM_RANGE(0x260002, 0x260003) AM_MIRROR(0x11ff8c) AM_READ_PORT("260002")
136133   AM_RANGE(0x260010, 0x260011) AM_MIRROR(0x11ff8e) AM_READ(special_port2_r)
137   AM_RANGE(0x260030, 0x260031) AM_MIRROR(0x11ff8e) AM_READ_LEGACY(atarigen_sound_r)
138   AM_RANGE(0x260040, 0x260041) AM_MIRROR(0x11ff8e) AM_WRITE_LEGACY(atarigen_sound_w)
134   AM_RANGE(0x260030, 0x260031) AM_MIRROR(0x11ff8e) AM_READ8(sound_r, 0x00ff)
135   AM_RANGE(0x260040, 0x260041) AM_MIRROR(0x11ff8e) AM_WRITE8(sound_w, 0x00ff)
139136   AM_RANGE(0x260050, 0x260051) AM_MIRROR(0x11ff8e) AM_WRITE(latch_w)
140137   AM_RANGE(0x260060, 0x260061) AM_MIRROR(0x11ff8e) AM_WRITE_LEGACY(atarigen_eeprom_enable_w)
141138   AM_RANGE(0x2a0000, 0x2a0001) AM_MIRROR(0x11fffe) AM_WRITE(watchdog_reset16_w)
trunk/src/mame/drivers/gauntlet.c
r18571r18572
135135 *
136136 *************************************/
137137
138static void update_interrupts(running_machine &machine)
138void gauntlet_state::update_interrupts()
139139{
140   gauntlet_state *state = machine.driver_data<gauntlet_state>();
141   machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
142   machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
140   subdevice("maincpu")->execute().set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
141   subdevice("maincpu")->execute().set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
143142}
144143
145144
146static void scanline_update(screen_device &screen, int scanline)
145void gauntlet_state::scanline_update(screen_device &screen, int scanline)
147146{
148   address_space &space = screen.machine().device("audiocpu")->memory().space(AS_PROGRAM);
147   address_space &space = subdevice("audiocpu")->memory().space(AS_PROGRAM);
149148
150149   /* sound IRQ is on 32V */
151150   if (scanline & 32)
152      atarigen_6502_irq_gen(screen.machine().device("audiocpu"));
151      m6502_irq_gen(*subdevice("audiocpu"));
153152   else
154      atarigen_6502_irq_ack_r(space, 0);
153      m6502_irq_ack_r(space, 0);
155154}
156155
157156
158157MACHINE_START_MEMBER(gauntlet_state,gauntlet)
159158{
160   atarigen_init(machine());
161
159   atarigen_state::machine_start();
162160   save_item(NAME(m_sound_reset_val));
163161}
164162
165163
166164MACHINE_RESET_MEMBER(gauntlet_state,gauntlet)
167165{
168
169166   m_sound_reset_val = 1;
170167
171   atarigen_eeprom_reset(this);
172   atarigen_slapstic_reset(this);
173   atarigen_interrupt_reset(this, update_interrupts);
174   atarigen_scanline_timer_reset(*machine().primary_screen, scanline_update, 32);
175   atarigen_sound_io_reset(machine().device("audiocpu"));
168   atarigen_state::machine_reset();
169   scanline_timer_reset(*machine().primary_screen, 32);
176170}
177171
178172
r18571r18572
209203      if ((oldword ^ m_sound_reset_val) & 1)
210204      {
211205         machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, (m_sound_reset_val & 1) ? CLEAR_LINE : ASSERT_LINE);
212         atarigen_sound_reset(machine());
206         sound_cpu_reset();
213207         if (m_sound_reset_val & 1)
214208         {
215209            machine().device("ymsnd")->reset();
216210            machine().device("tms")->reset();
217211            tms5220_set_frequency(machine().device("tms"), ATARI_CLOCK_14MHz/2 / 11);
218            atarigen_set_ym2151_vol(machine(), 0);
219            atarigen_set_pokey_vol(machine(), 0);
220            atarigen_set_tms5220_vol(machine(), 0);
212            set_ym2151_volume(0);
213            set_pokey_volume(0);
214            set_tms5220_volume(0);
221215         }
222216      }
223217   }
r18571r18572
284278
285279WRITE8_MEMBER(gauntlet_state::mixer_w)
286280{
287   atarigen_set_ym2151_vol(machine(), (data & 7) * 100 / 7);
288   atarigen_set_pokey_vol(machine(), ((data >> 3) & 3) * 100 / 3);
289   atarigen_set_tms5220_vol(machine(), ((data >> 5) & 7) * 100 / 7);
281   set_ym2151_volume((data & 7) * 100 / 7);
282   set_pokey_volume(((data >> 3) & 3) * 100 / 3);
283   set_tms5220_volume(((data >> 5) & 7) * 100 / 7);
290284}
291285
292286
r18571r18572
312306   AM_RANGE(0x803004, 0x803005) AM_MIRROR(0x2fcef0) AM_READ_PORT("803004")
313307   AM_RANGE(0x803006, 0x803007) AM_MIRROR(0x2fcef0) AM_READ_PORT("803006")
314308   AM_RANGE(0x803008, 0x803009) AM_MIRROR(0x2fcef0) AM_READ(port4_r)
315   AM_RANGE(0x80300e, 0x80300f) AM_MIRROR(0x2fcef0) AM_READ_LEGACY(atarigen_sound_r)
309   AM_RANGE(0x80300e, 0x80300f) AM_MIRROR(0x2fcef0) AM_READ8(sound_r, 0x00ff)
316310   AM_RANGE(0x803100, 0x803101) AM_MIRROR(0x2fce8e) AM_WRITE(watchdog_reset16_w)
317311   AM_RANGE(0x803120, 0x803121) AM_MIRROR(0x2fce8e) AM_WRITE(sound_reset_w)
318312   AM_RANGE(0x803140, 0x803141) AM_MIRROR(0x2fce8e) AM_WRITE_LEGACY(atarigen_video_int_ack_w)
319313   AM_RANGE(0x803150, 0x803151) AM_MIRROR(0x2fce8e) AM_WRITE_LEGACY(atarigen_eeprom_enable_w)
320   AM_RANGE(0x803170, 0x803171) AM_MIRROR(0x2fce8e) AM_WRITE_LEGACY(atarigen_sound_w)
314   AM_RANGE(0x803170, 0x803171) AM_MIRROR(0x2fce8e) AM_WRITE8(sound_w, 0x00ff)
321315
322316   /* VBUS */
323317   AM_RANGE(0x900000, 0x901fff) AM_MIRROR(0x2c8000) AM_RAM_WRITE_LEGACY(atarigen_playfield_w) AM_SHARE("playfield")
r18571r18572
342336static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, gauntlet_state )
343337   ADDRESS_MAP_UNMAP_HIGH
344338   AM_RANGE(0x0000, 0x0fff) AM_MIRROR(0x2000) AM_RAM
345   AM_RANGE(0x1000, 0x100f) AM_MIRROR(0x27c0) AM_WRITE_LEGACY(atarigen_6502_sound_w)
346   AM_RANGE(0x1010, 0x101f) AM_MIRROR(0x27c0) AM_READ_LEGACY(atarigen_6502_sound_r)
339   AM_RANGE(0x1000, 0x100f) AM_MIRROR(0x27c0) AM_WRITE(m6502_sound_w)
340   AM_RANGE(0x1010, 0x101f) AM_MIRROR(0x27c0) AM_READ(m6502_sound_r)
347341   AM_RANGE(0x1020, 0x102f) AM_MIRROR(0x27c0) AM_READ_PORT("COIN") AM_WRITE(mixer_w)
348342   AM_RANGE(0x1030, 0x103f) AM_MIRROR(0x27c0) AM_READWRITE(switch_6502_r, sound_ctl_w)
349343   AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x27c0) AM_DEVREADWRITE("pokey", pokey_device, read, write)
350344   AM_RANGE(0x1810, 0x1811) AM_MIRROR(0x27ce) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
351345   AM_RANGE(0x1820, 0x182f) AM_MIRROR(0x27c0) AM_DEVWRITE_LEGACY("tms", tms5220_data_w)
352   AM_RANGE(0x1830, 0x183f) AM_MIRROR(0x27c0) AM_READWRITE_LEGACY(atarigen_6502_irq_ack_r, atarigen_6502_irq_ack_w)
346   AM_RANGE(0x1830, 0x183f) AM_MIRROR(0x27c0) AM_READWRITE(m6502_irq_ack_r, m6502_irq_ack_w)
353347   AM_RANGE(0x4000, 0xffff) AM_ROM
354348ADDRESS_MAP_END
355349
r18571r18572
16211615   gauntlet_state *state = machine.driver_data<gauntlet_state>();
16221616   UINT8 *rom = state->memregion("maincpu")->base();
16231617   state->m_eeprom_default = NULL;
1624   atarigen_slapstic_init(machine.device("maincpu"), 0x038000, 0, slapstic);
1618   state->slapstic_configure(*machine.device<cpu_device>("maincpu"), 0x038000, 0, slapstic);
16251619
16261620   /* swap the top and bottom halves of the main CPU ROM images */
16271621   atarigen_swap_mem(rom + 0x000000, rom + 0x008000, 0x8000);
trunk/src/mame/drivers/eprom.c
r18571r18572
3737 *
3838 *************************************/
3939
40static void update_interrupts(running_machine &machine)
40void eprom_state::update_interrupts()
4141{
42   eprom_state *state = machine.driver_data<eprom_state>();
42   subdevice("maincpu")->execute().set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
4343
44   machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
44   if (subdevice("extra") != NULL)
45      subdevice("extra")->execute().set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
4546
46   if (machine.device("extra") != NULL)
47      machine.device("extra")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
48
49   machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
47   subdevice("maincpu")->execute().set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
5048}
5149
5250
53MACHINE_START_MEMBER(eprom_state,eprom)
54{
55   atarigen_init(machine());
56}
57
58
5951MACHINE_RESET_MEMBER(eprom_state,eprom)
6052{
61
62   atarigen_eeprom_reset(this);
63   atarigen_interrupt_reset(this, update_interrupts);
64   atarigen_scanline_timer_reset(*machine().primary_screen, eprom_scanline_update, 8);
65   atarijsa_reset();
53   atarigen_state::machine_reset();
54   scanline_timer_reset(*machine().primary_screen, 8);
55   atarijsa_reset(machine());
6656}
6757
6858
r18571r18572
163153   AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
164154   AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r)
165155   AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r)
166   AM_RANGE(0x260030, 0x260031) AM_READ_LEGACY(atarigen_sound_r)
156   AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff)
167157   AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w)
168158   AM_RANGE(0x360000, 0x360001) AM_WRITE_LEGACY(atarigen_video_int_ack_w)
169159   AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w)
170   AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w)
171   AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w)
160   AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w)
161   AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff)
172162   AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM AM_SHARE("paletteram")
173163   AM_RANGE(0x3f0000, 0x3f1fff) AM_WRITE_LEGACY(atarigen_playfield_w) AM_SHARE("playfield")
174164   AM_RANGE(0x3f2000, 0x3f3fff) AM_READWRITE_LEGACY(atarimo_0_spriteram_r, atarimo_0_spriteram_w)
r18571r18572
188178   AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
189179   AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r)
190180   AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r)
191   AM_RANGE(0x260030, 0x260031) AM_READ_LEGACY(atarigen_sound_r)
181   AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff)
192182   AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w)
193183   AM_RANGE(0x360000, 0x360001) AM_WRITE_LEGACY(atarigen_video_int_ack_w)
194184//  AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w)
195   AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w)
196   AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w)
185   AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w)
186   AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff)
197187   AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM AM_SHARE("paletteram")
198188   AM_RANGE(0xff0000, 0xff1fff) AM_WRITE_LEGACY(atarigen_playfield_upper_w) AM_SHARE("playfield_up")
199189   AM_RANGE(0xff8000, 0xff9fff) AM_WRITE_LEGACY(atarigen_playfield_w) AM_SHARE("playfield")
r18571r18572
219209   AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
220210   AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r)
221211   AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r)
222   AM_RANGE(0x260030, 0x260031) AM_READ_LEGACY(atarigen_sound_r)
212   AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff)
223213   AM_RANGE(0x360000, 0x360001) AM_WRITE_LEGACY(atarigen_video_int_ack_w)
224214   AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w)
225   AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w)
226   AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w)
215   AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w)
216   AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff)
227217ADDRESS_MAP_END
228218
229219
r18571r18572
413403
414404   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
415405
416   MCFG_MACHINE_START_OVERRIDE(eprom_state,eprom)
417406   MCFG_MACHINE_RESET_OVERRIDE(eprom_state,eprom)
418407   MCFG_NVRAM_ADD_1FILL("eeprom")
419408
r18571r18572
444433
445434   MCFG_QUANTUM_TIME(attotime::from_hz(600))
446435
447   MCFG_MACHINE_START_OVERRIDE(eprom_state,eprom)
448436   MCFG_MACHINE_RESET_OVERRIDE(eprom_state,eprom)
449437   MCFG_NVRAM_ADD_1FILL("eeprom")
450438
r18571r18572
475463
476464   MCFG_QUANTUM_TIME(attotime::from_hz(600))
477465
478   MCFG_MACHINE_START_OVERRIDE(eprom_state,eprom)
479466   MCFG_MACHINE_RESET_OVERRIDE(eprom_state,eprom)
480467   MCFG_NVRAM_ADD_1FILL("eeprom")
481468
trunk/src/mame/drivers/beathead.c
r18571r18572
169169}
170170
171171
172void beathead_state::machine_start()
173{
174   atarigen_init(machine());
175}
176
177
178static void update_interrupts(running_machine &machine) { machine.driver_data<beathead_state>()->update_interrupts(); }
179172void beathead_state::machine_reset()
180173{
181174   /* reset the common subsystems */
182   atarigen_eeprom_reset(this);
183   atarigen_interrupt_reset(this, ::update_interrupts);
184   atarijsa_reset();
175   atarigen_state::machine_reset();
176   atarijsa_reset(machine());
185177
186178   /* the code is temporarily mapped at 0 at startup */
187179   /* just copying the first 0x40 bytes is sufficient */
r18571r18572
221213   {
222214      m_irq_line_state = gen_int;
223215      //if (m_irq_line_state != CLEAR_LINE)
224         machine().device("maincpu")->execute().set_input_line(ASAP_IRQ0, m_irq_line_state);
216         subdevice("maincpu")->execute().set_input_line(ASAP_IRQ0, m_irq_line_state);
225217      //else
226218         //asap_set_irq_line(ASAP_IRQ0, m_irq_line_state);
227219   }
r18571r18572
300292 *
301293 *************************************/
302294
303READ32_MEMBER( beathead_state::sound_data_r )
304{
305   return atarigen_sound_r(space, offset, 0xffff);
306}
307
308
309WRITE32_MEMBER( beathead_state::sound_data_w )
310{
311   if (ACCESSING_BITS_0_7)
312      atarigen_sound_w(space, offset, data, mem_mask);
313}
314
315
316295WRITE32_MEMBER( beathead_state::sound_reset_w )
317296{
318297   logerror("Sound reset = %d\n", !offset);
r18571r18572
344323   AM_RANGE(0x00000000, 0x0001ffff) AM_RAM AM_SHARE("ram_base")
345324   AM_RANGE(0x01800000, 0x01bfffff) AM_ROM AM_REGION("user1", 0) AM_SHARE("rom_base")
346325   AM_RANGE(0x40000000, 0x400007ff) AM_RAM_WRITE(eeprom_data_w) AM_SHARE("nvram")
347   AM_RANGE(0x41000000, 0x41000003) AM_READWRITE(sound_data_r, sound_data_w)
326   AM_RANGE(0x41000000, 0x41000003) AM_READWRITE8(sound_r, sound_w, 0x000000ff)
348327   AM_RANGE(0x41000100, 0x41000103) AM_READ(interrupt_control_r)
349328   AM_RANGE(0x41000100, 0x4100011f) AM_WRITE(interrupt_control_w)
350329   AM_RANGE(0x41000200, 0x41000203) AM_READ_PORT("IN1")
trunk/src/mame/drivers/relief.c
r18571r18572
3232 *
3333 *************************************/
3434
35static void update_interrupts(running_machine &machine)
35void relief_state::update_interrupts()
3636{
37   relief_state *state = machine.driver_data<relief_state>();
38   machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
37   subdevice("maincpu")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
3938}
4039
4140
r18571r18572
6564 *
6665 *************************************/
6766
68MACHINE_START_MEMBER(relief_state,relief)
69{
70   atarigen_init(machine());
71}
72
73
7467MACHINE_RESET_MEMBER(relief_state,relief)
7568{
76
77   atarigen_eeprom_reset(this);
78   atarigen_interrupt_reset(this, update_interrupts);
69   atarigen_state::machine_reset();
7970   atarivc_reset(*machine().primary_screen, m_atarivc_eof_data, 2);
8071
8172   machine().device<okim6295_device>("oki")->set_bank_base(0);
r18571r18572
113104   if (ACCESSING_BITS_0_7)
114105   {
115106      m_ym2413_volume = (data >> 1) & 15;
116      atarigen_set_ym2413_vol(machine(), (m_ym2413_volume * m_overall_volume * 100) / (127 * 15));
107      set_ym2413_volume((m_ym2413_volume * m_overall_volume * 100) / (127 * 15));
117108      m_adpcm_bank_base = (0x040000 * ((data >> 6) & 3)) | (m_adpcm_bank_base & 0x100000);
118109   }
119110   if (ACCESSING_BITS_8_15)
r18571r18572
129120   if (ACCESSING_BITS_0_7)
130121   {
131122      m_overall_volume = data & 127;
132      atarigen_set_ym2413_vol(machine(), (m_ym2413_volume * m_overall_volume * 100) / (127 * 15));
133      atarigen_set_oki6295_vol(machine(), m_overall_volume * 100 / 127);
123      set_ym2413_volume((m_ym2413_volume * m_overall_volume * 100) / (127 * 15));
124      set_oki6295_volume(m_overall_volume * 100 / 127);
134125   }
135126}
136127
r18571r18572
296287   MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2)
297288   MCFG_CPU_PROGRAM_MAP(main_map)
298289
299   MCFG_MACHINE_START_OVERRIDE(relief_state,relief)
300290   MCFG_MACHINE_RESET_OVERRIDE(relief_state,relief)
301291   MCFG_NVRAM_ADD_1FILL("eeprom")
302292
trunk/src/mame/drivers/atarisy2.c
r18571r18572
155155 *
156156 *************************************/
157157
158static void update_interrupts(running_machine &machine)
158void atarisy2_state::update_interrupts()
159159{
160   atarisy2_state *state = machine.driver_data<atarisy2_state>();
161
162   if (state->m_video_int_state)
163      machine.device("maincpu")->execute().set_input_line(3, ASSERT_LINE);
160   if (m_video_int_state)
161      machine().device("maincpu")->execute().set_input_line(3, ASSERT_LINE);
164162   else
165      machine.device("maincpu")->execute().set_input_line(3, CLEAR_LINE);
163      machine().device("maincpu")->execute().set_input_line(3, CLEAR_LINE);
166164
167   if (state->m_scanline_int_state)
168      machine.device("maincpu")->execute().set_input_line(2, ASSERT_LINE);
165   if (m_scanline_int_state)
166      machine().device("maincpu")->execute().set_input_line(2, ASSERT_LINE);
169167   else
170      machine.device("maincpu")->execute().set_input_line(2, CLEAR_LINE);
168      machine().device("maincpu")->execute().set_input_line(2, CLEAR_LINE);
171169
172   if (state->m_p2portwr_state)
173      machine.device("maincpu")->execute().set_input_line(1, ASSERT_LINE);
170   if (m_p2portwr_state)
171      machine().device("maincpu")->execute().set_input_line(1, ASSERT_LINE);
174172   else
175      machine.device("maincpu")->execute().set_input_line(1, CLEAR_LINE);
173      machine().device("maincpu")->execute().set_input_line(1, CLEAR_LINE);
176174
177   if (state->m_p2portrd_state)
178      machine.device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
175   if (m_p2portrd_state)
176      machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
179177   else
180      machine.device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
178      machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
181179}
182180
183181
r18571r18572
188186 *
189187 *************************************/
190188
191static void scanline_update(screen_device &screen, int scanline)
189void atarisy2_state::scanline_update(screen_device &screen, int scanline)
192190{
193   atarisy2_state *state = screen.machine().driver_data<atarisy2_state>();
194191   if (scanline <= screen.height())
195192   {
196193      /* generate the 32V interrupt (IRQ 2) */
197194      if ((scanline % 64) == 0)
198         if (state->m_interrupt_enable & 4)
199            atarigen_scanline_int_gen(screen.machine().device("maincpu"));
195         if (m_interrupt_enable & 4)
196            scanline_int_gen(*subdevice("maincpu"));
200197   }
201198}
202199
r18571r18572
222219
223220MACHINE_START_MEMBER(atarisy2_state,atarisy2)
224221{
225   atarigen_init(machine());
222   atarigen_state::machine_start();
226223
227224   save_item(NAME(m_interrupt_enable));
228225   save_item(NAME(m_which_adc));
r18571r18572
235232
236233MACHINE_RESET_MEMBER(atarisy2_state,atarisy2)
237234{
238
239   atarigen_eeprom_reset(this);
235   atarigen_state::machine_reset();
240236   slapstic_reset();
241   atarigen_interrupt_reset(this, update_interrupts);
242   atarigen_sound_io_reset(machine().device("soundcpu"));
243   atarigen_scanline_timer_reset(*machine().primary_screen, scanline_update, 64);
237   scanline_timer_reset(*machine().primary_screen, 64);
244238
245239   address_space &main = machine().device<t11_device>("maincpu")->space(AS_PROGRAM);
246240   main.set_direct_update_handler(direct_update_delegate(FUNC(atarisy2_state::atarisy2_direct_handler), this));
r18571r18572
272266{
273267   /* reset sound IRQ */
274268   m_p2portrd_state = 0;
275   atarigen_update_interrupts(machine());
269   update_interrupts();
276270}
277271
278272
r18571r18572
280274{
281275   /* reset sound CPU */
282276   if (ACCESSING_BITS_0_7)
283      machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
277      machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
284278}
285279
286280
r18571r18572
671665   if (!(data & 0x02)) rbott += 1.0/47;
672666   if (!(data & 0x04)) rbott += 1.0/22;
673667   gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott)));
674   atarigen_set_ym2151_vol(machine(), gain * 100);
668   set_ym2151_volume(gain * 100);
675669
676670   /* bits 3-4 control the volume of the POKEYs, using 47k and 100k resistors */
677671   rtop = 1.0/(1.0/100 + 1.0/100);
r18571r18572
679673   if (!(data & 0x08)) rbott += 1.0/47;
680674   if (!(data & 0x10)) rbott += 1.0/22;
681675   gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott)));
682   atarigen_set_pokey_vol(machine(), gain * 100);
676   set_pokey_volume(gain * 100);
683677
684678   /* bits 5-7 control the volume of the TMS5220, using 22k, 47k, and 100k resistors */
685679   rtop = 1.0/(1.0/100 + 1.0/100);
r18571r18572
688682   if (!(data & 0x40)) rbott += 1.0/47;
689683   if (!(data & 0x80)) rbott += 1.0/22;
690684   gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott)));
691   atarigen_set_tms5220_vol(machine(), gain * 100);
685   set_tms5220_volume(gain * 100);
692686}
693687
694688
r18571r18572
705699      return;
706700
707701   /* a large number of signals are reset when this happens */
708   atarigen_sound_io_reset(machine().device("soundcpu"));
702   sound_io_reset();
709703   machine().device("ymsnd")->reset();
710704   if (m_has_tms5220)
711705   {
r18571r18572
717711
718712READ16_MEMBER(atarisy2_state::sound_r)
719713{
720
721714   /* clear the p2portwr state on a p1portrd */
722715   m_p2portwr_state = 0;
723   atarigen_update_interrupts(machine());
716   update_interrupts();
724717
725718   /* handle it normally otherwise */
726   return atarigen_sound_r(space,offset,0xffff);
719   return atarigen_state::sound_r(space,offset) | 0xff00;
727720}
728721
729722
730723WRITE8_MEMBER(atarisy2_state::sound_6502_w)
731724{
732
733725   /* clock the state through */
734726   m_p2portwr_state = (m_interrupt_enable & 2) != 0;
735   atarigen_update_interrupts(machine());
727   update_interrupts();
736728
737729   /* handle it normally otherwise */
738   atarigen_6502_sound_w(space, offset, data);
730   m6502_sound_w(space, offset, data);
739731}
740732
741733
742734READ8_MEMBER(atarisy2_state::sound_6502_r)
743735{
744
745736   /* clock the state through */
746737   m_p2portrd_state = (m_interrupt_enable & 1) != 0;
747   atarigen_update_interrupts(machine());
738   update_interrupts();
748739
749740   /* handle it normally otherwise */
750   return atarigen_6502_sound_r(space, offset);
741   return m6502_sound_r(space, offset);
751742}
752743
753744
r18571r18572
802793   AM_RANGE(0x1480, 0x1487) AM_MIRROR(0x0078) AM_WRITE(adc_strobe_w)
803794   AM_RANGE(0x1580, 0x1581) AM_MIRROR(0x001e) AM_WRITE(int0_ack_w)
804795   AM_RANGE(0x15a0, 0x15a1) AM_MIRROR(0x001e) AM_WRITE(int1_ack_w)
805   AM_RANGE(0x15c0, 0x15c1) AM_MIRROR(0x001e) AM_WRITE_LEGACY(atarigen_scanline_int_ack_w)
796   AM_RANGE(0x15c0, 0x15c1) AM_MIRROR(0x001e) AM_WRITE(scanline_int_ack_w)
806797   AM_RANGE(0x15e0, 0x15e1) AM_MIRROR(0x001e) AM_WRITE_LEGACY(atarigen_video_int_ack_w)
807798   AM_RANGE(0x1600, 0x1601) AM_MIRROR(0x007e) AM_WRITE(int_enable_w)
808   AM_RANGE(0x1680, 0x1681) AM_MIRROR(0x007e) AM_WRITE_LEGACY(atarigen_sound_w)
799   AM_RANGE(0x1680, 0x1681) AM_MIRROR(0x007e) AM_WRITE8(sound_w, 0x00ff)
809800   AM_RANGE(0x1700, 0x1701) AM_MIRROR(0x007e) AM_WRITE_LEGACY(atarisy2_xscroll_w) AM_SHARE("xscroll")
810801   AM_RANGE(0x1780, 0x1781) AM_MIRROR(0x007e) AM_WRITE_LEGACY(atarisy2_yscroll_w) AM_SHARE("yscroll")
811802   AM_RANGE(0x1800, 0x1801) AM_MIRROR(0x03fe) AM_READ(switch_r) AM_WRITE(watchdog_reset16_w)
r18571r18572
839830   AM_RANGE(0x1872, 0x1873) AM_MIRROR(0x2780) AM_WRITE(tms5220_strobe_w)
840831   AM_RANGE(0x1874, 0x1874) AM_MIRROR(0x2781) AM_WRITE(sound_6502_w)
841832   AM_RANGE(0x1876, 0x1876) AM_MIRROR(0x2781) AM_WRITE(coincount_w)
842   AM_RANGE(0x1878, 0x1878) AM_MIRROR(0x2781) AM_WRITE_LEGACY(atarigen_6502_irq_ack_w)
833   AM_RANGE(0x1878, 0x1878) AM_MIRROR(0x2781) AM_WRITE(m6502_irq_ack_w)
843834   AM_RANGE(0x187a, 0x187a) AM_MIRROR(0x2781) AM_WRITE(mixer_w)
844835   AM_RANGE(0x187c, 0x187c) AM_MIRROR(0x2781) AM_WRITE(switch_6502_w)
845836   AM_RANGE(0x187e, 0x187e) AM_MIRROR(0x2781) AM_WRITE(sound_reset_w)
r18571r18572
12621253   MCFG_CPU_PROGRAM_MAP(main_map)
12631254   MCFG_CPU_VBLANK_INT_DRIVER("screen", atarisy2_state,  vblank_int)
12641255
1265   MCFG_CPU_ADD("soundcpu", M6502, SOUND_CLOCK/8)
1256   MCFG_CPU_ADD("audiocpu", M6502, SOUND_CLOCK/8)
12661257   MCFG_CPU_PROGRAM_MAP(sound_map)
1267   MCFG_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)MASTER_CLOCK/2/16/16/16/10)
1258   MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)MASTER_CLOCK/2/16/16/16/10)
12681259
12691260   MCFG_MACHINE_START_OVERRIDE(atarisy2_state,atarisy2)
12701261   MCFG_MACHINE_RESET_OVERRIDE(atarisy2_state,atarisy2)
r18571r18572
13301321   ROM_LOAD16_BYTE( "cpu_l06.rv2", 0x070000, 0x004000, CRC(8a754466) SHA1(2c4c6ca797c7f4349c2893d8c0ba7e2658fdca99) )
13311322   ROM_LOAD16_BYTE( "cpu_s06.rv2", 0x070001, 0x004000, CRC(224209f9) SHA1(c41269bfadb8fff1c8ff0f6ea0b8e8b34feb49d6) )
13321323
1333   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
1324   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
13341325   ROM_LOAD( "cpu_a02.rv3", 0x004000, 0x004000, CRC(ba251bc4) SHA1(768e42608263205e412e651082ffa2a083b04644) )
13351326   ROM_LOAD( "cpu_b02.rv2", 0x008000, 0x004000, CRC(e4e7a8b9) SHA1(f11a0cf40d5c51ff180f0fa1cf676f95090a1010) )
13361327   ROM_LOAD( "cpu_c02.rv2", 0x00c000, 0x004000, CRC(d44c2aa2) SHA1(f1b00e36d87f6d77746cf003198c7f19aa2f4fab) )
r18571r18572
13721363   ROM_LOAD16_BYTE( "cpu_l06.rv2", 0x070000, 0x004000, CRC(8a754466) SHA1(2c4c6ca797c7f4349c2893d8c0ba7e2658fdca99) )
13731364   ROM_LOAD16_BYTE( "cpu_s06.rv2", 0x070001, 0x004000, CRC(224209f9) SHA1(c41269bfadb8fff1c8ff0f6ea0b8e8b34feb49d6) )
13741365
1375   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
1366   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
13761367   ROM_LOAD( "cpu_a02.rv2", 0x004000, 0x004000, CRC(4a759092) SHA1(26909df77f53ac19e205411b90558488badc82bd) )
13771368   ROM_LOAD( "cpu_b02.rv2", 0x008000, 0x004000, CRC(e4e7a8b9) SHA1(f11a0cf40d5c51ff180f0fa1cf676f95090a1010) )
13781369   ROM_LOAD( "cpu_c02.rv2", 0x00c000, 0x004000, CRC(d44c2aa2) SHA1(f1b00e36d87f6d77746cf003198c7f19aa2f4fab) )
r18571r18572
14141405   ROM_LOAD16_BYTE( "cpu_l06.rv1", 0x070000, 0x004000, CRC(ccbc58a6) SHA1(dd66317146c295524f83b8d40c20164e873752b5) )
14151406   ROM_LOAD16_BYTE( "cpu_s06.rv1", 0x070001, 0x004000, CRC(a7f14643) SHA1(d73c8ec2493617fce2e6822e8a6cde16a2de5965) )
14161407
1417   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
1408   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
14181409   ROM_LOAD( "cpu_a02.rv1", 0x004000, 0x004000, CRC(5479a788) SHA1(4cc5145e75ac6370f54eea33531f1f96160ee82b) )
14191410   ROM_LOAD( "cpu_b02.rv1", 0x008000, 0x004000, CRC(de4147c6) SHA1(c997510b2018291924abddfe604a8f738fd8035c) )
14201411   ROM_LOAD( "cpu_c02.rv1", 0x00c000, 0x004000, CRC(b71505fc) SHA1(15fd156038861cb715fce10f1c56f3ded851be39) )
r18571r18572
14541445   ROM_LOAD16_BYTE( "136047-1130.6k",  0x050000, 0x010000, CRC(93fba845) SHA1(4de5867272af63be696855f2a4dff99476b213ad) )
14551446   ROM_LOAD16_BYTE( "136047-1133.6r",  0x050001, 0x010000, CRC(53c177be) SHA1(a60c81899944e0dda9886e6697edc4d9309ca8f4) )
14561447
1457   ROM_REGION( 0x10000, "soundcpu", 0 )     /* 64k for 6502 code */
1448   ROM_REGION( 0x10000, "audiocpu", 0 )     /* 64k for 6502 code */
14581449   ROM_LOAD( "136047-2134.2a",  0x004000, 0x004000, CRC(0db4ca28) SHA1(71c2e0eee0eee418bdd2f806bd6ce5ae1c72bf69) )
14591450   ROM_LOAD( "136047-1135.2b",  0x008000, 0x004000, CRC(b1f157d0) SHA1(26355324d49baa02acb777940d7f49d074a75fe5) )
14601451   ROM_LOAD( "136047-2136.2cd", 0x00c000, 0x004000, CRC(00b06bec) SHA1(cd771eea329e0f6ab5bff1035f931800cc5da545) )
r18571r18572
15221513   ROM_LOAD16_BYTE( "136047-1130.6k",  0x050000, 0x010000, CRC(93fba845) SHA1(4de5867272af63be696855f2a4dff99476b213ad) )
15231514   ROM_LOAD16_BYTE( "136047-1133.6r",  0x050001, 0x010000, CRC(53c177be) SHA1(a60c81899944e0dda9886e6697edc4d9309ca8f4) )
15241515
1525   ROM_REGION( 0x10000, "soundcpu", 0 )     /* 64k for 6502 code */
1516   ROM_REGION( 0x10000, "audiocpu", 0 )     /* 64k for 6502 code */
15261517   ROM_LOAD( "136047-1134.2a",  0x004000, 0x004000, CRC(09a418c2) SHA1(017491bbcd0def695a23ab17b1e4fbd1fdf4d5d1) )
15271518   ROM_LOAD( "136047-1135.2b",  0x008000, 0x004000, CRC(b1f157d0) SHA1(26355324d49baa02acb777940d7f49d074a75fe5) )
15281519   ROM_LOAD( "136047-1136.2cd", 0x00c000, 0x004000, CRC(dad40e6d) SHA1(a94bc1b5f0a5218e9e44cd32f2ca6268b48072c2) )
r18571r18572
15901581   ROM_LOAD16_BYTE( "136047-1130.6k",  0x050000, 0x010000, CRC(93fba845) SHA1(4de5867272af63be696855f2a4dff99476b213ad) )
15911582   ROM_LOAD16_BYTE( "136047-1133.6r",  0x050001, 0x010000, CRC(53c177be) SHA1(a60c81899944e0dda9886e6697edc4d9309ca8f4) )
15921583
1593   ROM_REGION( 0x10000, "soundcpu", 0 )     /* 64k for 6502 code */
1584   ROM_REGION( 0x10000, "audiocpu", 0 )     /* 64k for 6502 code */
15941585   ROM_LOAD( "136047-1134.2a",  0x004000, 0x004000, CRC(09a418c2) SHA1(017491bbcd0def695a23ab17b1e4fbd1fdf4d5d1) )
15951586   ROM_LOAD( "136047-1135.2b",  0x008000, 0x004000, CRC(b1f157d0) SHA1(26355324d49baa02acb777940d7f49d074a75fe5) )
15961587   ROM_LOAD( "136047-1136.2cd", 0x00c000, 0x004000, CRC(dad40e6d) SHA1(a94bc1b5f0a5218e9e44cd32f2ca6268b48072c2) )
r18571r18572
16581649   ROM_LOAD16_BYTE( "136047-1130.6k",  0x050000, 0x010000, CRC(93fba845) SHA1(4de5867272af63be696855f2a4dff99476b213ad) )
16591650   ROM_LOAD16_BYTE( "136047-1133.6r",  0x050001, 0x010000, CRC(53c177be) SHA1(a60c81899944e0dda9886e6697edc4d9309ca8f4) )
16601651
1661   ROM_REGION( 0x10000, "soundcpu", 0 )     /* 64k for 6502 code */
1652   ROM_REGION( 0x10000, "audiocpu", 0 )     /* 64k for 6502 code */
16621653   ROM_LOAD( "136047-1134.2a",  0x004000, 0x004000, CRC(09a418c2) SHA1(017491bbcd0def695a23ab17b1e4fbd1fdf4d5d1) )
16631654   ROM_LOAD( "136047-1135.2b",  0x008000, 0x004000, CRC(b1f157d0) SHA1(26355324d49baa02acb777940d7f49d074a75fe5) )
16641655   ROM_LOAD( "136047-1136.2cd", 0x00c000, 0x004000, CRC(dad40e6d) SHA1(a94bc1b5f0a5218e9e44cd32f2ca6268b48072c2) )
r18571r18572
17261717   ROM_LOAD16_BYTE( "136047-1130.6k",  0x050000, 0x010000, CRC(93fba845) SHA1(4de5867272af63be696855f2a4dff99476b213ad) )
17271718   ROM_LOAD16_BYTE( "136047-1133.6r",  0x050001, 0x010000, CRC(53c177be) SHA1(a60c81899944e0dda9886e6697edc4d9309ca8f4) )
17281719
1729   ROM_REGION( 0x10000, "soundcpu", 0 )     /* 64k for 6502 code */
1720   ROM_REGION( 0x10000, "audiocpu", 0 )     /* 64k for 6502 code */
17301721   ROM_LOAD( "136047-2134.2a",  0x004000, 0x004000, CRC(0db4ca28) SHA1(71c2e0eee0eee418bdd2f806bd6ce5ae1c72bf69) )
17311722   ROM_LOAD( "136047-1135.2b",  0x008000, 0x004000, CRC(b1f157d0) SHA1(26355324d49baa02acb777940d7f49d074a75fe5) )
17321723   ROM_LOAD( "136047-2136.2cd", 0x00c000, 0x004000, CRC(00b06bec) SHA1(cd771eea329e0f6ab5bff1035f931800cc5da545) )
r18571r18572
17941785   ROM_LOAD16_BYTE( "136047-1130.6k",  0x050000, 0x010000, CRC(93fba845) SHA1(4de5867272af63be696855f2a4dff99476b213ad) )
17951786   ROM_LOAD16_BYTE( "136047-1133.6r",  0x050001, 0x010000, CRC(53c177be) SHA1(a60c81899944e0dda9886e6697edc4d9309ca8f4) )
17961787
1797   ROM_REGION( 0x10000, "soundcpu", 0 )     /* 64k for 6502 code */
1788   ROM_REGION( 0x10000, "audiocpu", 0 )     /* 64k for 6502 code */
17981789   ROM_LOAD( "136047-1134.2a",  0x004000, 0x004000, CRC(09a418c2) SHA1(017491bbcd0def695a23ab17b1e4fbd1fdf4d5d1) )
17991790   ROM_LOAD( "136047-1135.2b",  0x008000, 0x004000, CRC(b1f157d0) SHA1(26355324d49baa02acb777940d7f49d074a75fe5) )
18001791   ROM_LOAD( "136047-1136.2cd", 0x00c000, 0x004000, CRC(dad40e6d) SHA1(a94bc1b5f0a5218e9e44cd32f2ca6268b48072c2) )
r18571r18572
18631854   ROM_LOAD16_BYTE( "136042-126.6l",   0x070000, 0x008000, CRC(92f5392c) SHA1(064ccf24a68440caa565c0467ba4bf4246133698) )
18641855   ROM_LOAD16_BYTE( "136042-122.6s",   0x070001, 0x008000, CRC(0381f362) SHA1(e33b6d4949cdee33f27cedf00ef20f1ce5011e24) )
18651856
1866   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
1857   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
18671858   ROM_LOAD( "136042-419.2bc",  0x008000, 0x004000, CRC(b277915a) SHA1(e0e8cd713950f45352b7c1de986b5b0b5c1703b3) )
18681859   ROM_LOAD( "136042-420.2d",   0x00c000, 0x004000, CRC(170b2c53) SHA1(c6d5657da29cf637cea940406fcff9a7328964f8) )
18691860
r18571r18572
19101901   ROM_LOAD16_BYTE( "136042-126.6l",   0x070000, 0x008000, CRC(92f5392c) SHA1(064ccf24a68440caa565c0467ba4bf4246133698) )
19111902   ROM_LOAD16_BYTE( "136042-122.6s",   0x070001, 0x008000, CRC(0381f362) SHA1(e33b6d4949cdee33f27cedf00ef20f1ce5011e24) )
19121903
1913   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
1904   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
19141905   ROM_LOAD( "136042-119.2bc",  0x008000, 0x004000, CRC(0c810231) SHA1(a5a637e12df7eae234fdc2d3957d122c196c65cd) )
19151906   ROM_LOAD( "136042-120.2d",   0x00c000, 0x004000, CRC(647b7481) SHA1(51b1b09919eee3d98e65d48e3a2af8321ccf8a02) )
19161907
r18571r18572
19571948   ROM_LOAD16_BYTE( "136042-126.6l",   0x070000, 0x008000, CRC(92f5392c) SHA1(064ccf24a68440caa565c0467ba4bf4246133698) )
19581949   ROM_LOAD16_BYTE( "136042-122.6s",   0x070001, 0x008000, CRC(0381f362) SHA1(e33b6d4949cdee33f27cedf00ef20f1ce5011e24) )
19591950
1960   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
1951   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
19611952   ROM_LOAD( "136042-119.2bc",  0x008000, 0x004000, CRC(0c810231) SHA1(a5a637e12df7eae234fdc2d3957d122c196c65cd) )
19621953   ROM_LOAD( "136042-120.2d",   0x00c000, 0x004000, CRC(647b7481) SHA1(51b1b09919eee3d98e65d48e3a2af8321ccf8a02) )
19631954
r18571r18572
20041995   ROM_LOAD16_BYTE( "136042-126.6l",   0x070000, 0x008000, CRC(92f5392c) SHA1(064ccf24a68440caa565c0467ba4bf4246133698) )
20051996   ROM_LOAD16_BYTE( "136042-122.6s",   0x070001, 0x008000, CRC(0381f362) SHA1(e33b6d4949cdee33f27cedf00ef20f1ce5011e24) )
20061997
2007   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
1998   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
20081999   ROM_LOAD( "136042-119.2bc",  0x008000, 0x004000, CRC(0c810231) SHA1(a5a637e12df7eae234fdc2d3957d122c196c65cd) )
20092000   ROM_LOAD( "136042-120.2d",   0x00c000, 0x004000, CRC(647b7481) SHA1(51b1b09919eee3d98e65d48e3a2af8321ccf8a02) )
20102001
r18571r18572
20512042   ROM_LOAD16_BYTE( "136042-126.6l",   0x070000, 0x008000, CRC(92f5392c) SHA1(064ccf24a68440caa565c0467ba4bf4246133698) )
20522043   ROM_LOAD16_BYTE( "136042-122.6s",   0x070001, 0x008000, CRC(0381f362) SHA1(e33b6d4949cdee33f27cedf00ef20f1ce5011e24) )
20532044
2054   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
2045   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
20552046   ROM_LOAD( "136042-319.2bc",  0x008000, 0x004000, CRC(c7f31c16) SHA1(cfacf22405da5e3cf95059ea6b9677a5a8471496) )
20562047   ROM_LOAD( "136042-320.2d",   0x00c000, 0x004000, CRC(9815ece9) SHA1(95239e15fe3e3f9a66e0f4dae365f763656cb70b) )
20572048
r18571r18572
20982089   ROM_LOAD16_BYTE( "136042-126.6l",   0x070000, 0x008000, CRC(92f5392c) SHA1(064ccf24a68440caa565c0467ba4bf4246133698) )
20992090   ROM_LOAD16_BYTE( "136042-122.6s",   0x070001, 0x008000, CRC(0381f362) SHA1(e33b6d4949cdee33f27cedf00ef20f1ce5011e24) )
21002091
2101   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
2092   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
21022093   ROM_LOAD( "136042-119.2bc",  0x008000, 0x004000, CRC(0c810231) SHA1(a5a637e12df7eae234fdc2d3957d122c196c65cd) )
21032094   ROM_LOAD( "136042-120.2d",   0x00c000, 0x004000, CRC(647b7481) SHA1(51b1b09919eee3d98e65d48e3a2af8321ccf8a02) )
21042095
r18571r18572
21452136   ROM_LOAD16_BYTE( "136042-126.6l",   0x070000, 0x008000, CRC(92f5392c) SHA1(064ccf24a68440caa565c0467ba4bf4246133698) )
21462137   ROM_LOAD16_BYTE( "136042-122.6s",   0x070001, 0x008000, CRC(0381f362) SHA1(e33b6d4949cdee33f27cedf00ef20f1ce5011e24) )
21472138
2148   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
2139   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
21492140   ROM_LOAD( "136042-119.2bc",  0x008000, 0x004000, CRC(0c810231) SHA1(a5a637e12df7eae234fdc2d3957d122c196c65cd) )
21502141   ROM_LOAD( "136042-120.2d",   0x00c000, 0x004000, CRC(647b7481) SHA1(51b1b09919eee3d98e65d48e3a2af8321ccf8a02) )
21512142
r18571r18572
21922183   ROM_LOAD16_BYTE( "136045-1123.6l",  0x070000, 0x008000, CRC(0a4d216a) SHA1(53a4af7673c9dae1f6f2f13dce3c38a31ee12ee2) )
21932184   ROM_LOAD16_BYTE( "136045-1120.6s",  0x070001, 0x008000, CRC(103f3fde) SHA1(9a0e82c3294369858b7a6c978143d8145a8df5a2) )
21942185
2195   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
2186   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
21962187   ROM_LOAD( "136045-1118.2bc", 0x008000, 0x004000, CRC(eba41b2f) SHA1(a0d6e9f4609f2587b0fad6845e75653c10bf4249) )
21972188   ROM_LOAD( "136045-1119.2d",  0x00c000, 0x004000, CRC(9e49043a) SHA1(ec467fe1cd59c51e43c3acd83d300f5b3309a47a) )
21982189
r18571r18572
22372228   ROM_LOAD16_BYTE( "136045-1123.6l",  0x070000, 0x008000, CRC(0a4d216a) SHA1(53a4af7673c9dae1f6f2f13dce3c38a31ee12ee2) )
22382229   ROM_LOAD16_BYTE( "136045-1120.6s",  0x070001, 0x008000, CRC(103f3fde) SHA1(9a0e82c3294369858b7a6c978143d8145a8df5a2) )
22392230
2240   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
2231   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
22412232   ROM_LOAD( "136045-1118.2bc", 0x008000, 0x004000, CRC(eba41b2f) SHA1(a0d6e9f4609f2587b0fad6845e75653c10bf4249) )
22422233   ROM_LOAD( "136045-1119.2d",  0x00c000, 0x004000, CRC(9e49043a) SHA1(ec467fe1cd59c51e43c3acd83d300f5b3309a47a) )
22432234
r18571r18572
22822273   ROM_LOAD16_BYTE( "136045-1123.6l",  0x070000, 0x008000, CRC(0a4d216a) SHA1(53a4af7673c9dae1f6f2f13dce3c38a31ee12ee2) )
22832274   ROM_LOAD16_BYTE( "136045-1120.6s",  0x070001, 0x008000, CRC(103f3fde) SHA1(9a0e82c3294369858b7a6c978143d8145a8df5a2) )
22842275
2285   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
2276   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
22862277   ROM_LOAD( "136045-1118.2bc", 0x008000, 0x004000, CRC(eba41b2f) SHA1(a0d6e9f4609f2587b0fad6845e75653c10bf4249) )
22872278   ROM_LOAD( "136045-1119.2d",  0x00c000, 0x004000, CRC(9e49043a) SHA1(ec467fe1cd59c51e43c3acd83d300f5b3309a47a) )
22882279
r18571r18572
23272318   ROM_LOAD16_BYTE( "136045-1123.6l",  0x070000, 0x008000, CRC(0a4d216a) SHA1(53a4af7673c9dae1f6f2f13dce3c38a31ee12ee2) )
23282319   ROM_LOAD16_BYTE( "136045-1120.6s",  0x070001, 0x008000, CRC(103f3fde) SHA1(9a0e82c3294369858b7a6c978143d8145a8df5a2) )
23292320
2330   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
2321   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
23312322   ROM_LOAD( "136045-1118.2bc", 0x008000, 0x004000, CRC(eba41b2f) SHA1(a0d6e9f4609f2587b0fad6845e75653c10bf4249) )
23322323   ROM_LOAD( "136045-1119.2d",  0x00c000, 0x004000, CRC(9e49043a) SHA1(ec467fe1cd59c51e43c3acd83d300f5b3309a47a) )
23332324
r18571r18572
23722363   ROM_LOAD16_BYTE( "136045-1123.6l",  0x070000, 0x008000, CRC(0a4d216a) SHA1(53a4af7673c9dae1f6f2f13dce3c38a31ee12ee2) )
23732364   ROM_LOAD16_BYTE( "136045-1120.6s",  0x070001, 0x008000, CRC(103f3fde) SHA1(9a0e82c3294369858b7a6c978143d8145a8df5a2) )
23742365
2375   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
2366   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
23762367   ROM_LOAD( "136045-1118.2bc", 0x008000, 0x004000, CRC(eba41b2f) SHA1(a0d6e9f4609f2587b0fad6845e75653c10bf4249) )
23772368   ROM_LOAD( "136045-1119.2d",  0x00c000, 0x004000, CRC(9e49043a) SHA1(ec467fe1cd59c51e43c3acd83d300f5b3309a47a) )
23782369
r18571r18572
24172408   ROM_LOAD16_BYTE( "136045-1123.6l",  0x070000, 0x008000, CRC(0a4d216a) SHA1(53a4af7673c9dae1f6f2f13dce3c38a31ee12ee2) )
24182409   ROM_LOAD16_BYTE( "136045-1120.6s",  0x070001, 0x008000, CRC(103f3fde) SHA1(9a0e82c3294369858b7a6c978143d8145a8df5a2) )
24192410
2420   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
2411   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
24212412   ROM_LOAD( "136045-1118.2bc", 0x008000, 0x004000, CRC(eba41b2f) SHA1(a0d6e9f4609f2587b0fad6845e75653c10bf4249) )
24222413   ROM_LOAD( "136045-1119.2d",  0x00c000, 0x004000, CRC(9e49043a) SHA1(ec467fe1cd59c51e43c3acd83d300f5b3309a47a) )
24232414
r18571r18572
24622453   ROM_LOAD16_BYTE( "136045-1123.6l",  0x070000, 0x008000, CRC(0a4d216a) SHA1(53a4af7673c9dae1f6f2f13dce3c38a31ee12ee2) )
24632454   ROM_LOAD16_BYTE( "136045-1120.6s",  0x070001, 0x008000, CRC(103f3fde) SHA1(9a0e82c3294369858b7a6c978143d8145a8df5a2) )
24642455
2465   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
2456   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
24662457   ROM_LOAD( "136045-1118.2bc", 0x008000, 0x004000, CRC(eba41b2f) SHA1(a0d6e9f4609f2587b0fad6845e75653c10bf4249) )
24672458   ROM_LOAD( "136045-1119.2d",  0x00c000, 0x004000, CRC(9e49043a) SHA1(ec467fe1cd59c51e43c3acd83d300f5b3309a47a) )
24682459
r18571r18572
25072498   ROM_LOAD16_BYTE( "136045-1123.6l",  0x070000, 0x008000, CRC(0a4d216a) SHA1(53a4af7673c9dae1f6f2f13dce3c38a31ee12ee2) )
25082499   ROM_LOAD16_BYTE( "136045-1120.6s",  0x070001, 0x008000, CRC(103f3fde) SHA1(9a0e82c3294369858b7a6c978143d8145a8df5a2) )
25092500
2510   ROM_REGION( 0x10000, "soundcpu", 0 )   /* 64k for 6502 code */
2501   ROM_REGION( 0x10000, "audiocpu", 0 )   /* 64k for 6502 code */
25112502   ROM_LOAD( "136045-1118.2bc", 0x008000, 0x004000, CRC(eba41b2f) SHA1(a0d6e9f4609f2587b0fad6845e75653c10bf4249) )
25122503   ROM_LOAD( "136045-1119.2d",  0x00c000, 0x004000, CRC(9e49043a) SHA1(ec467fe1cd59c51e43c3acd83d300f5b3309a47a) )
25132504
r18571r18572
25522543   ROM_LOAD16_BYTE( "136051-1132.6l",  0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) )
25532544   ROM_LOAD16_BYTE( "136051-1133.6s",  0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) )
25542545
2555   ROM_REGION( 0x10000, "soundcpu", 0 )     /* 64k for 6502 code */
2546   ROM_REGION( 0x10000, "audiocpu", 0 )     /* 64k for 6502 code */
25562547   ROM_LOAD( "136051-5134.2a",  0x004000, 0x004000, CRC(1c8bdeed) SHA1(bbdbbb9a4903f98842d9a697410a2e3a2069284c) )
25572548   ROM_LOAD( "136051-5135.2bc", 0x008000, 0x004000, CRC(ed6adb91) SHA1(b1f1f0d1bda445a53de798fb6847c605afe53e3c) )
25582549   ROM_LOAD( "136051-5136.2d",  0x00c000, 0x004000, CRC(341f8486) SHA1(4cea39c0d8551ce7193e51de341f7297a94b8d9b) )
r18571r18572
26232614   ROM_LOAD16_BYTE( "136051-1132.6l",  0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) )
26242615   ROM_LOAD16_BYTE( "136051-1133.6s",  0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) )
26252616
2626   ROM_REGION( 0x10000, "soundcpu", 0 )     /* 64k for 6502 code */
2617   ROM_REGION( 0x10000, "audiocpu", 0 )     /* 64k for 6502 code */
26272618   ROM_LOAD( "136051-5134.2a",  0x004000, 0x004000, CRC(1c8bdeed) SHA1(bbdbbb9a4903f98842d9a697410a2e3a2069284c) )
26282619   ROM_LOAD( "136051-5135.2bc", 0x008000, 0x004000, CRC(ed6adb91) SHA1(b1f1f0d1bda445a53de798fb6847c605afe53e3c) )
26292620   ROM_LOAD( "136051-5136.2d",  0x00c000, 0x004000, CRC(341f8486) SHA1(4cea39c0d8551ce7193e51de341f7297a94b8d9b) )
r18571r18572
26942685   ROM_LOAD16_BYTE( "136051-1132.6l",  0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) )
26952686   ROM_LOAD16_BYTE( "136051-1133.6s",  0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) )
26962687
2697   ROM_REGION( 0x10000, "soundcpu", 0 )     /* 64k for 6502 code */
2688   ROM_REGION( 0x10000, "audiocpu", 0 )     /* 64k for 6502 code */
26982689   ROM_LOAD( "136051-5134.2a",  0x004000, 0x004000, CRC(1c8bdeed) SHA1(bbdbbb9a4903f98842d9a697410a2e3a2069284c) )
26992690   ROM_LOAD( "136051-5135.2bc", 0x008000, 0x004000, CRC(ed6adb91) SHA1(b1f1f0d1bda445a53de798fb6847c605afe53e3c) )
27002691   ROM_LOAD( "136051-5136.2d",  0x00c000, 0x004000, CRC(341f8486) SHA1(4cea39c0d8551ce7193e51de341f7297a94b8d9b) )
r18571r18572
27652756   ROM_LOAD16_BYTE( "136051-1132.6l",  0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) )
27662757   ROM_LOAD16_BYTE( "136051-1133.6s",  0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) )
27672758
2768   ROM_REGION( 0x10000, "soundcpu", 0 )     /* 64k for 6502 code */
2759   ROM_REGION( 0x10000, "audiocpu", 0 )     /* 64k for 6502 code */
27692760   ROM_LOAD( "136051-5134.2a",  0x004000, 0x004000, CRC(1c8bdeed) SHA1(bbdbbb9a4903f98842d9a697410a2e3a2069284c) )
27702761   ROM_LOAD( "136051-5135.2bc", 0x008000, 0x004000, CRC(ed6adb91) SHA1(b1f1f0d1bda445a53de798fb6847c605afe53e3c) )
27712762   ROM_LOAD( "136051-5136.2d",  0x00c000, 0x004000, CRC(341f8486) SHA1(4cea39c0d8551ce7193e51de341f7297a94b8d9b) )
r18571r18572
28362827   ROM_LOAD16_BYTE( "136051-1132.6l",  0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) )
28372828   ROM_LOAD16_BYTE( "136051-1133.6s",  0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) )
28382829
2839   ROM_REGION( 0x10000, "soundcpu", 0 )     /* 64k for 6502 code */
2830   ROM_REGION( 0x10000, "audiocpu", 0 )     /* 64k for 6502 code */
28402831   ROM_LOAD( "136051-1134.2a",  0x004000, 0x004000, CRC(a65748b9) SHA1(20d51300382543f09e47bee7273b9074e5a4618a) )
28412832   ROM_LOAD( "136051-1135.2bc", 0x008000, 0x004000, CRC(e9692cea) SHA1(2b2d9638e012d326777e2e730e28cbacea6d9a72) )
28422833   ROM_LOAD( "136051-1136.2d",  0x00c000, 0x004000, CRC(92fc7657) SHA1(cfda3a191a5f7ee4157f9d226bcf3dd601cabee1) )
r18571r18572
29072898   ROM_LOAD16_BYTE( "136051-1132.6l",  0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) )
29082899   ROM_LOAD16_BYTE( "136051-1133.6s",  0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) )
29092900
2910   ROM_REGION( 0x10000, "soundcpu", 0 )     /* 64k for 6502 code */
2901   ROM_REGION( 0x10000, "audiocpu", 0 )     /* 64k for 6502 code */
29112902   ROM_LOAD( "136051-1134.2a",  0x004000, 0x004000, CRC(a65748b9) SHA1(20d51300382543f09e47bee7273b9074e5a4618a) )
29122903   ROM_LOAD( "136051-1135.2bc", 0x008000, 0x004000, CRC(e9692cea) SHA1(2b2d9638e012d326777e2e730e28cbacea6d9a72) )
29132904   ROM_LOAD( "136051-1136.2d",  0x00c000, 0x004000, CRC(92fc7657) SHA1(cfda3a191a5f7ee4157f9d226bcf3dd601cabee1) )
r18571r18572
29782969   ROM_LOAD16_BYTE( "136051-1132.6l",  0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) )
29792970   ROM_LOAD16_BYTE( "136051-1133.6s",  0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) )
29802971
2981   ROM_REGION( 0x10000, "soundcpu", 0 )     /* 64k for 6502 code */
2972   ROM_REGION( 0x10000, "audiocpu", 0 )     /* 64k for 6502 code */
29822973   ROM_LOAD( "136051-1134.2a",  0x004000, 0x004000, CRC(a65748b9) SHA1(20d51300382543f09e47bee7273b9074e5a4618a) )
29832974   ROM_LOAD( "136051-1135.2bc", 0x008000, 0x004000, CRC(e9692cea) SHA1(2b2d9638e012d326777e2e730e28cbacea6d9a72) )
29842975   ROM_LOAD( "136051-1136.2d",  0x00c000, 0x004000, CRC(92fc7657) SHA1(cfda3a191a5f7ee4157f9d226bcf3dd601cabee1) )
r18571r18572
30493040   ROM_LOAD16_BYTE( "136051-1132.6l",  0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) )
30503041   ROM_LOAD16_BYTE( "136051-1133.6s",  0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) )
30513042
3052   ROM_REGION( 0x10000, "soundcpu", 0 )     /* 64k for 6502 code */
3043   ROM_REGION( 0x10000, "audiocpu", 0 )     /* 64k for 6502 code */
30533044   ROM_LOAD( "136051-4134.2a",  0x004000, 0x004000, CRC(45e03b0e) SHA1(d58f5e1095fd6a7c0253fcc9f0e55812c1677387) )
30543045   ROM_LOAD( "136051-4135.2bc", 0x008000, 0x004000, CRC(b4ca24b2) SHA1(86461da310b334f6b32c0e079de6852792284cc6) )
30553046   ROM_LOAD( "136051-4136.2d",  0x00c000, 0x004000, CRC(11efaabf) SHA1(76446b09bf7cacd713ab88d58793460c9d1a8b9b) )
r18571r18572
31203111   ROM_LOAD16_BYTE( "136051-1132.6l",  0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) )
31213112   ROM_LOAD16_BYTE( "136051-1133.6s",  0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) )
31223113
3123   ROM_REGION( 0x10000, "soundcpu", 0 )     /* 64k for 6502 code */
3114   ROM_REGION( 0x10000, "audiocpu", 0 )     /* 64k for 6502 code */
31243115   ROM_LOAD( "136051-5134.2a",  0x004000, 0x004000, CRC(1c8bdeed) SHA1(bbdbbb9a4903f98842d9a697410a2e3a2069284c) )
31253116   ROM_LOAD( "136051-5135.2bc", 0x008000, 0x004000, CRC(ed6adb91) SHA1(b1f1f0d1bda445a53de798fb6847c605afe53e3c) )
31263117   ROM_LOAD( "136051-5136.2d",  0x00c000, 0x004000, CRC(341f8486) SHA1(4cea39c0d8551ce7193e51de341f7297a94b8d9b) )
trunk/src/mame/drivers/shuuz.c
r18571r18572
3131 *
3232 *************************************/
3333
34static void update_interrupts(running_machine &machine)
34void shuuz_state::update_interrupts()
3535{
36   shuuz_state *state = machine.driver_data<shuuz_state>();
37   machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
36   subdevice("maincpu")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
3837}
3938
4039
r18571r18572
6463 *
6564 *************************************/
6665
67MACHINE_START_MEMBER(shuuz_state,shuuz)
68{
69   atarigen_init(machine());
70}
71
72
7366MACHINE_RESET_MEMBER(shuuz_state,shuuz)
7467{
75
76   atarigen_eeprom_reset(this);
77   atarigen_interrupt_reset(this, update_interrupts);
68   atarigen_state::machine_reset();
7869   atarivc_reset(*machine().primary_screen, m_atarivc_eof_data, 1);
7970}
8071
r18571r18572
263254   MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2)
264255   MCFG_CPU_PROGRAM_MAP(main_map)
265256
266   MCFG_MACHINE_START_OVERRIDE(shuuz_state,shuuz)
267257   MCFG_MACHINE_RESET_OVERRIDE(shuuz_state,shuuz)
268258   MCFG_NVRAM_ADD_1FILL("eeprom")
269259
trunk/src/mame/drivers/atarigt.c
r18571r18572
4747 *
4848 *************************************/
4949
50static void update_interrupts(running_machine &machine)
50void atarigt_state::update_interrupts()
5151{
52   atarigt_state *state = machine.driver_data<atarigt_state>();
53   machine.device("maincpu")->execute().set_input_line(3, state->m_sound_int_state    ? ASSERT_LINE : CLEAR_LINE);
54   machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state    ? ASSERT_LINE : CLEAR_LINE);
55   machine.device("maincpu")->execute().set_input_line(6, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
52   machine().device("maincpu")->execute().set_input_line(3, m_sound_int_state    ? ASSERT_LINE : CLEAR_LINE);
53   machine().device("maincpu")->execute().set_input_line(4, m_video_int_state    ? ASSERT_LINE : CLEAR_LINE);
54   machine().device("maincpu")->execute().set_input_line(6, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
5655}
5756
5857
59MACHINE_START_MEMBER(atarigt_state,atarigt)
60{
61   atarigen_init(machine());
62}
63
64
6558MACHINE_RESET_MEMBER(atarigt_state,atarigt)
6659{
67
68   atarigen_eeprom_reset(this);
69   atarigen_interrupt_reset(this, update_interrupts);
70   atarigen_scanline_timer_reset(*machine().primary_screen, atarigt_scanline_update, 8);
60   atarigen_state::machine_reset();
61   scanline_timer_reset(*machine().primary_screen, 8);
7162}
7263
7364
r18571r18572
612603   AM_RANGE(0xd80000, 0xdfffff) AM_READWRITE(colorram_protection_r, colorram_protection_w) AM_SHARE("colorram")
613604   AM_RANGE(0xe04000, 0xe04003) AM_WRITE(led_w)
614605   AM_RANGE(0xe08000, 0xe08003) AM_WRITE(latch_w)
615   AM_RANGE(0xe0a000, 0xe0a003) AM_WRITE_LEGACY(atarigen_scanline_int_ack32_w)
606   AM_RANGE(0xe0a000, 0xe0a003) AM_WRITE16(scanline_int_ack_w, 0xffffffff)
616607   AM_RANGE(0xe0c000, 0xe0c003) AM_WRITE_LEGACY(atarigen_video_int_ack32_w)
617608   AM_RANGE(0xe0e000, 0xe0e003) AM_WRITENOP//watchdog_reset_w },
618609   AM_RANGE(0xe80000, 0xe80003) AM_READ_PORT("P1_P2")
r18571r18572
811802   MCFG_CPU_ADD("maincpu", M68EC020, ATARI_CLOCK_50MHz/2)
812803   MCFG_CPU_PROGRAM_MAP(main_map)
813804   MCFG_CPU_VBLANK_INT("screen", atarigen_video_int_gen)
814   MCFG_CPU_PERIODIC_INT(atarigen_scanline_int_gen, 250)
805   MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, scanline_int_gen, 250)
815806
816   MCFG_MACHINE_START_OVERRIDE(atarigt_state,atarigt)
817807   MCFG_MACHINE_RESET_OVERRIDE(atarigt_state,atarigt)
818808   MCFG_NVRAM_ADD_1FILL("eeprom")
819809
trunk/src/mame/drivers/cyberbal.c
r18571r18572
3636 *
3737 *************************************/
3838
39static void update_interrupts(running_machine &machine)
39void cyberbal_state::update_interrupts()
4040{
41   cyberbal_state *state = machine.driver_data<cyberbal_state>();
42   machine.device("maincpu")->execute().set_input_line(1, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
43   machine.device("extra")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
41   if (subdevice("extra") != NULL)
42   {
43      subdevice("maincpu")->execute().set_input_line(1, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
44      subdevice("extra")->execute().set_input_line(1, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
45   }
46   else
47   {
48      subdevice("maincpu")->execute().set_input_line(1, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
49      subdevice("maincpu")->execute().set_input_line(3, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
50   }
4451}
4552
4653
4754MACHINE_START_MEMBER(cyberbal_state,cyberbal)
4855{
49   atarigen_init(machine());
56   atarigen_state::machine_start();
5057
5158   save_item(NAME(m_fast_68k_int));
5259   save_item(NAME(m_io_68k_int));
r18571r18572
5966
6067MACHINE_RESET_MEMBER(cyberbal_state,cyberbal)
6168{
69   atarigen_state::machine_reset();
70   scanline_timer_reset(*machine().primary_screen, 8);
6271
63   atarigen_eeprom_reset(this);
64   atarigen_slapstic_reset(this);
65   atarigen_interrupt_reset(this, update_interrupts);
66   atarigen_scanline_timer_reset(*machine().primary_screen, cyberbal_scanline_update, 8);
67   atarigen_sound_io_reset(machine().device("audiocpu"));
68
6972   cyberbal_sound_reset(machine());
7073
7174   /* Extra CPU (second M68k) doesn't run until reset */
r18571r18572
7376}
7477
7578
76static void cyberbal2p_update_interrupts(running_machine &machine)
77{
78   cyberbal_state *state = machine.driver_data<cyberbal_state>();
79   machine.device("maincpu")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
80   machine.device("maincpu")->execute().set_input_line(3, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
81}
82
83
8479MACHINE_RESET_MEMBER(cyberbal_state,cyberbal2p)
8580{
86
87   atarigen_eeprom_reset(this);
88   atarigen_interrupt_reset(this, cyberbal2p_update_interrupts);
89   atarigen_scanline_timer_reset(*machine().primary_screen, cyberbal_scanline_update, 8);
90   atarijsa_reset();
81   atarigen_state::machine_reset();
82   scanline_timer_reset(*machine().primary_screen, 8);
83   atarijsa_reset(machine());
9184}
9285
9386
r18571r18572
145138static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, cyberbal_state )
146139   AM_RANGE(0x000000, 0x03ffff) AM_ROM
147140   AM_RANGE(0xfc0000, 0xfc0fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom")
148   AM_RANGE(0xfc8000, 0xfcffff) AM_READ_LEGACY(atarigen_sound_upper_r)
141   AM_RANGE(0xfc8000, 0xfcffff) AM_READ8(sound_r, 0xff00)
149142   AM_RANGE(0xfd0000, 0xfd1fff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w)
150   AM_RANGE(0xfd2000, 0xfd3fff) AM_WRITE_LEGACY(atarigen_sound_reset_w)
143   AM_RANGE(0xfd2000, 0xfd3fff) AM_WRITE(sound_reset_w)
151144   AM_RANGE(0xfd4000, 0xfd5fff) AM_WRITE(watchdog_reset16_w)
152145   AM_RANGE(0xfd6000, 0xfd7fff) AM_WRITE(p2_reset_w)
153   AM_RANGE(0xfd8000, 0xfd9fff) AM_WRITE_LEGACY(atarigen_sound_upper_w)
146   AM_RANGE(0xfd8000, 0xfd9fff) AM_WRITE8(sound_w, 0xff00)
154147   AM_RANGE(0xfe0000, 0xfe0fff) AM_READ(special_port0_r)
155148   AM_RANGE(0xfe1000, 0xfe1fff) AM_READ_PORT("IN1")
156149   AM_RANGE(0xfe8000, 0xfe8fff) AM_RAM_WRITE_LEGACY(cyberbal_paletteram_1_w) AM_SHARE("paletteram_1")
r18571r18572
206199   AM_RANGE(0x0000, 0x1fff) AM_RAM
207200   AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
208201   AM_RANGE(0x2800, 0x2801) AM_WRITE(cyberbal_sound_68k_6502_w)
209   AM_RANGE(0x2802, 0x2803) AM_READWRITE_LEGACY(atarigen_6502_irq_ack_r, atarigen_6502_irq_ack_w)
210   AM_RANGE(0x2804, 0x2805) AM_WRITE_LEGACY(atarigen_6502_sound_w)
202   AM_RANGE(0x2802, 0x2803) AM_READWRITE(m6502_irq_ack_r, m6502_irq_ack_w)
203   AM_RANGE(0x2804, 0x2805) AM_WRITE(m6502_sound_w)
211204   AM_RANGE(0x2806, 0x2807) AM_WRITE(cyberbal_sound_bank_select_w)
212   AM_RANGE(0x2c00, 0x2c01) AM_READ_LEGACY(atarigen_6502_sound_r)
205   AM_RANGE(0x2c00, 0x2c01) AM_READ(m6502_sound_r)
213206   AM_RANGE(0x2c02, 0x2c03) AM_READ(cyberbal_special_port3_r)
214207   AM_RANGE(0x2c04, 0x2c05) AM_READ(cyberbal_sound_68k_6502_r)
215208   AM_RANGE(0x2c06, 0x2c07) AM_READ(cyberbal_sound_6502_stat_r)
r18571r18572
247240   AM_RANGE(0xfc0000, 0xfc0003) AM_READ_PORT("IN0")
248241   AM_RANGE(0xfc2000, 0xfc2003) AM_READ_PORT("IN1")
249242   AM_RANGE(0xfc4000, 0xfc4003) AM_READ(special_port2_r)
250   AM_RANGE(0xfc6000, 0xfc6003) AM_READ_LEGACY(atarigen_sound_upper_r)
243   AM_RANGE(0xfc6000, 0xfc6003) AM_READ8(sound_r, 0xff00)
251244   AM_RANGE(0xfc8000, 0xfc8fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom")
252245   AM_RANGE(0xfca000, 0xfcafff) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram")
253246   AM_RANGE(0xfd0000, 0xfd0003) AM_WRITE_LEGACY(atarigen_eeprom_enable_w)
254   AM_RANGE(0xfd2000, 0xfd2003) AM_WRITE_LEGACY(atarigen_sound_reset_w)
247   AM_RANGE(0xfd2000, 0xfd2003) AM_WRITE(sound_reset_w)
255248   AM_RANGE(0xfd4000, 0xfd4003) AM_WRITE(watchdog_reset16_w)
256249   AM_RANGE(0xfd6000, 0xfd6003) AM_WRITE_LEGACY(atarigen_video_int_ack_w)
257   AM_RANGE(0xfd8000, 0xfd8003) AM_WRITE_LEGACY(atarigen_sound_upper_w)
250   AM_RANGE(0xfd8000, 0xfd8003) AM_WRITE8(sound_w, 0xff00)
258251   AM_RANGE(0xfe0000, 0xfe0003) AM_READ(sound_state_r)
259252   AM_RANGE(0xff0000, 0xff1fff) AM_RAM_WRITE_LEGACY(atarigen_playfield_w) AM_SHARE("playfield")
260253   AM_RANGE(0xff2000, 0xff2fff) AM_RAM_WRITE_LEGACY(atarigen_alpha_w) AM_SHARE("alpha")
r18571r18572
419412
420413   MCFG_CPU_ADD("audiocpu", M6502, ATARI_CLOCK_14MHz/8)
421414   MCFG_CPU_PROGRAM_MAP(sound_map)
422   MCFG_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)ATARI_CLOCK_14MHz/4/4/16/16/14)
415   MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)ATARI_CLOCK_14MHz/4/4/16/16/14)
423416
424417   MCFG_CPU_ADD("extra", M68000, ATARI_CLOCK_14MHz/2)
425418   MCFG_CPU_PROGRAM_MAP(extra_map)
r18571r18572
988981
989982DRIVER_INIT_MEMBER(cyberbal_state,cyberbal)
990983{
991   atarigen_slapstic_init(machine().device("maincpu"), 0x018000, 0, 0);
984   slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x018000, 0, 0);
992985}
993986
994987
995988DRIVER_INIT_MEMBER(cyberbal_state,cyberbalt)
996989{
997   atarigen_slapstic_init(machine().device("maincpu"), 0x018000, 0, 116);
990   slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x018000, 0, 116);
998991}
999992
1000993
trunk/src/mame/drivers/badlands.c
r18571r18572
177177 *
178178 *************************************/
179179
180static void update_interrupts(running_machine &machine)
180void badlands_state::update_interrupts()
181181{
182   badlands_state *state = machine.driver_data<badlands_state>();
183   machine.device("maincpu")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
184   machine.device("maincpu")->execute().set_input_line(2, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
182   machine().device("maincpu")->execute().set_input_line(1, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
183   machine().device("maincpu")->execute().set_input_line(2, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
185184}
186185
187186
188static void scanline_update(screen_device &screen, int scanline)
187void badlands_state::scanline_update(screen_device &screen, int scanline)
189188{
190   address_space &space = screen.machine().device("audiocpu")->memory().space(AS_PROGRAM);
189   address_space &space = subdevice("audiocpu")->memory().space(AS_PROGRAM);
191190
192191   /* sound IRQ is on 32V */
193192   if (scanline & 32)
194      atarigen_6502_irq_ack_r(space, 0);
195   else if (!(screen.machine().root_device().ioport("FE4000")->read() & 0x40))
196      atarigen_6502_irq_gen(screen.machine().device("audiocpu"));
193      m6502_irq_ack_r(space, 0);
194   else if (!(ioport("FE4000")->read() & 0x40))
195      m6502_irq_gen(*screen.machine().device("audiocpu"));
197196}
198197
199198
200199MACHINE_START_MEMBER(badlands_state,badlands)
201200{
201   atarigen_state::machine_start();
202202
203   atarigen_init(machine());
204
205203   save_item(NAME(m_pedal_value));
206204}
207205
208206
209207MACHINE_RESET_MEMBER(badlands_state,badlands)
210208{
211
212209   m_pedal_value[0] = m_pedal_value[1] = 0x80;
213210
214   atarigen_eeprom_reset(this);
215   atarigen_interrupt_reset(this, update_interrupts);
216   atarigen_scanline_timer_reset(*machine().primary_screen, scanline_update, 32);
211   atarigen_state::machine_reset();
212   scanline_timer_reset(*machine().primary_screen, 32);
217213
218   atarigen_sound_io_reset(machine().device("audiocpu"));
219214   memcpy(m_bank_base, &m_bank_source_data[0x0000], 0x1000);
220215}
221216
r18571r18572
289284         break;
290285
291286      case 0x002:      /* /RDP */
292         result = atarigen_6502_sound_r(space, offset);
287         result = m6502_sound_r(space, offset);
293288         break;
294289
295290      case 0x004:      /* /RDIO */
r18571r18572
311306         break;
312307
313308      case 0x006:      /* /IRQACK */
314         atarigen_6502_irq_ack_r(space, 0);
309         m6502_irq_ack_r(space, 0);
315310         break;
316311
317312      case 0x200:      /* /VOICE */
r18571r18572
328323
329324WRITE8_MEMBER(badlands_state::audio_io_w)
330325{
331
332326   switch (offset & 0x206)
333327   {
334328      case 0x000:      /* n/c */
r18571r18572
338332         break;
339333
340334      case 0x006:      /* /IRQACK */
341         atarigen_6502_irq_ack_r(space, 0);
335         m6502_irq_ack_r(space, 0);
342336         break;
343337
344338      case 0x200:      /* n/c */
r18571r18572
346340         break;
347341
348342      case 0x202:      /* /WRP */
349         atarigen_6502_sound_w(space, offset, data);
343         m6502_sound_w(space, offset, data);
350344         break;
351345
352346      case 0x204:      /* WRIO */
r18571r18572
376370
377371static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, badlands_state )
378372   AM_RANGE(0x000000, 0x03ffff) AM_ROM
379   AM_RANGE(0xfc0000, 0xfc1fff) AM_READ(sound_busy_r) AM_WRITE_LEGACY(atarigen_sound_reset_w)
373   AM_RANGE(0xfc0000, 0xfc1fff) AM_READ(sound_busy_r) AM_WRITE(sound_reset_w)
380374   AM_RANGE(0xfd0000, 0xfd1fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom")
381375   AM_RANGE(0xfe0000, 0xfe1fff) AM_WRITE(watchdog_reset16_w)
382376   AM_RANGE(0xfe2000, 0xfe3fff) AM_WRITE_LEGACY(atarigen_video_int_ack_w)
r18571r18572
385379   AM_RANGE(0xfe6002, 0xfe6003) AM_READ_PORT("FE6002")
386380   AM_RANGE(0xfe6004, 0xfe6005) AM_READ(pedal_0_r)
387381   AM_RANGE(0xfe6006, 0xfe6007) AM_READ(pedal_1_r)
388   AM_RANGE(0xfe8000, 0xfe9fff) AM_WRITE_LEGACY(atarigen_sound_upper_w)
389   AM_RANGE(0xfea000, 0xfebfff) AM_READ_LEGACY(atarigen_sound_upper_r)
382   AM_RANGE(0xfe8000, 0xfe9fff) AM_WRITE8(sound_w, 0xff00)
383   AM_RANGE(0xfea000, 0xfebfff) AM_READ8(sound_r, 0xff00)
390384   AM_RANGE(0xfec000, 0xfedfff) AM_WRITE_LEGACY(badlands_pf_bank_w)
391385   AM_RANGE(0xfee000, 0xfeffff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w)
392386   AM_RANGE(0xffc000, 0xffc3ff) AM_RAM_WRITE_LEGACY(atarigen_expanded_666_paletteram_w) AM_SHARE("paletteram")
r18571r18572
672666   GFXDECODE_ENTRY( "gfx2", 0, molayout,  128, 8 )
673667GFXDECODE_END
674668
675static void update_interrupts_bootleg(running_machine &machine)
676{
677   badlands_state *state = machine.driver_data<badlands_state>();
678   machine.device("maincpu")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
679}
680669
681
682static void scanline_update_bootleg(screen_device &screen, int scanline)
683{
684   /* sound IRQ is on 32V */
685//  if (scanline & 32)
686//      atarigen_6502_irq_ack_r(screen.machine(), 0);
687//  else if (!(machine.root_device().ioport("FE4000")->read() & 0x40))
688//      atarigen_6502_irq_gen(screen.machine().device("audiocpu"));
689}
690
691
692
693670MACHINE_RESET_MEMBER(badlands_state,badlandsb)
694671{
695672//  m_pedal_value[0] = m_pedal_value[1] = 0x80;
696673
697   atarigen_eeprom_reset(this);
698   atarigen_interrupt_reset(this, update_interrupts_bootleg);
699   atarigen_scanline_timer_reset(*machine().primary_screen, scanline_update_bootleg, 32);
674   atarigen_state::machine_reset();
675   scanline_timer_reset(*machine().primary_screen, 32);
700676
701//  atarigen_sound_io_reset(machine().device("audiocpu"));
702677//  memcpy(m_bank_base, &m_bank_source_data[0x0000], 0x1000);
703678}
704679
trunk/src/mame/drivers/offtwall.c
r18571r18572
3131 *
3232 *************************************/
3333
34static void update_interrupts(running_machine &machine)
34void offtwall_state::update_interrupts()
3535{
36   offtwall_state *state = machine.driver_data<offtwall_state>();
37   machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
38   machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
36   subdevice("maincpu")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
37   subdevice("maincpu")->execute().set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
3938}
4039
4140
r18571r18572
4645 *
4746 *************************************/
4847
49MACHINE_START_MEMBER(offtwall_state,offtwall)
50{
51   atarigen_init(machine());
52}
53
54
5548MACHINE_RESET_MEMBER(offtwall_state,offtwall)
5649{
57
58   atarigen_eeprom_reset(this);
59   atarigen_interrupt_reset(this, update_interrupts);
50   atarigen_state::machine_reset();
6051   atarivc_reset(*machine().primary_screen, m_atarivc_eof_data, 1);
61   atarijsa_reset();
52   atarijsa_reset(machine());
6253}
6354
6455
r18571r18572
10394   {
10495      /* bit 4 resets the sound CPU */
10596      machine().device("jsa")->execute().set_input_line(INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
106      if (!(data & 0x10)) atarijsa_reset();
97      if (!(data & 0x10)) atarijsa_reset(machine());
10798   }
10899
109100   logerror("sound control = %04X\n", data);
r18571r18572
281272   AM_RANGE(0x260020, 0x260021) AM_READ_PORT("260020")
282273   AM_RANGE(0x260022, 0x260023) AM_READ_PORT("260022")
283274   AM_RANGE(0x260024, 0x260025) AM_READ_PORT("260024")
284   AM_RANGE(0x260030, 0x260031) AM_READ_LEGACY(atarigen_sound_r)
285   AM_RANGE(0x260040, 0x260041) AM_WRITE_LEGACY(atarigen_sound_w)
275   AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff)
276   AM_RANGE(0x260040, 0x260041) AM_WRITE8(sound_w, 0x00ff)
286277   AM_RANGE(0x260050, 0x260051) AM_WRITE(io_latch_w)
287278   AM_RANGE(0x260060, 0x260061) AM_WRITE_LEGACY(atarigen_eeprom_enable_w)
288279   AM_RANGE(0x2a0000, 0x2a0001) AM_WRITE(watchdog_reset16_w)
r18571r18572
404395   MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2)
405396   MCFG_CPU_PROGRAM_MAP(main_map)
406397
407   MCFG_MACHINE_START_OVERRIDE(offtwall_state,offtwall)
408398   MCFG_MACHINE_RESET_OVERRIDE(offtwall_state,offtwall)
409399   MCFG_NVRAM_ADD_1FILL("eeprom")
410400
trunk/src/mame/drivers/rampart.c
r18571r18572
3939 *
4040 *************************************/
4141
42static void update_interrupts(running_machine &machine)
42void rampart_state::update_interrupts()
4343{
44   rampart_state *state = machine.driver_data<rampart_state>();
45   machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
44   subdevice("maincpu")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
4645}
4746
4847
49static void scanline_update(screen_device &screen, int scanline)
48void rampart_state::scanline_update(screen_device &screen, int scanline)
5049{
5150   /* generate 32V signals */
5251   if ((scanline & 32) == 0)
53      atarigen_scanline_int_gen(screen.machine().device("maincpu"));
52      scanline_int_gen(*subdevice("maincpu"));
5453}
5554
5655
r18571r18572
6160 *
6261 *************************************/
6362
64MACHINE_START_MEMBER(rampart_state,rampart)
65{
66   atarigen_init(machine());
67}
68
69
7063MACHINE_RESET_MEMBER(rampart_state,rampart)
7164{
72
73   atarigen_eeprom_reset(this);
74   atarigen_slapstic_reset(this);
75   atarigen_interrupt_reset(this, update_interrupts);
76   atarigen_scanline_timer_reset(*machine().primary_screen, scanline_update, 32);
65   atarigen_state::machine_reset();
66   scanline_timer_reset(*machine().primary_screen, 32);
7767}
7868
7969
r18571r18572
114104   /* lower byte being modified? */
115105   if (ACCESSING_BITS_0_7)
116106   {
117      atarigen_set_oki6295_vol(machine(), (data & 0x0020) ? 100 : 0);
107      set_oki6295_volume((data & 0x0020) ? 100 : 0);
118108      if (!(data & 0x0010))
119109         machine().device("oki")->reset();
120      atarigen_set_ym2413_vol(machine(), ((data >> 1) & 7) * 100 / 7);
110      set_ym2413_volume(((data >> 1) & 7) * 100 / 7);
121111      if (!(data & 0x0001))
122112         machine().device("ymsnd")->reset();
123113   }
r18571r18572
155145   AM_RANGE(0x6c0004, 0x6c0005) AM_MIRROR(0x019ff8) AM_READ_PORT("TRACK2")
156146   AM_RANGE(0x6c0006, 0x6c0007) AM_MIRROR(0x019ff8) AM_READ_PORT("TRACK3")
157147   AM_RANGE(0x726000, 0x726001) AM_MIRROR(0x019ffe) AM_WRITE(watchdog_reset16_w)
158   AM_RANGE(0x7e6000, 0x7e6001) AM_MIRROR(0x019ffe) AM_WRITE_LEGACY(atarigen_scanline_int_ack_w)
148   AM_RANGE(0x7e6000, 0x7e6001) AM_MIRROR(0x019ffe) AM_WRITE(scanline_int_ack_w)
159149ADDRESS_MAP_END
160150
161151
r18571r18572
348338   MCFG_CPU_PROGRAM_MAP(main_map)
349339   MCFG_CPU_VBLANK_INT("screen", atarigen_video_int_gen)
350340
351   MCFG_MACHINE_START_OVERRIDE(rampart_state,rampart)
352341   MCFG_MACHINE_RESET_OVERRIDE(rampart_state,rampart)
353342   MCFG_NVRAM_ADD_1FILL("eeprom")
354343   MCFG_WATCHDOG_VBLANK_INIT(8)
r18571r18572
481470   UINT8 *rom = machine().root_device().memregion("maincpu")->base();
482471
483472   memcpy(&rom[0x140000], &rom[0x40000], 0x8000);
484   atarigen_slapstic_init(machine().device("maincpu"), 0x140000, 0x438000, 118);
473   slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x140000, 0x438000, 118);
485474}
486475
487476
trunk/src/mame/audio/atarijsa.c
r18571r18572
150150      jsacpu->space(AS_PROGRAM).install_readwrite_handler(0x2c00, 0x2c0f, read8_delegate(FUNC(pokey_device::read),pokey), write8_delegate(FUNC(pokey_device::write),pokey));
151151
152152   init_save_state(machine);
153   atarijsa_reset();
153   atarijsa_reset(machine);
154154
155155   /* initialize JSA III ADPCM */
156156   {
r18571r18572
175175}
176176
177177
178void atarijsa_reset(void)
178void atarijsa_reset(running_machine &machine)
179179{
180180   /* reset the sound I/O system */
181   atarigen_sound_io_reset(jsacpu);
181   machine.driver_data<atarigen_state>()->sound_io_reset();
182182
183183   /* reset the static states */
184184   overall_volume = 100;
r18571r18572
213213         break;
214214
215215      case 0x002:      /* /RDP */
216         result = atarigen_6502_sound_r(space, offset);
216         result = atarigen->m6502_sound_r(space, offset);
217217         break;
218218
219219      case 0x004:      /* /RDIO */
r18571r18572
238238         break;
239239
240240      case 0x006:      /* /IRQACK */
241         atarigen_6502_irq_ack_r(space, 0);
241         atarigen->m6502_irq_ack_r(space, 0);
242242         break;
243243
244244      case 0x200:      /* /VOICE */
r18571r18572
264264         break;
265265
266266      case 0x006:      /* /IRQACK */
267         atarigen_6502_irq_ack_r(space, 0);
267         space.machine().driver_data<atarigen_state>()->m6502_irq_ack_r(space, 0);
268268         break;
269269
270270      case 0x200:      /* /VOICE */
r18571r18572
273273         break;
274274
275275      case 0x202:      /* /WRP */
276         atarigen_6502_sound_w(space, offset, data);
276         space.machine().driver_data<atarigen_state>()->m6502_sound_w(space, offset, data);
277277         break;
278278
279279      case 0x204:      /* WRIO */
r18571r18572
346346         break;
347347
348348      case 0x002:      /* /RDP */
349         result = atarigen_6502_sound_r(space, offset);
349         result = atarigen->m6502_sound_r(space, offset);
350350         break;
351351
352352      case 0x004:      /* /RDIO */
r18571r18572
367367         break;
368368
369369      case 0x006:      /* /IRQACK */
370         atarigen_6502_irq_ack_r(space, 0);
370         atarigen->m6502_irq_ack_r(space, 0);
371371         break;
372372
373373      case 0x200:      /* /WRV */
r18571r18572
393393         break;
394394
395395      case 0x006:      /* /IRQACK */
396         atarigen_6502_irq_ack_r(space, 0);
396         space.machine().driver_data<atarigen_state>()->m6502_irq_ack_r(space, 0);
397397         break;
398398
399399      case 0x200:      /* /WRV */
r18571r18572
404404         break;
405405
406406      case 0x202:      /* /WRP */
407         atarigen_6502_sound_w(space, offset, data);
407         space.machine().driver_data<atarigen_state>()->m6502_sound_w(space, offset, data);
408408         break;
409409
410410      case 0x204:      /* /WRIO */
r18571r18572
469469         break;
470470
471471      case 0x002:      /* /RDP */
472         result = atarigen_6502_sound_r(space, offset);
472         result = atarigen->m6502_sound_r(space, offset);
473473         break;
474474
475475      case 0x004:      /* /RDIO */
r18571r18572
490490         break;
491491
492492      case 0x006:      /* /IRQACK */
493         atarigen_6502_irq_ack_r(space, 0);
493         atarigen->m6502_irq_ack_r(space, 0);
494494         break;
495495
496496      case 0x200:      /* /WRV */
r18571r18572
520520         break;
521521
522522      case 0x006:      /* /IRQACK */
523         atarigen_6502_irq_ack_r(space, 0);
523         space.machine().driver_data<atarigen_state>()->m6502_irq_ack_r(space, 0);
524524         break;
525525
526526      case 0x200:      /* /WRV */
r18571r18572
529529         break;
530530
531531      case 0x202:      /* /WRP */
532         atarigen_6502_sound_w(space, offset, data);
532         space.machine().driver_data<atarigen_state>()->m6502_sound_w(space, offset, data);
533533         break;
534534
535535      case 0x204:      /* /WRIO */
r18571r18572
603603         break;
604604
605605      case 0x002:      /* /RDP */
606         result = atarigen_6502_sound_r(space, offset);
606         result = atarigen->m6502_sound_r(space, offset);
607607         break;
608608
609609      case 0x004:      /* /RDIO */
r18571r18572
624624         break;
625625
626626      case 0x006:      /* /IRQACK */
627         atarigen_6502_irq_ack_r(space, 0);
627         atarigen->m6502_irq_ack_r(space, 0);
628628         break;
629629
630630      case 0x200:      /* /WRV */
r18571r18572
654654         break;
655655
656656      case 0x006:      /* /IRQACK */
657         atarigen_6502_irq_ack_r(space, 0);
657         space.machine().driver_data<atarigen_state>()->m6502_irq_ack_r(space, 0);
658658         break;
659659
660660      case 0x200:      /* /WRV */
r18571r18572
663663         break;
664664
665665      case 0x202:      /* /WRP */
666         atarigen_6502_sound_w(space, offset, data);
666         space.machine().driver_data<atarigen_state>()->m6502_sound_w(space, offset, data);
667667         break;
668668
669669      case 0x204:      /* /WRIO */
r18571r18572
732732
733733static void update_all_volumes(running_machine &machine )
734734{
735   if (pokey != NULL) atarigen_set_pokey_vol(machine, (overall_volume * pokey_volume / 100) * ym2151_ct1);
735   atarigen_state *state = machine.driver_data<atarigen_state>();
736   if (pokey != NULL) state->set_pokey_volume((overall_volume * pokey_volume / 100) * ym2151_ct1);
736737   //if (pokey != NULL) atarigen_set_pokey_stereo_vol(machine, (overall_volume * pokey_volume / 100) * ym2151_ct1, (overall_volume * pokey_volume / 100) * ym2151_ct2);
737   if (ym2151 != NULL) atarigen_set_ym2151_vol(machine, overall_volume * ym2151_volume / 100);
738   if (tms5220 != NULL) atarigen_set_tms5220_vol(machine, (overall_volume * tms5220_volume / 100) * ym2151_ct1);
738   if (ym2151 != NULL) state->set_ym2151_volume(overall_volume * ym2151_volume / 100);
739   if (tms5220 != NULL) state->set_tms5220_volume((overall_volume * tms5220_volume / 100) * ym2151_ct1);
739740   //if (tms5220 != NULL) atarigen_set_tms5220_stereo_vol(machine, (overall_volume * tms5220_volume / 100) * ym2151_ct1, (overall_volume * tms5220_volume / 100) * ym2151_ct2);
740   if (oki6295 != NULL || oki6295_l != NULL || oki6295_r != NULL) atarigen_set_oki6295_vol(machine, overall_volume * oki6295_volume / 100);
741   if (oki6295 != NULL || oki6295_l != NULL || oki6295_r != NULL) state->set_oki6295_volume(overall_volume * oki6295_volume / 100);
741742}
742743
743744
r18571r18572
794795   /* basic machine hardware */
795796   MCFG_CPU_ADD("jsa", M6502, JSA_MASTER_CLOCK/2)
796797   MCFG_CPU_PROGRAM_MAP(atarijsa1_map)
797   MCFG_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
798   MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
798799
799800   /* sound hardware */
800801   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r18571r18572
838839   /* basic machine hardware */
839840   MCFG_CPU_ADD("jsa", M6502, JSA_MASTER_CLOCK/2)
840841   MCFG_CPU_PROGRAM_MAP(atarijsa1_map)
841   MCFG_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
842   MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
842843
843844   /* sound hardware */
844845   MCFG_SPEAKER_STANDARD_MONO("mono")
r18571r18572
860861   /* basic machine hardware */
861862   MCFG_CPU_ADD("jsa", M6502, JSA_MASTER_CLOCK/2)
862863   MCFG_CPU_PROGRAM_MAP(atarijsa2_map)
863   MCFG_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
864   MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
864865
865866   /* sound hardware */
866867   MCFG_SPEAKER_STANDARD_MONO("mono")
r18571r18572
904905   /* basic machine hardware */
905906   MCFG_CPU_ADD("jsa", M6502, JSA_MASTER_CLOCK/2)
906907   MCFG_CPU_PROGRAM_MAP(atarijsa3s_map)
907   MCFG_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
908   MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
908909
909910   /* sound hardware */
910911   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
trunk/src/mame/audio/atarijsa.h
r18571r18572
66
77
88void atarijsa_init(running_machine &machine, const char *testport, int testmask);
9void atarijsa_reset(void);
9void atarijsa_reset(running_machine &machine);
1010
1111
1212MACHINE_CONFIG_EXTERN( jsa_i_stereo );
trunk/src/mame/machine/atarigen.c
r18571r18572
6464    STATIC FUNCTION DECLARATIONS
6565***************************************************************************/
6666
67static void slapstic_postload(running_machine &machine);
68
69static TIMER_CALLBACK( scanline_interrupt_callback );
70
71static void update_6502_irq(running_machine &machine);
72static TIMER_CALLBACK( delayed_sound_reset );
73static TIMER_CALLBACK( delayed_sound_w );
74static TIMER_CALLBACK( delayed_6502_sound_w );
75
76static void atarigen_set_vol(running_machine &machine, int volume, device_type type);
77
78static TIMER_CALLBACK( scanline_timer_callback );
79
8067static void atarivc_common_w(screen_device &screen, offs_t offset, UINT16 newword);
8168
82static TIMER_CALLBACK( unhalt_cpu );
8369
84static TIMER_CALLBACK( atarivc_eof_update );
8570
86
87
8871/***************************************************************************
8972    INLINE FUNCTIONS
9073***************************************************************************/
9174
92INLINE const atarigen_screen_timer *get_screen_timer(screen_device &screen)
75inline const atarigen_screen_timer *get_screen_timer(screen_device &screen)
9376{
9477   atarigen_state *state = screen.machine().driver_data<atarigen_state>();
9578   int i;
9679
97   /* find the index of the timer that matches the screen */
80   // find the index of the timer that matches the screen
9881   for (i = 0; i < ARRAY_LENGTH(state->m_screen_timer); i++)
9982      if (state->m_screen_timer[i].screen == &screen)
10083         return &state->m_screen_timer[i];
r18571r18572
10992    OVERALL INIT
11093***************************************************************************/
11194
112void atarigen_init(running_machine &machine)
95atarigen_state::atarigen_state(const machine_config &mconfig, device_type type, const char *tag)
96   : driver_device(mconfig, type, tag),
97     m_earom(*this, "earom"),
98     m_earom_data(0),
99     m_earom_control(0),
100     m_eeprom(*this, "eeprom"),
101     m_eeprom32(*this, "eeprom"),
102     m_scanline_int_state(0),
103     m_sound_int_state(0),
104     m_video_int_state(0),
105     m_eeprom_default(NULL),
106     m_cpu_to_sound_ready(0),
107     m_sound_to_cpu_ready(0),
108     m_playfield(*this, "playfield"),
109     m_playfield2(*this, "playfield2"),
110     m_playfield_upper(*this, "playfield_up"),
111     m_alpha(*this, "alpha"),
112     m_alpha2(*this, "alpha2"),
113     m_xscroll(*this, "xscroll"),
114     m_yscroll(*this, "yscroll"),
115     m_playfield32(*this, "playfield32"),
116     m_alpha32(*this, "alpha32"),
117     m_playfield_tilemap(NULL),
118     m_playfield2_tilemap(NULL),
119     m_alpha_tilemap(NULL),
120     m_alpha2_tilemap(NULL),
121     m_atarivc_data(*this, "atarivc_data"),
122     m_atarivc_eof_data(*this, "atarivc_eof"),
123     m_eeprom_unlocked(false),
124     m_slapstic_num(0),
125     m_slapstic(NULL),
126     m_slapstic_bank(0),
127     m_slapstic_last_pc(0),
128     m_slapstic_last_address(0),
129     m_slapstic_base(0),
130     m_slapstic_mirror(0),
131     m_sound_cpu(*this, "audiocpu"),
132     m_cpu_to_sound(0),
133     m_sound_to_cpu(0),
134     m_timed_int(0),
135     m_ym2151_int(0),
136     m_scanlines_per_callback(0),
137     m_actual_vc_latch0(0),
138     m_actual_vc_latch1(0),
139     m_atarivc_playfields(0),
140     m_playfield_latch(0),
141     m_playfield2_latch(0)
113142{
114   atarigen_state *state = machine.driver_data<atarigen_state>();
143}
144
145void atarigen_state::machine_start()
146{
147   // find the sound CPU, until JSA is moved to be independent
148   if (m_sound_cpu == NULL)
149   {
150      device_t *device = subdevice("jsa");
151      if (device != NULL)
152         m_sound_cpu.set_target(downcast<m6502_device *>(device));
153   }
154
115155   screen_device *screen;
116156   int i;
117157
118   /* allocate timers for all screens */
119   screen_device_iterator iter(machine.root_device());
120   assert(iter.count() <= ARRAY_LENGTH(state->m_screen_timer));
158   // allocate timers for all screens
159   screen_device_iterator iter(*this);
160   assert(iter.count() <= ARRAY_LENGTH(m_screen_timer));
121161   for (i = 0, screen = iter.first(); screen != NULL; i++, screen = iter.next())
122162   {
123      state->m_screen_timer[i].screen = screen;
124      state->m_screen_timer[i].scanline_interrupt_timer = machine.scheduler().timer_alloc(FUNC(scanline_interrupt_callback), (void *)screen);
125      state->m_screen_timer[i].scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_timer_callback), (void *)screen);
126      state->m_screen_timer[i].atarivc_eof_update_timer = machine.scheduler().timer_alloc(FUNC(atarivc_eof_update), (void *)screen);
163      m_screen_timer[i].screen = screen;
164      m_screen_timer[i].scanline_interrupt_timer = timer_alloc(TID_SCANLINE_INTERRUPT, (void *)screen);
165      m_screen_timer[i].scanline_timer = timer_alloc(TID_SCANLINE_TIMER, (void *)screen);
166      m_screen_timer[i].atarivc_eof_update_timer = timer_alloc(TID_ATARIVC_EOF, (void *)screen);
127167   }
128168
129   state->save_item(NAME(state->m_scanline_int_state));
130   state->save_item(NAME(state->m_sound_int_state));
131   state->save_item(NAME(state->m_video_int_state));
169   save_item(NAME(m_scanline_int_state));
170   save_item(NAME(m_sound_int_state));
171   save_item(NAME(m_video_int_state));
132172
133   state->save_item(NAME(state->m_cpu_to_sound_ready));
134   state->save_item(NAME(state->m_sound_to_cpu_ready));
173   save_item(NAME(m_cpu_to_sound_ready));
174   save_item(NAME(m_sound_to_cpu_ready));
135175
136   state->save_item(NAME(state->m_atarivc_state.latch1));            /* latch #1 value (-1 means disabled) */
137   state->save_item(NAME(state->m_atarivc_state.latch2));            /* latch #2 value (-1 means disabled) */
138   state->save_item(NAME(state->m_atarivc_state.rowscroll_enable));      /* true if row-scrolling is enabled */
139   state->save_item(NAME(state->m_atarivc_state.palette_bank));         /* which palette bank is enabled */
140   state->save_item(NAME(state->m_atarivc_state.pf0_xscroll));         /* playfield 1 xscroll */
141   state->save_item(NAME(state->m_atarivc_state.pf0_xscroll_raw));      /* playfield 1 xscroll raw value */
142   state->save_item(NAME(state->m_atarivc_state.pf0_yscroll));         /* playfield 1 yscroll */
143   state->save_item(NAME(state->m_atarivc_state.pf1_xscroll));         /* playfield 2 xscroll */
144   state->save_item(NAME(state->m_atarivc_state.pf1_xscroll_raw));      /* playfield 2 xscroll raw value */
145   state->save_item(NAME(state->m_atarivc_state.pf1_yscroll));         /* playfield 2 yscroll */
146   state->save_item(NAME(state->m_atarivc_state.mo_xscroll));         /* sprite xscroll */
147   state->save_item(NAME(state->m_atarivc_state.mo_yscroll));         /* sprite xscroll */
176   save_item(NAME(m_atarivc_state.latch1));            // latch #1 value (-1 means disabled)
177   save_item(NAME(m_atarivc_state.latch2));            // latch #2 value (-1 means disabled)
178   save_item(NAME(m_atarivc_state.rowscroll_enable));      // true if row-scrolling is enabled
179   save_item(NAME(m_atarivc_state.palette_bank));         // which palette bank is enabled
180   save_item(NAME(m_atarivc_state.pf0_xscroll));         // playfield 1 xscroll
181   save_item(NAME(m_atarivc_state.pf0_xscroll_raw));      // playfield 1 xscroll raw value
182   save_item(NAME(m_atarivc_state.pf0_yscroll));         // playfield 1 yscroll
183   save_item(NAME(m_atarivc_state.pf1_xscroll));         // playfield 2 xscroll
184   save_item(NAME(m_atarivc_state.pf1_xscroll_raw));      // playfield 2 xscroll raw value
185   save_item(NAME(m_atarivc_state.pf1_yscroll));         // playfield 2 yscroll
186   save_item(NAME(m_atarivc_state.mo_xscroll));         // sprite xscroll
187   save_item(NAME(m_atarivc_state.mo_yscroll));         // sprite xscroll
148188
149   state->save_item(NAME(state->m_eeprom_unlocked));
189   save_item(NAME(m_eeprom_unlocked));
150190
151   state->save_item(NAME(state->m_slapstic_num));
152   state->save_item(NAME(state->m_slapstic_bank));
153   state->save_item(NAME(state->m_slapstic_last_pc));
154   state->save_item(NAME(state->m_slapstic_last_address));
191   save_item(NAME(m_slapstic_num));
192   save_item(NAME(m_slapstic_bank));
193   save_item(NAME(m_slapstic_last_pc));
194   save_item(NAME(m_slapstic_last_address));
155195
156   state->save_item(NAME(state->m_cpu_to_sound));
157   state->save_item(NAME(state->m_sound_to_cpu));
158   state->save_item(NAME(state->m_timed_int));
159   state->save_item(NAME(state->m_ym2151_int));
196   save_item(NAME(m_cpu_to_sound));
197   save_item(NAME(m_sound_to_cpu));
198   save_item(NAME(m_timed_int));
199   save_item(NAME(m_ym2151_int));
160200
161   state->save_item(NAME(state->m_scanlines_per_callback));
201   save_item(NAME(m_scanlines_per_callback));
162202
163   state->save_item(NAME(state->m_actual_vc_latch0));
164   state->save_item(NAME(state->m_actual_vc_latch1));
203   save_item(NAME(m_actual_vc_latch0));
204   save_item(NAME(m_actual_vc_latch1));
165205
166   state->save_item(NAME(state->m_playfield_latch));
167   state->save_item(NAME(state->m_playfield2_latch));
206   save_item(NAME(m_playfield_latch));
207   save_item(NAME(m_playfield2_latch));
168208
169   /* need a postload to reset the state */
170   machine.save().register_postload(save_prepost_delegate(FUNC(slapstic_postload), &machine));
209   save_item(NAME(m_earom_data));
210   save_item(NAME(m_earom_control));
171211}
172212
173213
214void atarigen_state::machine_reset()
215{
216   // reset the interrupt states
217   m_video_int_state = m_sound_int_state = m_scanline_int_state = 0;
174218
175/***************************************************************************
176    INTERRUPT HANDLING
177***************************************************************************/
219   // reset the control latch on the EAROM, if present
220   if (m_earom != NULL)
221      m_earom->set_control(0, 1, 1, 0, 0);
178222
179/*---------------------------------------------------------------
180    atarigen_interrupt_reset: Initializes the state of all
181    the interrupt sources.
182---------------------------------------------------------------*/
223   // reset the EEPROM
224   m_eeprom_unlocked = false;
225   if (m_eeprom == NULL && m_eeprom32 != NULL)
226      m_eeprom.set_target(reinterpret_cast<UINT16 *>(m_eeprom32.target()), m_eeprom32.bytes());
183227
184void atarigen_interrupt_reset(atarigen_state *state, atarigen_int_func update_int)
185{
186   /* set the callback */
187   state->m_update_int_callback = update_int;
188
189   /* reset the interrupt states */
190   state->m_video_int_state = state->m_sound_int_state = state->m_scanline_int_state = 0;
228   // reset the slapstic
229   if (m_slapstic_num != 0)
230   {
231      slapstic_reset();
232      slapstic_update_bank(slapstic_bank());
233   }
234   
235   // reset sound I/O
236   sound_io_reset();
191237}
192238
193239
194/*---------------------------------------------------------------
195    atarigen_update_interrupts: Forces the interrupt callback
196    to be called with the current VBLANK and sound interrupt
197    states.
198---------------------------------------------------------------*/
199
200void atarigen_update_interrupts(running_machine &machine)
240void atarigen_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
201241{
202   atarigen_state *state = machine.driver_data<atarigen_state>();
203   (*state->m_update_int_callback)(machine);
242   switch (id)
243   {
244      case TID_SCANLINE_INTERRUPT:
245      {
246         scanline_int_gen(*machine().device("maincpu"));
247         screen_device *screen = reinterpret_cast<screen_device *>(ptr);
248         timer.adjust(screen->frame_period());
249         break;
250      }
251     
252      case TID_SCANLINE_TIMER:
253         scanline_timer(timer, *reinterpret_cast<screen_device *>(ptr), param);
254         break;
255     
256      case TID_ATARIVC_EOF:
257         atarivc_eof_update(timer, *reinterpret_cast<screen_device *>(ptr));
258         break;
259   
260      // sound I/O
261      case TID_SOUND_RESET:
262         delayed_sound_reset(param);
263         break;
264     
265      case TID_SOUND_WRITE:
266         delayed_sound_write(param);
267         break;
268     
269      case TID_6502_WRITE:
270         delayed_6502_write(param);
271         break;
272   
273      // unhalt the CPU that was passed as a pointer
274      case TID_UNHALT_CPU:
275         reinterpret_cast<device_t *>(ptr)->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
276         break;
277   }
204278}
205279
206280
207/*---------------------------------------------------------------
208    atarigen_scanline_int_set: Sets the scanline when the next
209    scanline interrupt should be generated.
210---------------------------------------------------------------*/
211
212void atarigen_scanline_int_set(screen_device &screen, int scanline)
281void atarigen_state::scanline_update(screen_device &screen, int scanline)
213282{
214   emu_timer *timer = get_screen_timer(screen)->scanline_interrupt_timer;
215   timer->adjust(screen.time_until_pos(scanline));
216283}
217284
218285
219/*---------------------------------------------------------------
220    atarigen_scanline_int_gen: Standard interrupt routine
221    which sets the scanline interrupt state.
222---------------------------------------------------------------*/
286/***************************************************************************
287    INTERRUPT HANDLING
288***************************************************************************/
223289
224INTERRUPT_GEN( atarigen_scanline_int_gen )
290//-------------------------------------------------
291//  scanline_int_set: Sets the scanline when the next
292//  scanline interrupt should be generated.
293//-------------------------------------------------
294
295void atarigen_state::scanline_int_set(screen_device &screen, int scanline)
225296{
226   atarigen_state *state = device->machine().driver_data<atarigen_state>();
227   state->m_scanline_int_state = 1;
228   (*state->m_update_int_callback)(device->machine());
297   get_screen_timer(screen)->scanline_interrupt_timer->adjust(screen.time_until_pos(scanline));
229298}
230299
231300
232/*---------------------------------------------------------------
233    atarigen_scanline_int_ack_w: Resets the state of the
234    scanline interrupt.
235---------------------------------------------------------------*/
301//-------------------------------------------------
302//  scanline_int_gen: Standard interrupt routine
303//  which sets the scanline interrupt state.
304//-------------------------------------------------
236305
237WRITE16_HANDLER( atarigen_scanline_int_ack_w )
306INTERRUPT_GEN_MEMBER(atarigen_state::scanline_int_gen)
238307{
239   atarigen_state *state = space.machine().driver_data<atarigen_state>();
240   state->m_scanline_int_state = 0;
241   (*state->m_update_int_callback)(space.machine());
308   m_scanline_int_state = 1;
309   update_interrupts();
242310}
243311
244WRITE32_HANDLER( atarigen_scanline_int_ack32_w )
312
313//-------------------------------------------------
314//  scanline_int_ack_w: Resets the state of the
315//  scanline interrupt.
316//-------------------------------------------------
317
318WRITE16_MEMBER(atarigen_state::scanline_int_ack_w)
245319{
246   atarigen_state *state = space.machine().driver_data<atarigen_state>();
247   state->m_scanline_int_state = 0;
248   (*state->m_update_int_callback)(space.machine());
320   m_scanline_int_state = 0;
321   update_interrupts();
249322}
250323
251324
252/*---------------------------------------------------------------
253    atarigen_sound_int_gen: Standard interrupt routine which
254    sets the sound interrupt state.
255---------------------------------------------------------------*/
325//-------------------------------------------------
326//  atarigen_sound_int_gen: Standard interrupt routine which
327//  sets the sound interrupt state.
328//-------------------------------------------------
256329
257330INTERRUPT_GEN( atarigen_sound_int_gen )
258331{
259332   atarigen_state *state = device->machine().driver_data<atarigen_state>();
260333   state->m_sound_int_state = 1;
261   (*state->m_update_int_callback)(device->machine());
334   state->update_interrupts();
262335}
263336
264337
265/*---------------------------------------------------------------
266    atarigen_sound_int_ack_w: Resets the state of the sound
267    interrupt.
268---------------------------------------------------------------*/
338//-------------------------------------------------
339//  atarigen_sound_int_ack_w: Resets the state of the sound
340//  interrupt.
341//-------------------------------------------------
269342
270343WRITE16_HANDLER( atarigen_sound_int_ack_w )
271344{
272345   atarigen_state *state = space.machine().driver_data<atarigen_state>();
273346   state->m_sound_int_state = 0;
274   (*state->m_update_int_callback)(space.machine());
347   state->update_interrupts();
275348}
276349
277350WRITE32_HANDLER( atarigen_sound_int_ack32_w )
278351{
279352   atarigen_state *state = space.machine().driver_data<atarigen_state>();
280353   state->m_sound_int_state = 0;
281   (*state->m_update_int_callback)(space.machine());
354   state->update_interrupts();
282355}
283356
284357
285/*---------------------------------------------------------------
286    atarigen_video_int_gen: Standard interrupt routine which
287    sets the video interrupt state.
288---------------------------------------------------------------*/
358//-------------------------------------------------
359//  atarigen_video_int_gen: Standard interrupt routine which
360//  sets the video interrupt state.
361//-------------------------------------------------
289362
290363INTERRUPT_GEN( atarigen_video_int_gen )
291364{
292365   atarigen_state *state = device->machine().driver_data<atarigen_state>();
293366   state->m_video_int_state = 1;
294   (*state->m_update_int_callback)(device->machine());
367   state->update_interrupts();
295368}
296369
297370
298/*---------------------------------------------------------------
299    atarigen_video_int_ack_w: Resets the state of the video
300    interrupt.
301---------------------------------------------------------------*/
371//-------------------------------------------------
372//  atarigen_video_int_ack_w: Resets the state of the video
373//  interrupt.
374//-------------------------------------------------
302375
303376WRITE16_HANDLER( atarigen_video_int_ack_w )
304377{
305378   atarigen_state *state = space.machine().driver_data<atarigen_state>();
306379   state->m_video_int_state = 0;
307   (*state->m_update_int_callback)(space.machine());
380   state->update_interrupts();
308381}
309382
310383WRITE32_HANDLER( atarigen_video_int_ack32_w )
311384{
312385   atarigen_state *state = space.machine().driver_data<atarigen_state>();
313386   state->m_video_int_state = 0;
314   (*state->m_update_int_callback)(space.machine());
387   state->update_interrupts();
315388}
316389
317390
318/*---------------------------------------------------------------
319    scanline_interrupt_callback: Signals an interrupt.
320---------------------------------------------------------------*/
321391
322static TIMER_CALLBACK( scanline_interrupt_callback )
323{
324   screen_device &screen = *reinterpret_cast<screen_device *>(ptr);
325   emu_timer *timer = get_screen_timer(screen)->scanline_interrupt_timer;
326
327   /* generate the interrupt */
328   atarigen_scanline_int_gen(machine.device("maincpu"));
329
330   /* set a new timer to go off at the same scan line next frame */
331   timer->adjust(screen.frame_period());
332}
333
334
335
336392/***************************************************************************
337393    EEPROM HANDLING
338394***************************************************************************/
339395
340/*---------------------------------------------------------------
341    atarigen_eeprom_reset: Makes sure that the unlocked state
342    is cleared when we reset.
343---------------------------------------------------------------*/
396//-------------------------------------------------
397//  atarigen_eeprom_enable_w: Any write to this handler will
398//  allow one byte to be written to the EEPROM data area the
399//  next time.
400//-------------------------------------------------
344401
345void atarigen_eeprom_reset(atarigen_state *state)
346{
347   state->m_eeprom_unlocked = 0;
348   if (state->m_eeprom == NULL && state->m_eeprom32 != NULL)
349      state->m_eeprom.set_target(reinterpret_cast<UINT16 *>(state->m_eeprom32.target()), state->m_eeprom32.bytes());
350}
351
352
353/*---------------------------------------------------------------
354    atarigen_eeprom_enable_w: Any write to this handler will
355    allow one byte to be written to the EEPROM data area the
356    next time.
357---------------------------------------------------------------*/
358
359402WRITE16_HANDLER( atarigen_eeprom_enable_w )
360403{
361404   atarigen_state *state = space.machine().driver_data<atarigen_state>();
362   state->m_eeprom_unlocked = 1;
405   state->m_eeprom_unlocked = true;
363406}
364407
365408WRITE32_HANDLER( atarigen_eeprom_enable32_w )
366409{
367410   atarigen_state *state = space.machine().driver_data<atarigen_state>();
368   state->m_eeprom_unlocked = 1;
411   state->m_eeprom_unlocked = true;
369412}
370413
371414
372/*---------------------------------------------------------------
373    atarigen_eeprom_w: Writes a "word" to the EEPROM, which is
374    almost always accessed via the low byte of the word only.
375    If the EEPROM hasn't been unlocked, the write attempt is
376    ignored.
377---------------------------------------------------------------*/
415//-------------------------------------------------
416//  atarigen_eeprom_w: Writes a "word" to the EEPROM, which is
417//  almost always accessed via the low byte of the word only.
418//  If the EEPROM hasn't been unlocked, the write attempt is
419//  ignored.
420//-------------------------------------------------
378421
379422WRITE16_HANDLER( atarigen_eeprom_w )
380423{
r18571r18572
384427      return;
385428
386429   COMBINE_DATA(&state->m_eeprom[offset]);
387   state->m_eeprom_unlocked = 0;
430   state->m_eeprom_unlocked = false;
388431}
389432
390433WRITE32_HANDLER( atarigen_eeprom32_w )
r18571r18572
398441   data >>= 16;
399442   mem_mask >>= 16;
400443   COMBINE_DATA(&state->m_eeprom[offset * 2]);
401   state->m_eeprom_unlocked = 0;
444   state->m_eeprom_unlocked = false;
402445}
403446
404447
405/*---------------------------------------------------------------
406    atarigen_eeprom_r: Reads a "word" from the EEPROM, which is
407    almost always accessed via the low byte of the word only.
408---------------------------------------------------------------*/
448//-------------------------------------------------
449//  atarigen_eeprom_r: Reads a "word" from the EEPROM, which is
450//  almost always accessed via the low byte of the word only.
451//-------------------------------------------------
409452
410453READ16_HANDLER( atarigen_eeprom_r )
411454{
r18571r18572
431474    SLAPSTIC HANDLING
432475***************************************************************************/
433476
434INLINE void update_bank(atarigen_state *state, int bank)
477inline void atarigen_state::slapstic_update_bank(int bank)
435478{
436   /* if the bank has changed, copy the memory; Pit Fighter needs this */
437   if (bank != state->m_slapstic_bank)
479   // if the bank has changed, copy the memory; Pit Fighter needs this
480   if (bank != m_slapstic_bank)
438481   {
439      /* bank 0 comes from the copy we made earlier */
482      // bank 0 comes from the copy we made earlier
440483      if (bank == 0)
441         memcpy(state->m_slapstic, state->m_slapstic_bank0, 0x2000);
484         memcpy(m_slapstic, m_slapstic_bank0, 0x2000);
442485      else
443         memcpy(state->m_slapstic, &state->m_slapstic[bank * 0x1000], 0x2000);
486         memcpy(m_slapstic, &m_slapstic[bank * 0x1000], 0x2000);
444487
445      /* remember the current bank */
446      state->m_slapstic_bank = bank;
488      // remember the current bank
489      m_slapstic_bank = bank;
447490   }
448491}
449492
450493
451static void slapstic_postload(running_machine &machine)
494void atarigen_state::device_post_load()
452495{
453   atarigen_state *state = machine.driver_data<atarigen_state>();
454   update_bank(state, slapstic_bank());
496   slapstic_update_bank(slapstic_bank());
455497}
456498
457499
458DIRECT_UPDATE_MEMBER(atarigen_state::atarigen_slapstic_setdirect)
500DIRECT_UPDATE_MEMBER(atarigen_state::slapstic_setdirect)
459501{
460   /* if we jump to an address in the slapstic region, tweak the slapstic
461       at that address and return ~0; this will cause us to be called on
462       subsequent fetches as well */
502   // if we jump to an address in the slapstic region, tweak the slapstic
503    // at that address and return ~0; this will cause us to be called on
504    // subsequent fetches as well
463505   address &= ~m_slapstic_mirror;
464506   if (address >= m_slapstic_base && address < m_slapstic_base + 0x8000)
465507   {
r18571r18572
468510      {
469511         m_slapstic_last_pc = pc;
470512         m_slapstic_last_address = address;
471         atarigen_slapstic_r(direct.space(), (address >> 1) & 0x3fff, 0xffff);
513         slapstic_r(direct.space(), (address >> 1) & 0x3fff, 0xffff);
472514      }
473515      return ~0;
474516   }
475
476517   return address;
477518}
478519
479520
480521
481/*---------------------------------------------------------------
482    atarigen_slapstic_init: Installs memory handlers for the
483    slapstic and sets the chip number.
484---------------------------------------------------------------*/
522//-------------------------------------------------
523//  slapstic_configure: Installs memory handlers for the
524//  slapstic and sets the chip number.
525//-------------------------------------------------
485526
486void atarigen_slapstic_init(device_t *device, offs_t base, offs_t mirror, int chipnum)
527void atarigen_state::slapstic_configure(cpu_device &device, offs_t base, offs_t mirror, int chipnum)
487528{
488   atarigen_state *state = device->machine().driver_data<atarigen_state>();
529   // reset in case we have no state
530   m_slapstic_num = chipnum;
531   m_slapstic = NULL;
489532
490   /* reset in case we have no state */
491   state->m_slapstic_num = chipnum;
492   state->m_slapstic = NULL;
493
494   /* if we have a chip, install it */
533   // if we have a chip, install it
495534   if (chipnum != 0)
496535   {
497      /* initialize the slapstic */
498      slapstic_init(device->machine(), chipnum);
536      // initialize the slapstic
537      slapstic_init(machine(), chipnum);
499538
500      /* install the memory handlers */
501      state->m_slapstic = device->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(base, base + 0x7fff, 0, mirror, FUNC(atarigen_slapstic_r), FUNC(atarigen_slapstic_w));
539      // install the memory handlers
540      address_space &program = device.space(AS_PROGRAM);
541      m_slapstic = program.install_readwrite_handler(base, base + 0x7fff, 0, mirror, read16_delegate(FUNC(atarigen_state::slapstic_r), this), write16_delegate(FUNC(atarigen_state::slapstic_w), this));
542      program.set_direct_update_handler(direct_update_delegate(FUNC(atarigen_state::slapstic_setdirect), this));
502543
503      /* allocate memory for a copy of bank 0 */
504      state->m_slapstic_bank0 = auto_alloc_array(device->machine(), UINT8, 0x2000);
505      memcpy(state->m_slapstic_bank0, state->m_slapstic, 0x2000);
544      // allocate memory for a copy of bank 0
545      m_slapstic_bank0.resize(0x2000);
546      memcpy(m_slapstic_bank0, m_slapstic, 0x2000);
506547
507      /* ensure we recopy memory for the bank */
508      state->m_slapstic_bank = 0xff;
548      // ensure we recopy memory for the bank
549      m_slapstic_bank = 0xff;
509550
510      /* install an opcode base handler if we are a 68000 or variant */
511      state->m_slapstic_base = base;
512      state->m_slapstic_mirror = mirror;
513
514      address_space &space = device->memory().space(AS_PROGRAM);
515      space.set_direct_update_handler(direct_update_delegate(FUNC(atarigen_state::atarigen_slapstic_setdirect), state));
551      // install an opcode base handler if we are a 68000 or variant
552      m_slapstic_base = base;
553      m_slapstic_mirror = mirror;
516554   }
517555}
518556
519557
520/*---------------------------------------------------------------
521    atarigen_slapstic_reset: Makes the selected slapstic number
522    active and resets its state.
523---------------------------------------------------------------*/
558//-------------------------------------------------
559//  slapstic_w: Assuming that the slapstic sits in
560//  ROM memory space, we just simply tweak the slapstic at this
561//  address and do nothing more.
562//-------------------------------------------------
524563
525void atarigen_slapstic_reset(atarigen_state *state)
564WRITE16_MEMBER(atarigen_state::slapstic_w)
526565{
527   if (state->m_slapstic_num != 0)
528   {
529      slapstic_reset();
530      update_bank(state, slapstic_bank());
531   }
566   slapstic_update_bank(slapstic_tweak(space, offset));
532567}
533568
534569
535/*---------------------------------------------------------------
536    atarigen_slapstic_w: Assuming that the slapstic sits in
537    ROM memory space, we just simply tweak the slapstic at this
538    address and do nothing more.
539---------------------------------------------------------------*/
570//-------------------------------------------------
571//  slapstic_r: Tweaks the slapstic at the appropriate
572//  address and then reads a word from the underlying memory.
573//-------------------------------------------------
540574
541WRITE16_HANDLER( atarigen_slapstic_w )
575READ16_MEMBER(atarigen_state::slapstic_r)
542576{
543   atarigen_state *state = space.machine().driver_data<atarigen_state>();
544   update_bank(state, slapstic_tweak(space, offset));
545}
577   // fetch the result from the current bank first
578   int result = m_slapstic[offset & 0xfff];
546579
547
548/*---------------------------------------------------------------
549    atarigen_slapstic_r: Tweaks the slapstic at the appropriate
550    address and then reads a word from the underlying memory.
551---------------------------------------------------------------*/
552
553READ16_HANDLER( atarigen_slapstic_r )
554{
555   /* fetch the result from the current bank first */
556   atarigen_state *state = space.machine().driver_data<atarigen_state>();
557   int result = state->m_slapstic[offset & 0xfff];
558
559   /* then determine the new one */
560   update_bank(state, slapstic_tweak(space, offset));
580   // then determine the new one
581   slapstic_update_bank(slapstic_tweak(space, offset));
561582   return result;
562583}
563584
r18571r18572
567588    SOUND I/O
568589***************************************************************************/
569590
570/*---------------------------------------------------------------
571    atarigen_sound_io_reset: Resets the state of the sound I/O.
572---------------------------------------------------------------*/
591//-------------------------------------------------
592//  sound_io_reset: Resets the state of the sound I/O.
593//-------------------------------------------------
573594
574void atarigen_sound_io_reset(device_t *device)
595void atarigen_state::sound_io_reset()
575596{
576   atarigen_state *state = device->machine().driver_data<atarigen_state>();
597   // reset the internal interrupts states
598   m_timed_int = m_ym2151_int = 0;
577599
578   /* remember which CPU is the sound CPU */
579   state->m_sound_cpu = device;
580
581   /* reset the internal interrupts states */
582   state->m_timed_int = state->m_ym2151_int = 0;
583
584   /* reset the sound I/O states */
585   state->m_cpu_to_sound = state->m_sound_to_cpu = 0;
586   state->m_cpu_to_sound_ready = state->m_sound_to_cpu_ready = 0;
600   // reset the sound I/O states
601   m_cpu_to_sound = m_sound_to_cpu = 0;
602   m_cpu_to_sound_ready = m_sound_to_cpu_ready = 0;
587603}
588604
589605
590/*---------------------------------------------------------------
591    atarigen_6502_irq_gen: Generates an IRQ signal to the 6502
592    sound processor.
593---------------------------------------------------------------*/
606//-------------------------------------------------
607//  m6502_irq_gen: Generates an IRQ signal to the
608//  6502 sound processor.
609//-------------------------------------------------
594610
595INTERRUPT_GEN( atarigen_6502_irq_gen )
611INTERRUPT_GEN_MEMBER(atarigen_state::m6502_irq_gen)
596612{
597   atarigen_state *state = device->machine().driver_data<atarigen_state>();
598   state->m_timed_int = 1;
599   update_6502_irq(device->machine());
613   m_timed_int = 1;
614   update_m6502_irq();
600615}
601616
602617
603/*---------------------------------------------------------------
604    atarigen_6502_irq_ack_r: Resets the IRQ signal to the 6502
605    sound processor. Both reads and writes can be used.
606---------------------------------------------------------------*/
618//-------------------------------------------------
619//  m6502_irq_ack_r: Resets the IRQ signal to the 6502
620//  sound processor. Both reads and writes can be used.
621//-------------------------------------------------
607622
608READ8_HANDLER( atarigen_6502_irq_ack_r )
623READ8_MEMBER(atarigen_state::m6502_irq_ack_r)
609624{
610   atarigen_state *state = space.machine().driver_data<atarigen_state>();
611   state->m_timed_int = 0;
612   update_6502_irq(space.machine());
625   m_timed_int = 0;
626   update_m6502_irq();
613627   return 0;
614628}
615629
616WRITE8_HANDLER( atarigen_6502_irq_ack_w )
630WRITE8_MEMBER(atarigen_state::m6502_irq_ack_w)
617631{
618   atarigen_state *state = space.machine().driver_data<atarigen_state>();
619   state->m_timed_int = 0;
620   update_6502_irq(space.machine());
632   m_timed_int = 0;
633   update_m6502_irq();
621634}
622635
623636
624/*---------------------------------------------------------------
625    atarigen_ym2151_irq_gen: Sets the state of the YM2151's
626    IRQ line.
627---------------------------------------------------------------*/
637//-------------------------------------------------
638//  atarigen_ym2151_irq_gen: Sets the state of the YM2151's
639//  IRQ line.
640//-------------------------------------------------
628641
629WRITE_LINE_MEMBER( atarigen_state::ym2151_irq_gen )
642WRITE_LINE_MEMBER(atarigen_state::ym2151_irq_gen)
630643{
631644   m_ym2151_int = state;
632   update_6502_irq(machine());
645   update_m6502_irq();
633646}
634647
635648
636/*---------------------------------------------------------------
637    atarigen_sound_reset_w: Write handler which resets the
638    sound CPU in response.
639---------------------------------------------------------------*/
649//-------------------------------------------------
650//  sound_reset_w: Write handler which resets the
651//  sound CPU in response.
652//-------------------------------------------------
640653
641WRITE16_HANDLER( atarigen_sound_reset_w )
654WRITE16_MEMBER(atarigen_state::sound_reset_w)
642655{
643   space.machine().scheduler().synchronize(FUNC(delayed_sound_reset));
656   synchronize(TID_SOUND_RESET);
644657}
645658
646659
647/*---------------------------------------------------------------
648    atarigen_sound_reset: Resets the state of the sound CPU
649    manually.
650---------------------------------------------------------------*/
660//-------------------------------------------------
661//  sound_cpu_reset: Resets the state of the sound
662//  CPU manually.
663//-------------------------------------------------
651664
652void atarigen_sound_reset(running_machine &machine)
665void atarigen_state::sound_cpu_reset()
653666{
654   machine.scheduler().synchronize(FUNC(delayed_sound_reset), 1);
667   synchronize(TID_SOUND_RESET, 1);
655668}
656669
657670
658/*---------------------------------------------------------------
659    atarigen_sound_w: Handles communication from the main CPU
660    to the sound CPU. Two versions are provided, one with the
661    data byte in the low 8 bits, and one with the data byte in
662    the upper 8 bits.
663---------------------------------------------------------------*/
671//-------------------------------------------------
672//  atarigen_sound_w: Handles communication from the main CPU
673//  to the sound CPU. Two versions are provided, one with the
674//  data byte in the low 8 bits, and one with the data byte in
675//  the upper 8 bits.
676//-------------------------------------------------
664677
665WRITE16_HANDLER( atarigen_sound_w )
678WRITE8_MEMBER(atarigen_state::sound_w)
666679{
667   if (ACCESSING_BITS_0_7)
668      space.machine().scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff);
680   synchronize(TID_SOUND_WRITE, data);
669681}
670682
671WRITE16_HANDLER( atarigen_sound_upper_w )
672{
673   if (ACCESSING_BITS_8_15)
674      space.machine().scheduler().synchronize(FUNC(delayed_sound_w), (data >> 8) & 0xff);
675}
676683
677WRITE32_HANDLER( atarigen_sound_upper32_w )
678{
679   if (ACCESSING_BITS_24_31)
680      space.machine().scheduler().synchronize(FUNC(delayed_sound_w), (data >> 24) & 0xff);
681}
684//-------------------------------------------------
685//  sound_r: Handles reading data communicated from the
686//  sound CPU to the main CPU. Two versions are provided, one
687//  with the data byte in the low 8 bits, and one with the data
688//  byte in the upper 8 bits.
689//-------------------------------------------------
682690
683
684/*---------------------------------------------------------------
685    atarigen_sound_r: Handles reading data communicated from the
686    sound CPU to the main CPU. Two versions are provided, one
687    with the data byte in the low 8 bits, and one with the data
688    byte in the upper 8 bits.
689---------------------------------------------------------------*/
690
691READ16_HANDLER( atarigen_sound_r )
691READ8_MEMBER(atarigen_state::sound_r)
692692{
693   atarigen_state *state = space.machine().driver_data<atarigen_state>();
694   state->m_sound_to_cpu_ready = 0;
693   m_sound_to_cpu_ready = 0;
695694   atarigen_sound_int_ack_w(space, 0, 0, 0xffff);
696   return state->m_sound_to_cpu | 0xff00;
695   return m_sound_to_cpu;
697696}
698697
699READ16_HANDLER( atarigen_sound_upper_r )
700{
701   atarigen_state *state = space.machine().driver_data<atarigen_state>();
702   state->m_sound_to_cpu_ready = 0;
703   atarigen_sound_int_ack_w(space, 0, 0, 0xffff);
704   return (state->m_sound_to_cpu << 8) | 0x00ff;
705}
706698
707READ32_HANDLER( atarigen_sound_upper32_r )
708{
709   atarigen_state *state = space.machine().driver_data<atarigen_state>();
710   state->m_sound_to_cpu_ready = 0;
711   atarigen_sound_int_ack32_w(space, 0, 0, 0xffff);
712   return (state->m_sound_to_cpu << 24) | 0x00ffffff;
713}
699//-------------------------------------------------
700//  m6502_sound_w: Handles communication from the
701//  sound CPU to the main CPU.
702//-------------------------------------------------
714703
715
716/*---------------------------------------------------------------
717    atarigen_6502_sound_w: Handles communication from the sound
718    CPU to the main CPU.
719---------------------------------------------------------------*/
720
721WRITE8_HANDLER( atarigen_6502_sound_w )
704WRITE8_MEMBER(atarigen_state::m6502_sound_w)
722705{
723   space.machine().scheduler().synchronize(FUNC(delayed_6502_sound_w), data);
706   synchronize(TID_6502_WRITE, data);
724707}
725708
726709
727/*---------------------------------------------------------------
728    atarigen_6502_sound_r: Handles reading data communicated
729    from the main CPU to the sound CPU.
730---------------------------------------------------------------*/
710//-------------------------------------------------
711//  m6502_sound_r: Handles reading data
712//  communicated from the main CPU to the sound
713//  CPU.
714//-------------------------------------------------
731715
732READ8_HANDLER( atarigen_6502_sound_r )
716READ8_MEMBER(atarigen_state::m6502_sound_r)
733717{
734   atarigen_state *state = space.machine().driver_data<atarigen_state>();
735   state->m_cpu_to_sound_ready = 0;
736   state->m_sound_cpu->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
737   return state->m_cpu_to_sound;
718   m_cpu_to_sound_ready = 0;
719   m_sound_cpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
720   return m_cpu_to_sound;
738721}
739722
740723
741/*---------------------------------------------------------------
742    update_6502_irq: Called whenever the IRQ state changes. An
743    interrupt is generated if either atarigen_6502_irq_gen()
744    was called, or if the YM2151 generated an interrupt via
745    the atarigen_ym2151_irq_gen() callback.
746---------------------------------------------------------------*/
724//-------------------------------------------------
725//  update_m6502_irq: Called whenever the IRQ state changes. An
726//  interrupt is generated if either m6502_irq_gen()
727//  was called, or if the YM2151 generated an interrupt via
728//  the atarigen_ym2151_irq_gen() callback.
729//-------------------------------------------------
747730
748static void update_6502_irq(running_machine &machine)
731void atarigen_state::update_m6502_irq()
749732{
750   atarigen_state *state = machine.driver_data<atarigen_state>();
751   if (state->m_timed_int || state->m_ym2151_int)
752      state->m_sound_cpu->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE);
733   if (m_timed_int || m_ym2151_int)
734      m_sound_cpu->set_input_line(M6502_IRQ_LINE, ASSERT_LINE);
753735   else
754      state->m_sound_cpu->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE);
736      m_sound_cpu->set_input_line(M6502_IRQ_LINE, CLEAR_LINE);
755737}
756738
757739
758/*---------------------------------------------------------------
759    delayed_sound_reset: Synchronizes the sound reset command
760    between the two CPUs.
761---------------------------------------------------------------*/
740//-------------------------------------------------
741//  delayed_sound_reset: Synchronizes the sound reset command
742//  between the two CPUs.
743//-------------------------------------------------
762744
763static TIMER_CALLBACK( delayed_sound_reset )
745void atarigen_state::delayed_sound_reset(int param)
764746{
765   atarigen_state *state = machine.driver_data<atarigen_state>();
766   address_space &space = state->m_sound_cpu->memory().space(AS_PROGRAM);
767
768   /* unhalt and reset the sound CPU */
747   // unhalt and reset the sound CPU
769748   if (param == 0)
770749   {
771      state->m_sound_cpu->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
772      state->m_sound_cpu->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
750      m_sound_cpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
751      m_sound_cpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE);
773752   }
774753
775   /* reset the sound write state */
776   state->m_sound_to_cpu_ready = 0;
777   atarigen_sound_int_ack_w(space, 0, 0, 0xffff);
754   // reset the sound write state
755   m_sound_to_cpu_ready = 0;
756   atarigen_sound_int_ack_w(m_sound_cpu->space(AS_PROGRAM), 0, 0, 0xffff);
778757
779   /* allocate a high frequency timer until a response is generated */
780   /* the main CPU is *very* sensistive to the timing of the response */
781   machine.scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
758   // allocate a high frequency timer until a response is generated
759   // the main CPU is *very* sensistive to the timing of the response
760   machine().scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
782761}
783762
784763
785/*---------------------------------------------------------------
786    delayed_sound_w: Synchronizes a data write from the main
787    CPU to the sound CPU.
788---------------------------------------------------------------*/
764//-------------------------------------------------
765//  delayed_sound_write: Synchronizes a data write
766//  from the main CPU to the sound CPU.
767//-------------------------------------------------
789768
790static TIMER_CALLBACK( delayed_sound_w )
769void atarigen_state::delayed_sound_write(int data)
791770{
792   atarigen_state *state = machine.driver_data<atarigen_state>();
793
794   /* warn if we missed something */
795   if (state->m_cpu_to_sound_ready)
771   // warn if we missed something
772   if (m_cpu_to_sound_ready)
796773      logerror("Missed command from 68010\n");
797774
798   /* set up the states and signal an NMI to the sound CPU */
799   state->m_cpu_to_sound = param;
800   state->m_cpu_to_sound_ready = 1;
801   state->m_sound_cpu->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
775   // set up the states and signal an NMI to the sound CPU
776   m_cpu_to_sound = data;
777   m_cpu_to_sound_ready = 1;
778   m_sound_cpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
802779
803   /* allocate a high frequency timer until a response is generated */
804   /* the main CPU is *very* sensistive to the timing of the response */
805   machine.scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
780   // allocate a high frequency timer until a response is generated
781   // the main CPU is *very* sensistive to the timing of the response
782   machine().scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
806783}
807784
808785
809/*---------------------------------------------------------------
810    delayed_6502_sound_w: Synchronizes a data write from the
811    sound CPU to the main CPU.
812---------------------------------------------------------------*/
786//-------------------------------------------------
787//  delayed_6502_write: Synchronizes a data write
788//  from the sound CPU to the main CPU.
789//-------------------------------------------------
813790
814static TIMER_CALLBACK( delayed_6502_sound_w )
791void atarigen_state::delayed_6502_write(int data)
815792{
816   atarigen_state *state = machine.driver_data<atarigen_state>();
817
818   /* warn if we missed something */
819   if (state->m_sound_to_cpu_ready)
793   // warn if we missed something
794   if (m_sound_to_cpu_ready)
820795      logerror("Missed result from 6502\n");
821796
822   /* set up the states and signal the sound interrupt to the main CPU */
823   state->m_sound_to_cpu = param;
824   state->m_sound_to_cpu_ready = 1;
825   atarigen_sound_int_gen(machine.device("maincpu"));
797   // set up the states and signal the sound interrupt to the main CPU
798   m_sound_to_cpu = data;
799   m_sound_to_cpu_ready = 1;
800   atarigen_sound_int_gen(machine().device("maincpu"));
826801}
827802
828803
r18571r18572
831806    SOUND HELPERS
832807***************************************************************************/
833808
834/*---------------------------------------------------------------
835    atarigen_set_vol: Scans for a particular sound chip and
836    changes the volume on all channels associated with it.
837---------------------------------------------------------------*/
809//-------------------------------------------------
810//  set_volume_by_type: Scans for a particular
811//  sound chip and changes the volume on all
812//  channels associated with it.
813//-------------------------------------------------
838814
839void atarigen_set_vol(running_machine &machine, int volume, device_type type)
815void atarigen_state::set_volume_by_type(int volume, device_type type)
840816{
841   sound_interface_iterator iter(machine.root_device());
817   sound_interface_iterator iter(*this);
842818   for (device_sound_interface *sound = iter.first(); sound != NULL; sound = iter.next())
843819      if (sound->device().type() == type)
844820         sound->set_output_gain(ALL_OUTPUTS, volume / 100.0);
845821}
846822
847823
848/*---------------------------------------------------------------
849    atarigen_set_XXXXX_vol: Sets the volume for a given type
850    of chip.
851---------------------------------------------------------------*/
824//-------------------------------------------------
825//  set_XXXXX_volume: Sets the volume for a given
826//  type of chip.
827//-------------------------------------------------
852828
853void atarigen_set_ym2151_vol(running_machine &machine, int volume)
829void atarigen_state::set_ym2151_volume(int volume)
854830{
855   atarigen_set_vol(machine, volume, YM2151);
831   set_volume_by_type(volume, YM2151);
856832}
857833
858void atarigen_set_ym2413_vol(running_machine &machine, int volume)
834void atarigen_state::set_ym2413_volume(int volume)
859835{
860   atarigen_set_vol(machine, volume, YM2413);
836   set_volume_by_type(volume, YM2413);
861837}
862838
863void atarigen_set_pokey_vol(running_machine &machine, int volume)
839void atarigen_state::set_pokey_volume(int volume)
864840{
865   atarigen_set_vol(machine, volume, POKEY);
841   set_volume_by_type(volume, POKEY);
866842}
867843
868void atarigen_set_tms5220_vol(running_machine &machine, int volume)
844void atarigen_state::set_tms5220_volume(int volume)
869845{
870   atarigen_set_vol(machine, volume, TMS5220);
846   set_volume_by_type(volume, TMS5220);
871847}
872848
873void atarigen_set_oki6295_vol(running_machine &machine, int volume)
849void atarigen_state::set_oki6295_volume(int volume)
874850{
875   atarigen_set_vol(machine, volume, OKIM6295);
851   set_volume_by_type(volume, OKIM6295);
876852}
877853
878854
r18571r18572
881857    SCANLINE TIMING
882858***************************************************************************/
883859
884/*---------------------------------------------------------------
885    atarigen_scanline_timer_reset: Sets up the scanline timer.
886---------------------------------------------------------------*/
860//-------------------------------------------------
861//  scanline_timer_reset: Sets up the scanline timer.
862//-------------------------------------------------
887863
888void atarigen_scanline_timer_reset(screen_device &screen, atarigen_scanline_func update_graphics, int frequency)
864void atarigen_state::scanline_timer_reset(screen_device &screen, int frequency)
889865{
890   atarigen_state *state = screen.machine().driver_data<atarigen_state>();
866   // set the scanline callback
867   m_scanlines_per_callback = frequency;
891868
892   /* set the scanline callback */
893   state->m_scanline_callback = update_graphics;
894   state->m_scanlines_per_callback = frequency;
895
896   /* set a timer to go off at scanline 0 */
897   if (state->m_scanline_callback != NULL)
898   {
899      emu_timer *timer = get_screen_timer(screen)->scanline_timer;
900      timer->adjust(screen.time_until_pos(0));
901   }
869   // set a timer to go off at scanline 0
870   if (frequency != 0)
871      get_screen_timer(screen)->scanline_timer->adjust(screen.time_until_pos(0));
902872}
903873
904874
905/*---------------------------------------------------------------
906    scanline_timer_callback: Called once every n scanlines
907    to generate the periodic callback to the main system.
908---------------------------------------------------------------*/
875//-------------------------------------------------
876//  scanline_timer: Called once every n scanlines
877//  to generate the periodic callback to the main
878//  system.
879//-------------------------------------------------
909880
910static TIMER_CALLBACK( scanline_timer_callback )
881void atarigen_state::scanline_timer(emu_timer &timer, screen_device &screen, int scanline)
911882{
912   atarigen_state *state = machine.driver_data<atarigen_state>();
913   screen_device &screen = *reinterpret_cast<screen_device *>(ptr);
914   int scanline = param;
883   // callback
884   scanline_update(screen, scanline);
915885
916   /* callback */
917   if (state->m_scanline_callback != NULL)
918   {
919      (*state->m_scanline_callback)(screen, scanline);
920
921      /* generate another */
922      scanline += state->m_scanlines_per_callback;
923      if (scanline >= screen.height())
924         scanline = 0;
925      get_screen_timer(screen)->scanline_timer->adjust(screen.time_until_pos(scanline), scanline);
926   }
886   // generate another
887   scanline += m_scanlines_per_callback;
888   if (scanline >= screen.height())
889      scanline = 0;
890   timer.adjust(screen.time_until_pos(scanline), scanline);
927891}
928892
929893
r18571r18572
932896    VIDEO CONTROLLER
933897***************************************************************************/
934898
935/*---------------------------------------------------------------
936    atarivc_eof_update: Callback that slurps up data and feeds
937    it into the video controller registers every refresh.
938---------------------------------------------------------------*/
899//-------------------------------------------------
900//  atarivc_eof_update: Callback that slurps up data and feeds
901//  it into the video controller registers every refresh.
902//-------------------------------------------------
939903
940static TIMER_CALLBACK( atarivc_eof_update )
904void atarigen_state::atarivc_eof_update(emu_timer &timer, screen_device &screen)
941905{
942   atarigen_state *state = machine.driver_data<atarigen_state>();
943   screen_device &screen = *reinterpret_cast<screen_device *>(ptr);
944   emu_timer *timer = get_screen_timer(screen)->atarivc_eof_update_timer;
945   int i;
906   // echo all the commands to the video controller
907   for (int i = 0; i < 0x1c; i++)
908      if (m_atarivc_eof_data[i])
909         atarivc_common_w(screen, i, m_atarivc_eof_data[i]);
946910
947   /* echo all the commands to the video controller */
948   for (i = 0; i < 0x1c; i++)
949      if (state->m_atarivc_eof_data[i])
950         atarivc_common_w(screen, i, state->m_atarivc_eof_data[i]);
911   // update the scroll positions
912   atarimo_set_xscroll(0, m_atarivc_state.mo_xscroll);
913   atarimo_set_yscroll(0, m_atarivc_state.mo_yscroll);
951914
952   /* update the scroll positions */
953   atarimo_set_xscroll(0, state->m_atarivc_state.mo_xscroll);
954   atarimo_set_yscroll(0, state->m_atarivc_state.mo_yscroll);
915   m_playfield_tilemap->set_scrollx(0, m_atarivc_state.pf0_xscroll);
916   m_playfield_tilemap->set_scrolly(0, m_atarivc_state.pf0_yscroll);
955917
956   state->m_playfield_tilemap->set_scrollx(0, state->m_atarivc_state.pf0_xscroll);
957   state->m_playfield_tilemap->set_scrolly(0, state->m_atarivc_state.pf0_yscroll);
958
959   if (state->m_atarivc_playfields > 1)
918   if (m_atarivc_playfields > 1)
960919   {
961      state->m_playfield2_tilemap->set_scrollx(0, state->m_atarivc_state.pf1_xscroll);
962      state->m_playfield2_tilemap->set_scrolly(0, state->m_atarivc_state.pf1_yscroll);
920      m_playfield2_tilemap->set_scrollx(0, m_atarivc_state.pf1_xscroll);
921      m_playfield2_tilemap->set_scrolly(0, m_atarivc_state.pf1_yscroll);
963922   }
964   timer->adjust(screen.time_until_pos(0));
923   timer.adjust(screen.time_until_pos(0));
965924
966   /* use this for debugging the video controller values */
925   // use this for debugging the video controller values
967926#if 0
968   if (machine.input().code_pressed(KEYCODE_8))
927   if (machine().input().code_pressed(KEYCODE_8))
969928   {
970929      static FILE *out;
971930      if (!out) out = fopen("scroll.log", "w");
r18571r18572
980939}
981940
982941
983/*---------------------------------------------------------------
984    atarivc_reset: Initializes the video controller.
985---------------------------------------------------------------*/
942//-------------------------------------------------
943//  atarivc_reset: Initializes the video controller.
944//-------------------------------------------------
986945
987946void atarivc_reset(screen_device &screen, UINT16 *eof_data, int playfields)
988947{
989948   atarigen_state *state = screen.machine().driver_data<atarigen_state>();
990949
991   /* this allows us to manually reset eof_data to NULL if it's not used */
950   // this allows us to manually reset eof_data to NULL if it's not used
992951   state->m_atarivc_eof_data.set_target(eof_data, 0x100);
993952   state->m_atarivc_playfields = playfields;
994953
995   /* clear the RAM we use */
954   // clear the RAM we use
996955   memset(state->m_atarivc_data, 0, 0x40);
997956   memset(&state->m_atarivc_state, 0, sizeof(state->m_atarivc_state));
998957
999   /* reset the latches */
958   // reset the latches
1000959   state->m_atarivc_state.latch1 = state->m_atarivc_state.latch2 = -1;
1001960   state->m_actual_vc_latch0 = state->m_actual_vc_latch1 = -1;
1002961
1003   /* start a timer to go off a little before scanline 0 */
962   // start a timer to go off a little before scanline 0
1004963   if (state->m_atarivc_eof_data)
1005   {
1006      emu_timer *timer = get_screen_timer(screen)->atarivc_eof_update_timer;
1007      timer->adjust(screen.time_until_pos(0));
1008   }
964      get_screen_timer(screen)->atarivc_eof_update_timer->adjust(screen.time_until_pos(0));
1009965}
1010966
1011967
968//-------------------------------------------------
969//  atarivc_w: Handles an I/O write to the video controller.
970//-------------------------------------------------
1012971
1013/*---------------------------------------------------------------
1014    atarivc_w: Handles an I/O write to the video controller.
1015---------------------------------------------------------------*/
1016
1017972void atarivc_w(screen_device &screen, offs_t offset, UINT16 data, UINT16 mem_mask)
1018973{
1019974   atarigen_state *state = screen.machine().driver_data<atarigen_state>();
r18571r18572
1026981
1027982
1028983
1029/*---------------------------------------------------------------
1030    atarivc_common_w: Does the bulk of the word for an I/O
1031    write.
1032---------------------------------------------------------------*/
984//-------------------------------------------------
985//  atarivc_common_w: Does the bulk of the word for an I/O
986//  write.
987//-------------------------------------------------
1033988
1034989static void atarivc_common_w(screen_device &screen, offs_t offset, UINT16 newword)
1035990{
r18571r18572
1037992   int oldword = state->m_atarivc_data[offset];
1038993   state->m_atarivc_data[offset] = newword;
1039994
1040   /* switch off the offset */
995   // switch off the offset
1041996   switch (offset)
1042997   {
1043      /*
1044            additional registers:
998      //
999        //  additional registers:
1000        //
1001        //      01 = vertical start (for centering)
1002        //      04 = horizontal start (for centering)
1003        //
10451004
1046                01 = vertical start (for centering)
1047                04 = horizontal start (for centering)
1048        */
1049
1050      /* set the scanline interrupt here */
1005      // set the scanline interrupt here
10511006      case 0x03:
10521007         if (oldword != newword)
1053            atarigen_scanline_int_set(screen, newword & 0x1ff);
1008            state->scanline_int_set(screen, newword & 0x1ff);
10541009         break;
10551010
1056      /* latch enable */
1011      // latch enable
10571012      case 0x0a:
10581013
1059         /* reset the latches when disabled */
1014         // reset the latches when disabled
10601015         atarigen_set_playfield_latch(state, (newword & 0x0080) ? state->m_actual_vc_latch0 : -1);
10611016         atarigen_set_playfield2_latch(state, (newword & 0x0080) ? state->m_actual_vc_latch1 : -1);
10621017
1063         /* check for rowscroll enable */
1018         // check for rowscroll enable
10641019         state->m_atarivc_state.rowscroll_enable = (newword & 0x2000) >> 13;
10651020
1066         /* check for palette banking */
1021         // check for palette banking
10671022         if (state->m_atarivc_state.palette_bank != (((newword & 0x0400) >> 10) ^ 1))
10681023         {
10691024            screen.update_partial(screen.vpos());
r18571r18572
10711026         }
10721027         break;
10731028
1074      /* indexed parameters */
1029      // indexed parameters
10751030      case 0x10: case 0x11: case 0x12: case 0x13:
10761031      case 0x14: case 0x15: case 0x16: case 0x17:
10771032      case 0x18: case 0x19: case 0x1a: case 0x1b:
r18571r18572
11051060         }
11061061         break;
11071062
1108      /* latch 1 value */
1063      // latch 1 value
11091064      case 0x1c:
11101065         state->m_actual_vc_latch0 = -1;
11111066         state->m_actual_vc_latch1 = newword;
r18571r18572
11131068         atarigen_set_playfield2_latch(state, (state->m_atarivc_data[0x0a] & 0x80) ? state->m_actual_vc_latch1 : -1);
11141069         break;
11151070
1116      /* latch 2 value */
1071      // latch 2 value
11171072      case 0x1d:
11181073         state->m_actual_vc_latch0 = newword;
11191074         state->m_actual_vc_latch1 = -1;
r18571r18572
11211076         atarigen_set_playfield2_latch(state, (state->m_atarivc_data[0x0a] & 0x80) ? state->m_actual_vc_latch1 : -1);
11221077         break;
11231078
1124      /* scanline IRQ ack here */
1079      // scanline IRQ ack here
11251080      case 0x1e:
1126         /* hack: this should be a device */
1127         atarigen_scanline_int_ack_w(screen.machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff);
1081         // hack: this should be a device
1082         state->scanline_int_ack_w(screen.machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff);
11281083         break;
11291084
1130      /* log anything else */
1085      // log anything else
11311086      case 0x00:
11321087      default:
11331088         if (oldword != newword)
r18571r18572
11371092}
11381093
11391094
1140/*---------------------------------------------------------------
1141    atarivc_r: Handles an I/O read from the video controller.
1142---------------------------------------------------------------*/
1095//-------------------------------------------------
1096//  atarivc_r: Handles an I/O read from the video controller.
1097//-------------------------------------------------
11431098
11441099UINT16 atarivc_r(screen_device &screen, offs_t offset)
11451100{
r18571r18572
11471102
11481103   logerror("vc_r(%02X)\n", offset);
11491104
1150   /* a read from offset 0 returns the current scanline */
1151   /* also sets bit 0x4000 if we're in VBLANK */
1105   // a read from offset 0 returns the current scanline
1106   // also sets bit 0x4000 if we're in VBLANK
11521107   if (offset == 0)
11531108   {
11541109      int result = screen.vpos();
r18571r18572
11701125    PLAYFIELD/ALPHA MAP HELPERS
11711126***************************************************************************/
11721127
1173/*---------------------------------------------------------------
1174    atarigen_alpha_w: Generic write handler for alpha RAM.
1175---------------------------------------------------------------*/
1128//-------------------------------------------------
1129//  atarigen_alpha_w: Generic write handler for alpha RAM.
1130//-------------------------------------------------
11761131
11771132WRITE16_HANDLER( atarigen_alpha_w )
11781133{
r18571r18572
12001155
12011156
12021157
1203/*---------------------------------------------------------------
1204    atarigen_set_playfield_latch: Sets the latch for the latched
1205    playfield handlers below.
1206---------------------------------------------------------------*/
1158//-------------------------------------------------
1159//  atarigen_set_playfield_latch: Sets the latch for the latched
1160//  playfield handlers below.
1161//-------------------------------------------------
12071162
12081163void atarigen_set_playfield_latch(atarigen_state *state, int data)
12091164{
r18571r18572
12171172
12181173
12191174
1220/*---------------------------------------------------------------
1221    atarigen_playfield_w: Generic write handler for PF RAM.
1222---------------------------------------------------------------*/
1175//-------------------------------------------------
1176//  atarigen_playfield_w: Generic write handler for PF RAM.
1177//-------------------------------------------------
12231178
12241179WRITE16_HANDLER( atarigen_playfield_w )
12251180{
r18571r18572
12471202
12481203
12491204
1250/*---------------------------------------------------------------
1251    atarigen_playfield_large_w: Generic write handler for
1252    large (2-word) playfield RAM.
1253---------------------------------------------------------------*/
1205//-------------------------------------------------
1206//  atarigen_playfield_large_w: Generic write handler for
1207//  large (2-word) playfield RAM.
1208//-------------------------------------------------
12541209
12551210WRITE16_HANDLER( atarigen_playfield_large_w )
12561211{
r18571r18572
12611216
12621217
12631218
1264/*---------------------------------------------------------------
1265    atarigen_playfield_upper_w: Generic write handler for
1266    upper word of split playfield RAM.
1267---------------------------------------------------------------*/
1219//-------------------------------------------------
1220//  atarigen_playfield_upper_w: Generic write handler for
1221//  upper word of split playfield RAM.
1222//-------------------------------------------------
12681223
12691224WRITE16_HANDLER( atarigen_playfield_upper_w )
12701225{
r18571r18572
12751230
12761231
12771232
1278/*---------------------------------------------------------------
1279    atarigen_playfield_dual_upper_w: Generic write handler for
1280    upper word of split dual playfield RAM.
1281---------------------------------------------------------------*/
1233//-------------------------------------------------
1234//  atarigen_playfield_dual_upper_w: Generic write handler for
1235//  upper word of split dual playfield RAM.
1236//-------------------------------------------------
12821237
12831238WRITE16_HANDLER( atarigen_playfield_dual_upper_w )
12841239{
r18571r18572
12901245
12911246
12921247
1293/*---------------------------------------------------------------
1294    atarigen_playfield_latched_lsb_w: Generic write handler for
1295    lower word of playfield RAM with a latch in the LSB of the
1296    upper word.
1297---------------------------------------------------------------*/
1248//-------------------------------------------------
1249//  atarigen_playfield_latched_lsb_w: Generic write handler for
1250//  lower word of playfield RAM with a latch in the LSB of the
1251//  upper word.
1252//-------------------------------------------------
12981253
12991254WRITE16_HANDLER( atarigen_playfield_latched_lsb_w )
13001255{
r18571r18572
13091264
13101265
13111266
1312/*---------------------------------------------------------------
1313    atarigen_playfield_latched_lsb_w: Generic write handler for
1314    lower word of playfield RAM with a latch in the MSB of the
1315    upper word.
1316---------------------------------------------------------------*/
1267//-------------------------------------------------
1268//  atarigen_playfield_latched_lsb_w: Generic write handler for
1269//  lower word of playfield RAM with a latch in the MSB of the
1270//  upper word.
1271//-------------------------------------------------
13171272
13181273WRITE16_HANDLER( atarigen_playfield_latched_msb_w )
13191274{
r18571r18572
13281283
13291284
13301285
1331/*---------------------------------------------------------------
1332    atarigen_playfield_latched_lsb_w: Generic write handler for
1333    lower word of second playfield RAM with a latch in the MSB
1334    of the upper word.
1335---------------------------------------------------------------*/
1286//-------------------------------------------------
1287//  atarigen_playfield_latched_lsb_w: Generic write handler for
1288//  lower word of second playfield RAM with a latch in the MSB
1289//  of the upper word.
1290//-------------------------------------------------
13361291
13371292WRITE16_HANDLER( atarigen_playfield2_latched_msb_w )
13381293{
r18571r18572
13521307    VIDEO HELPERS
13531308***************************************************************************/
13541309
1355/*---------------------------------------------------------------
1356    atarigen_get_hblank: Returns a guesstimate about the current
1357    HBLANK state, based on the assumption that HBLANK represents
1358    10% of the scanline period.
1359---------------------------------------------------------------*/
1310//-------------------------------------------------
1311//  atarigen_get_hblank: Returns a guesstimate about the current
1312//  HBLANK state, based on the assumption that HBLANK represents
1313//  10% of the scanline period.
1314//-------------------------------------------------
13601315
13611316int atarigen_get_hblank(screen_device &screen)
13621317{
r18571r18572
13641319}
13651320
13661321
1367/*---------------------------------------------------------------
1368    atarigen_halt_until_hblank_0: Halts CPU 0 until the
1369    next HBLANK.
1370---------------------------------------------------------------*/
1322//-------------------------------------------------
1323//  halt_until_hblank_0: Halts CPU 0 until the
1324//  next HBLANK.
1325//-------------------------------------------------
13711326
1372void atarigen_halt_until_hblank_0(screen_device &screen)
1327void atarigen_state::halt_until_hblank_0(device_t &device, screen_device &screen)
13731328{
1374   device_t *cpu = screen.machine().device("maincpu");
1375
1376   /* halt the CPU until the next HBLANK */
1329   // halt the CPU until the next HBLANK
13771330   int hpos = screen.hpos();
13781331   int width = screen.width();
13791332   int hblank = width * 9 / 10;
13801333
1381   /* if we're in hblank, set up for the next one */
1334   // if we're in hblank, set up for the next one
13821335   if (hpos >= hblank)
13831336      hblank += width;
13841337
1385   /* halt and set a timer to wake up */
1386   screen.machine().scheduler().timer_set(screen.scan_period() * (hblank - hpos) / width, FUNC(unhalt_cpu), 0, (void *)cpu);
1387   cpu->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
1338   // halt and set a timer to wake up
1339   device.execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
1340   timer_set(screen.scan_period() * (hblank - hpos) / width, TID_UNHALT_CPU, 0, (void *)&device);
13881341}
13891342
13901343
1391/*---------------------------------------------------------------
1392    atarigen_666_paletteram_w: 6-6-6 RGB palette RAM handler.
1393---------------------------------------------------------------*/
1344//-------------------------------------------------
1345//  atarigen_666_paletteram_w: 6-6-6 RGB palette RAM handler.
1346//-------------------------------------------------
13941347
13951348WRITE16_HANDLER( atarigen_666_paletteram_w )
13961349{
r18571r18572
14081361}
14091362
14101363
1411/*---------------------------------------------------------------
1412    atarigen_expanded_666_paletteram_w: 6-6-6 RGB expanded
1413    palette RAM handler.
1414---------------------------------------------------------------*/
1364//-------------------------------------------------
1365//  atarigen_expanded_666_paletteram_w: 6-6-6 RGB expanded
1366//  palette RAM handler.
1367//-------------------------------------------------
14151368
14161369WRITE16_HANDLER( atarigen_expanded_666_paletteram_w )
14171370{
r18571r18572
14341387}
14351388
14361389
1437/*---------------------------------------------------------------
1438    atarigen_666_paletteram32_w: 6-6-6 RGB palette RAM handler.
1439---------------------------------------------------------------*/
1390//-------------------------------------------------
1391//  atarigen_666_paletteram32_w: 6-6-6 RGB palette RAM handler.
1392//-------------------------------------------------
14401393
14411394WRITE32_HANDLER( atarigen_666_paletteram32_w )
14421395{
r18571r18572
14691422}
14701423
14711424
1472/*---------------------------------------------------------------
1473    unhalt_cpu: Timer callback to release the CPU from a halted state.
1474---------------------------------------------------------------*/
14751425
1476static TIMER_CALLBACK( unhalt_cpu )
1477{
1478   device_t *cpu = (device_t *)ptr;
1479   cpu->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
1480}
1481
1482
1483
14841426/***************************************************************************
14851427    MISC HELPERS
14861428***************************************************************************/
14871429
1488/*---------------------------------------------------------------
1489    atarigen_swap_mem: Inverts the bits in a region.
1490---------------------------------------------------------------*/
1430//-------------------------------------------------
1431//  atarigen_swap_mem: Inverts the bits in a region.
1432//-------------------------------------------------
14911433
14921434void atarigen_swap_mem(void *ptr1, void *ptr2, int bytes)
14931435{
r18571r18572
15021444}
15031445
15041446
1505/*---------------------------------------------------------------
1506    atarigen_blend_gfx: Takes two GFXElements and blends their
1507    data together to form one. Then frees the second.
1508---------------------------------------------------------------*/
1447//-------------------------------------------------
1448//  atarigen_blend_gfx: Takes two GFXElements and blends their
1449//  data together to form one. Then frees the second.
1450//-------------------------------------------------
15091451
15101452void atarigen_blend_gfx(running_machine &machine, int gfx0, int gfx1, int mask0, int mask1)
15111453{
r18571r18572
15141456   UINT8 *srcdata, *dest;
15151457   int c, x, y;
15161458
1517   /* allocate memory for the assembled data */
1459   // allocate memory for the assembled data
15181460   srcdata = auto_alloc_array(machine, UINT8, gx0->elements() * gx0->width() * gx0->height());
15191461
1520   /* loop over elements */
1462   // loop over elements
15211463   dest = srcdata;
15221464   for (c = 0; c < gx0->elements(); c++)
15231465   {
15241466      const UINT8 *c0base = gx0->get_data(c);
15251467      const UINT8 *c1base = gx1->get_data(c);
15261468
1527      /* loop over height */
1469      // loop over height
15281470      for (y = 0; y < gx0->height(); y++)
15291471      {
15301472         const UINT8 *c0 = c0base;
r18571r18572
15421484   gx0->set_raw_layout(srcdata, gx0->width(), gx0->height(), gx0->elements(), 8 * gx0->width(), 8 * gx0->width() * gx0->height());
15431485   gx0->set_granularity(granularity);
15441486
1545   /* free the second graphics element */
1487   // free the second graphics element
15461488   machine.gfx[gfx1] = NULL;
15471489   auto_free(machine, gx1);
15481490}
r18571r18572
15531495//  VECTOR AND EARLY RASTER EAROM INTERFACE
15541496//**************************************************************************
15551497
1556void atarigen_state::machine_start()
1557{
1558   // until everyone is converted to modern devices, call our parent
1559   driver_device::machine_start();
1560
1561   save_item(NAME(m_earom_data));
1562   save_item(NAME(m_earom_control));
1563}
1564
1565
1566void atarigen_state::machine_reset()
1567{
1568   // until everyone is converted to modern devices, call our parent
1569   driver_device::machine_reset();
1570
1571   // reset the control latch on the EAROM, if present
1572   if (m_earom != NULL)
1573      m_earom->set_control(0, 1, 1, 0, 0);
1574}
1575
1576
1577
1578//**************************************************************************
1579//  VECTOR AND EARLY RASTER EAROM INTERFACE
1580//**************************************************************************
1581
15821498READ8_MEMBER( atarigen_state::earom_r )
15831499{
15841500   // return data latched from previous clock
trunk/src/mame/machine/atarigen.h
r18571r18572
4242
4343#include "machine/nvram.h"
4444#include "machine/er2055.h"
45#include "cpu/m6502/m6502.h"
4546
4647
4748/***************************************************************************
r18571r18572
5960    TYPES & STRUCTURES
6061***************************************************************************/
6162
62typedef void (*atarigen_int_func)(running_machine &machine);
63
64typedef void (*atarigen_scanline_func)(screen_device &screen, int scanline);
65
6663struct atarivc_state_desc
6764{
6865   UINT32 latch1;                     /* latch #1 value (-1 means disabled) */
r18571r18572
9289class atarigen_state : public driver_device
9390{
9491public:
95   atarigen_state(const machine_config &mconfig, device_type type, const char *tag)
96      : driver_device(mconfig, type, tag),
97        m_earom(*this, "earom"),
98        m_eeprom(*this, "eeprom"),
99        m_eeprom32(*this, "eeprom"),
100        m_playfield(*this, "playfield"),
101        m_playfield2(*this, "playfield2"),
102        m_playfield_upper(*this, "playfield_up"),
103        m_alpha(*this, "alpha"),
104        m_alpha2(*this, "alpha2"),
105        m_xscroll(*this, "xscroll"),
106        m_yscroll(*this, "yscroll"),
107        m_playfield32(*this, "playfield32"),
108        m_alpha32(*this, "alpha32"),
109        m_atarivc_data(*this, "atarivc_data"),
110        m_atarivc_eof_data(*this, "atarivc_eof")
111   { }
92   // construction/destruction
93   atarigen_state(const machine_config &mconfig, device_type type, const char *tag);
11294
11395   // users must call through to these
11496   virtual void machine_start();
11597   virtual void machine_reset();
98   virtual void device_post_load();
99   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
116100
101   // callbacks provided by the derived class
102   virtual void update_interrupts() = 0;
103   virtual void scanline_update(screen_device &screen, int scanline);
104   
105   // interrupt handling
106   void scanline_int_set(screen_device &screen, int scanline);
107   INTERRUPT_GEN_MEMBER(scanline_int_gen);
108   DECLARE_WRITE16_MEMBER(scanline_int_ack_w);
109
110   // slapstic helpers
111   void slapstic_configure(cpu_device &device, offs_t base, offs_t mirror, int chipnum);
112   void slapstic_update_bank(int bank);
113   DECLARE_DIRECT_UPDATE_MEMBER(slapstic_setdirect);
114   DECLARE_WRITE16_MEMBER(slapstic_w);
115   DECLARE_READ16_MEMBER(slapstic_r);
116   
117   // sound I/O helpers
118   void sound_io_reset();
119   INTERRUPT_GEN_MEMBER(m6502_irq_gen);
120   DECLARE_READ8_MEMBER(m6502_irq_ack_r);
121   DECLARE_WRITE8_MEMBER(m6502_irq_ack_w);
122   DECLARE_WRITE_LINE_MEMBER(ym2151_irq_gen);
123   DECLARE_WRITE16_MEMBER(sound_reset_w);
124   void sound_cpu_reset();
125   DECLARE_WRITE8_MEMBER(sound_w);
126   DECLARE_READ8_MEMBER(sound_r);
127   DECLARE_WRITE8_MEMBER(m6502_sound_w);
128   DECLARE_READ8_MEMBER(m6502_sound_r);
129   void update_m6502_irq();
130   void delayed_sound_reset(int param);
131   void delayed_sound_write(int data);
132   void delayed_6502_write(int data);
133   
134   // sound helpers
135   void set_volume_by_type(int volume, device_type type);
136   void set_ym2151_volume(int volume);
137   void set_ym2413_volume(int volume);
138   void set_pokey_volume(int volume);
139   void set_tms5220_volume(int volume);
140   void set_oki6295_volume(int volume);
141
142   // scanline timing
143   void scanline_timer_reset(screen_device &screen, int frequency);
144   void scanline_timer(emu_timer &timer, screen_device &screen, int scanline);
145
146   // video controller
147   void atarivc_eof_update(emu_timer &timer, screen_device &screen);
148
149   // video helpers
150   void halt_until_hblank_0(device_t &device, screen_device &screen);
151
117152   // vector and early raster EAROM interface
118153   DECLARE_READ8_MEMBER( earom_r );
119154   DECLARE_WRITE8_MEMBER( earom_w );
120155   DECLARE_WRITE8_MEMBER( earom_control_w );
156   
157   // timer IDs
158   enum
159   {
160      TID_SCANLINE_INTERRUPT,
161      TID_SOUND_RESET,
162      TID_SOUND_WRITE,
163      TID_6502_WRITE,
164      TID_SCANLINE_TIMER,
165      TID_ATARIVC_EOF,
166      TID_UNHALT_CPU
167   };
121168
122   DECLARE_WRITE_LINE_MEMBER( ym2151_irq_gen );
123
124169   // vector and early raster EAROM interface
125170   optional_device<er2055_device> m_earom;
126171   UINT8            m_earom_data;
r18571r18572
149194   optional_shared_ptr<UINT32> m_playfield32;
150195   optional_shared_ptr<UINT32> m_alpha32;
151196
152   tilemap_t *         m_playfield_tilemap;
153   tilemap_t *         m_playfield2_tilemap;
154   tilemap_t *         m_alpha_tilemap;
155   tilemap_t *         m_alpha2_tilemap;
197   tilemap_t *            m_playfield_tilemap;
198   tilemap_t *            m_playfield2_tilemap;
199   tilemap_t *            m_alpha_tilemap;
200   tilemap_t *            m_alpha2_tilemap;
156201
157202   optional_shared_ptr<UINT16> m_atarivc_data;
158203   optional_shared_ptr<UINT16> m_atarivc_eof_data;
159   atarivc_state_desc   m_atarivc_state;
204   atarivc_state_desc      m_atarivc_state;
160205
161206   /* internal state */
162   atarigen_int_func      m_update_int_callback;
207   bool               m_eeprom_unlocked;
163208
164   UINT8               m_eeprom_unlocked;
165
166209   UINT8               m_slapstic_num;
167210   UINT16 *            m_slapstic;
168211   UINT8               m_slapstic_bank;
169   void *               m_slapstic_bank0;
212   dynamic_buffer         m_slapstic_bank0;
170213   offs_t               m_slapstic_last_pc;
171214   offs_t               m_slapstic_last_address;
172215   offs_t               m_slapstic_base;
173216   offs_t               m_slapstic_mirror;
174217
175   device_t *      m_sound_cpu;
218   optional_device<m6502_device> m_sound_cpu;
176219   UINT8               m_cpu_to_sound;
177220   UINT8               m_sound_to_cpu;
178221   UINT8               m_timed_int;
179222   UINT8               m_ym2151_int;
180223
181   atarigen_scanline_func   m_scanline_callback;
182224   UINT32               m_scanlines_per_callback;
183225
184226   UINT32               m_actual_vc_latch0;
r18571r18572
189231   UINT32               m_playfield2_latch;
190232
191233   atarigen_screen_timer   m_screen_timer[2];
192
193   DECLARE_DIRECT_UPDATE_MEMBER(atarigen_slapstic_setdirect);
194234};
195235
196236
r18571r18572
200240***************************************************************************/
201241
202242/*---------------------------------------------------------------
203    OVERALL INIT
204---------------------------------------------------------------*/
205
206void atarigen_init(running_machine &machine);
207
208
209/*---------------------------------------------------------------
210243    INTERRUPT HANDLING
211244---------------------------------------------------------------*/
212245
213void atarigen_interrupt_reset(atarigen_state *state, atarigen_int_func update_int);
214void atarigen_update_interrupts(running_machine &machine);
215
216void atarigen_scanline_int_set(screen_device &screen, int scanline);
217INTERRUPT_GEN( atarigen_scanline_int_gen );
218DECLARE_WRITE16_HANDLER( atarigen_scanline_int_ack_w );
219DECLARE_WRITE32_HANDLER( atarigen_scanline_int_ack32_w );
220
221246INTERRUPT_GEN( atarigen_sound_int_gen );
222247DECLARE_WRITE16_HANDLER( atarigen_sound_int_ack_w );
223248DECLARE_WRITE32_HANDLER( atarigen_sound_int_ack32_w );
r18571r18572
231256    EEPROM HANDLING
232257---------------------------------------------------------------*/
233258
234void atarigen_eeprom_reset(atarigen_state *state);
235
236259DECLARE_WRITE16_HANDLER( atarigen_eeprom_enable_w );
237260DECLARE_WRITE16_HANDLER( atarigen_eeprom_w );
238261DECLARE_READ16_HANDLER( atarigen_eeprom_r );
r18571r18572
244267
245268
246269/*---------------------------------------------------------------
247    SLAPSTIC HANDLING
248---------------------------------------------------------------*/
249
250void atarigen_slapstic_init(device_t *device, offs_t base, offs_t mirror, int chipnum);
251void atarigen_slapstic_reset(atarigen_state *state);
252
253DECLARE_WRITE16_HANDLER( atarigen_slapstic_w );
254DECLARE_READ16_HANDLER( atarigen_slapstic_r );
255
256
257/*---------------------------------------------------------------
258    SOUND I/O
259---------------------------------------------------------------*/
260
261void atarigen_sound_io_reset(device_t *device);
262
263INTERRUPT_GEN( atarigen_6502_irq_gen );
264DECLARE_READ8_HANDLER( atarigen_6502_irq_ack_r );
265DECLARE_WRITE8_HANDLER( atarigen_6502_irq_ack_w );
266
267DECLARE_WRITE16_HANDLER( atarigen_sound_w );
268DECLARE_READ16_HANDLER( atarigen_sound_r );
269DECLARE_WRITE16_HANDLER( atarigen_sound_upper_w );
270DECLARE_READ16_HANDLER( atarigen_sound_upper_r );
271
272DECLARE_WRITE32_HANDLER( atarigen_sound_upper32_w );
273DECLARE_READ32_HANDLER( atarigen_sound_upper32_r );
274
275void atarigen_sound_reset(running_machine &machine);
276DECLARE_WRITE16_HANDLER( atarigen_sound_reset_w );
277DECLARE_WRITE8_HANDLER( atarigen_6502_sound_w );
278DECLARE_READ8_HANDLER( atarigen_6502_sound_r );
279
280
281/*---------------------------------------------------------------
282    SOUND HELPERS
283---------------------------------------------------------------*/
284
285void atarigen_set_ym2151_vol(running_machine &machine, int volume);
286void atarigen_set_ym2413_vol(running_machine &machine, int volume);
287void atarigen_set_pokey_vol(running_machine &machine, int volume);
288void atarigen_set_tms5220_vol(running_machine &machine, int volume);
289void atarigen_set_oki6295_vol(running_machine &machine, int volume);
290
291
292/*---------------------------------------------------------------
293270    VIDEO CONTROLLER
294271---------------------------------------------------------------*/
295272
r18571r18572
329306    VIDEO HELPERS
330307---------------------------------------------------------------*/
331308
332void atarigen_scanline_timer_reset(screen_device &screen, atarigen_scanline_func update_graphics, int frequency);
333309int atarigen_get_hblank(screen_device &screen);
334void atarigen_halt_until_hblank_0(screen_device &screen);
335310DECLARE_WRITE16_HANDLER( atarigen_666_paletteram_w );
336311DECLARE_WRITE16_HANDLER( atarigen_expanded_666_paletteram_w );
337312DECLARE_WRITE32_HANDLER( atarigen_666_paletteram32_w );
trunk/src/mame/machine/harddriv.c
r18571r18572
3636 *************************************/
3737
3838
39static void hd68k_update_interrupts(running_machine &machine);
40
41
42
4339#if 0
4440#pragma mark * DRIVER/MULTISYNC BOARD
4541#endif
r18571r18572
5349
5450MACHINE_START_MEMBER(harddriv_state,harddriv)
5551{
52   atarigen_state::machine_start();
5653
57   atarigen_init(machine());
58
5954   /* predetermine memory regions */
6055   m_sim_memory = (UINT16 *)memregion("user1")->base();
6156   m_sim_memory_size = memregion("user1")->bytes() / 2;
r18571r18572
6560
6661MACHINE_RESET_MEMBER(harddriv_state,harddriv)
6762{
68
6963   /* generic reset */
70   atarigen_eeprom_reset(this);
64   atarigen_state::machine_reset();
7165   slapstic_reset();
72   atarigen_interrupt_reset(this, hd68k_update_interrupts);
7366
7467   /* halt several of the DSPs to start */
7568   if (m_adsp != NULL) m_adsp->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
r18571r18572
7871
7972   /* if we found a 6502, reset the JSA board */
8073   if (m_jsacpu != NULL)
81      atarijsa_reset();
74      atarijsa_reset(machine());
8275
8376   m_last_gsp_shiftreg = 0;
8477
r18571r18572
10194 *
10295 *************************************/
10396
104static void hd68k_update_interrupts(running_machine &machine)
97void harddriv_state::update_interrupts()
10598{
106   harddriv_state *state = machine.driver_data<harddriv_state>();
107   state->m_maincpu->set_input_line(1, state->m_msp_irq_state ? ASSERT_LINE : CLEAR_LINE);
108   state->m_maincpu->set_input_line(2, state->m_adsp_irq_state ? ASSERT_LINE : CLEAR_LINE);
109   state->m_maincpu->set_input_line(3, state->m_gsp_irq_state ? ASSERT_LINE : CLEAR_LINE);
110   state->m_maincpu->set_input_line(4, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);   /* /LINKIRQ on STUN Runner */
111   state->m_maincpu->set_input_line(5, state->m_irq_state ? ASSERT_LINE : CLEAR_LINE);
112   state->m_maincpu->set_input_line(6, state->m_duart_irq_state ? ASSERT_LINE : CLEAR_LINE);
99   m_maincpu->set_input_line(1, m_msp_irq_state ? ASSERT_LINE : CLEAR_LINE);
100   m_maincpu->set_input_line(2, m_adsp_irq_state ? ASSERT_LINE : CLEAR_LINE);
101   m_maincpu->set_input_line(3, m_gsp_irq_state ? ASSERT_LINE : CLEAR_LINE);
102   m_maincpu->set_input_line(4, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);   /* /LINKIRQ on STUN Runner */
103   m_maincpu->set_input_line(5, m_irq_state ? ASSERT_LINE : CLEAR_LINE);
104   m_maincpu->set_input_line(6, m_duart_irq_state ? ASSERT_LINE : CLEAR_LINE);
113105}
114106
115107
116108INTERRUPT_GEN_MEMBER(harddriv_state::hd68k_irq_gen)
117109{
118110   m_irq_state = 1;
119   atarigen_update_interrupts(machine());
111   update_interrupts();
120112}
121113
122114
r18571r18572
124116{
125117   harddriv_state *state = space.machine().driver_data<harddriv_state>();
126118   state->m_irq_state = 0;
127   atarigen_update_interrupts(space.machine());
119   state->update_interrupts();
128120}
129121
130122
r18571r18572
132124{
133125   harddriv_state *state = device->machine().driver_data<harddriv_state>();
134126   state->m_gsp_irq_state = irqstate;
135   atarigen_update_interrupts(device->machine());
127   state->update_interrupts();
136128}
137129
138130
r18571r18572
140132{
141133   harddriv_state *state = device->machine().driver_data<harddriv_state>();
142134   state->m_msp_irq_state = irqstate;
143   atarigen_update_interrupts(device->machine());
135   state->update_interrupts();
144136}
145137
146138
r18571r18572
317309{
318310   harddriv_state *state = space.machine().driver_data<harddriv_state>();
319311   if (state->m_jsacpu != NULL)
320      atarijsa_reset();
312      atarijsa_reset(space.machine());
321313   return ~0;
322314}
323315
r18571r18572
477469{
478470   harddriv_state *hd_state = device->machine().driver_data<harddriv_state>();
479471   hd_state->m_duart_irq_state = state;
480   atarigen_update_interrupts(device->machine());
472   hd_state->update_interrupts();
481473}
482474
483475
r18571r18572
756748   harddriv_state *state = space.machine().driver_data<harddriv_state>();
757749   logerror("%06X:68k clears ADSP interrupt\n", space.device().safe_pcbase());
758750   state->m_adsp_irq_state = 0;
759   atarigen_update_interrupts(space.machine());
751   state->update_interrupts();
760752}
761753
762754
r18571r18572
830822      case 6:   /* /GINT */
831823         logerror("%04X:ADSP signals interrupt\n", space.device().safe_pcbase());
832824         state->m_adsp_irq_state = 1;
833         atarigen_update_interrupts(space.machine());
825         state->update_interrupts();
834826         break;
835827
836828      case 7:   /* /MP */
r18571r18572
10871079      case 1:
10881080         logerror("%04X:ADSP sets interrupt = %d\n", space.device().safe_pcbase(), (data >> 1) & 1);
10891081         state->m_adsp_irq_state = (data >> 1) & 1;
1090         hd68k_update_interrupts(space.machine());
1082         state->update_interrupts();
10911083         break;
10921084
10931085      case 2:
r18571r18572
11801172{
11811173   atarigen_state *atarigen = device.machine().driver_data<atarigen_state>();
11821174   atarigen->m_sound_int_state = ((pins & DSP32_OUTPUT_PIF) != 0);
1183   hd68k_update_interrupts(device.machine());
1175   atarigen->update_interrupts();
11841176}
11851177
11861178
trunk/src/mame/video/cyberbal.c
r18571r18572
256256 *
257257 *************************************/
258258
259void cyberbal_scanline_update(screen_device &screen, int scanline)
259void cyberbal_state::scanline_update(screen_device &screen, int scanline)
260260{
261   cyberbal_state *state = screen.machine().driver_data<cyberbal_state>();
262261   int i;
263262   screen_device *update_screen;
264263
265264   /* loop over screens */
266   screen_device_iterator iter(screen.machine().root_device());
265   screen_device_iterator iter(*this);
267266   for (i = 0, update_screen = iter.first(); update_screen != NULL; i++, update_screen = iter.next())
268267   {
269      UINT16 *vram = i ? state->m_alpha2 : state->m_alpha;
268      UINT16 *vram = i ? m_alpha2 : m_alpha;
270269      UINT16 *base = &vram[((scanline - 8) / 8) * 64 + 47];
271270
272271      /* keep in range */
r18571r18572
278277      /* update the current parameters */
279278      if (!(base[3] & 1))
280279      {
281         if (((base[3] >> 1) & 7) != state->m_playfield_palette_bank[i])
280         if (((base[3] >> 1) & 7) != m_playfield_palette_bank[i])
282281         {
283282            if (scanline > 0)
284283               update_screen->update_partial(scanline - 1);
285            state->m_playfield_palette_bank[i] = (base[3] >> 1) & 7;
286            (i ? state->m_playfield2_tilemap : state->m_playfield_tilemap)->set_palette_offset(state->m_playfield_palette_bank[i] << 8);
284            m_playfield_palette_bank[i] = (base[3] >> 1) & 7;
285            (i ? m_playfield2_tilemap : m_playfield_tilemap)->set_palette_offset(m_playfield_palette_bank[i] << 8);
287286         }
288287      }
289288      if (!(base[4] & 1))
290289      {
291290         int newscroll = 2 * (((base[4] >> 7) + 4) & 0x1ff);
292         if (newscroll != state->m_playfield_xscroll[i])
291         if (newscroll != m_playfield_xscroll[i])
293292         {
294293            if (scanline > 0)
295294               update_screen->update_partial(scanline - 1);
296            (i ? state->m_playfield2_tilemap : state->m_playfield_tilemap)->set_scrollx(0, newscroll);
297            state->m_playfield_xscroll[i] = newscroll;
295            (i ? m_playfield2_tilemap : m_playfield_tilemap)->set_scrollx(0, newscroll);
296            m_playfield_xscroll[i] = newscroll;
298297         }
299298      }
300299      if (!(base[5] & 1))
301300      {
302301         /* a new vscroll latches the offset into a counter; we must adjust for this */
303302         int newscroll = ((base[5] >> 7) - (scanline)) & 0x1ff;
304         if (newscroll != state->m_playfield_yscroll[i])
303         if (newscroll != m_playfield_yscroll[i])
305304         {
306305            if (scanline > 0)
307306               update_screen->update_partial(scanline - 1);
308            (i ? state->m_playfield2_tilemap : state->m_playfield_tilemap)->set_scrolly(0, newscroll);
309            state->m_playfield_yscroll[i] = newscroll;
307            (i ? m_playfield2_tilemap : m_playfield_tilemap)->set_scrolly(0, newscroll);
308            m_playfield_yscroll[i] = newscroll;
310309         }
311310      }
312311      if (!(base[7] & 1))
313312      {
314         if (state->m_current_slip[i] != base[7])
313         if (m_current_slip[i] != base[7])
315314         {
316315            if (scanline > 0)
317316               update_screen->update_partial(scanline - 1);
318            state->m_current_slip[i] = base[7];
317            m_current_slip[i] = base[7];
319318         }
320319      }
321320   }
trunk/src/mame/video/atarigx2.c
r18571r18572
108108}
109109
110110
111void atarigx2_scanline_update(screen_device &screen, int scanline)
111void atarigx2_state::scanline_update(screen_device &screen, int scanline)
112112{
113   atarigx2_state *state = screen.machine().driver_data<atarigx2_state>();
114   UINT32 *base = &state->m_alpha32[(scanline / 8) * 32 + 24];
113   UINT32 *base = &m_alpha32[(scanline / 8) * 32 + 24];
115114   int i;
116115
117116   if (scanline == 0) logerror("-------\n");
118117
119118   /* keep in range */
120   if (base >= &state->m_alpha32[0x400])
119   if (base >= &m_alpha32[0x400])
121120      return;
122121
123122   /* update the playfield scrolls */
r18571r18572
129128      {
130129         int newscroll = (word >> 21) & 0x3ff;
131130         int newbank = (word >> 16) & 0x1f;
132         if (newscroll != state->m_playfield_xscroll)
131         if (newscroll != m_playfield_xscroll)
133132         {
134133            if (scanline + i > 0)
135134               screen.update_partial(scanline + i - 1);
136            state->m_playfield_tilemap->set_scrollx(0, newscroll);
137            state->m_playfield_xscroll = newscroll;
135            m_playfield_tilemap->set_scrollx(0, newscroll);
136            m_playfield_xscroll = newscroll;
138137         }
139         if (newbank != state->m_playfield_color_bank)
138         if (newbank != m_playfield_color_bank)
140139         {
141140            if (scanline + i > 0)
142141               screen.update_partial(scanline + i - 1);
143            state->m_playfield_tilemap->mark_all_dirty();
144            state->m_playfield_color_bank = newbank;
142            m_playfield_tilemap->mark_all_dirty();
143            m_playfield_color_bank = newbank;
145144         }
146145      }
147146
r18571r18572
149148      {
150149         int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff;
151150         int newbank = word & 15;
152         if (newscroll != state->m_playfield_yscroll)
151         if (newscroll != m_playfield_yscroll)
153152         {
154153            if (scanline + i > 0)
155154               screen.update_partial(scanline + i - 1);
156            state->m_playfield_tilemap->set_scrolly(0, newscroll);
157            state->m_playfield_yscroll = newscroll;
155            m_playfield_tilemap->set_scrolly(0, newscroll);
156            m_playfield_yscroll = newscroll;
158157         }
159         if (newbank != state->m_playfield_tile_bank)
158         if (newbank != m_playfield_tile_bank)
160159         {
161160            if (scanline + i > 0)
162161               screen.update_partial(scanline + i - 1);
163            state->m_playfield_tilemap->mark_all_dirty();
164            state->m_playfield_tile_bank = newbank;
162            m_playfield_tilemap->mark_all_dirty();
163            m_playfield_tile_bank = newbank;
165164         }
166165      }
167166   }
trunk/src/mame/video/atarig1.c
r18571r18572
8787}
8888
8989
90void atarig1_scanline_update(screen_device &screen, int scanline)
90void atarig1_state::scanline_update(screen_device &screen, int scanline)
9191{
92   atarig1_state *state = screen.machine().driver_data<atarig1_state>();
93   UINT16 *base = &state->m_alpha[(scanline / 8) * 64 + 48];
92   UINT16 *base = &m_alpha[(scanline / 8) * 64 + 48];
9493   int i;
9594
9695   //if (scanline == 0) logerror("-------\n");
9796
9897   /* keep in range */
99   if (base >= &state->m_alpha[0x800])
98   if (base >= &m_alpha[0x800])
10099      return;
101100   screen.update_partial(MAX(scanline - 1, 0));
102101
r18571r18572
109108      word = *base++;
110109      if (word & 0x8000)
111110      {
112         int newscroll = ((word >> 6) + state->m_pfscroll_xoffset) & 0x1ff;
113         if (newscroll != state->m_playfield_xscroll)
111         int newscroll = ((word >> 6) + m_pfscroll_xoffset) & 0x1ff;
112         if (newscroll != m_playfield_xscroll)
114113         {
115114            screen.update_partial(MAX(scanline + i - 1, 0));
116            state->m_playfield_tilemap->set_scrollx(0, newscroll);
117            state->m_playfield_xscroll = newscroll;
115            m_playfield_tilemap->set_scrollx(0, newscroll);
116            m_playfield_xscroll = newscroll;
118117         }
119118      }
120119
r18571r18572
124123      {
125124         int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff;
126125         int newbank = word & 7;
127         if (newscroll != state->m_playfield_yscroll)
126         if (newscroll != m_playfield_yscroll)
128127         {
129128            screen.update_partial(MAX(scanline + i - 1, 0));
130            state->m_playfield_tilemap->set_scrolly(0, newscroll);
131            state->m_playfield_yscroll = newscroll;
129            m_playfield_tilemap->set_scrolly(0, newscroll);
130            m_playfield_yscroll = newscroll;
132131         }
133         if (newbank != state->m_playfield_tile_bank)
132         if (newbank != m_playfield_tile_bank)
134133         {
135134            screen.update_partial(MAX(scanline + i - 1, 0));
136            state->m_playfield_tilemap->mark_all_dirty();
137            state->m_playfield_tile_bank = newbank;
135            m_playfield_tilemap->mark_all_dirty();
136            m_playfield_tile_bank = newbank;
138137         }
139138      }
140139   }
trunk/src/mame/video/atarisy1.c
r18571r18572
224224   if (diff & 0x0080)
225225   {
226226      space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, (newselect & 0x0080) ? CLEAR_LINE : ASSERT_LINE);
227      if (!(newselect & 0x0080)) atarigen_sound_reset(space.machine());
227      if (!(newselect & 0x0080)) state->sound_cpu_reset();
228228   }
229229
230230   /* if MO or playfield banks change, force a partial update */
r18571r18572
386386   address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM);
387387
388388   /* clear the state */
389   atarigen_scanline_int_ack_w(space, 0, 0, 0xffff);
389   scanline_int_ack_w(space, 0, 0);
390390}
391391
392392
r18571r18572
395395   int scanline = param;
396396
397397   /* update the state */
398   atarigen_scanline_int_gen(machine().device("maincpu"));
398   scanline_int_gen(*subdevice("maincpu"));
399399
400400   /* set a timer to turn it off */
401401   m_int3off_timer->adjust(machine().primary_screen->scan_period());
trunk/src/mame/video/atarig42.c
r18571r18572
108108}
109109
110110
111void atarig42_scanline_update(screen_device &screen, int scanline)
111void atarig42_state::scanline_update(screen_device &screen, int scanline)
112112{
113   atarig42_state *state = screen.machine().driver_data<atarig42_state>();
114   UINT16 *base = &state->m_alpha[(scanline / 8) * 64 + 48];
113   UINT16 *base = &m_alpha[(scanline / 8) * 64 + 48];
115114   int i;
116115
117116   if (scanline == 0) logerror("-------\n");
118117
119118   /* keep in range */
120   if (base >= &state->m_alpha[0x800])
119   if (base >= &m_alpha[0x800])
121120      return;
122121
123122   /* update the playfield scrolls */
r18571r18572
130129      {
131130         int newscroll = (word >> 5) & 0x3ff;
132131         int newbank = word & 0x1f;
133         if (newscroll != state->m_playfield_xscroll)
132         if (newscroll != m_playfield_xscroll)
134133         {
135134            if (scanline + i > 0)
136135               screen.update_partial(scanline + i - 1);
137            state->m_playfield_tilemap->set_scrollx(0, newscroll);
138            state->m_playfield_xscroll = newscroll;
136            m_playfield_tilemap->set_scrollx(0, newscroll);
137            m_playfield_xscroll = newscroll;
139138         }
140         if (newbank != state->m_playfield_color_bank)
139         if (newbank != m_playfield_color_bank)
141140         {
142141            if (scanline + i > 0)
143142               screen.update_partial(scanline + i - 1);
144            state->m_playfield_tilemap->mark_all_dirty();
145            state->m_playfield_color_bank = newbank;
143            m_playfield_tilemap->mark_all_dirty();
144            m_playfield_color_bank = newbank;
146145         }
147146      }
148147
r18571r18572
151150      {
152151         int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff;
153152         int newbank = word & 7;
154         if (newscroll != state->m_playfield_yscroll)
153         if (newscroll != m_playfield_yscroll)
155154         {
156155            if (scanline + i > 0)
157156               screen.update_partial(scanline + i - 1);
158            state->m_playfield_tilemap->set_scrolly(0, newscroll);
159            state->m_playfield_yscroll = newscroll;
157            m_playfield_tilemap->set_scrolly(0, newscroll);
158            m_playfield_yscroll = newscroll;
160159         }
161         if (newbank != state->m_playfield_tile_bank)
160         if (newbank != m_playfield_tile_bank)
162161         {
163162            if (scanline + i > 0)
164163               screen.update_partial(scanline + i - 1);
165            state->m_playfield_tilemap->mark_all_dirty();
166            state->m_playfield_tile_bank = newbank;
164            m_playfield_tilemap->mark_all_dirty();
165            m_playfield_tile_bank = newbank;
167166         }
168167      }
169168   }
trunk/src/mame/video/vindictr.c
r18571r18572
136136 *
137137 *************************************/
138138
139void vindictr_scanline_update(screen_device &screen, int scanline)
139void vindictr_state::scanline_update(screen_device &screen, int scanline)
140140{
141   vindictr_state *state = screen.machine().driver_data<vindictr_state>();
142   UINT16 *base = &state->m_alpha[((scanline - 8) / 8) * 64 + 42];
141   UINT16 *base = &m_alpha[((scanline - 8) / 8) * 64 + 42];
143142   int x;
144143
145144   /* keep in range */
146   if (base < state->m_alpha)
145   if (base < m_alpha)
147146      base += 0x7c0;
148   else if (base >= &state->m_alpha[0x7c0])
147   else if (base >= &m_alpha[0x7c0])
149148      return;
150149
151150   /* update the current parameters */
r18571r18572
156155      switch ((data >> 9) & 7)
157156      {
158157         case 2:      /* /PFB */
159            if (state->m_playfield_tile_bank != (data & 7))
158            if (m_playfield_tile_bank != (data & 7))
160159            {
161160               screen.update_partial(scanline - 1);
162               state->m_playfield_tile_bank = data & 7;
163               state->m_playfield_tilemap->mark_all_dirty();
161               m_playfield_tile_bank = data & 7;
162               m_playfield_tilemap->mark_all_dirty();
164163            }
165164            break;
166165
167166         case 3:      /* /PFHSLD */
168            if (state->m_playfield_xscroll != (data & 0x1ff))
167            if (m_playfield_xscroll != (data & 0x1ff))
169168            {
170169               screen.update_partial(scanline - 1);
171               state->m_playfield_tilemap->set_scrollx(0, data);
172               state->m_playfield_xscroll = data & 0x1ff;
170               m_playfield_tilemap->set_scrollx(0, data);
171               m_playfield_xscroll = data & 0x1ff;
173172            }
174173            break;
175174
r18571r18572
185184            break;
186185
187186         case 6:      /* /VIRQ */
188            atarigen_scanline_int_gen(screen.machine().device("maincpu"));
187            scanline_int_gen(*subdevice("maincpu"));
189188            break;
190189
191190         case 7:      /* /PFVS */
r18571r18572
196195            if (offset > visible_area.max_y)
197196               offset -= visible_area.max_y + 1;
198197
199            if (state->m_playfield_yscroll != ((data - offset) & 0x1ff))
198            if (m_playfield_yscroll != ((data - offset) & 0x1ff))
200199            {
201200               screen.update_partial(scanline - 1);
202               state->m_playfield_tilemap->set_scrolly(0, data - offset);
201               m_playfield_tilemap->set_scrolly(0, data - offset);
203202               atarimo_set_yscroll(0, (data - offset) & 0x1ff);
204203            }
205204            break;
trunk/src/mame/video/atarigt.c
r18571r18572
162162 *
163163 *************************************/
164164
165void atarigt_scanline_update(screen_device &screen, int scanline)
165void atarigt_state::scanline_update(screen_device &screen, int scanline)
166166{
167   atarigt_state *state = screen.machine().driver_data<atarigt_state>();
168   UINT32 *base = &state->m_alpha32[(scanline / 8) * 32 + 24];
167   UINT32 *base = &m_alpha32[(scanline / 8) * 32 + 24];
169168   int i;
170169
171170   /* keep in range */
172   if (base >= &state->m_alpha32[0x400])
171   if (base >= &m_alpha32[0x400])
173172      return;
174173
175174   /* update the playfield scrolls */
r18571r18572
181180      {
182181         int newscroll = (word >> 21) & 0x3ff;
183182         int newbank = (word >> 16) & 0x1f;
184         if (newscroll != state->m_playfield_xscroll)
183         if (newscroll != m_playfield_xscroll)
185184         {
186185            if (scanline + i > 0)
187186               screen.update_partial(scanline + i - 1);
188            state->m_playfield_tilemap->set_scrollx(0, newscroll);
189            state->m_playfield_xscroll = newscroll;
187            m_playfield_tilemap->set_scrollx(0, newscroll);
188            m_playfield_xscroll = newscroll;
190189         }
191         if (newbank != state->m_playfield_color_bank)
190         if (newbank != m_playfield_color_bank)
192191         {
193192            if (scanline + i > 0)
194193               screen.update_partial(scanline + i - 1);
195            state->m_playfield_tilemap->set_palette_offset((newbank & 0x1f) << 8);
196            state->m_playfield_color_bank = newbank;
194            m_playfield_tilemap->set_palette_offset((newbank & 0x1f) << 8);
195            m_playfield_color_bank = newbank;
197196         }
198197      }
199198
r18571r18572
201200      {
202201         int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff;
203202         int newbank = word & 15;
204         if (newscroll != state->m_playfield_yscroll)
203         if (newscroll != m_playfield_yscroll)
205204         {
206205            if (scanline + i > 0)
207206               screen.update_partial(scanline + i - 1);
208            state->m_playfield_tilemap->set_scrolly(0, newscroll);
209            state->m_playfield_yscroll = newscroll;
207            m_playfield_tilemap->set_scrolly(0, newscroll);
208            m_playfield_yscroll = newscroll;
210209         }
211         if (newbank != state->m_playfield_tile_bank)
210         if (newbank != m_playfield_tile_bank)
212211         {
213212            if (scanline + i > 0)
214213               screen.update_partial(scanline + i - 1);
215            state->m_playfield_tilemap->mark_all_dirty();
216            state->m_playfield_tile_bank = newbank;
214            m_playfield_tilemap->mark_all_dirty();
215            m_playfield_tile_bank = newbank;
217216         }
218217      }
219218   }
trunk/src/mame/video/batman.c
r18571r18572
117117 *
118118 *************************************/
119119
120void batman_scanline_update(screen_device &screen, int scanline)
120void batman_state::scanline_update(screen_device &screen, int scanline)
121121{
122   batman_state *state = screen.machine().driver_data<batman_state>();
123
124122   /* update the scanline parameters */
125   if (scanline <= screen.visible_area().max_y && state->m_atarivc_state.rowscroll_enable)
123   if (scanline <= screen.visible_area().max_y && m_atarivc_state.rowscroll_enable)
126124   {
127      UINT16 *base = &state->m_alpha[scanline / 8 * 64 + 48];
125      UINT16 *base = &m_alpha[scanline / 8 * 64 + 48];
128126      int scan, i;
129127
130128      for (scan = 0; scan < 8; scan++, scanline++)
r18571r18572
136134               case 9:
137135                  if (scanline > 0)
138136                     screen.update_partial(scanline - 1);
139                  state->m_atarivc_state.mo_xscroll = (data >> 7) & 0x1ff;
140                  atarimo_set_xscroll(0, state->m_atarivc_state.mo_xscroll);
137                  m_atarivc_state.mo_xscroll = (data >> 7) & 0x1ff;
138                  atarimo_set_xscroll(0, m_atarivc_state.mo_xscroll);
141139                  break;
142140
143141               case 10:
144142                  if (scanline > 0)
145143                     screen.update_partial(scanline - 1);
146                  state->m_atarivc_state.pf1_xscroll_raw = (data >> 7) & 0x1ff;
147                  atarivc_update_pf_xscrolls(state);
148                  state->m_playfield_tilemap->set_scrollx(0, state->m_atarivc_state.pf0_xscroll);
149                  state->m_playfield2_tilemap->set_scrollx(0, state->m_atarivc_state.pf1_xscroll);
144                  m_atarivc_state.pf1_xscroll_raw = (data >> 7) & 0x1ff;
145                  atarivc_update_pf_xscrolls(this);
146                  m_playfield_tilemap->set_scrollx(0, m_atarivc_state.pf0_xscroll);
147                  m_playfield2_tilemap->set_scrollx(0, m_atarivc_state.pf1_xscroll);
150148                  break;
151149
152150               case 11:
153151                  if (scanline > 0)
154152                     screen.update_partial(scanline - 1);
155                  state->m_atarivc_state.pf0_xscroll_raw = (data >> 7) & 0x1ff;
156                  atarivc_update_pf_xscrolls(state);
157                  state->m_playfield_tilemap->set_scrollx(0, state->m_atarivc_state.pf0_xscroll);
153                  m_atarivc_state.pf0_xscroll_raw = (data >> 7) & 0x1ff;
154                  atarivc_update_pf_xscrolls(this);
155                  m_playfield_tilemap->set_scrollx(0, m_atarivc_state.pf0_xscroll);
158156                  break;
159157
160158               case 13:
161159                  if (scanline > 0)
162160                     screen.update_partial(scanline - 1);
163                  state->m_atarivc_state.mo_yscroll = (data >> 7) & 0x1ff;
164                  atarimo_set_yscroll(0, state->m_atarivc_state.mo_yscroll);
161                  m_atarivc_state.mo_yscroll = (data >> 7) & 0x1ff;
162                  atarimo_set_yscroll(0, m_atarivc_state.mo_yscroll);
165163                  break;
166164
167165               case 14:
168166                  if (scanline > 0)
169167                     screen.update_partial(scanline - 1);
170                  state->m_atarivc_state.pf1_yscroll = (data >> 7) & 0x1ff;
171                  state->m_playfield2_tilemap->set_scrolly(0, state->m_atarivc_state.pf1_yscroll);
168                  m_atarivc_state.pf1_yscroll = (data >> 7) & 0x1ff;
169                  m_playfield2_tilemap->set_scrolly(0, m_atarivc_state.pf1_yscroll);
172170                  break;
173171
174172               case 15:
175173                  if (scanline > 0)
176174                     screen.update_partial(scanline - 1);
177                  state->m_atarivc_state.pf0_yscroll = (data >> 7) & 0x1ff;
178                  state->m_playfield_tilemap->set_scrolly(0, state->m_atarivc_state.pf0_yscroll);
175                  m_atarivc_state.pf0_yscroll = (data >> 7) & 0x1ff;
176                  m_playfield_tilemap->set_scrolly(0, m_atarivc_state.pf0_yscroll);
179177                  break;
180178            }
181179         }
trunk/src/mame/video/eprom.c
r18571r18572
205205 *
206206 *************************************/
207207
208void eprom_scanline_update(screen_device &screen, int scanline)
208void eprom_state::scanline_update(screen_device &screen, int scanline)
209209{
210   eprom_state *state = screen.machine().driver_data<eprom_state>();
211
212210   /* update the playfield */
213211   if (scanline == 0)
214212   {
215      int xscroll = (state->m_alpha[0x780] >> 7) & 0x1ff;
216      int yscroll = (state->m_alpha[0x781] >> 7) & 0x1ff;
217      state->m_playfield_tilemap->set_scrollx(0, xscroll);
218      state->m_playfield_tilemap->set_scrolly(0, yscroll);
213      int xscroll = (m_alpha[0x780] >> 7) & 0x1ff;
214      int yscroll = (m_alpha[0x781] >> 7) & 0x1ff;
215      m_playfield_tilemap->set_scrollx(0, xscroll);
216      m_playfield_tilemap->set_scrolly(0, yscroll);
219217      atarimo_set_xscroll(0, xscroll);
220218      atarimo_set_yscroll(0, yscroll);
221219   }
trunk/src/mame/video/blstroid.c
r18571r18572
8989
9090TIMER_CALLBACK_MEMBER(blstroid_state::irq_off)
9191{
92   address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM);
93
9492   /* clear the interrupt */
95   atarigen_scanline_int_ack_w(space, 0, 0, 0xffff);
93   address_space &space = subdevice("maincpu")->memory().space(AS_PROGRAM);
94   scanline_int_ack_w(space, 0, 0);
9695}
9796
9897
9998TIMER_CALLBACK_MEMBER(blstroid_state::irq_on)
10099{
101100   /* generate the interrupt */
102   atarigen_scanline_int_gen(machine().device("maincpu"));
103   atarigen_update_interrupts(machine());
101   scanline_int_gen(*subdevice("maincpu"));
102   update_interrupts();
104103}
105104
106105
107void blstroid_scanline_update(screen_device &screen, int scanline)
106void blstroid_state::scanline_update(screen_device &screen, int scanline)
108107{
109   blstroid_state *state = screen.machine().driver_data<blstroid_state>();
110108   int offset = (scanline / 8) * 64 + 40;
111109
112110   /* check for interrupts */
113111   if (offset < 0x1000)
114      if (state->m_playfield[offset] & 0x8000)
112      if (m_playfield[offset] & 0x8000)
115113      {
116114         int width, vpos;
117115         attotime period_on;
r18571r18572
129127         period_on  = screen.time_until_pos(vpos + 7, width * 0.9);
130128         period_off = screen.time_until_pos(vpos + 8, width * 0.9);
131129
132         screen.machine().scheduler().timer_set(period_on, timer_expired_delegate(FUNC(blstroid_state::irq_on),state));
133         screen.machine().scheduler().timer_set(period_off, timer_expired_delegate(FUNC(blstroid_state::irq_off),state));
130         screen.machine().scheduler().timer_set(period_on, timer_expired_delegate(FUNC(blstroid_state::irq_on), this));
131         screen.machine().scheduler().timer_set(period_off, timer_expired_delegate(FUNC(blstroid_state::irq_off), this));
134132      }
135133}
136134
trunk/src/mame/includes/atarigx2.h
r18571r18572
2929   UINT16         m_last_write_offset;
3030
3131   device_t *      m_rle;
32   virtual void update_interrupts();
33   virtual void scanline_update(screen_device &screen, int scanline);
3234   DECLARE_READ32_MEMBER(special_port2_r);
3335   DECLARE_READ32_MEMBER(special_port3_r);
3436   DECLARE_READ32_MEMBER(a2d_data_r);
trunk/src/mame/includes/toobin.h
r18571r18572
1717
1818   double         m_brightness;
1919   bitmap_ind16 m_pfbitmap;
20   virtual void update_interrupts();
2021   DECLARE_WRITE16_MEMBER(interrupt_scan_w);
2122   DECLARE_READ16_MEMBER(special_port1_r);
2223   DECLARE_DRIVER_INIT(toobin);
trunk/src/mame/includes/atarigt.h
r18571r18572
4848   UINT8         m_protdata[0x800];
4949
5050   device_t *      m_rle;
51   virtual void update_interrupts();
52   virtual void scanline_update(screen_device &screen, int scanline);
5153   DECLARE_READ32_MEMBER(special_port2_r);
5254   DECLARE_READ32_MEMBER(special_port3_r);
5355   DECLARE_READ32_MEMBER(analog_port0_r);
trunk/src/mame/includes/rampart.h
r18571r18572
1515
1616   required_shared_ptr<UINT16> m_bitmap;
1717   UINT8         m_has_mo;
18   virtual void update_interrupts();
19   virtual void scanline_update(screen_device &screen, int scanline);
1820   DECLARE_WRITE16_MEMBER(latch_w);
1921   DECLARE_DRIVER_INIT(rampart);
2022   DECLARE_MACHINE_START(rampart);
trunk/src/mame/includes/relief.h
r18571r18572
1515   UINT8         m_ym2413_volume;
1616   UINT8         m_overall_volume;
1717   UINT32         m_adpcm_bank_base;
18   virtual void update_interrupts();
1819   DECLARE_READ16_MEMBER(relief_atarivc_r);
1920   DECLARE_WRITE16_MEMBER(relief_atarivc_w);
2021   DECLARE_READ16_MEMBER(special_port2_r);
trunk/src/mame/includes/gauntlet.h
r18571r18572
1616   UINT8         m_vindctr2_screen_refresh;
1717   UINT8         m_playfield_tile_bank;
1818   UINT8         m_playfield_color_bank;
19   virtual void update_interrupts();
20   virtual void scanline_update(screen_device &screen, int scanline);
1921   DECLARE_READ16_MEMBER(port4_r);
2022   DECLARE_WRITE16_MEMBER(sound_reset_w);
2123   DECLARE_READ8_MEMBER(switch_6502_r);
trunk/src/mame/includes/arcadecl.h
r18571r18572
1616
1717   required_shared_ptr<UINT16> m_bitmap;
1818   UINT8         m_has_mo;
19   virtual void update_interrupts();
20   virtual void scanline_update(screen_device &screen, int scanline);
1921   DECLARE_WRITE16_MEMBER(latch_w);
2022   DECLARE_DRIVER_INIT(sparkz);
2123   DECLARE_MACHINE_START(arcadecl);
trunk/src/mame/includes/klax.h
r18571r18572
1111public:
1212   klax_state(const machine_config &mconfig, device_type type, const char *tag)
1313      : atarigen_state(mconfig, type, tag) { }
14   virtual void update_interrupts();
15   virtual void scanline_update(screen_device &screen, int scanline);
1416   DECLARE_WRITE16_MEMBER(interrupt_ack_w);
1517   TILE_GET_INFO_MEMBER(get_playfield_tile_info);
1618   DECLARE_MACHINE_START(klax);
trunk/src/mame/includes/liberatr.h
r18571r18572
3636protected:
3737   virtual void machine_start();
3838   virtual void video_start();
39   
40   virtual void update_interrupts() { }
3941
4042   struct planet;
4143
trunk/src/mame/includes/beathead.h
r18571r18572
5353        m_ram_base(*this, "ram_base"),
5454        m_rom_base(*this, "rom_base") { }
5555
56   virtual void machine_start();
5756   virtual void machine_reset();
5857
5958   virtual void video_start();
r18571r18572
9291   UINT32 *      m_movie_speedup_data;
9392
9493   // in drivers/beathead.c
95   void update_interrupts();
94   virtual void update_interrupts();
9695   DECLARE_WRITE32_MEMBER( interrupt_control_w );
9796   DECLARE_READ32_MEMBER( interrupt_control_r );
9897   DECLARE_WRITE32_MEMBER( eeprom_data_w );
trunk/src/mame/includes/skullxbo.h
r18571r18572
1111public:
1212   skullxbo_state(const machine_config &mconfig, device_type type, const char *tag)
1313      : atarigen_state(mconfig, type, tag) { }
14   virtual void update_interrupts();
15   virtual void scanline_update(screen_device &screen, int scanline);
1416   DECLARE_WRITE16_MEMBER(skullxbo_halt_until_hblank_0_w);
1517   DECLARE_READ16_MEMBER(special_port1_r);
1618   DECLARE_WRITE16_MEMBER(skullxbo_mobwr_w);
trunk/src/mame/includes/eprom.h
r18571r18572
1616   int          m_video_disable;
1717   UINT16 *      m_sync_data;
1818   int         m_last_offset;
19   virtual void update_interrupts();
20   virtual void scanline_update(screen_device &screen, int scanline);
1921   DECLARE_READ16_MEMBER(special_port1_r);
2022   DECLARE_READ16_MEMBER(adc_r);
2123   DECLARE_WRITE16_MEMBER(eprom_latch_w);
trunk/src/mame/includes/atarisy1.h
r18571r18572
4343   UINT8         m_bank_color_shift[MAX_GFX_ELEMENTS];
4444
4545   UINT8         m_cur[2][2];
46   virtual void update_interrupts();
4647   DECLARE_READ16_MEMBER(joystick_r);
4748   DECLARE_WRITE16_MEMBER(joystick_w);
4849   DECLARE_READ16_MEMBER(trakball_r);
trunk/src/mame/includes/atarig42.h
r18571r18572
3232
3333   device_t *      m_rle;
3434   UINT32         m_last_accesses[8];
35   virtual void update_interrupts();
36   virtual void scanline_update(screen_device &screen, int scanline);
3537   DECLARE_READ16_MEMBER(special_port2_r);
3638   DECLARE_WRITE16_MEMBER(a2d_select_w);
3739   DECLARE_READ16_MEMBER(a2d_data_r);
trunk/src/mame/includes/vindictr.h
r18571r18572
1515   UINT8         m_playfield_tile_bank;
1616   UINT16         m_playfield_xscroll;
1717   UINT16         m_playfield_yscroll;
18   virtual void update_interrupts();
19   virtual void scanline_update(screen_device &screen, int scanline);
1820   DECLARE_READ16_MEMBER(port1_r);
1921   DECLARE_DRIVER_INIT(vindictr);
2022   TILE_GET_INFO_MEMBER(get_alpha_tile_info);
trunk/src/mame/includes/atarisy2.h
r18571r18572
4949   UINT32         m_spin_center_count;
5050
5151   UINT16         m_vram[0x8000/2];
52   virtual void update_interrupts();
53   virtual void scanline_update(screen_device &screen, int scanline);
5254   DECLARE_WRITE16_MEMBER(int0_ack_w);
5355   DECLARE_WRITE16_MEMBER(int1_ack_w);
5456   DECLARE_WRITE16_MEMBER(int_enable_w);
trunk/src/mame/includes/shuuz.h
r18571r18572
1313      : atarigen_state(mconfig, type, tag) { }
1414
1515   int m_cur[2];
16   virtual void update_interrupts();
1617   DECLARE_READ16_MEMBER(shuuz_atarivc_r);
1718   DECLARE_WRITE16_MEMBER(shuuz_atarivc_w);
1819   DECLARE_WRITE16_MEMBER(latch_w);
trunk/src/mame/includes/foodf.h
r18571r18572
2424
2525   UINT8         m_whichport;
2626   required_shared_ptr<UINT16> m_spriteram;
27   virtual void update_interrupts();
2728   DECLARE_WRITE16_MEMBER(nvram_recall_w);
2829   DECLARE_WRITE8_MEMBER(digital_w);
2930   DECLARE_READ16_MEMBER(analog_r);
r18571r18572
3637   DECLARE_MACHINE_RESET(foodf);
3738   DECLARE_VIDEO_START(foodf);
3839   UINT32 screen_update_foodf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
39   TIMER_DEVICE_CALLBACK_MEMBER(scanline_update);
40   TIMER_DEVICE_CALLBACK_MEMBER(scanline_update_timer);
4041};
trunk/src/mame/includes/blstroid.h
r18571r18572
1414        m_priorityram(*this, "priorityram") { }
1515
1616   required_shared_ptr<UINT16>   m_priorityram;
17   virtual void update_interrupts();
18   virtual void scanline_update(screen_device &screen, int scanline);
1719   DECLARE_WRITE16_MEMBER(blstroid_halt_until_hblank_0_w);
1820   DECLARE_READ16_MEMBER(inputs_r);
1921   DECLARE_DRIVER_INIT(blstroid);
trunk/src/mame/includes/xybots.h
r18571r18572
1313      : atarigen_state(mconfig, type, tag) { }
1414
1515   UINT16         m_h256;
16   virtual void update_interrupts();
1617   DECLARE_READ16_MEMBER(special_port1_r);
1718   DECLARE_DRIVER_INIT(xybots);
1819   TILE_GET_INFO_MEMBER(get_alpha_tile_info);
trunk/src/mame/includes/harddriv.h
r18571r18572
173173
174174   INT8               m_gfx_finescroll;
175175   UINT8               m_gfx_palettebank;
176   virtual void update_interrupts();
176177   DECLARE_READ16_MEMBER(steeltal_dummy_r);
177178   DECLARE_READ32_MEMBER(rddsp_unmap_r);
178179   DECLARE_READ16_MEMBER(hd68k_snd_data_r);
trunk/src/mame/includes/cyberbal.h
r18571r18572
2828   UINT8         m_sound_data_from_6502;
2929   UINT8         m_sound_data_from_68k_ready;
3030   UINT8         m_sound_data_from_6502_ready;
31   virtual void update_interrupts();
32   virtual void scanline_update(screen_device &screen, int scanline);
3133   DECLARE_READ16_MEMBER(special_port0_r);
3234   DECLARE_READ16_MEMBER(special_port2_r);
3335   DECLARE_READ16_MEMBER(sound_state_r);
trunk/src/mame/includes/batman.h
r18571r18572
1515   UINT16         m_latch_data;
1616
1717   UINT8         m_alpha_tile_bank;
18   virtual void update_interrupts();
19   virtual void scanline_update(screen_device &screen, int scanline);
1820   DECLARE_READ16_MEMBER(batman_atarivc_r);
1921   DECLARE_WRITE16_MEMBER(batman_atarivc_w);
2022   DECLARE_READ16_MEMBER(special_port2_r);
trunk/src/mame/includes/badlands.h
r18571r18572
1818   UINT8 *         m_bank_source_data;
1919
2020   UINT8         m_playfield_tile_bank;
21   virtual void update_interrupts();
22   virtual void scanline_update(screen_device &screen, int scanline);
2123   DECLARE_READ16_MEMBER(sound_busy_r);
2224   DECLARE_READ16_MEMBER(pedal_0_r);
2325   DECLARE_READ16_MEMBER(pedal_1_r);
trunk/src/mame/includes/offtwall.h
r18571r18572
1919
2020   UINT16 *m_spritecache_count;
2121   UINT16 *m_unknown_verify_base;
22   virtual void update_interrupts();
2223   DECLARE_READ16_MEMBER(offtwall_atarivc_r);
2324   DECLARE_WRITE16_MEMBER(offtwall_atarivc_w);
2425   DECLARE_READ16_MEMBER(special_port3_r);
trunk/src/mame/includes/thunderj.h
r18571r18572
1313      : atarigen_state(mconfig, type, tag) { }
1414
1515   UINT8         m_alpha_tile_bank;
16   virtual void update_interrupts();
1617   DECLARE_READ16_MEMBER(special_port2_r);
1718   DECLARE_WRITE16_MEMBER(latch_w);
1819   DECLARE_READ16_MEMBER(thunderj_atarivc_r);
trunk/src/mame/includes/atarig1.h
r18571r18572
3030   UINT16         m_playfield_yscroll;
3131
3232   device_t *      m_rle;
33   virtual void update_interrupts();
34   virtual void scanline_update(screen_device &screen, int scanline);
3335   DECLARE_WRITE16_MEMBER(mo_control_w);
3436   DECLARE_WRITE16_MEMBER(mo_command_w);
3537   DECLARE_READ16_MEMBER(special_port0_r);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team