Previous 199869 Revisions Next

r41671 Monday 9th November, 2015 at 13:52:52 UTC by Ryan Holtz
- Fix PVS-Studio warning V564, "The &/| operator is applied to bool type value.

 You've probably forgotten to include parentheses." [MooglyGuy]
[src/devices/bus/abcbus]lux4105.cpp lux4105.h
[src/devices/bus/c64]easyflash.cpp kingsoft.cpp
[src/devices/bus/nes]nanjing.cpp
[src/devices/bus/wangpc]mvc.cpp
[src/devices/cpu/cubeqcpu]cubeqcpu.cpp
[src/devices/cpu/sh4]sh4dmac.cpp
[src/devices/machine]74181.cpp am9517a.cpp e05a03.cpp i8279.cpp tc009xlvc.cpp
[src/devices/sound]votrax.cpp votrax.h
[src/mame/drivers]d6800.cpp gstream.cpp inder.cpp ptcsol.cpp spinb.cpp st_mp200.cpp
[src/mame/machine]sorcerer.cpp
[src/mame/video]aerofgt.cpp aussiebyte.cpp cosmic.cpp mikromik.cpp

trunk/src/devices/bus/abcbus/lux4105.cpp
r250182r250183
3131{
3232   m_sasi_bsy = state;
3333
34   if (state)
34   if (m_sasi_bsy)
3535   {
3636      m_sasibus->write_sel(0);
3737   }
r250182r250183
141141
142142inline void luxor_4105_device::update_trrq_int()
143143{
144   int cd = !m_sasi_cd;
145   int req = !m_sasi_req;
146   int trrq = !(cd & !req);
144   bool cd = !m_sasi_cd;
145   bool req = !m_sasi_req;
146   int trrq = (cd & !req) ? 0 : 1;
147147
148148   if (BIT(m_dma, 5))
149149   {
r250182r250183
185185   m_cs(false),
186186   m_data(0),
187187   m_dma(0),
188   m_sasi_bsy(0),
189   m_sasi_req(0),
190   m_sasi_cd(0),
191   m_sasi_io(0)
188   m_sasi_bsy(false),
189   m_sasi_req(false),
190   m_sasi_cd(false),
191   m_sasi_io(false)
192192{
193193}
194194
r250182r250183
268268
269269      */
270270
271      data = !m_sasi_bsy;
272      data |= !m_sasi_req << 2;
273      data |= !m_sasi_cd << 3;
274      data |= !m_sasi_io << 6;
271      data = m_sasi_bsy ? 0 : (1 << 0);
272      data |= m_sasi_req ? 0 : (1 << 2);
273      data |= m_sasi_cd ? 0 : (1 << 3);
274      data |= m_sasi_io ? 0 : (1 << 6);
275275   }
276276
277277   return data;
trunk/src/devices/bus/abcbus/lux4105.h
r250182r250183
7878   UINT8 m_dma;
7979
8080   int m_sasi_bsy;
81   int m_sasi_req;
82   int m_sasi_cd;
83   int m_sasi_io;
81   bool m_sasi_req;
82   bool m_sasi_cd;
83   bool m_sasi_io;
8484};
8585
8686
trunk/src/devices/bus/c64/easyflash.cpp
r250182r250183
224224
225225int c64_easyflash_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
226226{
227   return !(BIT(m_mode, 0) | !(BIT(m_mode, 2) | m_jp1->read()));
227   return (BIT(m_mode, 0) || !(BIT(m_mode, 2) || m_jp1->read())) ? 0 : 1;
228228}
trunk/src/devices/bus/c64/kingsoft.cpp
r250182r250183
9494
9595int c64_kingsoft_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
9696{
97   return m_exrom & !(ba & rw & ((offset >= 0x8000 && offset < 0xc000) || (offset >= 0xe000)));
97   return m_exrom & ((ba & rw & ((offset >= 0x8000 && offset < 0xc000) || (offset >= 0xe000))) ? 0 : 1);
9898}
trunk/src/devices/bus/nes/nanjing.cpp
r250182r250183
124124      UINT8 temp = m_count;
125125      m_count = data;
126126
127      if (temp & !data)
128         m_latch2 ^= 0xff;
127      if ((temp & ~data) & 1)
128        {
129            m_latch2 ^= 0xff;
130        }
129131   }
130132
131133   switch (offset & 0x300)
trunk/src/devices/bus/wangpc/mvc.cpp
r250182r250183
111111      for (int bit = 0; bit < 10; bit++)
112112      {
113113         int x = (column * 10) + bit;
114         int color = ((BIT(data, 9) & !ATTR_BLANK) ^ ATTR_REVERSE);
114         int color = ((BIT(data, 9) & ~ATTR_BLANK) ^ ATTR_REVERSE);
115115
116116         if ((color | bitmap.pix32(vbp + y, hbp + x)) & ATTR_BOLD) color = 2;
117117         if (color) bitmap.pix32(vbp + y, hbp + x) = de ? PALETTE_MVC[color] : rgb_t::black;
trunk/src/devices/cpu/cubeqcpu/cubeqcpu.cpp
r250182r250183
10441044      dsrclatch =
10451045            (~(0x10 << dsrc) & 0xf0)
10461046            | (rsrc ? 0x04 : 0x02)
1047            | !(spf == SPF_SWRT);
1047            | (spf == SPF_SWRT ? 0 : 1);
10481048
10491049      /* R-latch is written on rising edge of dsrclatch bit 2 */
10501050      if (!_BIT(m_dsrclatch, 2) && _BIT(dsrclatch, 2))
r250182r250183
14921492         }
14931493
14941494         m_fglatch =
1495               (!(latch == LLATCH_FADLATCH) << 5)
1495               (latch == LLATCH_FADLATCH ? 0 : (1 << 5))
14961496               | (dowrt << 4)
14971497               | (start_stop << 3)
14981498               | (_pbcs << 2)
1499               | (!(spf == LSPF_BRES) << 1)
1500               | !(m_gt0reg && (spf == LSPF_BRES));
1499               | (spf == LSPF_BRES ? 0 : (1 << 1))
1500               | (m_gt0reg && (spf == LSPF_BRES) ? 0 : 1);
15011501      }
15021502      else
15031503      {
trunk/src/devices/cpu/sh4/sh4dmac.cpp
r250182r250183
178178      }
179179      break;
180180   }
181   *sar    = (*sar & !AM) | src;
182   *dar    = (*dar & !AM) | dst;
181   *sar    = (*sar & ~AM) | src;
182   *dar    = (*dar & ~AM) | dst;
183183   *dmatcr = count;
184184   return 1;
185185}
trunk/src/devices/machine/74181.cpp
r250182r250183
7676   int mp = !m_m;
7777
7878   // intermediate calculations
79   int ap0 = !(a0 | (b0 & s0) | (s1 & !b0));
79   int ap0 = !(a0 | (b0 & s0) | (s1 & ~b0));
8080   int bp0 = !(((!b0) & s2 & a0) | (a0 & b0 & s3));
81   int ap1 = !(a1 | (b1 & s0) | (s1 & !b1));
81   int ap1 = !(a1 | (b1 & s0) | (s1 & ~b1));
8282   int bp1 = !(((!b1) & s2 & a1) | (a1 & b1 & s3));
83   int ap2 = !(a2 | (b2 & s0) | (s1 & !b2));
83   int ap2 = !(a2 | (b2 & s0) | (s1 & ~b2));
8484   int bp2 = !(((!b2) & s2 & a2) | (a2 & b2 & s3));
85   int ap3 = !(a3 | (b3 & s0) | (s1 & !b3));
85   int ap3 = !(a3 | (b3 & s0) | (s1 & ~b3));
8686   int bp3 = !(((!b3) & s2 & a3) | (a3 & b3 & s3));
8787
8888   int fp0 = !(m_c & mp) ^ ((!ap0) & bp0);
trunk/src/devices/machine/am9517a.cpp
r250182r250183
151151
152152inline bool am9517a_device::is_request_active(int channel)
153153{
154   return (BIT(m_status, channel + 4) & !BIT(m_mask, channel)) ? true : false;
154   return (BIT(m_status, channel + 4) & ~BIT(m_mask, channel)) ? true : false;
155155}
156156
157157
trunk/src/devices/machine/e05a03.cpp
r250182r250183
118118      break;
119119
120120   /* printhead */
121   case 0x04: m_printhead = (m_printhead & 0x100) | !data; break;
122   case 0x05: m_printhead = (m_printhead & 0x0ff) | (!(BIT(data, 7) << 8)); break;
121    case 0x04: m_printhead = (m_printhead & 0x100) | (data == 0 ? 0xff : 0); break;
122    case 0x05: m_printhead = (m_printhead & 0x0ff) | (BIT(data, 7) ? (1 << 8) : 0); break;
123123
124124   /* paper feed and carriage motor phase data*/
125125   case 0x06: m_pf_motor = (data & 0xf0) >> 4; break;
trunk/src/devices/machine/i8279.cpp
r250182r250183
134134   for (i = 0; i < 8; i++) m_s_ram[i] = 0;
135135   for (i = 0; i < 16; i++) m_d_ram[i] = 0;
136136   m_status = 0;
137   m_autoinc = 1;
137   m_autoinc = true;
138138   m_d_ram_ptr = 0;
139139   m_s_ram_ptr = 0;
140140   m_read_flag = 0;
r250182r250183
374374   // read the display ram
375375      data = m_d_ram[m_d_ram_ptr];
376376      if (m_autoinc)
377        {
377378         m_d_ram_ptr++;
379        }
378380   }
379381   else
380382   if (sensor_mode)
r250182r250183
383385      assert(m_s_ram_ptr < ARRAY_LENGTH(m_s_ram));
384386      data = m_s_ram[m_s_ram_ptr];
385387      if (m_autoinc)
388        {
386389         m_s_ram_ptr++;
390        }
387391      else
392        {
388393         set_irq(0);
394        }
389395   }
390396   else
391397   {
r250182r250183
471477
472478WRITE8_MEMBER( i8279_device::data_w )
473479{//printf("Data: %X ",data);
474   if (BIT(m_cmd[0], 4) & m_autoinc)
480   if (BIT(m_cmd[0], 4) && m_autoinc)
475481   {
476482   // right-entry autoincrement not implemented yet
477483   }
trunk/src/devices/machine/tc009xlvc.cpp
r250182r250183
264264   if(!m_gfxdecode->started())
265265      throw device_missing_dependencies();
266266
267   memset(m_palette_ram, 0, sizeof(m_palette_ram));
268   memset(m_vregs, 0, sizeof(UINT8) * 0x100);
269   memset(m_bitmap_ram, 0, sizeof(UINT8) * 0x20000);
270   memset(m_pcg_ram, 0, sizeof(UINT8) * 0x10000);
271   memset(m_sprram_buffer, 0, sizeof(UINT8) * 0x400);
267   memset(m_palette_ram, 0, ARRAY_LENGTH(m_palette_ram));
268   memset(m_vregs, 0, ARRAY_LENGTH(m_vregs));
269   memset(m_bitmap_ram, 0, ARRAY_LENGTH(m_bitmap_ram));
270   memset(m_pcg_ram, 0, ARRAY_LENGTH(m_pcg_ram));
271   memset(m_sprram_buffer, 0, ARRAY_LENGTH(m_sprram_buffer));
272272
273273   // note, the way tiles are addressed suggests that 0x0000-0x3fff of this might be usable,
274274   //       but we don't map it anywhere, so the first tiles are always blank at the moment.
trunk/src/devices/sound/votrax.cpp
r250182r250183
520520   if (LOG_TIMING)
521521      osd_printf_debug("%4X %4X %4X %4X %4X %4X %4X %4X %4X %4X %4X %4X %4X %4X %4X %4X ", m_master_clock, m_counter_34, m_latch_70, m_latch_72, m_beta1, m_p1, m_p2, m_phi1, m_phi2, m_phi1_20, m_phi2_20, m_subphoneme_count, m_clock_88, m_counter_84, m_latch_92, m_internal_request);
522522   if (LOG_LOWPARAM)
523      osd_printf_debug("%4X %4X %4X %4X %4X ", m_srff_132, m_srff_114, m_srff_112, m_srff_142, m_latch_80);
523      osd_printf_debug("%d %d %d %d %d ", m_srff_132, m_srff_114, m_srff_112, m_srff_142, m_latch_80);
524524   if (LOG_GLOTTAL)
525525      osd_printf_debug("%4X %4X %4X %4X %4X %4X %4X ", m_counter_220, m_counter_222, m_counter_224, m_counter_234, m_counter_236, m_fgate, m_glottal_sync);
526526   if (LOG_TRANSITION)
r250182r250183
651651         {
652652            // if the request line was previously low, reset the VD/CLD flip-flops
653653            if (m_internal_request == CLEAR_LINE)
654               m_srff_112 = m_srff_114 = 0;
654                {
655               m_srff_112 = m_srff_114 = false;
656                }
655657            m_internal_request = ASSERT_LINE;
656658         }
657659
r250182r250183
684686            {
685687               // update CL
686688               case 3:
687                  m_srff_132 = m_srff_114 & BIT(~romdata, 3);
689                  m_srff_132 = m_srff_114 && BIT(~romdata, 3);
688690                  break;
689691
690692               // update CLD
691693               case 4:
692694                  romdata_swapped = (BIT(romdata, 0) << 3) | (BIT(romdata, 1) << 2) | (BIT(romdata, 2) << 1) | (BIT(romdata, 3) << 0);
693695                  if (m_counter_84 != 0 && romdata_swapped == (m_counter_84 ^ 0xf))
694                     m_srff_114 = 1;
696                        {
697                     m_srff_114 = true;
698                        }
695699                  break;
696700
697701               // update VD
698702               case 5:
699703                  romdata_swapped = (BIT(romdata, 0) << 3) | (BIT(romdata, 1) << 2) | (BIT(romdata, 2) << 1) | (BIT(romdata, 3) << 0);
700704                  if (m_counter_84 != 0 && romdata_swapped == (m_counter_84 ^ 0xf))
701                     m_srff_112 = 1;
705                        {
706                     m_srff_112 = true;
707                        }
702708                  break;
703709
704710               // update FF == PAC & (VA | FA)
r250182r250183
840846            // write if not FF and low 2 bits of latch
841847            // FF is the S/R flip-flop at 142 ANDed with !(/FA & /VA)
842848            case 0: case 1: case 2: case 3: case 4:
843               if (!(m_srff_142 & !((m_fa == 0) & (m_va == 0))) && (m_latch_46 & 0x3) == 0x3)
849               if ((m_srff_142 && !((m_fa == 0) && (m_va == 0))) == 0 && (m_latch_46 & 0x3) == 0x3)
844850                  ram_write = 1;
845851               break;
846852
847853            case 5:
848854               if ((m_latch_46 & 0xc) == 0xc && m_srff_112)
855                    {
849856                  ram_write = 1;
857                    }
850858               break;
851859
852860            case 6:
853861               if ((m_latch_46 & 0xc) == 0xc && m_srff_114)
862                    {
854863                  ram_write = 1;
864                    }
855865               break;
856866         }
857867
r250182r250183
12441254   m_latch_92 = 0;
12451255
12461256   // reset low parameter clocking
1247   m_srff_132 = 0;
1248   m_srff_114 = 0;
1249   m_srff_112 = 0;
1250   m_srff_142 = 0;
1257   m_srff_132 = false;
1258   m_srff_114 = false;
1259   m_srff_112 = false;
1260   m_srff_142 = false;
12511261   m_latch_80 = 50;
12521262   update_subphoneme_clock_period();
12531263
trunk/src/devices/sound/votrax.h
r250182r250183
9898   UINT8                       m_latch_92;             // 2-bit latch @ 92
9999
100100   // low parameter clocking
101   UINT8                       m_srff_132;             // S/R flip-flop @ 132
102   UINT8                       m_srff_114;             // S/R flip-flop @ 114
103   UINT8                       m_srff_112;             // S/R flip-flop @ 112
104   UINT8                       m_srff_142;             // S/R flip-flop @ 142
101   bool                        m_srff_132;             // S/R flip-flop @ 132
102   bool                        m_srff_114;             // S/R flip-flop @ 114
103   bool                        m_srff_112;             // S/R flip-flop @ 112
104   bool                        m_srff_142;             // S/R flip-flop @ 142
105105   UINT8                       m_latch_80;             // phoneme timing latch @ 80
106106
107107   // glottal circuit
trunk/src/mame/drivers/d6800.cpp
r250182r250183
282282   */
283283
284284   m_beeper->set_frequency(BIT(data, 0) ? 2400 : 1200);
285   m_beeper->set_state(BIT(data, 6) & m_cb2);
285   m_beeper->set_state(BIT(data, 6) & (m_cb2 ? 1 : 0));
286286
287287   m_portb = data & 0x7f;
288288}
trunk/src/mame/drivers/gstream.cpp
r250182r250183
346346
347347*/
348348
349   m_oki_bank_1 = ((BIT(data, 6) & !BIT(data, 7)) << 1) | (BIT(data, 2) & BIT(data, 3));
350   m_oki_bank_2 = ((BIT(data, 4) & !BIT(data, 5)) << 1) | (BIT(data, 0) & BIT(data, 1));
349   m_oki_bank_1 = ((BIT(data, 6) & ~BIT(data, 7)) << 1) | (BIT(data, 2) & BIT(data, 3));
350   m_oki_bank_2 = ((BIT(data, 4) & ~BIT(data, 5)) << 1) | (BIT(data, 0) & BIT(data, 1));
351351
352352   //popmessage("oki bank = %X\noki_1 = %X\noki_2 = %X\n",data, m_oki_bank_1, m_oki_bank_2);
353353
trunk/src/mame/drivers/inder.cpp
r250182r250183
12721272
12731273READ8_MEMBER( inder_state::ppic_r )
12741274{
1275   return m_pc0 | m_portc;
1275   return (m_pc0 ? 1 : 0) | m_portc;
12761276}
12771277
12781278WRITE8_MEMBER( inder_state::ppia_w )
trunk/src/mame/drivers/ptcsol.cpp
r250182r250183
654654            chr = m_p_videoram[x & 0x3ff];
655655
656656            // cursor
657            if (BIT(chr, 7) & cursor_inv)
657            if (BIT(chr, 7) && cursor_inv)
658658               inv ^= 0xff;
659659
660660            chr &= 0x7f;
trunk/src/mame/drivers/spinb.cpp
r250182r250183
472472
473473READ8_MEMBER( spinb_state::ppia_c_r )
474474{
475   return m_pc0a | m_portc_a;
475   return (m_pc0a ? 1 : 0) | m_portc_a;
476476}
477477
478478READ8_MEMBER( spinb_state::ppim_c_r )
479479{
480   return m_pc0m | m_portc_m;
480   return (m_pc0m ? 1 : 0) | m_portc_m;
481481}
482482
483483WRITE8_MEMBER( spinb_state::ppia_b_w )
trunk/src/mame/drivers/st_mp200.cpp
r250182r250183
438438
439439   if (!m_u10_ca2)
440440   {
441      if (m_7d & BIT(data, 1))
442         m_digit = 6;
443      else
444      if BIT(data, 2)
441      if (m_7d && BIT(data, 1))
442        {
443            m_digit = 6;
444        }
445      else if BIT(data, 2)
446        {
445447         m_digit = 5;
446      else
447      if BIT(data, 3)
448        }
449      else if BIT(data, 3)
450        {
448451         m_digit = 4;
449      else
450      if BIT(data, 4)
452        }
453      else if BIT(data, 4)
454        {
451455         m_digit = 3;
452      else
453      if BIT(data, 5)
456        }
457      else if BIT(data, 5)
458        {
454459         m_digit = 2;
455      else
456      if BIT(data, 6)
460        }
461      else if BIT(data, 6)
462        {
457463         m_digit = 1;
458      else
459      if BIT(data, 7)
464        }
465      else if BIT(data, 7)
466        {
460467         m_digit = 0;
468        }
461469
462470      if (BIT(data, 0) && (m_counter > 8))
463471      {
trunk/src/mame/machine/sorcerer.cpp
r250182r250183
188188      bool sound = BIT(m_iop_config->read(), 3);
189189
190190      m_cassette1->change_state(
191         (BIT(data,4) & sound) ? CASSETTE_SPEAKER_ENABLED : CASSETTE_SPEAKER_MUTED, CASSETTE_MASK_SPEAKER);
191         (BIT(data,4) && sound) ? CASSETTE_SPEAKER_ENABLED : CASSETTE_SPEAKER_MUTED, CASSETTE_MASK_SPEAKER);
192192
193193      m_cassette2->change_state(
194         (BIT(data,5) & sound) ? CASSETTE_SPEAKER_ENABLED : CASSETTE_SPEAKER_MUTED, CASSETTE_MASK_SPEAKER);
194         (BIT(data,5) && sound) ? CASSETTE_SPEAKER_ENABLED : CASSETTE_SPEAKER_MUTED, CASSETTE_MASK_SPEAKER);
195195
196196      /* cassette 1 motor */
197197      m_cassette1->change_state(
trunk/src/mame/video/aerofgt.cpp
r250182r250183
463463
464464      pri = m_spriteram3[attr_start + 2] & 0x0010;
465465
466      if ( chip_disabled_pri & !pri)
466      if ( chip_disabled_pri && !pri)
467467         continue;
468      if ((!chip_disabled_pri) & (pri >> 4))
468      if ((!chip_disabled_pri) && (pri >> 4))
469469         continue;
470470      ox = m_spriteram3[attr_start + 1] & 0x01ff;
471471      xsize = (m_spriteram3[attr_start + 2] & 0x0700) >> 8;
trunk/src/mame/video/aussiebyte.cpp
r250182r250183
156156      gfx = 0;
157157   if BIT(ac_attr, 5) // blank
158158      gfx = 0;
159   if (ac_curs & BIT(ac_cnt, 14)) // cursor
159   if (ac_curs && BIT(ac_cnt, 14)) // cursor
160160      gfx ^= 0xff;
161161   if BIT(ac_attr, 4) // reverse video
162162      gfx ^= 0xff;
trunk/src/mame/video/cosmic.cpp
r250182r250183
469469         if (((!vb_) & vc_ & (!vd_)) ^ (vb_ & (!vc_) & vd_))
470470         {
471471            /* tree */
472            if ((!hd_) & hc_ & (!hb_))
472            if (!hd_ && hc_ && !hb_)
473473            {
474474               offs_t offs = ((x >> 3) & 0x03) | ((y & 0x1f) << 2) |
475475                           (flip_screen() ? 0x80 : 0);
r250182r250183
482482
483483               color = (plane1 & plane2)       |   // R
484484                     (plane2         )  << 1 |   // G
485                     (plane1 & !plane2) << 2;    // B
485                     (plane1 & ~plane2) << 2;    // B
486486            }
487487         }
488488         else
489489         {
490490            /* water */
491            if (hd_ & !hc_ & hb_ & !ha_)
491            if (hd_ && !hc_ && hb_ && !ha_)
492492            {
493493               offs_t offs = hd | (water << 1) | 0x0200;
494494
trunk/src/mame/video/mikromik.cpp
r250182r250183
3636         // Step 3: Fill in missing 2 pixels in the screen bitmap by repeating last column of the char bitmap
3737         // (works better with MikroMikko 1 font than duplicating the first and the last column)
3838         qh = d7 & d6; // extend pixels on the right side only if there were two adjacent ones before shifting out the MSB
39         video_in = ((((d7 & llen) | !vsp) & !gpa0) & qh) | lten;
40         color = (hlt_in ? 1 : 2)*(video_in ^ compl_in);
39         video_in = ((((d7 & llen) | (vsp ? 0 : 1)) & (gpa0 ? 0 : 1)) & qh) | lten;
40         color = (hlt_in ? 1 : 2) * (video_in ^ compl_in);
4141         bitmap.pix32(y, x + 8) = m_palette->pen(color);
4242         bitmap.pix32(y, x + 9) = m_palette->pen(color);
4343      }
r250182r250183
4545      for (i = 0; i < 8; ++i) // ...and now the actual character bitmap bits for this scanline
4646      {
4747         qh = BIT(data, i);
48         video_in = ((((d7 & llen) | !vsp) & !gpa0) & qh) | lten;
48         video_in = ((((d7 & llen) | (vsp ? 0 : 1)) & (gpa0 ? 0 : 1)) & qh) | lten;
4949         color = (hlt_in ? 1 : 2)*(video_in ^ compl_in);
5050         bitmap.pix32(y, x + i) = m_palette->pen(color);
5151      }


Previous 199869 Revisions Next


© 1997-2024 The MAME Team