diff options
Diffstat (limited to 'src/mame/machine/asic65.cpp')
-rw-r--r-- | src/mame/machine/asic65.cpp | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/src/mame/machine/asic65.cpp b/src/mame/machine/asic65.cpp index 58b46fda1fb..a1ea4d222a1 100644 --- a/src/mame/machine/asic65.cpp +++ b/src/mame/machine/asic65.cpp @@ -36,7 +36,7 @@ #define MAX_COMMANDS 0x2b -static const UINT8 command_map[3][MAX_COMMANDS] = +static const uint8_t command_map[3][MAX_COMMANDS] = { { /* standard version */ @@ -84,7 +84,7 @@ static const UINT8 command_map[3][MAX_COMMANDS] = const device_type ASIC65 = &device_creator<asic65_device>; -asic65_device::asic65_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +asic65_device::asic65_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ASIC65, "Atari ASIC65", tag, owner, clock, "asic65", __FILE__), m_asic65_type(0), m_command(0), @@ -239,8 +239,8 @@ WRITE16_MEMBER( asic65_device::data_w ) READ16_MEMBER( asic65_device::read ) { - INT64 element, result64 = 0; - UINT16 result = 0; + int64_t element, result64 = 0; + uint16_t result = 0; /* rom-based just returns latched data */ if (m_asic65_type == ASIC65_ROMBASED) @@ -282,21 +282,21 @@ READ16_MEMBER( asic65_device::read ) case OP_SIN: /* sin */ if (m_param_index >= 1) - result = (int)(16384. * sin(M_PI * (double)(INT16)m_param[0] / 32768.)); + result = (int)(16384. * sin(M_PI * (double)(int16_t)m_param[0] / 32768.)); break; case OP_COS: /* cos */ if (m_param_index >= 1) - result = (int)(16384. * cos(M_PI * (double)(INT16)m_param[0] / 32768.)); + result = (int)(16384. * cos(M_PI * (double)(int16_t)m_param[0] / 32768.)); break; case OP_ATAN: /* vector angle */ if (m_param_index >= 4) { - INT32 xint = (INT32)((m_param[0] << 16) | m_param[1]); - INT32 yint = (INT32)((m_param[2] << 16) | m_param[3]); + int32_t xint = (int32_t)((m_param[0] << 16) | m_param[1]); + int32_t yint = (int32_t)((m_param[2] << 16) | m_param[3]); double a = atan2((double)yint, (double)xint); - result = (INT16)(a * 32768. / M_PI); + result = (int16_t)(a * 32768. / M_PI); } break; @@ -305,29 +305,29 @@ READ16_MEMBER( asic65_device::read ) /* in Race Drivin' will be off */ if (m_param_index >= 9+6) { - INT32 v0 = (INT32)((m_param[9] << 16) | m_param[10]); - INT32 v1 = (INT32)((m_param[11] << 16) | m_param[12]); - INT32 v2 = (INT32)((m_param[13] << 16) | m_param[14]); + int32_t v0 = (int32_t)((m_param[9] << 16) | m_param[10]); + int32_t v1 = (int32_t)((m_param[11] << 16) | m_param[12]); + int32_t v2 = (int32_t)((m_param[13] << 16) | m_param[14]); /* 2 results per element */ switch (m_result_index / 2) { case 0: - result64 = (INT64)v0 * (INT16)m_param[0] + - (INT64)v1 * (INT16)m_param[3] + - (INT64)v2 * (INT16)m_param[6]; + result64 = (int64_t)v0 * (int16_t)m_param[0] + + (int64_t)v1 * (int16_t)m_param[3] + + (int64_t)v2 * (int16_t)m_param[6]; break; case 1: - result64 = (INT64)v0 * (INT16)m_param[1] + - (INT64)v1 * (INT16)m_param[4] + - (INT64)v2 * (INT16)m_param[7]; + result64 = (int64_t)v0 * (int16_t)m_param[1] + + (int64_t)v1 * (int16_t)m_param[4] + + (int64_t)v2 * (int16_t)m_param[7]; break; case 2: - result64 = (INT64)v0 * (INT16)m_param[2] + - (INT64)v1 * (INT16)m_param[5] + - (INT64)v2 * (INT16)m_param[8]; + result64 = (int64_t)v0 * (int16_t)m_param[2] + + (int64_t)v1 * (int16_t)m_param[5] + + (int64_t)v2 * (int16_t)m_param[8]; break; } @@ -341,29 +341,29 @@ READ16_MEMBER( asic65_device::read ) case OP_MATRIXMULT: /* matrix multiply???? */ if (m_param_index >= 9+6) { - INT32 v0 = (INT32)((m_param[9] << 16) | m_param[10]); - INT32 v1 = (INT32)((m_param[11] << 16) | m_param[12]); - INT32 v2 = (INT32)((m_param[13] << 16) | m_param[14]); + int32_t v0 = (int32_t)((m_param[9] << 16) | m_param[10]); + int32_t v1 = (int32_t)((m_param[11] << 16) | m_param[12]); + int32_t v2 = (int32_t)((m_param[13] << 16) | m_param[14]); /* 2 results per element */ switch (m_result_index / 2) { case 0: - result64 = (INT64)v0 * (INT16)m_param[0] + - (INT64)v1 * (INT16)m_param[1] + - (INT64)v2 * (INT16)m_param[2]; + result64 = (int64_t)v0 * (int16_t)m_param[0] + + (int64_t)v1 * (int16_t)m_param[1] + + (int64_t)v2 * (int16_t)m_param[2]; break; case 1: - result64 = (INT64)v0 * (INT16)m_param[3] + - (INT64)v1 * (INT16)m_param[4] + - (INT64)v2 * (INT16)m_param[5]; + result64 = (int64_t)v0 * (int16_t)m_param[3] + + (int64_t)v1 * (int16_t)m_param[4] + + (int64_t)v2 * (int16_t)m_param[5]; break; case 2: - result64 = (INT64)v0 * (INT16)m_param[6] + - (INT64)v1 * (INT16)m_param[7] + - (INT64)v2 * (INT16)m_param[8]; + result64 = (int64_t)v0 * (int16_t)m_param[6] + + (int64_t)v1 * (int16_t)m_param[7] + + (int64_t)v2 * (int16_t)m_param[8]; break; } @@ -389,22 +389,22 @@ READ16_MEMBER( asic65_device::read ) /* return 0 == scale factor for 1/z */ /* return 1 == transformed X */ /* return 2 == transformed Y, taking height into account */ - element = (INT16)m_param[0]; + element = (int16_t)m_param[0]; if (m_param_index == 2) { - result64 = (element * (INT16)m_param[1]) >> 8; + result64 = (element * (int16_t)m_param[1]) >> 8; result64 -= 1; if (result64 > 0x3fff) result64 = 0; } else if (m_param_index == 3) { - result64 = (element * (INT16)m_param[2]) >> 15; + result64 = (element * (int16_t)m_param[2]) >> 15; result64 += 0xa8; } else if (m_param_index == 4) { - result64 = (INT16)((element * (INT16)m_param[3]) >> 10); - result64 = (INT16)m_yorigin - result64 - (result64 << 1); + result64 = (int16_t)((element * (int16_t)m_param[3]) >> 10); + result64 = (int16_t)m_yorigin - result64 - (result64 << 1); } result = result64 & 0xffff; } @@ -416,13 +416,13 @@ READ16_MEMBER( asic65_device::read ) case OP_SETBANK: /* set a bank */ { - static const UINT8 banklist[] = + static const uint8_t banklist[] = { 1,4,0,4,4,3,4,2, 4,4,4,4,4,4,4,4, 3,3,4,4,1,1,0,0, 4,4,4,4,2,2,4,4, 4,4 }; - static const UINT16 bankaddr[][8] = + static const uint16_t bankaddr[][8] = { { 0x77c0,0x77ce,0x77c2,0x77cc,0x77c4,0x77ca,0x77c6,0x77c8 }, { 0x77d0,0x77de,0x77d2,0x77dc,0x77d4,0x77da,0x77d6,0x77d8 }, @@ -442,7 +442,7 @@ READ16_MEMBER( asic65_device::read ) case OP_VERIFYBANK: /* verify a bank */ { - static const UINT16 bankverify[] = + static const uint16_t bankverify[] = { 0x0eb2,0x1000,0x171b,0x3d28 }; |