diff options
Diffstat (limited to 'src/devices/cpu/minx/minxfunc.h')
-rw-r--r-- | src/devices/cpu/minx/minxfunc.h | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/src/devices/cpu/minx/minxfunc.h b/src/devices/cpu/minx/minxfunc.h index 45478bc6667..adcc2d93641 100644 --- a/src/devices/cpu/minx/minxfunc.h +++ b/src/devices/cpu/minx/minxfunc.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Wilbert Pol -UINT8 minx_cpu_device::ADD8( UINT8 arg1, UINT8 arg2 ) +uint8_t minx_cpu_device::ADD8( uint8_t arg1, uint8_t arg2 ) { - UINT32 res = arg1 + arg2; + uint32_t res = arg1 + arg2; m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( ( arg2 ^ arg1 ^ 0x80 ) & ( arg2 ^ res ) & 0x80 ) ? FLAG_O : 0 ) @@ -13,9 +13,9 @@ UINT8 minx_cpu_device::ADD8( UINT8 arg1, UINT8 arg2 ) } -UINT16 minx_cpu_device::ADD16( UINT16 arg1, UINT16 arg2 ) +uint16_t minx_cpu_device::ADD16( uint16_t arg1, uint16_t arg2 ) { - UINT32 res = arg1 + arg2; + uint32_t res = arg1 + arg2; m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x8000 ) ? FLAG_S : 0 ) | ( ( ( arg2 ^ arg1 ^ 0x8000 ) & ( arg2 ^ res ) & 0x8000 ) ? FLAG_O : 0 ) @@ -26,9 +26,9 @@ UINT16 minx_cpu_device::ADD16( UINT16 arg1, UINT16 arg2 ) } -UINT8 minx_cpu_device::ADDC8( UINT8 arg1, UINT8 arg2 ) +uint8_t minx_cpu_device::ADDC8( uint8_t arg1, uint8_t arg2 ) { - UINT32 res = arg1 + arg2 + ( ( m_F & FLAG_C ) ? 1 : 0 ); + uint32_t res = arg1 + arg2 + ( ( m_F & FLAG_C ) ? 1 : 0 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( ( arg2 ^ arg1 ^ 0x80 ) & ( arg2 ^ res ) & 0x80 ) ? FLAG_O : 0 ) @@ -39,9 +39,9 @@ UINT8 minx_cpu_device::ADDC8( UINT8 arg1, UINT8 arg2 ) } -UINT16 minx_cpu_device::ADDC16( UINT16 arg1, UINT16 arg2 ) +uint16_t minx_cpu_device::ADDC16( uint16_t arg1, uint16_t arg2 ) { - UINT32 res = arg1 + arg2 + ( ( m_F & FLAG_C ) ? 1 : 0 ); + uint32_t res = arg1 + arg2 + ( ( m_F & FLAG_C ) ? 1 : 0 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x8000 ) ? FLAG_S : 0 ) | ( ( ( arg2 ^ arg1 ^ 0x8000 ) & ( arg2 ^ res ) & 0x8000 ) ? FLAG_O : 0 ) @@ -52,10 +52,10 @@ UINT16 minx_cpu_device::ADDC16( UINT16 arg1, UINT16 arg2 ) } -UINT8 minx_cpu_device::INC8( UINT8 arg ) +uint8_t minx_cpu_device::INC8( uint8_t arg ) { - UINT8 old_F = m_F; - UINT8 res = ADD8( arg, 1 ); + uint8_t old_F = m_F; + uint8_t res = ADD8( arg, 1 ); m_F = ( old_F & ~ ( FLAG_Z ) ) | ( ( res ) ? 0 : FLAG_Z ) ; @@ -63,10 +63,10 @@ UINT8 minx_cpu_device::INC8( UINT8 arg ) } -UINT16 minx_cpu_device::INC16( UINT16 arg ) +uint16_t minx_cpu_device::INC16( uint16_t arg ) { - UINT8 old_F = m_F; - UINT16 res = ADD16( arg, 1 ); + uint8_t old_F = m_F; + uint16_t res = ADD16( arg, 1 ); m_F = ( old_F & ~ ( FLAG_Z ) ) | ( ( res ) ? 0 : FLAG_Z ) ; @@ -74,9 +74,9 @@ UINT16 minx_cpu_device::INC16( UINT16 arg ) } -UINT8 minx_cpu_device::SUB8( UINT8 arg1, UINT8 arg2 ) +uint8_t minx_cpu_device::SUB8( uint8_t arg1, uint8_t arg2 ) { - UINT32 res = arg1 - arg2; + uint32_t res = arg1 - arg2; m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( ( arg2 ^ arg1 ) & ( arg1 ^ res ) & 0x80 ) ? FLAG_O : 0 ) @@ -87,9 +87,9 @@ UINT8 minx_cpu_device::SUB8( UINT8 arg1, UINT8 arg2 ) } -UINT16 minx_cpu_device::SUB16( UINT16 arg1, UINT16 arg2 ) +uint16_t minx_cpu_device::SUB16( uint16_t arg1, uint16_t arg2 ) { - UINT32 res = arg1 - arg2; + uint32_t res = arg1 - arg2; m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x8000 ) ? FLAG_S : 0 ) | ( ( ( arg2 ^ arg1 ) & ( arg1 ^ res ) & 0x8000 ) ? FLAG_O : 0 ) @@ -100,9 +100,9 @@ UINT16 minx_cpu_device::SUB16( UINT16 arg1, UINT16 arg2 ) } -UINT8 minx_cpu_device::SUBC8( UINT8 arg1, UINT8 arg2 ) +uint8_t minx_cpu_device::SUBC8( uint8_t arg1, uint8_t arg2 ) { - UINT32 res = arg1 - arg2 - ( ( m_F & FLAG_C ) ? 1 : 0 ); + uint32_t res = arg1 - arg2 - ( ( m_F & FLAG_C ) ? 1 : 0 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( ( arg2 ^ arg1 ) & ( arg1 ^ res ) & 0x80 ) ? FLAG_O : 0 ) @@ -113,9 +113,9 @@ UINT8 minx_cpu_device::SUBC8( UINT8 arg1, UINT8 arg2 ) } -UINT16 minx_cpu_device::SUBC16( UINT16 arg1, UINT16 arg2 ) +uint16_t minx_cpu_device::SUBC16( uint16_t arg1, uint16_t arg2 ) { - UINT32 res = arg1 - arg2 - ( ( m_F & FLAG_C ) ? 1 : 0 ); + uint32_t res = arg1 - arg2 - ( ( m_F & FLAG_C ) ? 1 : 0 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x8000 ) ? FLAG_S : 0 ) | ( ( ( arg2 ^ arg1 ) & ( arg1 ^ res ) & 0x8000 ) ? FLAG_O : 0 ) @@ -126,10 +126,10 @@ UINT16 minx_cpu_device::SUBC16( UINT16 arg1, UINT16 arg2 ) } -UINT8 minx_cpu_device::DEC8( UINT8 arg ) +uint8_t minx_cpu_device::DEC8( uint8_t arg ) { - UINT8 old_F = m_F; - UINT8 res = SUB8( arg, 1 ); + uint8_t old_F = m_F; + uint8_t res = SUB8( arg, 1 ); m_F = ( old_F & ~ ( FLAG_Z ) ) | ( ( res ) ? 0 : FLAG_Z ) ; @@ -137,10 +137,10 @@ UINT8 minx_cpu_device::DEC8( UINT8 arg ) } -UINT16 minx_cpu_device::DEC16( UINT16 arg ) +uint16_t minx_cpu_device::DEC16( uint16_t arg ) { - UINT8 old_F = m_F; - UINT16 res = SUB16( arg, 1 ); + uint8_t old_F = m_F; + uint16_t res = SUB16( arg, 1 ); m_F = ( old_F & ~ ( FLAG_Z ) ) | ( ( res ) ? 0 : FLAG_Z ) ; @@ -148,9 +148,9 @@ UINT16 minx_cpu_device::DEC16( UINT16 arg ) } -UINT8 minx_cpu_device::AND8( UINT8 arg1, UINT8 arg2 ) +uint8_t minx_cpu_device::AND8( uint8_t arg1, uint8_t arg2 ) { - UINT8 res = arg1 & arg2; + uint8_t res = arg1 & arg2; m_F = ( m_F & ~ ( FLAG_S | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( res ) ? 0 : FLAG_Z ) @@ -159,9 +159,9 @@ UINT8 minx_cpu_device::AND8( UINT8 arg1, UINT8 arg2 ) } -UINT8 minx_cpu_device::OR8( UINT8 arg1, UINT8 arg2 ) +uint8_t minx_cpu_device::OR8( uint8_t arg1, uint8_t arg2 ) { - UINT8 res = arg1 | arg2; + uint8_t res = arg1 | arg2; m_F = ( m_F & ~ ( FLAG_S | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( res ) ? 0 : FLAG_Z ) @@ -170,9 +170,9 @@ UINT8 minx_cpu_device::OR8( UINT8 arg1, UINT8 arg2 ) } -UINT8 minx_cpu_device::XOR8( UINT8 arg1, UINT8 arg2 ) +uint8_t minx_cpu_device::XOR8( uint8_t arg1, uint8_t arg2 ) { - UINT8 res = arg1 ^ arg2; + uint8_t res = arg1 ^ arg2; m_F = ( m_F & ~ ( FLAG_S | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( res ) ? 0 : FLAG_Z ) @@ -181,9 +181,9 @@ UINT8 minx_cpu_device::XOR8( UINT8 arg1, UINT8 arg2 ) } -UINT8 minx_cpu_device::NOT8( UINT8 arg ) +uint8_t minx_cpu_device::NOT8( uint8_t arg ) { - UINT8 res = ~arg; + uint8_t res = ~arg; m_F = ( m_F & ~ ( FLAG_S | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( res ) ? 0 : FLAG_Z ) @@ -192,9 +192,9 @@ UINT8 minx_cpu_device::NOT8( UINT8 arg ) } -UINT8 minx_cpu_device::NEG8( UINT8 arg ) +uint8_t minx_cpu_device::NEG8( uint8_t arg ) { - UINT8 res = -arg; + uint8_t res = -arg; m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( res ) ? 0 : FLAG_Z ) @@ -203,9 +203,9 @@ UINT8 minx_cpu_device::NEG8( UINT8 arg ) } -UINT8 minx_cpu_device::SAL8( UINT8 arg ) +uint8_t minx_cpu_device::SAL8( uint8_t arg ) { - UINT16 res = arg << 1; + uint16_t res = arg << 1; m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( arg != 0 && res == 0 ) ? FLAG_O : 0 ) @@ -216,9 +216,9 @@ UINT8 minx_cpu_device::SAL8( UINT8 arg ) } -UINT8 minx_cpu_device::SAR8( UINT8 arg ) +uint8_t minx_cpu_device::SAR8( uint8_t arg ) { - UINT16 res = ( arg >> 1 ) | ( arg & 0x80 ); + uint16_t res = ( arg >> 1 ) | ( arg & 0x80 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( arg != 0x80 && res == 0x80 ) ? FLAG_O : 0 ) @@ -229,9 +229,9 @@ UINT8 minx_cpu_device::SAR8( UINT8 arg ) } -UINT8 minx_cpu_device::SHL8( UINT8 arg ) +uint8_t minx_cpu_device::SHL8( uint8_t arg ) { - UINT16 res = arg << 1; + uint16_t res = arg << 1; m_F = ( m_F & ~ ( FLAG_S | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( arg & 0x80 ) ? FLAG_C : 0 ) @@ -241,9 +241,9 @@ UINT8 minx_cpu_device::SHL8( UINT8 arg ) } -UINT8 minx_cpu_device::SHR8( UINT8 arg ) +uint8_t minx_cpu_device::SHR8( uint8_t arg ) { - UINT16 res = arg >> 1; + uint16_t res = arg >> 1; m_F = ( m_F & ~ ( FLAG_S | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( arg & 0x01 ) ? FLAG_C : 0 ) @@ -253,9 +253,9 @@ UINT8 minx_cpu_device::SHR8( UINT8 arg ) } -UINT8 minx_cpu_device::ROLC8( UINT8 arg ) +uint8_t minx_cpu_device::ROLC8( uint8_t arg ) { - UINT16 res = ( arg << 1 ) | ( ( m_F & FLAG_C ) ? 1 : 0 ); + uint16_t res = ( arg << 1 ) | ( ( m_F & FLAG_C ) ? 1 : 0 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( arg & 0x80 ) ? FLAG_C : 0 ) @@ -265,9 +265,9 @@ UINT8 minx_cpu_device::ROLC8( UINT8 arg ) } -UINT8 minx_cpu_device::RORC8( UINT8 arg ) +uint8_t minx_cpu_device::RORC8( uint8_t arg ) { - UINT16 res = ( arg >> 1 ) | ( ( m_F & FLAG_C ) ? 0x80 : 0 ); + uint16_t res = ( arg >> 1 ) | ( ( m_F & FLAG_C ) ? 0x80 : 0 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( arg & 0x01 ) ? FLAG_C : 0 ) @@ -277,9 +277,9 @@ UINT8 minx_cpu_device::RORC8( UINT8 arg ) } -UINT8 minx_cpu_device::ROL8( UINT8 arg ) +uint8_t minx_cpu_device::ROL8( uint8_t arg ) { - UINT16 res = ( arg << 1 ) | ( ( arg & 0x80 ) ? 1 : 0 ); + uint16_t res = ( arg << 1 ) | ( ( arg & 0x80 ) ? 1 : 0 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( arg & 0x80 ) ? FLAG_C : 0 ) @@ -289,9 +289,9 @@ UINT8 minx_cpu_device::ROL8( UINT8 arg ) } -UINT8 minx_cpu_device::ROR8( UINT8 arg ) +uint8_t minx_cpu_device::ROR8( uint8_t arg ) { - UINT16 res = ( arg >> 1 ) | ( ( arg & 0x01 ) ? 0x80 : 0 ); + uint16_t res = ( arg >> 1 ) | ( ( arg & 0x01 ) ? 0x80 : 0 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( arg & 0x01 ) ? FLAG_C : 0 ) @@ -301,42 +301,42 @@ UINT8 minx_cpu_device::ROR8( UINT8 arg ) } -void minx_cpu_device::PUSH8( UINT8 arg ) +void minx_cpu_device::PUSH8( uint8_t arg ) { m_SP = m_SP - 1; WR( m_SP, arg ); } -void minx_cpu_device::PUSH16( UINT16 arg ) +void minx_cpu_device::PUSH16( uint16_t arg ) { PUSH8( arg >> 8 ); PUSH8( arg & 0x00FF ); } -UINT8 minx_cpu_device::POP8() +uint8_t minx_cpu_device::POP8() { - UINT8 res = RD( m_SP ); + uint8_t res = RD( m_SP ); m_SP = m_SP + 1; return res; } -UINT16 minx_cpu_device::POP16() +uint16_t minx_cpu_device::POP16() { return POP8() | ( POP8() << 8 ); } -void minx_cpu_device::JMP( UINT16 arg ) +void minx_cpu_device::JMP( uint16_t arg ) { m_V = m_U; m_PC = arg; } -void minx_cpu_device::CALL( UINT16 arg ) +void minx_cpu_device::CALL( uint16_t arg ) { PUSH8( m_V ); PUSH16( m_PC ); @@ -344,21 +344,21 @@ void minx_cpu_device::CALL( UINT16 arg ) } -#define AD1_IHL UINT32 addr1 = ( m_I << 16 ) | m_HL -#define AD1_IN8 UINT32 addr1 = ( m_I << 16 ) | ( m_N << 8 ) | rdop() -#define AD1_I16 UINT32 addr1 = ( m_I << 16 ) | rdop16() -#define AD1_XIX UINT32 addr1 = ( m_XI << 16 ) | m_X -#define AD1_YIY UINT32 addr1 = ( m_YI << 16 ) | m_Y -#define AD1_X8 UINT32 addr1 = ( m_XI << 16 ) | ( m_X + rdop() ) -#define AD1_Y8 UINT32 addr1 = ( m_YI << 16 ) | ( m_Y + rdop() ) -#define AD1_XL UINT32 addr1 = ( m_XI << 16 ) | ( m_X + ( m_HL & 0x00FF ) ) -#define AD1_YL UINT32 addr1 = ( m_YI << 16 ) | ( m_Y + ( m_HL & 0x00FF ) ) -#define AD2_IHL UINT32 addr2 = ( m_I << 16 ) | m_HL -#define AD2_IN8 UINT32 addr2 = ( m_I << 16 ) | ( m_N << 8 ) | rdop() -#define AD2_I16 UINT32 addr2 = ( m_I << 16 ) | rdop(); addr2 |= ( rdop() << 8 ) -#define AD2_XIX UINT32 addr2 = ( m_XI << 16 ) | m_X -#define AD2_YIY UINT32 addr2 = ( m_YI << 16 ) | m_Y -#define AD2_X8 UINT32 addr2 = ( m_XI << 16 ) | ( m_X + rdop() ) -#define AD2_Y8 UINT32 addr2 = ( m_YI << 16 ) | ( m_Y + rdop() ) -#define AD2_XL UINT32 addr2 = ( m_XI << 16 ) | ( m_X + ( m_HL & 0x00FF ) ) -#define AD2_YL UINT32 addr2 = ( m_YI << 16 ) | ( m_Y + ( m_HL & 0x00FF ) ) +#define AD1_IHL uint32_t addr1 = ( m_I << 16 ) | m_HL +#define AD1_IN8 uint32_t addr1 = ( m_I << 16 ) | ( m_N << 8 ) | rdop() +#define AD1_I16 uint32_t addr1 = ( m_I << 16 ) | rdop16() +#define AD1_XIX uint32_t addr1 = ( m_XI << 16 ) | m_X +#define AD1_YIY uint32_t addr1 = ( m_YI << 16 ) | m_Y +#define AD1_X8 uint32_t addr1 = ( m_XI << 16 ) | ( m_X + rdop() ) +#define AD1_Y8 uint32_t addr1 = ( m_YI << 16 ) | ( m_Y + rdop() ) +#define AD1_XL uint32_t addr1 = ( m_XI << 16 ) | ( m_X + ( m_HL & 0x00FF ) ) +#define AD1_YL uint32_t addr1 = ( m_YI << 16 ) | ( m_Y + ( m_HL & 0x00FF ) ) +#define AD2_IHL uint32_t addr2 = ( m_I << 16 ) | m_HL +#define AD2_IN8 uint32_t addr2 = ( m_I << 16 ) | ( m_N << 8 ) | rdop() +#define AD2_I16 uint32_t addr2 = ( m_I << 16 ) | rdop(); addr2 |= ( rdop() << 8 ) +#define AD2_XIX uint32_t addr2 = ( m_XI << 16 ) | m_X +#define AD2_YIY uint32_t addr2 = ( m_YI << 16 ) | m_Y +#define AD2_X8 uint32_t addr2 = ( m_XI << 16 ) | ( m_X + rdop() ) +#define AD2_Y8 uint32_t addr2 = ( m_YI << 16 ) | ( m_Y + rdop() ) +#define AD2_XL uint32_t addr2 = ( m_XI << 16 ) | ( m_X + ( m_HL & 0x00FF ) ) +#define AD2_YL uint32_t addr2 = ( m_YI << 16 ) | ( m_Y + ( m_HL & 0x00FF ) ) |