Previous 199869 Revisions Next

r18140 Tuesday 25th September, 2012 at 14:46:52 UTC by Miodrag Milanović
Some manual cleanup (no whatsnew)
[src/mame/drivers]chinagat.c cps2.c ddenlovr.c eolith.c eolith16.c eolithsp.c galaga.c mpu4hw.c saturn.c vegaeo.c
[src/mame/includes]cps1.h ddragon.h dynax.h eolith.h eolithsp.h galaga.h mpu4.h stv.h
[src/mame/machine]xevious.c
[src/mess/drivers]ace.c adam.c geneve.c mikromik.c portfoli.c tek405x.c ti99_4p.c ti99_4x.c tm990189.c vixen.c
[src/mess/video]cgc7900.c

trunk/src/mame/includes/dynax.h
r18139r18140
486486   TIMER_DEVICE_CALLBACK_MEMBER(neruton_irq_scanline);
487487   TIMER_DEVICE_CALLBACK_MEMBER(majxtal7_vblank_interrupt);
488488   TIMER_DEVICE_CALLBACK_MEMBER(tenkai_interrupt);
489   TIMER_DEVICE_CALLBACK_MEMBER(mjmyster_irq);
489490};
490491
491492//----------- defined in drivers/dynax.c -----------
trunk/src/mame/includes/ddragon.h
r18139r18140
101101   DECLARE_VIDEO_START(ddragon);
102102   UINT32 screen_update_ddragon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
103103   TIMER_DEVICE_CALLBACK_MEMBER(ddragon_scanline);
104   TIMER_DEVICE_CALLBACK_MEMBER(chinagat_scanline);
104105};
trunk/src/mame/includes/eolith.h
r18139r18140
4040   DECLARE_MACHINE_RESET(eolith);
4141   DECLARE_VIDEO_START(eolith);
4242   UINT32 screen_update_eolith(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
43   TIMER_DEVICE_CALLBACK_MEMBER(eolith_speedup);
4344};
trunk/src/mame/includes/eolithsp.h
r18139r18140
22
33void eolith_speedup_read(address_space &space);
44void init_eolith_speedup(running_machine &machine);
5TIMER_DEVICE_CALLBACK( eolith_speedup );
trunk/src/mame/includes/stv.h
r18139r18140
200200   DECLARE_MACHINE_RESET(stv);
201201   UINT32 screen_update_saturn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
202202   UINT32 screen_update_stv_vdp2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
203   TIMER_DEVICE_CALLBACK_MEMBER(saturn_scanline);
204   TIMER_DEVICE_CALLBACK_MEMBER(saturn_slave_scanline);
203205};
204206
205207#define MASTER_CLOCK_352 57272720
trunk/src/mame/includes/mpu4.h
r18139r18140
255255   DECLARE_MACHINE_START(mpu4oki);
256256   DECLARE_MACHINE_START(mpu4bwb);
257257   DECLARE_MACHINE_START(mpu4cry);
258   TIMER_DEVICE_CALLBACK_MEMBER(gen_50hz);
258259};
259260
260261/* mpu4.c, used by mpu4vid.c */
trunk/src/mame/includes/cps1.h
r18139r18140
215215   void screen_eof_cps1(screen_device &screen, bool state);
216216   INTERRUPT_GEN_MEMBER(cps1_interrupt);
217217   INTERRUPT_GEN_MEMBER(cps1_qsound_interrupt);
218   TIMER_DEVICE_CALLBACK_MEMBER(cps2_interrupt);
218219};
219220
220221/*----------- defined in drivers/cps1.c -----------*/
trunk/src/mame/includes/galaga.h
r18139r18140
9797   DECLARE_MACHINE_RESET(battles);
9898   UINT32 screen_update_xevious(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
9999   INTERRUPT_GEN_MEMBER(battles_interrupt_4);
100   TIMER_DEVICE_CALLBACK_MEMBER(battles_nmi_generate);
100101};
101102
102103
r18139r18140
192193/*----------- defined in machine/xevious.c -----------*/
193194
194195void battles_customio_init(running_machine &machine);
195TIMER_DEVICE_CALLBACK( battles_nmi_generate );
196196
197197DECLARE_READ8_HANDLER( battles_customio0_r );
198198DECLARE_READ8_HANDLER( battles_customio_data0_r );
trunk/src/mame/drivers/mpu4hw.c
r18139r18140
26612661}
26622662
26632663/* generate a 50 Hz signal (based on an RC time) */
2664TIMER_DEVICE_CALLBACK( gen_50hz )
2664TIMER_DEVICE_CALLBACK_MEMBER(mpu4_state::gen_50hz)
26652665{
2666   mpu4_state *state = timer.machine().driver_data<mpu4_state>();
26672666   /* Although reported as a '50Hz' signal, the fact that both rising and
26682667    falling edges of the pulse are used means the timer actually gives a 100Hz
26692668    oscillating signal.*/
2670   state->m_signal_50hz = state->m_signal_50hz?0:1;
2671   timer.machine().device<pia6821_device>("pia_ic4")->ca1_w(state->m_signal_50hz);   /* signal is connected to IC4 CA1 */
2669   m_signal_50hz = m_signal_50hz?0:1;
2670   machine().device<pia6821_device>("pia_ic4")->ca1_w(m_signal_50hz);   /* signal is connected to IC4 CA1 */
26722671
2673   update_meters(state);//run at 100Hz to sync with PIAs
2672   update_meters(this);//run at 100Hz to sync with PIAs
26742673}
26752674
26762675static ADDRESS_MAP_START( mpu4_memmap, AS_PROGRAM, 8, mpu4_state )
r18139r18140
26992698};
27002699
27012700MACHINE_CONFIG_FRAGMENT( mpu4_common )
2702   MCFG_TIMER_ADD_PERIODIC("50hz",gen_50hz, attotime::from_hz(100))
2701   MCFG_TIMER_DRIVER_ADD_PERIODIC("50hz", mpu4_state, gen_50hz, attotime::from_hz(100))
27032702
27042703   MCFG_MSC1937_ADD("vfd",0,LEFT_TO_RIGHT)
27052704   /* 6840 PTM */
trunk/src/mame/drivers/eolithsp.c
r18139r18140
8787}
8888
8989/* todo, use timers instead! */
90TIMER_DEVICE_CALLBACK( eolith_speedup )
90TIMER_DEVICE_CALLBACK_MEMBER(eolith_state::eolith_speedup)
9191{
9292   if (param==0)
9393   {
r18139r18140
9696
9797   if (param==eolith_speedup_resume_scanline)
9898   {
99      timer.machine().scheduler().trigger(1000);
99      machine().scheduler().trigger(1000);
100100   }
101101
102102   if (param==240)
trunk/src/mame/drivers/eolith16.c
r18139r18140
179179static MACHINE_CONFIG_START( eolith16, eolith16_state )
180180   MCFG_CPU_ADD("maincpu", E116T, 60000000)      /* no internal multiplier */
181181   MCFG_CPU_PROGRAM_MAP(eolith16_map)
182   MCFG_TIMER_ADD_SCANLINE("scantimer", eolith_speedup, "screen", 0, 1)
182   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", eolith16_state, eolith_speedup, "screen", 0, 1)
183183
184184   MCFG_EEPROM_ADD("eeprom", eeprom_interface_93C66)
185185
trunk/src/mame/drivers/galaga.c
r18139r18140
18721872   MCFG_CPU_PROGRAM_MAP(battles_mem4)
18731873   MCFG_CPU_VBLANK_INT_DRIVER("screen", xevious_state, battles_interrupt_4)
18741874
1875   MCFG_TIMER_ADD("battles_nmi", battles_nmi_generate)
1875   MCFG_TIMER_DRIVER_ADD("battles_nmi", xevious_state, battles_nmi_generate)
18761876
18771877   MCFG_MACHINE_RESET_OVERRIDE(xevious_state,battles)
18781878
trunk/src/mame/drivers/cps2.c
r18139r18140
621621 *
622622 *************************************/
623623
624static TIMER_DEVICE_CALLBACK( cps2_interrupt )
624TIMER_DEVICE_CALLBACK_MEMBER(cps_state::cps2_interrupt)
625625{
626   cps_state *state = timer.machine().driver_data<cps_state>();
627
628626   /* 2 is vblank, 4 is some sort of scanline interrupt, 6 is both at the same time. */
629627   if (param == 0)
630      state->m_scancalls = 0;
628      m_scancalls = 0;
631629
632   if (state->m_cps_b_regs[0x10 / 2] & 0x8000)
633      state->m_cps_b_regs[0x10 / 2] &= 0x1ff;
630   if (m_cps_b_regs[0x10 / 2] & 0x8000)
631      m_cps_b_regs[0x10 / 2] &= 0x1ff;
634632
635   if (state->m_cps_b_regs[0x12 / 2] & 0x8000)
636      state->m_cps_b_regs[0x12 / 2] &= 0x1ff;
633   if (m_cps_b_regs[0x12 / 2] & 0x8000)
634      m_cps_b_regs[0x12 / 2] &= 0x1ff;
637635
638//  popmessage("%04x %04x - %04x %04x",state->m_scanline1,state->m_scanline2,state->m_cps_b_regs[0x10/2],state->m_cps_b_regs[0x12/2]);
636//  popmessage("%04x %04x - %04x %04x",m_scanline1,m_scanline2,m_cps_b_regs[0x10/2],m_cps_b_regs[0x12/2]);
639637
640638   /* raster effects */
641   if (state->m_scanline1 == param || (state->m_scanline1 < param && !state->m_scancalls))
639   if (m_scanline1 == param || (m_scanline1 < param && !m_scancalls))
642640   {
643      state->m_cps_b_regs[0x10/2] = 0;
644      state->m_maincpu->set_input_line(4, HOLD_LINE);
641      m_cps_b_regs[0x10/2] = 0;
642      m_maincpu->set_input_line(4, HOLD_LINE);
645643      cps2_set_sprite_priorities(timer.machine());
646644      timer.machine().primary_screen->update_partial(param);
647      state->m_scancalls++;
645      m_scancalls++;
648646//      popmessage("IRQ4 scancounter = %04i", param);
649647   }
650648
651649   /* raster effects */
652   if(state->m_scanline2 == param || (state->m_scanline2 < param && !state->m_scancalls))
650   if(m_scanline2 == param || (m_scanline2 < param && !m_scancalls))
653651   {
654      state->m_cps_b_regs[0x12 / 2] = 0;
655      state->m_maincpu->set_input_line(4, HOLD_LINE);
652      m_cps_b_regs[0x12 / 2] = 0;
653      m_maincpu->set_input_line(4, HOLD_LINE);
656654      cps2_set_sprite_priorities(timer.machine());
657655      timer.machine().primary_screen->update_partial(param);
658      state->m_scancalls++;
656      m_scancalls++;
659657//      popmessage("IRQ4 scancounter = %04i", param);
660658   }
661659
662660   if (param == 240)  /* VBlank */
663661   {
664      state->m_cps_b_regs[0x10 / 2] = state->m_scanline1;
665      state->m_cps_b_regs[0x12 / 2] = state->m_scanline2;
666      state->m_maincpu->set_input_line(2, HOLD_LINE);
667      if(state->m_scancalls)
662      m_cps_b_regs[0x10 / 2] = m_scanline1;
663      m_cps_b_regs[0x12 / 2] = m_scanline2;
664      m_maincpu->set_input_line(2, HOLD_LINE);
665      if(m_scancalls)
668666      {
669667         cps2_set_sprite_priorities(timer.machine());
670668         timer.machine().primary_screen->update_partial(256);
671669      }
672670      cps2_objram_latch(timer.machine());
673671   }
674//  popmessage("Raster calls = %i", state->m_scancalls);
672//  popmessage("Raster calls = %i", m_scancalls);
675673}
676674
677675
r18139r18140
12261224   /* basic machine hardware */
12271225   MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz)
12281226   MCFG_CPU_PROGRAM_MAP(cps2_map)
1229   MCFG_TIMER_ADD_SCANLINE("scantimer", cps2_interrupt, "screen", 0, 1)
1227   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", cps_state, cps2_interrupt, "screen", 0, 1)
12301228
12311229   MCFG_CPU_ADD("audiocpu", Z80, 8000000)
12321230   MCFG_CPU_PROGRAM_MAP(qsound_sub_map)
trunk/src/mame/drivers/saturn.c
r18139r18140
18561856*/
18571857
18581858
1859static TIMER_DEVICE_CALLBACK( saturn_scanline )
1859TIMER_DEVICE_CALLBACK_MEMBER(saturn_state::saturn_scanline)
18601860{
1861   saturn_state *state = timer.machine().driver_data<saturn_state>();
1861   saturn_state *state = machine().driver_data<saturn_state>();
18621862   int scanline = param;
18631863   int max_y = timer.machine().primary_screen->height();
18641864   int y_step,vblank_line;
18651865
18661866   y_step = 2;
18671867
1868   if((max_y == 263 && state->m_vdp2.pal == 0) || (max_y == 313 && state->m_vdp2.pal == 1))
1868   if((max_y == 263 && m_vdp2.pal == 0) || (max_y == 313 && m_vdp2.pal == 1))
18691869      y_step = 1;
18701870
1871   vblank_line = (state->m_vdp2.pal) ? 288 : 240;
1871   vblank_line = (m_vdp2.pal) ? 288 : 240;
18721872
1873   //popmessage("%08x %d T0 %d T1 %d %08x",state->m_scu.ism ^ 0xffffffff,max_y,state->m_scu_regs[36],state->m_scu_regs[37],state->m_scu_regs[38]);
1873   //popmessage("%08x %d T0 %d T1 %d %08x",m_scu.ism ^ 0xffffffff,max_y,m_scu_regs[36],m_scu_regs[37],m_scu_regs[38]);
18741874
18751875   if(scanline == (0)*y_step)
18761876   {
18771877      video_update_vdp1(timer.machine());
18781878
18791879      if(STV_VDP1_VBE)
1880         state->m_vdp1.framebuffer_clear_on_next_frame = 1;
1880         m_vdp1.framebuffer_clear_on_next_frame = 1;
18811881
1882      if(!(state->m_scu.ism & IRQ_VDP1_END))
1882      if(!(m_scu.ism & IRQ_VDP1_END))
18831883      {
1884         state->m_maincpu->set_input_line_and_vector(0x2, HOLD_LINE, 0x4d);
1884         m_maincpu->set_input_line_and_vector(0x2, HOLD_LINE, 0x4d);
18851885         scu_do_transfer(timer.machine(),6);
18861886      }
18871887      else
1888         state->m_scu.ist |= (IRQ_VDP1_END);
1888         m_scu.ist |= (IRQ_VDP1_END);
18891889   }
18901890
18911891   if(scanline == 0*y_step)
18921892   {
1893      if(!(state->m_scu.ism & IRQ_VBLANK_OUT))
1893      if(!(m_scu.ism & IRQ_VBLANK_OUT))
18941894      {
1895         state->m_maincpu->set_input_line_and_vector(0xe, HOLD_LINE, 0x41);
1895         m_maincpu->set_input_line_and_vector(0xe, HOLD_LINE, 0x41);
18961896         scu_do_transfer(timer.machine(),1);
18971897      }
18981898      else
1899         state->m_scu.ist |= (IRQ_VBLANK_OUT);
1899         m_scu.ist |= (IRQ_VBLANK_OUT);
19001900
19011901   }
19021902   else if(scanline == vblank_line*y_step)
19031903   {
1904      if(!(state->m_scu.ism & IRQ_VBLANK_IN))
1904      if(!(m_scu.ism & IRQ_VBLANK_IN))
19051905      {
1906         state->m_maincpu->set_input_line_and_vector(0xf, HOLD_LINE ,0x40);
1906         m_maincpu->set_input_line_and_vector(0xf, HOLD_LINE ,0x40);
19071907         scu_do_transfer(timer.machine(),0);
19081908      }
19091909      else
1910         state->m_scu.ist |= (IRQ_VBLANK_IN);
1910         m_scu.ist |= (IRQ_VBLANK_IN);
19111911   }
19121912   else if((scanline % y_step) == 0 && scanline < vblank_line*y_step)
19131913   {
1914      if(!(state->m_scu.ism & IRQ_HBLANK_IN))
1914      if(!(m_scu.ism & IRQ_HBLANK_IN))
19151915      {
1916         state->m_maincpu->set_input_line_and_vector(0xd, HOLD_LINE, 0x42);
1916         m_maincpu->set_input_line_and_vector(0xd, HOLD_LINE, 0x42);
19171917         scu_do_transfer(timer.machine(),2);
19181918      }
19191919      else
1920         state->m_scu.ist |= (IRQ_HBLANK_IN);
1920         m_scu.ist |= (IRQ_HBLANK_IN);
19211921   }
19221922
1923   if(scanline == (state->m_scu_regs[36] & 0x3ff)*y_step)
1923   if(scanline == (m_scu_regs[36] & 0x3ff)*y_step)
19241924   {
1925      if(!(state->m_scu.ism & IRQ_TIMER_0))
1925      if(!(m_scu.ism & IRQ_TIMER_0))
19261926      {
1927         state->m_maincpu->set_input_line_and_vector(0xc, HOLD_LINE, 0x43 );
1927         m_maincpu->set_input_line_and_vector(0xc, HOLD_LINE, 0x43 );
19281928         scu_do_transfer(timer.machine(),3);
19291929      }
19301930      else
1931         state->m_scu.ist |= (IRQ_TIMER_0);
1931         m_scu.ist |= (IRQ_TIMER_0);
19321932   }
19331933
19341934   /* TODO: this isn't completely correct */
1935   if(state->m_scu_regs[38] & 0x1)
1935   if(m_scu_regs[38] & 0x1)
19361936   {
1937      if((!(state->m_scu_regs[38] & 0x100) && (scanline % y_step) == 0) ||
1938          ((state->m_scu_regs[38] & 0x100) && (scanline == (state->m_scu_regs[36] & 0x3ff)*y_step)))
1937      if((!(m_scu_regs[38] & 0x100) && (scanline % y_step) == 0) ||
1938          ((m_scu_regs[38] & 0x100) && (scanline == (m_scu_regs[36] & 0x3ff)*y_step)))
19391939      {
1940         if(!(state->m_scu.ism & IRQ_TIMER_1))
1940         if(!(m_scu.ism & IRQ_TIMER_1))
19411941         {
1942            state->m_maincpu->set_input_line_and_vector(0xb, HOLD_LINE, 0x44 );
1942            m_maincpu->set_input_line_and_vector(0xb, HOLD_LINE, 0x44 );
19431943            scu_do_transfer(timer.machine(),4);
19441944         }
19451945         else
1946            state->m_scu.ist |= (IRQ_TIMER_1);
1946            m_scu.ist |= (IRQ_TIMER_1);
19471947      }
19481948   }
19491949}
19501950
1951static TIMER_DEVICE_CALLBACK( saturn_slave_scanline )
1951TIMER_DEVICE_CALLBACK_MEMBER(saturn_state::saturn_slave_scanline )
19521952{
1953   saturn_state *state = timer.machine().driver_data<saturn_state>();
19541953   int scanline = param;
19551954   int max_y = timer.machine().primary_screen->height();
19561955   int y_step,vblank_line;
19571956
19581957   y_step = 2;
19591958
1960   if((max_y == 263 && state->m_vdp2.pal == 0) || (max_y == 313 && state->m_vdp2.pal == 1))
1959   if((max_y == 263 && m_vdp2.pal == 0) || (max_y == 313 && m_vdp2.pal == 1))
19611960      y_step = 1;
19621961
1963   vblank_line = (state->m_vdp2.pal) ? 288 : 240;
1962   vblank_line = (m_vdp2.pal) ? 288 : 240;
19641963
19651964   if(scanline == vblank_line*y_step)
1966      state->m_slave->set_input_line_and_vector(0x6, HOLD_LINE, 0x43);
1965      m_slave->set_input_line_and_vector(0x6, HOLD_LINE, 0x43);
19671966   else if((scanline % y_step) == 0 && scanline < vblank_line*y_step)
1968      state->m_slave->set_input_line_and_vector(0x2, HOLD_LINE, 0x41);
1967      m_slave->set_input_line_and_vector(0x2, HOLD_LINE, 0x41);
19691968}
19701969
19711970/* Die Hard Trilogy tests RAM address 0x25e7ffe bit 2 with Slave during FRT minit irq, in-development tool for breaking execution of it? */
r18139r18140
21852184   MCFG_CPU_ADD("maincpu", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz
21862185   MCFG_CPU_PROGRAM_MAP(saturn_mem)
21872186   MCFG_CPU_CONFIG(sh2_conf_master)
2188   MCFG_TIMER_ADD_SCANLINE("scantimer", saturn_scanline, "screen", 0, 1)
2187   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", saturn_state, saturn_scanline, "screen", 0, 1)
21892188
21902189   MCFG_CPU_ADD("slave", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz
21912190   MCFG_CPU_PROGRAM_MAP(saturn_mem)
21922191   MCFG_CPU_CONFIG(sh2_conf_slave)
2193   MCFG_TIMER_ADD_SCANLINE("slave_scantimer", saturn_slave_scanline, "screen", 0, 1)
2192   MCFG_TIMER_DRIVER_ADD_SCANLINE("slave_scantimer", saturn_state, saturn_slave_scanline, "screen", 0, 1)
21942193
21952194   MCFG_CPU_ADD("audiocpu", M68000, 11289600) //256 x 44100 Hz = 11.2896 MHz
21962195   MCFG_CPU_PROGRAM_MAP(sound_mem)
r18139r18140
22732272   MCFG_CPU_ADD("maincpu", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz
22742273   MCFG_CPU_PROGRAM_MAP(stv_mem)
22752274   MCFG_CPU_CONFIG(sh2_conf_master)
2276   MCFG_TIMER_ADD_SCANLINE("scantimer", saturn_scanline, "screen", 0, 1)
2275   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", saturn_state, saturn_scanline, "screen", 0, 1)
22772276
22782277   MCFG_CPU_ADD("slave", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz
22792278   MCFG_CPU_PROGRAM_MAP(stv_mem)
22802279   MCFG_CPU_CONFIG(sh2_conf_slave)
2281   MCFG_TIMER_ADD_SCANLINE("slave_scantimer", saturn_slave_scanline, "screen", 0, 1)
2280   MCFG_TIMER_DRIVER_ADD_SCANLINE("slave_scantimer", saturn_state, saturn_slave_scanline, "screen", 0, 1)
22822281
22832282   MCFG_CPU_ADD("audiocpu", M68000, 11289600) //11.2896 MHz
22842283   MCFG_CPU_PROGRAM_MAP(sound_mem)
trunk/src/mame/drivers/eolith.c
r18139r18140
571571static MACHINE_CONFIG_START( eolith45, eolith_state )
572572   MCFG_CPU_ADD("maincpu", E132N, 45000000)       /* 45 MHz */
573573   MCFG_CPU_PROGRAM_MAP(eolith_map)
574   MCFG_TIMER_ADD_SCANLINE("scantimer", eolith_speedup, "screen", 0, 1)
574   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", eolith_state, eolith_speedup, "screen", 0, 1)
575575
576576   /* Sound CPU */
577577   MCFG_CPU_ADD("soundcpu", I8032, XTAL_12MHz)
trunk/src/mame/drivers/vegaeo.c
r18139r18140
251251static MACHINE_CONFIG_START( vega, vegaeo_state )
252252   MCFG_CPU_ADD("maincpu", GMS30C2132, XTAL_55MHz)
253253   MCFG_CPU_PROGRAM_MAP(vega_map)
254   MCFG_TIMER_ADD_SCANLINE("scantimer", eolith_speedup, "screen", 0, 1)
254   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", vegaeo_state, eolith_speedup, "screen", 0, 1)
255255
256256   MCFG_AT28C16_ADD("at28c16", NULL)
257257
trunk/src/mame/drivers/ddenlovr.c
r18139r18140
89318931    to trigger the blitter irq every frame.
89328932 */
89338933
8934static TIMER_DEVICE_CALLBACK( mjmyster_irq )
8934TIMER_DEVICE_CALLBACK_MEMBER(dynax_state::mjmyster_irq)
89358935{
8936   dynax_state *state = timer.machine().driver_data<dynax_state>();
89378936   int scanline = param;
89388937
89398938   /* I haven't found a irq ack register, so I need this kludge to
89408939       make sure I don't lose any interrupt generated by the blitter,
89418940       otherwise quizchq would lock up. */
8942   if (downcast<cpu_device *>(state->m_maincpu)->input_state(0))
8941   if (downcast<cpu_device *>(m_maincpu)->input_state(0))
89438942      return;
89448943
89458944   if(scanline == 245)
8946      state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xf8);
8945      m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xf8);
89478946
89488947   if(scanline == 0)
8949      state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xfa);
8948      m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xfa);
89508949}
89518950
89528951static const ay8910_interface mjmyster_ay8910_interface =
r18139r18140
89858984   MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/2)   /* Verified */
89868985   MCFG_CPU_PROGRAM_MAP(mjmyster_map)
89878986   MCFG_CPU_IO_MAP(mjmyster_portmap)
8988   MCFG_TIMER_ADD_SCANLINE("scantimer", mjmyster_irq, "screen", 0, 1)
8987   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dynax_state, mjmyster_irq, "screen", 0, 1)
89898988
89908989   MCFG_DEVICE_MODIFY("rtc")
89918990   MCFG_DEVICE_CONFIG(mjmyster_rtc_intf)
r18139r18140
91089107   MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/2)   /* Verified */
91099108   MCFG_CPU_PROGRAM_MAP(mjmyster_map)
91109109   MCFG_CPU_IO_MAP(mjmyster_portmap)
9111   MCFG_TIMER_ADD_SCANLINE("scantimer", mjmyster_irq, "screen", 0, 1)
9110   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dynax_state, mjmyster_irq, "screen", 0, 1)
91129111
91139112   MCFG_MACHINE_START_OVERRIDE(dynax_state,mjmyster)
91149113
r18139r18140
91289127   MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/2)   /* Verified */
91299128   MCFG_CPU_PROGRAM_MAP(quizchq_map)
91309129   MCFG_CPU_IO_MAP(mjmyster_portmap)
9131   MCFG_TIMER_ADD_SCANLINE("scantimer", mjmyster_irq, "screen", 0, 1)
9130   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dynax_state, mjmyster_irq, "screen", 0, 1)
91329131
91339132   MCFG_MACHINE_START_OVERRIDE(dynax_state,mjmyster)
91349133
trunk/src/mame/drivers/chinagat.c
r18139r18140
108108      return (vcount - 0x18) | 0x100;
109109}
110110
111static TIMER_DEVICE_CALLBACK( chinagat_scanline )
111TIMER_DEVICE_CALLBACK_MEMBER(ddragon_state::chinagat_scanline)
112112{
113   ddragon_state *state = timer.machine().driver_data<ddragon_state>();
114113   int scanline = param;
115   int screen_height = timer.machine().primary_screen->height();
114   int screen_height = machine().primary_screen->height();
116115   int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
117116   int vcount = scanline_to_vcount(scanline);
118117
119118   /* update to the current point */
120119   if (scanline > 0)
121      timer.machine().primary_screen->update_partial(scanline - 1);
120      machine().primary_screen->update_partial(scanline - 1);
122121
123122   /* on the rising edge of VBLK (vcount == F8), signal an NMI */
124123   if (vcount == 0xf8)
125      state->m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
124      m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
126125
127126   /* set 1ms signal on rising edge of vcount & 8 */
128127   if (!(vcount_old & 8) && (vcount & 8))
129      state->m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
128      m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
130129
131130   /* adjust for next scanline */
132131   if (++scanline >= screen_height)
r18139r18140
571570   /* basic machine hardware */
572571   MCFG_CPU_ADD("maincpu", HD6309, MAIN_CLOCK / 2)      /* 1.5 MHz (12MHz oscillator / 4 internally) */
573572   MCFG_CPU_PROGRAM_MAP(main_map)
574   MCFG_TIMER_ADD_SCANLINE("scantimer", chinagat_scanline, "screen", 0, 1)
573   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ddragon_state, chinagat_scanline, "screen", 0, 1)
575574
576575   MCFG_CPU_ADD("sub", HD6309, MAIN_CLOCK / 2)      /* 1.5 MHz (12MHz oscillator / 4 internally) */
577576   MCFG_CPU_PROGRAM_MAP(sub_map)
r18139r18140
611610   /* basic machine hardware */
612611   MCFG_CPU_ADD("maincpu", M6809, MAIN_CLOCK / 8)      /* 68B09EP 1.5 MHz (12MHz oscillator) */
613612   MCFG_CPU_PROGRAM_MAP(main_map)
614   MCFG_TIMER_ADD_SCANLINE("scantimer", chinagat_scanline, "screen", 0, 1)
613   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ddragon_state, chinagat_scanline, "screen", 0, 1)
615614
616615   MCFG_CPU_ADD("sub", M6809, MAIN_CLOCK / 8)      /* 68B09EP 1.5 MHz (12MHz oscillator) */
617616   MCFG_CPU_PROGRAM_MAP(sub_map)
r18139r18140
656655   /* basic machine hardware */
657656   MCFG_CPU_ADD("maincpu", M6809, MAIN_CLOCK / 8)      /* 1.5 MHz (12MHz oscillator) */
658657   MCFG_CPU_PROGRAM_MAP(main_map)
659   MCFG_TIMER_ADD_SCANLINE("scantimer", chinagat_scanline, "screen", 0, 1)
658   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ddragon_state, chinagat_scanline, "screen", 0, 1)
660659
661660   MCFG_CPU_ADD("sub", M6809, MAIN_CLOCK / 8)      /* 1.5 MHz (12MHz oscillator) */
662661   MCFG_CPU_PROGRAM_MAP(sub_map)
trunk/src/mame/machine/xevious.c
r18139r18140
3535}
3636
3737
38TIMER_DEVICE_CALLBACK( battles_nmi_generate )
38TIMER_DEVICE_CALLBACK_MEMBER(xevious_state::battles_nmi_generate)
3939{
4040
4141   battles_customio_prev_command = battles_customio_command;
r18139r18140
4444   {
4545      if( battles_customio_command_count == 0 )
4646      {
47         timer.machine().device("sub3")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
47         machine().device("sub3")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
4848      }
4949      else
5050      {
51         timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
52         timer.machine().device("sub3")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
51         machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
52         machine().device("sub3")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
5353      }
5454   }
5555   else
5656   {
57      timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
58      timer.machine().device("sub3")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
57      machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
58      machine().device("sub3")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
5959   }
6060   battles_customio_command_count++;
6161}
trunk/src/mess/drivers/ti99_4p.c
r18139r18140
9595   DECLARE_WRITE_LINE_MEMBER(alphaW);
9696   virtual void machine_start();
9797   DECLARE_MACHINE_RESET(ti99_4p);
98
98   TIMER_DEVICE_CALLBACK_MEMBER(sgcpu_hblank_interrupt);
99   
99100   void set_tms9901_INT2_from_v9938(v99x8_device &vdp, int state);
100101
101102   tms9900_device*         m_cpu;
r18139r18140
867868   m_cpu->set_hold(CLEAR_LINE);
868869}
869870
870TIMER_DEVICE_CALLBACK( sgcpu_hblank_interrupt )
871TIMER_DEVICE_CALLBACK_MEMBER(ti99_4p::sgcpu_hblank_interrupt)
871872{
872   timer.machine().device<v9938_device>(VDP_TAG)->interrupt();
873   machine().device<v9938_device>(VDP_TAG)->interrupt();
873874}
874875
875876/*
r18139r18140
887888   // painted. Accordingly, the full set of lines is refreshed at 30 Hz,
888889   // not 60 Hz. This should be fixed in the v9938 emulation.
889890   MCFG_TI_V9938_ADD(VIDEO_SYSTEM_TAG, 30, SCREEN_TAG, 2500, 512+32, (212+28)*2, DEVICE_SELF, ti99_4p, set_tms9901_INT2_from_v9938)
890   MCFG_TIMER_ADD_SCANLINE("scantimer", sgcpu_hblank_interrupt, SCREEN_TAG, 0, 1)
891   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ti99_4p, sgcpu_hblank_interrupt, SCREEN_TAG, 0, 1)
891892
892893   // tms9901
893894   MCFG_TMS9901_ADD(TMS9901_TAG, tms9901_wiring_sgcpu, 3000000)
trunk/src/mess/drivers/adam.c
r18139r18140
11621162//**************************************************************************
11631163
11641164//-------------------------------------------------
1165//  TIMER_DEVICE_CALLBACK( paddle_tick )
1165//  TIMER_DEVICE_CALLBACK_MEMBER( paddle_tick )
11661166//-------------------------------------------------
11671167
11681168TIMER_DEVICE_CALLBACK_MEMBER(adam_state::paddle_tick)
trunk/src/mess/drivers/ti99_4x.c
r18139r18140
8787   DECLARE_WRITE_LINE_MEMBER( clock_out );
8888
8989   DECLARE_INPUT_CHANGED_MEMBER( load_interrupt );
90
90   TIMER_DEVICE_CALLBACK_MEMBER(ti99_4ev_hblank_interrupt);
91   
9192   // Some values to keep
9293   tms9900_device*      m_cpu;
9394   tms9901_device*      m_tms9901;
r18139r18140
10721073MACHINE_CONFIG_END
10731074
10741075
1075TIMER_DEVICE_CALLBACK( ti99_4ev_hblank_interrupt )
1076TIMER_DEVICE_CALLBACK_MEMBER(ti99_4x::ti99_4ev_hblank_interrupt)
10761077{
1077   timer.machine().device<v9938_device>(VDP_TAG)->interrupt();
1078   machine().device<v9938_device>(VDP_TAG)->interrupt();
10781079}
10791080
10801081/*
r18139r18140
10941095   // painted. Accordingly, the full set of lines is refreshed at 30 Hz,
10951096   // not 60 Hz. This should be fixed in the v9938 emulation.
10961097   MCFG_TI_V9938_ADD(VIDEO_SYSTEM_TAG, 30, SCREEN_TAG, 2500, 512+32, (212+28)*2, DEVICE_SELF, ti99_4x, set_tms9901_INT2_from_v9938)
1097   MCFG_TIMER_ADD_SCANLINE("scantimer", ti99_4ev_hblank_interrupt, SCREEN_TAG, 0, 1)
1098   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ti99_4x, ti99_4ev_hblank_interrupt, SCREEN_TAG, 0, 1)
10981099
10991100   /* Main board */
11001101   MCFG_TMS9901_ADD(TMS9901_TAG, tms9901_wiring_ti99_4a, 3000000)
trunk/src/mess/drivers/portfoli.c
r18139r18140
244244}
245245
246246//-------------------------------------------------
247//  TIMER_DEVICE_CALLBACK( keyboard_tick )
247//  TIMER_DEVICE_CALLBACK_MEMBER( keyboard_tick )
248248//-------------------------------------------------
249249
250250TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::keyboard_tick)
r18139r18140
365365//**************************************************************************
366366
367367//-------------------------------------------------
368//  TIMER_DEVICE_CALLBACK( system_tick )
368//  TIMER_DEVICE_CALLBACK_MEMBER( system_tick )
369369//-------------------------------------------------
370370
371371TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::system_tick)
r18139r18140
374374}
375375
376376//-------------------------------------------------
377//  TIMER_DEVICE_CALLBACK( counter_tick )
377//  TIMER_DEVICE_CALLBACK_MEMBER( counter_tick )
378378//-------------------------------------------------
379379
380380TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::counter_tick)
trunk/src/mess/drivers/vixen.c
r18139r18140
390390//**************************************************************************
391391
392392//-------------------------------------------------
393//  TIMER_DEVICE_CALLBACK( vsync_tick )
393//  TIMER_DEVICE_CALLBACK_MEMBER( vsync_tick )
394394//-------------------------------------------------
395395
396396TIMER_DEVICE_CALLBACK_MEMBER(vixen_state::vsync_tick)
trunk/src/mess/drivers/geneve.c
r18139r18140
260260   DECLARE_DRIVER_INIT(geneve);
261261   virtual void machine_start();
262262   virtual void machine_reset();
263   TIMER_DEVICE_CALLBACK_MEMBER(geneve_hblank_interrupt);
263264
264265   void   set_tms9901_INT2_from_v9938(v99x8_device &vdp, int state);
265266
r18139r18140
634635/*
635636    scanline interrupt
636637*/
637TIMER_DEVICE_CALLBACK( geneve_hblank_interrupt )
638TIMER_DEVICE_CALLBACK_MEMBER(geneve::geneve_hblank_interrupt)
638639{
639640   int scanline = param;
640   geneve *driver = timer.machine().driver_data<geneve>();
641641
642   timer.machine().device<v9938_device>(VDP_TAG)->interrupt();
642   machine().device<v9938_device>(VDP_TAG)->interrupt();
643643
644644   if (scanline == 0) // was 262
645645   {
r18139r18140
649649      // per vertical interrupt; however, the mouse sometimes shows jerky
650650      // behaviour. Maybe we should use an autonomous timer with a higher
651651      // rate? -> to be checked
652      driver->m_mouse->poll();
652      m_mouse->poll();
653653   }
654654}
655655
r18139r18140
763763   // painted. Accordingly, the full set of lines is refreshed at 30 Hz,
764764   // not 60 Hz. This should be fixed in the v9938 emulation.
765765   MCFG_TI_V9938_ADD(VIDEO_SYSTEM_TAG, 30, SCREEN_TAG, 2500, 512+32, (212+28)*2, DEVICE_SELF, geneve, set_tms9901_INT2_from_v9938)
766   MCFG_TIMER_ADD_SCANLINE("scantimer", geneve_hblank_interrupt, SCREEN_TAG, 0, 1) /* 262.5 in 60Hz, 312.5 in 50Hz */
766   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", geneve, geneve_hblank_interrupt, SCREEN_TAG, 0, 1) /* 262.5 in 60Hz, 312.5 in 50Hz */
767767
768768   // Main board components
769769   MCFG_TMS9901_ADD(TMS9901_TAG, tms9901_wiring_geneve, 3000000)
trunk/src/mess/drivers/tm990189.c
r18139r18140
144144   DECLARE_MACHINE_RESET(tm990_189);
145145   DECLARE_MACHINE_START(tm990_189_v);
146146   DECLARE_MACHINE_RESET(tm990_189_v);
147   
148   TIMER_DEVICE_CALLBACK_MEMBER(display_callback);
147149private:
148150   void draw_digit(void);
149151   void led_set(int number, bool state);
r18139r18140
247249}
248250
249251
250static TIMER_DEVICE_CALLBACK( display_callback )
252TIMER_DEVICE_CALLBACK_MEMBER(tm990189::display_callback)
251253{
252   tm990189 *state = timer.machine().driver_data<tm990189>();
253254   UINT8 i;
254255   char ledname[8];
255256    // since the segment data is cleared after being used, the old_segment is there
256257    // in case the segment data hasn't been refreshed yet.
257258   for (i = 0; i < 10; i++)
258259   {
259      state->m_old_segment_state[i] |= state->m_segment_state[i];
260      m_old_segment_state[i] |= m_segment_state[i];
260261      sprintf(ledname,"digit%d",i);
261      output_set_digit_value(i, state->m_old_segment_state[i]);
262      state->m_old_segment_state[i] = state->m_segment_state[i];
263      state->m_segment_state[i] = 0;
262      output_set_digit_value(i, m_old_segment_state[i]);
263      m_old_segment_state[i] = m_segment_state[i];
264      m_segment_state[i] = 0;
264265   }
265266
266267   for (i = 0; i < 7; i++)
267268   {
268269      sprintf(ledname,"led%d",i);
269      output_set_value(ledname, !BIT(state->m_LED_state, i));
270      output_set_value(ledname, !BIT(m_LED_state, i));
270271   }
271272}
272273
r18139r18140
855856   MCFG_TMS9901_ADD("tms9901_1", sys9901reset_param, 2000000)
856857   MCFG_TMS9902_ADD("tms9902", tms9902_params, 2000000)
857858   MCFG_TM990_189_RS232_ADD("rs232")
858   MCFG_TIMER_ADD_PERIODIC("display_timer", display_callback, attotime::from_hz(30))
859   MCFG_TIMER_DRIVER_ADD_PERIODIC("display_timer", tm990189, display_callback, attotime::from_hz(30))
859860   // Need to delay the timer, or it will spoil the initial LOAD
860861   // TODO: Fix this, probably inside CPU
861862   MCFG_TIMER_START_DELAY(attotime::from_msec(150))
r18139r18140
887888   MCFG_TMS9901_ADD("tms9901_1", sys9901reset_param, 2000000)
888889   MCFG_TMS9902_ADD("tms9902", tms9902_params,   2000000)
889890   MCFG_TM990_189_RS232_ADD("rs232")
890   MCFG_TIMER_ADD_PERIODIC("display_timer", display_callback, attotime::from_hz(30))
891   MCFG_TIMER_DRIVER_ADD_PERIODIC("display_timer", tm990189, display_callback, attotime::from_hz(30))
891892   MCFG_TIMER_START_DELAY(attotime::from_msec(150))
892893MACHINE_CONFIG_END
893894
trunk/src/mess/drivers/mikromik.c
r18139r18140
316316
317317
318318//-------------------------------------------------
319//  TIMER_DEVICE_CALLBACK( kbclk_tick )
319//  TIMER_DEVICE_CALLBACK_MEMBER( kbclk_tick )
320320//-------------------------------------------------
321321
322322TIMER_DEVICE_CALLBACK_MEMBER(mm1_state::kbclk_tick)
trunk/src/mess/drivers/ace.c
r18139r18140
361361
362362
363363//-------------------------------------------------
364//  TIMER_DEVICE_CALLBACK( set_irq )
364//  TIMER_DEVICE_CALLBACK_MEMBER( set_irq )
365365//-------------------------------------------------
366366
367367TIMER_DEVICE_CALLBACK_MEMBER(ace_state::set_irq)
r18139r18140
371371
372372
373373//-------------------------------------------------
374//  TIMER_DEVICE_CALLBACK( clear_irq )
374//  TIMER_DEVICE_CALLBACK_MEMBER( clear_irq )
375375//-------------------------------------------------
376376
377377TIMER_DEVICE_CALLBACK_MEMBER(ace_state::clear_irq)
trunk/src/mess/drivers/tek405x.c
r18139r18140
9595
9696
9797//-------------------------------------------------
98//  TIMER_DEVICE_CALLBACK( keyboard_tick )
98//  TIMER_DEVICE_CALLBACK_MEMBER( keyboard_tick )
9999//-------------------------------------------------
100100
101101TIMER_DEVICE_CALLBACK_MEMBER(tek4051_state::keyboard_tick)
trunk/src/mess/video/cgc7900.c
r18139r18140
170170}
171171
172172/*-------------------------------------------------
173    TIMER_DEVICE_CALLBACK( blink_tick )
173    TIMER_DEVICE_CALLBACK_MEMBER( blink_tick )
174174-------------------------------------------------*/
175175
176176TIMER_DEVICE_CALLBACK_MEMBER(cgc7900_state::blink_tick)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team