diff options
author | 2020-11-17 09:18:37 +1100 | |
---|---|---|
committer | 2020-11-17 09:18:37 +1100 | |
commit | ac270744f3066af4cb1d7cdd8c5fa20c126887fe (patch) | |
tree | 578221b642c7b29698dab20ec1816019b508cdbe /src | |
parent | f14e1794d7ab76d0701188ad1b3a8a165d8848a2 (diff) |
Fix most implicit fallthrough warnings from clang
Diffstat (limited to 'src')
45 files changed, 162 insertions, 164 deletions
diff --git a/src/devices/bus/abcbus/ssa.cpp b/src/devices/bus/abcbus/ssa.cpp index bc15c0852cb..c17c2e2a826 100644 --- a/src/devices/bus/abcbus/ssa.cpp +++ b/src/devices/bus/abcbus/ssa.cpp @@ -178,7 +178,7 @@ uint8_t abc_super_smartaid_device::abcbus_xmemfl(offs_t offset) { case 0x08: m_prom_bank = 1; - // fallthru + [[fallthrough]]; case 0x0c: case 0x0f: data = m_rom_2->base()[(m_rom_bank << 12) | (offset & 0xfff)]; break; diff --git a/src/devices/bus/gba/gba_slot.cpp b/src/devices/bus/gba/gba_slot.cpp index 629557768ed..e27488f1cd0 100644 --- a/src/devices/bus/gba/gba_slot.cpp +++ b/src/devices/bus/gba/gba_slot.cpp @@ -659,13 +659,13 @@ image_init_result gba_cart_slot_device::call_load() { case 2 * 1024 * 1024: memcpy(ROM + 0x200000, ROM, 0x200000); - // intentional fall-through + [[fallthrough]]; case 4 * 1024 * 1024: memcpy(ROM + 0x400000, ROM, 0x400000); - // intentional fall-through + [[fallthrough]]; case 8 * 1024 * 1024: memcpy(ROM + 0x800000, ROM, 0x800000); - // intentional fall-through + [[fallthrough]]; case 16 * 1024 * 1024: memcpy(ROM + 0x1000000, ROM, 0x1000000); break; diff --git a/src/devices/bus/sunkbd/hlekbd.cpp b/src/devices/bus/sunkbd/hlekbd.cpp index 96e91a8136f..305d09ef3e2 100644 --- a/src/devices/bus/sunkbd/hlekbd.cpp +++ b/src/devices/bus/sunkbd/hlekbd.cpp @@ -985,6 +985,7 @@ void hle_device_base::received_byte(uint8_t byte) default: assert(m_rx_state == RX_IDLE); + [[fallthrough]]; case RX_IDLE: switch (byte) { diff --git a/src/devices/bus/ti8x/ti8x.cpp b/src/devices/bus/ti8x/ti8x.cpp index 842b9e98678..f8ec86c06a8 100644 --- a/src/devices/bus/ti8x/ti8x.cpp +++ b/src/devices/bus/ti8x/ti8x.cpp @@ -432,6 +432,7 @@ TIMER_CALLBACK_MEMBER(device_ti8x_link_port_bit_interface::bit_timeout) // send timeout: case WAIT_IDLE: assert(EMPTY != m_tx_bit_buffer); + [[fallthrough]]; case WAIT_ACK_0: case WAIT_ACK_1: case WAIT_REL_0: diff --git a/src/devices/cpu/drcbec.cpp b/src/devices/cpu/drcbec.cpp index def49d3b04c..90f9a1adff9 100644 --- a/src/devices/cpu/drcbec.cpp +++ b/src/devices/cpu/drcbec.cpp @@ -540,7 +540,7 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_EXIT, 4, 1): // EXIT src1[,c] if (OPCODE_FAIL_CONDITION(opcode, flags)) break; - // fall through... + [[fallthrough]]; case MAKE_OPCODE_SHORT(OP_EXIT, 4, 0): return PARAM0; @@ -548,7 +548,7 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_JMP, 4, 1): // JMP imm[,c] if (OPCODE_FAIL_CONDITION(opcode, flags)) break; - // fall through... + [[fallthrough]]; case MAKE_OPCODE_SHORT(OP_JMP, 4, 0): newinst = inst[0].inst; @@ -559,7 +559,7 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_CALLH, 4, 1): // CALLH handle[,c] if (OPCODE_FAIL_CONDITION(opcode, flags)) break; - // fall through... + [[fallthrough]]; case MAKE_OPCODE_SHORT(OP_CALLH, 4, 0): assert(sp < ARRAY_LENGTH(callstack)); @@ -572,7 +572,7 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_RET, 4, 1): // RET [c] if (OPCODE_FAIL_CONDITION(opcode, flags)) break; - // fall through... + [[fallthrough]]; case MAKE_OPCODE_SHORT(OP_RET, 4, 0): assert(sp > 0); @@ -584,7 +584,7 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_EXH, 4, 1): // EXH handle,param[,c] if (OPCODE_FAIL_CONDITION(opcode, flags)) break; - // fall through... + [[fallthrough]]; case MAKE_OPCODE_SHORT(OP_EXH, 4, 0): assert(sp < ARRAY_LENGTH(callstack)); @@ -598,7 +598,7 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_CALLC, 4, 1): // CALLC func,ptr[,c] if (OPCODE_FAIL_CONDITION(opcode, flags)) break; - // fall through... + [[fallthrough]]; case MAKE_OPCODE_SHORT(OP_CALLC, 4, 0): (*inst[0].cfunc)(inst[1].v); @@ -833,7 +833,7 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_MOV, 4, 1): // MOV dst,src[,c] if (OPCODE_FAIL_CONDITION(opcode, flags)) break; - // fall through... + [[fallthrough]]; case MAKE_OPCODE_SHORT(OP_MOV, 4, 0): PARAM0 = PARAM1; @@ -1466,7 +1466,7 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_MOV, 8, 1): // DMOV dst,src[,c] if (OPCODE_FAIL_CONDITION(opcode, flags)) break; - // fall through... + [[fallthrough]]; case MAKE_OPCODE_SHORT(OP_MOV, 8, 0): DPARAM0 = DPARAM1; @@ -1837,7 +1837,7 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_FMOV, 4, 1): // FSMOV dst,src[,c] if (OPCODE_FAIL_CONDITION(opcode, flags)) break; - // fall through... + [[fallthrough]]; case MAKE_OPCODE_SHORT(OP_FMOV, 4, 0): FSPARAM0 = FSPARAM1; @@ -1980,7 +1980,7 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_FMOV, 8, 1): // FDMOV dst,src[,c] if (OPCODE_FAIL_CONDITION(opcode, flags)) break; - // fall through... + [[fallthrough]]; case MAKE_OPCODE_SHORT(OP_FMOV, 8, 0): FDPARAM0 = FDPARAM1; diff --git a/src/devices/cpu/dspp/dsppdrc.cpp b/src/devices/cpu/dspp/dsppdrc.cpp index 947c698576f..30be59db09b 100644 --- a/src/devices/cpu/dspp/dsppdrc.cpp +++ b/src/devices/cpu/dspp/dsppdrc.cpp @@ -501,10 +501,10 @@ void dspp_device::generate_set_rbase(drcuml_block &block, compiler_state *compil case 0: UML_MOV(block, mem(&m_core->m_rbase[0]), addr); UML_MOV(block, mem(&m_core->m_rbase[1]), addr + 4 - base); - // Intentional fall-through + [[fallthrough]]; case 8: UML_MOV(block, mem(&m_core->m_rbase[2]), addr + 8 - base); - // Intentional fall-through + [[fallthrough]]; case 12: UML_MOV(block, mem(&m_core->m_rbase[3]), addr + 12 - base); break; diff --git a/src/devices/cpu/hd61700/hd61700.cpp b/src/devices/cpu/hd61700/hd61700.cpp index 88dd1756d72..95f61dc6e84 100644 --- a/src/devices/cpu/hd61700/hd61700.cpp +++ b/src/devices/cpu/hd61700/hd61700.cpp @@ -2578,7 +2578,7 @@ void hd61700_cpu_device::execute_run() m_icount -= 5; } - //fall through + [[fallthrough]]; case 0xfc: //cani { diff --git a/src/devices/cpu/lc8670/lc8670dsm.cpp b/src/devices/cpu/lc8670/lc8670dsm.cpp index bdf8a88e8cc..5a27a0a8f47 100644 --- a/src/devices/cpu/lc8670/lc8670dsm.cpp +++ b/src/devices/cpu/lc8670/lc8670dsm.cpp @@ -107,7 +107,7 @@ void lc8670_disassembler::dasm_arg(uint8_t op, char *buffer, offs_t pc, int arg, break; case OP_R8: pc++; - // fall through + [[fallthrough]]; case OP_R8RI: buffer += sprintf(buffer, "%04x", (pc + 1 + opcodes.r8(pos) - (opcodes.r8(pos)&0x80 ? 0x100 : 0)) & 0xffff); pos++; diff --git a/src/devices/cpu/mips/ps2vif1.cpp b/src/devices/cpu/mips/ps2vif1.cpp index b12c39253e6..43fc71a2267 100644 --- a/src/devices/cpu/mips/ps2vif1.cpp +++ b/src/devices/cpu/mips/ps2vif1.cpp @@ -349,7 +349,7 @@ void ps2_vif1_device::execute_run() m_icount = 0; break; } - // Intentional fall-through + [[fallthrough]]; case STAT_MODE_DECODE: decode_vifcode(); break; @@ -359,7 +359,7 @@ void ps2_vif1_device::execute_run() m_icount = 0; break; } - // Intentional fall-through + [[fallthrough]]; case STAT_MODE_DATA: transfer_vifcode_data(); break; diff --git a/src/devices/cpu/pic17/pic17.cpp b/src/devices/cpu/pic17/pic17.cpp index 67d9caa23b7..99dff413d54 100644 --- a/src/devices/cpu/pic17/pic17.cpp +++ b/src/devices/cpu/pic17/pic17.cpp @@ -890,6 +890,7 @@ void pic17_cpu_device::execute_run() { while (true) { + [[fallthrough]]; case exec_phase::Q1: if ((m_execflags & SLEEP) != 0) { @@ -922,6 +923,7 @@ void pic17_cpu_device::execute_run() m_execphase = exec_phase::Q2; return; } + [[fallthrough]]; case exec_phase::Q2: if ((m_execflags & INTRPT) == 0) @@ -942,6 +944,7 @@ void pic17_cpu_device::execute_run() m_execphase = exec_phase::Q3; return; } + [[fallthrough]]; case exec_phase::Q3: if ((m_execflags & (TABLRD | TABLWT)) == 0) @@ -967,6 +970,7 @@ void pic17_cpu_device::execute_run() m_execphase = exec_phase::Q4; return; } + [[fallthrough]]; case exec_phase::Q4: if ((m_intsample & m_intsta) != 0) diff --git a/src/devices/cpu/score/score.cpp b/src/devices/cpu/score/score.cpp index 0e306b55349..32ab2ae6672 100644 --- a/src/devices/cpu/score/score.cpp +++ b/src/devices/cpu/score/score.cpp @@ -346,7 +346,7 @@ void score7_cpu_device::gen_exception(int cause, uint32_t param) { case EXCEPTION_P_EL: REG_EMA = REG_EPC; - // intentional fallthrough + [[fallthrough]]; case EXCEPTION_NMI: case EXCEPTION_CEE: case EXCEPTION_SYSCALL: diff --git a/src/devices/cpu/sm8500/sm85ops.h b/src/devices/cpu/sm8500/sm85ops.h index 2b4d4763bfe..29ff71d6559 100644 --- a/src/devices/cpu/sm8500/sm85ops.h +++ b/src/devices/cpu/sm8500/sm85ops.h @@ -144,6 +144,7 @@ s2 = s2 + mem_readbyte( ( r1 >> 3 ) & 0x07 ); \ } \ s2 = mem_readword( s2 ); \ + break; \ case 0x80: \ case 0xC0: \ break; \ diff --git a/src/devices/cpu/sparc/sparcdasm.cpp b/src/devices/cpu/sparc/sparcdasm.cpp index d3b7d291087..3de1b2fe6b5 100644 --- a/src/devices/cpu/sparc/sparcdasm.cpp +++ b/src/devices/cpu/sparc/sparcdasm.cpp @@ -721,6 +721,7 @@ sparc_disassembler::sparc_disassembler(const config *conf, unsigned version, vis m_vis_op_desc.find(0x07c)->second.mnemonic = "ford"; m_vis_op_desc.find(0x07e)->second.mnemonic = "foned"; } + [[fallthrough]]; case vis_none: break; } diff --git a/src/devices/cpu/z80/z80dasm.cpp b/src/devices/cpu/z80/z80dasm.cpp index f579fd6d62d..5357f86f661 100644 --- a/src/devices/cpu/z80/z80dasm.cpp +++ b/src/devices/cpu/z80/z80dasm.cpp @@ -497,7 +497,7 @@ offs_t z80_disassembler::disassemble(std::ostream &stream, offs_t pc, const data break; case 'X': offset = params.r8(pos++); - /* fall through */ + [[fallthrough]]; case 'Y': util::stream_format(stream,"(%s%c$%02x)", ixy, sign(offset), offs(offset) ); break; diff --git a/src/devices/machine/am9513.cpp b/src/devices/machine/am9513.cpp index 5e2ddc15a86..9e6a661b18b 100644 --- a/src/devices/machine/am9513.cpp +++ b/src/devices/machine/am9513.cpp @@ -1304,7 +1304,7 @@ void am9513_device::command_write(u8 data) m_write_prefetch = !BIT(data, 0); break; } - // else fall through + [[fallthrough]]; default: logerror("Invalid command: %02X\n", data); break; diff --git a/src/devices/machine/hp_taco.cpp b/src/devices/machine/hp_taco.cpp index f8b712dde7e..6760a7eda01 100644 --- a/src/devices/machine/hp_taco.cpp +++ b/src/devices/machine/hp_taco.cpp @@ -434,7 +434,7 @@ WRITE_LINE_MEMBER(hp_taco_device::tacho_tick_w) if (m_cmd_state != CMD_PH1) { break; } - // Falls through! + [[fallthrough]]; case CMD_WR_GAP_N_TACH: case CMD_INT_N_TACH: diff --git a/src/devices/machine/i8291a.cpp b/src/devices/machine/i8291a.cpp index ca73f500df8..3692ba95a28 100644 --- a/src/devices/machine/i8291a.cpp +++ b/src/devices/machine/i8291a.cpp @@ -432,27 +432,27 @@ void i8291a_device::aux_mode_w(uint8_t data) device_reset(); break; } - case 1: - /* preset internal clock counter */ - break; - case 4: - LOGMASKED(LOG_REG, "AUXA = %02X\n", data & 0x1f); - /* AUXA write */ - m_auxa = data; - break; - case 5: - LOGMASKED(LOG_REG, "AUXB = %02X\n", data & 0x1f); - m_auxb = data; - break; - case 3: - LOGMASKED(LOG_REG, "PPOLL %s (line %d)\n", (data & 0x10) ? "disable" : "enable", data & 7); - m_lpe = !!!(data & 0x10); - m_pp_sense = data & 0x08; - m_pp_line = data & 7; - break; - default: - break; - + break; + case 1: + /* preset internal clock counter */ + break; + case 4: + LOGMASKED(LOG_REG, "AUXA = %02X\n", data & 0x1f); + /* AUXA write */ + m_auxa = data; + break; + case 5: + LOGMASKED(LOG_REG, "AUXB = %02X\n", data & 0x1f); + m_auxb = data; + break; + case 3: + LOGMASKED(LOG_REG, "PPOLL %s (line %d)\n", (data & 0x10) ? "disable" : "enable", data & 7); + m_lpe = !!!(data & 0x10); + m_pp_sense = data & 0x08; + m_pp_line = data & 7; + break; + default: + break; } run_fsm(); } diff --git a/src/devices/machine/icm7170.cpp b/src/devices/machine/icm7170.cpp index 005626b6348..c66d1b6bcc7 100644 --- a/src/devices/machine/icm7170.cpp +++ b/src/devices/machine/icm7170.cpp @@ -305,7 +305,7 @@ void icm7170_device::write(offs_t offset, uint8_t data) case REG_COMMAND: m_timer->enable(data & CMD_REG_RUN); - // fall through + [[fallthrough]]; default: m_regs[offset & 0x1f] = data; diff --git a/src/devices/machine/msm6242.cpp b/src/devices/machine/msm6242.cpp index 0cfe458ed08..f6dd7c6dca7 100644 --- a/src/devices/machine/msm6242.cpp +++ b/src/devices/machine/msm6242.cpp @@ -325,11 +325,11 @@ void msm6242_device::update_timer() { case IRQ_HOUR: callback_ticks += (59 - get_clock_register(RTC_MINUTE)) * (0x8000 * 60); - // fall through + [[fallthrough]]; case IRQ_MINUTE: callback_ticks += (59 - get_clock_register(RTC_SECOND)) * 0x8000; - // fall through + [[fallthrough]]; case IRQ_SECOND: callback_ticks += 0x8000 - m_tick; diff --git a/src/devices/machine/ps2dma.cpp b/src/devices/machine/ps2dma.cpp index 5699d554247..6e143123fb0 100644 --- a/src/devices/machine/ps2dma.cpp +++ b/src/devices/machine/ps2dma.cpp @@ -327,7 +327,7 @@ void ps2_dmac_device::follow_source_tag(uint32_t chan) break; case ID_REFE: channel.set_end_tag(true); - // Intentional fall-through + [[fallthrough]]; case ID_REF: channel.set_addr(addr); channel.set_tag_addr(channel.tag_addr() + 0x10); diff --git a/src/devices/machine/smc91c9x.cpp b/src/devices/machine/smc91c9x.cpp index ee67ce23da2..7d85deee42b 100644 --- a/src/devices/machine/smc91c9x.cpp +++ b/src/devices/machine/smc91c9x.cpp @@ -729,7 +729,7 @@ void smc91c9x_device::process_command(uint16_t data) LOG(" REMOVE AND RELEASE FRAME FROM RX FIFO (PACK_NUM=%d)\n", curr_completed_rx()); // Release memory allocation alloc_release(curr_completed_rx()); - // Fall through + [[fallthrough]]; case ECMD_REMOVE_TOPFRAME_RX: LOG(" REMOVE FRAME FROM RX FIFO\n"); // remove entry from rx completion queue diff --git a/src/devices/machine/spg2xx_io.cpp b/src/devices/machine/spg2xx_io.cpp index cbd63945da2..14cf55d7929 100644 --- a/src/devices/machine/spg2xx_io.cpp +++ b/src/devices/machine/spg2xx_io.cpp @@ -805,7 +805,7 @@ void spg2xx_io_device::io_w(offs_t offset, uint16_t data) case REG_IOA_DATA: case REG_IOB_DATA: case REG_IOC_DATA: offset++; - // Intentional fallthrough - we redirect data register writes to the buffer register. + [[fallthrough]]; // we redirect data register writes to the buffer register. case REG_IOA_BUFFER: case REG_IOA_ATTRIB: case REG_IOB_BUFFER: case REG_IOB_ATTRIB: diff --git a/src/devices/machine/upd765.cpp b/src/devices/machine/upd765.cpp index 85aabb49335..f2eff71730e 100644 --- a/src/devices/machine/upd765.cpp +++ b/src/devices/machine/upd765.cpp @@ -3193,7 +3193,7 @@ void upd72067_device::auxcmd_w(uint8_t data) for(unsigned i = 0; i < 4; i++) if(flopi[i].dev) flopi[i].dev->mon_w(!BIT(data, i + 4)); - // fall through + [[fallthrough]]; case 0x03: // enable external mode case 0x0b: // control internal mode case 0x0f: // select format diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp index edbc92de7d0..9ee468dc412 100644 --- a/src/devices/video/voodoo.cpp +++ b/src/devices/video/voodoo.cpp @@ -3228,7 +3228,7 @@ int32_t voodoo_device::register_w(voodoo_device *vd, offs_t offset, uint32_t dat case fbiInit6: if (vd->vd_type < TYPE_VOODOO_2) break; - /* else fall through... */ + [[fallthrough]]; /* fbiInitX can only be written if initEnable says we can -- Voodoo/Voodoo2 only */ /* most of these affect memory layout, so always recompute that when done */ @@ -5522,7 +5522,7 @@ void voodoo_banshee_device::banshee_io_w(offs_t offset, u32 data, u32 mem_mask) fbi.width = data & 0xfff; if (data & 0xfff000) fbi.height = (data >> 12) & 0xfff; - /* fall through */ + [[fallthrough]]; case io_vidOverlayDudx: case io_vidOverlayDvdy: { diff --git a/src/emu/debug/express.cpp b/src/emu/debug/express.cpp index 27f6dd147c3..b0d72d045ec 100644 --- a/src/emu/debug/express.cpp +++ b/src/emu/debug/express.cpp @@ -1484,7 +1484,7 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *& default: ; // fall through } - // fall through + [[fallthrough]]; default: // check for a symbol match diff --git a/src/lib/formats/aim_dsk.cpp b/src/lib/formats/aim_dsk.cpp index e1c48dabd25..b0b109b15c9 100644 --- a/src/lib/formats/aim_dsk.cpp +++ b/src/lib/formats/aim_dsk.cpp @@ -111,6 +111,7 @@ bool aim_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) raw_w(raw_track_data, 16, 0x8924); raw_w(raw_track_data, 16, 0x5555); data_count = 0; + break; // TELETEXT.AIM and others case 0xff: diff --git a/src/lib/formats/imd_dsk.cpp b/src/lib/formats/imd_dsk.cpp index 631eac9b297..80df5793489 100644 --- a/src/lib/formats/imd_dsk.cpp +++ b/src/lib/formats/imd_dsk.cpp @@ -208,7 +208,7 @@ static floperr_t imd_write_indexed_sector(floppy_image_legacy *floppy, int head, if (err) { return err; } - // Fall through! + [[fallthrough]]; case 1: case 3: diff --git a/src/lib/formats/sol_cas.cpp b/src/lib/formats/sol_cas.cpp index a48a5b918fd..2d60023b23f 100644 --- a/src/lib/formats/sol_cas.cpp +++ b/src/lib/formats/sol_cas.cpp @@ -322,6 +322,7 @@ static int sol20_handle_cassette(int16_t *buffer, const uint8_t *bytes) sol20_scan_to_hex(bytes); } } + [[fallthrough]]; default: // everything else is ignored sol20_scan_to_eol(bytes); break; diff --git a/src/lib/util/msdib.cpp b/src/lib/util/msdib.cpp index a1ae5eaddf0..da6b3d70ce3 100644 --- a/src/lib/util/msdib.cpp +++ b/src/lib/util/msdib.cpp @@ -244,7 +244,7 @@ msdib_error dib_read_bitmap_header( header.core.size); return msdib_error::UNSUPPORTED_FORMAT; } - // fall through + [[fallthrough]]; case 40U: case 52U: case 56U: diff --git a/src/mame/audio/tvc.cpp b/src/mame/audio/tvc.cpp index 84495e0838b..ddae30f94ed 100644 --- a/src/mame/audio/tvc.cpp +++ b/src/mame/audio/tvc.cpp @@ -102,7 +102,7 @@ void tvc_sound_device::write(offs_t offset, uint8_t data) { case 1: m_enabled = BIT(data, 4); - // fall through + [[fallthrough]]; case 0: { diff --git a/src/mame/drivers/ddenlovr.cpp b/src/mame/drivers/ddenlovr.cpp index 7f3d3e7b2a7..a72fd82bdae 100644 --- a/src/mame/drivers/ddenlovr.cpp +++ b/src/mame/drivers/ddenlovr.cpp @@ -980,7 +980,7 @@ int ddenlovr_state::blit_draw( int src, int sx ) default: log_draw_error(src, cmd); - // fall through + [[fallthrough]]; case BLIT_STOP: return ((bit_addr + m_ddenlovr_blit_rom_bits - 1) / m_ddenlovr_blit_rom_bits) & 0xffffff; } @@ -4334,6 +4334,7 @@ void htengoku_state::htengoku_coin_w(uint8_t data) // popmessage("COINS %02x",data); #endif m_coins = data; + break; case 0x0d: break; // ff resets input port sequence? diff --git a/src/mame/drivers/hng64.cpp b/src/mame/drivers/hng64.cpp index d1623804ac0..e306baa3878 100644 --- a/src/mame/drivers/hng64.cpp +++ b/src/mame/drivers/hng64.cpp @@ -710,18 +710,25 @@ LVS-DG2 #include "cpu/z80/z80.h" #include "machine/nvram.h" -#define VERBOSE 1 +#define LOG_GENERAL (1U << 0) +#define LOG_COMRW (1U << 1) +#define LOG_SNDCOM_UNKNWN (1U << 2) +#define LOG_DMA (1U << 3) +#define LOG_VREGS (1U << 4) + +#define VERBOSE (LOG_GENERAL) #include "logmacro.h" -uint32_t hng64_state::hng64_com_r(offs_t offset) + +uint32_t hng64_state::hng64_com_r(offs_t offset, uint32_t mem_mask) { - //LOG("com read (PC=%08x): %08x %08x = %08x\n", m_maincpu->pc(), (offset*4)+0xc0000000, mem_mask, m_idt7133_dpram[offset]); + LOGMASKED(LOG_COMRW, "com read (PC=%08x): %08x %08x = %08x\n", m_maincpu->pc(), (offset*4)+0xc0000000, mem_mask, m_idt7133_dpram[offset]); return m_idt7133_dpram[offset]; } void hng64_state::hng64_com_w(offs_t offset, uint32_t data, uint32_t mem_mask) { - //LOG("com write (PC=%08x): %08x %08x = %08x\n", m_maincpu->pc(), (offset*4)+0xc0000000, mem_mask, data); + LOGMASKED(LOG_COMRW, "com write (PC=%08x): %08x %08x = %08x\n", m_maincpu->pc(), (offset*4)+0xc0000000, mem_mask, data); COMBINE_DATA(&m_idt7133_dpram[offset]); } @@ -776,7 +783,7 @@ void hng64_state::do_dma(address_space &space) { // check if this determines how long the crosshatch is visible for, we might need to put it on a timer. - //printf("Performing DMA Start %08x Len %08x Dst %08x\n", m_dma_start, m_dma_len, m_dma_dst); + LOGMASKED(LOG_DMA, "Performing DMA Start %08x Len %08x Dst %08x\n", m_dma_start, m_dma_len, m_dma_dst); while (m_dma_len >= 0) { uint32_t dat; @@ -1049,7 +1056,7 @@ void hng64_state::hng64_sprite_clear_odd_w(offs_t offset, uint32_t data, uint32_ void hng64_state::hng64_vregs_w(offs_t offset, uint32_t data, uint32_t mem_mask) { -// printf("hng64_vregs_w %02x, %08x %08x\n", offset * 4, data, mem_mask); + LOGMASKED(LOG_DMA, "hng64_vregs_w %02x, %08x %08x\n", offset * 4, data, mem_mask); COMBINE_DATA(&m_videoregs[offset]); } @@ -1062,7 +1069,7 @@ uint16_t hng64_state::main_sound_comms_r(offs_t offset) case 0x06: return sound_latch[1]; default: - //printf("%08x R\n",offset*2); + LOGMASKED(LOG_SNDCOM_UNKNWN, "%08x R\n",offset*2); break; } return 0; @@ -1081,10 +1088,10 @@ void hng64_state::main_sound_comms_w(offs_t offset, uint16_t data, uint16_t mem_ case 0x08: m_audiocpu->set_input_line(5, (data & 1) ? ASSERT_LINE : CLEAR_LINE); if(data & 0xfe) - //printf("IRQ send %02x?\n",data); + LOGMASKED(LOG_SNDCOM_UNKNWN, "IRQ send %02x?\n",data); break; default: - //printf("%02x %04x\n",offset*2,data); + LOGMASKED(LOG_SNDCOM_UNKNWN, "%02x %04x\n",offset*2,data); break; } } diff --git a/src/mame/drivers/hp9845.cpp b/src/mame/drivers/hp9845.cpp index 935da2f459c..ce87c4ca60c 100644 --- a/src/mame/drivers/hp9845.cpp +++ b/src/mame/drivers/hp9845.cpp @@ -2093,7 +2093,7 @@ uint16_t hp9845c_state::graphic_r(offs_t offset) case 2: // R6: data register with DMA TC m_gv_dma_en = false; - // Intentional fall-through + [[fallthrough]]; case 0: // R4: data register @@ -2785,7 +2785,7 @@ uint16_t hp9845t_state::graphic_r(offs_t offset) case 2: // R6: data register with DMA TC m_gv_dma_en = false; - // Intentional fall-through + [[fallthrough]]; case 0: // R4: data register diff --git a/src/mame/drivers/huebler.cpp b/src/mame/drivers/huebler.cpp index 56b5748d3d3..3ae27bb4d3c 100644 --- a/src/mame/drivers/huebler.cpp +++ b/src/mame/drivers/huebler.cpp @@ -286,6 +286,7 @@ WRITE_LINE_MEMBER(amu880_state::ctc_z2_w) break; case 6: m_sio->rxa_w((m_cassette->input() > 0.04) ? 1 : 0); + break; default: break; } diff --git a/src/mame/drivers/kas89.cpp b/src/mame/drivers/kas89.cpp index 440568b8ac1..4b7968e29e8 100644 --- a/src/mame/drivers/kas89.cpp +++ b/src/mame/drivers/kas89.cpp @@ -303,19 +303,19 @@ uint8_t kas89_state::mux_r() { switch(m_mux_data) { - case 0x01: return m_pl[0]->read(); - case 0x02: return m_pl[1]->read(); - case 0x04: return m_pl[2]->read(); - case 0x08: return m_pl[3]->read(); - case 0x10: return m_pl[4]->read(); - case 0x20: return m_pl[5]->read(); - case 0x40: + case 0x01: return m_pl[0]->read(); + case 0x02: return m_pl[1]->read(); + case 0x04: return m_pl[2]->read(); + case 0x08: return m_pl[3]->read(); + case 0x10: return m_pl[4]->read(); + case 0x20: return m_pl[5]->read(); + case 0x40: { m_lamps[37] = BIT(~m_svc->read(), 5); // Operator Key LAMP return m_svc->read(); } - case 0x80: return m_dsw->read(); // Polled at $162a through NMI routine - case 0x3f: return m_unk->read(); + case 0x80: return m_dsw->read(); // Polled at $162a through NMI routine + case 0x3f: return m_unk->read(); } logerror("Mux_data %02X\n", m_mux_data); @@ -420,91 +420,66 @@ void kas89_state::led_mux_select_w(uint8_t data) m_leds_mux_selector = data; - uint8_t i; for ( uint8_t i = 0; i < 37; i++ ) { m_lamps[i] = 0; // All LEDs OFF } - switch(data) + if (BIT(data, 0)) { - case 0x00: - { - for ( i = 0; i < 37; i++ ) - { - m_lamps[i] = 0; // All LEDs OFF - } - } - - case 0x01: - { - m_lamps[11] = BIT(m_leds_mux_data, 0); // Number 11 LED - m_lamps[36] = BIT(m_leds_mux_data, 1); // Number 36 LED - m_lamps[13] = BIT(m_leds_mux_data, 2); // Number 13 LED - m_lamps[27] = BIT(m_leds_mux_data, 3); // Number 27 LED - m_lamps[06] = BIT(m_leds_mux_data, 4); // Number 6 LED - m_lamps[34] = BIT(m_leds_mux_data, 5); // Number 34 LED - m_lamps[17] = BIT(m_leds_mux_data, 6); // Number 17 LED - m_lamps[25] = BIT(m_leds_mux_data, 7); // Number 25 LED - break; - } - - case 0x02: - { - m_lamps[ 2] = BIT(m_leds_mux_data, 0); // Number 2 LED - m_lamps[21] = BIT(m_leds_mux_data, 1); // Number 21 LED - m_lamps[ 4] = BIT(m_leds_mux_data, 2); // Number 4 LED - m_lamps[19] = BIT(m_leds_mux_data, 3); // Number 19 LED - m_lamps[15] = BIT(m_leds_mux_data, 4); // Number 15 LED - m_lamps[32] = BIT(m_leds_mux_data, 5); // Number 32 LED - m_lamps[ 0] = BIT(m_leds_mux_data, 6); // Number 0 LED - m_lamps[26] = BIT(m_leds_mux_data, 7); // Number 26 LED - break; - } + m_lamps[11] = BIT(m_leds_mux_data, 0); // Number 11 LED + m_lamps[36] = BIT(m_leds_mux_data, 1); // Number 36 LED + m_lamps[13] = BIT(m_leds_mux_data, 2); // Number 13 LED + m_lamps[27] = BIT(m_leds_mux_data, 3); // Number 27 LED + m_lamps[ 6] = BIT(m_leds_mux_data, 4); // Number 6 LED + m_lamps[34] = BIT(m_leds_mux_data, 5); // Number 34 LED + m_lamps[17] = BIT(m_leds_mux_data, 6); // Number 17 LED + m_lamps[25] = BIT(m_leds_mux_data, 7); // Number 25 LED + } - case 0x04: - { - m_lamps[ 3] = BIT(m_leds_mux_data, 0); // Number 3 LED - m_lamps[35] = BIT(m_leds_mux_data, 1); // Number 35 LED - m_lamps[12] = BIT(m_leds_mux_data, 2); // Number 12 LED - m_lamps[28] = BIT(m_leds_mux_data, 3); // Number 28 LED - m_lamps[ 7] = BIT(m_leds_mux_data, 4); // Number 7 LED - m_lamps[29] = BIT(m_leds_mux_data, 5); // Number 29 LED - m_lamps[18] = BIT(m_leds_mux_data, 6); // Number 18 LED - break; - } + if (BIT(data, 1)) + { + m_lamps[ 2] = BIT(m_leds_mux_data, 0); // Number 2 LED + m_lamps[21] = BIT(m_leds_mux_data, 1); // Number 21 LED + m_lamps[ 4] = BIT(m_leds_mux_data, 2); // Number 4 LED + m_lamps[19] = BIT(m_leds_mux_data, 3); // Number 19 LED + m_lamps[15] = BIT(m_leds_mux_data, 4); // Number 15 LED + m_lamps[32] = BIT(m_leds_mux_data, 5); // Number 32 LED + m_lamps[ 0] = BIT(m_leds_mux_data, 6); // Number 0 LED + m_lamps[26] = BIT(m_leds_mux_data, 7); // Number 26 LED + } - case 0x08: - { - m_lamps[22] = BIT(m_leds_mux_data, 0); // Number 22 LED - m_lamps[ 9] = BIT(m_leds_mux_data, 1); // Number 9 LED - m_lamps[31] = BIT(m_leds_mux_data, 2); // Number 31 LED - m_lamps[14] = BIT(m_leds_mux_data, 3); // Number 14 LED - m_lamps[20] = BIT(m_leds_mux_data, 4); // Number 20 LED - m_lamps[ 1] = BIT(m_leds_mux_data, 5); // Number 1 LED - m_lamps[33] = BIT(m_leds_mux_data, 6); // Number 33 LED - break; - } + if (BIT(data, 2)) + { + m_lamps[ 3] = BIT(m_leds_mux_data, 0); // Number 3 LED + m_lamps[35] = BIT(m_leds_mux_data, 1); // Number 35 LED + m_lamps[12] = BIT(m_leds_mux_data, 2); // Number 12 LED + m_lamps[28] = BIT(m_leds_mux_data, 3); // Number 28 LED + m_lamps[ 7] = BIT(m_leds_mux_data, 4); // Number 7 LED + m_lamps[29] = BIT(m_leds_mux_data, 5); // Number 29 LED + m_lamps[18] = BIT(m_leds_mux_data, 6); // Number 18 LED + } - case 0x10: - { - m_lamps[16] = BIT(m_leds_mux_data, 0); // Number 16 LED - m_lamps[24] = BIT(m_leds_mux_data, 1); // Number 24 LED - m_lamps[ 5] = BIT(m_leds_mux_data, 2); // Number 5 LED - m_lamps[10] = BIT(m_leds_mux_data, 3); // Number 10 LED - m_lamps[23] = BIT(m_leds_mux_data, 4); // Number 23 LED - m_lamps[ 8] = BIT(m_leds_mux_data, 5); // Number 8 LED - m_lamps[30] = BIT(m_leds_mux_data, 6); // Number 30 LED - break; - } + if (BIT(data, 3)) + { + m_lamps[22] = BIT(m_leds_mux_data, 0); // Number 22 LED + m_lamps[ 9] = BIT(m_leds_mux_data, 1); // Number 9 LED + m_lamps[31] = BIT(m_leds_mux_data, 2); // Number 31 LED + m_lamps[14] = BIT(m_leds_mux_data, 3); // Number 14 LED + m_lamps[20] = BIT(m_leds_mux_data, 4); // Number 20 LED + m_lamps[ 1] = BIT(m_leds_mux_data, 5); // Number 1 LED + m_lamps[33] = BIT(m_leds_mux_data, 6); // Number 33 LED + } - case 0xff: - { - for ( i = 0; i < 37; i++ ) - { - m_lamps[i] = 1; // All LEDs ON - } - } + if (BIT(data, 4)) + { + m_lamps[16] = BIT(m_leds_mux_data, 0); // Number 16 LED + m_lamps[24] = BIT(m_leds_mux_data, 1); // Number 24 LED + m_lamps[ 5] = BIT(m_leds_mux_data, 2); // Number 5 LED + m_lamps[10] = BIT(m_leds_mux_data, 3); // Number 10 LED + m_lamps[23] = BIT(m_leds_mux_data, 4); // Number 23 LED + m_lamps[ 8] = BIT(m_leds_mux_data, 5); // Number 8 LED + m_lamps[30] = BIT(m_leds_mux_data, 6); // Number 30 LED } } diff --git a/src/mame/drivers/spectrum.cpp b/src/mame/drivers/spectrum.cpp index 02006d75923..df9c72196e5 100644 --- a/src/mame/drivers/spectrum.cpp +++ b/src/mame/drivers/spectrum.cpp @@ -721,7 +721,8 @@ void spectrum_state::init_spectrum() switch (m_ram->size()) { case 48*1024: - m_specmem->space(AS_PROGRAM).install_ram(0x8000, 0xffff, nullptr); // Fall through + m_specmem->space(AS_PROGRAM).install_ram(0x8000, 0xffff, nullptr); + [[fallthrough]]; case 16*1024: m_specmem->space(AS_PROGRAM).install_ram(0x5b00, 0x7fff, nullptr); } diff --git a/src/mame/drivers/svision.cpp b/src/mame/drivers/svision.cpp index 41aebc4abee..ac21a4fef14 100644 --- a/src/mame/drivers/svision.cpp +++ b/src/mame/drivers/svision.cpp @@ -30,7 +30,7 @@ TIMER_CALLBACK_MEMBER(svision_state::svision_pet_timer) { m_pet.input = m_joy2->read(); } - /* fall through */ + [[fallthrough]]; case 0x02: case 0x04: case 0x06: case 0x08: case 0x0a: case 0x0c: case 0x0e: diff --git a/src/mame/drivers/x07.cpp b/src/mame/drivers/x07.cpp index 87fa7b56c7e..7d7ee3271a9 100644 --- a/src/mame/drivers/x07.cpp +++ b/src/mame/drivers/x07.cpp @@ -1135,7 +1135,7 @@ uint8_t x07_state::x07_io_r(offs_t offset) break; case 0xf6: if (m_cass_motor) m_regs_r[6] |= 4; - //fall through + [[fallthrough]]; case 0xf0: case 0xf1: case 0xf3: diff --git a/src/mame/includes/hng64.h b/src/mame/includes/hng64.h index c427550a139..24aa0356fc1 100644 --- a/src/mame/includes/hng64.h +++ b/src/mame/includes/hng64.h @@ -326,7 +326,7 @@ private: float m_lightStrength; float m_lightVector[3]; - uint32_t hng64_com_r(offs_t offset); + uint32_t hng64_com_r(offs_t offset, uint32_t mem_mask = ~0); void hng64_com_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); void hng64_com_share_w(offs_t offset, uint8_t data); uint8_t hng64_com_share_r(offs_t offset); diff --git a/src/mame/machine/iteagle_fpga.cpp b/src/mame/machine/iteagle_fpga.cpp index f2777289df5..52278b7bf90 100644 --- a/src/mame/machine/iteagle_fpga.cpp +++ b/src/mame/machine/iteagle_fpga.cpp @@ -911,6 +911,7 @@ void iteagle_periph_device::ctrl_w(offs_t offset, uint32_t data, uint32_t mem_ma if (ACCESSING_BITS_8_15) { m_rtc_regs[m_ctrl_regs[0x70/4]&0xff] = (data>>8)&0xff; } + break; default: break; } diff --git a/src/mame/machine/rmnimbus.cpp b/src/mame/machine/rmnimbus.cpp index 26b01f195b6..660ab45e42c 100644 --- a/src/mame/machine/rmnimbus.cpp +++ b/src/mame/machine/rmnimbus.cpp @@ -1075,6 +1075,7 @@ uint8_t rmnimbus_state::scsi_r(offs_t offset) case 0x08 : result = m_scsi_data_in->read(); hdc_post_rw(); + break; default: break; } diff --git a/src/mame/video/dkong.cpp b/src/mame/video/dkong.cpp index 91dbfba9031..8ebac51dbfb 100644 --- a/src/mame/video/dkong.cpp +++ b/src/mame/video/dkong.cpp @@ -945,7 +945,7 @@ VIDEO_START_MEMBER(dkong_state,dkong) m_screen->register_screen_bitmap(m_bg_bits); m_gfx3 = memregion("gfx3")->base(); m_gfx3_len = memregion("gfx3")->bytes(); - /* fall through */ + [[fallthrough]]; case HARDWARE_TKG04: case HARDWARE_TKG02: m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dkong_state::dkong_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); diff --git a/src/mame/video/k007342.cpp b/src/mame/video/k007342.cpp index 24910b52bfa..6538ad00800 100644 --- a/src/mame/video/k007342.cpp +++ b/src/mame/video/k007342.cpp @@ -169,6 +169,7 @@ void k007342_device::vreg_w(offs_t offset, uint8_t data) break; case 0x06: /* scroll y (register 1) */ m_scrolly[1] = data; + break; case 0x07: /* unused */ break; } diff --git a/src/mame/video/rmnimbus.cpp b/src/mame/video/rmnimbus.cpp index 4798f151c98..eba5386cef6 100644 --- a/src/mame/video/rmnimbus.cpp +++ b/src/mame/video/rmnimbus.cpp @@ -22,13 +22,13 @@ operation by disassembling the Nimbus bios and by writing experemental code on the real machine. */ - -#include <functional> - #include "emu.h" +#include "includes/rmnimbus.h" + #include "debugger.h" #include "debug/debugcon.h" -#include "includes/rmnimbus.h" + +#include <functional> #define WIDTH_MASK 0x07 diff --git a/src/osd/modules/input/input_sdlcommon.cpp b/src/osd/modules/input/input_sdlcommon.cpp index a227fa9f46f..73073ead5ae 100644 --- a/src/osd/modules/input/input_sdlcommon.cpp +++ b/src/osd/modules/input/input_sdlcommon.cpp @@ -122,7 +122,7 @@ void sdl_event_manager::process_window_event(running_machine &machine, SDL_Event case SDL_WINDOWEVENT_ENTER: m_mouse_over_window = 1; - /* fall through */ + [[fallthrough]]; case SDL_WINDOWEVENT_FOCUS_GAINED: case SDL_WINDOWEVENT_EXPOSED: case SDL_WINDOWEVENT_MAXIMIZED: |