Previous 199869 Revisions Next

r20358 Saturday 19th January, 2013 at 22:27:56 UTC by Aaron Giles
Few minor cleanups.
[src/mame/audio]cyberbal.c
[src/mame/drivers]atarig1.c atarig42.c atarigt.c atarisy2.c cyberbal.c
[src/mame/includes]atarig1.h atarig42.h atarigt.h atarisy2.h cyberbal.h
[src/mame/video]atarig1.c atarig42.c atarisy2.c cyberbal.c

trunk/src/mame/video/cyberbal.c
r20357r20358
6363 *
6464 *************************************/
6565
66static void video_start_cyberbal_common(running_machine &machine, int screens)
66void cyberbal_state::video_start_common(int screens)
6767{
6868   static const atarimo_desc mo0desc =
6969   {
r20357r20358
138138      0,                  /* resulting value to indicate "special" */
139139      0                   /* callback routine for special entries */
140140   };
141   cyberbal_state *state = machine.driver_data<cyberbal_state>();
142141
143142   /* initialize the playfield */
144   state->m_playfield_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cyberbal_state::get_playfield_tile_info),state), TILEMAP_SCAN_ROWS,  16,8, 64,64);
143   m_playfield_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cyberbal_state::get_playfield_tile_info),this), TILEMAP_SCAN_ROWS,  16,8, 64,64);
145144
146145   /* initialize the motion objects */
147   atarimo_init(machine, 0, &mo0desc);
148   atarimo_set_slipram(0, &state->m_current_slip[0]);
146   atarimo_init(machine(), 0, &mo0desc);
147   atarimo_set_slipram(0, &m_current_slip[0]);
149148
150149   /* initialize the alphanumerics */
151   state->m_alpha_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cyberbal_state::get_alpha_tile_info),state), TILEMAP_SCAN_ROWS,  16,8, 64,32);
152   state->m_alpha_tilemap->set_transparent_pen(0);
150   m_alpha_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cyberbal_state::get_alpha_tile_info),this), TILEMAP_SCAN_ROWS,  16,8, 64,32);
151   m_alpha_tilemap->set_transparent_pen(0);
153152
154153   /* allocate the second screen if necessary */
155154   if (screens == 2)
156155   {
157156      /* initialize the playfield */
158      state->m_playfield2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cyberbal_state::get_playfield2_tile_info),state), TILEMAP_SCAN_ROWS,  16,8, 64,64);
159      state->m_playfield2_tilemap->set_scrollx(0, 0);
157      m_playfield2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cyberbal_state::get_playfield2_tile_info),this), TILEMAP_SCAN_ROWS,  16,8, 64,64);
158      m_playfield2_tilemap->set_scrollx(0, 0);
160159
161160      /* initialize the motion objects */
162      atarimo_init(machine, 1, &mo1desc);
163      atarimo_set_slipram(1, &state->m_current_slip[1]);
161      atarimo_init(machine(), 1, &mo1desc);
162      atarimo_set_slipram(1, &m_current_slip[1]);
164163
165164      /* initialize the alphanumerics */
166      state->m_alpha2_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(cyberbal_state::get_alpha2_tile_info),state), TILEMAP_SCAN_ROWS,  16,8, 64,32);
167      state->m_alpha2_tilemap->set_scrollx(0, 0);
168      state->m_alpha2_tilemap->set_transparent_pen(0);
165      m_alpha2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(cyberbal_state::get_alpha2_tile_info),this), TILEMAP_SCAN_ROWS,  16,8, 64,32);
166      m_alpha2_tilemap->set_scrollx(0, 0);
167      m_alpha2_tilemap->set_transparent_pen(0);
169168   }
170169
171170   /* save states */
172   state->save_item(NAME(state->m_current_slip));
173   state->save_item(NAME(state->m_playfield_palette_bank));
174   state->save_item(NAME(state->m_playfield_xscroll));
175   state->save_item(NAME(state->m_playfield_yscroll));
171   save_item(NAME(m_current_slip));
172   save_item(NAME(m_playfield_palette_bank));
173   save_item(NAME(m_playfield_xscroll));
174   save_item(NAME(m_playfield_yscroll));
176175}
177176
178177
179178VIDEO_START_MEMBER(cyberbal_state,cyberbal)
180179{
181   video_start_cyberbal_common(machine(), 2);
180   video_start_common(2);
182181
183182   /* adjust the sprite positions */
184183   atarimo_set_xscroll(0, 4);
r20357r20358
188187
189188VIDEO_START_MEMBER(cyberbal_state,cyberbal2p)
190189{
191   video_start_cyberbal_common(machine(), 1);
190   video_start_common(1);
192191
193192   /* adjust the sprite positions */
194193   atarimo_set_xscroll(0, 5);
r20357r20358
221220 *
222221 *************************************/
223222
224WRITE16_HANDLER( cyberbal_paletteram_0_w )
223WRITE16_HANDLER(cyberbal_state::paletteram_0_w)
225224{
226   cyberbal_state *state = space.machine().driver_data<cyberbal_state>();
227   COMBINE_DATA(&state->m_paletteram_0[offset]);
228   set_palette_entry(space.machine(), offset, state->m_paletteram_0[offset]);
225   COMBINE_DATA(&m_paletteram_0[offset]);
226   set_palette_entry(machine(), offset, m_paletteram_0[offset]);
229227}
230228
231READ16_HANDLER( cyberbal_paletteram_0_r )
229READ16_HANDLER(cyberbal_state::paletteram_0_r)
232230{
233   cyberbal_state *state = space.machine().driver_data<cyberbal_state>();
234   return state->m_paletteram_0[offset];
231   return m_paletteram_0[offset];
235232}
236233
237234
238WRITE16_HANDLER( cyberbal_paletteram_1_w )
235WRITE16_HANDLER(cyberbal_state::paletteram_1_w)
239236{
240   cyberbal_state *state = space.machine().driver_data<cyberbal_state>();
241   COMBINE_DATA(&state->m_paletteram_1[offset]);
242   set_palette_entry(space.machine(), offset + 0x800, state->m_paletteram_1[offset]);
237   COMBINE_DATA(&m_paletteram_1[offset]);
238   set_palette_entry(machine(), offset + 0x800, m_paletteram_1[offset]);
243239}
244240
245READ16_HANDLER( cyberbal_paletteram_1_r )
241READ16_HANDLER(cyberbal_state::paletteram_1_r)
246242{
247   cyberbal_state *state = space.machine().driver_data<cyberbal_state>();
248   return state->m_paletteram_1[offset];
243   return m_paletteram_1[offset];
249244}
250245
251246
r20357r20358
328323 *
329324 *************************************/
330325
331static UINT32 update_one_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int index)
326UINT32 cyberbal_state::update_one_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int index)
332327{
333   cyberbal_state *state = screen.machine().driver_data<cyberbal_state>();
334328   atarimo_rect_list rectlist;
335329   rectangle tempclip = cliprect;
336330   bitmap_ind16 *mobitmap;
r20357r20358
338332   rectangle visarea = screen.visible_area();
339333
340334   /* draw the playfield */
341   ((index == 0) ? state->m_playfield_tilemap : state->m_playfield2_tilemap)->draw(bitmap, cliprect, 0, 0);
335   ((index == 0) ? m_playfield_tilemap : m_playfield2_tilemap)->draw(bitmap, cliprect, 0, 0);
342336
343337   /* draw the MOs -- note some kludging to get this to work correctly for 2 screens */
344338   mooffset = 0;
r20357r20358
371365      }
372366
373367   /* add the alpha on top */
374   ((index == 0) ? state->m_alpha_tilemap : state->m_alpha2_tilemap)->draw(bitmap, cliprect, 0, 0);
368   ((index == 0) ? m_alpha_tilemap : m_alpha2_tilemap)->draw(bitmap, cliprect, 0, 0);
375369   return 0;
376370}
377371
trunk/src/mame/video/atarig1.c
r20357r20358
7575 *
7676 *************************************/
7777
78WRITE16_HANDLER( atarig1_mo_control_w )
79{
80   atarig1_state *state = space.machine().driver_data<atarig1_state>();
81
82   logerror("MOCONT = %d (scan = %d)\n", data, space.machine().primary_screen->vpos());
83
84   /* set the control value */
85   COMBINE_DATA(&state->m_current_control);
86}
87
88
8978void atarig1_state::scanline_update(screen_device &screen, int scanline)
9079{
9180   UINT16 *base = &m_alpha[(scanline / 8) * 64 + 48];
trunk/src/mame/video/atarig42.c
r20357r20358
9696 *
9797 *************************************/
9898
99WRITE16_HANDLER( atarig42_mo_control_w )
100{
101   atarig42_state *state = space.machine().driver_data<atarig42_state>();
102
103   logerror("MOCONT = %d (scan = %d)\n", data, space.machine().primary_screen->vpos());
104
105   /* set the control value */
106   COMBINE_DATA(&state->m_current_control);
107}
108
109
11099void atarig42_state::scanline_update(screen_device &screen, int scanline)
111100{
112101   UINT16 *base = &m_alpha[(scanline / 8) * 64 + 48];
trunk/src/mame/video/atarisy2.c
r20357r20358
1313
1414/*************************************
1515 *
16 *  Prototypes
17 *
18 *************************************/
19
20
21
22
23
24/*************************************
25 *
2616 *  Tilemap callbacks
2717 *
2818 *************************************/
r20357r20358
124114 *
125115 *************************************/
126116
127WRITE16_HANDLER( atarisy2_xscroll_w )
117WRITE16_HANDLER( atarisy2_state::xscroll_w )
128118{
129   atarisy2_state *state = space.machine().driver_data<atarisy2_state>();
130   UINT16 oldscroll = *state->m_xscroll;
119   UINT16 oldscroll = *m_xscroll;
131120   UINT16 newscroll = oldscroll;
132121   COMBINE_DATA(&newscroll);
133122
r20357r20358
136125      space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
137126
138127   /* update the playfield scrolling - hscroll is clocked on the following scanline */
139   state->m_playfield_tilemap->set_scrollx(0, newscroll >> 6);
128   m_playfield_tilemap->set_scrollx(0, newscroll >> 6);
140129
141130   /* update the playfield banking */
142   if (state->m_playfield_tile_bank[0] != (newscroll & 0x0f) * 0x400)
131   if (m_playfield_tile_bank[0] != (newscroll & 0x0f) * 0x400)
143132   {
144      state->m_playfield_tile_bank[0] = (newscroll & 0x0f) * 0x400;
145      state->m_playfield_tilemap->mark_all_dirty();
133      m_playfield_tile_bank[0] = (newscroll & 0x0f) * 0x400;
134      m_playfield_tilemap->mark_all_dirty();
146135   }
147136
148137   /* update the data */
149   *state->m_xscroll = newscroll;
138   *m_xscroll = newscroll;
150139}
151140
152141
r20357r20358
156145}
157146
158147
159WRITE16_HANDLER( atarisy2_yscroll_w )
148WRITE16_HANDLER( atarisy2_state::yscroll_w )
160149{
161   atarisy2_state *state = space.machine().driver_data<atarisy2_state>();
162   UINT16 oldscroll = *state->m_yscroll;
150   UINT16 oldscroll = *m_yscroll;
163151   UINT16 newscroll = oldscroll;
164152   COMBINE_DATA(&newscroll);
165153
r20357r20358
169157
170158   /* if bit 4 is zero, the scroll value is clocked in right away */
171159   if (!(newscroll & 0x10))
172      state->m_playfield_tilemap->set_scrolly(0, (newscroll >> 6) - space.machine().primary_screen->vpos());
160      m_playfield_tilemap->set_scrolly(0, (newscroll >> 6) - space.machine().primary_screen->vpos());
173161   else
174      state->m_yscroll_reset_timer->adjust(space.machine().primary_screen->time_until_pos(0), newscroll >> 6);
162      m_yscroll_reset_timer->adjust(space.machine().primary_screen->time_until_pos(0), newscroll >> 6);
175163
176164   /* update the playfield banking */
177   if (state->m_playfield_tile_bank[1] != (newscroll & 0x0f) * 0x400)
165   if (m_playfield_tile_bank[1] != (newscroll & 0x0f) * 0x400)
178166   {
179      state->m_playfield_tile_bank[1] = (newscroll & 0x0f) * 0x400;
180      state->m_playfield_tilemap->mark_all_dirty();
167      m_playfield_tile_bank[1] = (newscroll & 0x0f) * 0x400;
168      m_playfield_tilemap->mark_all_dirty();
181169   }
182170
183171   /* update the data */
184   *state->m_yscroll = newscroll;
172   *m_yscroll = newscroll;
185173}
186174
187175
r20357r20358
192180 *
193181 *************************************/
194182
195WRITE16_HANDLER( atarisy2_paletteram_w )
183WRITE16_HANDLER( atarisy2_state::paletteram_w )
196184{
197185   static const int intensity_table[16] =
198186   {
r20357r20358
209197
210198   int newword, inten, red, green, blue;
211199
212   atarisy2_state *state = space.machine().driver_data<atarisy2_state>();
213   COMBINE_DATA(&state->m_generic_paletteram_16[offset]);
214   newword = state->m_generic_paletteram_16[offset];
200   COMBINE_DATA(&m_generic_paletteram_16[offset]);
201   newword = m_generic_paletteram_16[offset];
215202
216203   inten = intensity_table[newword & 15];
217204   red = (color_table[(newword >> 12) & 15] * inten) >> 4;
r20357r20358
228215 *
229216 *************************************/
230217
231READ16_HANDLER( atarisy2_slapstic_r )
218READ16_HANDLER( atarisy2_state::slapstic_r )
232219{
233   atarisy2_state *state = space.machine().driver_data<atarisy2_state>();
234   int result = state->m_slapstic_base[offset];
220   int result = m_slapstic_base[offset];
235221   slapstic_tweak(space, offset);
236222
237223   /* an extra tweak for the next opcode fetch */
238   state->m_videobank = slapstic_tweak(space, 0x1234) * 0x1000;
224   m_videobank = slapstic_tweak(space, 0x1234) * 0x1000;
239225   return result;
240226}
241227
242228
243WRITE16_HANDLER( atarisy2_slapstic_w )
229WRITE16_HANDLER( atarisy2_state::slapstic_w )
244230{
245   atarisy2_state *state = space.machine().driver_data<atarisy2_state>();
246
247231   slapstic_tweak(space, offset);
248232
249233   /* an extra tweak for the next opcode fetch */
250   state->m_videobank = slapstic_tweak(space, 0x1234) * 0x1000;
234   m_videobank = slapstic_tweak(space, 0x1234) * 0x1000;
251235}
252236
253237
r20357r20358
258242 *
259243 *************************************/
260244
261READ16_HANDLER( atarisy2_videoram_r )
245READ16_HANDLER( atarisy2_state::videoram_r )
262246{
263   atarisy2_state *state = space.machine().driver_data<atarisy2_state>();
264   int offs = offset | state->m_videobank;
247   int offs = offset | m_videobank;
265248   if (offs >= 0xc00 && offs < 0x1000)
266249   {
267250      return atarimo_0_spriteram_r(space, offs - 0x0c00, mem_mask);
268251   }
269252
270   return state->m_vram[offs];
253   return m_vram[offs];
271254}
272255
273256
274WRITE16_HANDLER( atarisy2_videoram_w )
257WRITE16_HANDLER( atarisy2_state::videoram_w )
275258{
276   atarisy2_state *state = space.machine().driver_data<atarisy2_state>();
277   int offs = offset | state->m_videobank;
259   int offs = offset | m_videobank;
278260
279261   /* alpharam? */
280262   if (offs < 0x0c00)
281263   {
282      COMBINE_DATA(&state->m_alpha[offs]);
283      state->m_alpha_tilemap->mark_tile_dirty(offs);
264      COMBINE_DATA(&m_alpha[offs]);
265      m_alpha_tilemap->mark_tile_dirty(offs);
284266   }
285267
286268   /* spriteram? */
r20357r20358
288270   {
289271      /* force an update if the link of object 0 is about to change */
290272      if (offs == 0x0c03)
291         space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
273         space.machine().primary_screen->update_partial(machine().primary_screen->vpos());
292274      atarimo_0_spriteram_w(space, offs - 0x0c00, data, mem_mask);
293275   }
294276
r20357r20358
296278   else if (offs >= 0x2000)
297279   {
298280      offs -= 0x2000;
299      COMBINE_DATA(&state->m_playfield[offs]);
300      state->m_playfield_tilemap->mark_tile_dirty(offs);
281      COMBINE_DATA(&m_playfield[offs]);
282      m_playfield_tilemap->mark_tile_dirty(offs);
301283   }
302284
303285   /* generic case */
304286   else
305287   {
306      COMBINE_DATA(&state->m_vram[offs]);
288      COMBINE_DATA(&m_vram[offs]);
307289   }
308290}
309291
trunk/src/mame/includes/cyberbal.h
r20357r20358
55*************************************************************************/
66
77#include "machine/atarigen.h"
8#include "cpu/m68000/m68000.h"
9#include "cpu/m6502/m6502.h"
10#include "sound/dac.h"
811
912class cyberbal_state : public atarigen_state
1013{
1114public:
1215   cyberbal_state(const machine_config &mconfig, device_type type, const char *tag)
1316      : atarigen_state(mconfig, type, tag),
17         m_maincpu(*this, "maincpu"),
18         m_audiocpu(*this, "audiocpu"),
19         m_extracpu(*this, "extra"),
20         m_daccpu(*this, "dac"),
21         m_dac1(*this, "dac1"),
22         m_dac2(*this, "dac2"),
1423         m_paletteram_0(*this, "paletteram_0"),
1524         m_paletteram_1(*this, "paletteram_1") { }
1625
26   required_device<m68000_device> m_maincpu;
27   optional_device<m6502_device> m_audiocpu;
28   optional_device<m68000_device> m_extracpu;
29   optional_device<m68000_device> m_daccpu;
30   optional_device<dac_device> m_dac1;
31   optional_device<dac_device> m_dac2;
1732   optional_shared_ptr<UINT16> m_paletteram_0;
1833   optional_shared_ptr<UINT16> m_paletteram_1;
1934   UINT16          m_current_slip[2];
r20357r20358
3449   DECLARE_READ16_MEMBER(special_port2_r);
3550   DECLARE_READ16_MEMBER(sound_state_r);
3651   DECLARE_WRITE16_MEMBER(p2_reset_w);
37   DECLARE_READ8_MEMBER(cyberbal_special_port3_r);
38   DECLARE_READ8_MEMBER(cyberbal_sound_6502_stat_r);
39   DECLARE_WRITE8_MEMBER(cyberbal_sound_bank_select_w);
40   DECLARE_READ8_MEMBER(cyberbal_sound_68k_6502_r);
41   DECLARE_WRITE8_MEMBER(cyberbal_sound_68k_6502_w);
42   DECLARE_WRITE16_MEMBER(cyberbal_io_68k_irq_ack_w);
43   DECLARE_READ16_MEMBER(cyberbal_sound_68k_r);
44   DECLARE_WRITE16_MEMBER(cyberbal_sound_68k_w);
45   DECLARE_WRITE16_MEMBER(cyberbal_sound_68k_dac_w);
52   DECLARE_READ8_MEMBER(special_port3_r);
53   DECLARE_READ8_MEMBER(sound_6502_stat_r);
54   DECLARE_WRITE8_MEMBER(sound_bank_select_w);
55   DECLARE_READ8_MEMBER(sound_68k_6502_r);
56   DECLARE_WRITE8_MEMBER(sound_68k_6502_w);
57   DECLARE_WRITE16_MEMBER(io_68k_irq_ack_w);
58   DECLARE_READ16_MEMBER(sound_68k_r);
59   DECLARE_WRITE16_MEMBER(sound_68k_w);
60   DECLARE_WRITE16_MEMBER(sound_68k_dac_w);
4661   DECLARE_DRIVER_INIT(cyberbalt);
4762   DECLARE_DRIVER_INIT(cyberbal2p);
4863   DECLARE_DRIVER_INIT(cyberbal);
r20357r20358
5873   UINT32 screen_update_cyberbal_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5974   UINT32 screen_update_cyberbal_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6075   UINT32 screen_update_cyberbal2p(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
61   INTERRUPT_GEN_MEMBER(cyberbal_sound_68k_irq_gen);
76   INTERRUPT_GEN_MEMBER(sound_68k_irq_gen);
77   DECLARE_READ16_MEMBER(paletteram_0_r);
78   DECLARE_READ16_MEMBER(paletteram_1_r);
79   DECLARE_WRITE16_MEMBER(paletteram_0_w);
80   DECLARE_WRITE16_MEMBER(paletteram_1_w);
81private:
82   void video_start_common(int screens);
83   void cyberbal_sound_reset();
84   UINT32 update_one_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int index);
85   void update_sound_68k_interrupts();
6286};
63
64/*----------- defined in audio/cyberbal.c -----------*/
65
66void cyberbal_sound_reset(running_machine &machine);
67
68/*----------- defined in video/cyberbal.c -----------*/
69
70DECLARE_READ16_HANDLER( cyberbal_paletteram_0_r );
71DECLARE_READ16_HANDLER( cyberbal_paletteram_1_r );
72DECLARE_WRITE16_HANDLER( cyberbal_paletteram_0_w );
73DECLARE_WRITE16_HANDLER( cyberbal_paletteram_1_w );
74
75void cyberbal_scanline_update(screen_device &screen, int scanline);
trunk/src/mame/includes/atarig1.h
r20357r20358
55*************************************************************************/
66
77#include "machine/atarigen.h"
8#include "cpu/m68000/m68000.h"
89
910class atarig1_state : public atarigen_state
1011{
1112public:
1213   atarig1_state(const machine_config &mconfig, device_type type, const char *tag)
1314      : atarigen_state(mconfig, type, tag),
15         m_maincpu(*this, "maincpu"),
1416         m_mo_command(*this, "mo_command") { }
1517
16   UINT8           m_is_pitfight;
18   required_device<m68000_device> m_maincpu;
1719
20   bool            m_is_pitfight;
21
1822   UINT8           m_which_input;
1923   required_shared_ptr<UINT16> m_mo_command;
2024
2125   UINT16 *        m_bslapstic_base;
2226   void *          m_bslapstic_bank0;
2327   UINT8           m_bslapstic_bank;
24   UINT8           m_bslapstic_primed;
28   bool            m_bslapstic_primed;
2529
2630   int             m_pfscroll_xoffset;
2731   UINT16          m_current_control;
r20357r20358
3034   UINT16          m_playfield_yscroll;
3135
3236   device_t *      m_rle;
37   virtual void device_post_load();
3338   virtual void update_interrupts();
3439   virtual void scanline_update(screen_device &screen, int scanline);
3540   DECLARE_WRITE16_MEMBER(mo_control_w);
r20357r20358
5358   DECLARE_VIDEO_START(atarig1);
5459   UINT32 screen_update_atarig1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5560   void screen_eof_atarig1(screen_device &screen, bool state);
61private:
62   void init_common(offs_t slapstic_base, int slapstic, bool is_pitfight);
63   void pitfightb_cheap_slapstic_init();
5664};
57
58/*----------- defined in video/atarig1.c -----------*/
59void atarig1_scanline_update(screen_device &screen, int scanline);
trunk/src/mame/includes/atarigt.h
r20357r20358
3838
3939   required_shared_ptr<UINT32> m_mo_command;
4040
41   void            (*m_protection_w)(address_space &space, offs_t offset, UINT16 data);
42   void            (*m_protection_r)(address_space &space, offs_t offset, UINT16 *data);
41   void            (atarigt_state::*m_protection_w)(address_space &space, offs_t offset, UINT16 data);
42   void            (atarigt_state::*m_protection_r)(address_space &space, offs_t offset, UINT16 *data);
4343
44   UINT8           m_ignore_writes;
44   bool            m_ignore_writes;
4545   offs_t          m_protaddr[ADDRSEQ_COUNT];
4646   UINT8           m_protmode;
4747   UINT16          m_protresult;
r20357r20358
7575   DECLARE_VIDEO_START(atarigt);
7676   UINT32 screen_update_atarigt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7777   void screen_eof_atarigt(screen_device &screen, bool state);
78private:
79   void tmek_update_mode(offs_t offset);
80   void tmek_protection_w(address_space &space, offs_t offset, UINT16 data);
81   void tmek_protection_r(address_space &space, offs_t offset, UINT16 *data);
82   void primrage_update_mode(offs_t offset);
83   void primrage_protection_w(address_space &space, offs_t offset, UINT16 data);
84   void primrage_protection_r(address_space &space, offs_t offset, UINT16 *data);
85   void primrage_init_common(offs_t cage_speedup);
86   void compute_fake_pots(int *pots);
7887};
79
80/*----------- defined in video/atarigt.c -----------*/
81void atarigt_scanline_update(screen_device &screen, int scanline);
trunk/src/mame/includes/atarig42.h
r20357r20358
55*************************************************************************/
66
77#include "machine/atarigen.h"
8#include "cpu/m68000/m68000.h"
89
910class atarig42_state : public atarigen_state
1011{
1112public:
1213   atarig42_state(const machine_config &mconfig, device_type type, const char *tag)
1314      : atarigen_state(mconfig, type, tag),
15         m_maincpu(*this, "maincpu"),
1416         m_mo_command(*this, "mo_command") { }
1517
18   required_device<m68000_device> m_maincpu;
19
1620   UINT16          m_playfield_base;
1721
1822   UINT16          m_current_control;
r20357r20358
5761   UINT32 screen_update_atarig42(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5862   void screen_eof_atarig42(screen_device &screen, bool state);
5963};
60
61/*----------- defined in video/atarig42.c -----------*/
62DECLARE_WRITE16_HANDLER( atarig42_mo_control_w );
63void atarig42_scanline_update(screen_device &screen, int scanline);
trunk/src/mame/includes/atarisy2.h
r20357r20358
55*************************************************************************/
66
77#include "machine/atarigen.h"
8#include "cpu/m6502/m6502.h"
9#include "cpu/t11/t11.h"
810
911class atarisy2_state : public atarigen_state
1012{
1113public:
1214   atarisy2_state(const machine_config &mconfig, device_type type, const char *tag)
1315      : atarigen_state(mconfig, type, tag),
16         m_maincpu(*this, "maincpu"),
17         m_audiocpu(*this, "audiocpu"),
1418         m_slapstic_base(*this, "slapstic_base"),
1519         m_bankselect(*this, "bankselect"),
1620         m_rombank1(*this, "rombank1"),
1721         m_rombank2(*this, "rombank2") { }
1822
23   required_device<t11_device> m_maincpu;
24   required_device<m6502_device> m_audiocpu;
1925   required_shared_ptr<UINT16> m_slapstic_base;
2026
2127   UINT8           m_interrupt_enable;
r20357r20358
4955   UINT32          m_spin_center_count;
5056
5157   UINT16          m_vram[0x8000/2];
58
59   virtual void device_post_load();
60
5261   virtual void update_interrupts();
5362   virtual void scanline_update(screen_device &screen, int scanline);
5463   DECLARE_WRITE16_MEMBER(int0_ack_w);
r20357r20358
8493   INTERRUPT_GEN_MEMBER(vblank_int);
8594   TIMER_CALLBACK_MEMBER(delayed_int_enable_w);
8695   TIMER_CALLBACK_MEMBER(reset_yscroll_callback);
96   DECLARE_READ16_MEMBER(slapstic_r);
97   DECLARE_READ16_MEMBER(videoram_r);
98   DECLARE_WRITE16_MEMBER(slapstic_w);
99   DECLARE_WRITE16_MEMBER(yscroll_w);
100   DECLARE_WRITE16_MEMBER(xscroll_w);
101   DECLARE_WRITE16_MEMBER(videoram_w);
102   DECLARE_WRITE16_MEMBER(paletteram_w);
87103};
88
89
90/*----------- defined in video/atarisy2.c -----------*/
91
92DECLARE_READ16_HANDLER( atarisy2_slapstic_r );
93DECLARE_READ16_HANDLER( atarisy2_videoram_r );
94
95DECLARE_WRITE16_HANDLER( atarisy2_slapstic_w );
96DECLARE_WRITE16_HANDLER( atarisy2_yscroll_w );
97DECLARE_WRITE16_HANDLER( atarisy2_xscroll_w );
98DECLARE_WRITE16_HANDLER( atarisy2_videoram_w );
99DECLARE_WRITE16_HANDLER( atarisy2_paletteram_w );
trunk/src/mame/drivers/atarig1.c
r20357r20358
1919
2020
2121#include "emu.h"
22#include "cpu/m68000/m68000.h"
2322#include "audio/atarijsa.h"
2423#include "video/atarirle.h"
2524#include "includes/atarig1.h"
r20357r20358
3433
3534void atarig1_state::update_interrupts()
3635{
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);
36   m_maincpu->set_input_line(1, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
37   m_maincpu->set_input_line(2, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
3938}
4039
4140
r20357r20358
139138}
140139
141140
142static void pitfightb_state_postload(running_machine &machine)
141void atarig1_state::device_post_load()
143142{
144   atarig1_state *state = machine.driver_data<atarig1_state>();
145   int bank = state->m_bslapstic_bank;
146   state->m_bslapstic_bank = -1;
147   state->update_bank(bank);
143   if (m_bslapstic_base != NULL)
144   {
145      int bank = m_bslapstic_bank;
146      m_bslapstic_bank = -1;
147      update_bank(bank);
148   }
148149}
149150
150151
r20357r20358
157158
158159   /* offset 0 primes the chip */
159160   if (offset == 0)
160      m_bslapstic_primed = TRUE;
161      m_bslapstic_primed = true;
161162
162163   /* one of 4 bankswitchers produces the result */
163164   else if (m_bslapstic_primed)
164165   {
165166      if (offset == 0x42)
166         update_bank(0), m_bslapstic_primed = FALSE;
167         update_bank(0), m_bslapstic_primed = false;
167168      else if (offset == 0x52)
168         update_bank(1), m_bslapstic_primed = FALSE;
169         update_bank(1), m_bslapstic_primed = false;
169170      else if (offset == 0x62)
170         update_bank(2), m_bslapstic_primed = FALSE;
171         update_bank(2), m_bslapstic_primed = false;
171172      else if (offset == 0x72)
172         update_bank(3), m_bslapstic_primed = FALSE;
173         update_bank(3), m_bslapstic_primed = false;
173174   }
174175   return result;
175176}
176177
177178
178static void pitfightb_cheap_slapstic_init(running_machine &machine)
179void atarig1_state::pitfightb_cheap_slapstic_init()
179180{
180   atarig1_state *state = machine.driver_data<atarig1_state>();
181
182181   /* install a read handler */
183   state->m_bslapstic_base = machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x038000, 0x03ffff, read16_delegate(FUNC(atarig1_state::pitfightb_cheap_slapstic_r),state));
182   m_bslapstic_base = m_maincpu->space(AS_PROGRAM).install_read_handler(0x038000, 0x03ffff, read16_delegate(FUNC(atarig1_state::pitfightb_cheap_slapstic_r),this));
184183
185184   /* allocate memory for a copy of bank 0 */
186   state->m_bslapstic_bank0 = auto_alloc_array(machine, UINT8, 0x2000);
187   memcpy(state->m_bslapstic_bank0, state->m_bslapstic_base, 0x2000);
185   m_bslapstic_bank0 = auto_alloc_array(machine(), UINT8, 0x2000);
186   memcpy(m_bslapstic_bank0, m_bslapstic_base, 0x2000);
188187
189188   /* not primed by default */
190   state->m_bslapstic_primed = FALSE;
189   m_bslapstic_primed = false;
191190}
192191
193192
r20357r20358
12051204 *
12061205 *************************************/
12071206
1208static void init_g1_common(running_machine &machine, offs_t slapstic_base, int slapstic, int is_pitfight)
1207void atarig1_state::init_common(offs_t slapstic_base, int slapstic, bool is_pitfight)
12091208{
1210   atarig1_state *state = machine.driver_data<atarig1_state>();
1211
1212   state->m_eeprom_default = NULL;
1209   m_eeprom_default = NULL;
12131210   if (slapstic == -1)
12141211   {
1215      pitfightb_cheap_slapstic_init(machine);
1216      state->save_item(NAME(state->m_bslapstic_bank));
1217      state->save_item(NAME(state->m_bslapstic_primed));
1218      machine.save().register_postload(save_prepost_delegate(FUNC(pitfightb_state_postload), &machine));
1212      pitfightb_cheap_slapstic_init();
1213      save_item(NAME(m_bslapstic_bank));
1214      save_item(NAME(m_bslapstic_primed));
12191215   }
12201216   else if (slapstic != 0)
1221      state->slapstic_configure(*machine.device<cpu_device>("maincpu"), slapstic_base, 0, slapstic);
1222   atarijsa_init(machine, "IN0", 0x4000);
1217      slapstic_configure(*m_maincpu, slapstic_base, 0, slapstic);
1218   atarijsa_init(machine(), "IN0", 0x4000);
12231219
1224   state->m_is_pitfight = is_pitfight;
1220   m_is_pitfight = is_pitfight;
12251221}
12261222
1227DRIVER_INIT_MEMBER(atarig1_state,hydra)     { init_g1_common(machine(), 0x078000, 116, 0); }
1228DRIVER_INIT_MEMBER(atarig1_state,hydrap)    { init_g1_common(machine(), 0x000000,   0, 0); }
1223DRIVER_INIT_MEMBER(atarig1_state,hydra)     { init_common(0x078000, 116, 0); }
1224DRIVER_INIT_MEMBER(atarig1_state,hydrap)    { init_common(0x000000,   0, 0); }
12291225
1230DRIVER_INIT_MEMBER(atarig1_state,pitfight9)  { init_g1_common(machine(), 0x038000, 114, 1); }
1231DRIVER_INIT_MEMBER(atarig1_state,pitfight7)  { init_g1_common(machine(), 0x038000, 112, 1); }
1232DRIVER_INIT_MEMBER(atarig1_state,pitfight)   { init_g1_common(machine(), 0x038000, 111, 1); }
1233DRIVER_INIT_MEMBER(atarig1_state,pitfightj)  { init_g1_common(machine(), 0x038000, 113, 1); }
1234DRIVER_INIT_MEMBER(atarig1_state,pitfightb)  { init_g1_common(machine(), 0x038000,  -1, 1); }
1226DRIVER_INIT_MEMBER(atarig1_state,pitfight9)  { init_common(0x038000, 114, 1); }
1227DRIVER_INIT_MEMBER(atarig1_state,pitfight7)  { init_common(0x038000, 112, 1); }
1228DRIVER_INIT_MEMBER(atarig1_state,pitfight)   { init_common(0x038000, 111, 1); }
1229DRIVER_INIT_MEMBER(atarig1_state,pitfightj)  { init_common(0x038000, 113, 1); }
1230DRIVER_INIT_MEMBER(atarig1_state,pitfightb)  { init_common(0x038000,  -1, 1); }
12351231
12361232
12371233/*************************************
trunk/src/mame/drivers/atarisy2.c
r20357r20358
124124
125125
126126#include "emu.h"
127#include "cpu/m6502/m6502.h"
128#include "cpu/t11/t11.h"
129127#include "includes/slapstic.h"
130128#include "includes/atarisy2.h"
131129#include "sound/tms5220.h"
r20357r20358
141139
142140/*************************************
143141 *
144 *  Prototypes
145 *
146 *************************************/
147
148static void bankselect_postload(running_machine &machine);
149
150
151
152/*************************************
153 *
154142 *  Interrupt updating
155143 *
156144 *************************************/
r20357r20358
158146void atarisy2_state::update_interrupts()
159147{
160148   if (m_video_int_state)
161      machine().device("maincpu")->execute().set_input_line(3, ASSERT_LINE);
149      m_maincpu->set_input_line(3, ASSERT_LINE);
162150   else
163      machine().device("maincpu")->execute().set_input_line(3, CLEAR_LINE);
151      m_maincpu->set_input_line(3, CLEAR_LINE);
164152
165153   if (m_scanline_int_state)
166      machine().device("maincpu")->execute().set_input_line(2, ASSERT_LINE);
154      m_maincpu->set_input_line(2, ASSERT_LINE);
167155   else
168      machine().device("maincpu")->execute().set_input_line(2, CLEAR_LINE);
156      m_maincpu->set_input_line(2, CLEAR_LINE);
169157
170158   if (m_p2portwr_state)
171      machine().device("maincpu")->execute().set_input_line(1, ASSERT_LINE);
159      m_maincpu->set_input_line(1, ASSERT_LINE);
172160   else
173      machine().device("maincpu")->execute().set_input_line(1, CLEAR_LINE);
161      m_maincpu->set_input_line(1, CLEAR_LINE);
174162
175163   if (m_p2portrd_state)
176      machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
164      m_maincpu->set_input_line(0, ASSERT_LINE);
177165   else
178      machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
166      m_maincpu->set_input_line(0, CLEAR_LINE);
179167}
180168
181169
r20357r20358
193181      /* generate the 32V interrupt (IRQ 2) */
194182      if ((scanline % 64) == 0)
195183         if (m_interrupt_enable & 4)
196            scanline_int_gen(*subdevice("maincpu"));
184            scanline_int_gen(*m_maincpu);
197185   }
198186}
199187
r20357r20358
225213   save_item(NAME(m_which_adc));
226214   save_item(NAME(m_p2portwr_state));
227215   save_item(NAME(m_p2portrd_state));
228   machine().save().register_postload(save_prepost_delegate(FUNC(bankselect_postload), &machine()));
229216   save_item(NAME(m_sound_reset_state));
230217}
231218
r20357r20358
236223   slapstic_reset();
237224   scanline_timer_reset(*machine().primary_screen, 64);
238225
239   address_space &main = machine().device<t11_device>("maincpu")->space(AS_PROGRAM);
240   main.set_direct_update_handler(direct_update_delegate(FUNC(atarisy2_state::atarisy2_direct_handler), this));
226   m_maincpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(atarisy2_state::atarisy2_direct_handler), this));
241227
242228   m_p2portwr_state = 0;
243229   m_p2portrd_state = 0;
r20357r20358
273259{
274260   /* reset sound CPU */
275261   if (ACCESSING_BITS_0_7)
276      machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
262      m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
277263}
278264
279265
r20357r20358
325311   COMBINE_DATA(&newword);
326312   m_bankselect[offset] = newword;
327313
328   base = &machine().root_device().memregion("maincpu")->base()[bankoffset[(newword >> 10) & 0x3f]];
314   base = &memregion("maincpu")->base()[bankoffset[(newword >> 10) & 0x3f]];
329315   memcpy(offset ? m_rombank2 : m_rombank1, base, 0x2000);
330316}
331317
332318
333static void bankselect_postload(running_machine &machine)
319void atarisy2_state::device_post_load()
334320{
335   address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM);
336   atarisy2_state *state = machine.driver_data<atarisy2_state>();
321   atarigen_state::device_post_load();
337322
338   state->bankselect_w(space, 0, state->m_bankselect[0], 0xffff);
339   state->bankselect_w(space, 1, state->m_bankselect[1], 0xffff);
323   address_space &space = m_maincpu->space(AS_PROGRAM);
324   bankselect_w(space, 0, m_bankselect[0], 0xffff);
325   bankselect_w(space, 1, m_bankselect[1], 0xffff);
340326}
341327
342328
r20357r20358
785771/* full memory map derived from schematics */
786772static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarisy2_state )
787773   AM_RANGE(0x0000, 0x0fff) AM_RAM
788   AM_RANGE(0x1000, 0x11ff) AM_MIRROR(0x0200) AM_RAM_WRITE_LEGACY(atarisy2_paletteram_w) AM_SHARE("paletteram")
774   AM_RANGE(0x1000, 0x11ff) AM_MIRROR(0x0200) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
789775   AM_RANGE(0x1400, 0x1403) AM_MIRROR(0x007c) AM_READWRITE(adc_r, bankselect_w) AM_SHARE("bankselect")
790776   AM_RANGE(0x1480, 0x1487) AM_MIRROR(0x0078) AM_WRITE(adc_strobe_w)
791777   AM_RANGE(0x1580, 0x1581) AM_MIRROR(0x001e) AM_WRITE(int0_ack_w)
r20357r20358
794780   AM_RANGE(0x15e0, 0x15e1) AM_MIRROR(0x001e) AM_WRITE(video_int_ack_w)
795781   AM_RANGE(0x1600, 0x1601) AM_MIRROR(0x007e) AM_WRITE(int_enable_w)
796782   AM_RANGE(0x1680, 0x1681) AM_MIRROR(0x007e) AM_WRITE8(sound_w, 0x00ff)
797   AM_RANGE(0x1700, 0x1701) AM_MIRROR(0x007e) AM_WRITE_LEGACY(atarisy2_xscroll_w) AM_SHARE("xscroll")
798   AM_RANGE(0x1780, 0x1781) AM_MIRROR(0x007e) AM_WRITE_LEGACY(atarisy2_yscroll_w) AM_SHARE("yscroll")
783   AM_RANGE(0x1700, 0x1701) AM_MIRROR(0x007e) AM_WRITE(xscroll_w) AM_SHARE("xscroll")
784   AM_RANGE(0x1780, 0x1781) AM_MIRROR(0x007e) AM_WRITE(yscroll_w) AM_SHARE("yscroll")
799785   AM_RANGE(0x1800, 0x1801) AM_MIRROR(0x03fe) AM_READ(switch_r) AM_WRITE(watchdog_reset16_w)
800786   AM_RANGE(0x1c00, 0x1c01) AM_MIRROR(0x03fe) AM_READ(sound_r)
801   AM_RANGE(0x2000, 0x3fff) AM_READWRITE_LEGACY(atarisy2_videoram_r, atarisy2_videoram_w)
787   AM_RANGE(0x2000, 0x3fff) AM_READWRITE(videoram_r, videoram_w)
802788   AM_RANGE(0x4000, 0x5fff) AM_ROM AM_SHARE("rombank1")
803789   AM_RANGE(0x6000, 0x7fff) AM_ROM AM_SHARE("rombank2")
804   AM_RANGE(0x8000, 0x81ff) AM_READWRITE_LEGACY(atarisy2_slapstic_r, atarisy2_slapstic_w) AM_SHARE("slapstic_base")
790   AM_RANGE(0x8000, 0x81ff) AM_READWRITE(slapstic_r, slapstic_w) AM_SHARE("slapstic_base")
805791   AM_RANGE(0x8000, 0xffff) AM_ROM
806792ADDRESS_MAP_END
807793
trunk/src/mame/drivers/cyberbal.c
r20357r20358
2020
2121
2222#include "emu.h"
23#include "cpu/m68000/m68000.h"
24#include "cpu/m6502/m6502.h"
2523#include "sound/2151intf.h"
26#include "sound/dac.h"
2724#include "rendlay.h"
2825#include "audio/atarijsa.h"
2926#include "video/atarimo.h"
r20357r20358
3835
3936void cyberbal_state::update_interrupts()
4037{
41   if (subdevice("extra") != NULL)
38   if (m_extracpu != NULL)
4239   {
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);
40      m_maincpu->set_input_line(1, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
41      m_extracpu->set_input_line(1, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
4542   }
4643   else
4744   {
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);
45      m_maincpu->set_input_line(1, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
46      m_maincpu->set_input_line(3, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
5047   }
5148}
5249
r20357r20358
6966   atarigen_state::machine_reset();
7067   scanline_timer_reset(*machine().primary_screen, 8);
7168
72   cyberbal_sound_reset(machine());
69   cyberbal_sound_reset();
7370
7471   /* Extra CPU (second M68k) doesn't run until reset */
75   machine().device("extra")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
72   m_extracpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
7673}
7774
7875
r20357r20358
124121
125122WRITE16_MEMBER(cyberbal_state::p2_reset_w)
126123{
127   machine().device("extra")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
124   m_extracpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
128125}
129126
130127
r20357r20358
146143   AM_RANGE(0xfd8000, 0xfd9fff) AM_WRITE8(sound_w, 0xff00)
147144   AM_RANGE(0xfe0000, 0xfe0fff) AM_READ(special_port0_r)
148145   AM_RANGE(0xfe1000, 0xfe1fff) AM_READ_PORT("IN1")
149   AM_RANGE(0xfe8000, 0xfe8fff) AM_RAM_WRITE_LEGACY(cyberbal_paletteram_1_w) AM_SHARE("paletteram_1")
150   AM_RANGE(0xfec000, 0xfecfff) AM_RAM_WRITE_LEGACY(cyberbal_paletteram_0_w) AM_SHARE("paletteram_0")
146   AM_RANGE(0xfe8000, 0xfe8fff) AM_RAM_WRITE(paletteram_1_w) AM_SHARE("paletteram_1")
147   AM_RANGE(0xfec000, 0xfecfff) AM_RAM_WRITE(paletteram_0_w) AM_SHARE("paletteram_0")
151148   AM_RANGE(0xff0000, 0xff1fff) AM_RAM_WRITE(playfield2_w)   AM_SHARE("playfield2")
152149   AM_RANGE(0xff2000, 0xff2fff) AM_RAM_WRITE(alpha2_w)       AM_SHARE("alpha2")
153150   AM_RANGE(0xff3000, 0xff37ff) AM_READWRITE_LEGACY(atarimo_1_spriteram_r, atarimo_1_spriteram_w)
r20357r20358
173170   AM_RANGE(0xfc0000, 0xfdffff) AM_WRITE(video_int_ack_w)
174171   AM_RANGE(0xfe0000, 0xfe0fff) AM_READ(special_port0_r)
175172   AM_RANGE(0xfe1000, 0xfe1fff) AM_READ_PORT("IN1")
176   AM_RANGE(0xfe8000, 0xfe8fff) AM_RAM_WRITE_LEGACY(cyberbal_paletteram_1_w) AM_SHARE("paletteram_1")
177   AM_RANGE(0xfec000, 0xfecfff) AM_RAM_WRITE_LEGACY(cyberbal_paletteram_0_w) AM_SHARE("paletteram_0")
173   AM_RANGE(0xfe8000, 0xfe8fff) AM_RAM_WRITE(paletteram_1_w) AM_SHARE("paletteram_1")
174   AM_RANGE(0xfec000, 0xfecfff) AM_RAM_WRITE(paletteram_0_w) AM_SHARE("paletteram_0")
178175   AM_RANGE(0xff0000, 0xff1fff) AM_RAM_WRITE(playfield2_w)   AM_SHARE("playfield2")
179176   AM_RANGE(0xff2000, 0xff2fff) AM_RAM_WRITE(alpha2_w)       AM_SHARE("alpha2")
180177   AM_RANGE(0xff3000, 0xff37ff) AM_READWRITE_LEGACY(atarimo_1_spriteram_r, atarimo_1_spriteram_w)
r20357r20358
198195static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, cyberbal_state )
199196   AM_RANGE(0x0000, 0x1fff) AM_RAM
200197   AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
201   AM_RANGE(0x2800, 0x2801) AM_WRITE(cyberbal_sound_68k_6502_w)
198   AM_RANGE(0x2800, 0x2801) AM_WRITE(sound_68k_6502_w)
202199   AM_RANGE(0x2802, 0x2803) AM_READWRITE(m6502_irq_ack_r, m6502_irq_ack_w)
203200   AM_RANGE(0x2804, 0x2805) AM_WRITE(m6502_sound_w)
204   AM_RANGE(0x2806, 0x2807) AM_WRITE(cyberbal_sound_bank_select_w)
201   AM_RANGE(0x2806, 0x2807) AM_WRITE(sound_bank_select_w)
205202   AM_RANGE(0x2c00, 0x2c01) AM_READ(m6502_sound_r)
206   AM_RANGE(0x2c02, 0x2c03) AM_READ(cyberbal_special_port3_r)
207   AM_RANGE(0x2c04, 0x2c05) AM_READ(cyberbal_sound_68k_6502_r)
208   AM_RANGE(0x2c06, 0x2c07) AM_READ(cyberbal_sound_6502_stat_r)
203   AM_RANGE(0x2c02, 0x2c03) AM_READ(special_port3_r)
204   AM_RANGE(0x2c04, 0x2c05) AM_READ(sound_68k_6502_r)
205   AM_RANGE(0x2c06, 0x2c07) AM_READ(sound_6502_stat_r)
209206   AM_RANGE(0x3000, 0x3fff) AM_ROMBANK("soundbank")
210207   AM_RANGE(0x4000, 0xffff) AM_ROM
211208ADDRESS_MAP_END
r20357r20358
220217
221218static ADDRESS_MAP_START( sound_68k_map, AS_PROGRAM, 16, cyberbal_state )
222219   AM_RANGE(0x000000, 0x03ffff) AM_ROM
223   AM_RANGE(0xff8000, 0xff87ff) AM_READ(cyberbal_sound_68k_r)
224   AM_RANGE(0xff8800, 0xff8fff) AM_WRITE(cyberbal_sound_68k_w)
225   AM_RANGE(0xff9000, 0xff97ff) AM_WRITE(cyberbal_io_68k_irq_ack_w)
226   AM_RANGE(0xff9800, 0xff9fff) AM_WRITE(cyberbal_sound_68k_dac_w)
220   AM_RANGE(0xff8000, 0xff87ff) AM_READ(sound_68k_r)
221   AM_RANGE(0xff8800, 0xff8fff) AM_WRITE(sound_68k_w)
222   AM_RANGE(0xff9000, 0xff97ff) AM_WRITE(io_68k_irq_ack_w)
223   AM_RANGE(0xff9800, 0xff9fff) AM_WRITE(sound_68k_dac_w)
227224   AM_RANGE(0xfff000, 0xffffff) AM_RAM
228225ADDRESS_MAP_END
229226
r20357r20358
420417
421418   MCFG_CPU_ADD("dac", M68000, ATARI_CLOCK_14MHz/2)
422419   MCFG_CPU_PROGRAM_MAP(sound_68k_map)
423   MCFG_CPU_PERIODIC_INT_DRIVER(cyberbal_state, cyberbal_sound_68k_irq_gen,  10000)
420   MCFG_CPU_PERIODIC_INT_DRIVER(cyberbal_state, sound_68k_irq_gen,  10000)
424421
425422   MCFG_QUANTUM_TIME(attotime::from_hz(600))
426423
r20357r20358
981978
982979DRIVER_INIT_MEMBER(cyberbal_state,cyberbal)
983980{
984   slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x018000, 0, 0);
981   slapstic_configure(*m_maincpu, 0x018000, 0, 0);
985982}
986983
987984
988985DRIVER_INIT_MEMBER(cyberbal_state,cyberbalt)
989986{
990   slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x018000, 0, 116);
987   slapstic_configure(*m_maincpu, 0x018000, 0, 116);
991988}
992989
993990
trunk/src/mame/drivers/atarigt.c
r20357r20358
138138}
139139
140140
141#if (HACK_TMEK_CONTROLS)
142INLINE void compute_fake_pots(int *pots)
141inline void atarigt_state::compute_fake_pots(int *pots)
143142{
144   int fake = machine.root_device().ioport("FAKE")->read();
143#if (HACK_TMEK_CONTROLS)
144   int fake = ioport("FAKE")->read();
145145
146146   pots[0] = pots[1] = pots[2] = pots[3] = 0x80;
147147
r20357r20358
167167      pots[1] = 0xff, pots[3] = 0x00;
168168   else if (fake & 0x08)       /* right only */
169169      pots[3] = 0xff, pots[1] = 0x00;
170}
171170#endif
171}
172172
173173
174174READ32_MEMBER(atarigt_state::analog_port0_r)
r20357r20358
282282
283283
284284
285static void tmek_update_mode(atarigt_state *state, offs_t offset)
285void atarigt_state::tmek_update_mode(offs_t offset)
286286{
287   int i;
288
289287   /* pop us into the readseq */
290   for (i = 0; i < ADDRSEQ_COUNT - 1; i++)
291      state->m_protaddr[i] = state->m_protaddr[i + 1];
292   state->m_protaddr[ADDRSEQ_COUNT - 1] = offset;
293
288   for (int i = 0; i < ADDRSEQ_COUNT - 1; i++)
289      m_protaddr[i] = m_protaddr[i + 1];
290   m_protaddr[ADDRSEQ_COUNT - 1] = offset;
294291}
295292
296293
297static void tmek_protection_w(address_space &space, offs_t offset, UINT16 data)
294void atarigt_state::tmek_protection_w(address_space &space, offs_t offset, UINT16 data)
298295{
299   atarigt_state *state = space.machine().driver_data<atarigt_state>();
300296/*
301297    T-Mek init:
302298        ($387C0) = $0001
r20357r20358
308304   if (LOG_PROTECTION) logerror("%06X:Protection W@%06X = %04X\n", space.device().safe_pcbase(), offset, data);
309305
310306   /* track accesses */
311   tmek_update_mode(state, offset);
307   tmek_update_mode(offset);
312308
313309   switch (offset)
314310   {
315311      case 0xdb0000:
316         state->m_ignore_writes = (data == 0x18);
312         m_ignore_writes = (data == 0x18);
317313         break;
318314   }
319315}
320316
321static void tmek_protection_r(address_space &space, offs_t offset, UINT16 *data)
317void atarigt_state::tmek_protection_r(address_space &space, offs_t offset, UINT16 *data)
322318{
323   atarigt_state *state = space.machine().driver_data<atarigt_state>();
324319   if (LOG_PROTECTION) logerror("%06X:Protection R@%06X\n", space.device().safe_pcbase(), offset);
325320
326321   /* track accesses */
327   tmek_update_mode(state, offset);
322   tmek_update_mode(offset);
328323
329324   /* handle specific reads */
330325   switch (offset)
r20357r20358
348343 *
349344 *************************************/
350345
351static void primage_update_mode(atarigt_state *state, offs_t offset)
346void atarigt_state::primrage_update_mode(offs_t offset)
352347{
353   int i;
354
355348   /* pop us into the readseq */
356   for (i = 0; i < ADDRSEQ_COUNT - 1; i++)
357      state->m_protaddr[i] = state->m_protaddr[i + 1];
358   state->m_protaddr[ADDRSEQ_COUNT - 1] = offset;
349   for (int i = 0; i < ADDRSEQ_COUNT - 1; i++)
350      m_protaddr[i] = m_protaddr[i + 1];
351   m_protaddr[ADDRSEQ_COUNT - 1] = offset;
359352
360353   /* check for particular sequences */
361   if (!state->m_protmode)
354   if (!m_protmode)
362355   {
363356      /* this is from the code at $20f90 */
364      if (state->m_protaddr[1] == 0xdcc7c4 && state->m_protaddr[2] == 0xdcc7c4 && state->m_protaddr[3] == 0xdc4010)
357      if (m_protaddr[1] == 0xdcc7c4 && m_protaddr[2] == 0xdcc7c4 && m_protaddr[3] == 0xdc4010)
365358      {
366359         if (LOG_PROTECTION) logerror("prot:Entering mode 1\n");
367         state->m_protmode = 1;
360         m_protmode = 1;
368361      }
369362
370363      /* this is from the code at $27592 */
371      if (state->m_protaddr[0] == 0xdcc7ca && state->m_protaddr[1] == 0xdcc7ca && state->m_protaddr[2] == 0xdcc7c6 && state->m_protaddr[3] == 0xdc4022)
364      if (m_protaddr[0] == 0xdcc7ca && m_protaddr[1] == 0xdcc7ca && m_protaddr[2] == 0xdcc7c6 && m_protaddr[3] == 0xdc4022)
372365      {
373366         if (LOG_PROTECTION) logerror("prot:Entering mode 2\n");
374         state->m_protmode = 2;
367         m_protmode = 2;
375368      }
376369
377370      /* this is from the code at $3d8dc */
378      if (state->m_protaddr[0] == 0xdcc7c0 && state->m_protaddr[1] == 0xdcc7c0 && state->m_protaddr[2] == 0xdc80f2 && state->m_protaddr[3] == 0xdc7af2)
371      if (m_protaddr[0] == 0xdcc7c0 && m_protaddr[1] == 0xdcc7c0 && m_protaddr[2] == 0xdc80f2 && m_protaddr[3] == 0xdc7af2)
379372      {
380373         if (LOG_PROTECTION) logerror("prot:Entering mode 3\n");
381         state->m_protmode = 3;
374         m_protmode = 3;
382375      }
383376   }
384377}
385378
386379
387380
388static void primrage_protection_w(address_space &space, offs_t offset, UINT16 data)
381void atarigt_state::primrage_protection_w(address_space &space, offs_t offset, UINT16 data)
389382{
390   atarigt_state *state = space.machine().driver_data<atarigt_state>();
391383   if (LOG_PROTECTION)
392384   {
393385   UINT32 pc = space.device().safe_pcbase();
r20357r20358
431423/* mask = 0x78fff */
432424
433425   /* track accesses */
434   primage_update_mode(state, offset);
426   primrage_update_mode(offset);
435427
436428   /* check for certain read sequences */
437   if (state->m_protmode == 1 && offset >= 0xdc7800 && offset < 0xdc7800 + sizeof(state->m_protdata) * 2)
438      state->m_protdata[(offset - 0xdc7800) / 2] = data;
429   if (m_protmode == 1 && offset >= 0xdc7800 && offset < 0xdc7800 + sizeof(m_protdata) * 2)
430      m_protdata[(offset - 0xdc7800) / 2] = data;
439431
440   if (state->m_protmode == 2)
432   if (m_protmode == 2)
441433   {
442434      int temp = (offset - 0xdc7800) / 2;
443435      if (LOG_PROTECTION) logerror("prot:mode 2 param = %04X\n", temp);
444      state->m_protresult = temp * 0x6915 + 0x6915;
436      m_protresult = temp * 0x6915 + 0x6915;
445437   }
446438
447   if (state->m_protmode == 3)
439   if (m_protmode == 3)
448440   {
449441      if (offset == 0xdc4700)
450442      {
451443         if (LOG_PROTECTION) logerror("prot:Clearing mode 3\n");
452         state->m_protmode = 0;
444         m_protmode = 0;
453445      }
454446   }
455447}
456448
457449
458450
459static void primrage_protection_r(address_space &space, offs_t offset, UINT16 *data)
451void atarigt_state::primrage_protection_r(address_space &space, offs_t offset, UINT16 *data)
460452{
461   atarigt_state *state = space.machine().driver_data<atarigt_state>();
462453   /* track accesses */
463   primage_update_mode(state, offset);
454   primrage_update_mode(offset);
464455
465456if (LOG_PROTECTION)
466457{
r20357r20358
537528   {
538529      /* status register; the code spins on this waiting for the high bit to be set */
539530      case 0xdc4700:
540//          if (state->m_protmode != 0)
531//          if (m_protmode != 0)
541532         {
542533            *data = 0x8000;
543534         }
r20357r20358
545536
546537      /* some kind of result register */
547538      case 0xdcc7c2:
548         if (state->m_protmode == 2)
539         if (m_protmode == 2)
549540         {
550            *data = state->m_protresult;
551            state->m_protmode = 0;
541            *data = m_protresult;
542            m_protmode = 0;
552543         if (LOG_PROTECTION) logerror("prot:Clearing mode 2\n");
553544         }
554545         break;
555546
556547      case 0xdcc7c4:
557         if (state->m_protmode == 1)
548         if (m_protmode == 1)
558549         {
559            state->m_protmode = 0;
550            m_protmode = 0;
560551         if (LOG_PROTECTION) logerror("prot:Clearing mode 1\n");
561552         }
562553         break;
r20357r20358
580571   if (ACCESSING_BITS_16_31)
581572   {
582573      result = atarigt_colorram_r(address);
583      (*m_protection_r)(space, address, &result);
574      (this->*m_protection_r)(space, address, &result);
584575      result32 |= result << 16;
585576   }
586577   if (ACCESSING_BITS_0_15)
587578   {
588579      result = atarigt_colorram_r(address + 2);
589      (*m_protection_r)(space, address + 2, &result);
580      (this->*m_protection_r)(space, address + 2, &result);
590581      result32 |= result;
591582   }
592583
r20357r20358
602593   {
603594      if (!m_ignore_writes)
604595         atarigt_colorram_w(address, data >> 16, mem_mask >> 16);
605      (*m_protection_w)(space, address, data >> 16);
596      (this->*m_protection_w)(space, address, data >> 16);
606597   }
607598   if (ACCESSING_BITS_0_15)
608599   {
609600      if (!m_ignore_writes)
610601         atarigt_colorram_w(address + 2, data, mem_mask);
611      (*m_protection_w)(space, address + 2, data);
602      (this->*m_protection_w)(space, address + 2, data);
612603   }
613604}
614605
r20357r20358
13201311   cage_set_irq_handler(cage_irq_callback);
13211312
13221313   /* setup protection */
1323   m_protection_r = tmek_protection_r;
1324   m_protection_w = tmek_protection_w;
1314   m_protection_r = &atarigt_state::tmek_protection_r;
1315   m_protection_w = &atarigt_state::tmek_protection_w;
13251316
13261317   /* temp hack */
13271318   machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0xd72000, 0xd75fff, write32_delegate(FUNC(atarigt_state::tmek_pf_w),this));
13281319}
13291320
13301321
1331static void primrage_init_common(running_machine &machine, offs_t cage_speedup)
1322void atarigt_state::primrage_init_common(offs_t cage_speedup)
13321323{
1333   atarigt_state *state = machine.driver_data<atarigt_state>();
1324   m_eeprom_default = NULL;
1325   m_is_primrage = 1;
13341326
1335   state->m_eeprom_default = NULL;
1336   state->m_is_primrage = 1;
1337
1338   cage_init(machine, cage_speedup);
1327   cage_init(machine(), cage_speedup);
13391328   cage_set_irq_handler(cage_irq_callback);
13401329
13411330   /* install protection */
1342   state->m_protection_r = primrage_protection_r;
1343   state->m_protection_w = primrage_protection_w;
1331   m_protection_r = &atarigt_state::primrage_protection_r;
1332   m_protection_w = &atarigt_state::primrage_protection_w;
13441333}
13451334
1346DRIVER_INIT_MEMBER(atarigt_state,primrage)  { primrage_init_common(machine(), 0x42f2); }
1347DRIVER_INIT_MEMBER(atarigt_state,primrage20) { primrage_init_common(machine(), 0x48a4); }
1335DRIVER_INIT_MEMBER(atarigt_state,primrage)  { primrage_init_common(0x42f2); }
1336DRIVER_INIT_MEMBER(atarigt_state,primrage20) { primrage_init_common(0x48a4); }
13481337
13491338/*************************************
13501339 *
trunk/src/mame/drivers/atarig42.c
r20357r20358
1818***************************************************************************/
1919
2020#include "emu.h"
21#include "cpu/m68000/m68000.h"
2221#include "machine/asic65.h"
2322#include "audio/atarijsa.h"
2423#include "video/atarirle.h"
r20357r20358
3332
3433void atarig42_state::update_interrupts()
3534{
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);
35   m_maincpu->set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
36   m_maincpu->set_input_line(5, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
3837}
3938
4039
r20357r20358
782781
783782   m_playfield_base = 0x400;
784783
785   address_space &main = machine().device<m68000_device>("maincpu")->space(AS_PROGRAM);
784   address_space &main = m_maincpu->space(AS_PROGRAM);
786785   m_sloop_base = main.install_readwrite_handler(0x000000, 0x07ffff, read16_delegate(FUNC(atarig42_state::roadriot_sloop_data_r),this), write16_delegate(FUNC(atarig42_state::roadriot_sloop_data_w),this));
787786   main.set_direct_update_handler(direct_update_delegate(FUNC(atarig42_state::atarig42_sloop_direct_handler), this));
788787
r20357r20358
820819   /* put an RTS there so we don't die */
821820   *(UINT16 *)&memregion("maincpu")->base()[0x80000] = 0x4E75;
822821
823   address_space &main = machine().device<m68000_device>("maincpu")->space(AS_PROGRAM);
822   address_space &main = m_maincpu->space(AS_PROGRAM);
824823   m_sloop_base = main.install_readwrite_handler(0x000000, 0x07ffff, read16_delegate(FUNC(atarig42_state::guardians_sloop_data_r),this), write16_delegate(FUNC(atarig42_state::guardians_sloop_data_w),this));
825824   main.set_direct_update_handler(direct_update_delegate(FUNC(atarig42_state::atarig42_sloop_direct_handler), this));
826825
trunk/src/mame/audio/cyberbal.c
r20357r20358
55****************************************************************************/
66
77#include "emu.h"
8#include "sound/dac.h"
98#include "sound/2151intf.h"
109#include "machine/atarigen.h"
1110#include "includes/cyberbal.h"
1211
1312
14static void update_sound_68k_interrupts(running_machine &machine);
15
16
17
18void cyberbal_sound_reset(running_machine &machine)
13void cyberbal_state::cyberbal_sound_reset()
1914{
20   cyberbal_state *state = machine.driver_data<cyberbal_state>();
21
2215   /* reset the sound system */
23   state->m_bank_base = &state->memregion("audiocpu")->base()[0x10000];
24   state->membank("soundbank")->set_base(&state->m_bank_base[0x0000]);
25   state->m_fast_68k_int = state->m_io_68k_int = 0;
26   state->m_sound_data_from_68k = state->m_sound_data_from_6502 = 0;
27   state->m_sound_data_from_68k_ready = state->m_sound_data_from_6502_ready = 0;
16   m_bank_base = &memregion("audiocpu")->base()[0x10000];
17   membank("soundbank")->set_base(&m_bank_base[0x0000]);
18   m_fast_68k_int = m_io_68k_int = 0;
19   m_sound_data_from_68k = m_sound_data_from_6502 = 0;
20   m_sound_data_from_68k_ready = m_sound_data_from_6502_ready = 0;
2821}
2922
3023
r20357r20358
3528 *
3629 *************************************/
3730
38READ8_MEMBER(cyberbal_state::cyberbal_special_port3_r)
31READ8_MEMBER(cyberbal_state::special_port3_r)
3932{
4033   int temp = ioport("JSAII")->read();
4134   if (!(ioport("IN0")->read() & 0x8000)) temp ^= 0x80;
r20357r20358
4538}
4639
4740
48READ8_MEMBER(cyberbal_state::cyberbal_sound_6502_stat_r)
41READ8_MEMBER(cyberbal_state::sound_6502_stat_r)
4942{
5043   int temp = 0xff;
5144   if (m_sound_data_from_6502_ready) temp ^= 0x80;
r20357r20358
5447}
5548
5649
57WRITE8_MEMBER(cyberbal_state::cyberbal_sound_bank_select_w)
50WRITE8_MEMBER(cyberbal_state::sound_bank_select_w)
5851{
5952   membank("soundbank")->set_base(&m_bank_base[0x1000 * ((data >> 6) & 3)]);
6053   coin_counter_w(machine(), 1, (data >> 5) & 1);
6154   coin_counter_w(machine(), 0, (data >> 4) & 1);
62   machine().device("dac")->execute().set_input_line(INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
55   m_daccpu->set_input_line(INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
6356   if (!(data & 0x01)) machine().device("ymsnd")->reset();
6457}
6558
6659
67READ8_MEMBER(cyberbal_state::cyberbal_sound_68k_6502_r)
60READ8_MEMBER(cyberbal_state::sound_68k_6502_r)
6861{
6962   m_sound_data_from_68k_ready = 0;
7063   return m_sound_data_from_68k;
7164}
7265
7366
74WRITE8_MEMBER(cyberbal_state::cyberbal_sound_68k_6502_w)
67WRITE8_MEMBER(cyberbal_state::sound_68k_6502_w)
7568{
7669   m_sound_data_from_6502 = data;
7770   m_sound_data_from_6502_ready = 1;
r20357r20358
7972   if (!m_io_68k_int)
8073   {
8174      m_io_68k_int = 1;
82      update_sound_68k_interrupts(machine());
75      update_sound_68k_interrupts();
8376   }
8477}
8578
r20357r20358
9184 *
9285 *************************************/
9386
94static void update_sound_68k_interrupts(running_machine &machine)
87void cyberbal_state::update_sound_68k_interrupts()
9588{
96   cyberbal_state *state = machine.driver_data<cyberbal_state>();
97   machine.device("dac")->execute().set_input_line(6, state->m_fast_68k_int ? ASSERT_LINE : CLEAR_LINE);
98   machine.device("dac")->execute().set_input_line(2, state->m_io_68k_int   ? ASSERT_LINE : CLEAR_LINE);
89   m_daccpu->set_input_line(6, m_fast_68k_int ? ASSERT_LINE : CLEAR_LINE);
90   m_daccpu->set_input_line(2, m_io_68k_int   ? ASSERT_LINE : CLEAR_LINE);
9991}
10092
10193
102INTERRUPT_GEN_MEMBER(cyberbal_state::cyberbal_sound_68k_irq_gen)
94INTERRUPT_GEN_MEMBER(cyberbal_state::sound_68k_irq_gen)
10395{
10496   if (!m_fast_68k_int)
10597   {
10698      m_fast_68k_int = 1;
107      update_sound_68k_interrupts(machine());
99      update_sound_68k_interrupts();
108100   }
109101}
110102
111103
112WRITE16_MEMBER(cyberbal_state::cyberbal_io_68k_irq_ack_w)
104WRITE16_MEMBER(cyberbal_state::io_68k_irq_ack_w)
113105{
114106   if (m_io_68k_int)
115107   {
116108      m_io_68k_int = 0;
117      update_sound_68k_interrupts(machine());
109      update_sound_68k_interrupts();
118110   }
119111}
120112
121113
122READ16_MEMBER(cyberbal_state::cyberbal_sound_68k_r)
114READ16_MEMBER(cyberbal_state::sound_68k_r)
123115{
124116   int temp = (m_sound_data_from_6502 << 8) | 0xff;
125117
r20357r20358
131123}
132124
133125
134WRITE16_MEMBER(cyberbal_state::cyberbal_sound_68k_w)
126WRITE16_MEMBER(cyberbal_state::sound_68k_w)
135127{
136128   if (ACCESSING_BITS_8_15)
137129   {
r20357r20358
141133}
142134
143135
144WRITE16_MEMBER(cyberbal_state::cyberbal_sound_68k_dac_w)
136WRITE16_MEMBER(cyberbal_state::sound_68k_dac_w)
145137{
146   dac_device *dac = machine().device<dac_device>((offset & 8) ? "dac2" : "dac1");
138   dac_device *dac = (offset & 8) ? m_dac2 : m_dac1;
147139   dac->write_unsigned16((((data >> 3) & 0x800) | ((data >> 2) & 0x7ff)) << 4);
148140
149141   if (m_fast_68k_int)
150142   {
151143      m_fast_68k_int = 0;
152      update_sound_68k_interrupts(machine());
144      update_sound_68k_interrupts();
153145   }
154146}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team