Previous 15994 Revisions Next

r4583 Wednesday 29th April, 2009 at 00:24:28 UTC by Fabio Priuli
New round of number-to-tag conversions in CPU calls
[src/mess/drivers]nc.c nes.c newbrain.c p2000t.c palm.c pasogo.c pce.c pcw.c pcw16.c pentagon.c pk8020.c pp01.c psx.c px4.c ql.c
[src/mess/machine]nascom1.c nes.c nes_mmc.c ondra.c oric.c orion.c osborne1.c partner.c pc1251.c pc1350.c pc1401.c pc1403.c pc8801.c pce.c pdp1.c pecom.c pk8020.c pmd85.c pokemini.c pp01.c primo.c radio86.c
[src/mess/video]odyssey2.c oric.c pc8801.c pdp1.c pecom.c primo.c

src/mess/video/pdp1.c
r4582r4583
303303static void pdp1_draw_panel(running_machine *machine, bitmap_t *bitmap)
304304{
305305   /* column 1: registers, test word, test address */
306   pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset+2*8, y_panel_pc_offset+8, cpu_get_reg(machine->cpu[0], PDP1_PC), 16);
307   pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset+2*8, y_panel_ma_offset+8, cpu_get_reg(machine->cpu[0], PDP1_MA), 16);
308   pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset, y_panel_mb_offset+8, cpu_get_reg(machine->cpu[0], PDP1_MB), 18);
309   pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset, y_panel_ac_offset+8, cpu_get_reg(machine->cpu[0], PDP1_AC), 18);
310   pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset, y_panel_io_offset+8, cpu_get_reg(machine->cpu[0], PDP1_IO), 18);
311   pdp1_draw_switch(machine, bitmap, x_panel_col1_offset, y_panel_ta_offset+8, cpu_get_reg(machine->cpu[0], PDP1_EXTEND_SW));
312   pdp1_draw_multipleswitch(machine, bitmap, x_panel_col1_offset+2*8, y_panel_ta_offset+8, cpu_get_reg(machine->cpu[0], PDP1_TA), 16);
313   pdp1_draw_multipleswitch(machine, bitmap, x_panel_col1_offset, y_panel_tw_offset+8, cpu_get_reg(machine->cpu[0], PDP1_TW), 18);
306   pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset+2*8, y_panel_pc_offset+8, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_PC), 16);
307   pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset+2*8, y_panel_ma_offset+8, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_MA), 16);
308   pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset, y_panel_mb_offset+8, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_MB), 18);
309   pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset, y_panel_ac_offset+8, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_AC), 18);
310   pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset, y_panel_io_offset+8, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_IO), 18);
311   pdp1_draw_switch(machine, bitmap, x_panel_col1_offset, y_panel_ta_offset+8, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_EXTEND_SW));
312   pdp1_draw_multipleswitch(machine, bitmap, x_panel_col1_offset+2*8, y_panel_ta_offset+8, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_TA), 16);
313   pdp1_draw_multipleswitch(machine, bitmap, x_panel_col1_offset, y_panel_tw_offset+8, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_TW), 18);
314314
315315   /* column 2: 1-bit indicators */
316   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_run_offset, cpu_get_reg(machine->cpu[0], PDP1_RUN));
317   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_cyc_offset, cpu_get_reg(machine->cpu[0], PDP1_CYC));
318   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_defer_offset, cpu_get_reg(machine->cpu[0], PDP1_DEFER));
316   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_run_offset, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_RUN));
317   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_cyc_offset, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_CYC));
318   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_defer_offset, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_DEFER));
319319   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_hs_cyc_offset, 0);   /* not emulated */
320   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_brk_ctr_1_offset, cpu_get_reg(machine->cpu[0], PDP1_BRK_CTR) & 1);
321   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_brk_ctr_2_offset, cpu_get_reg(machine->cpu[0], PDP1_BRK_CTR) & 2);
322   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ov_offset, cpu_get_reg(machine->cpu[0], PDP1_OV));
323   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_rim_offset, cpu_get_reg(machine->cpu[0], PDP1_RIM));
324   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_sbm_offset, cpu_get_reg(machine->cpu[0], PDP1_SBM));
325   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_exd_offset, cpu_get_reg(machine->cpu[0], PDP1_EXD));
326   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ioh_offset, cpu_get_reg(machine->cpu[0], PDP1_IOH));
327   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ioc_offset, cpu_get_reg(machine->cpu[0], PDP1_IOC));
328   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ios_offset, cpu_get_reg(machine->cpu[0], PDP1_IOS));
320   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_brk_ctr_1_offset, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_BRK_CTR) & 1);
321   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_brk_ctr_2_offset, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_BRK_CTR) & 2);
322   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ov_offset, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_OV));
323   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_rim_offset, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_RIM));
324   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_sbm_offset, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_SBM));
325   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_exd_offset, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_EXD));
326   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ioh_offset, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_IOH));
327   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ioc_offset, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_IOC));
328   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ios_offset, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_IOS));
329329
330330   /* column 3: power, single step, single inst, sense, flags, instr... */
331331   pdp1_draw_led(machine, bitmap, x_panel_col3_offset, y_panel_power_offset, 1);   /* always on */
332332   pdp1_draw_switch(machine, bitmap, x_panel_col3_offset+8, y_panel_power_offset, 1);   /* always on */
333   pdp1_draw_led(machine, bitmap, x_panel_col3_offset, y_panel_sngl_step_offset, cpu_get_reg(machine->cpu[0], PDP1_SNGL_STEP));
334   pdp1_draw_switch(machine, bitmap, x_panel_col3_offset+8, y_panel_sngl_step_offset, cpu_get_reg(machine->cpu[0], PDP1_SNGL_STEP));
335   pdp1_draw_led(machine, bitmap, x_panel_col3_offset, y_panel_sngl_inst_offset, cpu_get_reg(machine->cpu[0], PDP1_SNGL_INST));
336   pdp1_draw_switch(machine, bitmap, x_panel_col3_offset+8, y_panel_sngl_inst_offset, cpu_get_reg(machine->cpu[0], PDP1_SNGL_INST));
337   pdp1_draw_multipleled(machine, bitmap, x_panel_col3_offset, y_panel_ss_offset+8, cpu_get_reg(machine->cpu[0], PDP1_SS), 6);
338   pdp1_draw_multipleswitch(machine, bitmap, x_panel_col3_offset, y_panel_ss_offset+2*8, cpu_get_reg(machine->cpu[0], PDP1_SS), 6);
339   pdp1_draw_multipleled(machine, bitmap, x_panel_col3_offset, y_panel_pf_offset+8, cpu_get_reg(machine->cpu[0], PDP1_PF), 6);
340   pdp1_draw_multipleled(machine, bitmap, x_panel_col3_offset, y_panel_ir_offset+8, cpu_get_reg(machine->cpu[0], PDP1_IR), 5);
333   pdp1_draw_led(machine, bitmap, x_panel_col3_offset, y_panel_sngl_step_offset, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_SNGL_STEP));
334   pdp1_draw_switch(machine, bitmap, x_panel_col3_offset+8, y_panel_sngl_step_offset, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_SNGL_STEP));
335   pdp1_draw_led(machine, bitmap, x_panel_col3_offset, y_panel_sngl_inst_offset, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_SNGL_INST));
336   pdp1_draw_switch(machine, bitmap, x_panel_col3_offset+8, y_panel_sngl_inst_offset, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_SNGL_INST));
337   pdp1_draw_multipleled(machine, bitmap, x_panel_col3_offset, y_panel_ss_offset+8, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_SS), 6);
338   pdp1_draw_multipleswitch(machine, bitmap, x_panel_col3_offset, y_panel_ss_offset+2*8, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_SS), 6);
339   pdp1_draw_multipleled(machine, bitmap, x_panel_col3_offset, y_panel_pf_offset+8, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_PF), 6);
340   pdp1_draw_multipleled(machine, bitmap, x_panel_col3_offset, y_panel_ir_offset+8, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_IR), 5);
341341}
342342
343343
src/mess/video/pc8801.c
r4582r4583
298298  }
299299
300300
301   if (rh5) memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc000, 0xefff, 0, 0, rh5);
302   if (wh5) memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc000, 0xefff, 0, 0, wh5);
303   if (rh6) memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xf000, 0xffff, 0, 0, rh6);
304   if (wh6) memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xf000, 0xffff, 0, 0, wh6);
301   if (rh5) memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc000, 0xefff, 0, 0, rh5);
302   if (wh5) memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc000, 0xefff, 0, 0, wh5);
303   if (rh6) memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xf000, 0xffff, 0, 0, rh6);
304   if (wh6) memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xf000, 0xffff, 0, 0, wh6);
305305}
306306
307307WRITE8_HANDLER(pc88sr_disp_32)
src/mess/video/oric.c
r4582r4583
121121{
122122   /* attribute */
123123   int attribute = c & 0x03f;
124   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
124   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
125125
126126   switch ((attribute>>3) & 0x03)
127127   {
r4582r4583
299299         }
300300
301301         /* fetch data */
302         c = RAM ? RAM[read_addr] : memory_read_byte(cpu_get_address_space(screen->machine->cpu[0], ADDRESS_SPACE_PROGRAM), read_addr);
302         c = RAM ? RAM[read_addr] : memory_read_byte(cputag_get_address_space(screen->machine, "maincpu", ADDRESS_SPACE_PROGRAM), read_addr);
303303
304304         /* if bits 6 and 5 are zero, the byte contains a serial attribute */
305         if ((c & ((1<<6) | (1<<5)))==0)
305         if ((c & ((1 << 6) | (1 << 5))) == 0)
306306         {
307            oric_vh_update_attribute(screen->machine,c);
307            oric_vh_update_attribute(screen->machine, c);
308308
309309            /* display background colour when attribute has been found */
310            oric_vh_render_6pixels(bitmap,x,y,vh_state.active_foreground_colour, vh_state.active_background_colour, 0,(c & 0x080));
310            oric_vh_render_6pixels(bitmap, x, y, vh_state.active_foreground_colour, vh_state.active_background_colour, 0, (c & 0x080));
311311
312            if (y<200)
312            if (y < 200)
313313            {
314314               /* is hires active? */
315               if (vh_state.mode & (1<<2))
315               if (vh_state.mode & (1 << 2))
316316               {
317317                  hires_active = 1;
318318               }
src/mess/video/odyssey2.c
r4582r4583
174174{
175175   int i;
176176
177   for ( i = 0; i < 24; i++ ) {
177   for ( i = 0; i < 24; i++ )
178   {
178179      palette_set_color_rgb( machine, i, odyssey2_colors[i*3], odyssey2_colors[i*3+1], odyssey2_colors[i*3+2] );
179180   }
180181}
r4582r4583
188189        case 0xa1:
189190         data = control_status;
190191         iff = 0;
191         cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE);
192         cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
192193         control_status &= ~ 0x08;
193         if ( video_screen_get_hpos( space->machine->primary_screen ) < I824X_START_ACTIVE_SCAN || video_screen_get_hpos( space->machine->primary_screen ) > I824X_END_ACTIVE_SCAN ) {
194         if ( video_screen_get_hpos( space->machine->primary_screen ) < I824X_START_ACTIVE_SCAN || video_screen_get_hpos( space->machine->primary_screen ) > I824X_END_ACTIVE_SCAN )
195         {
194196            data |= 1;
195197         }
196198
r4582r4583
214216
215217        case 0xa5:
216218
217            if ((o2_vdc.s.control & VDC_CONTROL_REG_STROBE_XY)) {
219            if ((o2_vdc.s.control & VDC_CONTROL_REG_STROBE_XY))
220         {
218221                x_beam_pos = video_screen_get_hpos( space->machine->primary_screen );
219            if ( x_beam_pos < I824X_START_ACTIVE_SCAN ) {
222            if ( x_beam_pos < I824X_START_ACTIVE_SCAN )
223            {
220224               x_beam_pos = x_beam_pos - I824X_START_ACTIVE_SCAN + I824X_LINE_CLOCKS;
221            } else {
225            }
226            else
227            {
222228               x_beam_pos = x_beam_pos - I824X_START_ACTIVE_SCAN;
223229            }
224230         }
r4582r4583
247253        {
248254            /* Toggling strobe bit, tuck away values */
249255            x_beam_pos = video_screen_get_hpos( space->machine->primary_screen );
250         if ( x_beam_pos < I824X_START_ACTIVE_SCAN ) {
256         if ( x_beam_pos < I824X_START_ACTIVE_SCAN )
257         {
251258            x_beam_pos = x_beam_pos - I824X_START_ACTIVE_SCAN + 228;
252         } else {
259         }
260         else
261         {
253262            x_beam_pos = x_beam_pos - I824X_START_ACTIVE_SCAN;
254263         }
255264
r4582r4583
268277    o2_vdc.reg[offset] = data;
269278}
270279
271WRITE8_HANDLER ( odyssey2_lum_w ) {
280WRITE8_HANDLER ( odyssey2_lum_w )
281{
272282   lum = data;
273283}
274284
275285READ8_HANDLER( odyssey2_t1_r )
276286{
277   if ( video_screen_get_vpos( space->machine->primary_screen ) > start_vpos && video_screen_get_vpos( space->machine->primary_screen ) < start_vblank ) {
278      if ( video_screen_get_hpos( space->machine->primary_screen ) >= I824X_START_ACTIVE_SCAN && video_screen_get_hpos( space->machine->primary_screen ) < I824X_END_ACTIVE_SCAN ) {
287   if ( video_screen_get_vpos( space->machine->primary_screen ) > start_vpos && video_screen_get_vpos( space->machine->primary_screen ) < start_vblank )
288   {
289      if ( video_screen_get_hpos( space->machine->primary_screen ) >= I824X_START_ACTIVE_SCAN && video_screen_get_hpos( space->machine->primary_screen ) < I824X_END_ACTIVE_SCAN )
290      {
279291         return 1;
280292      }
281293   }
282294   return 0;
283295}
284296
285static TIMER_CALLBACK( i824x_scanline_callback ) {
297static TIMER_CALLBACK( i824x_scanline_callback )
298{
286299   UINT8   collision_map[160];
287300   int      vpos = video_screen_get_vpos( machine->primary_screen );
288301
289302   if ( vpos < start_vpos )
290303      return;
291304
292   if ( vpos == start_vpos ) {
305   if ( vpos == start_vpos )
306   {
293307      control_status &= ~0x08;
294308   }
295309
296   if ( vpos < start_vblank ) {
310   if ( vpos < start_vblank )
311   {
297312      rectangle rect;
298313      int   sprite_width[4] = { 8, 8, 8, 8 };
299314      int i;
r4582r4583
310325      memset( collision_map, 0, sizeof( collision_map ) );
311326
312327      /* Display grid if enabled */
313      if ( o2_vdc.s.control & 0x08 ) {
328      if ( o2_vdc.s.control & 0x08 )
329      {
314330         UINT16   color = ( o2_vdc.s.color & 7 ) | ( ( o2_vdc.s.color >> 3 ) & 0x08 ) | ( ( lum << 3 ) ^ 0x08 );
315331         int      x_grid_offset = 8;
316332         int    y_grid_offset = 24;
r4582r4583
320336         int      j, k, y;
321337
322338         /* Draw horizontal part of grid */
323         for ( j = 1, y = 0; y < 9; y++, j <<= 1 ) {
324            if ( y_grid_offset + y * height <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y_grid_offset + y * height + 3 ) {
325               for ( i = 0; i < 9; i++ ) {
326                  if ( ( o2_vdc.s.hgrid[0][i] & j ) || ( o2_vdc.s.hgrid[1][i] & ( j >> 8 ) ) ) {
327                     for ( k = 0; k < width + 2; k++ ) {
339         for ( j = 1, y = 0; y < 9; y++, j <<= 1 )
340         {
341            if ( y_grid_offset + y * height <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y_grid_offset + y * height + 3 )
342            {
343               for ( i = 0; i < 9; i++ )
344               {
345                  if ( ( o2_vdc.s.hgrid[0][i] & j ) || ( o2_vdc.s.hgrid[1][i] & ( j >> 8 ) ) )
346                  {
347                     for ( k = 0; k < width + 2; k++ )
348                     {
328349                        int px = x_grid_offset + i * width + k;
329350                        collision_map[ px ] |= COLLISION_HORIZ_GRID_DOTS;
330351                        *BITMAP_ADDR16( tmp_bitmap, vpos, I824X_START_ACTIVE_SCAN + px ) = color;
r4582r4583
335356         }
336357
337358         /* Draw vertical part of grid */
338         for( j = 1, y = 0; y < 8; y++, j <<= 1 ) {
339            if ( y_grid_offset + y * height <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y_grid_offset + ( y + 1 ) * height ) {
340               for ( i = 0; i < 10; i++ ) {
341                  if ( o2_vdc.s.vgrid[i] & j ) {
342                     for ( k = 0; k < w; k++ ) {
359         for( j = 1, y = 0; y < 8; y++, j <<= 1 )
360         {
361            if ( y_grid_offset + y * height <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y_grid_offset + ( y + 1 ) * height )
362            {
363               for ( i = 0; i < 10; i++ )
364               {
365                  if ( o2_vdc.s.vgrid[i] & j )
366                  {
367                     for ( k = 0; k < w; k++ )
368                     {
343369                        int px = x_grid_offset + i * width + k;
344370
345371                        /* Check if we collide with an already drawn source object */
346                        if ( collision_map[ px ] & o2_vdc.s.collision ) {
372                        if ( collision_map[ px ] & o2_vdc.s.collision )
373                        {
347374                           collision_status |= COLLISION_VERTICAL_GRID;
348375                        }
349376                        /* Check if an already drawn object would collide with us */
350                        if ( COLLISION_VERTICAL_GRID & o2_vdc.s.collision && collision_map[ px ] ) {
377                        if ( COLLISION_VERTICAL_GRID & o2_vdc.s.collision && collision_map[ px ] )
378                        {
351379                           collision_status |= collision_map[ px ];
352380                        }
353381                        collision_map[ px ] |= COLLISION_VERTICAL_GRID;
r4582r4583
360388      }
361389
362390      /* Display objects if enabled */
363      if ( o2_vdc.s.control & 0x20 ) {
391      if ( o2_vdc.s.control & 0x20 )
392      {
364393         /* Regular foreground objects */
365         for ( i = 0; i < ARRAY_LENGTH( o2_vdc.s.foreground ); i++ ) {
394         for ( i = 0; i < ARRAY_LENGTH( o2_vdc.s.foreground ); i++ )
395         {
366396            int   y = o2_vdc.s.foreground[i].y;
367397            int   height = 8 - ( ( ( y >> 1 ) + o2_vdc.s.foreground[i].ptr ) & 7 );
368398
369            if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + height * 2 ) {
399            if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + height * 2 )
400            {
370401               UINT16   color = 16 + ( ( o2_vdc.s.foreground[i].color & 0x0E ) >> 1 );
371402               int      offset = ( o2_vdc.s.foreground[i].ptr | ( ( o2_vdc.s.foreground[i].color & 0x01 ) << 8 ) ) + ( y >> 1 ) + ( ( vpos - start_vpos - y ) >> 1 );
372403               UINT8   chr = ((char*)o2_shape)[ offset & 0x1FF ];
373404               int      x = o2_vdc.s.foreground[i].x;
374405               UINT8   m;
375406
376               for ( m = 0x80; m > 0; m >>= 1, x++ ) {
377                  if ( chr & m ) {
378                     if ( x >= 0 && x < 160 ) {
407               for ( m = 0x80; m > 0; m >>= 1, x++ )
408               {
409                  if ( chr & m )
410                  {
411                     if ( x >= 0 && x < 160 )
412                     {
379413                        /* Check if we collide with an already drawn source object */
380                        if ( collision_map[ x ] & o2_vdc.s.collision ) {
414                        if ( collision_map[ x ] & o2_vdc.s.collision )
415                        {
381416                           collision_status |= COLLISION_CHARACTERS;
382417                        }
383418                        /* Check if an already drawn object would collide with us */
384                        if ( COLLISION_CHARACTERS & o2_vdc.s.collision && collision_map[ x ] ) {
419                        if ( COLLISION_CHARACTERS & o2_vdc.s.collision && collision_map[ x ] )
420                        {
385421                           collision_status |= collision_map[ x ];
386422                        }
387423                        collision_map[ x ] |= COLLISION_CHARACTERS;
r4582r4583
393429         }
394430
395431         /* Quad objects */
396         for ( i = 0; i < ARRAY_LENGTH( o2_vdc.s.quad ); i++ ) {
432         for ( i = 0; i < ARRAY_LENGTH( o2_vdc.s.quad ); i++ )
433         {
397434            int y = o2_vdc.s.quad[i].single[0].y;
398435            int height = 8;
399436
400            if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + height * 2 ) {
437            if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + height * 2 )
438            {
401439               int   x = o2_vdc.s.quad[i].single[0].x;
402440               int j;
403441
404               for ( j = 0; j < ARRAY_LENGTH( o2_vdc.s.quad[0].single ); j++, x += 8 ) {
442               for ( j = 0; j < ARRAY_LENGTH( o2_vdc.s.quad[0].single ); j++, x += 8 )
443               {
405444                  int      char_height = 8 - ( ( ( y >> 1 ) + o2_vdc.s.quad[i].single[j].ptr ) & 7 );
406                  if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + char_height * 2 ) {
445                  if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + char_height * 2 )
446                  {
407447                     UINT16 color = 16 + ( ( o2_vdc.s.quad[i].single[j].color & 0x0E ) >> 1 );
408448                     int   offset = ( o2_vdc.s.quad[i].single[j].ptr | ( ( o2_vdc.s.quad[i].single[j].color & 0x01 ) << 8 ) ) + ( y >> 1 ) + ( ( vpos - start_vpos - y ) >> 1 );
409449                     UINT8   chr = ((char*)o2_shape)[ offset & 0x1FF ];
410450                     UINT8   m;
411                     for ( m = 0x80; m > 0; m >>= 1, x++ ) {
412                        if ( chr & m ) {
413                           if ( x >= 0 && x < 160 ) {
451                     for ( m = 0x80; m > 0; m >>= 1, x++ )
452                     {
453                        if ( chr & m )
454                        {
455                           if ( x >= 0 && x < 160 )
456                           {
414457                              /* Check if we collide with an already drawn source object */
415                              if ( collision_map[ x ] & o2_vdc.s.collision ) {
458                              if ( collision_map[ x ] & o2_vdc.s.collision )
459                              {
416460                                 collision_status |= COLLISION_CHARACTERS;
417461                              }
418462                              /* Check if an already drawn object would collide with us */
419                              if ( COLLISION_CHARACTERS & o2_vdc.s.collision && collision_map[ x ] ) {
463                              if ( COLLISION_CHARACTERS & o2_vdc.s.collision && collision_map[ x ] )
464                              {
420465                                 collision_status |= collision_map[ x ];
421466                              }
422467                              collision_map[ x ] |= COLLISION_CHARACTERS;
r4582r4583
424469                           }
425470                        }
426471                     }
427                  } else {
472                  }
473                  else
474                  {
428475                     x += 8;
429476                  }
430477               }
r4582r4583
432479         }
433480
434481         /* Sprites */
435         for ( i = 0; i < ARRAY_LENGTH( o2_vdc.s.sprites ); i++ ) {
482         for ( i = 0; i < ARRAY_LENGTH( o2_vdc.s.sprites ); i++ )
483         {
436484            int y = o2_vdc.s.sprites[i].y;
437485            int height = 8;
438            if ( o2_vdc.s.sprites[i].color & 4 ) {
486            if ( o2_vdc.s.sprites[i].color & 4 )
487            {
439488               /* Zoomed sprite */
440489               sprite_width[i] = 16;
441               if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + height * 4 ) {
490               if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + height * 4 )
491               {
442492                  UINT16 color = 16 + ( ( o2_vdc.s.sprites[i].color >> 3 ) & 0x07 );
443493                  UINT8   chr = o2_vdc.s.shape[i][ ( ( vpos - start_vpos - y ) >> 2 ) ];
444494                  int      x = o2_vdc.s.sprites[i].x;
445495                  UINT8   m;
446496
447                  for ( m = 0x01; m > 0; m <<= 1, x += 2 ) {
448                     if ( chr & m ) {
449                        if ( x >= 0 && x < 160 ) {
497                  for ( m = 0x01; m > 0; m <<= 1, x += 2 )
498                  {
499                     if ( chr & m )
500                     {
501                        if ( x >= 0 && x < 160 )
502                        {
450503                           /* Check if we collide with an already drawn source object */
451                           if ( collision_map[ x ] & o2_vdc.s.collision ) {
504                           if ( collision_map[ x ] & o2_vdc.s.collision )
505                           {
452506                              collision_status |= ( 1 << i );
453507                           }
454508                           /* Check if an already drawn object would collide with us */
455                           if ( ( 1 << i ) & o2_vdc.s.collision && collision_map[ x ] ) {
509                           if ( ( 1 << i ) & o2_vdc.s.collision && collision_map[ x ] )
510                           {
456511                              collision_status |= collision_map[ x ];
457512                           }
458513                           collision_map[ x ] |= ( 1 << i );
459514                           *BITMAP_ADDR16( tmp_bitmap, vpos, I824X_START_ACTIVE_SCAN + x ) = color;
460515                        }
461                        if ( x >= -1 && x < 159 ) {
516                        if ( x >= -1 && x < 159 )
517                        {
462518                           /* Check if we collide with an already drawn source object */
463                           if ( collision_map[ x ] & o2_vdc.s.collision ) {
519                           if ( collision_map[ x ] & o2_vdc.s.collision )
520                           {
464521                              collision_status |= ( 1 << i );
465522                           }
466523                           /* Check if an already drawn object would collide with us */
467                           if ( ( 1 << i ) & o2_vdc.s.collision && collision_map[ x ] ) {
524                           if ( ( 1 << i ) & o2_vdc.s.collision && collision_map[ x ] )
525                           {
468526                              collision_status |= collision_map[ x ];
469527                           }
470528                           collision_map[ x ] |= ( 1 << i );
r4582r4583
473531                     }
474532                  }
475533               }
476            } else {
534            }
535            else
536            {
477537               /* Regular sprite */
478               if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + height * 2 ) {
538               if ( y <= ( vpos - start_vpos ) && ( vpos - start_vpos ) < y + height * 2 )
539               {
479540                  UINT16 color = 16 + ( ( o2_vdc.s.sprites[i].color >> 3 ) & 0x07 );
480541                  UINT8   chr = o2_vdc.s.shape[i][ ( ( vpos - start_vpos - y ) >> 1 ) ];
481542                  int      x = o2_vdc.s.sprites[i].x;
482543                  UINT8   m;
483544
484                  for ( m = 0x01; m > 0; m <<= 1, x++ ) {
485                     if ( chr & m ) {
486                        if ( x >= 0 && x < 160 ) {
545                  for ( m = 0x01; m > 0; m <<= 1, x++ )
546                  {
547                     if ( chr & m )
548                      {
549                        if ( x >= 0 && x < 160 )
550                        {
487551                           /* Check if we collide with an already drawn source object */
488                           if ( collision_map[ x ] & o2_vdc.s.collision ) {
552                           if ( collision_map[ x ] & o2_vdc.s.collision )
553                           {
489554                              collision_status |= ( 1 << i );
490555                           }
491556                           /* Check if an already drawn object would collide with us */
492                           if ( ( 1 << i ) & o2_vdc.s.collision && collision_map[ x ] ) {
557                           if ( ( 1 << i ) & o2_vdc.s.collision && collision_map[ x ] )
558                           {
493559                              collision_status |= collision_map[ x ];
494560                           }
495561                           collision_map[ x ] |= ( 1 << i );
r4582r4583
504570   }
505571
506572   /* Check for start of VBlank */
507   if ( vpos == start_vblank ) {
573   if ( vpos == start_vblank )
574   {
508575      control_status |= 0x08;
509      if ( ! iff ) {
510         cpu_set_input_line(machine->cpu[0], 0, ASSERT_LINE);
576      if ( ! iff )
577      {
578         cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
511579         iff = 1;
512580      }
513581   }
514582}
515583
516static TIMER_CALLBACK( i824x_hblank_callback ) {
584static TIMER_CALLBACK( i824x_hblank_callback )
585{
517586   int vpos = video_screen_get_vpos( machine->primary_screen );
518587
519588   if ( vpos < start_vpos - 1 )
520589      return;
521590
522   if ( vpos < start_vblank - 1 ) {
591   if ( vpos < start_vblank - 1 )
592   {
523593      control_status |= 0x01;
524594   }
525595}
r4582r4583
614684            }
615685            /* Noise poly is : L=16 W=2 10000000000100001 */
616686            lfsr = ( lfsr >> 1 ) | ( ( ( lfsr & 0x01 ) ^ ( ( lfsr & 0x800 ) >> 11 ) ) << 15 );
617            if ( ! lfsr ) {
687            if ( ! lfsr )
688            {
618689               lfsr = 0xFFFF;
619690            }
620691            /* Check if noise should be applied */
621            if ( o2_vdc.s.sound & 0x10 ) {
692            if ( o2_vdc.s.sound & 0x10 )
693            {
622694               *buffer |= ( lfsr & 0x01 );
623695            }
624696            o2_vdc.s.shift3 = signal & 0xFF;
r4582r4583
629701         /* Throw an interrupt if enabled */
630702         if( o2_vdc.s.control & 0x4 )
631703         {
632            cpu_set_input_line(device->machine->cpu[0], 1, HOLD_LINE); /* Is this right? */
704            cputag_set_input_line(device->machine, "maincpu", 1, HOLD_LINE); /* Is this right? */
633705         }
634706
635707         /* Adjust volume */
r4582r4583
662734   UINT8   ram[1024];
663735} ef9341;
664736
665INLINE UINT16 ef9341_get_c_addr( void ) {
666   if ( ( ef9341.Y & 0x0C ) == 0x0C ) {
737INLINE UINT16 ef9341_get_c_addr( void )
738{
739   if ( ( ef9341.Y & 0x0C ) == 0x0C )
740   {
667741      return 0x318 | ( ( ef9341.X & 0x38 ) << 2 ) | ( ef9341.X & 0x07 );
668742   }
669   if ( ef9341.X & 0x20 ) {
743   if ( ef9341.X & 0x20 )
744   {
670745      return 0x300 | ( ( ef9341.Y & 0x07 ) << 5 ) | ( ef9341.Y & 0x18 ) | ( ef9341.X & 0x07 );
671746   }
672747   return ( ef9341.Y << 5 ) | ef9341.X;
673748}
674749
675INLINE void ef9341_inc_c( void ) {
750INLINE void ef9341_inc_c( void )
751{
676752   ef9341.X++;
677   if ( ef9341.X >= 40 ) {
753   if ( ef9341.X >= 40 )
754   {
678755      ef9341.Y = ( ef9341.Y + 1 ) % 24;
679756   }
680757}
681758
682void ef9341_w( int command, int b, UINT8 data ) {
759void ef9341_w( int command, int b, UINT8 data )
760{
683761   logerror("ef9341 %s write, t%s, data %02X\n", command ? "command" : "data", b ? "B" : "A", data );
684762
685   if ( command ) {
686      if ( b ) {
763   if ( command )
764   {
765      if ( b )
766      {
687767         ef9341.TB = data;
688768         ef9341.busy = 0x80;
689         switch( ef9341.TB & 0xE0 ) {
769         switch( ef9341.TB & 0xE0 )
770         {
690771         case 0x00:   /* Begin row */
691772            ef9341.X = 0;
692773            ef9341.Y = ef9341.TA & 0x1F;
r4582r4583
711792            break;
712793         }
713794         ef9341.busy = 0;
714      } else {
795      }
796      else
797      {
715798         ef9341.TA = data;
716799      }
717   } else {
718      if ( b ) {
800   }
801   else
802   {
803      if ( b )
804      {
719805         ef9341.TB = data;
720806         ef9341.busy = 0x80;
721         switch ( ef9341.M & 0xE0 ) {
807         switch ( ef9341.M & 0xE0 )
808         {
722809         case 0x00:   /* Write */
723810            ef9341.ram[ ef9341_get_c_addr() ] = ef9341.TB;
724811            ef9341_inc_c();
r4582r4583
735822            break;
736823         }
737824         ef9341.busy = 0;
738      } else {
825      }
826      else
827      {
739828         ef9341.TA = data;
740829      }
741830   }
742831}
743832
744UINT8 ef9341_r( int command, int b ) {
833UINT8 ef9341_r( int command, int b )
834{
745835   UINT8   data = 0xFF;
746836
747837   logerror("ef9341 %s read, t%s\n", command ? "command" : "data", b ? "B" : "A" );
748   if ( command ) {
749      if ( b ) {
838   if ( command )
839   {
840      if ( b )
841      {
750842         data = 0xFF;
751      } else {
843      }
844      else
845      {
752846         data = ef9341.busy;
753847      }
754   } else {
755      if ( b ) {
848   }
849   else
850   {
851      if ( b )
852      {
756853         data = ef9341.TB;
757854         ef9341.busy = 0x80;
758      } else {
855      }
856      else
857      {
759858         data = ef9341.TA;
760859      }
761860   }
src/mess/video/primo.c
r4582r4583
2323   UINT16 *scanline = BITMAP_ADDR16(bitmap, primo_scanline, 0);
2424
2525   /* address of current line in Primo video memory */
26   const UINT8* primo_video_ram_line = memory_get_read_ptr(cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM), primo_video_memory_base + 32*primo_scanline);
26   const UINT8* primo_video_ram_line = memory_get_read_ptr(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), primo_video_memory_base + 32 * primo_scanline);
2727
2828   for (x=0; x<256; x+=8)
2929   {
src/mess/video/pecom.c
r4582r4583
7171   {
7272      driver_state->dma = 0;
7373
74      cpu_set_input_line(device->machine->cpu[0], CDP1802_INPUT_LINE_DMAOUT, HOLD_LINE);
74      cputag_set_input_line(device->machine, "maincpu", CDP1802_INPUT_LINE_DMAOUT, HOLD_LINE);
7575   }
7676   else
7777   {
src/mess/machine/pdp1.c
r4582r4583
194194MACHINE_START( pdp1 )
195195{
196196   UINT8 *dst;
197   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
197   const address_space *space = cputag_get_address_space( machine, "maincpu", ADDRESS_SPACE_PROGRAM );
198198
199199   static const unsigned char fontdata6x8[pdp1_fontdata_size] =
200200   {   /* ASCII characters */
r4582r4583
526526               tape_reader.rcl = 0;
527527               if (tape_reader.rcp)
528528               {
529                  cpu_set_reg(machine->cpu[0], PDP1_IO, tape_reader.rb);   /* transfer reader buffer to IO */
529                  cpu_set_reg(cputag_get_cpu(machine, "maincpu"), PDP1_IO, tape_reader.rb);   /* transfer reader buffer to IO */
530530                  pdp1_pulse_iot_done();
531531               }
532532               else
r4582r4583
921921   {
922922      io_status &= ~io_st_tyi;
923923      if (USE_SBS)
924         cpu_set_input_line_and_vector(device->machine->cpu[0], 0, CLEAR_LINE, 0);   /* interrupt it, baby */
924         cputag_set_input_line_and_vector(device->machine, "maincpu", 0, CLEAR_LINE, 0);   /* interrupt it, baby */
925925   }
926926}
927927
r4582r4583
991991   {
992992      io_status |= io_st_pen;
993993
994      cpu_set_reg(device->machine->cpu[0], PDP1_PF3, 1);
994      cpu_set_reg(cputag_get_cpu(device->machine, "maincpu"), PDP1_PF3, 1);
995995   }
996996
997997   if (nac)
r4582r4583
11311131   {
11321132      if ((parallel_drum.wfb >= 1) && (parallel_drum.wfb <= 22))
11331133      {
1134         drum_write(parallel_drum.wfb-1, dc, (signed)memory_read_dword_32be(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM),parallel_drum.wcl<<2));
1134         drum_write(parallel_drum.wfb-1, dc, (signed)memory_read_dword_32be(cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM),parallel_drum.wcl<<2));
11351135      }
11361136
11371137      if ((parallel_drum.rfb >= 1) && (parallel_drum.rfb <= 22))
11381138      {
1139         memory_write_dword_32be(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM),parallel_drum.wcl<<2, drum_read(parallel_drum.rfb-1, dc));
1139         memory_write_dword_32be(cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM),parallel_drum.wcl<<2, drum_read(parallel_drum.rfb-1, dc));
11401140      }
11411141
11421142      parallel_drum.wc = (parallel_drum.wc+1) & 07777;
r4582r4583
11451145      if (parallel_drum.wc)
11461146         delay = attotime_add(delay, PARALLEL_DRUM_WORD_TIME);
11471147   } while (parallel_drum.wc);
1148   cpu_adjust_icount(device->machine->cpu[0],-cpu_attotime_to_clocks(device->machine->cpu[0], delay));
1148   cpu_adjust_icount(cputag_get_cpu(device->machine, "maincpu"),-cputag_attotime_to_clocks(device->machine, "maincpu", delay));
11491149   /* if no error, skip */
1150   cpu_set_reg(device->machine->cpu[0], PDP1_PC, cpu_get_reg(device->machine->cpu[0], PDP1_PC)+1);
1150   cpu_set_reg(cputag_get_cpu(device->machine, "maincpu"), PDP1_PC, cpu_get_reg(cputag_get_cpu(device->machine, "maincpu"), PDP1_PC)+1);
11511151}
11521152
11531153void iot_dra(const device_config *device, int op2, int nac, int mb, int *io, int ac)
r4582r4583
12741274         typewriter.tb = (i << 4) + j;
12751275         io_status |= io_st_tyi;
12761276         #if USE_SBS
1277            cpu_set_input_line_and_vector(machine->cpu[0], 0, ASSERT_LINE, 0);   /* interrupt it, baby */
1277            cputag_set_input_line_and_vector(machine, "maincpu", 0, ASSERT_LINE, 0);   /* interrupt it, baby */
12781278         #endif
1279         cpu_set_reg(machine->cpu[0], PDP1_PF1, 1);
1279         cpu_set_reg(cputag_get_cpu(machine, "maincpu"), PDP1_PF1, 1);
12801280         pdp1_typewriter_drawchar(machine, typewriter.tb);   /* we want to echo input */
12811281         break;
12821282      }
r4582r4583
14271427         pdp1_pulse_start_clear();   /* pulse Start Clear line */
14281428         cpu_set_reg(device, PDP1_PC, (  cpu_get_reg(device, PDP1_TA) & 0170000)
14291429                              |  (cpu_get_reg(device, PDP1_PC) & 0007777));   /* transfer ETA to EPC */
1430         /*cpu_set_reg(machine->cpu[0], PDP1_MA, cpu_get_reg(machine->cpu[0], PDP1_PC));*/
1430         /*cpu_set_reg(cputag_get_cpu(machine, "maincpu"), PDP1_MA, cpu_get_reg(cputag_get_cpu(machine, "maincpu"), PDP1_PC));*/
14311431         cpu_set_reg(device, PDP1_EXD, cpu_get_reg(device, PDP1_EXTEND_SW));
14321432         cpu_set_reg(device, PDP1_OV, 0);      /* right??? */
14331433         cpu_set_reg(device, PDP1_RUN, 0);
src/mess/machine/pokemini.c
r4582r4583
193193   {
194194      //logerror("Triggering IRQ with vector %02x\n", vector );
195195      /* Trigger interrupt and set vector */
196      cpu_set_input_line_and_vector( machine->cpu[0], 0, ASSERT_LINE, vector );
196      cputag_set_input_line_and_vector( machine, "maincpu", 0, ASSERT_LINE, vector );
197197   }
198198   else
199199   {
200      cpu_set_input_line( machine->cpu[0], 0, CLEAR_LINE );
200      cputag_set_input_line( machine, "maincpu", 0, CLEAR_LINE );
201201   }
202202}
203203
r4582r4583
491491         int index = data & 0x07;
492492         int cycles = ( pm_reg[0x19] & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
493493
494         timer_adjust_periodic(timers.timer1, attotime_zero, 0, cpu_clocks_to_attotime(space->machine->cpu[0], cycles));
494         timer_adjust_periodic(timers.timer1, attotime_zero, 0, cputag_clocks_to_attotime(space->machine, "maincpu", cycles));
495495      }
496496
497497      /* Check for prescaler change for the high counter */
r4582r4583
500500         int index = ( data >> 4 ) & 0x07;
501501         int cycles = ( pm_reg[0x19] & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
502502
503         timer_adjust_periodic(timers.timer1_hi, attotime_zero, 0, cpu_clocks_to_attotime(space->machine->cpu[0], cycles));
503         timer_adjust_periodic(timers.timer1_hi, attotime_zero, 0, cputag_clocks_to_attotime(space->machine, "maincpu", cycles));
504504      }
505505
506506      /* Check if timer1 low should be enabled */
r4582r4583
541541         int index = pm_reg[0x18] & 0x07;
542542         int cycles = ( data & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
543543
544         timer_adjust_periodic(timers.timer1, attotime_zero, 0, cpu_clocks_to_attotime(space->machine->cpu[0], cycles));
544         timer_adjust_periodic(timers.timer1, attotime_zero, 0, cputag_clocks_to_attotime(space->machine, "maincpu", cycles));
545545      }
546546
547547      /* Check for prescaler change for the low counter */
r4582r4583
550550         int index = ( pm_reg[0x18] >> 4 ) & 0x07;
551551         int cycles = ( data & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
552552
553         timer_adjust_periodic(timers.timer1_hi, attotime_zero, 0, cpu_clocks_to_attotime(space->machine->cpu[0], cycles));
553         timer_adjust_periodic(timers.timer1_hi, attotime_zero, 0, cputag_clocks_to_attotime(space->machine, "maincpu", cycles));
554554      }
555555
556556      {
r4582r4583
620620         int index = data & 0x07;
621621         int cycles = ( pm_reg[0x1B] & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
622622
623         timer_adjust_periodic(timers.timer2, attotime_zero, 0, cpu_clocks_to_attotime(space->machine->cpu[0], cycles));
623         timer_adjust_periodic(timers.timer2, attotime_zero, 0, cputag_clocks_to_attotime(space->machine, "maincpu", cycles));
624624      }
625625
626626      /* Check for prescaler change for the high counter */
r4582r4583
629629         int index = ( data >> 4 ) & 0x07;
630630         int cycles = ( pm_reg[0x1B] & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
631631
632         timer_adjust_periodic(timers.timer2_hi, attotime_zero, 0, cpu_clocks_to_attotime(space->machine->cpu[0], cycles));
632         timer_adjust_periodic(timers.timer2_hi, attotime_zero, 0, cputag_clocks_to_attotime(space->machine, "maincpu", cycles));
633633      }
634634
635635      /* Check if timer2 low should be enabled */
r4582r4583
666666         int index = pm_reg[0x1A] & 0x07;
667667         int cycles = ( data & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
668668
669         timer_adjust_periodic(timers.timer2, attotime_zero, 0, cpu_clocks_to_attotime(space->machine->cpu[0], cycles));
669         timer_adjust_periodic(timers.timer2, attotime_zero, 0, cputag_clocks_to_attotime(space->machine, "maincpu", cycles));
670670
671671         if ( ( pm_reg[0x1A] & 0x08 ) && ( pm_reg[0x38] & 0x04 ) &&
672672              ( ( ( pm_reg[0x19] & 0x10 ) && ( data & 0x01 ) ) ||
r4582r4583
686686         int index = ( pm_reg[0x1A] >> 4 ) & 0x07;
687687         int cycles = ( data & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
688688
689         timer_adjust_periodic(timers.timer2_hi, attotime_zero, 0, cpu_clocks_to_attotime(space->machine->cpu[0], cycles));
689         timer_adjust_periodic(timers.timer2_hi, attotime_zero, 0, cputag_clocks_to_attotime(space->machine, "maincpu", cycles));
690690
691691         if ( ( pm_reg[0x1A] & 0x80 ) && ( pm_reg[0x39] & 0x04 ) && ! ( pm_reg[0x38] & 0x80 ) &&
692692              ( ( ( pm_reg[0x19] & 0x10 ) && ( data & 0x02 ) ) ||
r4582r4583
720720         int index = data & 0x07;
721721         int cycles = ( pm_reg[0x1D] & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
722722
723         timer_adjust_periodic(timers.timer3, attotime_zero, 0, cpu_clocks_to_attotime(space->machine->cpu[0], cycles));
723         timer_adjust_periodic(timers.timer3, attotime_zero, 0, cputag_clocks_to_attotime(space->machine, "maincpu", cycles));
724724      }
725725
726726      /* Check for prescaler change for the high counter */
r4582r4583
729729         int index = ( data >> 4 ) & 0x07;
730730         int cycles = ( pm_reg[0x1D] & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
731731
732         timer_adjust_periodic(timers.timer3_hi, attotime_zero, 0, cpu_clocks_to_attotime(space->machine->cpu[0], cycles));
732         timer_adjust_periodic(timers.timer3_hi, attotime_zero, 0, cputag_clocks_to_attotime(space->machine, "maincpu", cycles));
733733      }
734734
735735      /* Check if timer2 low should be enabled */
r4582r4583
766766         int index = pm_reg[0x1C] & 0x07;
767767         int cycles = ( data & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
768768
769         timer_adjust_periodic(timers.timer3, attotime_zero, 0, cpu_clocks_to_attotime(space->machine->cpu[0], cycles));
769         timer_adjust_periodic(timers.timer3, attotime_zero, 0, cputag_clocks_to_attotime(space->machine, "maincpu", cycles));
770770
771771         if ( ( pm_reg[0x1C] & 0x08 ) && ( pm_reg[0x48] & 0x04 ) &&
772772              ( ( ( pm_reg[0x19] & 0x10 ) && ( data & 0x01 ) ) ||
r4582r4583
786786         int index = ( pm_reg[0x1C] >> 4 ) & 0x07;
787787         int cycles = ( data & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
788788
789         timer_adjust_periodic(timers.timer3_hi, attotime_zero, 0, cpu_clocks_to_attotime(space->machine->cpu[0], cycles));
789         timer_adjust_periodic(timers.timer3_hi, attotime_zero, 0, cputag_clocks_to_attotime(space->machine, "maincpu", cycles));
790790
791791         if ( ( pm_reg[0x1C] & 0x80 ) && ( pm_reg[0x49] & 0x04 ) && ! ( pm_reg[0x48] & 0x80 ) &&
792792              ( ( ( pm_reg[0x19] & 0x10 ) && ( data & 0x02 ) ) ||
r4582r4583
14371437
14381438static TIMER_CALLBACK( pokemini_prc_counter_callback )
14391439{
1440   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
1440   const address_space *space = cputag_get_address_space( machine, "maincpu", ADDRESS_SPACE_PROGRAM );
14411441   prc.count++;
14421442
14431443   /* Check for overflow */
r4582r4583
16011601   /* Set up the PRC */
16021602   prc.max_frame_count = 2;
16031603   prc.count_timer = timer_alloc(machine,  pokemini_prc_counter_callback, NULL );
1604   timer_adjust_periodic( prc.count_timer, attotime_zero, 0, cpu_clocks_to_attotime(machine->cpu[0], 55640 / 65) );
1604   timer_adjust_periodic( prc.count_timer, attotime_zero, 0, cputag_clocks_to_attotime(machine, "maincpu", 55640 / 65) );
16051605}
16061606
src/mess/machine/pc1350.c
r4582r4583
118118
119119MACHINE_START( pc1350 )
120120{
121   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
121   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
122122   
123123   timer_set(machine, ATTOTIME_IN_SEC(1), NULL, 0, pc1350_power_up);
124124
src/mess/machine/radio86.c
r4582r4583
137137READ8_DEVICE_HANDLER(radio86_dma_read_byte)
138138{
139139   UINT8 result;
140   result = memory_read_byte(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM),offset);
140   result = memory_read_byte(cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM), offset);
141141   return result;
142142}
143143
r4582r4583
172172
173173READ8_HANDLER (radio_io_r )
174174{
175   return memory_read_byte(cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM),(offset << 8) + offset);
175   return memory_read_byte(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM), (offset << 8) + offset);
176176}
177177
178178WRITE8_HANDLER(radio_io_w )
179179{
180   memory_write_byte(cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM),(offset << 8) + offset,data);
180   memory_write_byte(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM), (offset << 8) + offset,data);
181181}
182182
183183MACHINE_RESET( radio86 )
src/mess/machine/pmd85.c
r4582r4583
3535
3636static void pmd851_update_memory(running_machine *machine)
3737{
38   const address_space* space = cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM);
38   const address_space* space = cputag_get_address_space(machine, "maincpu",ADDRESS_SPACE_PROGRAM);
3939   
4040   if (pmd85_startup_mem_map)
4141   {
r4582r4583
7878
7979static void pmd852a_update_memory(running_machine *machine)
8080{
81   const address_space* space = cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM);
81   const address_space* space = cputag_get_address_space(machine, "maincpu",ADDRESS_SPACE_PROGRAM);
8282
8383   if (pmd85_startup_mem_map)
8484   {
r4582r4583
150150
151151static void alfa_update_memory(running_machine *machine)
152152{
153   const address_space* space = cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM);
153   const address_space* space = cputag_get_address_space(machine, "maincpu",ADDRESS_SPACE_PROGRAM);
154154
155155   if (pmd85_startup_mem_map)
156156   {
r4582r4583
182182
183183static void mato_update_memory(running_machine *machine)
184184{
185   const address_space* space = cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM);
185   const address_space* space = cputag_get_address_space(machine, "maincpu",ADDRESS_SPACE_PROGRAM);
186186
187187   if (pmd85_startup_mem_map)
188188   {
r4582r4583
206206
207207static void c2717_update_memory(running_machine *machine)
208208{
209   const address_space* space = cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM);
209   const address_space* space = cputag_get_address_space(machine, "maincpu",ADDRESS_SPACE_PROGRAM);
210210
211211   UINT8 *mem = memory_region(machine, "maincpu");
212212   if (pmd85_startup_mem_map)
r4582r4583
899899   pmd85_common_driver_init(machine);
900900}
901901
902static TIMER_CALLBACK( setup_machine_state ) {
902static TIMER_CALLBACK( setup_machine_state )
903{
903904   device_config *pit8253 = (device_config*)devtag_get_device(machine, "pit8253");
904905
905906   pit8253_gate_w(pit8253, 0, 1);
906907   pit8253_gate_w(pit8253, 1, 1);
907908   pit8253_gate_w(pit8253, 2, 1);
908   if (pmd85_model!=MATO) {
909   if (pmd85_model!=MATO)
910   {
909911      msm8251_connect(devtag_get_device(machine, "uart"), &pmd85_cassette_serial_connection);
910912   }
911913}
r4582r4583
934936
935937   timer_set(machine,  attotime_zero, NULL, 0, setup_machine_state );
936938
937   memory_set_direct_update_handler(cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM), pmd85_opbaseoverride);   
939   memory_set_direct_update_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), pmd85_opbaseoverride);   
938940}
src/mess/machine/oric.c
r4582r4583
8282   /* any irq set? */
8383   if ((oric_irqs & 0x0f)!=0)
8484   {
85      cpu_set_input_line(machine->cpu[0],0, HOLD_LINE);
85      cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
8686   }
8787   else
8888   {
89      cpu_set_input_line(machine->cpu[0],0, CLEAR_LINE);
89      cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
9090   }
9191}
9292
r4582r4583
162162/* this port is also used to read printer data */
163163static READ8_DEVICE_HANDLER ( oric_via_in_a_func )
164164{
165   const address_space *space = cpu_get_address_space( device->machine->cpu[0], ADDRESS_SPACE_PROGRAM );
165   const address_space *space = cputag_get_address_space( device->machine, "maincpu", ADDRESS_SPACE_PROGRAM );
166166
167167   /*logerror("port a read\r\n"); */
168168
r4582r4583
464464static void oric_install_apple2_interface(running_machine *machine)
465465{
466466   const device_config *fdc = devtag_get_device(machine, "fdc");
467   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
467   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
468468
469469   memory_install_read8_handler(space, 0x0300, 0x030f, 0, 0, oric_IO_r);
470470   memory_install_read8_device_handler(space, fdc, 0x0310, 0x031f, 0, 0, applefdc_r);
r4582r4583
479479static void oric_enable_memory(running_machine *machine, int low, int high, int rd, int wr)
480480{
481481   int i;
482   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
482   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
483483   for (i = low; i <= high; i++)
484484   {
485485      switch(i) {
r4582r4583
558558static void oric_install_apple2_v2_interface(running_machine *machine)
559559{
560560   const device_config *fdc = devtag_get_device(machine, "fdc");
561   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
561   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
562562
563563   memory_install_read8_handler(space, 0x0300, 0x030f, 0, 0, oric_IO_r);
564564   memory_install_read8_device_handler(space, fdc, 0x0310, 0x031f, 0, 0, applefdc_r);
r4582r4583
748748         wd17xx_reset(fdc);
749749         break;
750750      case 0x0a:
751         logerror("jasmin overlay ram w: %02x PC: %04x\n",data,cpu_get_pc(space->machine->cpu[0]));
751         logerror("jasmin overlay ram w: %02x PC: %04x\n", data, cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")));
752752         port_3fa_w = data;
753753         oric_jasmin_set_mem_0x0c000(space->machine);
754754         break;
755755      case 0x0b:
756         logerror("jasmin romdis w: %02x PC: %04x\n",data,cpu_get_pc(space->machine->cpu[0]));
756         logerror("jasmin romdis w: %02x PC: %04x\n", data, cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")));
757757         port_3fb_w = data;
758758         oric_jasmin_set_mem_0x0c000(space->machine);
759759         break;
r4582r4583
774774
775775static void oric_install_jasmin_interface(running_machine *machine)
776776{
777   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
777   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
778778   /* romdis */
779779   port_3fb_w = 1;
780780   oric_jasmin_set_mem_0x0c000(machine);
r4582r4583
10261026
10271027static void oric_install_microdisc_interface(running_machine *machine)
10281028{
1029   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
1029   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
10301030
10311031   memory_install_read8_handler(space, 0x0300, 0x030f, 0, 0, oric_IO_r);
10321032   memory_install_read8_handler(space, 0x0310, 0x031f, 0, 0, oric_microdisc_r);
r4582r4583
11171117MACHINE_RESET( oric )
11181118{
11191119   int disc_interface_id = input_port_read(machine, "FLOPPY") & 0x07;
1120   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
1120   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
11211121
11221122   switch (disc_interface_id)
11231123   {
r4582r4583
12081208   {
12091209      if ((offset & 0x0f)!=0x0d)
12101210      {
1211         logerror("via 0 r: %04x %04x\n",offset, (unsigned) cpu_get_reg(space->machine->cpu[0], REG_GENPC));
1211         logerror("via 0 r: %04x %04x\n",offset, (unsigned) cpu_get_reg(cputag_get_cpu(space->machine, "maincpu"), REG_GENPC));
12121212      }
12131213   }
12141214   /* it is repeated */
r4582r4583
12271227
12281228      case ORIC_FLOPPY_INTERFACE_MICRODISC:
12291229      {
1230         if ((offset>=0x010) && (offset<=0x01f))
1230         if ((offset >= 0x010) && (offset <= 0x01f))
12311231         {
12321232            oric_microdisc_w(offset, data);
12331233            return;
r4582r4583
12371237
12381238      case ORIC_FLOPPY_INTERFACE_JASMIN:
12391239      {
1240         if ((offset>=0x0f4) && (offset<=0x0ff))
1240         if ((offset >= 0x0f4) && (offset <= 0x0ff))
12411241         {
1242            oric_jasmin_w(offset,data);
1242            oric_jasmin_w(offset, data);
12431243            return;
12441244         }
12451245
r4582r4583
12491249#endif
12501250   if (enable_logging)
12511251   {
1252      logerror("via 0 w: %04x %02x %04x\n",offset,data,(unsigned) cpu_get_reg(space->machine->cpu[0], REG_GENPC));
1252      logerror("via 0 w: %04x %02x %04x\n", offset, data,(unsigned) cpu_get_reg(cputag_get_cpu(space->machine, "maincpu"), REG_GENPC));
12531253   }
12541254
1255   via_w(via_0, offset & 0x0f,data);
1255   via_w(via_0, offset & 0x0f, data);
12561256}
12571257
12581258
r4582r4583
13311331{
13321332   read8_space_func rh;
13331333   write8_space_func wh;
1334   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
1334   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
13351335
13361336   struct telestrat_mem_block *mem_block = &telestrat_blocks[telestrat_bank_selection];
13371337
src/mess/machine/orion.c
r4582r4583
9797   ppi8255_w((device_config*)devtag_get_device(space->machine, "ppi8255_1"), offset & 3, data);   
9898}
9999
100static void orion_set_video_mode(running_machine *machine, int width) {
100static void orion_set_video_mode(running_machine *machine, int width)
101{
101102      rectangle visarea;
102103     
103104      visarea.min_x = 0;
r4582r4583
109110
110111WRITE8_HANDLER ( orion128_video_mode_w )
111112{           
112   if ((data & 0x80)!=(orion128_video_mode & 0x80)) {
113      if ((data & 0x80)==0x80) {
114         if (orion_video_mode_mask == 31) {
113   if ((data & 0x80)!=(orion128_video_mode & 0x80))
114   {
115      if ((data & 0x80)==0x80)
116      {
117         if (orion_video_mode_mask == 31)
118         {
115119            orion128_video_width = SCREEN_WIDTH_512;
116120            orion_set_video_mode(space->machine,512);     
117         } else {
121         }
122         else
123         {
118124            orion128_video_width = SCREEN_WIDTH_480;
119125            orion_set_video_mode(space->machine,480);     
120126         }         
121      } else {
127      }
128      else
129      {
122130         orion128_video_width = SCREEN_WIDTH_384;
123131         orion_set_video_mode(space->machine,384);
124132      }
r4582r4583
129137
130138WRITE8_HANDLER ( orion128_video_page_w )
131139{   
132   if (orion128_video_page != data) {
133      if ((data & 0x80)!=(orion128_video_page & 0x80)) {
134         if ((data & 0x80)==0x80) {
135            if (orion_video_mode_mask == 31) {
140   if (orion128_video_page != data)
141   {
142      if ((data & 0x80)!=(orion128_video_page & 0x80))
143      {
144         if ((data & 0x80)==0x80)
145         {
146            if (orion_video_mode_mask == 31)
147            {
136148               orion128_video_width = SCREEN_WIDTH_512;
137149               orion_set_video_mode(space->machine,512);     
138            } else {
150            }
151            else
152            {
139153               orion128_video_width = SCREEN_WIDTH_480;
140154               orion_set_video_mode(space->machine,480);     
141155            }         
142         } else {
156         }
157         else
158         {
143159            orion128_video_width = SCREEN_WIDTH_384;
144160            orion_set_video_mode(space->machine,384);
145161         }
r4582r4583
151167
152168WRITE8_HANDLER ( orion128_memory_page_w )
153169{           
154   if (data!=orion128_memory_page ) {
170   if (data!=orion128_memory_page )
171   {
155172      memory_set_bankptr(space->machine, 1, mess_ram + (data & 3) * 0x10000);
156173      orion128_memory_page = (data & 3);
157174   }
r4582r4583
194211   if (device_load_basicdsk_floppy (image) != INIT_PASS)
195212      return INIT_FAIL;
196213
197   if (size==800*1024) {
214   if (size==800*1024)
215   {
198216      basicdsk_set_geometry (image, 80, 2, 5, 1024, 1, 0, FALSE);
199   } else {
217   }
218   else
219   {
200220      basicdsk_set_geometry (image, 80, 2, 9, 512, 1, 0, FALSE);
201221   }
202222   return INIT_PASS;
r4582r4583
214234{   
215235   const device_config *fdc = devtag_get_device(space->machine, "wd1793");
216236
217   switch(offset) {
237   switch(offset)
238   {
218239      case 0x0   :
219240      case 0x10 : return wd17xx_status_r(fdc,0);
220241      case 0x1    :
r4582r4583
231252{     
232253   const device_config *fdc = devtag_get_device(space->machine, "wd1793");
233254   
234   switch(offset) {
255   switch(offset)
256   {
235257      case 0x0   :
236258      case 0x10 : wd17xx_command_w(fdc,0,data); break;
237259      case 0x1    :
r4582r4583
247269}
248270static READ8_HANDLER ( orionz80_floppy_rtc_r )
249271{   
250   if ((offset >= 0x60) && (offset <= 0x6f)) {
272   if ((offset >= 0x60) && (offset <= 0x6f))
273   {
251274      return mc146818_port_r(space,offset-0x60);
252   } else {
275   }
276   else
277   {
253278      return orion128_floppy_r(space,offset);
254279   }   
255280}
256281
257282static WRITE8_HANDLER ( orionz80_floppy_rtc_w )
258283{     
259   if ((offset >= 0x60) && (offset <= 0x6f)) {
284   if ((offset >= 0x60) && (offset <= 0x6f))
285   {
260286      mc146818_port_w(space,offset-0x60,data);
261   } else {
287   }
288   else
289   {
262290      orion128_floppy_w(space,offset,data);
263291   }   
264292}
r4582r4583
283311WRITE8_HANDLER ( orionz80_sound_w )
284312{   
285313   const device_config *speaker = devtag_get_device(space->machine, "speaker");
286   if (orion_speaker==0) {
314   if (orion_speaker == 0)
315   {
287316      orion_speaker = data;     
288   } else {
317   }
318   else
319   {
289320      orion_speaker = 0 ;   
290321   }
291322   speaker_level_w(speaker,orion_speaker);
r4582r4583
303334{
304335   UINT8 bank_select;
305336   UINT8 segment_select;
306   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
337   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
307338   
308339   bank_select = (orionz80_dispatcher & 0x0c) >> 2;
309340   segment_select = orionz80_dispatcher & 0x03;
310341   
311342   memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_BANK1);
312   if ((orionz80_dispatcher & 0x80)==0) { // dispatcher on
343   if ((orionz80_dispatcher & 0x80)==0)
344   { // dispatcher on
313345      memory_set_bankptr(machine, 1, mess_ram + 0x10000 * bank_select + segment_select * 0x4000 );     
314   } else { // dispatcher off
346   }
347   else
348   { // dispatcher off
315349      memory_set_bankptr(machine, 1, mess_ram + 0x10000 * orionz80_memory_page);     
316350   }
317351     
318352   memory_set_bankptr(machine, 2, mess_ram + 0x4000 + 0x10000 * orionz80_memory_page);     
319353   
320   if ((orionz80_dispatcher & 0x20) == 0) {
354   if ((orionz80_dispatcher & 0x20) == 0)
355   {
321356      memory_install_write8_handler(space, 0xf400, 0xf4ff, 0, 0, orion128_system_w);
322357      memory_install_write8_handler(space, 0xf500, 0xf5ff, 0, 0, orion128_romdisk_w);
323358      memory_install_write8_handler(space, 0xf700, 0xf7ff, 0, 0, orionz80_floppy_rtc_w);   
r4582r4583
335370      memory_set_bankptr(machine, 3, mess_ram + 0xf000);           
336371      memory_set_bankptr(machine, 5, memory_region(machine, "maincpu") + 0xf800);     
337372     
338   } else {
373   }
374   else
375   {
339376      /* if it is full memory access */
340377      memory_set_bankptr(machine, 3, mess_ram + 0xf000 + 0x10000 * orionz80_memory_page);     
341378      memory_set_bankptr(machine, 4, mess_ram + 0xf400 + 0x10000 * orionz80_memory_page);     
r4582r4583
357394
358395MACHINE_RESET ( orionz80 )
359396{   
360   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
397   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
361398   
362399   memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
363400   memory_install_write8_handler(space, 0x4000, 0xefff, 0, 0, SMH_BANK2);
r4582r4583
396433
397434INTERRUPT_GEN( orionz80_interrupt )
398435{
399   if ((orionz80_dispatcher & 0x40)==0x40) {
436   if ((orionz80_dispatcher & 0x40)==0x40)
437   {
400438      cpu_set_input_line(device, 0, HOLD_LINE);         
401439   }   
402440}
403441
404READ8_HANDLER ( orionz80_io_r ) {
405   if (offset == 0xFFFD) {
442READ8_HANDLER ( orionz80_io_r )
443{
444   if (offset == 0xFFFD)
445   {
406446      return ay8910_r (devtag_get_device(space->machine, "ay8912"), 0);
407447   }
408448   return 0xff;
409449}
410450
411WRITE8_HANDLER ( orionz80_io_w ) {
412   switch (offset & 0xff) {
451WRITE8_HANDLER ( orionz80_io_w )
452{
453   switch (offset & 0xff)
454   {
413455      case 0xf8 : orion128_video_mode_w(space,0,data);break;
414456      case 0xf9 : orionz80_memory_page_w(space,0,data);break;
415457      case 0xfa : orion128_video_page_w(space,0,data);break;
r4582r4583
417459      case 0xfe : orionz80_sound_fe_w(space,0,data);break;
418460      case 0xff : orionz80_sound_w(space,0,data);break;
419461   }
420   switch(offset) {
462   switch(offset)
463   {
421464      case 0xfffd : ay8910_address_w(devtag_get_device(space->machine, "ay8912"), 0, data);
422465                 break;
423466      case 0xbffd :
r4582r4583
453496
454497static void orionpro_bank_switch(running_machine *machine)
455498{
456   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
499   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
457500   int page = orionpro_page & 7; // we have only 8 pages   
458501   int is128 = (orionpro_dispatcher & 0x80) ? 1 : 0;
459   if (is128==1) {
502   if (is128==1)
503   {
460504      page = orionpro_128_page & 7;
461505   }
462506   memory_install_write8_handler(space, 0x0000, 0x1fff, 0, 0, SMH_BANK1);
r4582r4583
469513   memory_install_write8_handler(space, 0xf800, 0xffff, 0, 0, SMH_BANK8);
470514   
471515   
472   if ((orionpro_dispatcher & 0x01)==0x00) {   // RAM0 segment disabled
516   if ((orionpro_dispatcher & 0x01)==0x00)
517   {   // RAM0 segment disabled
473518      memory_set_bankptr(machine, 1, mess_ram + 0x10000 * page);
474519      memory_set_bankptr(machine, 2, mess_ram + 0x10000 * page + 0x2000);     
475   } else {               
520   }
521   else
522   {
476523      memory_set_bankptr(machine, 1, mess_ram + (orionpro_ram0_segment & 31) * 0x4000);
477524      memory_set_bankptr(machine, 2, mess_ram + (orionpro_ram0_segment & 31) * 0x4000 + 0x2000);
478525   }
479   if ((orionpro_dispatcher & 0x10)==0x10) {   // ROM1 enabled     
526   if ((orionpro_dispatcher & 0x10)==0x10)
527   {   // ROM1 enabled     
480528      memory_install_write8_handler(space, 0x0000, 0x1fff, 0, 0, SMH_UNMAP);
481529      memory_set_bankptr(machine, 1, memory_region(machine, "maincpu") + 0x20000);     
482530   }
483   if ((orionpro_dispatcher & 0x08)==0x08) {   // ROM2 enabled
531   if ((orionpro_dispatcher & 0x08)==0x08)
532   {   // ROM2 enabled
484533      memory_install_write8_handler(space, 0x2000, 0x3fff, 0, 0, SMH_UNMAP);
485534      memory_set_bankptr(machine, 2, memory_region(machine, "maincpu") + 0x22000 + (orionpro_rom2_segment & 7) * 0x2000);     
486535   }
487536
488   if ((orionpro_dispatcher & 0x02)==0x00) {   // RAM1 segment disabled
537   if ((orionpro_dispatcher & 0x02)==0x00)
538   {   // RAM1 segment disabled
489539      memory_set_bankptr(machine, 3, mess_ram + 0x10000 * page + 0x4000);     
490   } else {                     
540   }
541   else
542   {
491543      memory_set_bankptr(machine, 3, mess_ram + (orionpro_ram1_segment & 31) * 0x4000);     
492544   }
493545   
494   if ((orionpro_dispatcher & 0x04)==0x00) {   // RAM2 segment disabled
546   if ((orionpro_dispatcher & 0x04)==0x00)
547   {   // RAM2 segment disabled
495548      memory_set_bankptr(machine, 4, mess_ram + 0x10000 * page + 0x8000);
496   } else {       
549   }
550   else
551   {
497552      memory_set_bankptr(machine, 4, mess_ram + (orionpro_ram2_segment & 31) * 0x4000);
498553   }
499554   
500555   memory_set_bankptr(machine, 5, mess_ram + 0x10000 * page + 0xc000);
501556   
502   if (is128) {
557   if (is128)
558   {
503559      memory_set_bankptr(machine, 6, mess_ram + 0x10000 * 0 + 0xf000);   
504560
505561      memory_install_write8_handler(space, 0xf400, 0xf4ff, 0, 0, orion128_system_w);
r4582r4583
519575   
520576   
521577      memory_set_bankptr(machine, 8, mess_ram + 0x10000 * 0 + 0xf800);   
522   } else {
523      if ((orionpro_dispatcher & 0x40)==0x40) {   // FIX F000 enabled
578   }
579   else
580   {
581      if ((orionpro_dispatcher & 0x40)==0x40)
582      {   // FIX F000 enabled
524583         memory_set_bankptr(machine, 6, mess_ram + 0x10000 * 0 + 0xf000);     
525584         memory_set_bankptr(machine, 7, mess_ram + 0x10000 * 0 + 0xf400);     
526585         memory_set_bankptr(machine, 8, mess_ram + 0x10000 * 0 + 0xf800);     
527      } else {
586      }
587      else
588      {
528589         memory_set_bankptr(machine, 6, mess_ram + 0x10000 * page + 0xf000);     
529590         memory_set_bankptr(machine, 7, mess_ram + 0x10000 * page + 0xf400);     
530591         memory_set_bankptr(machine, 8, mess_ram + 0x10000 * page + 0xf800);     
r4582r4583
563624   orionpro_pseudo_color = 0;
564625}
565626
566READ8_HANDLER ( orionpro_io_r ) {
627READ8_HANDLER ( orionpro_io_r )
628{
567629   const device_config *fdc = devtag_get_device(space->machine, "wd1793");
568630     
569   switch (offset & 0xff) {     
631   switch (offset & 0xff)
632   {     
570633      case 0x00 : return 0x56;
571634      case 0x04 : return orionpro_ram0_segment;
572635      case 0x05 : return orionpro_ram1_segment;
r4582r4583
588651      case 0x2a : return orion128_romdisk_r(space,2);
589652      case 0x2b : return orion128_romdisk_r(space,3);
590653   }
591   if (offset == 0xFFFD) {
654   if (offset == 0xFFFD)
655   {
592656      return ay8910_r (devtag_get_device(space->machine, "ay8912"), 0);
593657   }
594658   return 0xff;
595659}
596660
597WRITE8_HANDLER ( orionpro_io_w ) {
661WRITE8_HANDLER ( orionpro_io_w )
662{
598663   const device_config *fdc = devtag_get_device(space->machine, "wd1793");
599664     
600   switch (offset & 0xff) {     
665   switch (offset & 0xff)
666   {     
601667      case 0x04 : orionpro_ram0_segment = data; orionpro_bank_switch(space->machine); break;     
602668      case 0x05 : orionpro_ram1_segment = data; orionpro_bank_switch(space->machine); break;
603669      case 0x06 : orionpro_ram2_segment = data; orionpro_bank_switch(space->machine); break;
r4582r4583
625691      case 0xfe : orionz80_sound_fe_w(space,0,data);break;
626692      case 0xff : orionz80_sound_w(space,0,data);break;
627693   }
628   switch(offset) {
694   switch(offset)
695   {
629696      case 0xfffd : ay8910_address_w(devtag_get_device(space->machine, "ay8912"), 0, data);
630697                 break;
631698      case 0xbffd :
r4582r4583
633700                  break;     
634701   }
635702}
636     
703     
src/mess/machine/nascom1.c
r4582r4583
316316   switch (mess_ram_size)
317317   {
318318   case 1 * 1024:
319      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM),
319      memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM),
320320         0x1400, 0x9000, 0, 0, SMH_NOP, SMH_NOP);
321321      break;
322322
323323   case 16 * 1024:
324      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM),
324      memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM),
325325         0x1400, 0x4fff, 0, 0, SMH_BANK1, SMH_BANK1);
326      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM),
326      memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM),
327327         0x5000, 0xafff, 0, 0, SMH_NOP, SMH_NOP);
328328      memory_set_bankptr(machine, 1, mess_ram);
329329      break;
330330
331331   case 32 * 1024:
332      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM),
332      memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM),
333333         0x1400, 0x8fff, 0, 0, SMH_BANK1, SMH_BANK1);
334      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM),
334      memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM),
335335         0x9000, 0xafff, 0, 0, SMH_NOP, SMH_NOP);
336336      memory_set_bankptr(machine, 1, mess_ram);
337337      break;
338338
339339   case 40 * 1024:
340      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM),
340      memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM),
341341         0x1400, 0xafff, 0, 0, SMH_BANK1, SMH_BANK1);
342342      memory_set_bankptr(machine, 1, mess_ram);
343343      break;
src/mess/machine/osborne1.c
r4582r4583
243243
244244   if ( osborne1.pia_1_irq_state )
245245   {
246      cpu_set_input_line(machine->cpu[0], 0, ASSERT_LINE );
246      cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE );
247247   }
248248   else
249249   {
250      cpu_set_input_line(machine->cpu[0], 0, CLEAR_LINE );
250      cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE );
251251   }
252252}
253253
r4582r4583
349349
350350static TIMER_CALLBACK(osborne1_video_callback)
351351{
352   const address_space* space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
352   const address_space* space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
353353   const device_config *speaker = devtag_get_device(space->machine, "beep");
354354   const device_config *pia_1 = devtag_get_device(space->machine, "pia_1");
355355   int y = video_screen_get_vpos(machine->primary_screen);
r4582r4583
491491
492492MACHINE_RESET( osborne1 )
493493{
494   const address_space* space = cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM);
494   const address_space* space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
495495   /* Initialize memory configuration */
496496   osborne1_bankswitch_w( space, 0x00, 0 );
497497
r4582r4583
541541{
542542    /* Enable ROM and I/O when IRQ is acknowledged */
543543    UINT8   old_bankswitch = osborne1.bankswitch;
544    const address_space* space = cpu_get_address_space(device->machine->cpu[0],ADDRESS_SPACE_PROGRAM);
544    const address_space* space = cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
545545   
546546    osborne1_bankswitch_w( space, 0, 0 );
547547    osborne1.bankswitch = old_bankswitch;
src/mess/machine/primo.c
r4582r4583
4949
5050static void primo_update_memory(running_machine *machine)
5151{
52   const address_space* space = cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM);
52   const address_space* space = cputag_get_address_space(machine, "maincpu",ADDRESS_SPACE_PROGRAM);
5353   switch (primo_port_FD & 0x03)
5454   {
5555      case 0x00:   /* Original ROM */
r4582r4583
247247   if (input_port_read(machine, "MEMORY_EXPANSION"))
248248      primo_port_FD = 0x00;
249249   primo_update_memory(machine);
250   cpu_set_clockscale(machine->cpu[0], input_port_read(machine, "CPU_CLOCK") ? 1.5 : 1.0);
250   cpu_set_clockscale(cputag_get_cpu(machine, "maincpu"), input_port_read(machine, "CPU_CLOCK") ? 1.5 : 1.0);
251251}
252252
253253MACHINE_RESET( primoa )
r4582r4583
278278
279279   /* Z80 registers */
280280
281   cpu_set_reg(machine->cpu[0], Z80_BC, snapshot_data[4] + snapshot_data[5]*256);
282   cpu_set_reg(machine->cpu[0], Z80_DE, snapshot_data[6] + snapshot_data[7]*256);
283   cpu_set_reg(machine->cpu[0], Z80_HL, snapshot_data[8] + snapshot_data[9]*256);
284   cpu_set_reg(machine->cpu[0], Z80_AF, snapshot_data[10] + snapshot_data[11]*256);
285   cpu_set_reg(machine->cpu[0], Z80_BC2, snapshot_data[12] + snapshot_data[13]*256);
286   cpu_set_reg(machine->cpu[0], Z80_DE2, snapshot_data[14] + snapshot_data[15]*256);
287   cpu_set_reg(machine->cpu[0], Z80_HL2, snapshot_data[16] + snapshot_data[17]*256);
288   cpu_set_reg(machine->cpu[0], Z80_AF2, snapshot_data[18] + snapshot_data[19]*256);
289   cpu_set_reg(machine->cpu[0], Z80_PC, snapshot_data[20] + snapshot_data[21]*256);
290   cpu_set_reg(machine->cpu[0], Z80_SP, snapshot_data[22] + snapshot_data[23]*256);
291   cpu_set_reg(machine->cpu[0], Z80_I, snapshot_data[24]);
292   cpu_set_reg(machine->cpu[0], Z80_R, snapshot_data[25]);
293   cpu_set_reg(machine->cpu[0], Z80_IX, snapshot_data[26] + snapshot_data[27]*256);
294   cpu_set_reg(machine->cpu[0], Z80_IY, snapshot_data[28] + snapshot_data[29]*256);
281   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), Z80_BC, snapshot_data[4] + snapshot_data[5]*256);
282   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), Z80_DE, snapshot_data[6] + snapshot_data[7]*256);
283   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), Z80_HL, snapshot_data[8] + snapshot_data[9]*256);
284   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), Z80_AF, snapshot_data[10] + snapshot_data[11]*256);
285   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), Z80_BC2, snapshot_data[12] + snapshot_data[13]*256);
286   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), Z80_DE2, snapshot_data[14] + snapshot_data[15]*256);
287   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), Z80_HL2, snapshot_data[16] + snapshot_data[17]*256);
288   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), Z80_AF2, snapshot_data[18] + snapshot_data[19]*256);
289   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), Z80_PC, snapshot_data[20] + snapshot_data[21]*256);
290   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), Z80_SP, snapshot_data[22] + snapshot_data[23]*256);
291   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), Z80_I, snapshot_data[24]);
292   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), Z80_R, snapshot_data[25]);
293   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), Z80_IX, snapshot_data[26] + snapshot_data[27]*256);
294   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), Z80_IY, snapshot_data[28] + snapshot_data[29]*256);
295295
296296
297297   /* IO ports */
r4582r4583
306306   /* memory */
307307
308308   for (i=0; i<0xc000; i++)
309      memory_write_byte(cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM), i+0x4000, snapshot_data[i+38]);
309      memory_write_byte(cputag_get_address_space(machine, "maincpu",ADDRESS_SPACE_PROGRAM), i+0x4000, snapshot_data[i+38]);
310310}
311311
312312SNAPSHOT_LOAD( primo )
r4582r4583
352352   start_addr = quickload_data[2] + quickload_data[3]*256;
353353
354354   for (i=4; i<quickload_size; i++)
355      memory_write_byte(cpu_get_address_space(machine->cpu[0],ADDRESS_SPACE_PROGRAM), start_addr+i-4, quickload_data[i]);
355      memory_write_byte(cputag_get_address_space(machine, "maincpu",ADDRESS_SPACE_PROGRAM), start_addr+i-4, quickload_data[i]);
356356
357   cpu_set_reg(machine->cpu[0], Z80_PC, start_addr);
357   cpu_set_reg(cputag_get_cpu(machine, "maincpu"), Z80_PC, start_addr);
358358
359359   logerror ("Quickload .pp l: %04x r: %04x s: %04x\n", load_addr, start_addr, quickload_size-4);
360360}
src/mess/machine/pc1401.c
r4582r4583
143143DRIVER_INIT( pc1401 )
144144{
145145   int i;
146   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
146   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
147147   UINT8 *gfx=memory_region(machine, "gfx1");
148148#if 0
149149   char sucker[]={
src/mess/machine/nes.c
r4582r4583
7272
7373static void init_nes_core (running_machine *machine)
7474{
75   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
75   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
7676
7777   /* We set these here in case they weren't set in the cart loader */
7878   nes.rom = memory_region(machine, "maincpu");
src/mess/machine/nes_mmc.c
r4582r4583
9595
9696static TIMER_CALLBACK(nes_irq_callback)
9797{
98   cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
98   cputag_set_input_line(machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
9999   timer_adjust_oneshot(nes_irq_timer, attotime_never, 0);
100100}
101101
r4582r4583
645645      if (IRQ_enable && !blanked && (IRQ_count == 0) && priorCount)
646646      {
647647         logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(device->machine->primary_screen), video_screen_get_hpos(device->machine->primary_screen));
648         cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
649//         timer_adjust_oneshot(nes_irq_timer, cpu_clocks_to_attotime(device->machine->cpu[0], 4), 0);
648         cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
649//         timer_adjust_oneshot(nes_irq_timer, cputag_clocks_to_attotime(device->machine, "maincpu", 4), 0);
650650      }
651651   }
652652}
r4582r4583
852852   if (scanline == IRQ_count)
853853   {
854854      if (IRQ_enable)
855         cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
855         cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
856856
857857      IRQ_status = 0xff;
858858   }
r4582r4583
16081608   {
16091609      if (IRQ_count <= 114)
16101610      {
1611         cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
1611         cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
16121612      }
16131613      IRQ_count -= 114;
16141614   }
r4582r4583
17521752         {
17531753            if ((IRQ_count & 0x0f) == 0x00)
17541754               /* rollover every 0x10 */
1755               cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
1755               cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
17561756         }
17571757         else if (IRQ_mode & 0x04)
17581758         {
17591759            if ((IRQ_count & 0x0ff) == 0x00)
17601760               /* rollover every 0x100 */
1761               cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
1761               cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
17621762         }
17631763         else if (IRQ_mode & 0x02)
17641764         {
17651765            if ((IRQ_count & 0x0fff) == 0x000)
17661766               /* rollover every 0x1000 */
1767               cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
1767               cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
17681768         }
17691769         else if (IRQ_count == 0)
17701770            /* rollover at 0x10000 */
1771            cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
1771            cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
17721772      }
17731773   }
17741774   else
r4582r4583
19871987   /* Increment & check the IRQ scanline counter */
19881988   if (IRQ_enable && (IRQ_count == 0x7fff))
19891989   {
1990      cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
1990      cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
19911991   }
19921992}
19931993
r4582r4583
20462046static void fds_irq ( const device_config *device, int scanline, int vblank, int blanked )
20472047{
20482048   if (IRQ_enable_latch)
2049      cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
2049      cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
20502050
20512051   /* Increment & check the IRQ scanline counter */
20522052   if (IRQ_enable)
20532053   {
20542054      if (IRQ_count <= 114)
20552055      {
2056         cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
2056         cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
20572057         IRQ_enable = 0;
20582058         nes_fds.status0 |= 0x01;
20592059      }
r4582r4583
21662166   {
21672167      IRQ_count = IRQ_count_latch;
21682168      IRQ_enable = IRQ_enable_latch;
2169      cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
2169      cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
21702170   }
21712171}
21722172
r4582r4583
28442844   {
28452845      if (--IRQ_count == 0)
28462846      {
2847         cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
2847         cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
28482848      }
28492849   }
28502850}
r4582r4583
29182918         /* Check if IRQ is being enabled */
29192919         if ( ! IRQ_enable && ( data & 0x02 ) ) {
29202920            IRQ_enable = 1;
2921            timer_adjust_oneshot(nes_irq_timer, cpu_clocks_to_attotime(space->machine->cpu[0], 24576), 0);
2921            timer_adjust_oneshot(nes_irq_timer, cputag_clocks_to_attotime(space->machine, "maincpu", 24576), 0);
29222922         }
29232923         if ( ! ( data & 0x02 ) ) {
29242924            IRQ_enable = 0;
r4582r4583
33043304   if (IRQ_enable)
33053305   {
33063306      if (--IRQ_count == 0)
3307         cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
3307         cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
33083308   }
33093309}
33103310
r4582r4583
33843384   {
33853385      if (IRQ_count <= 114)
33863386      {
3387         cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
3387         cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
33883388      }
33893389      IRQ_count -= 114;
33903390   }
r4582r4583
44114411      if (IRQ_enable && !blanked && (IRQ_count == 0) && priorCount)
44124412      {
44134413         logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(device->machine->primary_screen), video_screen_get_hpos(device->machine->primary_screen));
4414         cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
4414         cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
44154415      }
44164416   }
44174417}
r4582r4583
49324932      if (IRQ_enable && !blanked && (IRQ_count == 0) && priorCount)
49334933      {
49344934         logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(device->machine->primary_screen), video_screen_get_hpos(device->machine->primary_screen));
4935         cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
4935         cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, HOLD_LINE);
49364936      }
49374937   }
49384938}
r4582r4583
49494949*/
49504950int mapper_reset (running_machine *machine, int mapperNum)
49514951{
4952   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
4952   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
49534953   nes_state *state = machine->driver_data;
49544954   int err = 0;
49554955   const mmc *mapper;
src/mess/machine/ondra.c
r4582r4583
4848{
4949   UINT8 *mem = memory_region(machine, "maincpu");
5050   if (ondra_bank1_status==0) {
51      memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
51      memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
5252      memory_set_bankptr(machine, 1, mem + 0x010000);
5353   } else {
54      memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, SMH_BANK1);
54      memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, SMH_BANK1);
5555      memory_set_bankptr(machine, 1, mess_ram + 0x0000);
5656   }
5757   memory_set_bankptr(machine, 2, mess_ram + 0x4000);
5858   if (ondra_bank2_status==0) {
59      memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xe000, 0xffff, 0, 0, SMH_BANK3);
60      memory_install_read8_handler (cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xe000, 0xffff, 0, 0, SMH_BANK3);
59      memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xe000, 0xffff, 0, 0, SMH_BANK3);
60      memory_install_read8_handler (cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xe000, 0xffff, 0, 0, SMH_BANK3);
6161      memory_set_bankptr(machine, 3, mess_ram + 0xe000);
6262   } else {
63      memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xe000, 0xffff, 0, 0, SMH_UNMAP);
64      memory_install_read8_handler (cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xe000, 0xffff, 0, 0, ondra_keyboard_r);
63      memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xe000, 0xffff, 0, 0, SMH_UNMAP);
64      memory_install_read8_handler (cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xe000, 0xffff, 0, 0, ondra_keyboard_r);
6565   }
6666}
6767
r4582r4583
8484
8585static TIMER_CALLBACK(nmi_check_callback)
8686{
87   if ((input_port_read(machine, "NMI") & 1)==1) {
88      cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE);
87   if ((input_port_read(machine, "NMI") & 1) == 1)
88   {
89      cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
8990   }
9091}
9192
src/mess/machine/pc8801.c
r4582r4583
122122   }
123123   if (level >= 0 && level<interrupt_level_reg)
124124   {
125      cpu_set_input_line(machine->cpu[0], 0, HOLD_LINE);
125      cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
126126   }
127127}
128128
r4582r4583
170170
171171static void pc8801_init_interrupt(running_machine *machine)
172172{
173   interrupt_level_reg=0;
174   interrupt_mask_reg=0xf8;
175   interrupt_trig_reg=0x0;
176   cpu_set_irq_callback(machine->cpu[0],pc8801_interrupt_callback);
177   timer_pulse(machine, ATTOTIME_IN_HZ(600),NULL, 0,pc8801_timer_interrupt);
173   interrupt_level_reg = 0;
174   interrupt_mask_reg = 0xf8;
175   interrupt_trig_reg = 0x0;
176   cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), pc8801_interrupt_callback);
177   timer_pulse(machine, ATTOTIME_IN_HZ(600), NULL, 0, pc8801_timer_interrupt);
178178}
179179
180180WRITE8_HANDLER(pc88sr_outport_30)
r4582r4583
394394      if(ext_w==NULL)
395395      {
396396         /* read only mode */
397         memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x5fff, 0, 0, SMH_NOP);
398         memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, SMH_NOP);
397         memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000, 0x5fff, 0, 0, SMH_NOP);
398         memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, SMH_NOP);
399399      }
400400      else
401401      {
402402         /* r/w mode */
403         memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x5fff, 0, 0, SMH_BANK1);
404         memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, SMH_BANK2);
403         memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000, 0x5fff, 0, 0, SMH_BANK1);
404         memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, SMH_BANK2);
405405         if(ext_w!=ext_r) logerror("differnt between read and write bank of extension memory.\n");
406406      }
407407   }
r4582r4583
411411      if(RAMmode)
412412      {
413413         /* RAM */
414         memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x5fff, 0, 0, SMH_BANK1);
415         memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, SMH_BANK2);
414         memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000, 0x5fff, 0, 0, SMH_BANK1);
415         memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, SMH_BANK2);
416416         memory_set_bankptr(machine, 1, pc8801_mainRAM + 0x0000);
417417         memory_set_bankptr(machine, 2, pc8801_mainRAM + 0x6000);
418418      }
r4582r4583
420420      {
421421         /* ROM */
422422         /* write through to main RAM */
423         memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x5fff, 0, 0, pc8801_writemem1);
424         memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, pc8801_writemem2);
423         memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000, 0x5fff, 0, 0, pc8801_writemem1);
424         memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, pc8801_writemem2);
425425         if(ROMmode)
426426         {
427427            /* N-BASIC */
r4582r4583
443443   }
444444
445445   /* 0x8000 to 0xffff */
446   memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8000, 0x83ff, 0, 0, (RAMmode || ROMmode) ? SMH_BANK3 : pc8801_read_textwindow);
447   memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8000, 0x83ff, 0, 0, (RAMmode || ROMmode) ? SMH_BANK3 : pc8801_write_textwindow);
446   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0x83ff, 0, 0, (RAMmode || ROMmode) ? SMH_BANK3 : pc8801_read_textwindow);
447   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0x83ff, 0, 0, (RAMmode || ROMmode) ? SMH_BANK3 : pc8801_write_textwindow);
448448
449449   memory_set_bankptr(machine, 4, pc8801_mainRAM + 0x8400);
450450
r4582r4583
455455   }
456456   else
457457   {
458      memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc000, 0xefff, 0, 0, SMH_BANK5);
459      memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc000, 0xefff, 0, 0, SMH_BANK5);
460      memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xf000, 0xffff, 0, 0, SMH_BANK6);
461      memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xf000, 0xffff, 0, 0, SMH_BANK6);
458      memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc000, 0xefff, 0, 0, SMH_BANK5);
459      memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc000, 0xefff, 0, 0, SMH_BANK5);
460      memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xf000, 0xffff, 0, 0, SMH_BANK6);
461      memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xf000, 0xffff, 0, 0, SMH_BANK6);
462462
463463      memory_set_bankptr(machine, 5, pc8801_mainRAM + 0xc000);
464464      if(maptvram)
r4582r4583
805805/* callback for /INT output from FDC */
806806static NEC765_INTERRUPT( pc8801_fdc_interrupt )
807807{
808    cpu_set_input_line(device->machine->cpu[1], 0, state ? HOLD_LINE : CLEAR_LINE);
808    cputag_set_input_line(device->machine, "sub", 0, state ? HOLD_LINE : CLEAR_LINE);
809809}
810810
811811/* callback for /DRQ output from FDC */
r4582r4583
825825{
826826   use_5FD = (input_port_read(machine, "DSW2") & 0x80) != 0x00;
827827   if (!use_5FD)
828      cpu_suspend(machine->cpu[1], SUSPEND_REASON_DISABLE, 1);
828      cputag_suspend(machine, "sub", SUSPEND_REASON_DISABLE, 1);
829829   else
830      cpu_resume(machine->cpu[1], SUSPEND_REASON_DISABLE);
831   cpu_set_input_line_vector(machine->cpu[1],0,0);
830      cputag_resume(machine, "sub", SUSPEND_REASON_DISABLE);
831   cpu_set_input_line_vector(cputag_get_cpu(machine, "sub"), 0, 0);
832832   floppy_drive_set_motor_state(image_from_devtype_and_index(machine, IO_FLOPPY, 0), 1);
833833   floppy_drive_set_motor_state(image_from_devtype_and_index(machine, IO_FLOPPY, 1), 1);
834834   floppy_drive_set_ready_state(image_from_devtype_and_index(machine, IO_FLOPPY, 0), 1,0);
src/mess/machine/pc1403.c
r4582r4583
126126void pc1403_outc(const device_config *device, int data)
127127{
128128    pc1403_portc = data;
129//    logerror("%g pc %.4x outc %.2x\n", attotime_to_double(timer_get_time(device->machine)), cpu_get_pc(device->machine->cpu[0]), data);
129//    logerror("%g pc %.4x outc %.2x\n", attotime_to_double(timer_get_time(device->machine)), cpu_get_pc(cputag_get_cpu(device->machine, "maincpu")), data);
130130}
131131
132132
r4582r4583
172172DRIVER_INIT( pc1403 )
173173{
174174   int i;
175   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
175   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
176176   UINT8 *gfx=memory_region(machine, "gfx1");
177177
178178   for (i=0; i<128; i++) gfx[i]=i;
r4582r4583
192192      memory_install_write8_handler(space, 0x8000, 0xdfff, 0, 0, SMH_NOP);
193193   }
194194}
195
src/mess/machine/partner.c
r4582r4583
146146
147147static void partner_iomap_bank(running_machine *machine,UINT8 *rom)
148148{
149   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
149   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
150150   switch(partner_win_mem_page) {
151151      case 2 :
152152            // FDD
r4582r4583
163163}
164164static void partner_bank_switch(running_machine *machine)
165165{
166   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
166   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
167167   UINT8 *rom = memory_region(machine, "maincpu");
168168   
169169   memory_install_write8_handler(space, 0x0000, 0x07ff, 0, 0, SMH_BANK1);
r4582r4583
378378
379379static WRITE8_DEVICE_HANDLER(partner_dma_write_byte)
380380{
381   memory_write_byte(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM),offset,data);
381   memory_write_byte(cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM), offset, data);
382382}
383383
384384static READ8_DEVICE_HANDLER ( partner_wd17xx_data_r )
src/mess/machine/pp01.c
r4582r4583
1515/* Driver initialization */
1616DRIVER_INIT(pp01)
1717{
18   memset(mess_ram,0,64*1024);
18   memset(mess_ram, 0, 64 * 1024);
1919}
2020
2121
2222MACHINE_RESET( pp01 )
2323{
2424   UINT8 *mem = memory_region(machine, "maincpu");
25   memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
25   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
2626
2727   memory_set_bankptr(machine, 1, mem + 0x010000);
2828   memory_set_bankptr(machine, 2, mess_ram + 0x4000);
src/mess/machine/pecom.c
r4582r4583
3737MACHINE_RESET( pecom )
3838{
3939   UINT8 *rom = memory_region(machine, "maincpu");
40   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
40   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
4141   
4242   pecom_state *state = machine->driver_data;
4343   
r4582r4583
6363WRITE8_HANDLER( pecom_bank_w )
6464{
6565   const device_config *cdp1869 = devtag_get_device(space->machine, CDP1869_TAG);
66   const address_space *space2 = cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
66   const address_space *space2 = cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
6767   UINT8 *rom = memory_region(space->machine, "maincpu");
68   memory_install_write8_handler(cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, SMH_BANK1);
68   memory_install_write8_handler(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, SMH_BANK1);
6969   memory_set_bankptr(space->machine, 1, mess_ram + 0x0000);
7070     
71   if (data==2) {
71   if (data==2)
72   {
7273      memory_install_read8_device_handler (space2, cdp1869, 0xf000, 0xf7ff, 0, 0, cdp1869_charram_r);
7374      memory_install_write8_device_handler(space2, cdp1869, 0xf000, 0xf7ff, 0, 0, cdp1869_charram_w);
7475      memory_install_read8_device_handler (space2, cdp1869, 0xf800, 0xffff, 0, 0, cdp1869_pageram_r);
7576      memory_install_write8_device_handler(space2, cdp1869, 0xf800, 0xffff, 0, 0, cdp1869_pageram_w);   
76   } else {
77   }
78   else
79   {
7780      memory_install_write8_handler(space2, 0xf000, 0xf7ff, 0, 0, SMH_UNMAP);
7881      memory_install_write8_handler(space2, 0xf800, 0xffff, 0, 0, SMH_UNMAP);
7982      memory_install_read8_handler (space2, 0xf000, 0xf7ff, 0, 0, SMH_BANK3);
r4582r4583
9497      Address is available on address bus during reading of value from port, and that is
9598      used to determine keyboard line reading
9699   */
97   UINT16 addr = cpu_get_reg(space->machine->cpu[0],CDP1802_R0 + cpu_get_reg(space->machine->cpu[0],CDP1802_X));
100   UINT16 addr = cpu_get_reg(cputag_get_cpu(space->machine, "maincpu"), CDP1802_R0 + cpu_get_reg(cputag_get_cpu(space->machine, "maincpu"), CDP1802_X));
98101   /* just in case somone is reading non existing ports */
99102   if (addr<0x7cca || addr>0x7ce3) return 0;
100103   return input_port_read(space->machine, keynames[addr - 0x7cca]) & 0x03;
r4582r4583
119122   double valcas = cassette_input(cassette_device_image(device->machine));
120123   UINT8 val = input_port_read(device->machine, "CNT");
121124   
122   if ((val & 0x04)==0x04 && pecom_prev_caps_state==0) {
125   if ((val & 0x04)==0x04 && pecom_prev_caps_state==0)
126   {
123127      pecom_caps_state = (pecom_caps_state==4) ? 0 : 4; // Change CAPS state
124128   }
125129   pecom_prev_caps_state = val & 0x04;
126   if (valcas!=0.0) { // If there is any cassette signal
130   if (valcas!=0.0)
131   { // If there is any cassette signal
127132      val = (val & 0x0D); // remove EF2 from SHIFT
128133      flags -= EF2;
129134      if ( valcas > 0.00) flags += EF2;
r4582r4583
150155     
151156   case CDP1802_STATE_CODE_S2_DMA:
152157      // DMA acknowledge clears the DMAOUT request
153      cpu_set_input_line(device->machine->cpu[0], CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE);
158      cputag_set_input_line(device->machine, "maincpu", CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE);
154159      break;
155160   case CDP1802_STATE_CODE_S3_INTERRUPT:
156161      break;
157162   }
158163}
164
159165CDP1802_INTERFACE( pecom64_cdp1802_config )
160166{
161167   pecom64_mode_r,
src/mess/machine/pce.c
r4582r4583
199199   /* Check for Street fighter 2 */
200200   if ( size == PCE_ROM_MAXSIZE )
201201   {
202      memory_install_write8_handler(cpu_get_address_space(image->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x01ff0, 0x01ff3, 0, 0, pce_sf2_banking_w );
202      memory_install_write8_handler(cputag_get_address_space(image->machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x01ff0, 0x01ff3, 0, 0, pce_sf2_banking_w );
203203   }
204204
205205   /* Check for Populous */
r4582r4583
207207   {
208208      cartridge_ram = auto_malloc( 0x8000 );
209209      memory_set_bankptr( image->machine, 2, cartridge_ram );
210      memory_install_write8_handler(cpu_get_address_space(image->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x080000, 0x087FFF, 0, 0, pce_cartridge_ram_w );
210      memory_install_write8_handler(cputag_get_address_space(image->machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x080000, 0x087FFF, 0, 0, pce_cartridge_ram_w );
211211   }
212212
213213   /* Check for CD system card */
r4582r4583
220220         pce_sys3_card = 1;
221221         cartridge_ram = auto_malloc( 0x30000 );
222222         memory_set_bankptr( image->machine, 4, cartridge_ram );
223         memory_install_write8_handler(cpu_get_address_space(image->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0D0000, 0x0FFFFF, 0, 0, pce_cartridge_ram_w );
223         memory_install_write8_handler(cputag_get_address_space(image->machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0D0000, 0x0FFFFF, 0, 0, pce_cartridge_ram_w );
224224      }
225225   }
226226   return 0;
r4582r4583
863863
864864   if ( pce_cd.regs[0x02] & pce_cd.regs[0x03] & ( PCE_CD_IRQ_TRANSFER_DONE | PCE_CD_IRQ_TRANSFER_READY ) )
865865   {
866      cpu_set_input_line(machine->cpu[0], 1, ASSERT_LINE );
866      cputag_set_input_line(machine, "maincpu", 1, ASSERT_LINE );
867867   }
868868   else
869869   {
870      cpu_set_input_line(machine->cpu[0], 1, CLEAR_LINE );
870      cputag_set_input_line(machine, "maincpu", 1, CLEAR_LINE );
871871   }
872872}
873873
r4582r4583
10781078      if ( pce_cd.scsi_IO )
10791079      {
10801080         pce_cd.scsi_ACK = 1;
1081         timer_set(machine, cpu_clocks_to_attotime(machine->cpu[0], 15), NULL, 0, pce_cd_clear_ack );
1081         timer_set(machine, cputag_clocks_to_attotime(machine, "maincpu", 15), NULL, 0, pce_cd_clear_ack );
10821082      }
10831083   }
10841084   return data;
src/mess/machine/pc1251.c
r4582r4583
121121DRIVER_INIT( pc1251 )
122122{
123123   int i;
124   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
124   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
125125   UINT8 *gfx = memory_region(machine, "gfx1");
126126   for (i=0; i<128; i++) gfx[i]=i;
127127
src/mess/machine/pk8020.c
r4582r4583
2121
2222MACHINE_RESET( pk8020 )
2323{
24   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);   
24   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);   
2525   
2626   memory_install_read8_handler (space, 0x0000, 0x1fff, 0, 0, SMH_BANK1);
2727   memory_install_write8_handler(space, 0x0000, 0x7fff, 0, 0, SMH_UNMAP);
src/mess/drivers/nc.c
r4582r4583
304304         (((nc_irq_status & nc_irq_mask) & 0x3f)!=0)
305305         )
306306   {
307      logerror("int set %02x\n",nc_irq_status & nc_irq_mask);
307      logerror("int set %02x\n", nc_irq_status & nc_irq_mask);
308308      /* set int */
309      cpu_set_input_line(machine->cpu[0], 0, HOLD_LINE);
309      cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
310310   }
311311   else
312312   {
313313      /* clear int */
314      cpu_set_input_line(machine->cpu[0], 0, CLEAR_LINE);
314      cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
315315   }
316316}
317317
r4582r4583
338338
339339static void nc_refresh_memory_bank_config(running_machine *machine, int bank)
340340{
341   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
341   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
342342   int mem_type;
343343   int mem_bank;
344344   read8_space_func read_handler;
r4582r4583
533533            case NC_TYPE_1xx:
534534            {
535535                 LOG(("nmi triggered\n"));
536                cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE);
536                cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
537537            }
538538            break;
539539
540540            case NC_TYPE_200:
541541            {
542               nc_irq_status |=(1<<4);
542               nc_irq_status |= (1 << 4);
543543               nc_update_interrupts(machine);
544544            }
545545            break;
r4582r4583
872872    is cleared this will not cause another nmi */
873873   /* I'll emulate it like this to be sure */
874874
875   if (state!=previous_alarm_state)
875   if (state != previous_alarm_state)
876876   {
877877      if (state)
878878      {
879879         /* I'll pulse it because if I used hold-line I'm not sure
880880            it would clear - to be checked */
881         cpu_set_input_line(device->machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE);
881         cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
882882      }
883883   }
884884
r4582r4583
887887
888888static void nc100_txrdy_callback(const device_config *device, int state)
889889{
890   nc_irq_latch &= ~(1<<1);
890   nc_irq_latch &= ~(1 << 1);
891891
892892   /* uart on? */
893   if ((nc_uart_control & (1<<3))==0)
893   if ((nc_uart_control & (1 << 3)) == 0)
894894   {
895895      if (state)
896896      {
897897         logerror("tx ready\n");
898         nc_irq_latch |= (1<<1);
898         nc_irq_latch |= (1 << 1);
899899      }
900900   }
901901
r4582r4583
14541454   }
14551455
14561456   /* bit 5 is used in disk interface */
1457   LOG_DEBUG(("bit 5: PC: %04x %02x\n",cpu_get_pc(space->machine->cpu[0]), data & (1<<5)));
1457   LOG_DEBUG(("bit 5: PC: %04x %02x\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), data & (1 << 5)));
14581458}
14591459
14601460
r4582r4583
14731473static WRITE8_HANDLER(nc200_memory_card_wait_state_w)
14741474{
14751475   const device_config *fdc = devtag_get_device(space->machine, "nec765");
1476   LOG_DEBUG(("nc200 memory card wait state: PC: %04x %02x\n",cpu_get_pc(space->machine->cpu[0]),data));
1476   LOG_DEBUG(("nc200 memory card wait state: PC: %04x %02x\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), data));
14771477#if 0
1478   floppy_drive_set_motor_state(0,1);
1479   floppy_drive_set_ready_state(0,1,1);
1478   floppy_drive_set_motor_state(0, 1);
1479   floppy_drive_set_ready_state(0, 1, 1);
14801480#endif
14811481   nec765_set_tc_state(fdc, (data & 0x01));
14821482}
r4582r4583
14861486/* bit 0 seems to be the same as nc100 */
14871487static WRITE8_HANDLER(nc200_poweroff_control_w)
14881488{
1489   LOG_DEBUG(("nc200 power off: PC: %04x %02x\n",cpu_get_pc(space->machine->cpu[0]),data));
1489   LOG_DEBUG(("nc200 power off: PC: %04x %02x\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), data));
14901490
1491   nc200_video_set_backlight(((data^(1<<2))>>2) & 0x01);
1491   nc200_video_set_backlight(((data ^ (1 << 2)) >> 2) & 0x01);
14921492}
14931493
14941494static ADDRESS_MAP_START(nc200_io, ADDRESS_SPACE_IO, 8)
src/mess/drivers/pentagon.c
r4582r4583
1616
1717static DIRECT_UPDATE_HANDLER( pentagon_direct )
1818{   
19   UINT16 pc = cpu_get_reg(space->machine->cpu[0], REG_GENPCBASE);
20   if (betadisk_is_active()) {
21      if (pc >= 0x4000) {
19   UINT16 pc = cpu_get_reg(cputag_get_cpu(space->machine, "maincpu"), REG_GENPCBASE);
20   if (betadisk_is_active())
21   {
22      if (pc >= 0x4000)
23      {
2224         ROMSelection = ((spectrum_128_port_7ffd_data>>4) & 0x01) ? 1 : 0;
2325         betadisk_disable();
2426         memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
r4582r4583
3032      betadisk_enable();
3133     
3234   }
33   if((address>=0x0000) && (address<=0x3fff)) {
35   if((address>=0x0000) && (address<=0x3fff))
36   {
3437      memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
3538      direct->raw = direct->decrypted =  memory_region(space->machine, "maincpu") + 0x010000 + (ROMSelection<<14);
3639      memory_set_bankptr(space->machine, 1, direct->raw);
r4582r4583
4548
4649   memory_set_bankptr(machine, 4, mess_ram + ((spectrum_128_port_7ffd_data & 0x07) * 0x4000));
4750
48   if( betadisk_is_active() && !( spectrum_128_port_7ffd_data & 0x10 ) ) {   
51   if( betadisk_is_active() && !( spectrum_128_port_7ffd_data & 0x10 ) )
52   {   
4953      /* GLUK */
5054      ROMSelection = 2;
5155   }
r4582r4583
8690
8791static MACHINE_RESET( pentagon )
8892{
89   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
93   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
9094
9195   memory_install_read8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_BANK1);
9296   memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
src/mess/drivers/nes.c
r4582r4583
217217
218218static void ppu_nmi(const device_config *device, int *ppu_regs)
219219{
220   cpu_set_input_line(device->machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE);
220   cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
221221}
222222
223223
src/mess/drivers/palm.c
r4582r4583
9191
9292static MACHINE_START( palm )
9393{
94    const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
95    memory_install_read16_handler(space,0x000000,mess_ram_size-1,mess_ram_size-1,0,(read16_space_func)1);
96    memory_install_write16_handler(space,0x000000,mess_ram_size-1,mess_ram_size-1,0,(write16_space_func)1);
94    const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
95    memory_install_read16_handler (space, 0x000000, mess_ram_size - 1, mess_ram_size - 1, 0, (read16_space_func)1);
96    memory_install_write16_handler(space, 0x000000, mess_ram_size - 1, mess_ram_size - 1, 0, (write16_space_func)1);
9797    memory_set_bankptr(machine, 1, mess_ram);
9898
9999    state_save_register_global(machine, port_f_latch);
r4582r4583
107107    memset(mess_ram, 0, mess_ram_size);
108108    memcpy(mess_ram, bios, 0x20000);
109109
110    device_reset(machine->cpu[0]);
110    device_reset(cputag_get_cpu(machine, "maincpu"));
111111}
112112
113113
r4582r4583
137137
138138static DRIVER_INIT( palm )
139139{
140    debug_cpu_set_dasm_override(machine->cpu[0], palm_dasm_override);
140    debug_cpu_set_dasm_override(cputag_get_cpu(machine, "maincpu"), palm_dasm_override);
141141}
142142
143143static const mc68328_interface palm_dragonball_iface =
src/mess/drivers/pcw16.c
r4582r4583
131131   /* any bits set excluding vsync */
132132   if ((pcw16_system_status & (~0x04))!=0)
133133   {
134      cpu_set_input_line(machine->cpu[0], 0, HOLD_LINE);
134      cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
135135   }
136136   else
137137   {
138      cpu_set_input_line(machine->cpu[0], 0, CLEAR_LINE);
138      cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
139139   }
140140}
141141
r4582r4583
370370
371371static void pcw16_set_bank_handlers(running_machine *machine, int bank, PCW16_RAM_TYPE type)
372372{
373   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
373   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
374374   read8_space_func read_handler;
375375   write8_space_func write_handler;
376376
r4582r4583
10101010            {
10111011               /* I'll pulse it because if I used hold-line I'm not sure
10121012                    it would clear - to be checked */
1013               cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE);
1013               cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
10141014            }
10151015         }
10161016      }
src/mess/drivers/pasogo.c
r4582r4583
420420
421421static INTERRUPT_GEN( pasogo_interrupt )
422422{
423//   cpu_set_input_line(machine->cpu[0], UPD7810_INTFE1, PULSE_LINE);
423//   cputag_set_input_line(machine, "maincpu", UPD7810_INTFE1, PULSE_LINE);
424424}
425425
426426static IRQ_CALLBACK(pasogo_irq_callback)
r4582r4583
430430
431431static MACHINE_RESET( pasogo )
432432{
433   cpu_set_irq_callback(machine->cpu[0], pasogo_irq_callback);
433   cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), pasogo_irq_callback);
434434}
435435
436436//static const unsigned i86_address_mask = 0x000fffff;
r4582r4583
459459
460460static PIC8259_SET_INT_LINE( pasogo_pic8259_set_int_line )
461461{
462   cpu_set_input_line(device->machine->cpu[0], 0, interrupt ? HOLD_LINE : CLEAR_LINE);
462   cputag_set_input_line(device->machine, "maincpu", 0, interrupt ? HOLD_LINE : CLEAR_LINE);
463463}
464464
465465
src/mess/drivers/px4.c
r4582r4583
232232static WRITE8_HANDLER( px4_bankr_w )
233233{
234234   px4_state *px4 = space->machine->driver_data;
235   const address_space *space_program = cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
235   const address_space *space_program = cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
236236
237237   logerror("%s: px4_bankr_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
238238
src/mess/drivers/p2000t.c
r4582r4583
209209
210210static INTERRUPT_GEN( p2000_interrupt )
211211{
212   cpu_set_input_line(device->machine->cpu[0], 0, HOLD_LINE);
212   cputag_set_input_line(device->machine, "maincpu", 0, HOLD_LINE);
213213}
214214
215215/* Machine definition */
src/mess/drivers/pcw.c
r4582r4583
150150      ((fdc_interrupt_code==1) && ((pcw_system_status & (1<<5))!=0))
151151      )
152152   {
153      cpu_set_input_line(machine->cpu[0], 0,HOLD_LINE);
153      cputag_set_input_line(machine, "maincpu", 0,HOLD_LINE);
154154   }
155155   else
156156   {
157      cpu_set_input_line(machine->cpu[0], 0,CLEAR_LINE);
157      cputag_set_input_line(machine, "maincpu", 0,CLEAR_LINE);
158158   }
159159}
160160
r4582r4583
194194            {
195195               /* I'll pulse it because if I used hold-line I'm not sure
196196                    it would clear - to be checked */
197               cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE);
197               cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
198198            }
199199         }
200200      }
r4582r4583
262262
263263static void pcw_update_read_memory_block(running_machine *machine, int block, int bank)
264264{
265   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
265   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
266266   memory_set_bankptr(machine, block + 1, mess_ram + ((bank * 0x4000) % mess_ram_size));
267267
268268   /* bank 3? */
r4582r4583
488488            /* yes */
489489
490490            /* clear nmi interrupt */
491            cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_NMI, CLEAR_LINE);
491            cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
492492         }
493493
494494         /* re-issue interrupt */
r4582r4583
510510            /* yes */
511511
512512            /* Clear NMI */
513            cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_NMI, CLEAR_LINE);
513            cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
514514
515515         }
516516
r4582r4583
761761{
762762   pcw_boot = 1;
763763
764   cpu_set_input_line_vector(machine->cpu[0], 0,0x0ff);
764   cpu_set_input_line_vector(cputag_get_cpu(machine, "maincpu"), 0, 0x0ff);
765765
766766
767767   /* ram paging is actually undefined at power-on */
r4582r4583
10791079COMP( 1987, pcw9256,   pcw8256,   0,      pcw,     pcw,   pcw,   pcw_256k,   "Amstrad plc", "PCW9256",      GAME_NOT_WORKING)
10801080COMP( 1987, pcw9512,   pcw8256,   0,      pcw9512,  pcw,   pcw,   pcw_512k,   "Amstrad plc", "PCW9512 (+)",   GAME_NOT_WORKING)
10811081COMP( 1993, pcw10,       pcw8256,   0,      pcw9512,  pcw,   pcw,   pcw_512k,   "Amstrad plc", "PCW10",         GAME_NOT_WORKING)
1082
src/mess/drivers/ql.c
r4582r4583
529529{
530530   ql_state *state = machine->driver_data;
531531
532   const address_space *program = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
532   const address_space *program = cputag_get_address_space(machine, M68008_TAG, ADDRESS_SPACE_PROGRAM);
533533
534534   /* configure ROM cartridge */
535535
r4582r4583
613613   MDRV_DRIVER_DATA(ql_state)
614614
615615   // basic machine hardware
616
617616   MDRV_CPU_ADD(M68008_TAG, M68008, X1/2)
618617   MDRV_CPU_PROGRAM_MAP(ql_map, 0)
619618
src/mess/drivers/newbrain.c
r4582r4583
10421042
10431043      */
10441044
1045      cpu_set_input_line(space->machine->cpu[2], INPUT_LINE_RESET, BIT(data, 5) ? HOLD_LINE : CLEAR_LINE);
1045      cputag_set_input_line(space->machine, FDC_Z80_TAG, INPUT_LINE_RESET, BIT(data, 5) ? HOLD_LINE : CLEAR_LINE);
10461046
10471047      state->paging = BIT(data, 0);
10481048      state->a16 = BIT(data, 2);
src/mess/drivers/psx.c
r4582r4583
371371{
372372   if( address == 0x80030000 )
373373   {
374      const device_config *cpu = space->machine->cpu[ 0 ];
374      const device_config *cpu = cputag_get_cpu(space->machine, "maincpu");
375375
376376      memory_set_direct_update_handler( space, NULL );
377377
r4582r4583
396396
397397static QUICKLOAD_LOAD( psx_exe_load )
398398{
399   const address_space *space = cpu_get_address_space( image->machine->cpu[0], ADDRESS_SPACE_PROGRAM );
399   const address_space *space = cputag_get_address_space( image->machine, "maincpu", ADDRESS_SPACE_PROGRAM );
400400
401401   exe_size = 0;
402402   exe_buffer = malloc( quickload_size );
src/mess/drivers/pp01.c
r4582r4583
2626/* Input ports */
2727static INPUT_PORTS_START( pp01 )
2828   PORT_START("LINE0")
29      PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U)
30      PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A)
31      PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T)
32      PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L)
33      PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W)
34      PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F6") PORT_CODE(KEYCODE_F6)
35      PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F)
36      PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F7") PORT_CODE(KEYCODE_F7)
29   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U)
30   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A)
31   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T)
32   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L)
33   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W)
34   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F6") PORT_CODE(KEYCODE_F6)
35   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F)
36   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F7") PORT_CODE(KEYCODE_F7)
3737
3838INPUT_PORTS_END
3939
4040/* Machine driver */
4141static MACHINE_DRIVER_START( pp01 )
42     /* basic machine hardware */
43     MDRV_CPU_ADD("maincpu", 8080, 2000000)
44     MDRV_CPU_PROGRAM_MAP(pp01_mem, 0)
45     MDRV_CPU_IO_MAP(pp01_io, 0)
42   /* basic machine hardware */
43   MDRV_CPU_ADD("maincpu", 8080, 2000000)
44   MDRV_CPU_PROGRAM_MAP(pp01_mem, 0)
45   MDRV_CPU_IO_MAP(pp01_io, 0)
4646
47     MDRV_MACHINE_START( pp01 )
48     MDRV_MACHINE_RESET( pp01 )
47   MDRV_MACHINE_START( pp01 )
48   MDRV_MACHINE_RESET( pp01 )
4949
5050    /* video hardware */
51      MDRV_SCREEN_ADD("screen", RASTER)
52      MDRV_SCREEN_REFRESH_RATE(50)
53      MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
54      MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
55      MDRV_SCREEN_SIZE(256, 256)
56      MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
57      MDRV_PALETTE_LENGTH(8)
58      MDRV_PALETTE_INIT(pp01)
51   MDRV_SCREEN_ADD("screen", RASTER)
52   MDRV_SCREEN_REFRESH_RATE(50)
53   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
54   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
55   MDRV_SCREEN_SIZE(256, 256)
56   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
57   MDRV_PALETTE_LENGTH(8)
58   MDRV_PALETTE_INIT(pp01)
5959
60      MDRV_VIDEO_START(pp01)
61    MDRV_VIDEO_UPDATE(pp01)
60   MDRV_VIDEO_START(pp01)
61   MDRV_VIDEO_UPDATE(pp01)
6262MACHINE_DRIVER_END
6363
6464static SYSTEM_CONFIG_START(pp01)
r4582r4583
6868/* ROM definition */
6969
7070ROM_START( pp01 )
71    ROM_REGION( 0x14000, "maincpu", ROMREGION_ERASEFF )
72    ROM_LOAD( "pp01.rom", 0x10000, 0x4000, CRC(d6ee4dd6) SHA1(acc162975f255bc8de5ca0fd8da11d1d7bd7fbfc) )
71   ROM_REGION( 0x14000, "maincpu", ROMREGION_ERASEFF )
72   ROM_LOAD( "pp01.rom", 0x10000, 0x4000, CRC(d6ee4dd6) SHA1(acc162975f255bc8de5ca0fd8da11d1d7bd7fbfc) )
7373ROM_END
7474
7575
r4582r4583
7777
7878/*    YEAR  NAME    PARENT  COMPAT  MACHINE     INPUT       INIT     CONFIG COMPANY                  FULLNAME   FLAGS */
7979COMP( 198?, pp01,    0,        0,      pp01,       pp01,       pp01,     pp01,     "ZVT",                "PP-01",    GAME_NOT_WORKING)
80
src/mess/drivers/pce.c
r4582r4583
268268CONS( 1987, pce,    0,      0,      pce,    pce,     pce,   0,   "Nippon Electronic Company", "PC Engine", GAME_IMPERFECT_SOUND )
269269CONS( 1989, tg16,   pce,    0,      pce,    pce,     tg16,  0,   "Nippon Electronic Company", "TurboGrafx 16", GAME_IMPERFECT_SOUND )
270270CONS( 1989, sgx,    pce,    0,      sgx,    pce,     sgx,   0,   "Nippon Electronic Company", "SuperGrafx", GAME_IMPERFECT_SOUND )
271
src/mess/drivers/pk8020.c
r4582r4583
4545/* Machine driver */
4646static MACHINE_DRIVER_START( pk8020 )
4747  /* basic machine hardware */
48  MDRV_CPU_ADD("maincpu", 8080, 2500000)
49  MDRV_CPU_PROGRAM_MAP(pk8020_mem, 0)
50  MDRV_CPU_IO_MAP(pk8020_io, 0)
48   MDRV_CPU_ADD("maincpu", 8080, 2500000)
49   MDRV_CPU_PROGRAM_MAP(pk8020_mem, 0)
50   MDRV_CPU_IO_MAP(pk8020_io, 0)
5151
52  MDRV_MACHINE_RESET( pk8020 )
52   MDRV_MACHINE_RESET( pk8020 )
5353
5454    /* video hardware */
5555   MDRV_SCREEN_ADD("screen", RASTER)
r4582r4583
6262   MDRV_PALETTE_INIT(pk8020)
6363
6464   MDRV_VIDEO_START(pk8020)
65  MDRV_VIDEO_UPDATE(pk8020)
65   MDRV_VIDEO_UPDATE(pk8020)
6666MACHINE_DRIVER_END
6767
6868/* ROM definition */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team