Previous 199869 Revisions Next

r20826 Friday 8th February, 2013 at 12:09:50 UTC by Miodrag Milanović
modernized rest of galaga (nw)
[src/mame/drivers]galaga.c
[src/mame/includes]galaga.h
[src/mame/machine]xevious.c
[src/mame/video]bosco.c digdug.c galaga.c xevious.c

trunk/src/mame/machine/xevious.c
r20825r20826
1717
1818***************************************************************************/
1919
20static UINT8 customio[16];
21static char battles_customio_command;
22static char battles_customio_prev_command;
23static char battles_customio_command_count;
24static char battles_customio_data;
25static char battles_sound_played;
26
27
28void battles_customio_init(running_machine &machine)
20void xevious_state::battles_customio_init()
2921{
30   battles_customio_command = 0;
31   battles_customio_prev_command = 0;
32   battles_customio_command_count = 0;
33   battles_customio_data = 0;
34   battles_sound_played = 0;
22   m_battles_customio_command = 0;
23   m_battles_customio_prev_command = 0;
24   m_battles_customio_command_count = 0;
25   m_battles_customio_data = 0;
26   m_battles_sound_played = 0;
3527}
3628
3729
3830TIMER_DEVICE_CALLBACK_MEMBER(xevious_state::battles_nmi_generate)
3931{
40   battles_customio_prev_command = battles_customio_command;
32   m_battles_customio_prev_command = m_battles_customio_command;
4133
42   if( battles_customio_command & 0x10 )
34   if( m_battles_customio_command & 0x10 )
4335   {
44      if( battles_customio_command_count == 0 )
36      if( m_battles_customio_command_count == 0 )
4537      {
4638         machine().device("sub3")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
4739      }
r20825r20826
5648      machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
5749      machine().device("sub3")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
5850   }
59   battles_customio_command_count++;
51   m_battles_customio_command_count++;
6052}
6153
6254
63READ8_HANDLER( battles_customio0_r )
55READ8_MEMBER( xevious_state::battles_customio0_r )
6456{
65   logerror("CPU0 %04x: custom I/O Read = %02x\n",space.device().safe_pc(),battles_customio_command);
66   return battles_customio_command;
57   logerror("CPU0 %04x: custom I/O Read = %02x\n",space.device().safe_pc(),m_battles_customio_command);
58   return m_battles_customio_command;
6759}
6860
69READ8_HANDLER( battles_customio3_r )
61READ8_MEMBER( xevious_state::battles_customio3_r )
7062{
7163   int return_data;
7264
7365   if( space.device().safe_pc() == 0xAE ){
7466      /* CPU4 0xAA - 0xB9 : waiting for MB8851 ? */
75      return_data =   ( (battles_customio_command & 0x10) << 3)
67      return_data =   ( (m_battles_customio_command & 0x10) << 3)
7668                  | 0x00
77                  | (battles_customio_command & 0x0f);
69                  | (m_battles_customio_command & 0x0f);
7870   }else{
79      return_data =   ( (battles_customio_prev_command & 0x10) << 3)
71      return_data =   ( (m_battles_customio_prev_command & 0x10) << 3)
8072                  | 0x60
81                  | (battles_customio_prev_command & 0x0f);
73                  | (m_battles_customio_prev_command & 0x0f);
8274   }
8375   logerror("CPU3 %04x: custom I/O Read = %02x\n",space.device().safe_pc(),return_data);
8476
r20825r20826
8678}
8779
8880
89WRITE8_HANDLER( battles_customio0_w )
81WRITE8_MEMBER( xevious_state::battles_customio0_w )
9082{
91   timer_device *timer = space.machine().device<timer_device>("battles_nmi");
83   timer_device *timer = machine().device<timer_device>("battles_nmi");
9284
9385   logerror("CPU0 %04x: custom I/O Write = %02x\n",space.device().safe_pc(),data);
9486
95   battles_customio_command = data;
96   battles_customio_command_count = 0;
87   m_battles_customio_command = data;
88   m_battles_customio_command_count = 0;
9789
9890   switch (data)
9991   {
r20825r20826
10597
10698}
10799
108WRITE8_HANDLER( battles_customio3_w )
100WRITE8_MEMBER( xevious_state::battles_customio3_w )
109101{
110102   logerror("CPU3 %04x: custom I/O Write = %02x\n",space.device().safe_pc(),data);
111103
112   battles_customio_command = data;
104   m_battles_customio_command = data;
113105}
114106
115107
116108
117READ8_HANDLER( battles_customio_data0_r )
109READ8_MEMBER( xevious_state::battles_customio_data0_r )
118110{
119   logerror("CPU0 %04x: custom I/O parameter %02x Read = %02x\n",space.device().safe_pc(),offset,battles_customio_data);
111   logerror("CPU0 %04x: custom I/O parameter %02x Read = %02x\n",space.device().safe_pc(),offset,m_battles_customio_data);
120112
121   return battles_customio_data;
113   return m_battles_customio_data;
122114}
123115
124READ8_HANDLER( battles_customio_data3_r )
116READ8_MEMBER( xevious_state::battles_customio_data3_r )
125117{
126   logerror("CPU3 %04x: custom I/O parameter %02x Read = %02x\n",space.device().safe_pc(),offset,battles_customio_data);
127   return battles_customio_data;
118   logerror("CPU3 %04x: custom I/O parameter %02x Read = %02x\n",space.device().safe_pc(),offset,m_battles_customio_data);
119   return m_battles_customio_data;
128120}
129121
130122
131WRITE8_HANDLER( battles_customio_data0_w )
123WRITE8_MEMBER( xevious_state::battles_customio_data0_w )
132124{
133125   logerror("CPU0 %04x: custom I/O parameter %02x Write = %02x\n",space.device().safe_pc(),offset,data);
134   battles_customio_data = data;
126   m_battles_customio_data = data;
135127}
136128
137WRITE8_HANDLER( battles_customio_data3_w )
129WRITE8_MEMBER( xevious_state::battles_customio_data3_w )
138130{
139131   logerror("CPU3 %04x: custom I/O parameter %02x Write = %02x\n",space.device().safe_pc(),offset,data);
140   battles_customio_data = data;
132   m_battles_customio_data = data;
141133}
142134
143135
144WRITE8_HANDLER( battles_CPU4_coin_w )
136WRITE8_MEMBER( xevious_state::battles_CPU4_coin_w )
145137{
146   set_led_status(space.machine(), 0,data & 0x02); // Start 1
147   set_led_status(space.machine(), 1,data & 0x01); // Start 2
138   set_led_status(machine(), 0,data & 0x02); // Start 1
139   set_led_status(machine(), 1,data & 0x01); // Start 2
148140
149   coin_counter_w(space.machine(), 0,data & 0x20);
150   coin_counter_w(space.machine(), 1,data & 0x10);
151   coin_lockout_global_w(space.machine(), ~data & 0x04);
141   coin_counter_w(machine(), 0,data & 0x20);
142   coin_counter_w(machine(), 1,data & 0x10);
143   coin_lockout_global_w(machine(), ~data & 0x04);
152144}
153145
154146
155WRITE8_HANDLER( battles_noise_sound_w )
147WRITE8_MEMBER( xevious_state::battles_noise_sound_w )
156148{
157149   logerror("CPU3 %04x: 50%02x Write = %02x\n",space.device().safe_pc(),offset,data);
158   if( (battles_sound_played == 0) && (data == 0xFF) ){
159      samples_device *samples = space.machine().device<samples_device>("samples");
160      if( customio[0] == 0x40 ){
150   if( (m_battles_sound_played == 0) && (data == 0xFF) ){
151      samples_device *samples = machine().device<samples_device>("samples");
152      if( m_customio[0] == 0x40 ){
161153         samples->start(0, 0);
162154      }
163155      else{
164156         samples->start(0, 1);
165157      }
166158   }
167   battles_sound_played = data;
159   m_battles_sound_played = data;
168160}
169161
170162
171READ8_HANDLER( battles_input_port_r )
163READ8_MEMBER( xevious_state::battles_input_port_r )
172164{
173165   switch ( offset )
174166   {
175167      default:
176      case 0: return ~BITSWAP8(space.machine().root_device().ioport("IN0H")->read(),7,6,5,4,2,3,1,0);
177      case 1: return ~space.machine().root_device().ioport("IN1L")->read();
178      case 2: return ~space.machine().root_device().ioport("IN1H")->read();
179      case 3: return ~space.machine().root_device().ioport("IN0L")->read();
168      case 0: return ~BITSWAP8(machine().root_device().ioport("IN0H")->read(),7,6,5,4,2,3,1,0);
169      case 1: return ~machine().root_device().ioport("IN1L")->read();
170      case 2: return ~machine().root_device().ioport("IN1H")->read();
171      case 3: return ~machine().root_device().ioport("IN0L")->read();
180172   }
181173}
182174
trunk/src/mame/video/xevious.c
r20825r20826
237237
238238***************************************************************************/
239239
240WRITE8_HANDLER( xevious_fg_videoram_w )
240WRITE8_MEMBER( xevious_state::xevious_fg_videoram_w )
241241{
242   xevious_state *state =  space.machine().driver_data<xevious_state>();
243
244   state->m_xevious_fg_videoram[offset] = data;
245   state->m_fg_tilemap->mark_tile_dirty(offset);
242   m_xevious_fg_videoram[offset] = data;
243   m_fg_tilemap->mark_tile_dirty(offset);
246244}
247245
248WRITE8_HANDLER( xevious_fg_colorram_w )
246WRITE8_MEMBER( xevious_state::xevious_fg_colorram_w )
249247{
250   xevious_state *state =  space.machine().driver_data<xevious_state>();
251
252   state->m_xevious_fg_colorram[offset] = data;
253   state->m_fg_tilemap->mark_tile_dirty(offset);
248   m_xevious_fg_colorram[offset] = data;
249   m_fg_tilemap->mark_tile_dirty(offset);
254250}
255251
256WRITE8_HANDLER( xevious_bg_videoram_w )
252WRITE8_MEMBER( xevious_state::xevious_bg_videoram_w )
257253{
258   xevious_state *state =  space.machine().driver_data<xevious_state>();
259
260   state->m_xevious_bg_videoram[offset] = data;
261   state->m_bg_tilemap->mark_tile_dirty(offset);
254   m_xevious_bg_videoram[offset] = data;
255   m_bg_tilemap->mark_tile_dirty(offset);
262256}
263257
264WRITE8_HANDLER( xevious_bg_colorram_w )
258WRITE8_MEMBER( xevious_state::xevious_bg_colorram_w )
265259{
266   xevious_state *state =  space.machine().driver_data<xevious_state>();
267
268   state->m_xevious_bg_colorram[offset] = data;
269   state->m_bg_tilemap->mark_tile_dirty(offset);
260   m_xevious_bg_colorram[offset] = data;
261   m_bg_tilemap->mark_tile_dirty(offset);
270262}
271263
272WRITE8_HANDLER( xevious_vh_latch_w )
264WRITE8_MEMBER( xevious_state::xevious_vh_latch_w )
273265{
274   xevious_state *state =  space.machine().driver_data<xevious_state>();
275
276266   int reg;
277267   int scroll = data + ((offset&0x01)<<8);   /* A0 -> D8 */
278268
r20825r20826
281271   switch (reg)
282272   {
283273   case 0:
284      state->m_bg_tilemap->set_scrollx(0,scroll);
274      m_bg_tilemap->set_scrollx(0,scroll);
285275      break;
286276   case 1:
287      state->m_fg_tilemap->set_scrollx(0,scroll);
277      m_fg_tilemap->set_scrollx(0,scroll);
288278      break;
289279   case 2:
290      state->m_bg_tilemap->set_scrolly(0,scroll);
280      m_bg_tilemap->set_scrolly(0,scroll);
291281      break;
292282   case 3:
293      state->m_fg_tilemap->set_scrolly(0,scroll);
283      m_fg_tilemap->set_scrolly(0,scroll);
294284      break;
295285   case 7:
296      state->flip_screen_set(scroll & 1);
286      flip_screen_set(scroll & 1);
297287      break;
298288   default:
299289         logerror("CRTC WRITE REG: %x  Data: %03x\n",reg, scroll);
r20825r20826
303293
304294
305295/* emulation for schematic 9B */
306WRITE8_HANDLER( xevious_bs_w )
296WRITE8_MEMBER( xevious_state::xevious_bs_w )
307297{
308   xevious_state *state =  space.machine().driver_data<xevious_state>();
309
310   state->m_xevious_bs[offset & 1] = data;
298   m_xevious_bs[offset & 1] = data;
311299}
312300
313READ8_HANDLER( xevious_bb_r )
301READ8_MEMBER( xevious_state::xevious_bb_r )
314302{
315   xevious_state *state =  space.machine().driver_data<xevious_state>();
316
317   UINT8 *rom2a = state->memregion("gfx4")->base();
303   UINT8 *rom2a = memregion("gfx4")->base();
318304   UINT8 *rom2b = rom2a+0x1000;
319305   UINT8 *rom2c = rom2a+0x3000;
320306   int adr_2b,adr_2c;
321307   int dat1,dat2;
322308
323309   /* get BS to 12 bit data from 2A,2B */
324   adr_2b = ((state->m_xevious_bs[1] & 0x7e) << 6) | ((state->m_xevious_bs[0] & 0xfe) >> 1);
310   adr_2b = ((m_xevious_bs[1] & 0x7e) << 6) | ((m_xevious_bs[0] & 0xfe) >> 1);
325311
326312   if (adr_2b & 1)
327313   {
r20825r20826
334320      dat1 = ((rom2a[adr_2b >> 1] & 0x0f) << 8) | rom2b[adr_2b];
335321   }
336322
337   adr_2c = ((dat1 & 0x1ff) << 2) | ((state->m_xevious_bs[1] & 1) << 1) | (state->m_xevious_bs[0] & 1);
323   adr_2c = ((dat1 & 0x1ff) << 2) | ((m_xevious_bs[1] & 1) << 1) | (m_xevious_bs[0] & 1);
338324   if (dat1 & 0x400) adr_2c ^= 1;
339325   if (dat1 & 0x200) adr_2c ^= 2;
340326
trunk/src/mame/video/bosco.c
r20825r20826
150150
151151***************************************************************************/
152152
153WRITE8_HANDLER( bosco_videoram_w )
153WRITE8_MEMBER( bosco_state::bosco_videoram_w )
154154{
155   bosco_state *state =  space.machine().driver_data<bosco_state>();
156
157   state->m_videoram[offset] = data;
155   m_videoram[offset] = data;
158156   if (offset & 0x400)
159      state->m_bg_tilemap->mark_tile_dirty(offset & 0x3ff);
157      m_bg_tilemap->mark_tile_dirty(offset & 0x3ff);
160158   else
161      state->m_fg_tilemap->mark_tile_dirty(offset & 0x3ff);
159      m_fg_tilemap->mark_tile_dirty(offset & 0x3ff);
162160}
163161
164WRITE8_HANDLER( bosco_scrollx_w )
162WRITE8_MEMBER( bosco_state::bosco_scrollx_w )
165163{
166   bosco_state *state =  space.machine().driver_data<bosco_state>();
167
168   state->m_bg_tilemap->set_scrollx(0,data);
164   m_bg_tilemap->set_scrollx(0,data);
169165}
170166
171WRITE8_HANDLER( bosco_scrolly_w )
167WRITE8_MEMBER( bosco_state::bosco_scrolly_w )
172168{
173   bosco_state *state =  space.machine().driver_data<bosco_state>();
174   state->m_bg_tilemap->set_scrolly(0,data);
169   m_bg_tilemap->set_scrolly(0,data);
175170}
176171
177WRITE8_HANDLER( bosco_starclr_w )
172WRITE8_MEMBER( bosco_state::bosco_starclr_w )
178173{
179174}
180175
r20825r20826
255250      {
256251         int x,y;
257252
258         if ( (set_a == star_seed_tab[star_cntr].set) || ( set_b == star_seed_tab[star_cntr].set) )
253         if ( (set_a == m_star_seed_tab[star_cntr].set) || ( set_b == m_star_seed_tab[star_cntr].set) )
259254         {
260            x = (star_seed_tab[star_cntr].x + m_stars_scrollx) % 256;
261            y = (star_seed_tab[star_cntr].y + m_stars_scrolly) % 256;
255            x = (m_star_seed_tab[star_cntr].x + m_stars_scrollx) % 256;
256            y = (m_star_seed_tab[star_cntr].y + m_stars_scrolly) % 256;
262257
263258            /* dont draw the stars that are off the screen */
264259            if ( x < 224 )
r20825r20826
266261               if (flip) x += 20*8;
267262
268263               if (cliprect.contains(x, y))
269                  bitmap.pix16(y, x) = STARS_COLOR_BASE + star_seed_tab[star_cntr].col;
264                  bitmap.pix16(y, x) = STARS_COLOR_BASE + m_star_seed_tab[star_cntr].col;
270265            }
271266         }
272267      }
trunk/src/mame/video/galaga.c
r20825r20826
3131
3232*/
3333
34const struct star star_seed_tab[252]=
34struct galaga_state::star galaga_state::m_star_seed_tab[252]=
3535{
3636/* also shared by Bosconian */
3737
r20825r20826
544544      {
545545         int x,y;
546546
547         if ( (set_a == star_seed_tab[star_cntr].set) || ( set_b == star_seed_tab[star_cntr].set) )
547         if ( (set_a == m_star_seed_tab[star_cntr].set) || ( set_b == m_star_seed_tab[star_cntr].set) )
548548         {
549            x = (star_seed_tab[star_cntr].x + m_stars_scrollx) % 256 + x_align;
550            y = (y_align + star_seed_tab[star_cntr].y + m_stars_scrolly) % 256;
549            x = (m_star_seed_tab[star_cntr].x + m_stars_scrollx) % 256 + x_align;
550            y = (y_align + m_star_seed_tab[star_cntr].y + m_stars_scrolly) % 256;
551551
552552            if (cliprect.contains(x, y))
553               bitmap.pix16(y, x) = STARS_COLOR_BASE + star_seed_tab[ star_cntr ].col;
553               bitmap.pix16(y, x) = STARS_COLOR_BASE + m_star_seed_tab[ star_cntr ].col;
554554         }
555555
556556      }
trunk/src/mame/video/digdug.c
r20825r20826
162162
163163***************************************************************************/
164164
165WRITE8_HANDLER( digdug_videoram_w )
165WRITE8_MEMBER( digdug_state::digdug_videoram_w )
166166{
167   digdug_state *state =  space.machine().driver_data<digdug_state>();
168
169   state->m_videoram[offset] = data;
170   state->m_fg_tilemap->mark_tile_dirty(offset & 0x3ff);
167   m_videoram[offset] = data;
168   m_fg_tilemap->mark_tile_dirty(offset & 0x3ff);
171169}
172170
173WRITE8_HANDLER( digdug_PORT_w )
171WRITE8_MEMBER( digdug_state::digdug_PORT_w )
174172{
175   digdug_state *state =  space.machine().driver_data<digdug_state>();
176
177173   switch (offset)
178174   {
179175      case 0: /* select background picture */
r20825r20826
182178            int shift = offset;
183179            int mask = 1 << shift;
184180
185            if ((state->m_bg_select & mask) != ((data & 1) << shift))
181            if ((m_bg_select & mask) != ((data & 1) << shift))
186182            {
187               state->m_bg_select = (state->m_bg_select & ~mask) | ((data & 1) << shift);
188               state->m_bg_tilemap->mark_all_dirty();
183               m_bg_select = (m_bg_select & ~mask) | ((data & 1) << shift);
184               m_bg_tilemap->mark_all_dirty();
189185            }
190186         }
191187         break;
192188
193189      case 2: /* select alpha layer color mode (see tx_get_tile_info) */
194         if (state->m_tx_color_mode != (data & 1))
190         if (m_tx_color_mode != (data & 1))
195191         {
196            state->m_tx_color_mode = data & 1;
197            state->m_fg_tilemap->mark_all_dirty();
192            m_tx_color_mode = data & 1;
193            m_fg_tilemap->mark_all_dirty();
198194         }
199195         break;
200196
201197      case 3: /* "disable" background (see bg_get_tile_info) */
202         if (state->m_bg_disable != (data & 1))
198         if (m_bg_disable != (data & 1))
203199         {
204            state->m_bg_disable = data & 1;
205            state->m_bg_tilemap->mark_all_dirty();
200            m_bg_disable = data & 1;
201            m_bg_tilemap->mark_all_dirty();
206202         }
207203         break;
208204
r20825r20826
212208            int shift = offset;
213209            int mask = 1 << shift;
214210
215            if ((state->m_bg_color_bank & mask) != ((data & 1) << shift))
211            if ((m_bg_color_bank & mask) != ((data & 1) << shift))
216212            {
217               state->m_bg_color_bank = (state->m_bg_color_bank & ~mask) | ((data & 1) << shift);
218               state->m_bg_tilemap->mark_all_dirty();
213               m_bg_color_bank = (m_bg_color_bank & ~mask) | ((data & 1) << shift);
214               m_bg_tilemap->mark_all_dirty();
219215            }
220216         }
221217         break;
r20825r20826
224220         break;
225221
226222      case 7: /* FLIP */
227         state->flip_screen_set(data & 1);
223         flip_screen_set(data & 1);
228224         break;
229225   }
230226}
trunk/src/mame/includes/galaga.h
r20825r20826
6464   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
6565   void draw_stars(bitmap_ind16 &bitmap, const rectangle &cliprect );
6666   void bosco_latch_reset();
67   struct star
68   {
69      UINT16 x,y;
70      UINT8 col,set;
71   };
72
73   static struct star m_star_seed_tab[];
6774};
6875
6976class xevious_state : public galaga_state
r20825r20826
102109   INTERRUPT_GEN_MEMBER(battles_interrupt_4);
103110   TIMER_DEVICE_CALLBACK_MEMBER(battles_nmi_generate);
104111   void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
112   DECLARE_WRITE8_MEMBER( xevious_fg_videoram_w );
113   DECLARE_WRITE8_MEMBER( xevious_fg_colorram_w );
114   DECLARE_WRITE8_MEMBER( xevious_bg_videoram_w );
115   DECLARE_WRITE8_MEMBER( xevious_bg_colorram_w );
116   DECLARE_WRITE8_MEMBER( xevious_vh_latch_w );
117   DECLARE_WRITE8_MEMBER( xevious_bs_w );
118   DECLARE_READ8_MEMBER( xevious_bb_r );
119   
120   // Custom I/O
121   void battles_customio_init();
122
123   DECLARE_READ8_MEMBER( battles_customio0_r );
124   DECLARE_READ8_MEMBER( battles_customio_data0_r );
125   DECLARE_READ8_MEMBER( battles_customio3_r );
126   DECLARE_READ8_MEMBER( battles_customio_data3_r );
127   DECLARE_READ8_MEMBER( battles_input_port_r );
128
129   DECLARE_WRITE8_MEMBER( battles_customio0_w );
130   DECLARE_WRITE8_MEMBER( battles_customio_data0_w );
131   DECLARE_WRITE8_MEMBER( battles_customio3_w );
132   DECLARE_WRITE8_MEMBER( battles_customio_data3_w );
133   DECLARE_WRITE8_MEMBER( battles_CPU4_coin_w );
134   DECLARE_WRITE8_MEMBER( battles_noise_sound_w );
135   
136   UINT8 m_customio[16];
137   char m_battles_customio_command;
138   char m_battles_customio_prev_command;
139   char m_battles_customio_command_count;
140   char m_battles_customio_data;
141   char m_battles_sound_played;
105142};
106143
107144
r20825r20826
138175   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
139176   void draw_bullets(bitmap_ind16 &bitmap, const rectangle &cliprect);
140177   void draw_stars(bitmap_ind16 &bitmap, const rectangle &cliprect, int flip);   
178   DECLARE_WRITE8_MEMBER( bosco_videoram_w );
179   DECLARE_WRITE8_MEMBER( bosco_scrollx_w );
180   DECLARE_WRITE8_MEMBER( bosco_scrolly_w );
181   DECLARE_WRITE8_MEMBER( bosco_starclr_w );
141182};
142183
143184class digdug_state : public galaga_state
r20825r20826
165206   DECLARE_PALETTE_INIT(digdug);
166207   UINT32 screen_update_digdug(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
167208   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
209   DECLARE_WRITE8_MEMBER( digdug_videoram_w );
210   DECLARE_WRITE8_MEMBER( digdug_PORT_w );   
168211};
169212
170/*----------- defined in video/bosco.c -----------*/
171
172DECLARE_WRITE8_HANDLER( bosco_videoram_w );
173DECLARE_WRITE8_HANDLER( bosco_scrollx_w );
174DECLARE_WRITE8_HANDLER( bosco_scrolly_w );
175DECLARE_WRITE8_HANDLER( bosco_starclr_w );
176
177213/*----------- defined in audio/galaga.c -----------*/
178214
179215DISCRETE_SOUND_EXTERN( bosco );
180216DISCRETE_SOUND_EXTERN( galaga );
181
182
183/*----------- defined in video/galaga.c -----------*/
184
185struct star
186{
187   UINT16 x,y;
188   UINT8 col,set;
189};
190
191extern const struct star star_seed_tab[];
192
193/*----------- defined in video/xevious.c -----------*/
194
195DECLARE_WRITE8_HANDLER( xevious_fg_videoram_w );
196DECLARE_WRITE8_HANDLER( xevious_fg_colorram_w );
197DECLARE_WRITE8_HANDLER( xevious_bg_videoram_w );
198DECLARE_WRITE8_HANDLER( xevious_bg_colorram_w );
199DECLARE_WRITE8_HANDLER( xevious_vh_latch_w );
200DECLARE_WRITE8_HANDLER( xevious_bs_w );
201DECLARE_READ8_HANDLER( xevious_bb_r );
202
203/*----------- defined in machine/xevious.c -----------*/
204
205void battles_customio_init(running_machine &machine);
206
207DECLARE_READ8_HANDLER( battles_customio0_r );
208DECLARE_READ8_HANDLER( battles_customio_data0_r );
209DECLARE_READ8_HANDLER( battles_customio3_r );
210DECLARE_READ8_HANDLER( battles_customio_data3_r );
211DECLARE_READ8_HANDLER( battles_input_port_r );
212
213DECLARE_WRITE8_HANDLER( battles_customio0_w );
214DECLARE_WRITE8_HANDLER( battles_customio_data0_w );
215DECLARE_WRITE8_HANDLER( battles_customio3_w );
216DECLARE_WRITE8_HANDLER( battles_customio_data3_w );
217DECLARE_WRITE8_HANDLER( battles_CPU4_coin_w );
218DECLARE_WRITE8_HANDLER( battles_noise_sound_w );
219
220/*----------- defined in video/digdug.c -----------*/
221
222DECLARE_WRITE8_HANDLER( digdug_videoram_w );
223DECLARE_WRITE8_HANDLER( digdug_PORT_w );
trunk/src/mame/drivers/galaga.c
r20825r20826
903903MACHINE_RESET_MEMBER(xevious_state,battles)
904904{
905905   MACHINE_RESET_CALL_MEMBER(galaga);
906   battles_customio_init(machine());
906   battles_customio_init();
907907}
908908
909909
r20825r20826
917917   AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE_LEGACY("06xx_0", namco_06xx_data_r, namco_06xx_data_w)
918918   AM_RANGE(0x7100, 0x7100) AM_DEVREADWRITE_LEGACY("06xx_0", namco_06xx_ctrl_r, namco_06xx_ctrl_w)
919919   AM_RANGE(0x7800, 0x7fff) AM_RAM AM_SHARE("share1")
920   AM_RANGE(0x8000, 0x8fff) AM_RAM_WRITE_LEGACY(bosco_videoram_w) AM_SHARE("videoram")/* + sprite registers */
920   AM_RANGE(0x8000, 0x8fff) AM_RAM_WRITE(bosco_videoram_w) AM_SHARE("videoram")/* + sprite registers */
921921   AM_RANGE(0x9000, 0x90ff) AM_DEVREADWRITE_LEGACY("06xx_1", namco_06xx_data_r, namco_06xx_data_w)
922922   AM_RANGE(0x9100, 0x9100) AM_DEVREADWRITE_LEGACY("06xx_1", namco_06xx_ctrl_r, namco_06xx_ctrl_w)
923923   AM_RANGE(0x9800, 0x980f) AM_WRITEONLY AM_SHARE("bosco_radarattr")
924   AM_RANGE(0x9810, 0x9810) AM_WRITE_LEGACY(bosco_scrollx_w)
925   AM_RANGE(0x9820, 0x9820) AM_WRITE_LEGACY(bosco_scrolly_w)
924   AM_RANGE(0x9810, 0x9810) AM_WRITE(bosco_scrollx_w)
925   AM_RANGE(0x9820, 0x9820) AM_WRITE(bosco_scrolly_w)
926926   AM_RANGE(0x9830, 0x9830) AM_WRITEONLY AM_SHARE("starcontrol")
927   AM_RANGE(0x9840, 0x9840) AM_WRITE_LEGACY(bosco_starclr_w)
927   AM_RANGE(0x9840, 0x9840) AM_WRITE(bosco_starclr_w)
928928   AM_RANGE(0x9870, 0x9870) AM_WRITE(bosco_flip_screen_w)
929929   AM_RANGE(0x9874, 0x9875) AM_WRITEONLY AM_SHARE("bosco_starblink")
930930ADDRESS_MAP_END
r20825r20826
959959   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("xevious_sr1") /* work RAM + sprite registers */
960960   AM_RANGE(0x9000, 0x97ff) AM_RAM AM_SHARE("xevious_sr2") /* work RAM + sprite registers */
961961   AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_SHARE("xevious_sr3") /* work RAM + sprite registers */
962   AM_RANGE(0xb000, 0xb7ff) AM_RAM_WRITE_LEGACY(xevious_fg_colorram_w) AM_SHARE("fg_colorram")
963   AM_RANGE(0xb800, 0xbfff) AM_RAM_WRITE_LEGACY(xevious_bg_colorram_w) AM_SHARE("bg_colorram")
964   AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE_LEGACY(xevious_fg_videoram_w) AM_SHARE("fg_videoram")
965   AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE_LEGACY(xevious_bg_videoram_w) AM_SHARE("bg_videoram")
966   AM_RANGE(0xd000, 0xd07f) AM_WRITE_LEGACY(xevious_vh_latch_w)
967   AM_RANGE(0xf000, 0xffff) AM_READWRITE_LEGACY(xevious_bb_r, xevious_bs_w)
962   AM_RANGE(0xb000, 0xb7ff) AM_RAM_WRITE(xevious_fg_colorram_w) AM_SHARE("fg_colorram")
963   AM_RANGE(0xb800, 0xbfff) AM_RAM_WRITE(xevious_bg_colorram_w) AM_SHARE("bg_colorram")
964   AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(xevious_fg_videoram_w) AM_SHARE("fg_videoram")
965   AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(xevious_bg_videoram_w) AM_SHARE("bg_videoram")
966   AM_RANGE(0xd000, 0xd07f) AM_WRITE(xevious_vh_latch_w)
967   AM_RANGE(0xf000, 0xffff) AM_READWRITE(xevious_bb_r, xevious_bs_w)
968968ADDRESS_MAP_END
969969
970970
r20825r20826
975975   AM_RANGE(0x6830, 0x6830) AM_WRITE(watchdog_reset_w)
976976   AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE_LEGACY("06xx", namco_06xx_data_r, namco_06xx_data_w)
977977   AM_RANGE(0x7100, 0x7100) AM_DEVREADWRITE_LEGACY("06xx", namco_06xx_ctrl_r, namco_06xx_ctrl_w)
978   AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE_LEGACY(digdug_videoram_w) AM_SHARE("videoram") /* tilemap RAM (bottom half of RAM 0 */
978   AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(digdug_videoram_w) AM_SHARE("videoram") /* tilemap RAM (bottom half of RAM 0 */
979979   AM_RANGE(0x8400, 0x87ff) AM_RAM AM_SHARE("share1")                          /* work RAM (top half for RAM 0 */
980980   AM_RANGE(0x8800, 0x8bff) AM_RAM AM_SHARE("digdug_objram")   /* work RAM + sprite registers */
981981   AM_RANGE(0x9000, 0x93ff) AM_RAM AM_SHARE("digdug_posram")   /* work RAM + sprite registers */
982982   AM_RANGE(0x9800, 0x9bff) AM_RAM AM_SHARE("digdug_flpram")   /* work RAM + sprite registers */
983   AM_RANGE(0xa000, 0xa007) AM_READNOP AM_WRITE_LEGACY(digdug_PORT_w)      /* video latches (spurious reads when setting latch bits) */
983   AM_RANGE(0xa000, 0xa007) AM_READNOP AM_WRITE(digdug_PORT_w)      /* video latches (spurious reads when setting latch bits) */
984984   AM_RANGE(0xb800, 0xb83f) AM_DEVREADWRITE("earom", atari_vg_earom_device, read, write)   /* non volatile memory data */
985985   AM_RANGE(0xb840, 0xb840) AM_DEVWRITE("earom", atari_vg_earom_device, ctrl_w)                    /* non volatile memory control */
986986ADDRESS_MAP_END
r20825r20826
993993   AM_RANGE(0x1000, 0x107f) AM_RAM
994994ADDRESS_MAP_END
995995
996static ADDRESS_MAP_START( battles_mem4, AS_PROGRAM, 8, galaga_state )
996static ADDRESS_MAP_START( battles_mem4, AS_PROGRAM, 8, xevious_state )
997997   AM_RANGE(0x0000, 0x0fff) AM_ROM
998   AM_RANGE(0x4000, 0x4003) AM_READ_LEGACY(battles_input_port_r)
999   AM_RANGE(0x4001, 0x4001) AM_WRITE_LEGACY(battles_CPU4_coin_w)
1000   AM_RANGE(0x5000, 0x5000) AM_WRITE_LEGACY(battles_noise_sound_w)
1001   AM_RANGE(0x6000, 0x6000) AM_READWRITE_LEGACY(battles_customio3_r, battles_customio3_w)
1002   AM_RANGE(0x7000, 0x7000) AM_READWRITE_LEGACY(battles_customio_data3_r, battles_customio_data3_w)
998   AM_RANGE(0x4000, 0x4003) AM_READ(battles_input_port_r)
999   AM_RANGE(0x4001, 0x4001) AM_WRITE(battles_CPU4_coin_w)
1000   AM_RANGE(0x5000, 0x5000) AM_WRITE(battles_noise_sound_w)
1001   AM_RANGE(0x6000, 0x6000) AM_READWRITE(battles_customio3_r, battles_customio3_w)
1002   AM_RANGE(0x7000, 0x7000) AM_READWRITE(battles_customio_data3_r, battles_customio_data3_w)
10031003   AM_RANGE(0x8000, 0x80ff) AM_RAM
10041004ADDRESS_MAP_END
10051005
r20825r20826
33483348DRIVER_INIT_MEMBER(xevious_state,battles)
33493349{
33503350   /* replace the Namco I/O handlers with interface to the 4th CPU */
3351   machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x7000, 0x700f, FUNC(battles_customio_data0_r), FUNC(battles_customio_data0_w) );
3352   machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x7100, 0x7100, FUNC(battles_customio0_r), FUNC(battles_customio0_w) );
3351   machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x7000, 0x700f, read8_delegate(FUNC(xevious_state::battles_customio_data0_r),this), write8_delegate(FUNC(xevious_state::battles_customio_data0_w),this) );
3352   machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x7100, 0x7100, read8_delegate(FUNC(xevious_state::battles_customio0_r),this), write8_delegate(FUNC(xevious_state::battles_customio0_w),this) );
33533353
33543354   DRIVER_INIT_CALL(xevious);
33553355}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team