summaryrefslogtreecommitdiffstats
path: root/src/devices/cpu/scmp/scmp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/scmp/scmp.cpp')
-rw-r--r--src/devices/cpu/scmp/scmp.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/devices/cpu/scmp/scmp.cpp b/src/devices/cpu/scmp/scmp.cpp
index 2671dc9cf5a..04f7023ac62 100644
--- a/src/devices/cpu/scmp/scmp.cpp
+++ b/src/devices/cpu/scmp/scmp.cpp
@@ -21,7 +21,7 @@ const device_type SCMP = &device_creator<scmp_device>;
const device_type INS8060 = &device_creator<ins8060_device>;
-scmp_device::scmp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+scmp_device::scmp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: cpu_device(mconfig, SCMP, "INS 8050 SC/MP", tag, owner, clock, "ins8050", __FILE__)
, m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0), m_AC(0), m_ER(0), m_SR(0), m_program(nullptr), m_direct(nullptr), m_icount(0)
, m_flag_out_func(*this)
@@ -34,7 +34,7 @@ scmp_device::scmp_device(const machine_config &mconfig, const char *tag, device_
}
-scmp_device::scmp_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
+scmp_device::scmp_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source)
, m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0), m_AC(0), m_ER(0), m_SR(0), m_program(nullptr), m_direct(nullptr), m_icount(0)
, m_flag_out_func(*this)
@@ -47,52 +47,52 @@ scmp_device::scmp_device(const machine_config &mconfig, device_type type, const
}
-ins8060_device::ins8060_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ins8060_device::ins8060_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: scmp_device(mconfig, INS8060, "INS 8060 SC/MP II", tag, owner, clock, "ins8060", __FILE__)
{
}
-offs_t scmp_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
+offs_t scmp_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
{
extern CPU_DISASSEMBLE( scmp );
return CPU_DISASSEMBLE_NAME(scmp)(this, buffer, pc, oprom, opram, options);
}
-UINT16 scmp_device::ADD12(UINT16 addr, INT8 val)
+uint16_t scmp_device::ADD12(uint16_t addr, int8_t val)
{
return ((addr + val) & 0x0fff) | (addr & 0xf000);
}
-UINT8 scmp_device::ROP()
+uint8_t scmp_device::ROP()
{
- UINT16 pc = m_PC.w.l;
+ uint16_t pc = m_PC.w.l;
m_PC.w.l = ADD12(m_PC.w.l,1);
return m_direct->read_byte( pc);
}
-UINT8 scmp_device::ARG()
+uint8_t scmp_device::ARG()
{
- UINT16 pc = m_PC.w.l;
+ uint16_t pc = m_PC.w.l;
m_PC.w.l = ADD12(m_PC.w.l,1);
return m_direct->read_byte(pc);
}
-UINT8 scmp_device::RM(UINT32 a)
+uint8_t scmp_device::RM(uint32_t a)
{
return m_program->read_byte(a);
}
-void scmp_device::WM(UINT32 a, UINT8 v)
+void scmp_device::WM(uint32_t a, uint8_t v)
{
m_program->write_byte(a, v);
}
-void scmp_device::illegal(UINT8 opcode)
+void scmp_device::illegal(uint8_t opcode)
{
#if VERBOSE
- UINT16 pc = m_PC.w.l;
+ uint16_t pc = m_PC.w.l;
LOG(("SC/MP illegal instruction %04X $%02X\n", pc-1, opcode));
#endif
}
@@ -108,10 +108,10 @@ PAIR *scmp_device::GET_PTR_REG(int num)
}
}
-void scmp_device::BIN_ADD(UINT8 val)
+void scmp_device::BIN_ADD(uint8_t val)
{
- UINT16 tmp = m_AC + val + ((m_SR >> 7) & 1);
- UINT8 ov = (((m_AC & 0x80)==(val & 0x80)) && ((m_AC & 0x80)!=(tmp & 0x80))) ? 0x40 : 0x00;
+ uint16_t tmp = m_AC + val + ((m_SR >> 7) & 1);
+ uint8_t ov = (((m_AC & 0x80)==(val & 0x80)) && ((m_AC & 0x80)!=(tmp & 0x80))) ? 0x40 : 0x00;
m_AC = tmp & 0xff;
m_SR &= 0x3f; // clear CY/L and OV flag
@@ -119,28 +119,28 @@ void scmp_device::BIN_ADD(UINT8 val)
m_SR |= ov;
}
-void scmp_device::DEC_ADD(UINT8 val)
+void scmp_device::DEC_ADD(uint8_t val)
{
- UINT16 tmp = m_AC + val + ((m_SR >> 7) & 1);
+ uint16_t tmp = m_AC + val + ((m_SR >> 7) & 1);
if ((tmp & 0x0f) > 9) tmp +=6;
m_AC = tmp % 0xa0;
m_SR &= 0x7f; // clear CY/L flag
m_SR |= (tmp > 0x99) ? 0x80 : 0x00;
}
-UINT16 scmp_device::GET_ADDR(UINT8 code)
+uint16_t scmp_device::GET_ADDR(uint8_t code)
{
- UINT16 addr;
- INT8 offset;
- UINT16 retVal = 0;
- UINT16 ptr = GET_PTR_REG(code & 0x03)->w.l;
+ uint16_t addr;
+ int8_t offset;
+ uint16_t retVal = 0;
+ uint16_t ptr = GET_PTR_REG(code & 0x03)->w.l;
- UINT8 arg = ARG();
+ uint8_t arg = ARG();
if (arg == 0x80) {
offset = m_ER;
} else {
if (arg & 0x80) {
- offset = (INT8)arg;
+ offset = (int8_t)arg;
} else {
offset = arg;
}
@@ -172,8 +172,8 @@ UINT16 scmp_device::GET_ADDR(UINT8 code)
void scmp_device::execute_one(int opcode)
{
- UINT8 tmp;
- UINT8 ptr = opcode & 3;
+ uint8_t tmp;
+ uint8_t ptr = opcode & 3;
if (BIT(opcode,7)) {
// two bytes instructions
switch (opcode)
@@ -231,7 +231,7 @@ void scmp_device::execute_one(int opcode)
case 0xa8 : case 0xa9 : case 0xaa : case 0xab :
// IDL
{
- UINT16 addr = GET_ADDR(opcode);
+ uint16_t addr = GET_ADDR(opcode);
m_icount -= 22;
m_AC = RM(addr) + 1;
WM(addr,m_AC);
@@ -240,7 +240,7 @@ void scmp_device::execute_one(int opcode)
case 0xb8 : case 0xb9 : case 0xba : case 0xbb :
// DLD
{
- UINT16 addr = GET_ADDR(opcode);
+ uint16_t addr = GET_ADDR(opcode);
m_icount -= 22;
m_AC = RM(addr) - 1;
WM(addr,m_AC);
@@ -278,14 +278,14 @@ void scmp_device::execute_one(int opcode)
// Transfer Instructions
case 0x90 : case 0x91 : case 0x92 : case 0x93 :// JMP
m_icount -= 11;
- m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(INT8)ARG());
+ m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(int8_t)ARG());
break;
case 0x94 : case 0x95 : case 0x96 : case 0x97 :
// JP
m_icount -= 9;
tmp = ARG();
if (!(m_AC & 0x80)) {
- m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(INT8)tmp);
+ m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(int8_t)tmp);
m_icount -= 2;
}
break;
@@ -294,7 +294,7 @@ void scmp_device::execute_one(int opcode)
m_icount -= 9;
tmp = ARG();
if (!m_AC) {
- m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(INT8)tmp);
+ m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(int8_t)tmp);
m_icount -= 2;
}
break;
@@ -303,14 +303,14 @@ void scmp_device::execute_one(int opcode)
m_icount -= 9;
tmp = ARG();
if (m_AC) {
- m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(INT8)tmp);
+ m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(int8_t)tmp);
m_icount -= 2;
}
break;
// Double-Byte Miscellaneous Instructions
case 0x8f: // DLY
tmp = ARG();
- m_icount -= 13 + (m_AC * 2) + (((UINT32)tmp) << 1) + (((UINT32)tmp) << 9);
+ m_icount -= 13 + (m_AC * 2) + (((uint32_t)tmp) << 1) + (((uint32_t)tmp) << 9);
m_AC = 0xff;
break;
// Others are illegal
@@ -374,7 +374,7 @@ void scmp_device::execute_one(int opcode)
case 0x3c: case 0x3d :case 0x3e: case 0x3f:
// XPPC
{
- UINT16 tmp16 = ADD12(m_PC.w.l,-1); // Since PC is incremented we need to fix it
+ uint16_t tmp16 = ADD12(m_PC.w.l,-1); // Since PC is incremented we need to fix it
m_icount -= 7;
m_PC.w.l = GET_PTR_REG(ptr)->w.l;
GET_PTR_REG(ptr)->w.l = tmp16;
@@ -459,7 +459,7 @@ void scmp_device::execute_one(int opcode)
***************************************************************************/
void scmp_device::take_interrupt()
{
- UINT16 tmp = ADD12(m_PC.w.l,-1); // We fix PC so at return it goes to current location
+ uint16_t tmp = ADD12(m_PC.w.l,-1); // We fix PC so at return it goes to current location
m_SR &= 0xf7; // clear IE flag
m_icount -= 8; // assumption