Previous 199869 Revisions Next

r20921 Monday 11th February, 2013 at 01:18:44 UTC by Angelo Salese
Fixed TH Control Method when TR is active, fixes input detection in 3D Lemmings
[src/mame/machine]scudsp.c smpc.c

trunk/src/mame/machine/smpc.c
r20920r20921
864864   const char *const padnames[] = { "JOY1", "JOY2" };
865865   UINT8 res = 0;
866866
867   th = (pad_n == 0) ? ((m_smpc.PDR1>>6) & 1) : ((m_smpc.PDR2>>6) & 1);
867   th = (pad_n == 0) ? ((m_smpc.PDR1>>5) & 3) : ((m_smpc.PDR2>>6) & 3);
868868
869869   if (LOG_SMPC) printf("SMPC: SH-2 TH control mode, returning pad data %d for phase %d\n",pad_n+1, th);
870870
871871   switch(th)
872872   {
873      case 1:
874         res = th<<7;
873      /* TODO: 3D Lemmings bogusly enables TH Control mode, wants this to return the ID, needs HW tests.  */
874      case 3:
875         res = th<<6;
876         res |= 0x14;
877         res |= machine().root_device().ioport(padnames[pad_n])->read() & 8; // L
878         break;
879      case 2:
880         res = th<<6;
875881         //   1 C B Right Left Down Up
876882         res|= (((machine().root_device().ioport(padnames[pad_n])->read()>>4)) & 0x30); // C & B
877883         res|= (((machine().root_device().ioport(padnames[pad_n])->read()>>12)) & 0xf);
878884         break;
885      case 1:
886         res = th<<6;
887         res |= 0x10;
888         res |= (machine().root_device().ioport(padnames[pad_n])->read()>>4) & 0xf; // R, X, Y, Z
889         break;
879890      case 0:
880         res = th<<7;
891         res = th<<6;
881892         //  0 Start A 0 0    Down Up
882893         res|= (((machine().root_device().ioport(padnames[pad_n])->read()>>6)) & 0x30); // Start & A
883894         res|= (((machine().root_device().ioport(padnames[pad_n])->read()>>12)) & 0x3);
r20920r20921
9971008      m_smpc.SF = data & 1; // hand-shake flag
9981009
9991010   if(offset == 0x75)  // PDR1
1000      m_smpc.PDR1 = (data & m_smpc.DDR1);
1011      m_smpc.PDR1 = data & 0x7f;
10011012
10021013   if(offset == 0x77)  // PDR2
1003      m_smpc.PDR2 = (data & m_smpc.DDR2);
1014      m_smpc.PDR2 = data & 0x7f;
10041015
10051016   if(offset == 0x79)
10061017      m_smpc.DDR1 = data & 0x7f;
trunk/src/mame/machine/scudsp.c
r20920r20921
431431      case 0x2:   /* OR */
432432         i3 = dsp_reg.acl.si | dsp_reg.pl.si;
433433         dsp_reg.alu = (UINT64)(UINT32)i3;
434         /* TODO: Croc and some early Psygnosis games wants Z to be 1 when the result of this one is negative.
435                  Needs HW tests ... */
436         if(i3 < 0)
437            i3 = 0;
434438         SET_Z(i3 == 0);
435439         SET_C(0);
436440         SET_S(i3 < 0);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team