diff options
author | 2016-06-16 14:16:28 +0200 | |
---|---|---|
committer | 2016-06-16 14:21:44 +0200 | |
commit | 7099d6eaa22b8958f133b4f9eec6a8705a30b2d8 (patch) | |
tree | 476d5293b8a59637cfd0c8fcade96f483b59f548 /src | |
parent | 8c87ea208c9cfcf33cf3fd71bb71b5a812819120 (diff) |
gcc 6.1.1 warning fixes (nw)
Diffstat (limited to 'src')
38 files changed, 269 insertions, 174 deletions
diff --git a/src/devices/cpu/asap/asapdasm.cpp b/src/devices/cpu/asap/asapdasm.cpp index 676ba850228..fd204c68a94 100644 --- a/src/devices/cpu/asap/asapdasm.cpp +++ b/src/devices/cpu/asap/asapdasm.cpp @@ -90,7 +90,8 @@ CPU_DISASSEMBLE( asap ) else if (rsrc2_iszero) sprintf(buffer, "mov%s %s,%s", setcond[cond], reg[rsrc1], reg[rdst]); else - sprintf(buffer, "add%s %s,%s,%s", setcond[cond], reg[rsrc1], src2(op,0), reg[rdst]); break; + sprintf(buffer, "add%s %s,%s,%s", setcond[cond], reg[rsrc1], src2(op,0), reg[rdst]); + break; case 0x09: sprintf(buffer, "sub%s %s,%s,%s", setcond[cond], reg[rsrc1], src2(op,0), reg[rdst]); break; case 0x0a: sprintf(buffer, "addc%s %s,%s,%s", setcond[cond], reg[rsrc1], src2(op,0), reg[rdst]); break; case 0x0b: sprintf(buffer, "subc%s %s,%s,%s", setcond[cond], reg[rsrc1], src2(op,0), reg[rdst]); break; @@ -103,7 +104,8 @@ CPU_DISASSEMBLE( asap ) else if (rsrc2_iszero) sprintf(buffer, "mov%s %s,%s", setcond[cond], reg[rsrc1], reg[rdst]); else - sprintf(buffer, "or%s %s,%s,%s", setcond[cond], reg[rsrc1], src2(op,0), reg[rdst]); break; + sprintf(buffer, "or%s %s,%s,%s", setcond[cond], reg[rsrc1], src2(op,0), reg[rdst]); + break; case 0x0f: sprintf(buffer, "orn%s %s,%s,%s", setcond[cond], reg[rsrc1], src2(op,0), reg[rdst]); break; case 0x10: sprintf(buffer, "ld%s %s[%s],%s", setcond[cond], reg[rsrc1], src2(op,2), reg[rdst]); break; case 0x11: sprintf(buffer, "ldh%s %s[%s],%s", setcond[cond], reg[rsrc1], src2(op,1), reg[rdst]); break; @@ -137,7 +139,7 @@ CPU_DISASSEMBLE( asap ) } else sprintf(buffer, "jmp%s %s[%s]", setcond[cond], reg[rsrc1], src2(op,2)); - break; + break; case 0x1f: sprintf(buffer, "trap $1f"); flags = DASMFLAG_STEP_OVER; break; } return 4 | flags | DASMFLAG_SUPPORTED; diff --git a/src/devices/cpu/h8/h8make.py b/src/devices/cpu/h8/h8make.py index 2115bc01cbe..e5aee1dbb96 100644 --- a/src/devices/cpu/h8/h8make.py +++ b/src/devices/cpu/h8/h8make.py @@ -57,7 +57,7 @@ def save_full_one(f, t, name, source): print(line, file=f) substate += 1 elif has_eat(line): - print("\tif(icount) icount = bcount; inst_substate = %d; return;" % substate, file=f) + print("\tif(icount) { icount = bcount; } inst_substate = %d; return;" % substate, file=f) substate += 1 else: print(line, file=f) @@ -77,7 +77,7 @@ def save_partial_one(f, t, name, source): print(line, file=f) substate += 1 elif has_eat(line): - print("\tif(icount) icount = bcount; inst_substate = %d; return;" % substate, file=f) + print("\tif(icount) { icount = bcount; } inst_substate = %d; return;" % substate, file=f) print("case %d:;" % substate, file=f) substate += 1 else: diff --git a/src/devices/cpu/mcs48/mcs48dsm.cpp b/src/devices/cpu/mcs48/mcs48dsm.cpp index 9e2a080430c..dd63846ab57 100644 --- a/src/devices/cpu/mcs48/mcs48dsm.cpp +++ b/src/devices/cpu/mcs48/mcs48dsm.cpp @@ -24,7 +24,8 @@ static UINT32 common_dasm(device_t *device, char *buffer, offs_t pc, const UINT8 case 0x02: if (!upi41) sprintf(buffer, "out bus,a"); else - sprintf(buffer, "out dbb,a"); break; + sprintf(buffer, "out dbb,a"); + break; case 0x03: sprintf(buffer, "add a,#$%02X", *opram++); break; case 0x04: sprintf(buffer, "jmp $0%02X", *opram++); break; case 0x05: sprintf(buffer, "en i"); break; @@ -32,7 +33,8 @@ static UINT32 common_dasm(device_t *device, char *buffer, offs_t pc, const UINT8 case 0x08: if (!upi41) sprintf(buffer, "in a,bus"); else - sprintf(buffer, "illegal"); break; + sprintf(buffer, "illegal"); + break; case 0x09: sprintf(buffer, "in a,p1"); break; case 0x0a: sprintf(buffer, "in a,p2"); break; case 0x0c: sprintf(buffer, "movd a,p4"); break; @@ -60,7 +62,8 @@ static UINT32 common_dasm(device_t *device, char *buffer, offs_t pc, const UINT8 case 0x22: if (!upi41) sprintf(buffer, "illegal"); else - sprintf(buffer, "in a,dbb"); break; + sprintf(buffer, "in a,dbb"); + break; case 0x23: sprintf(buffer, "mov a,#$%02X", *opram++); break; case 0x24: sprintf(buffer, "jmp $1%02X", *opram++); break; case 0x25: sprintf(buffer, "en tcnti"); break; @@ -140,7 +143,8 @@ static UINT32 common_dasm(device_t *device, char *buffer, offs_t pc, const UINT8 case 0x75: if (!upi41) sprintf(buffer, "ent0 clk"); else - sprintf(buffer, "illegal"); break; + sprintf(buffer, "illegal"); + break; case 0x76: sprintf(buffer, "jf1 $%03X", (pc & 0xf00) | *opram++); break; case 0x77: sprintf(buffer, "rr a"); break; case 0x78: sprintf(buffer, "addc a,r0"); break; @@ -154,22 +158,26 @@ static UINT32 common_dasm(device_t *device, char *buffer, offs_t pc, const UINT8 case 0x80: if (!upi41) sprintf(buffer, "movx a,@r0"); else - sprintf(buffer, "illegal"); break; + sprintf(buffer, "illegal"); + break; case 0x81: if (!upi41) sprintf(buffer, "movx a,@r1"); else - sprintf(buffer, "illegal"); break; + sprintf(buffer, "illegal"); + break; case 0x83: sprintf(buffer, "ret"); flags = DASMFLAG_STEP_OUT; break; case 0x84: sprintf(buffer, "jmp $4%02X", *opram++); break; case 0x85: sprintf(buffer, "clr f0"); break; case 0x86: if (!upi41) sprintf(buffer, "jni $%03X", (pc & 0xf00) | *opram++); else - sprintf(buffer, "jobf $%03X", (pc & 0xf00) | *opram++); break; + sprintf(buffer, "jobf $%03X", (pc & 0xf00) | *opram++); + break; case 0x88: if (!upi41) sprintf(buffer, "orl bus,#$%02X", *opram++); else - sprintf(buffer, "illegal"); break; + sprintf(buffer, "illegal"); + break; case 0x89: sprintf(buffer, "orl p1,#$%02X", *opram++); break; case 0x8a: sprintf(buffer, "orl p2,#$%02X", *opram++); break; case 0x8c: sprintf(buffer, "orld p4,a"); break; @@ -179,11 +187,13 @@ static UINT32 common_dasm(device_t *device, char *buffer, offs_t pc, const UINT8 case 0x90: if (!upi41) sprintf(buffer, "movx @r0,a"); else - sprintf(buffer, "mov sts,a"); break; + sprintf(buffer, "mov sts,a"); + break; case 0x91: if (!upi41) sprintf(buffer, "movx @r1,a"); else - sprintf(buffer, "illegal"); break; + sprintf(buffer, "illegal"); + break; case 0x92: sprintf(buffer, "jb4 $%03X", (pc & 0xf00) | *opram++); break; case 0x93: sprintf(buffer, "retr"); flags = DASMFLAG_STEP_OUT; break; case 0x94: sprintf(buffer, "call $4%02X", *opram++); flags = DASMFLAG_STEP_OVER; break; @@ -193,7 +203,8 @@ static UINT32 common_dasm(device_t *device, char *buffer, offs_t pc, const UINT8 case 0x98: if (!upi41) sprintf(buffer, "anl bus,#$%02X", *opram++); else - sprintf(buffer, "illegal"); break; + sprintf(buffer, "illegal"); + break; case 0x99: sprintf(buffer, "anl p1,#$%02X", *opram++); break; case 0x9a: sprintf(buffer, "anl p2,#$%02X", *opram++); break; case 0x9c: sprintf(buffer, "anld p4,a"); break; @@ -250,7 +261,8 @@ static UINT32 common_dasm(device_t *device, char *buffer, offs_t pc, const UINT8 case 0xd6: if (!upi41) sprintf(buffer, "illegal"); else - sprintf(buffer, "jnibf $%03X", (pc & 0xf00) | *opram++); break; + sprintf(buffer, "jnibf $%03X", (pc & 0xf00) | *opram++); + break; case 0xd7: sprintf(buffer, "mov psw,a"); break; case 0xd8: sprintf(buffer, "xrl a,r0"); break; case 0xd9: sprintf(buffer, "xrl a,r1"); break; @@ -265,7 +277,8 @@ static UINT32 common_dasm(device_t *device, char *buffer, offs_t pc, const UINT8 case 0xe5: if (!upi41) sprintf(buffer, "sel mb0"); else - sprintf(buffer, "en dma"); break; + sprintf(buffer, "en dma"); + break; case 0xe6: sprintf(buffer, "jnc $%03X", (pc & 0xf00) | *opram++); break; case 0xe7: sprintf(buffer, "rl a"); break; case 0xe8: sprintf(buffer, "djnz r0,$%03X", (pc & 0xf00) | *opram++); flags = DASMFLAG_STEP_OVER; break; @@ -283,7 +296,8 @@ static UINT32 common_dasm(device_t *device, char *buffer, offs_t pc, const UINT8 case 0xf5: if (!upi41) sprintf(buffer, "sel mb1"); else - sprintf(buffer, "en flags"); break; + sprintf(buffer, "en flags"); + break; case 0xf6: sprintf(buffer, "jc $%03X", (pc & 0xf00) | *opram++); break; case 0xf7: sprintf(buffer, "rlc a"); break; case 0xf8: sprintf(buffer, "mov a,r0"); break; diff --git a/src/devices/cpu/mips/mips3dsm.cpp b/src/devices/cpu/mips/mips3dsm.cpp index 1b0d6e52286..71e81ca7b5c 100644 --- a/src/devices/cpu/mips/mips3dsm.cpp +++ b/src/devices/cpu/mips/mips3dsm.cpp @@ -373,7 +373,8 @@ unsigned dasmmips3(char *buffer, unsigned pc, UINT32 op) case 0x00: if (op == 0) sprintf(buffer, "nop"); else - sprintf(buffer, "sll %s,%s,%d", reg[rd], reg[rt], shift); break; + sprintf(buffer, "sll %s,%s,%d", reg[rd], reg[rt], shift); + break; case 0x01: sprintf(buffer, "mov%c %s,%s,%d", ((op >> 16) & 1) ? 't' : 'f', reg[rd], reg[rs], (op >> 18) & 7); break; case 0x02: sprintf(buffer, "srl %s,%s,%d", reg[rd], reg[rt], shift); break; case 0x03: sprintf(buffer, "sra %s,%s,%d", reg[rd], reg[rt], shift); break; @@ -384,7 +385,9 @@ unsigned dasmmips3(char *buffer, unsigned pc, UINT32 op) case 0x09: if (rd == 31) sprintf(buffer, "jalr %s", reg[rs]); else - sprintf(buffer, "jalr %s,%s", reg[rs], reg[rd]); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; + sprintf(buffer, "jalr %s,%s", reg[rs], reg[rd]); + flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); + break; case 0x0a: sprintf(buffer, "movz %s,%s,%s", reg[rd], reg[rs], reg[rt]); break; case 0x0b: sprintf(buffer, "movn %s,%s,%s", reg[rd], reg[rs], reg[rt]); break; case 0x0c: sprintf(buffer, "syscall"); flags = DASMFLAG_STEP_OVER; break; @@ -461,7 +464,8 @@ unsigned dasmmips3(char *buffer, unsigned pc, UINT32 op) case 0x04: if (rs == 0 && rt == 0) sprintf(buffer, "b $%08x", pc + 4 + ((INT16)op << 2)); else - sprintf(buffer, "beq %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((INT16)op << 2));break; + sprintf(buffer, "beq %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((INT16)op << 2)); + break; case 0x05: sprintf(buffer, "bne %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((INT16)op << 2));break; case 0x06: sprintf(buffer, "blez %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); break; case 0x07: sprintf(buffer, "bgtz %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); break; diff --git a/src/devices/cpu/mips/r3kdasm.cpp b/src/devices/cpu/mips/r3kdasm.cpp index ed0da525a98..3e65c0f0e9c 100644 --- a/src/devices/cpu/mips/r3kdasm.cpp +++ b/src/devices/cpu/mips/r3kdasm.cpp @@ -144,7 +144,8 @@ static UINT32 dasm_cop(UINT32 pc, int cop, UINT32 op, char *buffer) } } else - sprintf(buffer, "cop%d $%07x", cop, op & 0x01ffffff); break; + sprintf(buffer, "cop%d $%07x", cop, op & 0x01ffffff); + break; default: sprintf(buffer, "dc.l $%08x [invalid]", op); break; } @@ -250,7 +251,8 @@ static unsigned dasmr3k(char *buffer, unsigned pc, UINT32 op) case 0x00: if (op == 0) sprintf(buffer, "nop"); else - sprintf(buffer, "sll %s,%s,%d", reg[rd], reg[rt], shift); break; + sprintf(buffer, "sll %s,%s,%d", reg[rd], reg[rt], shift); + break; case 0x02: sprintf(buffer, "srl %s,%s,%d", reg[rd], reg[rt], shift); break; case 0x03: sprintf(buffer, "sra %s,%s,%d", reg[rd], reg[rt], shift); break; case 0x04: sprintf(buffer, "sllv %s,%s,%s", reg[rd], reg[rt], reg[rs]); break; @@ -260,7 +262,9 @@ static unsigned dasmr3k(char *buffer, unsigned pc, UINT32 op) case 0x09: if (rd == 31) sprintf(buffer, "jalr %s", reg[rs]); else - sprintf(buffer, "jalr %s,%s", reg[rs], reg[rd]); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; + sprintf(buffer, "jalr %s,%s", reg[rs], reg[rd]); + flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); + break; case 0x0c: sprintf(buffer, "syscall"); flags = DASMFLAG_STEP_OVER; break; case 0x0d: sprintf(buffer, "break"); flags = DASMFLAG_STEP_OVER; break; case 0x0f: sprintf(buffer, "sync [invalid]"); break; @@ -318,7 +322,8 @@ static unsigned dasmr3k(char *buffer, unsigned pc, UINT32 op) case 0x04: if (rs == 0 && rt == 0) sprintf(buffer, "b $%08x", pc + 4 + ((INT16)op << 2)); else - sprintf(buffer, "beq %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((INT16)op << 2));break; + sprintf(buffer, "beq %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((INT16)op << 2)); + break; case 0x05: sprintf(buffer, "bne %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((INT16)op << 2));break; case 0x06: sprintf(buffer, "blez %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); break; case 0x07: sprintf(buffer, "bgtz %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); break; diff --git a/src/devices/cpu/tms9900/9900dasm.cpp b/src/devices/cpu/tms9900/9900dasm.cpp index 1e79c407538..b3c8bfb56dc 100644 --- a/src/devices/cpu/tms9900/9900dasm.cpp +++ b/src/devices/cpu/tms9900/9900dasm.cpp @@ -444,7 +444,7 @@ unsigned Dasm9900 (char *buffer, unsigned pc, int model_id, const UINT8 *oprom, case 1: /* opcode is dcs */ opc = _dcs; - break; + break; case 2: case 3: /* should be 2, but instruction decoding is incomplete */ @@ -458,11 +458,11 @@ unsigned Dasm9900 (char *buffer, unsigned pc, int model_id, const UINT8 *oprom, instead of the immediate. Since I do not know, I handle this as an illegal instruction. */ opc = _ill; - break; + break; default: /* this is still a software xop */ - break; + break; } } diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp index 67ccf6e198c..7131aa1c2ec 100644 --- a/src/devices/imagedev/floppy.cpp +++ b/src/devices/imagedev/floppy.cpp @@ -438,10 +438,10 @@ bool floppy_image_device::call_load() if (!cur_load_cb.isnull()) return cur_load_cb(this); - if (motor_always_on) { - // When disk is inserted, start motor - mon_w(0); - } else if(!mon) + if (motor_always_on) { + // When disk is inserted, start motor + mon_w(0); + } else if(!mon) ready_counter = 2; return IMAGE_INIT_PASS; @@ -469,10 +469,10 @@ void floppy_image_device::call_unload() if (!cur_unload_cb.isnull()) cur_unload_cb(this); - if (motor_always_on) { - // When disk is removed, stop motor - mon_w(1); - } else if(!ready) { + if (motor_always_on) { + // When disk is removed, stop motor + mon_w(1); + } else if(!ready) { ready = true; if(!cur_ready_cb.isnull()) cur_ready_cb(this, ready); diff --git a/src/devices/machine/i8251.cpp b/src/devices/machine/i8251.cpp index 8baf4bc57ec..7b0d272970d 100644 --- a/src/devices/machine/i8251.cpp +++ b/src/devices/machine/i8251.cpp @@ -205,21 +205,20 @@ void i8251_device::transmit_clock() else return; - if (is_transmit_register_empty()) { - if ((m_status & I8251_STATUS_TX_READY) == 0 && (is_tx_enabled() || (m_flags & I8251_DELAYED_TX_EN) != 0)) { - start_tx(); - } else { - m_status |= I8251_STATUS_TX_EMPTY; - } - update_tx_ready(); - update_tx_empty(); + if (is_transmit_register_empty()) { + if ((m_status & I8251_STATUS_TX_READY) == 0 && (is_tx_enabled() || (m_flags & I8251_DELAYED_TX_EN) != 0)) { + start_tx(); + } else { + m_status |= I8251_STATUS_TX_EMPTY; } - /* if diserial has bits to send, make them so */ - if (!is_transmit_register_empty()) - { - UINT8 data = transmit_register_get_data_bit(); - m_txd_handler(data); - } + update_tx_ready(); + update_tx_empty(); + } + /* if diserial has bits to send, make them so */ + if (!is_transmit_register_empty()) { + UINT8 data = transmit_register_get_data_bit(); + m_txd_handler(data); + } #if 0 /* hunt mode? */ diff --git a/src/devices/machine/tms9901.cpp b/src/devices/machine/tms9901.cpp index 3da7028baa8..1ff3b7381f6 100644 --- a/src/devices/machine/tms9901.cpp +++ b/src/devices/machine/tms9901.cpp @@ -411,37 +411,53 @@ WRITE8_MEMBER ( tms9901_device::write ) switch (offset) { case 0x10: - if (!m_write_p0.isnull()) m_write_p0(data); break; + if (!m_write_p0.isnull()) m_write_p0(data); + break; case 0x11: - if (!m_write_p1.isnull()) m_write_p1(data); break; + if (!m_write_p1.isnull()) m_write_p1(data); + break; case 0x12: - if (!m_write_p2.isnull()) m_write_p2(data); break; + if (!m_write_p2.isnull()) m_write_p2(data); + break; case 0x13: - if (!m_write_p3.isnull()) m_write_p3(data); break; + if (!m_write_p3.isnull()) m_write_p3(data); + break; case 0x14: - if (!m_write_p4.isnull()) m_write_p4(data); break; + if (!m_write_p4.isnull()) m_write_p4(data); + break; case 0x15: - if (!m_write_p5.isnull()) m_write_p5(data); break; + if (!m_write_p5.isnull()) m_write_p5(data); + break; case 0x16: - if (!m_write_p6.isnull()) m_write_p6(data); break; + if (!m_write_p6.isnull()) m_write_p6(data); + break; case 0x17: - if (!m_write_p7.isnull()) m_write_p7(data); break; + if (!m_write_p7.isnull()) m_write_p7(data); + break; case 0x18: - if (!m_write_p8.isnull()) m_write_p8(data); break; + if (!m_write_p8.isnull()) m_write_p8(data); + break; case 0x19: - if (!m_write_p9.isnull()) m_write_p9(data); break; + if (!m_write_p9.isnull()) m_write_p9(data); + break; case 0x1A: - if (!m_write_p10.isnull()) m_write_p10(data); break; + if (!m_write_p10.isnull()) m_write_p10(data); + break; case 0x1B: - if (!m_write_p11.isnull()) m_write_p11(data); break; + if (!m_write_p11.isnull()) m_write_p11(data); + break; case 0x1C: - if (!m_write_p12.isnull()) m_write_p12(data); break; + if (!m_write_p12.isnull()) m_write_p12(data); + break; case 0x1D: - if (!m_write_p13.isnull()) m_write_p13(data); break; + if (!m_write_p13.isnull()) m_write_p13(data); + break; case 0x1E: - if (!m_write_p14.isnull()) m_write_p14(data); break; + if (!m_write_p14.isnull()) m_write_p14(data); + break; case 0x1F: - if (!m_write_p15.isnull()) m_write_p15(data); break; + if (!m_write_p15.isnull()) m_write_p15(data); + break; } return; diff --git a/src/devices/sound/scsp.cpp b/src/devices/sound/scsp.cpp index 2d6054209c8..4f5311def8e 100644 --- a/src/devices/sound/scsp.cpp +++ b/src/devices/sound/scsp.cpp @@ -1390,13 +1390,10 @@ int IRQCB(void *param) void scsp_device::set_ram_base(void *base) { - if (this) - { - m_SCSPRAM = (unsigned char *)base; - m_DSP.SCSPRAM = (UINT16 *)base; - m_SCSPRAM_LENGTH = 0x80000; - m_DSP.SCSPRAM_LENGTH = 0x80000/2; - } + m_SCSPRAM = (unsigned char *)base; + m_DSP.SCSPRAM = (UINT16 *)base; + m_SCSPRAM_LENGTH = 0x80000; + m_DSP.SCSPRAM_LENGTH = 0x80000/2; } diff --git a/src/devices/sound/upd7759.cpp b/src/devices/sound/upd7759.cpp index cb75e30b231..78cdf5ce24a 100644 --- a/src/devices/sound/upd7759.cpp +++ b/src/devices/sound/upd7759.cpp @@ -716,7 +716,7 @@ void upd7759_device::device_timer(emu_timer &timer, device_timer_id id, int para /* set a timer to go off when that is done */ if (m_state != STATE_IDLE) m_timer->adjust(m_clock_period * m_clocks_left); - break; + break; default: assert_always(FALSE, "Unknown id in upd7759_device::device_timer"); diff --git a/src/devices/video/ef9345.cpp b/src/devices/video/ef9345.cpp index 057550d794b..a78835b12c0 100644 --- a/src/devices/video/ef9345.cpp +++ b/src/devices/video/ef9345.cpp @@ -428,7 +428,7 @@ void ef9345_device::bichrome40(UINT8 type, UINT16 address, UINT8 dial, UINT16 ib case 0x70: //11 = flash underlined if (m_blink) underline = 1; - break; + break; } } diff --git a/src/emu/devdelegate.h b/src/emu/devdelegate.h index b688cd31261..58974c4f5b3 100644 --- a/src/emu/devdelegate.h +++ b/src/emu/devdelegate.h @@ -74,7 +74,7 @@ public: device_delegate(const thistype &src, device_t &search_root) : basetype(src), device_delegate_helper(src.m_device_name) { bind_relative_to(search_root); } // perform the binding - void bind_relative_to(device_t &search_root) { assert(&search_root != nullptr); if (!basetype::isnull()) basetype::late_bind(bound_object(search_root)); } + void bind_relative_to(device_t &search_root) { if (!basetype::isnull()) basetype::late_bind(bound_object(search_root)); } // getter (for validation purposes) const char *device_name() const { return m_device_name; } diff --git a/src/frontend/mame/ui/miscmenu.cpp b/src/frontend/mame/ui/miscmenu.cpp index 02be6a20614..b17ff5fefa8 100644 --- a/src/frontend/mame/ui/miscmenu.cpp +++ b/src/frontend/mame/ui/miscmenu.cpp @@ -894,7 +894,11 @@ menu_plugins_configure::~menu_plugins_configure() { emu_file file_plugin(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); if (file_plugin.open("plugin.ini") != osd_file::error::NONE) - throw emu_fatalerror("Unable to create file plugin.ini\n"); + // Can't throw in a destructor, so let's ignore silently for + // now. We shouldn't write files in a destructor in any case. + // + // throw emu_fatalerror("Unable to create file plugin.ini\n"); + return; // generate the updated INI file_plugin.puts(mame_machine_manager::instance()->plugins().output_ini().c_str()); } @@ -977,4 +981,4 @@ void menu_plugins_configure::custom_render(void *selectedref, float top, float b DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } -} // namespace ui
\ No newline at end of file +} // namespace ui diff --git a/src/frontend/mame/ui/selsoft.cpp b/src/frontend/mame/ui/selsoft.cpp index 3f2b17a54d7..fa68affb36a 100644 --- a/src/frontend/mame/ui/selsoft.cpp +++ b/src/frontend/mame/ui/selsoft.cpp @@ -1245,12 +1245,12 @@ void menu_select_software::build_list(std::vector<ui_software_info *> &s_drivers case UI_SW_AVAILABLE: if (s_driver->available) m_displaylist.push_back(s_driver); - break; + break; case UI_SW_UNAVAILABLE: if (!s_driver->available) m_displaylist.push_back(s_driver); - break; + break; case UI_SW_SUPPORTED: if (s_driver->supported == SOFTWARE_SUPPORTED_YES) diff --git a/src/lib/formats/thom_dsk.cpp b/src/lib/formats/thom_dsk.cpp index da7187d65f8..2e126b696e7 100644 --- a/src/lib/formats/thom_dsk.cpp +++ b/src/lib/formats/thom_dsk.cpp @@ -93,9 +93,9 @@ static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, in || (sector < 0) || (sector >= 16)) return FLOPPY_ERROR_SEEKERROR; - offs = tag->sector_pos[track][sector]; - if (offs <= 0 ) - return FLOPPY_ERROR_SEEKERROR; + offs = tag->sector_pos[track][sector]; + if (offs <= 0 ) + return FLOPPY_ERROR_SEEKERROR; if (offset) *offset = offs; diff --git a/src/mame/audio/vboy.cpp b/src/mame/audio/vboy.cpp index f6b77630522..f8c21cee315 100644 --- a/src/mame/audio/vboy.cpp +++ b/src/mame/audio/vboy.cpp @@ -372,8 +372,10 @@ void vboysnd_device::sound_stream_update(sound_stream &stream, stream_sample_t * // scale to 16 bits note_left = (note_left << 5) | ((note_left >> 6) & 0x1f); note_right = (note_right << 5) | ((note_right >> 6) & 0x1f); - if (note_left < -32767) note_left = -32767; if (note_left > 32767) note_left = 32767; - if (note_right < -32767) note_right = -32767; if (note_right > 32767) note_right = 32767; + if (note_left < -32767) note_left = -32767; + if (note_left > 32767) note_left = 32767; + if (note_right < -32767) note_right = -32767; + if (note_right > 32767) note_right = 32767; *(outL++) = ((INT16)note_left); *(outR++) = ((INT16)note_right); diff --git a/src/mame/drivers/cobra.cpp b/src/mame/drivers/cobra.cpp index 391cf3e040e..fd26a331638 100644 --- a/src/mame/drivers/cobra.cpp +++ b/src/mame/drivers/cobra.cpp @@ -578,7 +578,9 @@ bool cobra_jvs::coin_counters(UINT8 *&buf, UINT8 count) *buf++ = m_coin_counter[0] >> 8; *buf++ = m_coin_counter[0]; if(count > 1) + { *buf++ = m_coin_counter[1] >> 8; *buf++ = m_coin_counter[1]; + } return true; } diff --git a/src/mame/drivers/cosmic.cpp b/src/mame/drivers/cosmic.cpp index 58b92a19d39..b896be46641 100644 --- a/src/mame/drivers/cosmic.cpp +++ b/src/mame/drivers/cosmic.cpp @@ -212,55 +212,61 @@ WRITE8_MEMBER(cosmic_state::cosmica_sound_output_w) if (m_samples->playing(2)) { m_samples->stop(2); - m_samples->start(2, 3); break; + m_samples->start(2, 3); } else - m_samples->start(2, 3); break; + m_samples->start(2, 3); + break; case 3: if (m_samples->playing(3)) { m_samples->stop(3); - m_samples->start(3, 4); break; + m_samples->start(3, 4); } else - m_samples->start(3, 4); break; + m_samples->start(3, 4); + break; case 4: if (m_samples->playing(4)) { m_samples->stop(4); - m_samples->start(4, 5); break; + m_samples->start(4, 5); } else - m_samples->start(4, 5); break; + m_samples->start(4, 5); + break; case 5: if (m_samples->playing(5)) { m_samples->stop(5); - m_samples->start(5, 6); break; + m_samples->start(5, 6); } else - m_samples->start(5, 6); break; + m_samples->start(5, 6); + break; case 6: if (m_samples->playing(6)) { m_samples->stop(6); - m_samples->start(6, 7); break; + m_samples->start(6, 7); } else - m_samples->start(6, 7); break; + m_samples->start(6, 7); + break; case 7: if (m_samples->playing(7)) { m_samples->stop(7); - m_samples->start(7, 8); break; + m_samples->start(7, 8); } else - m_samples->start(7, 8); break; + m_samples->start(7, 8); + break; } } diff --git a/src/mame/drivers/cyclemb.cpp b/src/mame/drivers/cyclemb.cpp index 1772a3caa57..fed5bf963b2 100644 --- a/src/mame/drivers/cyclemb.cpp +++ b/src/mame/drivers/cyclemb.cpp @@ -335,7 +335,7 @@ void cyclemb_state::skydest_draw_sprites(screen_device &screen, bitmap_ind16 &bi if(m_obj3_ram[i+1] & 1) x |= 0x100; - x = 0x138 - x; + x = 0x138 - x; spr_offs = (m_obj1_ram[i+0]); spr_offs += ((m_obj3_ram[i+0] & 3) << 8); diff --git a/src/mame/drivers/gaelco3d.cpp b/src/mame/drivers/gaelco3d.cpp index d7b3652da95..5c08a3d8ffd 100644 --- a/src/mame/drivers/gaelco3d.cpp +++ b/src/mame/drivers/gaelco3d.cpp @@ -486,7 +486,7 @@ WRITE16_MEMBER(gaelco3d_state::tms_reset_w) /* it does not ever appear to be touched after that */ if (LOG) logerror("%06X:tms_reset_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask); - m_tms->set_input_line(INPUT_LINE_RESET, (data == 0xffff) ? CLEAR_LINE : ASSERT_LINE); + m_tms->set_input_line(INPUT_LINE_RESET, (data == 0xffff) ? CLEAR_LINE : ASSERT_LINE); } diff --git a/src/mame/drivers/halleys.cpp b/src/mame/drivers/halleys.cpp index f384dbb37c6..45fcde5b1f4 100644 --- a/src/mame/drivers/halleys.cpp +++ b/src/mame/drivers/halleys.cpp @@ -937,13 +937,20 @@ COMMAND_MODE: ax = (UINT16)src1_ptr[edx]; al = src1_ptr[edx+0x10000]; ax |= BG_RGB; - if (al & 0x01) dst_ptr[ecx] = ax; ecx++; ecx &= WARPMASK; - if (al & 0x02) dst_ptr[ecx] = ax; ecx++; ecx &= WARPMASK; - if (al & 0x04) dst_ptr[ecx] = ax; ecx++; ecx &= WARPMASK; - if (al & 0x08) dst_ptr[ecx] = ax; ecx++; ecx &= WARPMASK; - if (al & 0x10) dst_ptr[ecx] = ax; ecx++; ecx &= WARPMASK; - if (al & 0x20) dst_ptr[ecx] = ax; ecx++; ecx &= WARPMASK; - if (al & 0x40) dst_ptr[ecx] = ax; ecx++; ecx &= WARPMASK; + if (al & 0x01) dst_ptr[ecx] = ax; + ecx++; ecx &= WARPMASK; + if (al & 0x02) dst_ptr[ecx] = ax; + ecx++; ecx &= WARPMASK; + if (al & 0x04) dst_ptr[ecx] = ax; + ecx++; ecx &= WARPMASK; + if (al & 0x08) dst_ptr[ecx] = ax; + ecx++; ecx &= WARPMASK; + if (al & 0x10) dst_ptr[ecx] = ax; + ecx++; ecx &= WARPMASK; + if (al & 0x20) dst_ptr[ecx] = ax; + ecx++; ecx &= WARPMASK; + if (al & 0x40) dst_ptr[ecx] = ax; + ecx++; ecx &= WARPMASK; if (al & 0x80) dst_ptr[ecx] = ax; dst_ptr += SCREEN_WIDTH; } while (++edx); @@ -1404,12 +1411,18 @@ void halleys_state::copy_fixed_xp(bitmap_ind16 &bitmap, UINT16 *source) do { ax = esi[ecx]; bx = esi[ecx+1]; - if (ax) edi[ecx ] = ax; ax = esi[ecx+2]; - if (bx) edi[ecx+1] = bx; bx = esi[ecx+3]; - if (ax) edi[ecx+2] = ax; ax = esi[ecx+4]; - if (bx) edi[ecx+3] = bx; bx = esi[ecx+5]; - if (ax) edi[ecx+4] = ax; ax = esi[ecx+6]; - if (bx) edi[ecx+5] = bx; bx = esi[ecx+7]; + if (ax) edi[ecx ] = ax; + ax = esi[ecx+2]; + if (bx) edi[ecx+1] = bx; + bx = esi[ecx+3]; + if (ax) edi[ecx+2] = ax; + ax = esi[ecx+4]; + if (bx) edi[ecx+3] = bx; + bx = esi[ecx+5]; + if (ax) edi[ecx+4] = ax; + ax = esi[ecx+6]; + if (bx) edi[ecx+5] = bx; + bx = esi[ecx+7]; if (ax) edi[ecx+6] = ax; if (bx) edi[ecx+7] = bx; } @@ -1440,24 +1453,40 @@ void halleys_state::copy_fixed_2b(bitmap_ind16 &bitmap, UINT16 *source) ax = esi[ecx]; bx = esi[ecx+1]; - if (!(ax)) goto SKIP0; if (!(ax&SP_2BACK)) goto DRAW0; if (edi[ecx ]) goto SKIP0; + if (!(ax)) goto SKIP0; + if (!(ax&SP_2BACK)) goto DRAW0; + if (edi[ecx ]) goto SKIP0; DRAW0: edi[ecx ] = ax; SKIP0: ax = esi[ecx+2]; - if (!(bx)) goto SKIP1; if (!(bx&SP_2BACK)) goto DRAW1; if (edi[ecx+1]) goto SKIP1; + if (!(bx)) goto SKIP1; + if (!(bx&SP_2BACK)) goto DRAW1; + if (edi[ecx+1]) goto SKIP1; DRAW1: edi[ecx+1] = bx; SKIP1: bx = esi[ecx+3]; - if (!(ax)) goto SKIP2; if (!(ax&SP_2BACK)) goto DRAW2; if (edi[ecx+2]) goto SKIP2; + if (!(ax)) goto SKIP2; + if (!(ax&SP_2BACK)) goto DRAW2; + if (edi[ecx+2]) goto SKIP2; DRAW2: edi[ecx+2] = ax; SKIP2: ax = esi[ecx+4]; - if (!(bx)) goto SKIP3; if (!(bx&SP_2BACK)) goto DRAW3; if (edi[ecx+3]) goto SKIP3; + if (!(bx)) goto SKIP3; + if (!(bx&SP_2BACK)) goto DRAW3; + if (edi[ecx+3]) goto SKIP3; DRAW3: edi[ecx+3] = bx; SKIP3: bx = esi[ecx+5]; - if (!(ax)) goto SKIP4; if (!(ax&SP_2BACK)) goto DRAW4; if (edi[ecx+4]) goto SKIP4; + if (!(ax)) goto SKIP4; + if (!(ax&SP_2BACK)) goto DRAW4; + if (edi[ecx+4]) goto SKIP4; DRAW4: edi[ecx+4] = ax; SKIP4: ax = esi[ecx+6]; - if (!(bx)) goto SKIP5; if (!(bx&SP_2BACK)) goto DRAW5; if (edi[ecx+5]) goto SKIP5; + if (!(bx)) goto SKIP5; + if (!(bx&SP_2BACK)) goto DRAW5; + if (edi[ecx+5]) goto SKIP5; DRAW5: edi[ecx+5] = bx; SKIP5: bx = esi[ecx+7]; - if (!(ax)) goto SKIP6; if (!(ax&SP_2BACK)) goto DRAW6; if (edi[ecx+6]) goto SKIP6; + if (!(ax)) goto SKIP6; + if (!(ax&SP_2BACK)) goto DRAW6; + if (edi[ecx+6]) goto SKIP6; DRAW6: edi[ecx+6] = ax; SKIP6: - if (!(bx)) continue; if (!(bx&SP_2BACK)) goto DRAW7; if (edi[ecx+7]) continue; + if (!(bx)) continue; + if (!(bx&SP_2BACK)) goto DRAW7; + if (edi[ecx+7]) continue; DRAW7: edi[ecx+7] = bx; } while (ecx += 8); diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp index 84f8d746fc0..6fa412a978c 100644 --- a/src/mame/drivers/pc9801.cpp +++ b/src/mame/drivers/pc9801.cpp @@ -1021,7 +1021,7 @@ WRITE8_MEMBER(pc9801_state::pc9801_video_ff_w) m_gfx_ff = 1; if(data & 1) logerror("Graphic f/f actually enabled!\n"); - break; + break; case 4: if(m_gfx_ff) { diff --git a/src/mame/machine/3do.cpp b/src/mame/machine/3do.cpp index cb3de112e79..b172b88cfa4 100644 --- a/src/mame/machine/3do.cpp +++ b/src/mame/machine/3do.cpp @@ -771,8 +771,8 @@ READ32_MEMBER(_3do_state::_3do_clio_r) return m_clio.uncle_rom; default: - if (!space.debugger_access()) - logerror( "%08X: unhandled CLIO read offset = %08X\n", m_maincpu->pc(), offset * 4 ); + if (!space.debugger_access()) + logerror( "%08X: unhandled CLIO read offset = %08X\n", m_maincpu->pc(), offset * 4 ); break; } return 0; diff --git a/src/mame/machine/awboard.cpp b/src/mame/machine/awboard.cpp index b9d5a28ced6..03cd59a9118 100644 --- a/src/mame/machine/awboard.cpp +++ b/src/mame/machine/awboard.cpp @@ -301,7 +301,7 @@ READ16_MEMBER(aw_rom_board::pio_r) UINT32 roffset = epr_offset & 0x3ffffff; if (roffset >= (mpr_offset / 2)) roffset += mpr_bank * 0x4000000; - UINT16 retval = (m_region->bytes() > (roffset * 2)) ? m_region->u16(roffset) : 0; // not endian-safe? + UINT16 retval = (m_region->bytes() > (roffset * 2)) ? m_region->u16(roffset) : 0; // not endian-safe? return retval; } diff --git a/src/mame/machine/fd1094.cpp b/src/mame/machine/fd1094.cpp index 7616adcd0b9..ed358b97cc2 100644 --- a/src/mame/machine/fd1094.cpp +++ b/src/mame/machine/fd1094.cpp @@ -816,7 +816,7 @@ UINT16 fd1094_device::decrypt_one(offs_t address, UINT16 val, const UINT8 *main_ val = BITSWAP16(val, 15, 9,10,13, 3,12, 0,14, 6, 5, 2,11, 8, 1, 4, 7); if (!global_xor1) if (~val & 0x0800) val ^= 0x3002; // 1,12,13 - if (~val & 0x0020) val ^= 0x0044; // 2,6 + if (true) if (~val & 0x0020) val ^= 0x0044; // 2,6 if (!key_1b) if (~val & 0x0400) val ^= 0x0890; // 4,7,11 if (!global_swap2) if (!key_0c) val ^= 0x0308; // 3,8,9 val ^= 0x6561; diff --git a/src/mame/machine/jvs13551.cpp b/src/mame/machine/jvs13551.cpp index fa0350e60a0..be82ed40bb8 100644 --- a/src/mame/machine/jvs13551.cpp +++ b/src/mame/machine/jvs13551.cpp @@ -123,8 +123,9 @@ bool sega_837_13551::coin_counters(UINT8 *&buf, UINT8 count) *buf++ = coin_counter[0] >> 8; *buf++ = coin_counter[0]; - if(count > 1) + if(count > 1) { *buf++ = coin_counter[1] >> 8; *buf++ = coin_counter[1]; + } return true; } diff --git a/src/mame/video/cheekyms.cpp b/src/mame/video/cheekyms.cpp index 572c2476575..9a68448afb2 100644 --- a/src/mame/video/cheekyms.cpp +++ b/src/mame/video/cheekyms.cpp @@ -123,19 +123,19 @@ void cheekyms_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre if (!flip) code++; - gfx->transpen(bitmap,cliprect, code, color, 0, 0, x, y, 0); + gfx->transpen(bitmap,cliprect, code, color, 0, 0, x, y, 0); } else { if (m_spriteram[offs + 0] & 0x02) { - gfx->transpen(bitmap,cliprect, code | 0x20, color, 0, 0, x, y, 0); - gfx->transpen(bitmap,cliprect, code | 0x21, color, 0, 0, 0x10 + x, y, 0); + gfx->transpen(bitmap,cliprect, code | 0x20, color, 0, 0, x, y, 0); + gfx->transpen(bitmap,cliprect, code | 0x21, color, 0, 0, 0x10 + x, y, 0); } else { - gfx->transpen(bitmap,cliprect, code | 0x20, color, 0, 0, x, y, 0); - gfx->transpen(bitmap,cliprect, code | 0x21, color, 0, 0, x, 0x10 + y, 0); + gfx->transpen(bitmap,cliprect, code | 0x20, color, 0, 0, x, y, 0); + gfx->transpen(bitmap,cliprect, code | 0x21, color, 0, 0, x, 0x10 + y, 0); } } } diff --git a/src/mame/video/exerion.cpp b/src/mame/video/exerion.cpp index dee291a0419..c2d30a8daac 100644 --- a/src/mame/video/exerion.cpp +++ b/src/mame/video/exerion.cpp @@ -388,12 +388,12 @@ UINT32 exerion_state::screen_update_exerion(screen_device &screen, bitmap_ind16 else code &= ~0x10, code2 |= 0x10; - gfx->transmask(bitmap,cliprect, code2, color, xflip, yflip, x, y + gfx->height(), - m_palette->transpen_mask(*gfx, color, 0x10)); + gfx->transmask(bitmap,cliprect, code2, color, xflip, yflip, x, y + gfx->height(), + m_palette->transpen_mask(*gfx, color, 0x10)); } - gfx->transmask(bitmap,cliprect, code, color, xflip, yflip, x, y, - m_palette->transpen_mask(*gfx, color, 0x10)); + gfx->transmask(bitmap,cliprect, code, color, xflip, yflip, x, y, + m_palette->transpen_mask(*gfx, color, 0x10)); if (doubled) i += 4; } diff --git a/src/mame/video/fcombat.cpp b/src/mame/video/fcombat.cpp index d3ba66e120e..fdd54b92f85 100644 --- a/src/mame/video/fcombat.cpp +++ b/src/mame/video/fcombat.cpp @@ -176,18 +176,18 @@ UINT32 fcombat_state::screen_update_fcombat(screen_device &screen, bitmap_ind16 else code &= ~0x10, code2 |= 0x10; - gfx->transpen(bitmap,cliprect, code2, color, xflip, yflip, x, y + gfx->height(), 0); + gfx->transpen(bitmap,cliprect, code2, color, xflip, yflip, x, y + gfx->height(), 0); } if(flags&0x10) { - gfx->transpen(bitmap,cliprect, code2 + 16, color, xflip, yflip, x, y + gfx->height(), 0); - gfx->transpen(bitmap,cliprect, code2 + 16 * 2, color, xflip, yflip, x, y + 2 * gfx->height(), 0); - gfx->transpen(bitmap,cliprect, code2 + 16 * 3, color, xflip, yflip, x, y + 3 * gfx->height(), 0); + gfx->transpen(bitmap,cliprect, code2 + 16, color, xflip, yflip, x, y + gfx->height(), 0); + gfx->transpen(bitmap,cliprect, code2 + 16 * 2, color, xflip, yflip, x, y + 2 * gfx->height(), 0); + gfx->transpen(bitmap,cliprect, code2 + 16 * 3, color, xflip, yflip, x, y + 3 * gfx->height(), 0); } - gfx->transpen(bitmap,cliprect, code, color, xflip, yflip, x, y, 0); + gfx->transpen(bitmap,cliprect, code, color, xflip, yflip, x, y, 0); if (doubled) i += 4; } diff --git a/src/mame/video/gotya.cpp b/src/mame/video/gotya.cpp index 3f2eace21f2..ca2070a70f1 100644 --- a/src/mame/video/gotya.cpp +++ b/src/mame/video/gotya.cpp @@ -128,11 +128,11 @@ void gotya_state::draw_status_row( bitmap_ind16 &bitmap, const rectangle &clipre sy = 31 - row; - m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, - m_videoram2[row * 32 + col], - m_videoram2[row * 32 + col + 0x10] & 0x0f, - flip_screen_x(), flip_screen_y(), - 8 * sx, 8 * sy); + m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, + m_videoram2[row * 32 + col], + m_videoram2[row * 32 + col + 0x10] & 0x0f, + flip_screen_x(), flip_screen_y(), + 8 * sx, 8 * sy); } } @@ -152,10 +152,10 @@ void gotya_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect sy = 240 - sy; - m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, - code, color, - flip_screen_x(), flip_screen_y(), - sx, sy, 0); + m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, + code, color, + flip_screen_x(), flip_screen_y(), + sx, sy, 0); } } diff --git a/src/mame/video/k001005.cpp b/src/mame/video/k001005.cpp index fad84787317..66ea3984cc0 100644 --- a/src/mame/video/k001005.cpp +++ b/src/mame/video/k001005.cpp @@ -969,8 +969,10 @@ void k001005_renderer::draw_scanline(INT32 scanline, const extent_t &extent, con int ibri = (int)(bri); int ifog = (int)(fog); - if (ibri < 0) ibri = 0; if (ibri > 255) ibri = 255; - if (ifog < 0) ifog = 0; if (ifog > 65536) ifog = 65536; + if (ibri < 0) ibri = 0; + if (ibri > 255) ibri = 255; + if (ifog < 0) ifog = 0; + if (ifog > 65536) ifog = 65536; if (z <= zb[x]) { @@ -984,9 +986,12 @@ void k001005_renderer::draw_scanline(INT32 scanline, const extent_t &extent, con g = ((((g * poly_light_g * ibri) >> 16) * ifog) + (poly_fog_g * (65536 - ifog))) >> 16; b = ((((b * poly_light_b * ibri) >> 16) * ifog) + (poly_fog_b * (65536 - ifog))) >> 16; - if (r < 0) r = 0; if (r > 255) r = 255; - if (g < 0) g = 0; if (g > 255) g = 255; - if (b < 0) b = 0; if (b > 255) b = 255; + if (r < 0) r = 0; + if (r > 255) r = 255; + if (g < 0) g = 0; + if (g > 255) g = 255; + if (b < 0) b = 0; + if (b > 255) b = 255; fb[x] = (color & 0xff000000) | (r << 16) | (g << 8) | b; zb[x] = z; @@ -1046,8 +1051,10 @@ void k001005_renderer::draw_scanline_tex(INT32 scanline, const extent_t &extent, int ibri = (int)(bri); int ifog = (int)(fog); - if (ibri < 0) ibri = 0; if (ibri > 255) ibri = 255; - if (ifog < 0) ifog = 0; if (ifog > 65536) ifog = 65536; + if (ibri < 0) ibri = 0; + if (ibri > 255) ibri = 255; + if (ifog < 0) ifog = 0; + if (ifog > 65536) ifog = 65536; if (z <= zb[x]) { @@ -1074,9 +1081,12 @@ void k001005_renderer::draw_scanline_tex(INT32 scanline, const extent_t &extent, g = ((((g * poly_light_g * ibri) >> 16) * ifog) + (poly_fog_g * (65536 - ifog))) >> 16; b = ((((b * poly_light_b * ibri) >> 16) * ifog) + (poly_fog_b * (65536 - ifog))) >> 16; - if (r < 0) r = 0; if (r > 255) r = 255; - if (g < 0) g = 0; if (g > 255) g = 255; - if (b < 0) b = 0; if (b > 255) b = 255; + if (r < 0) r = 0; + if (r > 255) r = 255; + if (g < 0) g = 0; + if (g > 255) g = 255; + if (b < 0) b = 0; + if (b > 255) b = 255; fb[x] = 0xff000000 | (r << 16) | (g << 8) | b; zb[x] = z; @@ -1129,9 +1139,12 @@ void k001005_renderer::draw_scanline_gouraud_blend(INT32 scanline, const extent_ ib = ((ib * ia) >> 8) + ((sb * (0xff-ia)) >> 8); } - if (ir < 0) ir = 0; if (ir > 255) ir = 255; - if (ig < 0) ig = 0; if (ig > 255) ig = 255; - if (ib < 0) ib = 0; if (ib > 255) ib = 255; + if (ir < 0) ir = 0; + if (ir > 255) ir = 255; + if (ig < 0) ig = 0; + if (ig > 255) ig = 255; + if (ib < 0) ib = 0; + if (ib > 255) ib = 255; fb[x] = 0xff000000 | (ir << 16) | (ig << 8) | ib; zb[x] = z; diff --git a/src/mame/video/k052109.cpp b/src/mame/video/k052109.cpp index 6530afb113a..3456778a502 100644 --- a/src/mame/video/k052109.cpp +++ b/src/mame/video/k052109.cpp @@ -337,8 +337,8 @@ READ8_MEMBER( k052109_device::read ) else m_k052109_cb(0, bank, &code, &color, &flags, &priority); - addr = (code << 5) + (offset & 0x1f); - addr &= m_char_rom.mask(); + addr = (code << 5) + (offset & 0x1f); + addr &= m_char_rom.mask(); // logerror("%04x: off = %04x sub = %02x (bnk = %x) adr = %06x\n", space.device().safe_pc(), offset, m_romsubbank, bank, addr); diff --git a/src/mame/video/snk.cpp b/src/mame/video/snk.cpp index 3749233adcb..cb7d58d0001 100644 --- a/src/mame/video/snk.cpp +++ b/src/mame/video/snk.cpp @@ -585,10 +585,10 @@ WRITE8_MEMBER(snk_state::ikari_unknown_video_w) Changing palette bank is necessary to fix colors in test mode. */ -if (data != 0x20 && // normal - data != 0x31 && // ikari test - data != 0xaa) // victroad spurious during boot - popmessage("attrs %02x contact MAMEDEV", data); + if (data != 0x20 && // normal + data != 0x31 && // ikari test + data != 0xaa) // victroad spurious during boot + popmessage("attrs %02x contact MAMEDEV", data); m_tx_tilemap->set_palette_offset((data & 0x01) << 4); if (m_tx_tile_offset != ((data & 0x10) << 4)) diff --git a/src/mame/video/strnskil.cpp b/src/mame/video/strnskil.cpp index 20d7e3e2ee5..76316d1d9bf 100644 --- a/src/mame/video/strnskil.cpp +++ b/src/mame/video/strnskil.cpp @@ -107,7 +107,7 @@ void strnskil_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec sx = sx - 256; - m_gfxdecode->gfx(1)->transmask(bitmap,cliprect, + m_gfxdecode->gfx(1)->transmask(bitmap,cliprect, code, color, flipx, flipy, px, py, diff --git a/src/mame/video/taotaido.cpp b/src/mame/video/taotaido.cpp index 21eaa685afc..47cc988fe45 100644 --- a/src/mame/video/taotaido.cpp +++ b/src/mame/video/taotaido.cpp @@ -49,7 +49,7 @@ WRITE16_MEMBER(taotaido_state::tileregs_w) m_video_bank_select[(offset-4)*2] = data >> 8; if(ACCESSING_BITS_0_7) m_video_bank_select[(offset-4)*2+1] = data &0xff; - m_bg_tilemap->mark_all_dirty(); + m_bg_tilemap->mark_all_dirty(); break; } } diff --git a/src/mame/video/vc4000.cpp b/src/mame/video/vc4000.cpp index 45fa1079131..ca57728b645 100644 --- a/src/mame/video/vc4000.cpp +++ b/src/mame/video/vc4000.cpp @@ -542,7 +542,8 @@ inline void vc4000_state::vc4000_draw_grid(UINT8 *collision) } switch (i&3) { case 0: - if (k&1) w=8;break; + if (k&1) w=8; + break; case 1: if ((line%40)<=10) { if (k&2) w=8; diff --git a/src/mame/video/wolfpack.cpp b/src/mame/video/wolfpack.cpp index 07b3aea0acc..03cfdde3da4 100644 --- a/src/mame/video/wolfpack.cpp +++ b/src/mame/video/wolfpack.cpp @@ -196,7 +196,7 @@ void wolfpack_state::draw_pt(bitmap_ind16 &bitmap, const rectangle &cliprect) rect.max_x = 255; - m_gfxdecode->gfx(2)->transpen(bitmap,rect, + m_gfxdecode->gfx(2)->transpen(bitmap,rect, m_pt_pic, 0, 0, 0, @@ -204,7 +204,7 @@ void wolfpack_state::draw_pt(bitmap_ind16 &bitmap, const rectangle &cliprect) m_pt_pos_select ? 0x70 : 0xA0, 0); - m_gfxdecode->gfx(2)->transpen(bitmap,rect, + m_gfxdecode->gfx(2)->transpen(bitmap,rect, m_pt_pic, 0, 0, 0, |