summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/sh2/sh2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/sh2/sh2.cpp')
-rw-r--r--src/devices/cpu/sh2/sh2.cpp544
1 files changed, 272 insertions, 272 deletions
diff --git a/src/devices/cpu/sh2/sh2.cpp b/src/devices/cpu/sh2/sh2.cpp
index 140f59929d1..415d9cd9645 100644
--- a/src/devices/cpu/sh2/sh2.cpp
+++ b/src/devices/cpu/sh2/sh2.cpp
@@ -69,7 +69,7 @@
20010207 Sylvain Glaize (mokona@puupuu.org)
- - Bug fix in void MOVBM(UINT32 m, UINT32 n) (see comment)
+ - Bug fix in void MOVBM(uint32_t m, uint32_t n) (see comment)
- Support of full 32 bit addressing (RB, RW, RL and WB, WW, WL functions)
reason : when the two high bits of the address are set, access is
done directly in the cache data array. The SUPER KANEKO NOVA SYSTEM
@@ -169,7 +169,7 @@ static ADDRESS_MAP_START( sh7032_map, AS_PROGRAM, 32, sh1_device )
AM_RANGE(0x05fffe00, 0x05ffffff) AM_READWRITE16(sh7032_r,sh7032_w,0xffffffff) // SH-7032H internal i/o
ADDRESS_MAP_END
-sh2_device::sh2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+sh2_device::sh2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: cpu_device(mconfig, SH2, "SH-2", tag, owner, clock, "sh2", __FILE__)
, m_program_config("program", ENDIANNESS_BIG, 32, 32, 0, ADDRESS_MAP_NAME(sh7604_map))
, m_decrypted_program_config("decrypted_opcodes", ENDIANNESS_BIG, 32, 32, 0)
@@ -202,7 +202,7 @@ void sh2_device::device_stop()
}
-sh2_device::sh2_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, int cpu_type, address_map_constructor internal_map, int addrlines )
+sh2_device::sh2_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, int cpu_type, address_map_constructor internal_map, int addrlines )
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source)
, m_program_config("program", ENDIANNESS_BIG, 32, addrlines, 0, internal_map)
, m_decrypted_program_config("decrypted_opcodes", ENDIANNESS_BIG, 32, addrlines, 0)
@@ -228,12 +228,12 @@ sh2_device::sh2_device(const machine_config &mconfig, device_type type, const ch
m_isdrc = allow_drc();
}
-sh2a_device::sh2a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+sh2a_device::sh2a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: sh2_device(mconfig, SH1, "SH-2A", tag, owner, clock, "sh2a", __FILE__, CPU_TYPE_SH2, ADDRESS_MAP_NAME(sh7021_map), 28 )
{
}
-sh1_device::sh1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+sh1_device::sh1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: sh2_device(mconfig, SH1, "SH-1", tag, owner, clock, "sh1", __FILE__, CPU_TYPE_SH1, ADDRESS_MAP_NAME(sh7032_map), 28 )
{
}
@@ -248,7 +248,7 @@ const address_space_config *sh2_device::memory_space_config(address_spacenum spa
}
}
-offs_t sh2_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
+offs_t sh2_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
{
extern CPU_DISASSEMBLE( sh2 );
return CPU_DISASSEMBLE_NAME( sh2 )(this, buffer, pc, oprom, opram, options);
@@ -262,7 +262,7 @@ offs_t sh2_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opro
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
-UINT8 sh2_device::RB(offs_t A)
+uint8_t sh2_device::RB(offs_t A)
{
if((A & 0xf0000000) == 0 || (A & 0xf0000000) == 0x20000000)
return m_program->read_byte(A & AM);
@@ -270,7 +270,7 @@ UINT8 sh2_device::RB(offs_t A)
return m_program->read_byte(A);
}
-UINT16 sh2_device::RW(offs_t A)
+uint16_t sh2_device::RW(offs_t A)
{
if((A & 0xf0000000) == 0 || (A & 0xf0000000) == 0x20000000)
return m_program->read_word(A & AM);
@@ -278,7 +278,7 @@ UINT16 sh2_device::RW(offs_t A)
return m_program->read_word(A);
}
-UINT32 sh2_device::RL(offs_t A)
+uint32_t sh2_device::RL(offs_t A)
{
/* 0x20000000 no Cache */
/* 0x00000000 read thru Cache if CE bit is 1 */
@@ -288,7 +288,7 @@ UINT32 sh2_device::RL(offs_t A)
return m_program->read_dword(A);
}
-void sh2_device::WB(offs_t A, UINT8 V)
+void sh2_device::WB(offs_t A, uint8_t V)
{
if((A & 0xf0000000) == 0 || (A & 0xf0000000) == 0x20000000)
{
@@ -299,7 +299,7 @@ void sh2_device::WB(offs_t A, UINT8 V)
m_program->write_byte(A,V);
}
-void sh2_device::WW(offs_t A, UINT16 V)
+void sh2_device::WW(offs_t A, uint16_t V)
{
if((A & 0xf0000000) == 0 || (A & 0xf0000000) == 0x20000000)
{
@@ -310,7 +310,7 @@ void sh2_device::WW(offs_t A, UINT16 V)
m_program->write_word(A,V);
}
-void sh2_device::WL(offs_t A, UINT32 V)
+void sh2_device::WL(offs_t A, uint32_t V)
{
if((A & 0xf0000000) == 0 || (A & 0xf0000000) == 0x20000000)
{
@@ -327,7 +327,7 @@ void sh2_device::WL(offs_t A, UINT32 V)
* 0011 nnnn mmmm 1100 1 -
* ADD Rm,Rn
*/
-void sh2_device::ADD(UINT32 m, UINT32 n)
+void sh2_device::ADD(uint32_t m, uint32_t n)
{
m_sh2_state->r[n] += m_sh2_state->r[m];
}
@@ -336,18 +336,18 @@ void sh2_device::ADD(UINT32 m, UINT32 n)
* 0111 nnnn iiii iiii 1 -
* ADD #imm,Rn
*/
-void sh2_device::ADDI(UINT32 i, UINT32 n)
+void sh2_device::ADDI(uint32_t i, uint32_t n)
{
- m_sh2_state->r[n] += (INT32)(INT16)(INT8)i;
+ m_sh2_state->r[n] += (int32_t)(int16_t)(int8_t)i;
}
/* code cycles t-bit
* 0011 nnnn mmmm 1110 1 carry
* ADDC Rm,Rn
*/
-void sh2_device::ADDC(UINT32 m, UINT32 n)
+void sh2_device::ADDC(uint32_t m, uint32_t n)
{
- UINT32 tmp0, tmp1;
+ uint32_t tmp0, tmp1;
tmp1 = m_sh2_state->r[n] + m_sh2_state->r[m];
tmp0 = m_sh2_state->r[n];
@@ -364,21 +364,21 @@ void sh2_device::ADDC(UINT32 m, UINT32 n)
* 0011 nnnn mmmm 1111 1 overflow
* ADDV Rm,Rn
*/
-void sh2_device::ADDV(UINT32 m, UINT32 n)
+void sh2_device::ADDV(uint32_t m, uint32_t n)
{
- INT32 dest, src, ans;
+ int32_t dest, src, ans;
- if ((INT32) m_sh2_state->r[n] >= 0)
+ if ((int32_t) m_sh2_state->r[n] >= 0)
dest = 0;
else
dest = 1;
- if ((INT32) m_sh2_state->r[m] >= 0)
+ if ((int32_t) m_sh2_state->r[m] >= 0)
src = 0;
else
src = 1;
src += dest;
m_sh2_state->r[n] += m_sh2_state->r[m];
- if ((INT32) m_sh2_state->r[n] >= 0)
+ if ((int32_t) m_sh2_state->r[n] >= 0)
ans = 0;
else
ans = 1;
@@ -398,7 +398,7 @@ void sh2_device::ADDV(UINT32 m, UINT32 n)
* 0010 nnnn mmmm 1001 1 -
* AND Rm,Rn
*/
-void sh2_device::AND(UINT32 m, UINT32 n)
+void sh2_device::AND(uint32_t m, uint32_t n)
{
m_sh2_state->r[n] &= m_sh2_state->r[m];
}
@@ -408,7 +408,7 @@ void sh2_device::AND(UINT32 m, UINT32 n)
* 1100 1001 iiii iiii 1 -
* AND #imm,R0
*/
-void sh2_device::ANDI(UINT32 i)
+void sh2_device::ANDI(uint32_t i)
{
m_sh2_state->r[0] &= i;
}
@@ -417,9 +417,9 @@ void sh2_device::ANDI(UINT32 i)
* 1100 1101 iiii iiii 1 -
* AND.B #imm,@(R0,GBR)
*/
-void sh2_device::ANDM(UINT32 i)
+void sh2_device::ANDM(uint32_t i)
{
- UINT32 temp;
+ uint32_t temp;
m_sh2_state->ea = m_sh2_state->gbr + m_sh2_state->r[0];
temp = i & RB( m_sh2_state->ea );
@@ -431,11 +431,11 @@ void sh2_device::ANDM(UINT32 i)
* 1000 1011 dddd dddd 3/1 -
* BF disp8
*/
-void sh2_device::BF(UINT32 d)
+void sh2_device::BF(uint32_t d)
{
if ((m_sh2_state->sr & T) == 0)
{
- INT32 disp = ((INT32)d << 24) >> 24;
+ int32_t disp = ((int32_t)d << 24) >> 24;
m_sh2_state->pc = m_sh2_state->ea = m_sh2_state->pc + disp * 2 + 2;
m_sh2_state->icount -= 2;
}
@@ -445,11 +445,11 @@ void sh2_device::BF(UINT32 d)
* 1000 1111 dddd dddd 3/1 -
* BFS disp8
*/
-void sh2_device::BFS(UINT32 d)
+void sh2_device::BFS(uint32_t d)
{
if ((m_sh2_state->sr & T) == 0)
{
- INT32 disp = ((INT32)d << 24) >> 24;
+ int32_t disp = ((int32_t)d << 24) >> 24;
m_delay = m_sh2_state->ea = m_sh2_state->pc + disp * 2 + 2;
m_sh2_state->icount--;
}
@@ -459,14 +459,14 @@ void sh2_device::BFS(UINT32 d)
* 1010 dddd dddd dddd 2 -
* BRA disp12
*/
-void sh2_device::BRA(UINT32 d)
+void sh2_device::BRA(uint32_t d)
{
- INT32 disp = ((INT32)d << 20) >> 20;
+ int32_t disp = ((int32_t)d << 20) >> 20;
#if BUSY_LOOP_HACKS
if (disp == -2)
{
- UINT32 next_opcode = RW(m_sh2_state->pc & AM);
+ uint32_t next_opcode = RW(m_sh2_state->pc & AM);
/* BRA $
* NOP
*/
@@ -482,7 +482,7 @@ void sh2_device::BRA(UINT32 d)
* 0000 mmmm 0010 0011 2 -
* BRAF Rm
*/
-void sh2_device::BRAF(UINT32 m)
+void sh2_device::BRAF(uint32_t m)
{
m_delay = m_sh2_state->pc + m_sh2_state->r[m] + 2;
m_sh2_state->icount--;
@@ -492,9 +492,9 @@ void sh2_device::BRAF(UINT32 m)
* 1011 dddd dddd dddd 2 -
* BSR disp12
*/
-void sh2_device::BSR(UINT32 d)
+void sh2_device::BSR(uint32_t d)
{
- INT32 disp = ((INT32)d << 20) >> 20;
+ int32_t disp = ((int32_t)d << 20) >> 20;
m_sh2_state->pr = m_sh2_state->pc + 2;
m_delay = m_sh2_state->ea = m_sh2_state->pc + disp * 2 + 2;
@@ -505,7 +505,7 @@ void sh2_device::BSR(UINT32 d)
* 0000 mmmm 0000 0011 2 -
* BSRF Rm
*/
-void sh2_device::BSRF(UINT32 m)
+void sh2_device::BSRF(uint32_t m)
{
m_sh2_state->pr = m_sh2_state->pc + 2;
m_delay = m_sh2_state->pc + m_sh2_state->r[m] + 2;
@@ -516,11 +516,11 @@ void sh2_device::BSRF(UINT32 m)
* 1000 1001 dddd dddd 3/1 -
* BT disp8
*/
-void sh2_device::BT(UINT32 d)
+void sh2_device::BT(uint32_t d)
{
if ((m_sh2_state->sr & T) != 0)
{
- INT32 disp = ((INT32)d << 24) >> 24;
+ int32_t disp = ((int32_t)d << 24) >> 24;
m_sh2_state->pc = m_sh2_state->ea = m_sh2_state->pc + disp * 2 + 2;
m_sh2_state->icount -= 2;
}
@@ -530,11 +530,11 @@ void sh2_device::BT(UINT32 d)
* 1000 1101 dddd dddd 2/1 -
* BTS disp8
*/
-void sh2_device::BTS(UINT32 d)
+void sh2_device::BTS(uint32_t d)
{
if ((m_sh2_state->sr & T) != 0)
{
- INT32 disp = ((INT32)d << 24) >> 24;
+ int32_t disp = ((int32_t)d << 24) >> 24;
m_delay = m_sh2_state->ea = m_sh2_state->pc + disp * 2 + 2;
m_sh2_state->icount--;
}
@@ -563,7 +563,7 @@ void sh2_device::CLRT()
* 0011 nnnn mmmm 0000 1 comparison result
* CMP_EQ Rm,Rn
*/
-void sh2_device::CMPEQ(UINT32 m, UINT32 n)
+void sh2_device::CMPEQ(uint32_t m, uint32_t n)
{
if (m_sh2_state->r[n] == m_sh2_state->r[m])
m_sh2_state->sr |= T;
@@ -575,9 +575,9 @@ void sh2_device::CMPEQ(UINT32 m, UINT32 n)
* 0011 nnnn mmmm 0011 1 comparison result
* CMP_GE Rm,Rn
*/
-void sh2_device::CMPGE(UINT32 m, UINT32 n)
+void sh2_device::CMPGE(uint32_t m, uint32_t n)
{
- if ((INT32) m_sh2_state->r[n] >= (INT32) m_sh2_state->r[m])
+ if ((int32_t) m_sh2_state->r[n] >= (int32_t) m_sh2_state->r[m])
m_sh2_state->sr |= T;
else
m_sh2_state->sr &= ~T;
@@ -587,9 +587,9 @@ void sh2_device::CMPGE(UINT32 m, UINT32 n)
* 0011 nnnn mmmm 0111 1 comparison result
* CMP_GT Rm,Rn
*/
-void sh2_device::CMPGT(UINT32 m, UINT32 n)
+void sh2_device::CMPGT(uint32_t m, uint32_t n)
{
- if ((INT32) m_sh2_state->r[n] > (INT32) m_sh2_state->r[m])
+ if ((int32_t) m_sh2_state->r[n] > (int32_t) m_sh2_state->r[m])
m_sh2_state->sr |= T;
else
m_sh2_state->sr &= ~T;
@@ -599,9 +599,9 @@ void sh2_device::CMPGT(UINT32 m, UINT32 n)
* 0011 nnnn mmmm 0110 1 comparison result
* CMP_HI Rm,Rn
*/
-void sh2_device::CMPHI(UINT32 m, UINT32 n)
+void sh2_device::CMPHI(uint32_t m, uint32_t n)
{
- if ((UINT32) m_sh2_state->r[n] > (UINT32) m_sh2_state->r[m])
+ if ((uint32_t) m_sh2_state->r[n] > (uint32_t) m_sh2_state->r[m])
m_sh2_state->sr |= T;
else
m_sh2_state->sr &= ~T;
@@ -611,9 +611,9 @@ void sh2_device::CMPHI(UINT32 m, UINT32 n)
* 0011 nnnn mmmm 0010 1 comparison result
* CMP_HS Rm,Rn
*/
-void sh2_device::CMPHS(UINT32 m, UINT32 n)
+void sh2_device::CMPHS(uint32_t m, uint32_t n)
{
- if ((UINT32) m_sh2_state->r[n] >= (UINT32) m_sh2_state->r[m])
+ if ((uint32_t) m_sh2_state->r[n] >= (uint32_t) m_sh2_state->r[m])
m_sh2_state->sr |= T;
else
m_sh2_state->sr &= ~T;
@@ -624,9 +624,9 @@ void sh2_device::CMPHS(UINT32 m, UINT32 n)
* 0100 nnnn 0001 0101 1 comparison result
* CMP_PL Rn
*/
-void sh2_device::CMPPL(UINT32 n)
+void sh2_device::CMPPL(uint32_t n)
{
- if ((INT32) m_sh2_state->r[n] > 0)
+ if ((int32_t) m_sh2_state->r[n] > 0)
m_sh2_state->sr |= T;
else
m_sh2_state->sr &= ~T;
@@ -636,9 +636,9 @@ void sh2_device::CMPPL(UINT32 n)
* 0100 nnnn 0001 0001 1 comparison result
* CMP_PZ Rn
*/
-void sh2_device::CMPPZ(UINT32 n)
+void sh2_device::CMPPZ(uint32_t n)
{
- if ((INT32) m_sh2_state->r[n] >= 0)
+ if ((int32_t) m_sh2_state->r[n] >= 0)
m_sh2_state->sr |= T;
else
m_sh2_state->sr &= ~T;
@@ -648,10 +648,10 @@ void sh2_device::CMPPZ(UINT32 n)
* 0010 nnnn mmmm 1100 1 comparison result
* CMP_STR Rm,Rn
*/
-void sh2_device::CMPSTR(UINT32 m, UINT32 n)
+void sh2_device::CMPSTR(uint32_t m, uint32_t n)
{
- UINT32 temp;
- INT32 HH, HL, LH, LL;
+ uint32_t temp;
+ int32_t HH, HL, LH, LL;
temp = m_sh2_state->r[n] ^ m_sh2_state->r[m];
HH = (temp >> 24) & 0xff;
HL = (temp >> 16) & 0xff;
@@ -668,9 +668,9 @@ void sh2_device::CMPSTR(UINT32 m, UINT32 n)
* 1000 1000 iiii iiii 1 comparison result
* CMP/EQ #imm,R0
*/
-void sh2_device::CMPIM(UINT32 i)
+void sh2_device::CMPIM(uint32_t i)
{
- UINT32 imm = (UINT32)(INT32)(INT16)(INT8)i;
+ uint32_t imm = (uint32_t)(int32_t)(int16_t)(int8_t)i;
if (m_sh2_state->r[0] == imm)
m_sh2_state->sr |= T;
@@ -682,7 +682,7 @@ void sh2_device::CMPIM(UINT32 i)
* 0010 nnnn mmmm 0111 1 calculation result
* DIV0S Rm,Rn
*/
-void sh2_device::DIV0S(UINT32 m, UINT32 n)
+void sh2_device::DIV0S(uint32_t m, uint32_t n)
{
if ((m_sh2_state->r[n] & 0x80000000) == 0)
m_sh2_state->sr &= ~Q;
@@ -711,10 +711,10 @@ void sh2_device::DIV0U()
* 0011 nnnn mmmm 0100 1 calculation result
* DIV1 Rm,Rn
*/
-void sh2_device::DIV1(UINT32 m, UINT32 n)
+void sh2_device::DIV1(uint32_t m, uint32_t n)
{
- UINT32 tmp0;
- UINT32 old_q;
+ uint32_t tmp0;
+ uint32_t old_q;
old_q = m_sh2_state->sr & Q;
if (0x80000000 & m_sh2_state->r[n])
@@ -803,24 +803,24 @@ void sh2_device::DIV1(UINT32 m, UINT32 n)
}
/* DMULS.L Rm,Rn */
-void sh2_device::DMULS(UINT32 m, UINT32 n)
+void sh2_device::DMULS(uint32_t m, uint32_t n)
{
- UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2;
- UINT32 temp0, temp1, temp2, temp3;
- INT32 tempm, tempn, fnLmL;
+ uint32_t RnL, RnH, RmL, RmH, Res0, Res1, Res2;
+ uint32_t temp0, temp1, temp2, temp3;
+ int32_t tempm, tempn, fnLmL;
- tempn = (INT32) m_sh2_state->r[n];
- tempm = (INT32) m_sh2_state->r[m];
+ tempn = (int32_t) m_sh2_state->r[n];
+ tempm = (int32_t) m_sh2_state->r[m];
if (tempn < 0)
tempn = 0 - tempn;
if (tempm < 0)
tempm = 0 - tempm;
- if ((INT32) (m_sh2_state->r[n] ^ m_sh2_state->r[m]) < 0)
+ if ((int32_t) (m_sh2_state->r[n] ^ m_sh2_state->r[m]) < 0)
fnLmL = -1;
else
fnLmL = 0;
- temp1 = (UINT32) tempn;
- temp2 = (UINT32) tempm;
+ temp1 = (uint32_t) tempn;
+ temp2 = (uint32_t) tempm;
RnL = temp1 & 0x0000ffff;
RnH = (temp1 >> 16) & 0x0000ffff;
RmL = temp2 & 0x0000ffff;
@@ -852,10 +852,10 @@ void sh2_device::DMULS(UINT32 m, UINT32 n)
}
/* DMULU.L Rm,Rn */
-void sh2_device::DMULU(UINT32 m, UINT32 n)
+void sh2_device::DMULU(uint32_t m, uint32_t n)
{
- UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2;
- UINT32 temp0, temp1, temp2, temp3;
+ uint32_t RnL, RnH, RmL, RmH, Res0, Res1, Res2;
+ uint32_t temp0, temp1, temp2, temp3;
RnL = m_sh2_state->r[n] & 0x0000ffff;
RnH = (m_sh2_state->r[n] >> 16) & 0x0000ffff;
@@ -880,7 +880,7 @@ void sh2_device::DMULU(UINT32 m, UINT32 n)
}
/* DT Rn */
-void sh2_device::DT(UINT32 n)
+void sh2_device::DT(uint32_t n)
{
m_sh2_state->r[n]--;
if (m_sh2_state->r[n] == 0)
@@ -889,7 +889,7 @@ void sh2_device::DT(UINT32 n)
m_sh2_state->sr &= ~T;
#if BUSY_LOOP_HACKS
{
- UINT32 next_opcode = RW(m_sh2_state->pc & AM);
+ uint32_t next_opcode = RW(m_sh2_state->pc & AM);
/* DT Rn
* BF $-2
*/
@@ -906,25 +906,25 @@ void sh2_device::DT(UINT32 n)
}
/* EXTS.B Rm,Rn */
-void sh2_device::EXTSB(UINT32 m, UINT32 n)
+void sh2_device::EXTSB(uint32_t m, uint32_t n)
{
- m_sh2_state->r[n] = ((INT32)m_sh2_state->r[m] << 24) >> 24;
+ m_sh2_state->r[n] = ((int32_t)m_sh2_state->r[m] << 24) >> 24;
}
/* EXTS.W Rm,Rn */
-void sh2_device::EXTSW(UINT32 m, UINT32 n)
+void sh2_device::EXTSW(uint32_t m, uint32_t n)
{
- m_sh2_state->r[n] = ((INT32)m_sh2_state->r[m] << 16) >> 16;
+ m_sh2_state->r[n] = ((int32_t)m_sh2_state->r[m] << 16) >> 16;
}
/* EXTU.B Rm,Rn */
-void sh2_device::EXTUB(UINT32 m, UINT32 n)
+void sh2_device::EXTUB(uint32_t m, uint32_t n)
{
m_sh2_state->r[n] = m_sh2_state->r[m] & 0x000000ff;
}
/* EXTU.W Rm,Rn */
-void sh2_device::EXTUW(UINT32 m, UINT32 n)
+void sh2_device::EXTUW(uint32_t m, uint32_t n)
{
m_sh2_state->r[n] = m_sh2_state->r[m] & 0x0000ffff;
}
@@ -947,14 +947,14 @@ void sh2_device::ILLEGAL()
/* JMP @Rm */
-void sh2_device::JMP(UINT32 m)
+void sh2_device::JMP(uint32_t m)
{
m_delay = m_sh2_state->ea = m_sh2_state->r[m];
m_sh2_state->icount--;
}
/* JSR @Rm */
-void sh2_device::JSR(UINT32 m)
+void sh2_device::JSR(uint32_t m)
{
m_sh2_state->pr = m_sh2_state->pc + 2;
m_delay = m_sh2_state->ea = m_sh2_state->r[m];
@@ -963,26 +963,26 @@ void sh2_device::JSR(UINT32 m)
/* LDC Rm,SR */
-void sh2_device::LDCSR(UINT32 m)
+void sh2_device::LDCSR(uint32_t m)
{
m_sh2_state->sr = m_sh2_state->r[m] & FLAGS;
m_test_irq = 1;
}
/* LDC Rm,GBR */
-void sh2_device::LDCGBR(UINT32 m)
+void sh2_device::LDCGBR(uint32_t m)
{
m_sh2_state->gbr = m_sh2_state->r[m];
}
/* LDC Rm,VBR */
-void sh2_device::LDCVBR(UINT32 m)
+void sh2_device::LDCVBR(uint32_t m)
{
m_sh2_state->vbr = m_sh2_state->r[m];
}
/* LDC.L @Rm+,SR */
-void sh2_device::LDCMSR(UINT32 m)
+void sh2_device::LDCMSR(uint32_t m)
{
m_sh2_state->ea = m_sh2_state->r[m];
m_sh2_state->sr = RL( m_sh2_state->ea ) & FLAGS;
@@ -992,7 +992,7 @@ void sh2_device::LDCMSR(UINT32 m)
}
/* LDC.L @Rm+,GBR */
-void sh2_device::LDCMGBR(UINT32 m)
+void sh2_device::LDCMGBR(uint32_t m)
{
m_sh2_state->ea = m_sh2_state->r[m];
m_sh2_state->gbr = RL( m_sh2_state->ea );
@@ -1001,7 +1001,7 @@ void sh2_device::LDCMGBR(UINT32 m)
}
/* LDC.L @Rm+,VBR */
-void sh2_device::LDCMVBR(UINT32 m)
+void sh2_device::LDCMVBR(uint32_t m)
{
m_sh2_state->ea = m_sh2_state->r[m];
m_sh2_state->vbr = RL( m_sh2_state->ea );
@@ -1010,25 +1010,25 @@ void sh2_device::LDCMVBR(UINT32 m)
}
/* LDS Rm,MACH */
-void sh2_device::LDSMACH(UINT32 m)
+void sh2_device::LDSMACH(uint32_t m)
{
m_sh2_state->mach = m_sh2_state->r[m];
}
/* LDS Rm,MACL */
-void sh2_device::LDSMACL(UINT32 m)
+void sh2_device::LDSMACL(uint32_t m)
{
m_sh2_state->macl = m_sh2_state->r[m];
}
/* LDS Rm,PR */
-void sh2_device::LDSPR(UINT32 m)
+void sh2_device::LDSPR(uint32_t m)
{
m_sh2_state->pr = m_sh2_state->r[m];
}
/* LDS.L @Rm+,MACH */
-void sh2_device::LDSMMACH(UINT32 m)
+void sh2_device::LDSMMACH(uint32_t m)
{
m_sh2_state->ea = m_sh2_state->r[m];
m_sh2_state->mach = RL( m_sh2_state->ea );
@@ -1036,7 +1036,7 @@ void sh2_device::LDSMMACH(UINT32 m)
}
/* LDS.L @Rm+,MACL */
-void sh2_device::LDSMMACL(UINT32 m)
+void sh2_device::LDSMMACL(uint32_t m)
{
m_sh2_state->ea = m_sh2_state->r[m];
m_sh2_state->macl = RL( m_sh2_state->ea );
@@ -1044,7 +1044,7 @@ void sh2_device::LDSMMACL(UINT32 m)
}
/* LDS.L @Rm+,PR */
-void sh2_device::LDSMPR(UINT32 m)
+void sh2_device::LDSMPR(uint32_t m)
{
m_sh2_state->ea = m_sh2_state->r[m];
m_sh2_state->pr = RL( m_sh2_state->ea );
@@ -1052,17 +1052,17 @@ void sh2_device::LDSMPR(UINT32 m)
}
/* MAC.L @Rm+,@Rn+ */
-void sh2_device::MAC_L(UINT32 m, UINT32 n)
+void sh2_device::MAC_L(uint32_t m, uint32_t n)
{
- UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2;
- UINT32 temp0, temp1, temp2, temp3;
- INT32 tempm, tempn, fnLmL;
+ uint32_t RnL, RnH, RmL, RmH, Res0, Res1, Res2;
+ uint32_t temp0, temp1, temp2, temp3;
+ int32_t tempm, tempn, fnLmL;
- tempn = (INT32) RL( m_sh2_state->r[n] );
+ tempn = (int32_t) RL( m_sh2_state->r[n] );
m_sh2_state->r[n] += 4;
- tempm = (INT32) RL( m_sh2_state->r[m] );
+ tempm = (int32_t) RL( m_sh2_state->r[m] );
m_sh2_state->r[m] += 4;
- if ((INT32) (tempn ^ tempm) < 0)
+ if ((int32_t) (tempn ^ tempm) < 0)
fnLmL = -1;
else
fnLmL = 0;
@@ -1070,8 +1070,8 @@ void sh2_device::MAC_L(UINT32 m, UINT32 n)
tempn = 0 - tempn;
if (tempm < 0)
tempm = 0 - tempm;
- temp1 = (UINT32) tempn;
- temp2 = (UINT32) tempm;
+ temp1 = (uint32_t) tempn;
+ temp2 = (uint32_t) tempm;
RnL = temp1 & 0x0000ffff;
RnH = (temp1 >> 16) & 0x0000ffff;
RmL = temp2 & 0x0000ffff;
@@ -1103,12 +1103,12 @@ void sh2_device::MAC_L(UINT32 m, UINT32 n)
if (m_sh2_state->macl > Res0)
Res2++;
Res2 += (m_sh2_state->mach & 0x0000ffff);
- if (((INT32) Res2 < 0) && (Res2 < 0xffff8000))
+ if (((int32_t) Res2 < 0) && (Res2 < 0xffff8000))
{
Res2 = 0x00008000;
Res0 = 0x00000000;
}
- else if (((INT32) Res2 > 0) && (Res2 > 0x00007fff))
+ else if (((int32_t) Res2 > 0) && (Res2 > 0x00007fff))
{
Res2 = 0x00007fff;
Res0 = 0xffffffff;
@@ -1129,22 +1129,22 @@ void sh2_device::MAC_L(UINT32 m, UINT32 n)
}
/* MAC.W @Rm+,@Rn+ */
-void sh2_device::MAC_W(UINT32 m, UINT32 n)
+void sh2_device::MAC_W(uint32_t m, uint32_t n)
{
- INT32 tempm, tempn, dest, src, ans;
- UINT32 templ;
+ int32_t tempm, tempn, dest, src, ans;
+ uint32_t templ;
- tempn = (INT32) RW( m_sh2_state->r[n] );
+ tempn = (int32_t) RW( m_sh2_state->r[n] );
m_sh2_state->r[n] += 2;
- tempm = (INT32) RW( m_sh2_state->r[m] );
+ tempm = (int32_t) RW( m_sh2_state->r[m] );
m_sh2_state->r[m] += 2;
templ = m_sh2_state->macl;
- tempm = ((INT32) (short) tempn * (INT32) (short) tempm);
- if ((INT32) m_sh2_state->macl >= 0)
+ tempm = ((int32_t) (short) tempn * (int32_t) (short) tempm);
+ if ((int32_t) m_sh2_state->macl >= 0)
dest = 0;
else
dest = 1;
- if ((INT32) tempm >= 0)
+ if ((int32_t) tempm >= 0)
{
src = 0;
tempn = 0;
@@ -1156,7 +1156,7 @@ void sh2_device::MAC_W(UINT32 m, UINT32 n)
}
src += dest;
m_sh2_state->macl += tempm;
- if ((INT32) m_sh2_state->macl >= 0)
+ if ((int32_t) m_sh2_state->macl >= 0)
ans = 0;
else
ans = 1;
@@ -1181,99 +1181,99 @@ void sh2_device::MAC_W(UINT32 m, UINT32 n)
}
/* MOV Rm,Rn */
-void sh2_device::MOV(UINT32 m, UINT32 n)
+void sh2_device::MOV(uint32_t m, uint32_t n)
{
m_sh2_state->r[n] = m_sh2_state->r[m];
}
/* MOV.B Rm,@Rn */
-void sh2_device::MOVBS(UINT32 m, UINT32 n)
+void sh2_device::MOVBS(uint32_t m, uint32_t n)
{
m_sh2_state->ea = m_sh2_state->r[n];
WB( m_sh2_state->ea, m_sh2_state->r[m] & 0x000000ff);
}
/* MOV.W Rm,@Rn */
-void sh2_device::MOVWS(UINT32 m, UINT32 n)
+void sh2_device::MOVWS(uint32_t m, uint32_t n)
{
m_sh2_state->ea = m_sh2_state->r[n];
WW( m_sh2_state->ea, m_sh2_state->r[m] & 0x0000ffff);
}
/* MOV.L Rm,@Rn */
-void sh2_device::MOVLS(UINT32 m, UINT32 n)
+void sh2_device::MOVLS(uint32_t m, uint32_t n)
{
m_sh2_state->ea = m_sh2_state->r[n];
WL( m_sh2_state->ea, m_sh2_state->r[m] );
}
/* MOV.B @Rm,Rn */
-void sh2_device::MOVBL(UINT32 m, UINT32 n)
+void sh2_device::MOVBL(uint32_t m, uint32_t n)
{
m_sh2_state->ea = m_sh2_state->r[m];
- m_sh2_state->r[n] = (UINT32)(INT32)(INT16)(INT8) RB( m_sh2_state->ea );
+ m_sh2_state->r[n] = (uint32_t)(int32_t)(int16_t)(int8_t) RB( m_sh2_state->ea );
}
/* MOV.W @Rm,Rn */
-void sh2_device::MOVWL(UINT32 m, UINT32 n)
+void sh2_device::MOVWL(uint32_t m, uint32_t n)
{
m_sh2_state->ea = m_sh2_state->r[m];
- m_sh2_state->r[n] = (UINT32)(INT32)(INT16) RW( m_sh2_state->ea );
+ m_sh2_state->r[n] = (uint32_t)(int32_t)(int16_t) RW( m_sh2_state->ea );
}
/* MOV.L @Rm,Rn */
-void sh2_device::MOVLL(UINT32 m, UINT32 n)
+void sh2_device::MOVLL(uint32_t m, uint32_t n)
{
m_sh2_state->ea = m_sh2_state->r[m];
m_sh2_state->r[n] = RL( m_sh2_state->ea );
}
/* MOV.B Rm,@-Rn */
-void sh2_device::MOVBM(UINT32 m, UINT32 n)
+void sh2_device::MOVBM(uint32_t m, uint32_t n)
{
/* SMG : bug fix, was reading m_sh2_state->r[n] */
- UINT32 data = m_sh2_state->r[m] & 0x000000ff;
+ uint32_t data = m_sh2_state->r[m] & 0x000000ff;
m_sh2_state->r[n] -= 1;
WB( m_sh2_state->r[n], data );
}
/* MOV.W Rm,@-Rn */
-void sh2_device::MOVWM(UINT32 m, UINT32 n)
+void sh2_device::MOVWM(uint32_t m, uint32_t n)
{
- UINT32 data = m_sh2_state->r[m] & 0x0000ffff;
+ uint32_t data = m_sh2_state->r[m] & 0x0000ffff;
m_sh2_state->r[n] -= 2;
WW( m_sh2_state->r[n], data );
}
/* MOV.L Rm,@-Rn */
-void sh2_device::MOVLM(UINT32 m, UINT32 n)
+void sh2_device::MOVLM(uint32_t m, uint32_t n)
{
- UINT32 data = m_sh2_state->r[m];
+ uint32_t data = m_sh2_state->r[m];
m_sh2_state->r[n] -= 4;
WL( m_sh2_state->r[n], data );
}
/* MOV.B @Rm+,Rn */
-void sh2_device::MOVBP(UINT32 m, UINT32 n)
+void sh2_device::MOVBP(uint32_t m, uint32_t n)
{
- m_sh2_state->r[n] = (UINT32)(INT32)(INT16)(INT8) RB( m_sh2_state->r[m] );
+ m_sh2_state->r[n] = (uint32_t)(int32_t)(int16_t)(int8_t) RB( m_sh2_state->r[m] );
if (n != m)
m_sh2_state->r[m] += 1;
}
/* MOV.W @Rm+,Rn */
-void sh2_device::MOVWP(UINT32 m, UINT32 n)
+void sh2_device::MOVWP(uint32_t m, uint32_t n)
{
- m_sh2_state->r[n] = (UINT32)(INT32)(INT16) RW( m_sh2_state->r[m] );
+ m_sh2_state->r[n] = (uint32_t)(int32_t)(int16_t) RW( m_sh2_state->r[m] );
if (n != m)
m_sh2_state->r[m] += 2;
}
/* MOV.L @Rm+,Rn */
-void sh2_device::MOVLP(UINT32 m, UINT32 n)
+void sh2_device::MOVLP(uint32_t m, uint32_t n)
{
m_sh2_state->r[n] = RL( m_sh2_state->r[m] );
if (n != m)
@@ -1281,208 +1281,208 @@ void sh2_device::MOVLP(UINT32 m, UINT32 n)
}
/* MOV.B Rm,@(R0,Rn) */
-void sh2_device::MOVBS0(UINT32 m, UINT32 n)
+void sh2_device::MOVBS0(uint32_t m, uint32_t n)
{
m_sh2_state->ea = m_sh2_state->r[n] + m_sh2_state->r[0];
WB( m_sh2_state->ea, m_sh2_state->r[m] & 0x000000ff );
}
/* MOV.W Rm,@(R0,Rn) */
-void sh2_device::MOVWS0(UINT32 m, UINT32 n)
+void sh2_device::MOVWS0(uint32_t m, uint32_t n)
{
m_sh2_state->ea = m_sh2_state->r[n] + m_sh2_state->r[0];
WW( m_sh2_state->ea, m_sh2_state->r[m] & 0x0000ffff );
}
/* MOV.L Rm,@(R0,Rn) */
-void sh2_device::MOVLS0(UINT32 m, UINT32 n)
+void sh2_device::MOVLS0(uint32_t m, uint32_t n)
{
m_sh2_state->ea = m_sh2_state->r[n] + m_sh2_state->r[0];
WL( m_sh2_state->ea, m_sh2_state->r[m] );
}
/* MOV.B @(R0,Rm),Rn */
-void sh2_device::MOVBL0(UINT32 m, UINT32 n)
+void sh2_device::MOVBL0(uint32_t m, uint32_t n)
{
m_sh2_state->ea = m_sh2_state->r[m] + m_sh2_state->r[0];
- m_sh2_state->r[n] = (UINT32)(INT32)(INT16)(INT8) RB( m_sh2_state->ea );
+ m_sh2_state->r[n] = (uint32_t)(int32_t)(int16_t)(int8_t) RB( m_sh2_state->ea );
}
/* MOV.W @(R0,Rm),Rn */
-void sh2_device::MOVWL0(UINT32 m, UINT32 n)
+void sh2_device::MOVWL0(uint32_t m, uint32_t n)
{
m_sh2_state->ea = m_sh2_state->r[m] + m_sh2_state->r[0];
- m_sh2_state->r[n] = (UINT32)(INT32)(INT16) RW( m_sh2_state->ea );
+ m_sh2_state->r[n] = (uint32_t)(int32_t)(int16_t) RW( m_sh2_state->ea );
}
/* MOV.L @(R0,Rm),Rn */
-void sh2_device::MOVLL0(UINT32 m, UINT32 n)
+void sh2_device::MOVLL0(uint32_t m, uint32_t n)
{
m_sh2_state->ea = m_sh2_state->r[m] + m_sh2_state->r[0];
m_sh2_state->r[n] = RL( m_sh2_state->ea );
}
/* MOV #imm,Rn */
-void sh2_device::MOVI(UINT32 i, UINT32 n)
+void sh2_device::MOVI(uint32_t i, uint32_t n)
{
- m_sh2_state->r[n] = (UINT32)(INT32)(INT16)(INT8) i;
+ m_sh2_state->r[n] = (uint32_t)(int32_t)(int16_t)(int8_t) i;
}
/* MOV.W @(disp8,PC),Rn */
-void sh2_device::MOVWI(UINT32 d, UINT32 n)
+void sh2_device::MOVWI(uint32_t d, uint32_t n)
{
- UINT32 disp = d & 0xff;
+ uint32_t disp = d & 0xff;
m_sh2_state->ea = m_sh2_state->pc + disp * 2 + 2;
- m_sh2_state->r[n] = (UINT32)(INT32)(INT16) RW( m_sh2_state->ea );
+ m_sh2_state->r[n] = (uint32_t)(int32_t)(int16_t) RW( m_sh2_state->ea );
}
/* MOV.L @(disp8,PC),Rn */
-void sh2_device::MOVLI(UINT32 d, UINT32 n)
+void sh2_device::MOVLI(uint32_t d, uint32_t n)
{
- UINT32 disp = d & 0xff;
+ uint32_t disp = d & 0xff;
m_sh2_state->ea = ((m_sh2_state->pc + 2) & ~3) + disp * 4;
m_sh2_state->r[n] = RL( m_sh2_state->ea );
}
/* MOV.B @(disp8,GBR),R0 */
-void sh2_device::MOVBLG(UINT32 d)
+void sh2_device::MOVBLG(uint32_t d)
{
- UINT32 disp = d & 0xff;
+ uint32_t disp = d & 0xff;
m_sh2_state->ea = m_sh2_state->gbr + disp;
- m_sh2_state->r[0] = (UINT32)(INT32)(INT16)(INT8) RB( m_sh2_state->ea );
+ m_sh2_state->r[0] = (uint32_t)(int32_t)(int16_t)(int8_t) RB( m_sh2_state->ea );
}
/* MOV.W @(disp8,GBR),R0 */
-void sh2_device::MOVWLG(UINT32 d)
+void sh2_device::MOVWLG(uint32_t d)
{
- UINT32 disp = d & 0xff;
+ uint32_t disp = d & 0xff;
m_sh2_state->ea = m_sh2_state->gbr + disp * 2;
- m_sh2_state->r[0] = (INT32)(INT16) RW( m_sh2_state->ea );
+ m_sh2_state->r[0] = (int32_t)(int16_t) RW( m_sh2_state->ea );
}
/* MOV.L @(disp8,GBR),R0 */
-void sh2_device::MOVLLG(UINT32 d)
+void sh2_device::MOVLLG(uint32_t d)
{
- UINT32 disp = d & 0xff;
+ uint32_t disp = d & 0xff;
m_sh2_state->ea = m_sh2_state->gbr + disp * 4;
m_sh2_state->r[0] = RL( m_sh2_state->ea );
}
/* MOV.B R0,@(disp8,GBR) */
-void sh2_device::MOVBSG(UINT32 d)
+void sh2_device::MOVBSG(uint32_t d)
{
- UINT32 disp = d & 0xff;
+ uint32_t disp = d & 0xff;
m_sh2_state->ea = m_sh2_state->gbr + disp;
WB( m_sh2_state->ea, m_sh2_state->r[0] & 0x000000ff );
}
/* MOV.W R0,@(disp8,GBR) */
-void sh2_device::MOVWSG(UINT32 d)
+void sh2_device::MOVWSG(uint32_t d)
{
- UINT32 disp = d & 0xff;
+ uint32_t disp = d & 0xff;
m_sh2_state->ea = m_sh2_state->gbr + disp * 2;
WW( m_sh2_state->ea, m_sh2_state->r[0] & 0x0000ffff );
}
/* MOV.L R0,@(disp8,GBR) */
-void sh2_device::MOVLSG(UINT32 d)
+void sh2_device::MOVLSG(uint32_t d)
{
- UINT32 disp = d & 0xff;
+ uint32_t disp = d & 0xff;
m_sh2_state->ea = m_sh2_state->gbr + disp * 4;
WL( m_sh2_state->ea, m_sh2_state->r[0] );
}
/* MOV.B R0,@(disp4,Rn) */
-void sh2_device::MOVBS4(UINT32 d, UINT32 n)
+void sh2_device::MOVBS4(uint32_t d, uint32_t n)
{
- UINT32 disp = d & 0x0f;
+ uint32_t disp = d & 0x0f;
m_sh2_state->ea = m_sh2_state->r[n] + disp;
WB( m_sh2_state->ea, m_sh2_state->r[0] & 0x000000ff );
}
/* MOV.W R0,@(disp4,Rn) */
-void sh2_device::MOVWS4(UINT32 d, UINT32 n)
+void sh2_device::MOVWS4(uint32_t d, uint32_t n)
{
- UINT32 disp = d & 0x0f;
+ uint32_t disp = d & 0x0f;
m_sh2_state->ea = m_sh2_state->r[n] + disp * 2;
WW( m_sh2_state->ea, m_sh2_state->r[0] & 0x0000ffff );
}
/* MOV.L Rm,@(disp4,Rn) */
-void sh2_device::MOVLS4(UINT32 m, UINT32 d, UINT32 n)
+void sh2_device::MOVLS4(uint32_t m, uint32_t d, uint32_t n)
{
- UINT32 disp = d & 0x0f;
+ uint32_t disp = d & 0x0f;
m_sh2_state->ea = m_sh2_state->r[n] + disp * 4;
WL( m_sh2_state->ea, m_sh2_state->r[m] );
}
/* MOV.B @(disp4,Rm),R0 */
-void sh2_device::MOVBL4(UINT32 m, UINT32 d)
+void sh2_device::MOVBL4(uint32_t m, uint32_t d)
{
- UINT32 disp = d & 0x0f;
+ uint32_t disp = d & 0x0f;
m_sh2_state->ea = m_sh2_state->r[m] + disp;
- m_sh2_state->r[0] = (UINT32)(INT32)(INT16)(INT8) RB( m_sh2_state->ea );
+ m_sh2_state->r[0] = (uint32_t)(int32_t)(int16_t)(int8_t) RB( m_sh2_state->ea );
}
/* MOV.W @(disp4,Rm),R0 */
-void sh2_device::MOVWL4(UINT32 m, UINT32 d)
+void sh2_device::MOVWL4(uint32_t m, uint32_t d)
{
- UINT32 disp = d & 0x0f;
+ uint32_t disp = d & 0x0f;
m_sh2_state->ea = m_sh2_state->r[m] + disp * 2;
- m_sh2_state->r[0] = (UINT32)(INT32)(INT16) RW( m_sh2_state->ea );
+ m_sh2_state->r[0] = (uint32_t)(int32_t)(int16_t) RW( m_sh2_state->ea );
}
/* MOV.L @(disp4,Rm),Rn */
-void sh2_device::MOVLL4(UINT32 m, UINT32 d, UINT32 n)
+void sh2_device::MOVLL4(uint32_t m, uint32_t d, uint32_t n)
{
- UINT32 disp = d & 0x0f;
+ uint32_t disp = d & 0x0f;
m_sh2_state->ea = m_sh2_state->r[m] + disp * 4;
m_sh2_state->r[n] = RL( m_sh2_state->ea );
}
/* MOVA @(disp8,PC),R0 */
-void sh2_device::MOVA(UINT32 d)
+void sh2_device::MOVA(uint32_t d)
{
- UINT32 disp = d & 0xff;
+ uint32_t disp = d & 0xff;
m_sh2_state->ea = ((m_sh2_state->pc + 2) & ~3) + disp * 4;
m_sh2_state->r[0] = m_sh2_state->ea;
}
/* MOVT Rn */
-void sh2_device::MOVT(UINT32 n)
+void sh2_device::MOVT(uint32_t n)
{
m_sh2_state->r[n] = m_sh2_state->sr & T;
}
/* MUL.L Rm,Rn */
-void sh2_device::MULL(UINT32 m, UINT32 n)
+void sh2_device::MULL(uint32_t m, uint32_t n)
{
m_sh2_state->macl = m_sh2_state->r[n] * m_sh2_state->r[m];
m_sh2_state->icount--;
}
/* MULS Rm,Rn */
-void sh2_device::MULS(UINT32 m, UINT32 n)
+void sh2_device::MULS(uint32_t m, uint32_t n)
{
- m_sh2_state->macl = (INT16) m_sh2_state->r[n] * (INT16) m_sh2_state->r[m];
+ m_sh2_state->macl = (int16_t) m_sh2_state->r[n] * (int16_t) m_sh2_state->r[m];
}
/* MULU Rm,Rn */
-void sh2_device::MULU(UINT32 m, UINT32 n)
+void sh2_device::MULU(uint32_t m, uint32_t n)
{
- m_sh2_state->macl = (UINT16) m_sh2_state->r[n] * (UINT16) m_sh2_state->r[m];
+ m_sh2_state->macl = (uint16_t) m_sh2_state->r[n] * (uint16_t) m_sh2_state->r[m];
}
/* NEG Rm,Rn */
-void sh2_device::NEG(UINT32 m, UINT32 n)
+void sh2_device::NEG(uint32_t m, uint32_t n)
{
m_sh2_state->r[n] = 0 - m_sh2_state->r[m];
}
/* NEGC Rm,Rn */
-void sh2_device::NEGC(UINT32 m, UINT32 n)
+void sh2_device::NEGC(uint32_t m, uint32_t n)
{
- UINT32 temp;
+ uint32_t temp;
temp = m_sh2_state->r[m];
m_sh2_state->r[n] = -temp - (m_sh2_state->sr & T);
@@ -1498,27 +1498,27 @@ void sh2_device::NOP(void)
}
/* NOT Rm,Rn */
-void sh2_device::NOT(UINT32 m, UINT32 n)
+void sh2_device::NOT(uint32_t m, uint32_t n)
{
m_sh2_state->r[n] = ~m_sh2_state->r[m];
}
/* OR Rm,Rn */
-void sh2_device::OR(UINT32 m, UINT32 n)
+void sh2_device::OR(uint32_t m, uint32_t n)
{
m_sh2_state->r[n] |= m_sh2_state->r[m];
}
/* OR #imm,R0 */
-void sh2_device::ORI(UINT32 i)
+void sh2_device::ORI(uint32_t i)
{
m_sh2_state->r[0] |= i;
}
/* OR.B #imm,@(R0,GBR) */
-void sh2_device::ORM(UINT32 i)
+void sh2_device::ORM(uint32_t i)
{
- UINT32 temp;
+ uint32_t temp;
m_sh2_state->ea = m_sh2_state->gbr + m_sh2_state->r[0];
temp = RB( m_sh2_state->ea );
@@ -1528,9 +1528,9 @@ void sh2_device::ORM(UINT32 i)
}
/* ROTCL Rn */
-void sh2_device::ROTCL(UINT32 n)
+void sh2_device::ROTCL(uint32_t n)
{
- UINT32 temp;
+ uint32_t temp;
temp = (m_sh2_state->r[n] >> 31) & T;
m_sh2_state->r[n] = (m_sh2_state->r[n] << 1) | (m_sh2_state->sr & T);
@@ -1538,9 +1538,9 @@ void sh2_device::ROTCL(UINT32 n)
}
/* ROTCR Rn */
-void sh2_device::ROTCR(UINT32 n)
+void sh2_device::ROTCR(uint32_t n)
{
- UINT32 temp;
+ uint32_t temp;
temp = (m_sh2_state->sr & T) << 31;
if (m_sh2_state->r[n] & T)
m_sh2_state->sr |= T;
@@ -1550,14 +1550,14 @@ void sh2_device::ROTCR(UINT32 n)
}
/* ROTL Rn */
-void sh2_device::ROTL(UINT32 n)
+void sh2_device::ROTL(uint32_t n)
{
m_sh2_state->sr = (m_sh2_state->sr & ~T) | ((m_sh2_state->r[n] >> 31) & T);
m_sh2_state->r[n] = (m_sh2_state->r[n] << 1) | (m_sh2_state->r[n] >> 31);
}
/* ROTR Rn */
-void sh2_device::ROTR(UINT32 n)
+void sh2_device::ROTR(uint32_t n)
{
m_sh2_state->sr = (m_sh2_state->sr & ~T) | (m_sh2_state->r[n] & T);
m_sh2_state->r[n] = (m_sh2_state->r[n] >> 1) | (m_sh2_state->r[n] << 31);
@@ -1590,65 +1590,65 @@ void sh2_device::SETT()
}
/* SHAL Rn (same as SHLL) */
-void sh2_device::SHAL(UINT32 n)
+void sh2_device::SHAL(uint32_t n)
{
m_sh2_state->sr = (m_sh2_state->sr & ~T) | ((m_sh2_state->r[n] >> 31) & T);
m_sh2_state->r[n] <<= 1;
}
/* SHAR Rn */
-void sh2_device::SHAR(UINT32 n)
+void sh2_device::SHAR(uint32_t n)
{
m_sh2_state->sr = (m_sh2_state->sr & ~T) | (m_sh2_state->r[n] & T);
- m_sh2_state->r[n] = (UINT32)((INT32)m_sh2_state->r[n] >> 1);
+ m_sh2_state->r[n] = (uint32_t)((int32_t)m_sh2_state->r[n] >> 1);
}
/* SHLL Rn (same as SHAL) */
-void sh2_device::SHLL(UINT32 n)
+void sh2_device::SHLL(uint32_t n)
{
m_sh2_state->sr = (m_sh2_state->sr & ~T) | ((m_sh2_state->r[n] >> 31) & T);
m_sh2_state->r[n] <<= 1;
}
/* SHLL2 Rn */
-void sh2_device::SHLL2(UINT32 n)
+void sh2_device::SHLL2(uint32_t n)
{
m_sh2_state->r[n] <<= 2;
}
/* SHLL8 Rn */
-void sh2_device::SHLL8(UINT32 n)
+void sh2_device::SHLL8(uint32_t n)
{
m_sh2_state->r[n] <<= 8;
}
/* SHLL16 Rn */
-void sh2_device::SHLL16(UINT32 n)
+void sh2_device::SHLL16(uint32_t n)
{
m_sh2_state->r[n] <<= 16;
}
/* SHLR Rn */
-void sh2_device::SHLR(UINT32 n)
+void sh2_device::SHLR(uint32_t n)
{
m_sh2_state->sr = (m_sh2_state->sr & ~T) | (m_sh2_state->r[n] & T);
m_sh2_state->r[n] >>= 1;
}
/* SHLR2 Rn */
-void sh2_device::SHLR2(UINT32 n)
+void sh2_device::SHLR2(uint32_t n)
{
m_sh2_state->r[n] >>= 2;
}
/* SHLR8 Rn */
-void sh2_device::SHLR8(UINT32 n)
+void sh2_device::SHLR8(uint32_t n)
{
m_sh2_state->r[n] >>= 8;
}
/* SHLR16 Rn */
-void sh2_device::SHLR16(UINT32 n)
+void sh2_device::SHLR16(uint32_t n)
{
m_sh2_state->r[n] >>= 16;
}
@@ -1667,25 +1667,25 @@ void sh2_device::SLEEP()
}
/* STC SR,Rn */
-void sh2_device::STCSR(UINT32 n)
+void sh2_device::STCSR(uint32_t n)
{
m_sh2_state->r[n] = m_sh2_state->sr;
}
/* STC GBR,Rn */
-void sh2_device::STCGBR(UINT32 n)
+void sh2_device::STCGBR(uint32_t n)
{
m_sh2_state->r[n] = m_sh2_state->gbr;
}
/* STC VBR,Rn */
-void sh2_device::STCVBR(UINT32 n)
+void sh2_device::STCVBR(uint32_t n)
{
m_sh2_state->r[n] = m_sh2_state->vbr;
}
/* STC.L SR,@-Rn */
-void sh2_device::STCMSR(UINT32 n)
+void sh2_device::STCMSR(uint32_t n)
{
m_sh2_state->r[n] -= 4;
m_sh2_state->ea = m_sh2_state->r[n];
@@ -1694,7 +1694,7 @@ void sh2_device::STCMSR(UINT32 n)
}
/* STC.L GBR,@-Rn */
-void sh2_device::STCMGBR(UINT32 n)
+void sh2_device::STCMGBR(uint32_t n)
{
m_sh2_state->r[n] -= 4;
m_sh2_state->ea = m_sh2_state->r[n];
@@ -1703,7 +1703,7 @@ void sh2_device::STCMGBR(UINT32 n)
}
/* STC.L VBR,@-Rn */
-void sh2_device::STCMVBR(UINT32 n)
+void sh2_device::STCMVBR(uint32_t n)
{
m_sh2_state->r[n] -= 4;
m_sh2_state->ea = m_sh2_state->r[n];
@@ -1712,25 +1712,25 @@ void sh2_device::STCMVBR(UINT32 n)
}
/* STS MACH,Rn */
-void sh2_device::STSMACH(UINT32 n)
+void sh2_device::STSMACH(uint32_t n)
{
m_sh2_state->r[n] = m_sh2_state->mach;
}
/* STS MACL,Rn */
-void sh2_device::STSMACL(UINT32 n)
+void sh2_device::STSMACL(uint32_t n)
{
m_sh2_state->r[n] = m_sh2_state->macl;
}
/* STS PR,Rn */
-void sh2_device::STSPR(UINT32 n)
+void sh2_device::STSPR(uint32_t n)
{
m_sh2_state->r[n] = m_sh2_state->pr;
}
/* STS.L MACH,@-Rn */
-void sh2_device::STSMMACH(UINT32 n)
+void sh2_device::STSMMACH(uint32_t n)
{
m_sh2_state->r[n] -= 4;
m_sh2_state->ea = m_sh2_state->r[n];
@@ -1738,7 +1738,7 @@ void sh2_device::STSMMACH(UINT32 n)
}
/* STS.L MACL,@-Rn */
-void sh2_device::STSMMACL(UINT32 n)
+void sh2_device::STSMMACL(uint32_t n)
{
m_sh2_state->r[n] -= 4;
m_sh2_state->ea = m_sh2_state->r[n];
@@ -1746,7 +1746,7 @@ void sh2_device::STSMMACL(UINT32 n)
}
/* STS.L PR,@-Rn */
-void sh2_device::STSMPR(UINT32 n)
+void sh2_device::STSMPR(uint32_t n)
{
m_sh2_state->r[n] -= 4;
m_sh2_state->ea = m_sh2_state->r[n];
@@ -1754,15 +1754,15 @@ void sh2_device::STSMPR(UINT32 n)
}
/* SUB Rm,Rn */
-void sh2_device::SUB(UINT32 m, UINT32 n)
+void sh2_device::SUB(uint32_t m, uint32_t n)
{
m_sh2_state->r[n] -= m_sh2_state->r[m];
}
/* SUBC Rm,Rn */
-void sh2_device::SUBC(UINT32 m, UINT32 n)
+void sh2_device::SUBC(uint32_t m, uint32_t n)
{
- UINT32 tmp0, tmp1;
+ uint32_t tmp0, tmp1;
tmp1 = m_sh2_state->r[n] - m_sh2_state->r[m];
tmp0 = m_sh2_state->r[n];
@@ -1776,21 +1776,21 @@ void sh2_device::SUBC(UINT32 m, UINT32 n)
}
/* SUBV Rm,Rn */
-void sh2_device::SUBV(UINT32 m, UINT32 n)
+void sh2_device::SUBV(uint32_t m, uint32_t n)
{
- INT32 dest, src, ans;
+ int32_t dest, src, ans;
- if ((INT32) m_sh2_state->r[n] >= 0)
+ if ((int32_t) m_sh2_state->r[n] >= 0)
dest = 0;
else
dest = 1;
- if ((INT32) m_sh2_state->r[m] >= 0)
+ if ((int32_t) m_sh2_state->r[m] >= 0)
src = 0;
else
src = 1;
src += dest;
m_sh2_state->r[n] -= m_sh2_state->r[m];
- if ((INT32) m_sh2_state->r[n] >= 0)
+ if ((int32_t) m_sh2_state->r[n] >= 0)
ans = 0;
else
ans = 1;
@@ -1807,9 +1807,9 @@ void sh2_device::SUBV(UINT32 m, UINT32 n)
}
/* SWAP.B Rm,Rn */
-void sh2_device::SWAPB(UINT32 m, UINT32 n)
+void sh2_device::SWAPB(uint32_t m, uint32_t n)
{
- UINT32 temp0, temp1;
+ uint32_t temp0, temp1;
temp0 = m_sh2_state->r[m] & 0xffff0000;
temp1 = (m_sh2_state->r[m] & 0x000000ff) << 8;
@@ -1818,18 +1818,18 @@ void sh2_device::SWAPB(UINT32 m, UINT32 n)
}
/* SWAP.W Rm,Rn */
-void sh2_device::SWAPW(UINT32 m, UINT32 n)
+void sh2_device::SWAPW(uint32_t m, uint32_t n)
{
- UINT32 temp;
+ uint32_t temp;
temp = (m_sh2_state->r[m] >> 16) & 0x0000ffff;
m_sh2_state->r[n] = (m_sh2_state->r[m] << 16) | temp;
}
/* TAS.B @Rn */
-void sh2_device::TAS(UINT32 n)
+void sh2_device::TAS(uint32_t n)
{
- UINT32 temp;
+ uint32_t temp;
m_sh2_state->ea = m_sh2_state->r[n];
/* Bus Lock enable */
temp = RB( m_sh2_state->ea );
@@ -1844,9 +1844,9 @@ void sh2_device::TAS(UINT32 n)
}
/* TRAPA #imm */
-void sh2_device::TRAPA(UINT32 i)
+void sh2_device::TRAPA(uint32_t i)
{
- UINT32 imm = i & 0xff;
+ uint32_t imm = i & 0xff;
m_sh2_state->ea = m_sh2_state->vbr + imm * 4;
@@ -1861,7 +1861,7 @@ void sh2_device::TRAPA(UINT32 i)
}
/* TST Rm,Rn */
-void sh2_device::TST(UINT32 m, UINT32 n)
+void sh2_device::TST(uint32_t m, uint32_t n)
{
if ((m_sh2_state->r[n] & m_sh2_state->r[m]) == 0)
m_sh2_state->sr |= T;
@@ -1870,9 +1870,9 @@ void sh2_device::TST(UINT32 m, UINT32 n)
}
/* TST #imm,R0 */
-void sh2_device::TSTI(UINT32 i)
+void sh2_device::TSTI(uint32_t i)
{
- UINT32 imm = i & 0xff;
+ uint32_t imm = i & 0xff;
if ((imm & m_sh2_state->r[0]) == 0)
m_sh2_state->sr |= T;
@@ -1881,9 +1881,9 @@ void sh2_device::TSTI(UINT32 i)
}
/* TST.B #imm,@(R0,GBR) */
-void sh2_device::TSTM(UINT32 i)
+void sh2_device::TSTM(uint32_t i)
{
- UINT32 imm = i & 0xff;
+ uint32_t imm = i & 0xff;
m_sh2_state->ea = m_sh2_state->gbr + m_sh2_state->r[0];
if ((imm & RB( m_sh2_state->ea )) == 0)
@@ -1894,23 +1894,23 @@ void sh2_device::TSTM(UINT32 i)
}
/* XOR Rm,Rn */
-void sh2_device::XOR(UINT32 m, UINT32 n)
+void sh2_device::XOR(uint32_t m, uint32_t n)
{
m_sh2_state->r[n] ^= m_sh2_state->r[m];
}
/* XOR #imm,R0 */
-void sh2_device::XORI(UINT32 i)
+void sh2_device::XORI(uint32_t i)
{
- UINT32 imm = i & 0xff;
+ uint32_t imm = i & 0xff;
m_sh2_state->r[0] ^= imm;
}
/* XOR.B #imm,@(R0,GBR) */
-void sh2_device::XORM(UINT32 i)
+void sh2_device::XORM(uint32_t i)
{
- UINT32 imm = i & 0xff;
- UINT32 temp;
+ uint32_t imm = i & 0xff;
+ uint32_t temp;
m_sh2_state->ea = m_sh2_state->gbr + m_sh2_state->r[0];
temp = RB( m_sh2_state->ea );
@@ -1920,9 +1920,9 @@ void sh2_device::XORM(UINT32 i)
}
/* XTRCT Rm,Rn */
-void sh2_device::XTRCT(UINT32 m, UINT32 n)
+void sh2_device::XTRCT(uint32_t m, uint32_t n)
{
- UINT32 temp;
+ uint32_t temp;
temp = (m_sh2_state->r[m] << 16) & 0xffff0000;
m_sh2_state->r[n] = (m_sh2_state->r[n] >> 16) & 0x0000ffff;
@@ -1933,7 +1933,7 @@ void sh2_device::XTRCT(UINT32 m, UINT32 n)
* OPCODE DISPATCHERS
*****************************************************************************/
-void sh2_device::op0000(UINT16 opcode)
+void sh2_device::op0000(uint16_t opcode)
{
switch (opcode & 0x3F)
{
@@ -2010,12 +2010,12 @@ void sh2_device::op0000(UINT16 opcode)
}
}
-void sh2_device::op0001(UINT16 opcode)
+void sh2_device::op0001(uint16_t opcode)
{
MOVLS4(Rm, opcode & 0x0f, Rn);
}
-void sh2_device::op0010(UINT16 opcode)
+void sh2_device::op0010(uint16_t opcode)
{
switch (opcode & 15)
{
@@ -2038,7 +2038,7 @@ void sh2_device::op0010(UINT16 opcode)
}
}
-void sh2_device::op0011(UINT16 opcode)
+void sh2_device::op0011(uint16_t opcode)
{
switch (opcode & 15)
{
@@ -2061,7 +2061,7 @@ void sh2_device::op0011(UINT16 opcode)
}
}
-void sh2_device::op0100(UINT16 opcode)
+void sh2_device::op0100(uint16_t opcode)
{
switch (opcode & 0x3F)
{
@@ -2136,12 +2136,12 @@ void sh2_device::op0100(UINT16 opcode)
}
}
-void sh2_device::op0101(UINT16 opcode)
+void sh2_device::op0101(uint16_t opcode)
{
MOVLL4(Rm, opcode & 0x0f, Rn);
}
-void sh2_device::op0110(UINT16 opcode)
+void sh2_device::op0110(uint16_t opcode)
{
switch (opcode & 15)
{
@@ -2164,12 +2164,12 @@ void sh2_device::op0110(UINT16 opcode)
}
}
-void sh2_device::op0111(UINT16 opcode)
+void sh2_device::op0111(uint16_t opcode)
{
ADDI(opcode & 0xff, Rn);
}
-void sh2_device::op1000(UINT16 opcode)
+void sh2_device::op1000(uint16_t opcode)
{
switch ( opcode & (15<<8) )
{
@@ -2193,22 +2193,22 @@ void sh2_device::op1000(UINT16 opcode)
}
-void sh2_device::op1001(UINT16 opcode)
+void sh2_device::op1001(uint16_t opcode)
{
MOVWI(opcode & 0xff, Rn);
}
-void sh2_device::op1010(UINT16 opcode)
+void sh2_device::op1010(uint16_t opcode)
{
BRA(opcode & 0xfff);
}
-void sh2_device::op1011(UINT16 opcode)
+void sh2_device::op1011(uint16_t opcode)
{
BSR(opcode & 0xfff);
}
-void sh2_device::op1100(UINT16 opcode)
+void sh2_device::op1100(uint16_t opcode)
{
switch (opcode & (15<<8))
{
@@ -2231,17 +2231,17 @@ void sh2_device::op1100(UINT16 opcode)
}
}
-void sh2_device::op1101(UINT16 opcode)
+void sh2_device::op1101(uint16_t opcode)
{
MOVLI(opcode & 0xff, Rn);
}
-void sh2_device::op1110(UINT16 opcode)
+void sh2_device::op1110(uint16_t opcode)
{
MOVI(opcode & 0xff, Rn);
}
-void sh2_device::op1111(UINT16 opcode)
+void sh2_device::op1111(uint16_t opcode)
{
ILLEGAL();
}
@@ -2307,7 +2307,7 @@ void sh2_device::execute_run()
do
{
- UINT32 opcode;
+ uint32_t opcode;
debugger_instruction_hook(this, m_sh2_state->pc);
@@ -2516,7 +2516,7 @@ void sh2_device::device_start()
m_pcfsel = 0;
/* initialize the UML generator */
- UINT32 flags = 0;
+ uint32_t flags = 0;
m_drcuml = std::make_unique<drcuml_state>(*this, m_cache, flags, 1, 32, 1);
/* add symbols for our stuff */