summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2020-06-25 10:54:22 +1000
committer Vas Crabb <vas@vastheman.com>2020-06-25 10:54:22 +1000
commita335166ec2020954d8c272a26e076080aafa26ba (patch)
tree9c7d61567f279fa6d398fc0fd70d25a88f5b70ec
parent731fbe19754f6bd13e1c2a6d9c7fcf61f15c6369 (diff)
-bus/coco/coco_ram.cpp: fix a rather obvious bug in shift/mask
-misc. formatting consistency
-rw-r--r--src/devices/bus/coco/coco_ram.cpp23
-rw-r--r--src/devices/cpu/i960/i960.cpp2
-rw-r--r--src/emu/natkeyboard.cpp2
-rw-r--r--src/mame/drivers/gscpm.cpp40
4 files changed, 31 insertions, 36 deletions
diff --git a/src/devices/bus/coco/coco_ram.cpp b/src/devices/bus/coco/coco_ram.cpp
index 222f1abedf3..885cc55a34d 100644
--- a/src/devices/bus/coco/coco_ram.cpp
+++ b/src/devices/bus/coco/coco_ram.cpp
@@ -12,7 +12,7 @@
#include "emu.h"
#include "coco_ram.h"
-#include "cococart.h"
+
#include "machine/ram.h"
#define STATICRAM_TAG "static_ram"
@@ -53,7 +53,7 @@ namespace
private:
required_device<ram_device> m_staticram;
- int m_offset;
+ u32 m_offset;
};
};
@@ -126,19 +126,19 @@ void coco_pak_ram_device::scs_write(offs_t offset, u8 data)
{
// int idata = data;
- switch(offset)
+ switch (offset)
{
case 0:
- m_offset = ((m_offset & 0xffff00) + data);
+ m_offset = (m_offset & 0xffff00) | u32(data);
break;
case 1:
- m_offset = ((m_offset & 0xff00ff) + (data << 8));
+ m_offset = (m_offset & 0xff00ff) | (u32(data) << 8);
break;
case 2:
- m_offset = ((m_offset & 0x00ffff) + (data << 16));
+ m_offset = (m_offset & 0x00ffff) | (u32(data) << 16);
break;
case 3:
- if( m_offset < BUFFER_SIZE )
+ if (m_offset < BUFFER_SIZE)
{
m_staticram->write(m_offset, data);
}
@@ -161,20 +161,19 @@ u8 coco_pak_ram_device::scs_read(offs_t offset)
switch (offset)
{
case 0:
- data = (m_offset) & 0xff;
+ data = u8(m_offset & 0x00ff);
break;
case 1:
- data = (m_offset & 0xff00ff) >> 8;
+ data = u8((m_offset >> 8) & 0x00ff);
break;
case 2:
- data = (m_offset & 0xff0000) >> 16;
+ data = u8((m_offset >> 16) & 0x00ff);
break;
case 3:
- if( m_offset < BUFFER_SIZE )
+ if (m_offset < BUFFER_SIZE)
{
data = m_staticram->read(m_offset);
}
-
break;
}
diff --git a/src/devices/cpu/i960/i960.cpp b/src/devices/cpu/i960/i960.cpp
index 81b14d7aa69..ae17f211aba 100644
--- a/src/devices/cpu/i960/i960.cpp
+++ b/src/devices/cpu/i960/i960.cpp
@@ -107,7 +107,7 @@ void i960_cpu_device::send_iac(uint32_t adr)
logerror("I960: %x: IAC %08x %08x %08x %08x (invalidate internal instruction cache)\n", m_PIP, iac[0], iac[1], iac[2], iac[3]);
// we do not emulate the instruction cache, so this is safe to ignore
break;
- case 0x8F: // enable/disable breakpoints
+ case 0x8f: // enable/disable breakpoints
logerror("I960: %x: IAC %08x %08x %08x %08x (enable/disable breakpoints)\n", m_PIP, iac[0], iac[1], iac[2], iac[3]);
// processor breakpoints are not emulated, safe to ignore
break;
diff --git a/src/emu/natkeyboard.cpp b/src/emu/natkeyboard.cpp
index f264754b3a4..110e0462b6d 100644
--- a/src/emu/natkeyboard.cpp
+++ b/src/emu/natkeyboard.cpp
@@ -881,7 +881,7 @@ const natural_keyboard::keycode_map_entry *natural_keyboard::find_code(char32_t
{
keycode_map::const_iterator const found(m_keycode_map.find(ch));
if (m_keycode_map.end() == found) return nullptr;
- for(const keycode_map_entry &entry : found->second)
+ for (keycode_map_entry const &entry : found->second)
{
if (entry.condition.eval())
return &entry;
diff --git a/src/mame/drivers/gscpm.cpp b/src/mame/drivers/gscpm.cpp
index dffd5427097..ca91dd86fa3 100644
--- a/src/mame/drivers/gscpm.cpp
+++ b/src/mame/drivers/gscpm.cpp
@@ -81,39 +81,35 @@ void gscpm_state::cflash_w(offs_t offset, uint8_t data)
uint8_t gscpm_state::sio_r(offs_t offset)
{
- switch(offset & 3)
+ switch (offset & 3)
{
- case 0x00:
- return m_sio->da_r();
- break;
- case 0x01:
- return m_sio->db_r();
- break;
- case 0x02:
- return m_sio->ca_r();
- break;
- case 0x03:
- return m_sio->cb_r();
- break;
+ case 0x00:
+ return m_sio->da_r();
+ case 0x01:
+ return m_sio->db_r();
+ case 0x02:
+ return m_sio->ca_r();
+ case 0x03:
+ return m_sio->cb_r();
}
return 0x00; // can't happen
}
void gscpm_state::sio_w(offs_t offset, uint8_t data)
{
- switch(offset & 3)
+ switch (offset & 3)
{
- case 0x00:
- m_sio->da_w(data);
+ case 0x00:
+ m_sio->da_w(data);
break;
- case 0x01:
- m_sio->db_w(data);
+ case 0x01:
+ m_sio->db_w(data);
break;
- case 0x02:
- m_sio->ca_w(data);
+ case 0x02:
+ m_sio->ca_w(data);
break;
- case 0x03:
- m_sio->cb_w(data);
+ case 0x03:
+ m_sio->cb_w(data);
break;
}
}