Previous 199869 Revisions Next

r41670 Monday 9th November, 2015 at 12:50:57 UTC by Ryan Holtz
- Fix PVS-Studio warning V562, "It's odd to compare a bool type value with

 a value of 0/1" [MooglyGuy]
[src/devices/cpu/dsp32]dsp32.cpp
[src/devices/cpu/i8085]i8085.cpp i8085.h
[src/devices/cpu/nec]necinstr.inc
[src/devices/sound]tms5110.cpp tms5220.cpp
[src/lib/formats]upd765_dsk.cpp
[src/mame/drivers]rabbit.cpp vboy.cpp
[src/mame/machine]namcos2.cpp

trunk/src/devices/cpu/dsp32/dsp32.cpp
r250181r250182
344344   {
345345      case STATE_GENFLAGS:
346346         // no actual flags register, so just make something up
347         m_iotemp =  ((zFLAG != 0) << 0) |
348                  ((nFLAG != 0) << 1) |
349                  ((cFLAG != 0) << 2) |
350                  ((vFLAG != 0) << 3) |
351                  ((ZFLAG != 0) << 4) |
352                  ((NFLAG != 0) << 5) |
353                  ((UFLAG != 0) << 6) |
354                  ((VFLAG != 0) << 7);
347         m_iotemp =  (zFLAG ? 0x01 : 0) |
348                  (nFLAG ? 0x02 : 0) |
349                  (cFLAG ? 0x04 : 0) |
350                  (vFLAG ? 0x08 : 0) |
351                  (ZFLAG ? 0x10 : 0) |
352                  (NFLAG ? 0x20 : 0) |
353                  (UFLAG ? 0x40 : 0) |
354                  (VFLAG ? 0x80 : 0);
355355         break;
356356
357357      case DSP32_PCR:
trunk/src/devices/cpu/i8085/i8085.cpp
r250181r250182
916916   m_trap_pending = 0;
917917   m_trap_im_copy = 0;
918918   m_sod_state = 0;
919   m_ietemp = 0;
919   m_ietemp = false;
920920
921921   init_tables();
922922
r250181r250182
10051005   {
10061006      case I8085_SID:
10071007         if (m_ietemp)
1008            m_IM |= IM_SID;
1008            {
1009                m_IM |= IM_SID;
1010            }
10091011         else
1012            {
10101013            m_IM &= ~IM_SID;
1014            }
10111015         break;
10121016
10131017      case I8085_INTE:
10141018         if (m_ietemp)
1019            {
10151020            m_IM |= IM_IE;
1021            }
10161022         else
1023            {
10171024            m_IM &= ~IM_IE;
1025            }
10181026         break;
10191027
10201028      default:
r250181r250182
10281036   switch (entry.index())
10291037   {
10301038      case I8085_SID:
1031         {
1032         int sid = m_in_sid_func();
1033
1034         m_ietemp = ((m_IM & IM_SID) != 0);
1035         m_ietemp = (sid != 0);
1036         }
1039         m_ietemp = ((m_IM & IM_SID) != 0) && m_in_sid_func() != 0;
10371040         break;
10381041
10391042      case I8085_INTE:
trunk/src/devices/cpu/i8085/i8085.h
r250181r250182
116116   UINT8               m_trap_im_copy;   /* copy of IM register when TRAP was taken */
117117   UINT8               m_sod_state;      /* state of the SOD line */
118118
119   UINT8               m_ietemp;         /* import/export temp space */
119   bool                m_ietemp;         /* import/export temp space */
120120
121121   address_space *m_program;
122122   direct_read_data *m_direct;
trunk/src/devices/cpu/nec/necinstr.inc
r250181r250182
571571      case 0x6f:  CLK(2); if (c) do { i_outsw(); c--; } while (c>0); Wreg(CW)=c; break;
572572      case 0xa4:  CLK(2); if (c) do { i_movsb(); c--; } while (c>0); Wreg(CW)=c; break;
573573      case 0xa5:  CLK(2); if (c) do { i_movsw(); c--; } while (c>0); Wreg(CW)=c; break;
574      case 0xa6:  CLK(2); if (c) do { i_cmpsb(); c--; } while (c>0 && ZF==0);    Wreg(CW)=c; break;
575      case 0xa7:  CLK(2); if (c) do { i_cmpsw(); c--; } while (c>0 && ZF==0);    Wreg(CW)=c; break;
574      case 0xa6:  CLK(2); if (c) do { i_cmpsb(); c--; } while (c>0 && !ZF);    Wreg(CW)=c; break;
575      case 0xa7:  CLK(2); if (c) do { i_cmpsw(); c--; } while (c>0 && !ZF);    Wreg(CW)=c; break;
576576      case 0xaa:  CLK(2); if (c) do { i_stosb(); c--; } while (c>0); Wreg(CW)=c; break;
577577      case 0xab:  CLK(2); if (c) do { i_stosw(); c--; } while (c>0); Wreg(CW)=c; break;
578578      case 0xac:  CLK(2); if (c) do { i_lodsb(); c--; } while (c>0); Wreg(CW)=c; break;
579579      case 0xad:  CLK(2); if (c) do { i_lodsw(); c--; } while (c>0); Wreg(CW)=c; break;
580      case 0xae:  CLK(2); if (c) do { i_scasb(); c--; } while (c>0 && ZF==0);    Wreg(CW)=c; break;
581      case 0xaf:  CLK(2); if (c) do { i_scasw(); c--; } while (c>0 && ZF==0);    Wreg(CW)=c; break;
580      case 0xae:  CLK(2); if (c) do { i_scasb(); c--; } while (c>0 && !ZF);    Wreg(CW)=c; break;
581      case 0xaf:  CLK(2); if (c) do { i_scasw(); c--; } while (c>0 && !ZF);    Wreg(CW)=c; break;
582582      default:    logerror("%06x: REPNE invalid\n",PC());    (this->*s_nec_instruction[next])();
583583   }
584584   m_seg_prefix=FALSE;
r250181r250182
598598      case 0x6f:  CLK(2); if (c) do { i_outsw(); c--; } while (c>0); Wreg(CW)=c; break;
599599      case 0xa4:  CLK(2); if (c) do { i_movsb(); c--; } while (c>0); Wreg(CW)=c; break;
600600      case 0xa5:  CLK(2); if (c) do { i_movsw(); c--; } while (c>0); Wreg(CW)=c; break;
601      case 0xa6:  CLK(2); if (c) do { i_cmpsb(); c--; } while (c>0 && ZF==1);    Wreg(CW)=c; break;
602      case 0xa7:  CLK(2); if (c) do { i_cmpsw(); c--; } while (c>0 && ZF==1);    Wreg(CW)=c; break;
601      case 0xa6:  CLK(2); if (c) do { i_cmpsb(); c--; } while (c>0 && ZF);    Wreg(CW)=c; break;
602      case 0xa7:  CLK(2); if (c) do { i_cmpsw(); c--; } while (c>0 && ZF);    Wreg(CW)=c; break;
603603      case 0xaa:  CLK(2); if (c) do { i_stosb(); c--; } while (c>0); Wreg(CW)=c; break;
604604      case 0xab:  CLK(2); if (c) do { i_stosw(); c--; } while (c>0); Wreg(CW)=c; break;
605605      case 0xac:  CLK(2); if (c) do { i_lodsb(); c--; } while (c>0); Wreg(CW)=c; break;
606606      case 0xad:  CLK(2); if (c) do { i_lodsw(); c--; } while (c>0); Wreg(CW)=c; break;
607      case 0xae:  CLK(2); if (c) do { i_scasb(); c--; } while (c>0 && ZF==1);    Wreg(CW)=c; break;
608      case 0xaf:  CLK(2); if (c) do { i_scasw(); c--; } while (c>0 && ZF==1);    Wreg(CW)=c; break;
607      case 0xae:  CLK(2); if (c) do { i_scasb(); c--; } while (c>0 && ZF);    Wreg(CW)=c; break;
608      case 0xaf:  CLK(2); if (c) do { i_scasw(); c--; } while (c>0 && ZF);    Wreg(CW)=c; break;
609609      default:    logerror("%06x: REPE invalid\n",PC()); (this->*s_nec_instruction[next])();
610610   }
611611   m_seg_prefix=FALSE;
trunk/src/devices/sound/tms5110.cpp
r250181r250182
393393             * Old frame was unvoiced, new is voiced
394394             * Old frame was unvoiced, new frame is silence/zero energy (non-existent on tms51xx rev D and F (present and working on tms52xx, present but buggy on tms51xx rev A and B))
395395             */
396            if ( ((OLD_FRAME_UNVOICED_FLAG == 0) && (NEW_FRAME_UNVOICED_FLAG == 1))
397               || ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_UNVOICED_FLAG == 0))
398               || ((OLD_FRAME_SILENCE_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 0)) )
396            if ( ((OLD_FRAME_UNVOICED_FLAG == 0) && NEW_FRAME_UNVOICED_FLAG)
397               || ((OLD_FRAME_UNVOICED_FLAG == 1) && !NEW_FRAME_UNVOICED_FLAG)
398               || ((OLD_FRAME_SILENCE_FLAG == 1) && !NEW_FRAME_SILENCE_FLAG) )
399399               //|| ((m_inhibit == 1) && (OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 1)) ) //TMS51xx INTERP BUG1
400400               //|| ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 1)) )
401401               m_inhibit = 1;
trunk/src/devices/sound/tms5220.cpp
r250181r250182
788788             * Old frame was unvoiced, new is voiced
789789             * Old frame was unvoiced, new frame is silence/zero energy (non-existent on tms51xx rev D and F (present and working on tms52xx, present but buggy on tms51xx rev A and B))
790790             */
791            if ( ((OLD_FRAME_UNVOICED_FLAG == 0) && (NEW_FRAME_UNVOICED_FLAG == 1))
792               || ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_UNVOICED_FLAG == 0))
793               || ((OLD_FRAME_SILENCE_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 0))
791            if ( ((OLD_FRAME_UNVOICED_FLAG == 0) && NEW_FRAME_UNVOICED_FLAG)
792               || ((OLD_FRAME_UNVOICED_FLAG == 1) && !NEW_FRAME_UNVOICED_FLAG)
793               || ((OLD_FRAME_SILENCE_FLAG == 1) && !NEW_FRAME_SILENCE_FLAG)
794794               //|| ((m_inhibit == 1) && (OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 1)) ) //TMS51xx INTERP BUG1
795               || ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 1)) )
795               || ((OLD_FRAME_UNVOICED_FLAG == 1) && NEW_FRAME_SILENCE_FLAG) )
796796               m_inhibit = 1;
797797            else // normal frame, normal interpolation
798798               m_inhibit = 0;
trunk/src/lib/formats/upd765_dsk.cpp
r250181r250182
304304         // Handling enough tracks is better than not
305305         if(cn.track_count >= tracks && cc.track_count < tracks)
306306            goto change;
307         else if(cn.track_count >= tracks && cc.track_count < tracks)
307         else if(cc.track_count >= tracks && cn.track_count < tracks)
308308            goto dont_change;
309309
310310         // Both are on the same side of the track count, so closest is best
trunk/src/mame/drivers/rabbit.cpp
r250181r250182
314314
315315      xflip = (source[0]&0x00008000)>>15;
316316      yflip = (source[0]&0x00004000)>>14;
317      colr = (source[1]&0x0ff00000)>>15;
318317
319
320318      tileno = (source[1]&0x0001ffff);
321319      colr =   (source[1]&0x0ff00000)>>20;
322320
trunk/src/mame/drivers/vboy.cpp
r250181r250182
627627//              attotime new_time = machine().time();
628628
629629//              if((new_time - m_input_latch_time) < m_maincpu->cycles_to_attotime(640))
630               value |= machine().rand() & 2;
630//                  value |= machine().rand() & 2;
631631
632632            value = m_vboy_regs.kcr | 0x4c;
633633         }
trunk/src/mame/machine/namcos2.cpp
r250181r250182
674674INTERRUPT_GEN_MEMBER(namcos2_shared_state::namcos2_68k_gpu_vblank)
675675{
676676   /* only used by namcos21 */
677   int scanline = get_posirq_scanline();
678   scanline = 0x50+0x89; /* HACK for Winning Run */
677   //int scanline = get_posirq_scanline();
678   INT32 scanline = 0x50+0x89; /* HACK for Winning Run */
679679
680680   //printf( "namcos2_68k_gpu_vblank(%d)\n",m_68k_gpu_C148[NAMCOS2_C148_POSIRQ] );
681681   adjust_posirq_timer(scanline);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team