Previous 199869 Revisions Next

r20877 Saturday 9th February, 2013 at 18:31:21 UTC by Angelo Salese
Added INTBACK buffer mechanism, fixes at least Rayman inputs
[src/mame/includes]stv.h
[src/mame/machine]smpc.c

trunk/src/mame/machine/smpc.c
r20876r20877
529529{
530530   saturn_state *state = machine.driver_data<saturn_state>();
531531
532   if(state->m_smpc.IREG[0] != 0)
532   if(state->m_smpc.intback_buf[0] != 0)
533533   {
534534      {
535535         int i;
r20876r20877
560560            state->m_smpc.OREG[16+i]=0xff; // undefined
561561      }
562562
563      state->m_smpc.intback_stage = (state->m_smpc.IREG[1] & 8) >> 3; // first peripheral
563      state->m_smpc.intback_stage = (state->m_smpc.intback_buf[1] & 8) >> 3; // first peripheral
564564      state->m_smpc.SR = 0x40 | state->m_smpc.intback_stage << 5;
565      state->m_smpc.pmode = state->m_smpc.IREG[0]>>4;
565      state->m_smpc.pmode = state->m_smpc.intback_buf[0]>>4;
566566
567567      if(!(state->m_scu.ism & IRQ_SMPC))
568568         state->m_maincpu->set_input_line_and_vector(8, HOLD_LINE, 0x47);
r20876r20877
574574      /* clear hand-shake flag */
575575      state->m_smpc.SF = 0x00;
576576   }
577   else if(state->m_smpc.IREG[1] & 8)
577   else if(state->m_smpc.intback_buf[1] & 8)
578578   {
579      state->m_smpc.intback_stage = (state->m_smpc.IREG[1] & 8) >> 3; // first peripheral
579      state->m_smpc.intback_stage = (state->m_smpc.intback_buf[1] & 8) >> 3; // first peripheral
580580      state->m_smpc.SR = 0x40;
581581      state->m_smpc.OREG[31] = 0x10;
582582      machine.scheduler().timer_set(attotime::from_usec(0), FUNC(intback_peripheral),0);
r20876r20877
702702               timing += 700;
703703
704704            /* TODO: check if IREG[2] is setted to 0xf0 */
705            {
706               int i;
705707
708               for(i=0;i<3;i++)
709                  state->m_smpc.intback_buf[i] = state->m_smpc.IREG[i];
710            }
711
706712            if(LOG_PAD_CMD) printf("INTBACK %02x %02x %d %d\n",state->m_smpc.IREG[0],state->m_smpc.IREG[1],space.machine().primary_screen->vpos(),(int)space.machine().primary_screen->frame_number());
707713            space.machine().scheduler().timer_set(attotime::from_usec(timing), FUNC(saturn_smpc_intback),0); //TODO: is variable time correct?
708714         }
trunk/src/mame/includes/stv.h
r20876r20877
102102      UINT8 SF;
103103      UINT8 SR;
104104      UINT8 IREG[7];
105      UINT8 intback_buf[7];
105106      UINT8 OREG[32];
106107      int   intback_stage;
107108      int   pmode;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team