Previous 199869 Revisions Next

r20419 Wednesday 23rd January, 2013 at 19:53:35 UTC by Curt Coder
(MESS) sms: Cleanup. (nw)
[src/mess/machine]sms.c

trunk/src/mess/machine/sms.c
r20418r20419
239239      case 0x04:  /* Sports Pad */
240240         if (data != m_sports_pad_last_data_1)
241241         {
242            UINT32 cpu_cycles = downcast<cpu_device *>(&space.device())->total_cycles();
242            UINT32 cpu_cycles = m_main_cpu->total_cycles();
243243
244244            m_sports_pad_last_data_1 = data;
245245            if (cpu_cycles - m_last_sports_pad_time_1 > 512)
r20418r20419
261261      case 0x40:  /* Sports Pad */
262262         if (data != m_sports_pad_last_data_2)
263263         {
264            UINT32 cpu_cycles = downcast<cpu_device *>(&space.device())->total_cycles();
264            UINT32 cpu_cycles = m_main_cpu->total_cycles();
265265
266266            m_sports_pad_last_data_2 = data;
267267            if (cpu_cycles - m_last_sports_pad_time_2 > 2048)
r20418r20419
856856
857857READ8_MEMBER(sms_state::sms_sscope_r)
858858{
859   int sscope = machine().root_device().ioport("SEGASCOPE")->read_safe(0x00);
859   int sscope = ioport("SEGASCOPE")->read_safe(0x00);
860860
861861   if ( sscope )
862862   {
r20418r20419
872872{
873873   m_mainram[0x1FF8 + offset] = data;
874874
875   int sscope = machine().root_device().ioport("SEGASCOPE")->read_safe(0x00);
875   int sscope = ioport("SEGASCOPE")->read_safe(0x00);
876876
877877   if ( sscope )
878878   {
r20418r20419
19191919   m_ym = machine().device("ym2413");
19201920   m_left_lcd = machine().device("left_lcd");
19211921   m_right_lcd = machine().device("right_lcd");
1922   m_space = &machine().device("maincpu")->memory().space(AS_PROGRAM);
1922   m_space = &m_main_cpu->space(AS_PROGRAM);
19231923
19241924   /* Check if lightgun has been chosen as input: if so, enable crosshair */
19251925   machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(sms_state::lightgun_tick),this));
r20418r20419
20802080   logerror("0x%04X: sms_store_control write 0x%02X\n", space.device().safe_pc(), data);
20812081   if (data & 0x02)
20822082   {
2083      machine().device<cpu_device>("maincpu")->resume(SUSPEND_REASON_HALT);
2083      m_main_cpu->resume(SUSPEND_REASON_HALT);
20842084   }
20852085   else
20862086   {
20872087      /* Pull reset line of CPU #0 low */
2088      machine().device("maincpu")->reset();
2089      machine().device<cpu_device>("maincpu")->suspend(SUSPEND_REASON_HALT, 1);
2088      m_main_cpu->reset();
2089      m_main_cpu->suspend(SUSPEND_REASON_HALT, 1);
20902090   }
20912091   m_store_control = data;
20922092}
r20418r20419
21862186
21872187   if (&screen != m_main_scr)
21882188   {
2189      sscope = machine().root_device().ioport("SEGASCOPE")->read_safe(0x00);
2189      sscope = ioport("SEGASCOPE")->read_safe(0x00);
21902190      if (!sscope)
21912191      {
21922192         // without SegaScope, both LCDs for glasses go black
r20418r20419
22142214      // save a copy of current bitmap for the binocular hack
22152215      if (sscope)
22162216      {
2217         sscope_binocular_hack = machine().root_device().ioport("SSCOPE_BINOCULAR")->read_safe(0x00);
2217         sscope_binocular_hack = ioport("SSCOPE_BINOCULAR")->read_safe(0x00);
22182218
22192219         if (&screen == m_left_lcd)
22202220         {
r20418r20419
22342234      // use the copied bitmap for the binocular hack
22352235      if (sscope)
22362236      {
2237         sscope_binocular_hack = machine().root_device().ioport("SSCOPE_BINOCULAR")->read_safe(0x00);
2237         sscope_binocular_hack = ioport("SSCOPE_BINOCULAR")->read_safe(0x00);
22382238
22392239         if (&screen == m_left_lcd)
22402240         {

Previous 199869 Revisions Next


© 1997-2024 The MAME Team