diff options
author | 2016-10-22 13:13:17 +0200 | |
---|---|---|
committer | 2016-10-22 13:13:17 +0200 | |
commit | ddb290d5f615019c33c42b8d94e5a5254cabcf33 (patch) | |
tree | a70f688b0df3acd19da7b1151e5902e3c6af3fa5 /src/devices/cpu/asap | |
parent | 333bff8de64dfaeb98134000412796b4fdef970b (diff) |
NOTICE (TYPE NAME CONSOLIDATION)
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8
also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
Diffstat (limited to 'src/devices/cpu/asap')
-rw-r--r-- | src/devices/cpu/asap/asap.cpp | 316 | ||||
-rw-r--r-- | src/devices/cpu/asap/asap.h | 52 | ||||
-rw-r--r-- | src/devices/cpu/asap/asapdasm.cpp | 16 |
3 files changed, 192 insertions, 192 deletions
diff --git a/src/devices/cpu/asap/asap.cpp b/src/devices/cpu/asap/asap.cpp index bfad7b0a4cf..c5271ab128a 100644 --- a/src/devices/cpu/asap/asap.cpp +++ b/src/devices/cpu/asap/asap.cpp @@ -20,12 +20,12 @@ // CONSTANTS //************************************************************************** -const UINT32 PS_CFLAG = 0x00000001; -const UINT32 PS_VFLAG = 0x00000002; -const UINT32 PS_ZFLAG = 0x00000004; -const UINT32 PS_NFLAG = 0x00000008; -const UINT32 PS_IFLAG = 0x00000010; -const UINT32 PS_PFLAG = 0x00000020; +const uint32_t PS_CFLAG = 0x00000001; +const uint32_t PS_VFLAG = 0x00000002; +const uint32_t PS_ZFLAG = 0x00000004; +const uint32_t PS_NFLAG = 0x00000008; +const uint32_t PS_IFLAG = 0x00000010; +const uint32_t PS_PFLAG = 0x00000020; //const int EXCEPTION_RESET = 0; const int EXCEPTION_TRAP0 = 1; @@ -40,8 +40,8 @@ const int REGBASE = 0xffe0; // MACROS //************************************************************************** -#define SET_C_ADD(a,b) (m_cflag = (UINT32)(b) > (UINT32)(~(a))) -#define SET_C_SUB(a,b) (m_cflag = (UINT32)(b) <= (UINT32)(a)) +#define SET_C_ADD(a,b) (m_cflag = (uint32_t)(b) > (uint32_t)(~(a))) +#define SET_C_SUB(a,b) (m_cflag = (uint32_t)(b) <= (uint32_t)(a)) #define SET_V_ADD(r,a,b) (m_vflag = ~((a) ^ (b)) & ((a) ^ (r))) #define SET_V_SUB(r,a,b) (m_vflag = ((a) ^ (b)) & ((a) ^ (r))) #define SET_ZN(r) (m_znflag = (r)) @@ -136,7 +136,7 @@ const device_type ASAP = &device_creator<asap_device>; // asap_device - constructor //------------------------------------------------- -asap_device::asap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +asap_device::asap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, ASAP, "ASAP", tag, owner, clock, "asap", __FILE__), m_program_config("program", ENDIANNESS_LITTLE, 32, 32), m_pc(0), @@ -288,7 +288,7 @@ void asap_device::state_string_export(const device_state_entry &entry, std::stri str = string_format("%c%c%c%c%c%c", m_pflag ? 'P' : '.', m_iflag ? 'I' : '.', - ((INT32)m_znflag < 0) ? 'N' : '.', + ((int32_t)m_znflag < 0) ? 'N' : '.', (m_znflag == 0) ? 'Z' : '.', ((m_vflag >> 30) & PS_VFLAG) ? 'V' : '.', m_cflag ? 'C' : '.'); @@ -302,7 +302,7 @@ void asap_device::state_string_export(const device_state_entry &entry, std::stri // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 asap_device::disasm_min_opcode_bytes() const +uint32_t asap_device::disasm_min_opcode_bytes() const { return 4; } @@ -313,7 +313,7 @@ UINT32 asap_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 asap_device::disasm_max_opcode_bytes() const +uint32_t asap_device::disasm_max_opcode_bytes() const { return 12; } @@ -324,7 +324,7 @@ UINT32 asap_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t asap_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t asap_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( asap ); return CPU_DISASSEMBLE_NAME(asap)(this, buffer, pc, oprom, opram, options); @@ -340,7 +340,7 @@ offs_t asap_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opr // readop - read an opcode at the given address //------------------------------------------------- -inline UINT32 asap_device::readop(offs_t pc) +inline uint32_t asap_device::readop(offs_t pc) { return m_direct->read_dword(pc); } @@ -350,7 +350,7 @@ inline UINT32 asap_device::readop(offs_t pc) // readbyte - read a byte at the given address //------------------------------------------------- -inline UINT8 asap_device::readbyte(offs_t address) +inline uint8_t asap_device::readbyte(offs_t address) { // no alignment issues with bytes return m_program->read_byte(address); @@ -361,7 +361,7 @@ inline UINT8 asap_device::readbyte(offs_t address) // readword - read a word at the given address //------------------------------------------------- -inline UINT16 asap_device::readword(offs_t address) +inline uint16_t asap_device::readword(offs_t address) { // aligned reads are easy if (WORD_ALIGNED(address)) @@ -376,7 +376,7 @@ inline UINT16 asap_device::readword(offs_t address) // readlong - read a long at the given address //------------------------------------------------- -inline UINT32 asap_device::readlong(offs_t address) +inline uint32_t asap_device::readlong(offs_t address) { // aligned reads are easy if (DWORD_ALIGNED(address)) @@ -391,7 +391,7 @@ inline UINT32 asap_device::readlong(offs_t address) // writebyte - write a byte at the given address //------------------------------------------------- -inline void asap_device::writebyte(offs_t address, UINT8 data) +inline void asap_device::writebyte(offs_t address, uint8_t data) { // no alignment issues with bytes m_program->write_byte(address, data); @@ -402,7 +402,7 @@ inline void asap_device::writebyte(offs_t address, UINT8 data) // writeword - write a word at the given address //------------------------------------------------- -inline void asap_device::writeword(offs_t address, UINT16 data) +inline void asap_device::writeword(offs_t address, uint16_t data) { // aligned writes are easy if (WORD_ALIGNED(address)) @@ -426,7 +426,7 @@ inline void asap_device::writeword(offs_t address, UINT16 data) // writelong - write a long at the given address //------------------------------------------------- -inline void asap_device::writelong(offs_t address, UINT32 data) +inline void asap_device::writelong(offs_t address, uint32_t data) { // aligned writes are easy if (DWORD_ALIGNED(address)) @@ -524,7 +524,7 @@ inline void asap_device::execute_instruction() // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 asap_device::execute_min_cycles() const +uint32_t asap_device::execute_min_cycles() const { return 1; } @@ -535,7 +535,7 @@ UINT32 asap_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 asap_device::execute_max_cycles() const +uint32_t asap_device::execute_max_cycles() const { return 2; } @@ -546,7 +546,7 @@ UINT32 asap_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 asap_device::execute_input_lines() const +uint32_t asap_device::execute_input_lines() const { return 1; } @@ -635,9 +635,9 @@ void asap_device::trap0() void asap_device::bsp() { - if ((INT32)m_znflag > 0) + if ((int32_t)m_znflag > 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -650,9 +650,9 @@ void asap_device::bsp() void asap_device::bmz() { - if ((INT32)m_znflag <= 0) + if ((int32_t)m_znflag <= 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -665,9 +665,9 @@ void asap_device::bmz() void asap_device::bgt() { - if (m_znflag != 0 && (INT32)(m_znflag ^ m_vflag) >= 0) + if (m_znflag != 0 && (int32_t)(m_znflag ^ m_vflag) >= 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -680,9 +680,9 @@ void asap_device::bgt() void asap_device::ble() { - if (m_znflag == 0 || (INT32)(m_znflag ^ m_vflag) < 0) + if (m_znflag == 0 || (int32_t)(m_znflag ^ m_vflag) < 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -695,9 +695,9 @@ void asap_device::ble() void asap_device::bge() { - if ((INT32)(m_znflag ^ m_vflag) >= 0) + if ((int32_t)(m_znflag ^ m_vflag) >= 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -710,9 +710,9 @@ void asap_device::bge() void asap_device::blt() { - if ((INT32)(m_znflag ^ m_vflag) < 0) + if ((int32_t)(m_znflag ^ m_vflag) < 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -727,7 +727,7 @@ void asap_device::bhi() { if (m_znflag != 0 && m_cflag) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -742,7 +742,7 @@ void asap_device::bls() { if (m_znflag == 0 || !m_cflag) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -757,7 +757,7 @@ void asap_device::bcc() { if (!m_cflag) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -772,7 +772,7 @@ void asap_device::bcs() { if (m_cflag) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -785,9 +785,9 @@ void asap_device::bcs() void asap_device::bpl() { - if ((INT32)m_znflag >= 0) + if ((int32_t)m_znflag >= 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -800,9 +800,9 @@ void asap_device::bpl() void asap_device::bmi() { - if ((INT32)m_znflag < 0) + if ((int32_t)m_znflag < 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -817,7 +817,7 @@ void asap_device::bne() { if (m_znflag != 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -832,7 +832,7 @@ void asap_device::beq() { if (m_znflag == 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -845,9 +845,9 @@ void asap_device::beq() void asap_device::bvc() { - if ((INT32)m_vflag >= 0) + if ((int32_t)m_vflag >= 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -860,9 +860,9 @@ void asap_device::bvc() void asap_device::bvs() { - if ((INT32)m_vflag < 0) + if ((int32_t)m_vflag < 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -878,7 +878,7 @@ void asap_device::bvs() void asap_device::bsr() { DSTVAL = m_pc + 4; - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -890,7 +890,7 @@ void asap_device::bsr() void asap_device::bsr_0() { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -909,9 +909,9 @@ void asap_device::lea() void asap_device::lea_c() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 + (src2 << 2); + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 + (src2 << 2); SET_ZNCV_ADD(dst, src1, src2); if (src1 & 0xc0000000) @@ -923,9 +923,9 @@ void asap_device::lea_c() void asap_device::lea_c0() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 + (src2 << 2); + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 + (src2 << 2); SET_ZNCV_ADD(dst, src1, src2); if (src1 & 0xc0000000) @@ -943,9 +943,9 @@ void asap_device::leah() void asap_device::leah_c() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 + (src2 << 1); + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 + (src2 << 1); SET_ZNCV_ADD(dst, src1, src2); if (src1 & 0x80000000) @@ -957,9 +957,9 @@ void asap_device::leah_c() void asap_device::leah_c0() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 + (src2 << 1); + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 + (src2 << 1); SET_ZNCV_ADD(dst, src1, src2); if (src1 & 0x80000000) @@ -977,9 +977,9 @@ void asap_device::subr() void asap_device::subr_c() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src2 - src1; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src2 - src1; SET_ZNCV_SUB(dst, src2, src1); DSTVAL = dst; @@ -987,9 +987,9 @@ void asap_device::subr_c() void asap_device::subr_c0() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src2 - src1; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src2 - src1; SET_ZNCV_SUB(dst, src2, src1); } @@ -1003,14 +1003,14 @@ void asap_device::xor_() void asap_device::xor_c() { - UINT32 dst = SRC1VAL ^ SRC2VAL; + uint32_t dst = SRC1VAL ^ SRC2VAL; SET_ZN(dst); DSTVAL = dst; } void asap_device::xor_c0() { - UINT32 dst = SRC1VAL ^ SRC2VAL; + uint32_t dst = SRC1VAL ^ SRC2VAL; SET_ZN(dst); } @@ -1023,14 +1023,14 @@ void asap_device::xorn() void asap_device::xorn_c() { - UINT32 dst = SRC1VAL ^ ~SRC2VAL; + uint32_t dst = SRC1VAL ^ ~SRC2VAL; SET_ZN(dst); DSTVAL = dst; } void asap_device::xorn_c0() { - UINT32 dst = SRC1VAL ^ ~SRC2VAL; + uint32_t dst = SRC1VAL ^ ~SRC2VAL; SET_ZN(dst); } @@ -1043,9 +1043,9 @@ void asap_device::add() void asap_device::add_c() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 + src2; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 + src2; SET_ZNCV_ADD(dst, src1, src2); DSTVAL = dst; @@ -1053,9 +1053,9 @@ void asap_device::add_c() void asap_device::add_c0() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 + src2; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 + src2; SET_ZNCV_ADD(dst, src1, src2); } @@ -1069,9 +1069,9 @@ void asap_device::sub() void asap_device::sub_c() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 - src2; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 - src2; SET_ZNCV_SUB(dst, src1, src2); DSTVAL = dst; @@ -1079,9 +1079,9 @@ void asap_device::sub_c() void asap_device::sub_c0() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 - src2; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 - src2; SET_ZNCV_SUB(dst, src1, src2); } @@ -1095,9 +1095,9 @@ void asap_device::addc() void asap_device::addc_c() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 + src2 + m_cflag; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 + src2 + m_cflag; SET_ZNCV_ADD(dst, src1, src2); DSTVAL = dst; @@ -1105,9 +1105,9 @@ void asap_device::addc_c() void asap_device::addc_c0() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 + src2 + m_cflag; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 + src2 + m_cflag; SET_ZNCV_ADD(dst, src1, src2); } @@ -1121,9 +1121,9 @@ void asap_device::subc() void asap_device::subc_c() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 - src2 - 1 + m_cflag; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 - src2 - 1 + m_cflag; SET_ZNCV_SUB(dst, src1, src2); DSTVAL = dst; @@ -1131,9 +1131,9 @@ void asap_device::subc_c() void asap_device::subc_c0() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 - src2 - 1 + m_cflag; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 - src2 - 1 + m_cflag; SET_ZNCV_SUB(dst, src1, src2); } @@ -1147,14 +1147,14 @@ void asap_device::and_() void asap_device::and_c() { - UINT32 dst = SRC1VAL & SRC2VAL; + uint32_t dst = SRC1VAL & SRC2VAL; SET_ZN(dst); DSTVAL = dst; } void asap_device::and_c0() { - UINT32 dst = SRC1VAL & SRC2VAL; + uint32_t dst = SRC1VAL & SRC2VAL; SET_ZN(dst); } @@ -1167,14 +1167,14 @@ void asap_device::andn() void asap_device::andn_c() { - UINT32 dst = SRC1VAL & ~SRC2VAL; + uint32_t dst = SRC1VAL & ~SRC2VAL; SET_ZN(dst); DSTVAL = dst; } void asap_device::andn_c0() { - UINT32 dst = SRC1VAL & ~SRC2VAL; + uint32_t dst = SRC1VAL & ~SRC2VAL; SET_ZN(dst); } @@ -1187,14 +1187,14 @@ void asap_device::or_() void asap_device::or_c() { - UINT32 dst = SRC1VAL | SRC2VAL; + uint32_t dst = SRC1VAL | SRC2VAL; SET_ZN(dst); DSTVAL = dst; } void asap_device::or_c0() { - UINT32 dst = SRC1VAL | SRC2VAL; + uint32_t dst = SRC1VAL | SRC2VAL; SET_ZN(dst); } @@ -1207,14 +1207,14 @@ void asap_device::orn() void asap_device::orn_c() { - UINT32 dst = SRC1VAL | ~SRC2VAL; + uint32_t dst = SRC1VAL | ~SRC2VAL; SET_ZN(dst); DSTVAL = dst; } void asap_device::orn_c0() { - UINT32 dst = SRC1VAL | ~SRC2VAL; + uint32_t dst = SRC1VAL | ~SRC2VAL; SET_ZN(dst); } @@ -1232,14 +1232,14 @@ void asap_device::ld_0() void asap_device::ld_c() { - UINT32 dst = readlong(SRC1VAL + (SRC2VAL << 2)); + uint32_t dst = readlong(SRC1VAL + (SRC2VAL << 2)); SET_ZN(dst); DSTVAL = dst; } void asap_device::ld_c0() { - UINT32 dst = readlong(SRC1VAL + (SRC2VAL << 2)); + uint32_t dst = readlong(SRC1VAL + (SRC2VAL << 2)); SET_ZN(dst); } @@ -1247,7 +1247,7 @@ void asap_device::ld_c0() void asap_device::ldh() { - DSTVAL = (INT16)readword(SRC1VAL + (SRC2VAL << 1)); + DSTVAL = (int16_t)readword(SRC1VAL + (SRC2VAL << 1)); } void asap_device::ldh_0() @@ -1257,14 +1257,14 @@ void asap_device::ldh_0() void asap_device::ldh_c() { - UINT32 dst = (INT16)readword(SRC1VAL + (SRC2VAL << 1)); + uint32_t dst = (int16_t)readword(SRC1VAL + (SRC2VAL << 1)); SET_ZN(dst); DSTVAL = dst; } void asap_device::ldh_c0() { - UINT32 dst = (INT16)readword(SRC1VAL + (SRC2VAL << 1)); + uint32_t dst = (int16_t)readword(SRC1VAL + (SRC2VAL << 1)); SET_ZN(dst); } @@ -1282,14 +1282,14 @@ void asap_device::lduh_0() void asap_device::lduh_c() { - UINT32 dst = readword(SRC1VAL + (SRC2VAL << 1)); + uint32_t dst = readword(SRC1VAL + (SRC2VAL << 1)); SET_ZN(dst); DSTVAL = dst; } void asap_device::lduh_c0() { - UINT32 dst = readword(SRC1VAL + (SRC2VAL << 1)); + uint32_t dst = readword(SRC1VAL + (SRC2VAL << 1)); SET_ZN(dst); } @@ -1307,7 +1307,7 @@ void asap_device::sth_0() void asap_device::sth_c() { - UINT32 dst = (UINT16)DSTVAL; + uint32_t dst = (uint16_t)DSTVAL; SET_ZN(dst); writeword(SRC1VAL + (SRC2VAL << 1), dst); } @@ -1332,7 +1332,7 @@ void asap_device::st_0() void asap_device::st_c() { - UINT32 dst = DSTVAL; + uint32_t dst = DSTVAL; SET_ZN(dst); writelong(SRC1VAL + (SRC2VAL << 2), dst); } @@ -1347,7 +1347,7 @@ void asap_device::st_c0() void asap_device::ldb() { - DSTVAL = (INT8)readbyte(SRC1VAL + SRC2VAL); + DSTVAL = (int8_t)readbyte(SRC1VAL + SRC2VAL); } void asap_device::ldb_0() @@ -1357,14 +1357,14 @@ void asap_device::ldb_0() void asap_device::ldb_c() { - UINT32 dst = (INT8)readbyte(SRC1VAL + SRC2VAL); + uint32_t dst = (int8_t)readbyte(SRC1VAL + SRC2VAL); SET_ZN(dst); DSTVAL = dst; } void asap_device::ldb_c0() { - UINT32 dst = (INT8)readbyte(SRC1VAL + SRC2VAL); + uint32_t dst = (int8_t)readbyte(SRC1VAL + SRC2VAL); SET_ZN(dst); } @@ -1382,14 +1382,14 @@ void asap_device::ldub_0() void asap_device::ldub_c() { - UINT32 dst = readbyte(SRC1VAL + SRC2VAL); + uint32_t dst = readbyte(SRC1VAL + SRC2VAL); SET_ZN(dst); DSTVAL = dst; } void asap_device::ldub_c0() { - UINT32 dst = readbyte(SRC1VAL + SRC2VAL); + uint32_t dst = readbyte(SRC1VAL + SRC2VAL); SET_ZN(dst); } @@ -1407,7 +1407,7 @@ void asap_device::stb_0() void asap_device::stb_c() { - UINT32 dst = (UINT8)DSTVAL; + uint32_t dst = (uint8_t)DSTVAL; SET_ZN(dst); writebyte(SRC1VAL + SRC2VAL, dst); } @@ -1422,18 +1422,18 @@ void asap_device::stb_c0() void asap_device::ashr() { - UINT32 src2 = SRC2VAL; - DSTVAL = (src2 < 32) ? ((INT32)SRC1VAL >> src2) : ((INT32)SRC1VAL >> 31); + uint32_t src2 = SRC2VAL; + DSTVAL = (src2 < 32) ? ((int32_t)SRC1VAL >> src2) : ((int32_t)SRC1VAL >> 31); } void asap_device::ashr_c() { - UINT32 src2 = SRC2VAL; + uint32_t src2 = SRC2VAL; m_cflag = 0; if (src2 < 32) { - UINT32 src1 = SRC1VAL; - UINT32 dst = (INT32)src1 >> src2; + uint32_t src1 = SRC1VAL; + uint32_t dst = (int32_t)src1 >> src2; SET_ZN(dst); if (src2 != 0) { @@ -1444,7 +1444,7 @@ void asap_device::ashr_c() } else { - UINT32 dst = (INT32)SRC1VAL >> 31; + uint32_t dst = (int32_t)SRC1VAL >> 31; SET_ZN(dst); DSTVAL = dst; } @@ -1452,12 +1452,12 @@ void asap_device::ashr_c() void asap_device::ashr_c0() { - UINT32 src2 = SRC2VAL; + uint32_t src2 = SRC2VAL; m_cflag = 0; if (src2 < 32) { - UINT32 src1 = SRC1VAL; - UINT32 dst = (INT32)src1 >> src2; + uint32_t src1 = SRC1VAL; + uint32_t dst = (int32_t)src1 >> src2; SET_ZN(dst); if (src2 != 0) { @@ -1467,7 +1467,7 @@ void asap_device::ashr_c0() } else { - UINT32 dst = (INT32)SRC1VAL >> 31; + uint32_t dst = (int32_t)SRC1VAL >> 31; SET_ZN(dst); } } @@ -1476,18 +1476,18 @@ void asap_device::ashr_c0() void asap_device::lshr() { - UINT32 src2 = SRC2VAL; + uint32_t src2 = SRC2VAL; DSTVAL = (src2 < 32) ? (SRC1VAL >> src2) : (SRC1VAL >> 31); } void asap_device::lshr_c() { - UINT32 src2 = SRC2VAL; + uint32_t src2 = SRC2VAL; m_cflag = 0; if (src2 < 32) { - UINT32 src1 = SRC1VAL; - UINT32 dst = src1 >> src2; + uint32_t src1 = SRC1VAL; + uint32_t dst = src1 >> src2; SET_ZN(dst); if (src2 != 0) { @@ -1498,7 +1498,7 @@ void asap_device::lshr_c() } else { - UINT32 dst = SRC1VAL >> 31; + uint32_t dst = SRC1VAL >> 31; SET_ZN(dst); DSTVAL = dst; } @@ -1506,12 +1506,12 @@ void asap_device::lshr_c() void asap_device::lshr_c0() { - UINT32 src2 = SRC2VAL; + uint32_t src2 = SRC2VAL; m_cflag = 0; if (src2 < 32) { - UINT32 src1 = SRC1VAL; - UINT32 dst = src1 >> src2; + uint32_t src1 = SRC1VAL; + uint32_t dst = src1 >> src2; SET_ZN(dst); if (src2 != 0) { @@ -1530,24 +1530,24 @@ void asap_device::lshr_c0() void asap_device::ashl() { - UINT32 src2 = SRC2VAL; + uint32_t src2 = SRC2VAL; DSTVAL = (src2 < 32) ? (SRC1VAL << src2) : 0; } void asap_device::ashl_c() { - UINT32 src2 = SRC2VAL; + uint32_t src2 = SRC2VAL; m_cflag = m_vflag = 0; if (src2 < 32) { - UINT32 src1 = SRC1VAL; - UINT32 dst = src1 << src2; + uint32_t src1 = SRC1VAL; + uint32_t dst = src1 << src2; SET_ZN(dst); if (src2 != 0) { - src1 = (INT32)src1 >> (32 - src2); + src1 = (int32_t)src1 >> (32 - src2); m_cflag = src1 & PS_CFLAG; - m_vflag = (src1 != ((INT32)dst >> 31)) << 31; + m_vflag = (src1 != ((int32_t)dst >> 31)) << 31; } DSTVAL = dst; } @@ -1560,18 +1560,18 @@ void asap_device::ashl_c() void asap_device::ashl_c0() { - UINT32 src2 = SRC2VAL; + uint32_t src2 = SRC2VAL; m_cflag = m_vflag = 0; if (src2 < 32) { - UINT32 src1 = SRC1VAL; - UINT32 dst = src1 << src2; + uint32_t src1 = SRC1VAL; + uint32_t dst = src1 << src2; SET_ZN(dst); if (src2 != 0) { - src1 = (INT32)src1 >> (32 - src2); + src1 = (int32_t)src1 >> (32 - src2); m_cflag = src1 & PS_CFLAG; - m_vflag = (src1 != ((INT32)dst >> 31)) << 31; + m_vflag = (src1 != ((int32_t)dst >> 31)) << 31; } } else @@ -1582,25 +1582,25 @@ void asap_device::ashl_c0() void asap_device::rotl() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL & 31; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL & 31; DSTVAL = (src1 << src2) | (src1 >> (32 - src2)); } void asap_device::rotl_c() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL & 31; - UINT32 dst = (src1 << src2) | (src1 >> (32 - src2)); + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL & 31; + uint32_t dst = (src1 << src2) | (src1 >> (32 - src2)); SET_ZN(dst); DSTVAL = dst; } void asap_device::rotl_c0() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL & 31; - UINT32 dst = (src1 << src2) | (src1 >> (32 - src2)); + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL & 31; + uint32_t dst = (src1 << src2) | (src1 >> (32 - src2)); SET_ZN(dst); } @@ -1615,7 +1615,7 @@ void asap_device::getps() void asap_device::putps() { - UINT32 src2 = SRC2VAL & 0x3f; + uint32_t src2 = SRC2VAL & 0x3f; SET_FLAGS(src2); check_irqs(); } diff --git a/src/devices/cpu/asap/asap.h b/src/devices/cpu/asap/asap.h index 87d11282072..1ed0583d4d1 100644 --- a/src/devices/cpu/asap/asap.h +++ b/src/devices/cpu/asap/asap.h @@ -26,7 +26,7 @@ class asap_device : public cpu_device { public: // construction/destruction - asap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + asap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // public interfaces @@ -36,9 +36,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -51,18 +51,18 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // helpers - inline UINT32 readop(offs_t pc); - inline UINT8 readbyte(offs_t address); - inline UINT16 readword(offs_t address); - inline UINT32 readlong(offs_t address); - inline void writebyte(offs_t address, UINT8 data); - inline void writeword(offs_t address, UINT16 data); - inline void writelong(offs_t address, UINT32 data); + inline uint32_t readop(offs_t pc); + inline uint8_t readbyte(offs_t address); + inline uint16_t readword(offs_t address); + inline uint32_t readlong(offs_t address); + inline void writebyte(offs_t address, uint8_t data); + inline void writeword(offs_t address, uint16_t data); + inline void writelong(offs_t address, uint32_t data); inline void generate_exception(int exception); inline void check_irqs(); inline void fetch_instruction(); @@ -185,27 +185,27 @@ protected: // internal state const address_space_config m_program_config; - UINT32 m_pc; + uint32_t m_pc; // expanded flags - UINT32 m_pflag; - UINT32 m_iflag; - UINT32 m_cflag; - UINT32 m_vflag; - UINT32 m_znflag; - UINT32 m_flagsio; + uint32_t m_pflag; + uint32_t m_iflag; + uint32_t m_cflag; + uint32_t m_vflag; + uint32_t m_znflag; + uint32_t m_flagsio; // internal stuff - UINT32 m_op; - UINT32 m_ppc; - UINT32 m_nextpc; - UINT8 m_irq_state; + uint32_t m_op; + uint32_t m_ppc; + uint32_t m_nextpc; + uint8_t m_irq_state; int m_icount; address_space * m_program; direct_read_data * m_direct; // src2val table, registers are at the end - UINT32 m_src2val[65536]; + uint32_t m_src2val[65536]; // opcode/condition tables typedef void (asap_device::*ophandler)(); diff --git a/src/devices/cpu/asap/asapdasm.cpp b/src/devices/cpu/asap/asapdasm.cpp index ded3a24e17b..47665331da2 100644 --- a/src/devices/cpu/asap/asapdasm.cpp +++ b/src/devices/cpu/asap/asapdasm.cpp @@ -35,7 +35,7 @@ static const char *const condition[16] = CODE CODE ***************************************************************************/ -static inline char *src2(UINT32 op, int scale) +static inline char *src2(uint32_t op, int scale) { static char temp[20]; if ((op & 0xffe0) == 0xffe0) @@ -47,25 +47,25 @@ static inline char *src2(UINT32 op, int scale) CPU_DISASSEMBLE( asap ) { - UINT32 op = oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24); + uint32_t op = oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24); int opcode = op >> 27; int cond = (op >> 21) & 1; int rdst = (op >> 22) & 31; int rsrc1 = (op >> 16) & 31; int rsrc2 = op & 0xffff; int rsrc2_iszero = (!rsrc2 || rsrc2 == 0xffe0); - UINT32 flags = 0; + uint32_t flags = 0; switch (opcode) { case 0x00: sprintf(buffer, "trap $00"); flags = DASMFLAG_STEP_OVER; break; - case 0x01: sprintf(buffer, "b%s $%08x", condition[rdst & 15], pc + ((INT32)(op << 10) >> 8)); break; + case 0x01: sprintf(buffer, "b%s $%08x", condition[rdst & 15], pc + ((int32_t)(op << 10) >> 8)); break; case 0x02: if ((op & 0x003fffff) == 3) { - UINT32 nextop = oprom[4] | (oprom[5] << 8) | (oprom[6] << 16) | (oprom[7] << 24); + uint32_t nextop = oprom[4] | (oprom[5] << 8) | (oprom[6] << 16) | (oprom[7] << 24); if ((nextop >> 27) == 0x10 && ((nextop >> 22) & 31) == rdst && (nextop & 0xffff) == 0) { - UINT32 nextnextop = oprom[8] | (oprom[9] << 8) | (oprom[10] << 16) | (oprom[11] << 24); + uint32_t nextnextop = oprom[8] | (oprom[9] << 8) | (oprom[10] << 16) | (oprom[11] << 24); sprintf(buffer, "llit%s $%08x,%s", setcond[cond], nextnextop, reg[rdst]); return 12 | DASMFLAG_STEP_OVER | DASMFLAG_SUPPORTED; } @@ -73,10 +73,10 @@ CPU_DISASSEMBLE( asap ) if (rdst) { flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); - sprintf(buffer, "bsr %s,$%08x", reg[rdst], pc + ((INT32)(op << 10) >> 8)); + sprintf(buffer, "bsr %s,$%08x", reg[rdst], pc + ((int32_t)(op << 10) >> 8)); } else - sprintf(buffer, "bra $%08x", pc + ((INT32)(op << 10) >> 8)); + sprintf(buffer, "bra $%08x", pc + ((int32_t)(op << 10) >> 8)); break; case 0x03: sprintf(buffer, "lea%s %s[%s],%s", setcond[cond], reg[rsrc1], src2(op,2), reg[rdst]); break; case 0x04: sprintf(buffer, "leah%s %s[%s],%s", setcond[cond], reg[rsrc1], src2(op,1), reg[rdst]); break; |