summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/tms32031/tms32031.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/tms32031/tms32031.cpp')
-rw-r--r--src/devices/cpu/tms32031/tms32031.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/devices/cpu/tms32031/tms32031.cpp b/src/devices/cpu/tms32031/tms32031.cpp
index 22593bc9e15..a2a86c8b89a 100644
--- a/src/devices/cpu/tms32031/tms32031.cpp
+++ b/src/devices/cpu/tms32031/tms32031.cpp
@@ -144,7 +144,7 @@ float tms3203x_device::tmsreg::as_float() const
else
{
int exp = (exponent() + 127) << 23;
- INT32 man = -mantissa();
+ int32_t man = -mantissa();
id.i[0] = 0x80000000 + exp + ((man >> 8) & 0x00ffffff);
}
@@ -179,7 +179,7 @@ double tms3203x_device::tmsreg::as_double() const
else
{
int exp = (exponent() + 1023) << 20;
- INT32 man = -mantissa();
+ int32_t man = -mantissa();
id.i[BYTE_XOR_BE(0)] = 0x80000000 + exp + ((man >> 11) & 0x001fffff);
id.i[BYTE_XOR_BE(1)] = (man << 21) & 0xffe00000;
}
@@ -199,8 +199,8 @@ void tms3203x_device::tmsreg::from_double(double val)
// extract mantissa and exponent from the IEEE input
int_double id;
id.d = val;
- INT32 mantissa = ((id.i[BYTE_XOR_BE(0)] & 0x000fffff) << 11) | ((id.i[BYTE_XOR_BE(1)] & 0xffe00000) >> 21);
- INT32 exponent = ((id.i[BYTE_XOR_BE(0)] & 0x7ff00000) >> 20) - 1023;
+ int32_t mantissa = ((id.i[BYTE_XOR_BE(0)] & 0x000fffff) << 11) | ((id.i[BYTE_XOR_BE(1)] & 0xffe00000) >> 21);
+ int32_t exponent = ((id.i[BYTE_XOR_BE(0)] & 0x7ff00000) >> 20) - 1023;
// if we're too small, map to 0
if (exponent < -128)
@@ -212,7 +212,7 @@ void tms3203x_device::tmsreg::from_double(double val)
// if we're too large, map to the maximum value
else if (exponent > 127)
{
- if ((INT32)id.i[BYTE_XOR_BE(0)] >= 0)
+ if ((int32_t)id.i[BYTE_XOR_BE(0)] >= 0)
set_mantissa(0x7fffffff);
else
set_mantissa(0x80000001);
@@ -220,7 +220,7 @@ void tms3203x_device::tmsreg::from_double(double val)
}
// if we're positive, map directly
- else if ((INT32)id.i[BYTE_XOR_BE(0)] >= 0)
+ else if ((int32_t)id.i[BYTE_XOR_BE(0)] >= 0)
{
set_mantissa(mantissa);
set_exponent(exponent);
@@ -251,7 +251,7 @@ void tms3203x_device::tmsreg::from_double(double val)
// tms3203x_device - constructor
//-------------------------------------------------
-tms3203x_device::tms3203x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 chiptype, address_map_constructor internal_map, const char *shortname, const char *source)
+tms3203x_device::tms3203x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t chiptype, address_map_constructor internal_map, const char *shortname, const char *source)
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source),
m_program_config("program", ENDIANNESS_LITTLE, 32, 24, -2, internal_map),
m_chip_type(chiptype),
@@ -280,12 +280,12 @@ tms3203x_device::tms3203x_device(const machine_config &mconfig, device_type type
#endif
}
-tms32031_device::tms32031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+tms32031_device::tms32031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: tms3203x_device(mconfig, TMS32031, "TMS32031", tag, owner, clock, CHIP_TYPE_TMS32031, ADDRESS_MAP_NAME(internal_32031), "tms32031", __FILE__)
{
}
-tms32032_device::tms32032_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+tms32032_device::tms32032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: tms3203x_device(mconfig, TMS32032, "TMS32032", tag, owner, clock, CHIP_TYPE_TMS32032, ADDRESS_MAP_NAME(internal_32032), "tms32032", __FILE__)
{
}
@@ -337,7 +337,7 @@ const tiny_rom_entry *tms3203x_device::device_rom_region() const
// ROPCODE - fetch an opcode
//-------------------------------------------------
-inline UINT32 tms3203x_device::ROPCODE(offs_t pc)
+inline uint32_t tms3203x_device::ROPCODE(offs_t pc)
{
return m_direct->read_dword(pc << 2);
}
@@ -347,7 +347,7 @@ inline UINT32 tms3203x_device::ROPCODE(offs_t pc)
// RMEM - read memory
//-------------------------------------------------
-inline UINT32 tms3203x_device::RMEM(offs_t addr)
+inline uint32_t tms3203x_device::RMEM(offs_t addr)
{
if (m_mcbl_mode && addr < 0x1000)
return m_bootrom[addr];
@@ -360,7 +360,7 @@ inline UINT32 tms3203x_device::RMEM(offs_t addr)
// WMEM - write memory
//-------------------------------------------------
-inline void tms3203x_device::WMEM(offs_t addr, UINT32 data)
+inline void tms3203x_device::WMEM(offs_t addr, uint32_t data)
{
m_program->write_dword(addr << 2, data);
}
@@ -382,7 +382,7 @@ void tms3203x_device::device_start()
m_iack_cb.resolve_safe();
// set up the internal boot loader ROM
- m_bootrom = reinterpret_cast<UINT32*>(memregion(shortname())->base());
+ m_bootrom = reinterpret_cast<uint32_t*>(memregion(shortname())->base());
m_direct->set_direct_update(direct_update_delegate(FUNC(tms3203x_device::direct_handler), this));
// save state
@@ -547,7 +547,7 @@ void tms3203x_device::state_string_export(const device_state_entry &entry, std::
break;
case STATE_GENFLAGS:
- UINT32 temp = m_r[TMR_ST].i32[0];
+ uint32_t temp = m_r[TMR_ST].i32[0];
str = string_format("%c%c%c%c%c%c%c%c",
(temp & 0x80) ? 'O':'.',
(temp & 0x40) ? 'U':'.',
@@ -567,7 +567,7 @@ void tms3203x_device::state_string_export(const device_state_entry &entry, std::
// of the shortest instruction, in bytes
//-------------------------------------------------
-UINT32 tms3203x_device::disasm_min_opcode_bytes() const
+uint32_t tms3203x_device::disasm_min_opcode_bytes() const
{
return 4;
}
@@ -578,7 +578,7 @@ UINT32 tms3203x_device::disasm_min_opcode_bytes() const
// of the longest instruction, in bytes
//-------------------------------------------------
-UINT32 tms3203x_device::disasm_max_opcode_bytes() const
+uint32_t tms3203x_device::disasm_max_opcode_bytes() const
{
return 4;
}
@@ -589,7 +589,7 @@ UINT32 tms3203x_device::disasm_max_opcode_bytes() const
// helper function
//-------------------------------------------------
-offs_t tms3203x_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
+offs_t tms3203x_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
{
extern CPU_DISASSEMBLE( tms3203x );
return CPU_DISASSEMBLE_NAME(tms3203x)(this, buffer, pc, oprom, opram, options);
@@ -606,9 +606,9 @@ offs_t tms3203x_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8
// floating-point format a 32-bit IEEE float
//-------------------------------------------------
-float tms3203x_device::fp_to_float(UINT32 floatdata)
+float tms3203x_device::fp_to_float(uint32_t floatdata)
{
- tmsreg gen(floatdata << 8, (INT32)floatdata >> 24);
+ tmsreg gen(floatdata << 8, (int32_t)floatdata >> 24);
return gen.as_float();
}
@@ -618,9 +618,9 @@ float tms3203x_device::fp_to_float(UINT32 floatdata)
// floating-point format a 64-bit IEEE double
//-------------------------------------------------
-double tms3203x_device::fp_to_double(UINT32 floatdata)
+double tms3203x_device::fp_to_double(uint32_t floatdata)
{
- tmsreg gen(floatdata << 8, (INT32)floatdata >> 24);
+ tmsreg gen(floatdata << 8, (int32_t)floatdata >> 24);
return gen.as_double();
}
@@ -630,10 +630,10 @@ double tms3203x_device::fp_to_double(UINT32 floatdata)
// a 32-bit DSP floating-point value
//-------------------------------------------------
-UINT32 tms3203x_device::float_to_fp(float fval)
+uint32_t tms3203x_device::float_to_fp(float fval)
{
tmsreg gen(fval);
- return (gen.exponent() << 24) | ((UINT32)gen.mantissa() >> 8);
+ return (gen.exponent() << 24) | ((uint32_t)gen.mantissa() >> 8);
}
@@ -642,10 +642,10 @@ UINT32 tms3203x_device::float_to_fp(float fval)
// a 32-bit DSP floating-point value
//-------------------------------------------------
-UINT32 tms3203x_device::double_to_fp(double dval)
+uint32_t tms3203x_device::double_to_fp(double dval)
{
tmsreg gen(dval);
- return (gen.exponent() << 24) | ((UINT32)gen.mantissa() >> 8);
+ return (gen.exponent() << 24) | ((uint32_t)gen.mantissa() >> 8);
}
@@ -662,7 +662,7 @@ UINT32 tms3203x_device::double_to_fp(double dval)
void tms3203x_device::check_irqs()
{
// determine if we have any live interrupts
- UINT16 validints = IREG(TMR_IF) & IREG(TMR_IE) & 0x0fff;
+ uint16_t validints = IREG(TMR_IF) & IREG(TMR_IE) & 0x0fff;
if (validints == 0 || (IREG(TMR_ST) & GIEFLAG) == 0)
return;
@@ -679,7 +679,7 @@ void tms3203x_device::check_irqs()
m_is_idling = false;
if (!m_delayed)
{
- UINT16 intmask = 1 << (whichtrap - 1);
+ uint16_t intmask = 1 << (whichtrap - 1);
// bit in IF is cleared when interrupt is taken
IREG(TMR_IF) &= ~intmask;
@@ -700,7 +700,7 @@ void tms3203x_device::check_irqs()
// cycles it takes for one instruction to execute
//-------------------------------------------------
-UINT32 tms3203x_device::execute_min_cycles() const
+uint32_t tms3203x_device::execute_min_cycles() const
{
return 1;
}
@@ -711,7 +711,7 @@ UINT32 tms3203x_device::execute_min_cycles() const
// cycles it takes for one instruction to execute
//-------------------------------------------------
-UINT32 tms3203x_device::execute_max_cycles() const
+uint32_t tms3203x_device::execute_max_cycles() const
{
return 4;
}
@@ -722,7 +722,7 @@ UINT32 tms3203x_device::execute_max_cycles() const
// input/interrupt lines
//-------------------------------------------------
-UINT32 tms3203x_device::execute_input_lines() const
+uint32_t tms3203x_device::execute_input_lines() const
{
return (m_chip_type == CHIP_TYPE_TMS32032) ? 13 : 12;
}
@@ -747,7 +747,7 @@ void tms3203x_device::execute_set_input(int inputnum, int state)
}
// update the external state
- UINT16 intmask = 1 << inputnum;
+ uint16_t intmask = 1 << inputnum;
if (state == ASSERT_LINE)
{
m_irq_state |= intmask;
@@ -787,7 +787,7 @@ void tms3203x_device::execute_run()
{
if ((IREG(TMR_ST) & RMFLAG) && m_pc == IREG(TMR_RE) + 1)
{
- if ((INT32)--IREG(TMR_RC) >= 0)
+ if ((int32_t)--IREG(TMR_RC) >= 0)
m_pc = IREG(TMR_RS);
else
{
@@ -819,7 +819,7 @@ void tms3203x_device::execute_run()
machine().debug_break();
if ((IREG(TMR_ST) & RMFLAG) && m_pc == IREG(TMR_RE) + 1)
{
- if ((INT32)--IREG(TMR_RC) >= 0)
+ if ((int32_t)--IREG(TMR_RC) >= 0)
m_pc = IREG(TMR_RS);
else
{