summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/v30mz/v30mz.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/v30mz/v30mz.cpp')
-rw-r--r--src/devices/cpu/v30mz/v30mz.cpp374
1 files changed, 187 insertions, 187 deletions
diff --git a/src/devices/cpu/v30mz/v30mz.cpp b/src/devices/cpu/v30mz/v30mz.cpp
index 1436b72d757..54197ea82c0 100644
--- a/src/devices/cpu/v30mz/v30mz.cpp
+++ b/src/devices/cpu/v30mz/v30mz.cpp
@@ -75,7 +75,7 @@ enum BREGS {
#define CF (m_CarryVal!=0)
#define SF (m_SignVal<0)
#define ZF (m_ZeroVal==0)
-#define PF m_parity_table[(UINT8)m_ParityVal]
+#define PF m_parity_table[(uint8_t)m_ParityVal]
#define AF (m_AuxVal!=0)
#define OF (m_OverVal!=0)
#define MD (m_MF!=0)
@@ -97,7 +97,7 @@ enum BREGS {
const device_type V30MZ = &device_creator<v30mz_cpu_device>;
-v30mz_cpu_device::v30mz_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+v30mz_cpu_device::v30mz_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: cpu_device(mconfig, V30MZ, "V30MZ", tag, owner, clock, "v30mz", __FILE__)
, m_program_config("program", ENDIANNESS_LITTLE, 8, 20, 0)
, m_io_config("io", ENDIANNESS_LITTLE, 8, 16, 0)
@@ -109,23 +109,23 @@ v30mz_cpu_device::v30mz_cpu_device(const machine_config &mconfig, const char *ta
static const BREGS reg_name[8]={ AL, CL, DL, BL, AH, CH, DH, BH };
/* Set up parity lookup table. */
- for (UINT16 i = 0;i < 256; i++)
+ for (uint16_t i = 0;i < 256; i++)
{
- UINT16 c = 0;
- for (UINT16 j = i; j > 0; j >>= 1)
+ uint16_t c = 0;
+ for (uint16_t j = i; j > 0; j >>= 1)
{
if (j & 1) c++;
}
m_parity_table[i] = !(c & 1);
}
- for (UINT16 i = 0; i < 256; i++)
+ for (uint16_t i = 0; i < 256; i++)
{
m_Mod_RM.reg.b[i] = reg_name[(i & 0x38) >> 3];
m_Mod_RM.reg.w[i] = (WREGS) ( (i & 0x38) >> 3) ;
}
- for (UINT16 i = 0xc0; i < 0x100; i++)
+ for (uint16_t i = 0xc0; i < 0x100; i++)
{
m_Mod_RM.RM.w[i] = (WREGS)( i & 7 );
m_Mod_RM.RM.b[i] = (BREGS)reg_name[i & 7];
@@ -197,7 +197,7 @@ void v30mz_cpu_device::state_string_export(const device_state_entry &entry, std:
case STATE_GENFLAGS:
{
- UINT16 flags = CompressFlags();
+ uint16_t flags = CompressFlags();
str = string_format("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
flags & 0x8000 ? 'M':'.',
flags & 0x4000 ? '?':'.',
@@ -264,77 +264,77 @@ void v30mz_cpu_device::device_reset()
}
-inline UINT32 v30mz_cpu_device::pc()
+inline uint32_t v30mz_cpu_device::pc()
{
m_pc = ( m_sregs[CS] << 4 ) + m_ip;
return m_pc;
}
-inline UINT8 v30mz_cpu_device::read_byte(UINT32 addr)
+inline uint8_t v30mz_cpu_device::read_byte(uint32_t addr)
{
return m_program->read_byte(addr);
}
-inline UINT16 v30mz_cpu_device::read_word(UINT32 addr)
+inline uint16_t v30mz_cpu_device::read_word(uint32_t addr)
{
return m_program->read_byte(addr) | ( m_program->read_byte(addr+1) << 8 );
}
-inline void v30mz_cpu_device::write_byte(UINT32 addr, UINT8 data)
+inline void v30mz_cpu_device::write_byte(uint32_t addr, uint8_t data)
{
m_program->write_byte(addr, data);
}
-inline void v30mz_cpu_device::write_word(UINT32 addr, UINT16 data)
+inline void v30mz_cpu_device::write_word(uint32_t addr, uint16_t data)
{
m_program->write_byte( addr, data & 0xff );
m_program->write_byte( addr + 1, data >> 8 );
}
-inline UINT8 v30mz_cpu_device::read_port(UINT16 port)
+inline uint8_t v30mz_cpu_device::read_port(uint16_t port)
{
return m_io->read_byte(port);
}
-inline void v30mz_cpu_device::write_port(UINT16 port, UINT8 data)
+inline void v30mz_cpu_device::write_port(uint16_t port, uint8_t data)
{
m_io->write_byte(port, data);
}
-inline UINT8 v30mz_cpu_device::fetch_op()
+inline uint8_t v30mz_cpu_device::fetch_op()
{
- UINT8 data = m_direct->read_byte( pc() );
+ uint8_t data = m_direct->read_byte( pc() );
m_ip++;
return data;
}
-inline UINT8 v30mz_cpu_device::fetch()
+inline uint8_t v30mz_cpu_device::fetch()
{
- UINT8 data = m_direct->read_byte( pc() );
+ uint8_t data = m_direct->read_byte( pc() );
m_ip++;
return data;
}
-inline UINT16 v30mz_cpu_device::fetch_word()
+inline uint16_t v30mz_cpu_device::fetch_word()
{
- UINT16 data = fetch();
+ uint16_t data = fetch();
data |= ( fetch() << 8 );
return data;
}
-inline UINT8 v30mz_cpu_device::repx_op()
+inline uint8_t v30mz_cpu_device::repx_op()
{
- UINT8 next = fetch_op();
+ uint8_t next = fetch_op();
bool seg_prefix = false;
int seg = 0;
@@ -371,19 +371,19 @@ inline UINT8 v30mz_cpu_device::repx_op()
}
-inline void v30mz_cpu_device::CLK(UINT32 cycles)
+inline void v30mz_cpu_device::CLK(uint32_t cycles)
{
m_icount -= cycles;
}
-inline void v30mz_cpu_device::CLKM(UINT32 cycles_reg, UINT32 cycles_mem)
+inline void v30mz_cpu_device::CLKM(uint32_t cycles_reg, uint32_t cycles_mem)
{
m_icount -= ( m_modrm >= 0xc0 ) ? cycles_reg : cycles_mem;
}
-inline UINT32 v30mz_cpu_device::default_base(int seg)
+inline uint32_t v30mz_cpu_device::default_base(int seg)
{
if ( m_seg_prefix && (seg==DS || seg==SS) )
{
@@ -396,7 +396,7 @@ inline UINT32 v30mz_cpu_device::default_base(int seg)
}
-inline UINT32 v30mz_cpu_device::get_ea()
+inline uint32_t v30mz_cpu_device::get_ea()
{
switch( m_modrm & 0xc7 )
{
@@ -434,76 +434,76 @@ inline UINT32 v30mz_cpu_device::get_ea()
break;
case 0x40:
- m_eo = m_regs.w[BW] + m_regs.w[IX] + (INT8)fetch();
+ m_eo = m_regs.w[BW] + m_regs.w[IX] + (int8_t)fetch();
m_ea = default_base(DS) + m_eo;
break;
case 0x41:
- m_eo = m_regs.w[BW] + m_regs.w[IY] + (INT8)fetch();
+ m_eo = m_regs.w[BW] + m_regs.w[IY] + (int8_t)fetch();
m_ea = default_base(DS) + m_eo;
break;
case 0x42:
- m_eo = m_regs.w[BP] + m_regs.w[IX] + (INT8)fetch();
+ m_eo = m_regs.w[BP] + m_regs.w[IX] + (int8_t)fetch();
m_ea = default_base(SS) + m_eo;
break;
case 0x43:
- m_eo = m_regs.w[BP] + m_regs.w[IY] + (INT8)fetch();
+ m_eo = m_regs.w[BP] + m_regs.w[IY] + (int8_t)fetch();
m_ea = default_base(SS) + m_eo;
break;
case 0x44:
- m_eo = m_regs.w[IX] + (INT8)fetch();
+ m_eo = m_regs.w[IX] + (int8_t)fetch();
m_ea = default_base(DS) + m_eo;
break;
case 0x45:
- m_eo = m_regs.w[IY] + (INT8)fetch();
+ m_eo = m_regs.w[IY] + (int8_t)fetch();
m_ea = default_base(DS) + m_eo;
break;
case 0x46:
- m_eo = m_regs.w[BP] + (INT8)fetch();
+ m_eo = m_regs.w[BP] + (int8_t)fetch();
m_ea = default_base(SS) + m_eo;
break;
case 0x47:
- m_eo = m_regs.w[BW] + (INT8)fetch();
+ m_eo = m_regs.w[BW] + (int8_t)fetch();
m_ea = default_base(DS) + m_eo;
break;
case 0x80:
m_e16 = fetch_word();
- m_eo = m_regs.w[BW] + m_regs.w[IX] + (INT16)m_e16;
+ m_eo = m_regs.w[BW] + m_regs.w[IX] + (int16_t)m_e16;
m_ea = default_base(DS) + m_eo;
break;
case 0x81:
m_e16 = fetch_word();
- m_eo = m_regs.w[BW] + m_regs.w[IY] + (INT16)m_e16;
+ m_eo = m_regs.w[BW] + m_regs.w[IY] + (int16_t)m_e16;
m_ea = default_base(DS) + m_eo;
break;
case 0x82:
m_e16 = fetch_word();
- m_eo = m_regs.w[BP] + m_regs.w[IX] + (INT16)m_e16;
+ m_eo = m_regs.w[BP] + m_regs.w[IX] + (int16_t)m_e16;
m_ea = default_base(SS) + m_eo;
break;
case 0x83:
m_e16 = fetch_word();
- m_eo = m_regs.w[BP] + m_regs.w[IY] + (INT16)m_e16;
+ m_eo = m_regs.w[BP] + m_regs.w[IY] + (int16_t)m_e16;
m_ea = default_base(SS) + m_eo;
break;
case 0x84:
m_e16 = fetch_word();
- m_eo = m_regs.w[IX] + (INT16)m_e16;
+ m_eo = m_regs.w[IX] + (int16_t)m_e16;
m_ea = default_base(DS) + m_eo;
break;
case 0x85:
m_e16 = fetch_word();
- m_eo = m_regs.w[IY] + (INT16)m_e16;
+ m_eo = m_regs.w[IY] + (int16_t)m_e16;
m_ea = default_base(DS) + m_eo;
break;
case 0x86:
m_e16 = fetch_word();
- m_eo = m_regs.w[BP] + (INT16)m_e16;
+ m_eo = m_regs.w[BP] + (int16_t)m_e16;
m_ea = default_base(SS) + m_eo;
break;
case 0x87:
m_e16 = fetch_word();
- m_eo = m_regs.w[BW] + (INT16)m_e16;
+ m_eo = m_regs.w[BW] + (int16_t)m_e16;
m_ea = default_base(DS) + m_eo;
break;
}
@@ -512,7 +512,7 @@ inline UINT32 v30mz_cpu_device::get_ea()
}
-inline void v30mz_cpu_device::PutbackRMByte(UINT8 data)
+inline void v30mz_cpu_device::PutbackRMByte(uint8_t data)
{
if ( m_modrm >= 0xc0 )
{
@@ -525,7 +525,7 @@ inline void v30mz_cpu_device::PutbackRMByte(UINT8 data)
}
-inline void v30mz_cpu_device::PutbackRMWord(UINT16 data)
+inline void v30mz_cpu_device::PutbackRMWord(uint16_t data)
{
if ( m_modrm >= 0xc0 )
{
@@ -545,12 +545,12 @@ inline void v30mz_cpu_device::PutImmRMWord()
}
else
{
- UINT32 addr = get_ea();
+ uint32_t addr = get_ea();
write_word( addr, fetch_word() );
}
}
-inline void v30mz_cpu_device::PutRMWord(UINT16 val)
+inline void v30mz_cpu_device::PutRMWord(uint16_t val)
{
if ( m_modrm >= 0xc0 )
{
@@ -563,7 +563,7 @@ inline void v30mz_cpu_device::PutRMWord(UINT16 val)
}
-inline void v30mz_cpu_device::PutRMByte(UINT8 val)
+inline void v30mz_cpu_device::PutRMByte(uint8_t val)
{
if ( m_modrm >= 0xc0 )
{
@@ -584,7 +584,7 @@ inline void v30mz_cpu_device::PutImmRMByte()
}
else
{
- UINT32 addr = get_ea();
+ uint32_t addr = get_ea();
write_byte( addr, fetch() );
}
}
@@ -637,31 +637,31 @@ inline void v30mz_cpu_device::DEF_axd16()
-inline void v30mz_cpu_device::RegByte(UINT8 data)
+inline void v30mz_cpu_device::RegByte(uint8_t data)
{
m_regs.b[ m_Mod_RM.reg.b[ m_modrm ] ] = data;
}
-inline void v30mz_cpu_device::RegWord(UINT16 data)
+inline void v30mz_cpu_device::RegWord(uint16_t data)
{
m_regs.w[ m_Mod_RM.reg.w[ m_modrm ] ] = data;
}
-inline UINT8 v30mz_cpu_device::RegByte()
+inline uint8_t v30mz_cpu_device::RegByte()
{
return m_regs.b[ m_Mod_RM.reg.b[ m_modrm ] ];
}
-inline UINT16 v30mz_cpu_device::RegWord()
+inline uint16_t v30mz_cpu_device::RegWord()
{
return m_regs.w[ m_Mod_RM.reg.w[ m_modrm ] ];
}
-inline UINT16 v30mz_cpu_device::GetRMWord()
+inline uint16_t v30mz_cpu_device::GetRMWord()
{
if ( m_modrm >= 0xc0 )
{
@@ -674,15 +674,15 @@ inline UINT16 v30mz_cpu_device::GetRMWord()
}
-inline UINT16 v30mz_cpu_device::GetnextRMWord()
+inline uint16_t v30mz_cpu_device::GetnextRMWord()
{
- UINT32 addr = ( m_ea & 0xf0000 ) | ( ( m_ea + 2 ) & 0xffff );
+ uint32_t addr = ( m_ea & 0xf0000 ) | ( ( m_ea + 2 ) & 0xffff );
return read_word( addr );
}
-inline UINT8 v30mz_cpu_device::GetRMByte()
+inline uint8_t v30mz_cpu_device::GetRMByte()
{
if ( m_modrm >= 0xc0 )
{
@@ -695,26 +695,26 @@ inline UINT8 v30mz_cpu_device::GetRMByte()
}
-inline void v30mz_cpu_device::PutMemB(int seg, UINT16 offset, UINT8 data)
+inline void v30mz_cpu_device::PutMemB(int seg, uint16_t offset, uint8_t data)
{
write_byte( default_base( seg ) + offset, data);
}
-inline void v30mz_cpu_device::PutMemW(int seg, UINT16 offset, UINT16 data)
+inline void v30mz_cpu_device::PutMemW(int seg, uint16_t offset, uint16_t data)
{
PutMemB( seg, offset, data & 0xff);
PutMemB( seg, offset+1, data >> 8);
}
-inline UINT8 v30mz_cpu_device::GetMemB(int seg, UINT16 offset)
+inline uint8_t v30mz_cpu_device::GetMemB(int seg, uint16_t offset)
{
return read_byte( default_base(seg) + offset );
}
-inline UINT16 v30mz_cpu_device::GetMemW(int seg, UINT16 offset)
+inline uint16_t v30mz_cpu_device::GetMemW(int seg, uint16_t offset)
{
return GetMemB(seg, offset) | ( GetMemB(seg, offset + 1) << 8 );
}
@@ -722,68 +722,68 @@ inline UINT16 v30mz_cpu_device::GetMemW(int seg, UINT16 offset)
// Setting flags
-inline void v30mz_cpu_device::set_CFB(UINT32 x)
+inline void v30mz_cpu_device::set_CFB(uint32_t x)
{
m_CarryVal = x & 0x100;
}
-inline void v30mz_cpu_device::set_CFW(UINT32 x)
+inline void v30mz_cpu_device::set_CFW(uint32_t x)
{
m_CarryVal = x & 0x10000;
}
-inline void v30mz_cpu_device::set_AF(UINT32 x,UINT32 y,UINT32 z)
+inline void v30mz_cpu_device::set_AF(uint32_t x,uint32_t y,uint32_t z)
{
m_AuxVal = (x ^ (y ^ z)) & 0x10;
}
-inline void v30mz_cpu_device::set_SF(UINT32 x)
+inline void v30mz_cpu_device::set_SF(uint32_t x)
{
m_SignVal = x;
}
-inline void v30mz_cpu_device::set_ZF(UINT32 x)
+inline void v30mz_cpu_device::set_ZF(uint32_t x)
{
m_ZeroVal = x;
}
-inline void v30mz_cpu_device::set_PF(UINT32 x)
+inline void v30mz_cpu_device::set_PF(uint32_t x)
{
m_ParityVal = x;
}
-inline void v30mz_cpu_device::set_SZPF_Byte(UINT32 x)
+inline void v30mz_cpu_device::set_SZPF_Byte(uint32_t x)
{
- m_SignVal = m_ZeroVal = m_ParityVal = (INT8)x;
+ m_SignVal = m_ZeroVal = m_ParityVal = (int8_t)x;
}
-inline void v30mz_cpu_device::set_SZPF_Word(UINT32 x)
+inline void v30mz_cpu_device::set_SZPF_Word(uint32_t x)
{
- m_SignVal = m_ZeroVal = m_ParityVal = (INT16)x;
+ m_SignVal = m_ZeroVal = m_ParityVal = (int16_t)x;
}
-inline void v30mz_cpu_device::set_OFW_Add(UINT32 x,UINT32 y,UINT32 z)
+inline void v30mz_cpu_device::set_OFW_Add(uint32_t x,uint32_t y,uint32_t z)
{
m_OverVal = (x ^ y) & (x ^ z) & 0x8000;
}
-inline void v30mz_cpu_device::set_OFB_Add(UINT32 x,UINT32 y,UINT32 z)
+inline void v30mz_cpu_device::set_OFB_Add(uint32_t x,uint32_t y,uint32_t z)
{
m_OverVal = (x ^ y) & (x ^ z) & 0x80;
}
-inline void v30mz_cpu_device::set_OFW_Sub(UINT32 x,UINT32 y,UINT32 z)
+inline void v30mz_cpu_device::set_OFW_Sub(uint32_t x,uint32_t y,uint32_t z)
{
m_OverVal = (z ^ y) & (z ^ x) & 0x8000;
}
-inline void v30mz_cpu_device::set_OFB_Sub(UINT32 x,UINT32 y,UINT32 z)
+inline void v30mz_cpu_device::set_OFB_Sub(uint32_t x,uint32_t y,uint32_t z)
{
m_OverVal = (z ^ y) & (z ^ x) & 0x80;
}
-inline UINT16 v30mz_cpu_device::CompressFlags() const
+inline uint16_t v30mz_cpu_device::CompressFlags() const
{
return (CF ? 1 : 0)
| (PF ? 4 : 0)
@@ -797,7 +797,7 @@ inline UINT16 v30mz_cpu_device::CompressFlags() const
| (MD << 15);
}
-inline void v30mz_cpu_device::ExpandFlags(UINT16 f)
+inline void v30mz_cpu_device::ExpandFlags(uint16_t f)
{
m_CarryVal = (f) & 1;
m_ParityVal = !((f) & 4);
@@ -843,7 +843,7 @@ inline void v30mz_cpu_device::i_outsw()
inline void v30mz_cpu_device::i_movsb()
{
- UINT8 tmp = GetMemB( DS, m_regs.w[IX] );
+ uint8_t tmp = GetMemB( DS, m_regs.w[IX] );
PutMemB( ES, m_regs.w[IY], tmp);
m_regs.w[IY] += -2 * m_DF + 1;
m_regs.w[IX] += -2 * m_DF + 1;
@@ -852,7 +852,7 @@ inline void v30mz_cpu_device::i_movsb()
inline void v30mz_cpu_device::i_movsw()
{
- UINT16 tmp = GetMemW( DS, m_regs.w[IX] );
+ uint16_t tmp = GetMemW( DS, m_regs.w[IX] );
PutMemW( ES, m_regs.w[IY], tmp );
m_regs.w[IY] += -4 * m_DF + 2;
m_regs.w[IX] += -4 * m_DF + 2;
@@ -928,7 +928,7 @@ inline void v30mz_cpu_device::i_scasw()
inline void v30mz_cpu_device::i_popf()
{
- UINT32 tmp = POP();
+ uint32_t tmp = POP();
ExpandFlags(tmp);
CLK(3);
@@ -941,7 +941,7 @@ inline void v30mz_cpu_device::i_popf()
inline void v30mz_cpu_device::ADDB()
{
- UINT32 res = m_dst + m_src;
+ uint32_t res = m_dst + m_src;
set_CFB(res);
set_OFB_Add(res,m_src,m_dst);
@@ -953,7 +953,7 @@ inline void v30mz_cpu_device::ADDB()
inline void v30mz_cpu_device::ADDW()
{
- UINT32 res = m_dst + m_src;
+ uint32_t res = m_dst + m_src;
set_CFW(res);
set_OFW_Add(res,m_src,m_dst);
@@ -965,7 +965,7 @@ inline void v30mz_cpu_device::ADDW()
inline void v30mz_cpu_device::SUBB()
{
- UINT32 res = m_dst - m_src;
+ uint32_t res = m_dst - m_src;
set_CFB(res);
set_OFB_Sub(res,m_src,m_dst);
@@ -977,7 +977,7 @@ inline void v30mz_cpu_device::SUBB()
inline void v30mz_cpu_device::SUBW()
{
- UINT32 res = m_dst - m_src;
+ uint32_t res = m_dst - m_src;
set_CFW(res);
set_OFW_Sub(res,m_src,m_dst);
@@ -1085,7 +1085,7 @@ inline void v30mz_cpu_device::RORC_WORD()
m_dst >>= 1;
}
-inline void v30mz_cpu_device::SHL_BYTE(UINT8 c)
+inline void v30mz_cpu_device::SHL_BYTE(uint8_t c)
{
m_icount -= c;
m_dst <<= c;
@@ -1094,7 +1094,7 @@ inline void v30mz_cpu_device::SHL_BYTE(UINT8 c)
PutbackRMByte(m_dst);
}
-inline void v30mz_cpu_device::SHL_WORD(UINT8 c)
+inline void v30mz_cpu_device::SHL_WORD(uint8_t c)
{
m_icount -= c;
m_dst <<= c;
@@ -1103,7 +1103,7 @@ inline void v30mz_cpu_device::SHL_WORD(UINT8 c)
PutbackRMWord(m_dst);
}
-inline void v30mz_cpu_device::SHR_BYTE(UINT8 c)
+inline void v30mz_cpu_device::SHR_BYTE(uint8_t c)
{
m_icount -= c;
m_dst >>= c-1;
@@ -1113,7 +1113,7 @@ inline void v30mz_cpu_device::SHR_BYTE(UINT8 c)
PutbackRMByte(m_dst);
}
-inline void v30mz_cpu_device::SHR_WORD(UINT8 c)
+inline void v30mz_cpu_device::SHR_WORD(uint8_t c)
{
m_icount -= c;
m_dst >>= c-1;
@@ -1123,20 +1123,20 @@ inline void v30mz_cpu_device::SHR_WORD(UINT8 c)
PutbackRMWord(m_dst);
}
-inline void v30mz_cpu_device::SHRA_BYTE(UINT8 c)
+inline void v30mz_cpu_device::SHRA_BYTE(uint8_t c)
{
m_icount -= c;
- m_dst = ((INT8)m_dst) >> (c-1);
+ m_dst = ((int8_t)m_dst) >> (c-1);
m_CarryVal = m_dst & 0x1;
m_dst = m_dst >> 1;
set_SZPF_Byte(m_dst);
PutbackRMByte(m_dst);
}
-inline void v30mz_cpu_device::SHRA_WORD(UINT8 c)
+inline void v30mz_cpu_device::SHRA_WORD(uint8_t c)
{
m_icount -= c;
- m_dst = ((INT16)m_dst) >> (c-1);
+ m_dst = ((int16_t)m_dst) >> (c-1);
m_CarryVal = m_dst & 0x1;
m_dst = m_dst >> 1;
set_SZPF_Word(m_dst);
@@ -1144,19 +1144,19 @@ inline void v30mz_cpu_device::SHRA_WORD(UINT8 c)
}
-inline void v30mz_cpu_device::XchgAWReg(UINT8 reg)
+inline void v30mz_cpu_device::XchgAWReg(uint8_t reg)
{
- UINT16 tmp = m_regs.w[reg];
+ uint16_t tmp = m_regs.w[reg];
m_regs.w[reg] = m_regs.w[AW];
m_regs.w[AW] = tmp;
}
-inline void v30mz_cpu_device::IncWordReg(UINT8 reg)
+inline void v30mz_cpu_device::IncWordReg(uint8_t reg)
{
- UINT32 tmp = m_regs.w[reg];
- UINT32 tmp1 = tmp+1;
+ uint32_t tmp = m_regs.w[reg];
+ uint32_t tmp1 = tmp+1;
m_OverVal = (tmp == 0x7fff);
set_AF(tmp1,tmp,1);
@@ -1165,10 +1165,10 @@ inline void v30mz_cpu_device::IncWordReg(UINT8 reg)
}
-inline void v30mz_cpu_device::DecWordReg(UINT8 reg)
+inline void v30mz_cpu_device::DecWordReg(uint8_t reg)
{
- UINT32 tmp = m_regs.w[reg];
- UINT32 tmp1 = tmp-1;
+ uint32_t tmp = m_regs.w[reg];
+ uint32_t tmp1 = tmp-1;
m_OverVal = (tmp == 0x8000);
set_AF(tmp1,tmp,1);
@@ -1177,16 +1177,16 @@ inline void v30mz_cpu_device::DecWordReg(UINT8 reg)
}
-inline void v30mz_cpu_device::PUSH(UINT16 data)
+inline void v30mz_cpu_device::PUSH(uint16_t data)
{
m_regs.w[SP] -= 2;
write_word( ( m_sregs[SS] << 4 ) + m_regs.w[SP], data );
}
-inline UINT16 v30mz_cpu_device::POP()
+inline uint16_t v30mz_cpu_device::POP()
{
- UINT16 data = read_word( ( m_sregs[SS] << 4 ) + m_regs.w[SP] );
+ uint16_t data = read_word( ( m_sregs[SS] << 4 ) + m_regs.w[SP] );
m_regs.w[SP] += 2;
return data;
@@ -1195,7 +1195,7 @@ inline UINT16 v30mz_cpu_device::POP()
inline void v30mz_cpu_device::JMP(bool cond)
{
- int rel = (int)((INT8)fetch());
+ int rel = (int)((int8_t)fetch());
if (cond)
{
@@ -1206,11 +1206,11 @@ inline void v30mz_cpu_device::JMP(bool cond)
}
-inline void v30mz_cpu_device::ADJ4(INT8 param1,INT8 param2)
+inline void v30mz_cpu_device::ADJ4(int8_t param1,int8_t param2)
{
if (AF || ((m_regs.b[AL] & 0xf) > 9))
{
- UINT16 tmp;
+ uint16_t tmp;
tmp = m_regs.b[AL] + param1;
m_regs.b[AL] = tmp;
m_AuxVal = 1;
@@ -1225,7 +1225,7 @@ inline void v30mz_cpu_device::ADJ4(INT8 param1,INT8 param2)
}
-inline void v30mz_cpu_device::ADJB(INT8 param1, INT8 param2)
+inline void v30mz_cpu_device::ADJB(int8_t param1, int8_t param2)
{
if (AF || ((m_regs.b[AL] & 0xf) > 9))
{
@@ -1257,8 +1257,8 @@ void v30mz_cpu_device::interrupt(int int_num)
m_pending_irq &= ~INT_IRQ;
}
- UINT16 dest_off = read_word( int_num * 4 + 0 );
- UINT16 dest_seg = read_word( int_num * 4 + 2 );
+ uint16_t dest_off = read_word( int_num * 4 + 0 );
+ uint16_t dest_seg = read_word( int_num * 4 + 2 );
PUSH(m_sregs[CS]);
PUSH(m_ip);
@@ -1296,7 +1296,7 @@ void v30mz_cpu_device::execute_set_input( int inptnum, int state )
}
-offs_t v30mz_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
+offs_t v30mz_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
{
extern CPU_DISASSEMBLE( nec );
return CPU_DISASSEMBLE_NAME(nec)(this, buffer, pc, oprom, opram, options);
@@ -1355,7 +1355,7 @@ void v30mz_cpu_device::execute_run()
debugger_instruction_hook( this, pc() );
- UINT8 op = fetch_op();
+ uint8_t op = fetch_op();
switch(op)
{
@@ -1460,7 +1460,7 @@ void v30mz_cpu_device::execute_run()
case 0x0f: // i_pre_nec
{
- UINT32 tmp, tmp2;
+ uint32_t tmp, tmp2;
switch ( fetch() )
{
@@ -1581,8 +1581,8 @@ void v30mz_cpu_device::execute_run()
case 0x20:
{
int count = (m_regs.b[CL]+1)/2;
- UINT16 di = m_regs.w[IY];
- UINT16 si = m_regs.w[IX];
+ uint16_t di = m_regs.w[IY];
+ uint16_t si = m_regs.w[IX];
if (m_seg_prefix)
{
logerror("%s: %06x: Warning: seg_prefix defined for add4s\n", tag(), pc());
@@ -1612,8 +1612,8 @@ void v30mz_cpu_device::execute_run()
case 0x22:
{
int count = (m_regs.b[CL]+1)/2;
- UINT16 di = m_regs.w[IY];
- UINT16 si = m_regs.w[IX];
+ uint16_t di = m_regs.w[IY];
+ uint16_t si = m_regs.w[IX];
if (m_seg_prefix)
{
logerror("%s: %06x: Warning: seg_prefix defined for sub4s\n", tag(), pc());
@@ -1652,8 +1652,8 @@ void v30mz_cpu_device::execute_run()
case 0x26:
{
int count = (m_regs.b[CL]+1)/2;
- UINT16 di = m_regs.w[IY];
- UINT16 si = m_regs.w[IX];
+ uint16_t di = m_regs.w[IY];
+ uint16_t si = m_regs.w[IX];
if (m_seg_prefix)
{
logerror("%s: %06x: Warning: seg_prefix defined for cmp4s\n", tag(), pc());
@@ -2232,7 +2232,7 @@ void v30mz_cpu_device::execute_run()
case 0x60: // i_pusha
{
- UINT32 tmp = m_regs.w[SP];
+ uint32_t tmp = m_regs.w[SP];
PUSH(m_regs.w[AW]);
PUSH(m_regs.w[CW]);
@@ -2260,7 +2260,7 @@ void v30mz_cpu_device::execute_run()
case 0x62: // i_chkind
{
- UINT32 low,high,tmp;
+ uint32_t low,high,tmp;
m_modrm = fetch();
low = GetRMWord();
high = GetnextRMWord();
@@ -2280,8 +2280,8 @@ void v30mz_cpu_device::execute_run()
case 0x64: // i_repnc
{
- UINT8 next = repx_op();
- UINT16 c = m_regs.w[CW];
+ uint8_t next = repx_op();
+ uint16_t c = m_regs.w[CW];
switch (next)
{
@@ -2311,8 +2311,8 @@ void v30mz_cpu_device::execute_run()
case 0x65: // i_repc
{
- UINT8 next = repx_op();
- UINT16 c = m_regs.w[CW];
+ uint8_t next = repx_op();
+ uint16_t c = m_regs.w[CW];
switch (next)
{
@@ -2347,28 +2347,28 @@ void v30mz_cpu_device::execute_run()
case 0x69: // i_imul_d16
{
- UINT32 tmp;
+ uint32_t tmp;
DEF_r16w();
tmp = fetch_word();
- m_dst = (INT32)((INT16)m_src)*(INT32)((INT16)tmp);
- m_CarryVal = m_OverVal = (((INT32)m_dst) >> 15 != 0) && (((INT32)m_dst) >> 15 != -1);
+ m_dst = (int32_t)((int16_t)m_src)*(int32_t)((int16_t)tmp);
+ m_CarryVal = m_OverVal = (((int32_t)m_dst) >> 15 != 0) && (((int32_t)m_dst) >> 15 != -1);
RegWord(m_dst);
CLKM(3,4);
}
break;
case 0x6a: // i_push_d8
- PUSH( (UINT16)((INT16)((INT8)fetch())) );
+ PUSH( (uint16_t)((int16_t)((int8_t)fetch())) );
CLK(1);
break;
case 0x6b: // i_imul_d8
{
- UINT32 src2;
+ uint32_t src2;
DEF_r16w();
- src2= (UINT16)((INT16)((INT8)fetch()));
- m_dst = (INT32)((INT16)m_src)*(INT32)((INT16)src2);
- m_CarryVal = m_OverVal = (((INT32)m_dst) >> 15 != 0) && (((INT32)m_dst) >> 15 != -1);
+ src2= (uint16_t)((int16_t)((int8_t)fetch()));
+ m_dst = (int32_t)((int16_t)m_src)*(int32_t)((int16_t)src2);
+ m_CarryVal = m_OverVal = (((int32_t)m_dst) >> 15 != 0) && (((int32_t)m_dst) >> 15 != -1);
RegWord(m_dst);
CLKM(3,4);
}
@@ -2501,7 +2501,7 @@ void v30mz_cpu_device::execute_run()
case 0x82: // i_82pre
m_modrm = fetch();
m_dst = GetRMByte();
- m_src = (INT8)fetch();
+ m_src = (int8_t)fetch();
if (m_modrm >=0xc0 ) { CLK(1); }
else if ((m_modrm & 0x38)==0x38) { CLK(2); }
else { CLK(3); }
@@ -2522,7 +2522,7 @@ void v30mz_cpu_device::execute_run()
case 0x83: // i_83pre
m_modrm = fetch();
m_dst = GetRMWord();
- m_src = ((INT16)((INT8)fetch()));
+ m_src = ((int16_t)((int8_t)fetch()));
if ( m_modrm >= 0xc0 ) { CLK(1); }
else if (( m_modrm & 0x38 ) == 0x38) { CLK(2); }
else { CLK(3); }
@@ -2690,8 +2690,8 @@ void v30mz_cpu_device::execute_run()
case 0x9a: // i_call_far
{
- UINT16 tmp = fetch_word();
- UINT16 tmp2 = fetch_word();
+ uint16_t tmp = fetch_word();
+ uint16_t tmp2 = fetch_word();
PUSH(m_sregs[CS]);
PUSH(m_ip);
m_ip = tmp;
@@ -2715,7 +2715,7 @@ void v30mz_cpu_device::execute_run()
case 0x9e: // i_sahf
{
- UINT32 tmp = (CompressFlags() & 0xff00) | (m_regs.b[AH] & 0xd5);
+ uint32_t tmp = (CompressFlags() & 0xff00) | (m_regs.b[AH] & 0xd5);
ExpandFlags(tmp);
CLK(4);
}
@@ -2729,7 +2729,7 @@ void v30mz_cpu_device::execute_run()
case 0xa0: // i_mov_aldisp
{
- UINT32 addr = fetch_word();
+ uint32_t addr = fetch_word();
m_regs.b[AL] = GetMemB(DS, addr);
CLK(1);
}
@@ -2737,7 +2737,7 @@ void v30mz_cpu_device::execute_run()
case 0xa1: // i_mov_axdisp
{
- UINT32 addr = fetch_word();
+ uint32_t addr = fetch_word();
m_regs.b[AL] = GetMemB(DS, addr);
m_regs.b[AH] = GetMemB(DS, addr+1);
CLK(1);
@@ -2746,7 +2746,7 @@ void v30mz_cpu_device::execute_run()
case 0xa2: // i_mov_dispal
{
- UINT32 addr = fetch_word();
+ uint32_t addr = fetch_word();
PutMemB(DS, addr, m_regs.b[AL]);
CLK(1);
}
@@ -2754,7 +2754,7 @@ void v30mz_cpu_device::execute_run()
case 0xa3: // i_mov_dispax
{
- UINT32 addr = fetch_word();
+ uint32_t addr = fetch_word();
PutMemB(DS, addr, m_regs.b[AL]);
PutMemB(DS, addr+1, m_regs.b[AH]);
CLK(1);
@@ -2907,7 +2907,7 @@ void v30mz_cpu_device::execute_run()
case 0xc0: // i_rotshft_bd8
{
- UINT8 c;
+ uint8_t c;
m_modrm = fetch();
m_src = GetRMByte();
m_dst = m_src;
@@ -2932,7 +2932,7 @@ void v30mz_cpu_device::execute_run()
case 0xc1: // i_rotshft_wd8
{
- UINT8 c;
+ uint8_t c;
m_modrm = fetch();
m_src = GetRMWord();
m_dst = m_src;
@@ -2958,7 +2958,7 @@ void v30mz_cpu_device::execute_run()
case 0xc2: // i_ret_d16
{
- UINT32 count = fetch_word();
+ uint32_t count = fetch_word();
m_ip = POP();
m_regs.w[SP] += count;
CLK(6);
@@ -2999,8 +2999,8 @@ void v30mz_cpu_device::execute_run()
case 0xc8: // i_enter
{
- UINT16 nb = fetch();
- UINT32 level;
+ uint16_t nb = fetch();
+ uint32_t level;
CLK(8);
nb |= fetch() << 8;
@@ -3029,7 +3029,7 @@ void v30mz_cpu_device::execute_run()
case 0xca: // i_retf_d16
{
- UINT32 count = fetch_word();
+ uint32_t count = fetch_word();
m_ip = POP();
m_sregs[CS] = POP();
m_regs.w[SP] += count;
@@ -3108,7 +3108,7 @@ void v30mz_cpu_device::execute_run()
case 0xd2: // i_rotshft_bcl
{
- UINT8 c;
+ uint8_t c;
m_modrm = fetch();
m_src = GetRMByte();
@@ -3134,7 +3134,7 @@ void v30mz_cpu_device::execute_run()
case 0xd3: // i_rotshft_wcl
{
- UINT8 c;
+ uint8_t c;
m_modrm = fetch();
m_src = GetRMWord();
@@ -3194,7 +3194,7 @@ void v30mz_cpu_device::execute_run()
case 0xe0: // i_loopne
{
- INT8 disp = (INT8)fetch();
+ int8_t disp = (int8_t)fetch();
m_regs.w[CW]--;
if (!ZF && m_regs.w[CW])
@@ -3208,7 +3208,7 @@ void v30mz_cpu_device::execute_run()
case 0xe1: // i_loope
{
- INT8 disp = (INT8)fetch();
+ int8_t disp = (int8_t)fetch();
m_regs.w[CW]--;
if (ZF && m_regs.w[CW])
@@ -3222,7 +3222,7 @@ void v30mz_cpu_device::execute_run()
case 0xe2: // i_loop
{
- INT8 disp = (INT8)fetch();
+ int8_t disp = (int8_t)fetch();
m_regs.w[CW]--;
if (m_regs.w[CW])
@@ -3236,7 +3236,7 @@ void v30mz_cpu_device::execute_run()
case 0xe3: // i_jcxz
{
- INT8 disp = (INT8)fetch();
+ int8_t disp = (int8_t)fetch();
if (m_regs.w[CW] == 0)
{
@@ -3254,7 +3254,7 @@ void v30mz_cpu_device::execute_run()
case 0xe5: // i_inax
{
- UINT8 port = fetch();
+ uint8_t port = fetch();
m_regs.b[AL] = read_port(port);
m_regs.b[AH] = read_port(port+1);
@@ -3269,7 +3269,7 @@ void v30mz_cpu_device::execute_run()
case 0xe7: // i_outax
{
- UINT8 port = fetch();
+ uint8_t port = fetch();
write_port(port, m_regs.b[AL]);
write_port(port+1, m_regs.b[AH]);
@@ -3280,7 +3280,7 @@ void v30mz_cpu_device::execute_run()
case 0xe8: // i_call_d16
{
- INT16 tmp = (INT16)fetch_word();
+ int16_t tmp = (int16_t)fetch_word();
PUSH(m_ip);
m_ip = m_ip + tmp;
@@ -3290,7 +3290,7 @@ void v30mz_cpu_device::execute_run()
case 0xe9: // i_jmp_d16
{
- INT16 offset = (INT16)fetch_word();
+ int16_t offset = (int16_t)fetch_word();
m_ip += offset;
CLK(4);
}
@@ -3298,8 +3298,8 @@ void v30mz_cpu_device::execute_run()
case 0xea: // i_jmp_far
{
- UINT16 tmp = fetch_word();
- UINT16 tmp1 = fetch_word();
+ uint16_t tmp = fetch_word();
+ uint16_t tmp1 = fetch_word();
m_sregs[CS] = tmp1;
m_ip = tmp;
@@ -3309,14 +3309,14 @@ void v30mz_cpu_device::execute_run()
case 0xeb: // i_jmp_d8
{
- int tmp = (int)((INT8)fetch());
+ int tmp = (int)((int8_t)fetch());
CLK(4);
if (tmp==-2 && m_no_interrupt==0 && (m_pending_irq==0) && m_icount>0)
{
m_icount%=12; /* cycle skip */
}
- m_ip = (UINT16)(m_ip+tmp);
+ m_ip = (uint16_t)(m_ip+tmp);
}
break;
@@ -3327,7 +3327,7 @@ void v30mz_cpu_device::execute_run()
case 0xed: // i_inaxdx
{
- UINT32 port = m_regs.w[DW];
+ uint32_t port = m_regs.w[DW];
m_regs.b[AL] = read_port(port);
m_regs.b[AH] = read_port(port+1);
@@ -3342,7 +3342,7 @@ void v30mz_cpu_device::execute_run()
case 0xef: // i_outdxax
{
- UINT32 port = m_regs.w[DW];
+ uint32_t port = m_regs.w[DW];
write_port(port, m_regs.b[AL]);
write_port(port+1, m_regs.b[AH]);
@@ -3359,8 +3359,8 @@ void v30mz_cpu_device::execute_run()
case 0xf2: // i_repne
{
- UINT8 next = repx_op();
- UINT16 c = m_regs.w[CW];
+ uint8_t next = repx_op();
+ uint16_t c = m_regs.w[CW];
switch (next)
{
@@ -3389,8 +3389,8 @@ void v30mz_cpu_device::execute_run()
case 0xf3: // i_repe
{
- UINT8 next = repx_op();
- UINT16 c = m_regs.w[CW];
+ uint8_t next = repx_op();
+ uint16_t c = m_regs.w[CW];
switch (next)
{
@@ -3429,9 +3429,9 @@ void v30mz_cpu_device::execute_run()
case 0xf6: // i_f6pre
{
- UINT32 tmp;
- UINT32 uresult,uresult2;
- INT32 result,result2;
+ uint32_t tmp;
+ uint32_t uresult,uresult2;
+ int32_t result,result2;
m_modrm = fetch();
tmp = GetRMByte();
@@ -3459,13 +3459,13 @@ void v30mz_cpu_device::execute_run()
break;
case 0x20: /* MULU */
uresult = m_regs.b[AL] * tmp;
- m_regs.w[AW] = (UINT16)uresult;
+ m_regs.w[AW] = (uint16_t)uresult;
m_CarryVal = m_OverVal = (m_regs.b[AH]!=0) ? 1 : 0;
CLKM(3,4);
break;
case 0x28: /* MUL */
- result = (INT16)((INT8)m_regs.b[AL])*(INT16)((INT8)tmp);
- m_regs.w[AW] = (UINT16)result;
+ result = (int16_t)((int8_t)m_regs.b[AL])*(int16_t)((int8_t)tmp);
+ m_regs.w[AW] = (uint16_t)result;
m_CarryVal = m_OverVal = (m_regs.b[AH]!=0) ? 1 : 0;
CLKM(3,4);
break;
@@ -3493,9 +3493,9 @@ void v30mz_cpu_device::execute_run()
case 0x38: /* DIV */
if (tmp)
{
- result = (INT16)m_regs.w[AW];
- result2 = result % (INT16)((INT8)tmp);
- if ((result /= (INT16)((INT8)tmp)) > 0xff)
+ result = (int16_t)m_regs.w[AW];
+ result2 = result % (int16_t)((int8_t)tmp);
+ if ((result /= (int16_t)((int8_t)tmp)) > 0xff)
{
interrupt(0);
}
@@ -3518,9 +3518,9 @@ void v30mz_cpu_device::execute_run()
case 0xf7: // i_f7pre
{
- UINT32 tmp,tmp2;
- UINT32 uresult,uresult2;
- INT32 result,result2;
+ uint32_t tmp,tmp2;
+ uint32_t uresult,uresult2;
+ int32_t result,result2;
m_modrm = fetch();
tmp = GetRMWord();
@@ -3550,12 +3550,12 @@ void v30mz_cpu_device::execute_run()
case 0x20: /* MULU */
uresult = m_regs.w[AW]*tmp;
m_regs.w[AW] = uresult & 0xffff;
- m_regs.w[DW] = ((UINT32)uresult)>>16;
+ m_regs.w[DW] = ((uint32_t)uresult)>>16;
m_CarryVal = m_OverVal = (m_regs.w[DW] != 0) ? 1 : 0;
CLKM(3,4);
break;
case 0x28: /* MUL */
- result = (INT32)((INT16)m_regs.w[AW]) * (INT32)((INT16)tmp);
+ result = (int32_t)((int16_t)m_regs.w[AW]) * (int32_t)((int16_t)tmp);
m_regs.w[AW] = result & 0xffff;
m_regs.w[DW] = result >> 16;
m_CarryVal = m_OverVal = (m_regs.w[DW] != 0) ? 1 : 0;
@@ -3564,7 +3564,7 @@ void v30mz_cpu_device::execute_run()
case 0x30: /* DIVU */
if (tmp)
{
- uresult = (((UINT32)m_regs.w[DW]) << 16) | m_regs.w[AW];
+ uresult = (((uint32_t)m_regs.w[DW]) << 16) | m_regs.w[AW];
uresult2 = uresult % tmp;
if ((uresult /= tmp) > 0xffff)
{
@@ -3585,9 +3585,9 @@ void v30mz_cpu_device::execute_run()
case 0x38: /* DIV */
if (tmp)
{
- result = ((UINT32)m_regs.w[DW] << 16) + m_regs.w[AW];
- result2 = result % (INT32)((INT16)tmp);
- if ((result /= (INT32)((INT16)tmp)) > 0xffff)
+ result = ((uint32_t)m_regs.w[DW] << 16) + m_regs.w[AW];
+ result2 = result % (int32_t)((int16_t)tmp);
+ if ((result /= (int32_t)((int16_t)tmp)) > 0xffff)
{
interrupt(0);
}
@@ -3640,7 +3640,7 @@ void v30mz_cpu_device::execute_run()
case 0xfe: // i_fepre
{
- UINT32 tmp, tmp1;
+ uint32_t tmp, tmp1;
m_modrm = fetch();
tmp = GetRMByte();
switch ( m_modrm & 0x38 )
@@ -3670,7 +3670,7 @@ void v30mz_cpu_device::execute_run()
case 0xff: // i_ffpre
{
- UINT32 tmp, tmp1;
+ uint32_t tmp, tmp1;
m_modrm = fetch();
tmp = GetRMWord();
switch ( m_modrm & 0x38 )