summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/fd1089.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/machine/fd1089.cpp')
-rw-r--r--src/mame/machine/fd1089.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/mame/machine/fd1089.cpp b/src/mame/machine/fd1089.cpp
index e364581916c..15938db5773 100644
--- a/src/mame/machine/fd1089.cpp
+++ b/src/mame/machine/fd1089.cpp
@@ -290,10 +290,10 @@ uint8_t fd1089_base_device::rearrange_key(uint8_t table, bool opcode)
if (BIT(table,6))
table ^= (1<<7);
- table = BITSWAP8(table,1,0,6,4,3,5,2,7);
+ table = bitswap<8>(table,1,0,6,4,3,5,2,7);
if (BIT(table,6))
- table = BITSWAP8(table,7,6,2,4,5,3,1,0);
+ table = bitswap<8>(table,7,6,2,4,5,3,1,0);
}
else
{
@@ -307,10 +307,10 @@ uint8_t fd1089_base_device::rearrange_key(uint8_t table, bool opcode)
if (BIT(~table,7))
table ^= (1<<6);
- table = BITSWAP8(table,5,6,7,4,2,3,1,0);
+ table = bitswap<8>(table,5,6,7,4,2,3,1,0);
if (BIT(table,6))
- table = BITSWAP8(table,7,6,5,3,2,4,1,0);
+ table = bitswap<8>(table,7,6,5,3,2,4,1,0);
}
if (BIT(table,6))
@@ -342,7 +342,7 @@ uint8_t fd1089a_device::decode(uint8_t val, uint8_t key, bool opcode)
uint8_t table = rearrange_key(key, opcode);
const decrypt_parameters &p = s_addr_params[table >> 4];
- val = BITSWAP8(val, p.s7,p.s6,p.s5,p.s4,p.s3,p.s2,p.s1,p.s0) ^ p.xorval;
+ val = bitswap<8>(val, p.s7,p.s6,p.s5,p.s4,p.s3,p.s2,p.s1,p.s0) ^ p.xorval;
if (BIT(table,3)) val ^= 0x01;
if (BIT(table,0)) val ^= 0xb1;
@@ -369,20 +369,20 @@ uint8_t fd1089a_device::decode(uint8_t val, uint8_t key, bool opcode)
{
if (BIT(val,0)) val ^= 0xc0;
if (BIT(~val,6) ^ BIT(val,4))
- val = BITSWAP8(val, 7,6,5,4,1,0,2,3);
+ val = bitswap<8>(val, 7,6,5,4,1,0,2,3);
}
else
{
if (BIT(~val,6) ^ BIT(val,4))
- val = BITSWAP8(val, 7,6,5,4,0,1,3,2);
+ val = bitswap<8>(val, 7,6,5,4,0,1,3,2);
}
if (BIT(~val,6))
- val = BITSWAP8(val, 7,6,5,4,2,3,0,1);
+ val = bitswap<8>(val, 7,6,5,4,2,3,0,1);
const decrypt_parameters &q = s_data_params_a[family];
val ^= q.xorval;
- val = BITSWAP8(val, q.s7,q.s6,q.s5,q.s4,q.s3,q.s2,q.s1,q.s0);
+ val = bitswap<8>(val, q.s7,q.s6,q.s5,q.s4,q.s3,q.s2,q.s1,q.s0);
return val;
}
@@ -402,7 +402,7 @@ uint8_t fd1089b_device::decode(uint8_t val, uint8_t key, bool opcode)
uint8_t table = rearrange_key(key, opcode);
const decrypt_parameters &p = s_addr_params[table >> 4];
- val = BITSWAP8(val, p.s7,p.s6,p.s5,p.s4,p.s3,p.s2,p.s1,p.s0) ^ p.xorval;
+ val = bitswap<8>(val, p.s7,p.s6,p.s5,p.s4,p.s3,p.s2,p.s1,p.s0) ^ p.xorval;
if (BIT(table,3)) val ^= 0x01;
if (BIT(table,0)) val ^= 0xb1;
@@ -429,17 +429,17 @@ uint8_t fd1089b_device::decode(uint8_t val, uint8_t key, bool opcode)
if (BIT(table,2))
{
- val = BITSWAP8(val, 7,6,5,4,1,0,3,2);
+ val = bitswap<8>(val, 7,6,5,4,1,0,3,2);
if (BIT(table,0) ^ BIT(table,1))
- val = BITSWAP8(val, 7,6,5,4,0,1,3,2);
+ val = bitswap<8>(val, 7,6,5,4,0,1,3,2);
}
else
{
- val = BITSWAP8(val, 7,6,5,4,3,2,0,1);
+ val = bitswap<8>(val, 7,6,5,4,3,2,0,1);
if (BIT(table,0) ^ BIT(table,1))
- val = BITSWAP8(val, 7,6,5,4,1,0,2,3);
+ val = bitswap<8>(val, 7,6,5,4,1,0,2,3);
}
return val;