summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2018-08-29 05:29:50 +1000
committer Vas Crabb <vas@vastheman.com>2018-08-29 05:29:50 +1000
commit9f7bcbd886ba69bccd9180ded7cfbd112f02b23b (patch)
treeca4f2cc2b76f5e62c7cb14aace1f0b99754464c7 /src/devices
parent413e511e121f44e033968dddc6f9a5514030b5b1 (diff)
final cleanup (nw)
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/machine/upd765.cpp43
-rw-r--r--src/devices/sound/huc6230.cpp4
2 files changed, 19 insertions, 28 deletions
diff --git a/src/devices/machine/upd765.cpp b/src/devices/machine/upd765.cpp
index 32cc58fe20f..6fd3d246e6d 100644
--- a/src/devices/machine/upd765.cpp
+++ b/src/devices/machine/upd765.cpp
@@ -587,8 +587,7 @@ void upd765_family_device::fifo_push(uint8_t data, bool internal)
// MZ: A bit speculative. These lines help to avoid some FIFO mess-up
// with the HX5102 that happens when WRITE DATA fails to find the sector
// but the host already starts pushing the sector data. Should not hurt.
- if (fifo_expected == 0)
- {
+ if(fifo_expected == 0) {
LOGFIFO("Fifo not expecting data, discarding\n");
return;
}
@@ -976,15 +975,13 @@ void upd765_family_device::live_run(attotime limit)
break;
case SCAN_SECTOR_DATA_BYTE:
- if(!scan_done) // TODO: handle stp, x68000 sets it to 0xff (as it would dtl)?
- {
+ if(!scan_done) { // TODO: handle stp, x68000 sets it to 0xff (as it would dtl)?
int slot = (cur_live.bit_counter >> 4)-1;
uint8_t data = fifo_pop(true);
if(!slot)
st2 = (st2 & ~(ST2_SN)) | ST2_SH;
- if(data != cur_live.data_reg)
- {
+ if(data != cur_live.data_reg) {
st2 = (st2 & ~(ST2_SH)) | ST2_SN;
if((data < cur_live.data_reg) && ((command[0] & 0x1f) == 0x19)) // low
st2 &= ~ST2_SN;
@@ -992,14 +989,11 @@ void upd765_family_device::live_run(attotime limit)
if((data > cur_live.data_reg) && ((command[0] & 0x1f) == 0x1d)) // high
st2 &= ~ST2_SN;
}
- if((slot == sector_size) && !(st2 & ST2_SN))
- {
+ if((slot == sector_size) && !(st2 & ST2_SN)) {
scan_done = true;
tc_done = true;
}
- }
- else
- {
+ } else {
if(fifo_pos)
fifo_pop(true);
}
@@ -2378,9 +2372,9 @@ std::string upd765_family_device::results() const
{
std::ostringstream stream;
stream << "results=(";
- if (!result_pos) stream << "none";
- else
- {
+ if(!result_pos)
+ stream << "none";
+ else {
stream << std::hex << std::setfill('0') << std::setw(2) << unsigned(result[0]);
for (int i=1; i < result_pos; i++)
stream << ',' << std::setw(2) << unsigned(result[i]);
@@ -2752,7 +2746,7 @@ void i82072_device::start_command(int cmd)
upd765_family_device::start_command(cmd);
// set motor off counter if command execution has completed
- if (main_phase != PHASE_EXEC && motorcfg)
+ if(main_phase != PHASE_EXEC && motorcfg)
motor_off_counter = (2 + ((motorcfg & MOFF) >> 4)) << (motorcfg & HSDA ? 1 : 0);
} else
delayed_command = cmd;
@@ -2775,7 +2769,7 @@ void i82072_device::execute_command(int cmd)
LOGCOMMAND("command motor %s drive %d\n", motor_on ? "on" : "off", fi.id);
// if we are selecting a different drive, stop the motor on the previously selected drive
- if (selected_drive != fi.id && flopi[selected_drive].dev && flopi[selected_drive].dev->mon_r() == 0)
+ if(selected_drive != fi.id && flopi[selected_drive].dev && flopi[selected_drive].dev->mon_r() == 0)
flopi[selected_drive].dev->mon_w(1);
// select the drive
@@ -2992,14 +2986,13 @@ WRITE8_MEMBER(tc8566af_device::cr1_w)
WRITE8_MEMBER(upd72065_device::auxcmd_w)
{
- switch(data)
- {
- case 0x36: // reset
- soft_reset();
- break;
- case 0x35: // set standby
- break;
- case 0x34: // reset standby
- break;
+ switch(data) {
+ case 0x36: // reset
+ soft_reset();
+ break;
+ case 0x35: // set standby
+ break;
+ case 0x34: // reset standby
+ break;
}
}
diff --git a/src/devices/sound/huc6230.cpp b/src/devices/sound/huc6230.cpp
index 23155c4dc7f..9b77d1f83c0 100644
--- a/src/devices/sound/huc6230.cpp
+++ b/src/devices/sound/huc6230.cpp
@@ -13,13 +13,11 @@
#include "emu.h"
#include "huc6230.h"
-static const int clamp(int val, int min, int max) { return std::min(max,std::max(min,val)); }
+constexpr int clamp(int val, int min, int max) { return std::min(max, std::max(min, val)); }
void huc6230_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
- /* Clear buffer */
-
int frq = (1 << m_adpcm_freq);
for (int i = 0; i < samples; i++)
{