diff options
Diffstat (limited to 'src/devices/cpu/i386/i386priv.h')
-rw-r--r-- | src/devices/cpu/i386/i386priv.h | 346 |
1 files changed, 173 insertions, 173 deletions
diff --git a/src/devices/cpu/i386/i386priv.h b/src/devices/cpu/i386/i386priv.h index 3edf681744b..528dade6c72 100644 --- a/src/devices/cpu/i386/i386priv.h +++ b/src/devices/cpu/i386/i386priv.h @@ -15,7 +15,7 @@ #define MMXOP(XX) mmx_##XX #define SSEOP(XX) sse_##XX -extern int i386_dasm_one(char *buffer, UINT32 pc, const UINT8 *oprom, int mode); +extern int i386_dasm_one(char *buffer, uint32_t pc, const uint8_t *oprom, int mode); enum SREGS { ES, CS, SS, DS, FS, GS }; @@ -277,20 +277,20 @@ enum smram_intel_p5 #define MXCSR_FZ (1<<15) // Flush to Zero union MMX_REG { - UINT32 d[2]; - INT32 i[2]; - UINT16 w[4]; - INT16 s[4]; - UINT8 b[8]; - INT8 c[8]; + uint32_t d[2]; + int32_t i[2]; + uint16_t w[4]; + int16_t s[4]; + uint8_t b[8]; + int8_t c[8]; float f[2]; - UINT64 q; - INT64 l; + uint64_t q; + int64_t l; }; extern int i386_parity_table[256]; -#define FAULT_THROW(fault,error) { throw (UINT64)(fault | (UINT64)error << 32); } +#define FAULT_THROW(fault,error) { throw (uint64_t)(fault | (uint64_t)error << 32); } #define PF_THROW(error) { m_cr[2] = address; FAULT_THROW(FAULT_PF,error); } #define PROTECTED_MODE (m_cr[0] & 0x1) @@ -309,16 +309,16 @@ extern int i386_parity_table[256]; #define SetCF8(x) {m_CF = ((x) & 0x100) ? 1 : 0; } #define SetCF16(x) {m_CF = ((x) & 0x10000) ? 1 : 0; } -#define SetCF32(x) {m_CF = ((x) & (((UINT64)1) << 32)) ? 1 : 0; } +#define SetCF32(x) {m_CF = ((x) & (((uint64_t)1) << 32)) ? 1 : 0; } #define SetSF(x) (m_SF = (x)) #define SetZF(x) (m_ZF = (x)) #define SetAF(x,y,z) (m_AF = (((x) ^ ((y) ^ (z))) & 0x10) ? 1 : 0) #define SetPF(x) (m_PF = i386_parity_table[(x) & 0xFF]) -#define SetSZPF8(x) {m_ZF = ((UINT8)(x)==0); m_SF = ((x)&0x80) ? 1 : 0; m_PF = i386_parity_table[x & 0xFF]; } -#define SetSZPF16(x) {m_ZF = ((UINT16)(x)==0); m_SF = ((x)&0x8000) ? 1 : 0; m_PF = i386_parity_table[x & 0xFF]; } -#define SetSZPF32(x) {m_ZF = ((UINT32)(x)==0); m_SF = ((x)&0x80000000) ? 1 : 0; m_PF = i386_parity_table[x & 0xFF]; } +#define SetSZPF8(x) {m_ZF = ((uint8_t)(x)==0); m_SF = ((x)&0x80) ? 1 : 0; m_PF = i386_parity_table[x & 0xFF]; } +#define SetSZPF16(x) {m_ZF = ((uint16_t)(x)==0); m_SF = ((x)&0x8000) ? 1 : 0; m_PF = i386_parity_table[x & 0xFF]; } +#define SetSZPF32(x) {m_ZF = ((uint32_t)(x)==0); m_SF = ((x)&0x80000000) ? 1 : 0; m_PF = i386_parity_table[x & 0xFF]; } #define MMX(n) (*((MMX_REG *)(&m_x87_reg[(n)].low))) #define XMM(n) m_sse_reg[(n)] @@ -362,7 +362,7 @@ extern MODRM_TABLE i386_MODRM_table[256]; /***********************************************************************************/ -UINT32 i386_device::i386_translate(int segment, UINT32 ip, int rwn) +uint32_t i386_device::i386_translate(int segment, uint32_t ip, int rwn) { // TODO: segment limit access size, execution permission, handle exception thrown from exception handler if(PROTECTED_MODE && !V8086_MODE && (rwn != -1)) @@ -381,7 +381,7 @@ UINT32 i386_device::i386_translate(int segment, UINT32 ip, int rwn) #define VTLB_FLAG_DIRTY 0x100 -vtlb_entry i386_device::get_permissions(UINT32 pte, int wp) +vtlb_entry i386_device::get_permissions(uint32_t pte, int wp) { vtlb_entry ret = VTLB_READ_ALLOWED | ((pte & 4) ? VTLB_USER_READ_ALLOWED : 0); if(!wp) @@ -393,10 +393,10 @@ vtlb_entry i386_device::get_permissions(UINT32 pte, int wp) bool i386_device::i386_translate_address(int intention, offs_t *address, vtlb_entry *entry) { - UINT32 a = *address; - UINT32 pdbr = m_cr[3] & 0xfffff000; - UINT32 directory = (a >> 22) & 0x3ff; - UINT32 table = (a >> 12) & 0x3ff; + uint32_t a = *address; + uint32_t pdbr = m_cr[3] & 0xfffff000; + uint32_t directory = (a >> 22) & 0x3ff; + uint32_t table = (a >> 12) & 0x3ff; vtlb_entry perm = 0; bool ret; bool user = (intention & TRANSLATE_USER_MASK) ? true : false; @@ -410,7 +410,7 @@ bool i386_device::i386_translate_address(int intention, offs_t *address, vtlb_en return true; } - UINT32 page_dir = m_program->read_dword(pdbr + directory * 4); + uint32_t page_dir = m_program->read_dword(pdbr + directory * 4); if(page_dir & 1) { if ((page_dir & 0x80) && (m_cr[4] & 0x10)) @@ -439,7 +439,7 @@ bool i386_device::i386_translate_address(int intention, offs_t *address, vtlb_en } else { - UINT32 page_entry = m_program->read_dword((page_dir & 0xfffff000) + (table * 4)); + uint32_t page_entry = m_program->read_dword((page_dir & 0xfffff000) + (table * 4)); if(!(page_entry & 1)) ret = false; else @@ -481,20 +481,20 @@ bool i386_device::i386_translate_address(int intention, offs_t *address, vtlb_en //#define TEST_TLB -int i386_device::translate_address(int pl, int type, UINT32 *address, UINT32 *error) +int i386_device::translate_address(int pl, int type, uint32_t *address, uint32_t *error) { if(!(m_cr[0] & 0x80000000)) // Some (very few) old OS's won't work with this return TRUE; const vtlb_entry *table = vtlb_table(); - UINT32 index = *address >> 12; + uint32_t index = *address >> 12; vtlb_entry entry = table[index]; if(type == TRANSLATE_FETCH) type = TRANSLATE_READ; if(pl == 3) type |= TRANSLATE_USER_MASK; #ifdef TEST_TLB - UINT32 test_addr = *address; + uint32_t test_addr = *address; #endif if(!(entry & VTLB_FLAG_VALID) || ((type & TRANSLATE_WRITE) && !(entry & VTLB_FLAG_DIRTY))) @@ -523,22 +523,22 @@ int i386_device::translate_address(int pl, int type, UINT32 *address, UINT32 *er return TRUE; } -void i386_device::CHANGE_PC(UINT32 pc) +void i386_device::CHANGE_PC(uint32_t pc) { m_pc = i386_translate(CS, pc, -1 ); } -void i386_device::NEAR_BRANCH(INT32 offs) +void i386_device::NEAR_BRANCH(int32_t offs) { /* TODO: limit */ m_eip += offs; m_pc += offs; } -UINT8 i386_device::FETCH() +uint8_t i386_device::FETCH() { - UINT8 value; - UINT32 address = m_pc, error; + uint8_t value; + uint32_t address = m_pc, error; if(!translate_address(m_CPL,TRANSLATE_FETCH,&address,&error)) PF_THROW(error); @@ -552,10 +552,10 @@ UINT8 i386_device::FETCH() m_pc++; return value; } -UINT16 i386_device::FETCH16() +uint16_t i386_device::FETCH16() { - UINT16 value; - UINT32 address = m_pc, error; + uint16_t value; + uint32_t address = m_pc, error; if( !WORD_ALIGNED(address) ) { /* Unaligned read */ value = (FETCH() << 0); @@ -570,10 +570,10 @@ UINT16 i386_device::FETCH16() } return value; } -UINT32 i386_device::FETCH32() +uint32_t i386_device::FETCH32() { - UINT32 value; - UINT32 address = m_pc, error; + uint32_t value; + uint32_t address = m_pc, error; if( !DWORD_ALIGNED(m_pc) ) { /* Unaligned read */ value = (FETCH() << 0); @@ -592,9 +592,9 @@ UINT32 i386_device::FETCH32() return value; } -UINT8 i386_device::READ8(UINT32 ea) +uint8_t i386_device::READ8(uint32_t ea) { - UINT32 address = ea, error; + uint32_t address = ea, error; if(!translate_address(m_CPL,TRANSLATE_READ,&address, &error)) PF_THROW(error); @@ -602,10 +602,10 @@ UINT8 i386_device::READ8(UINT32 ea) address &= m_a20_mask; return m_program->read_byte(address); } -UINT16 i386_device::READ16(UINT32 ea) +uint16_t i386_device::READ16(uint32_t ea) { - UINT16 value; - UINT32 address = ea, error; + uint16_t value; + uint32_t address = ea, error; if( !WORD_ALIGNED(ea) ) { /* Unaligned read */ value = (READ8( address+0 ) << 0); @@ -619,10 +619,10 @@ UINT16 i386_device::READ16(UINT32 ea) } return value; } -UINT32 i386_device::READ32(UINT32 ea) +uint32_t i386_device::READ32(uint32_t ea) { - UINT32 value; - UINT32 address = ea, error; + uint32_t value; + uint32_t address = ea, error; if( !DWORD_ALIGNED(ea) ) { /* Unaligned read */ value = (READ8( address+0 ) << 0); @@ -639,33 +639,33 @@ UINT32 i386_device::READ32(UINT32 ea) return value; } -UINT64 i386_device::READ64(UINT32 ea) +uint64_t i386_device::READ64(uint32_t ea) { - UINT64 value; - UINT32 address = ea, error; + uint64_t value; + uint32_t address = ea, error; if( !QWORD_ALIGNED(ea) ) { /* Unaligned read */ - value = (((UINT64) READ8( address+0 )) << 0); - value |= (((UINT64) READ8( address+1 )) << 8); - value |= (((UINT64) READ8( address+2 )) << 16); - value |= (((UINT64) READ8( address+3 )) << 24); - value |= (((UINT64) READ8( address+4 )) << 32); - value |= (((UINT64) READ8( address+5 )) << 40); - value |= (((UINT64) READ8( address+6 )) << 48); - value |= (((UINT64) READ8( address+7 )) << 56); + value = (((uint64_t) READ8( address+0 )) << 0); + value |= (((uint64_t) READ8( address+1 )) << 8); + value |= (((uint64_t) READ8( address+2 )) << 16); + value |= (((uint64_t) READ8( address+3 )) << 24); + value |= (((uint64_t) READ8( address+4 )) << 32); + value |= (((uint64_t) READ8( address+5 )) << 40); + value |= (((uint64_t) READ8( address+6 )) << 48); + value |= (((uint64_t) READ8( address+7 )) << 56); } else { if(!translate_address(m_CPL,TRANSLATE_READ,&address,&error)) PF_THROW(error); address &= m_a20_mask; - value = (((UINT64) m_program->read_dword( address+0 )) << 0); - value |= (((UINT64) m_program->read_dword( address+4 )) << 32); + value = (((uint64_t) m_program->read_dword( address+0 )) << 0); + value |= (((uint64_t) m_program->read_dword( address+4 )) << 32); } return value; } -UINT8 i386_device::READ8PL0(UINT32 ea) +uint8_t i386_device::READ8PL0(uint32_t ea) { - UINT32 address = ea, error; + uint32_t address = ea, error; if(!translate_address(0,TRANSLATE_READ,&address,&error)) PF_THROW(error); @@ -673,10 +673,10 @@ UINT8 i386_device::READ8PL0(UINT32 ea) address &= m_a20_mask; return m_program->read_byte(address); } -UINT16 i386_device::READ16PL0(UINT32 ea) +uint16_t i386_device::READ16PL0(uint32_t ea) { - UINT16 value; - UINT32 address = ea, error; + uint16_t value; + uint32_t address = ea, error; if( !WORD_ALIGNED(ea) ) { /* Unaligned read */ value = (READ8PL0( address+0 ) << 0); @@ -691,10 +691,10 @@ UINT16 i386_device::READ16PL0(UINT32 ea) return value; } -UINT32 i386_device::READ32PL0(UINT32 ea) +uint32_t i386_device::READ32PL0(uint32_t ea) { - UINT32 value; - UINT32 address = ea, error; + uint32_t value; + uint32_t address = ea, error; if( !DWORD_ALIGNED(ea) ) { /* Unaligned read */ value = (READ8PL0( address+0 ) << 0); @@ -711,16 +711,16 @@ UINT32 i386_device::READ32PL0(UINT32 ea) return value; } -void i386_device::WRITE_TEST(UINT32 ea) +void i386_device::WRITE_TEST(uint32_t ea) { - UINT32 address = ea, error; + uint32_t address = ea, error; if(!translate_address(m_CPL,TRANSLATE_WRITE,&address,&error)) PF_THROW(error); } -void i386_device::WRITE8(UINT32 ea, UINT8 value) +void i386_device::WRITE8(uint32_t ea, uint8_t value) { - UINT32 address = ea, error; + uint32_t address = ea, error; if(!translate_address(m_CPL,TRANSLATE_WRITE,&address,&error)) PF_THROW(error); @@ -728,9 +728,9 @@ void i386_device::WRITE8(UINT32 ea, UINT8 value) address &= m_a20_mask; m_program->write_byte(address, value); } -void i386_device::WRITE16(UINT32 ea, UINT16 value) +void i386_device::WRITE16(uint32_t ea, uint16_t value) { - UINT32 address = ea, error; + uint32_t address = ea, error; if( !WORD_ALIGNED(ea) ) { /* Unaligned write */ WRITE8( address+0, value & 0xff ); @@ -743,9 +743,9 @@ void i386_device::WRITE16(UINT32 ea, UINT16 value) m_program->write_word(address, value); } } -void i386_device::WRITE32(UINT32 ea, UINT32 value) +void i386_device::WRITE32(uint32_t ea, uint32_t value) { - UINT32 address = ea, error; + uint32_t address = ea, error; if( !DWORD_ALIGNED(ea) ) { /* Unaligned write */ WRITE8( address+0, value & 0xff ); @@ -761,9 +761,9 @@ void i386_device::WRITE32(UINT32 ea, UINT32 value) } } -void i386_device::WRITE64(UINT32 ea, UINT64 value) +void i386_device::WRITE64(uint32_t ea, uint64_t value) { - UINT32 address = ea, error; + uint32_t address = ea, error; if( !QWORD_ALIGNED(ea) ) { /* Unaligned write */ WRITE8( address+0, value & 0xff ); @@ -786,193 +786,193 @@ void i386_device::WRITE64(UINT32 ea, UINT64 value) /***********************************************************************************/ -UINT8 i386_device::OR8(UINT8 dst, UINT8 src) +uint8_t i386_device::OR8(uint8_t dst, uint8_t src) { - UINT8 res = dst | src; + uint8_t res = dst | src; m_CF = m_OF = 0; SetSZPF8(res); return res; } -UINT16 i386_device::OR16(UINT16 dst, UINT16 src) +uint16_t i386_device::OR16(uint16_t dst, uint16_t src) { - UINT16 res = dst | src; + uint16_t res = dst | src; m_CF = m_OF = 0; SetSZPF16(res); return res; } -UINT32 i386_device::OR32(UINT32 dst, UINT32 src) +uint32_t i386_device::OR32(uint32_t dst, uint32_t src) { - UINT32 res = dst | src; + uint32_t res = dst | src; m_CF = m_OF = 0; SetSZPF32(res); return res; } -UINT8 i386_device::AND8(UINT8 dst, UINT8 src) +uint8_t i386_device::AND8(uint8_t dst, uint8_t src) { - UINT8 res = dst & src; + uint8_t res = dst & src; m_CF = m_OF = 0; SetSZPF8(res); return res; } -UINT16 i386_device::AND16(UINT16 dst, UINT16 src) +uint16_t i386_device::AND16(uint16_t dst, uint16_t src) { - UINT16 res = dst & src; + uint16_t res = dst & src; m_CF = m_OF = 0; SetSZPF16(res); return res; } -UINT32 i386_device::AND32(UINT32 dst, UINT32 src) +uint32_t i386_device::AND32(uint32_t dst, uint32_t src) { - UINT32 res = dst & src; + uint32_t res = dst & src; m_CF = m_OF = 0; SetSZPF32(res); return res; } -UINT8 i386_device::XOR8(UINT8 dst, UINT8 src) +uint8_t i386_device::XOR8(uint8_t dst, uint8_t src) { - UINT8 res = dst ^ src; + uint8_t res = dst ^ src; m_CF = m_OF = 0; SetSZPF8(res); return res; } -UINT16 i386_device::XOR16(UINT16 dst, UINT16 src) +uint16_t i386_device::XOR16(uint16_t dst, uint16_t src) { - UINT16 res = dst ^ src; + uint16_t res = dst ^ src; m_CF = m_OF = 0; SetSZPF16(res); return res; } -UINT32 i386_device::XOR32(UINT32 dst, UINT32 src) +uint32_t i386_device::XOR32(uint32_t dst, uint32_t src) { - UINT32 res = dst ^ src; + uint32_t res = dst ^ src; m_CF = m_OF = 0; SetSZPF32(res); return res; } #define SUB8(dst, src) SBB8(dst, src, 0) -UINT8 i386_device::SBB8(UINT8 dst, UINT8 src, UINT8 b) +uint8_t i386_device::SBB8(uint8_t dst, uint8_t src, uint8_t b) { - UINT16 res = (UINT16)dst - (UINT16)src - (UINT8)b; + uint16_t res = (uint16_t)dst - (uint16_t)src - (uint8_t)b; SetCF8(res); SetOF_Sub8(res,src,dst); SetAF(res,src,dst); SetSZPF8(res); - return (UINT8)res; + return (uint8_t)res; } #define SUB16(dst, src) SBB16(dst, src, 0) -UINT16 i386_device::SBB16(UINT16 dst, UINT16 src, UINT16 b) +uint16_t i386_device::SBB16(uint16_t dst, uint16_t src, uint16_t b) { - UINT32 res = (UINT32)dst - (UINT32)src - (UINT32)b; + uint32_t res = (uint32_t)dst - (uint32_t)src - (uint32_t)b; SetCF16(res); SetOF_Sub16(res,src,dst); SetAF(res,src,dst); SetSZPF16(res); - return (UINT16)res; + return (uint16_t)res; } #define SUB32(dst, src) SBB32(dst, src, 0) -UINT32 i386_device::SBB32(UINT32 dst, UINT32 src, UINT32 b) +uint32_t i386_device::SBB32(uint32_t dst, uint32_t src, uint32_t b) { - UINT64 res = (UINT64)dst - (UINT64)src - (UINT64) b; + uint64_t res = (uint64_t)dst - (uint64_t)src - (uint64_t) b; SetCF32(res); SetOF_Sub32(res,src,dst); SetAF(res,src,dst); SetSZPF32(res); - return (UINT32)res; + return (uint32_t)res; } #define ADD8(dst, src) ADC8(dst, src, 0) -UINT8 i386_device::ADC8(UINT8 dst, UINT8 src, UINT8 c) +uint8_t i386_device::ADC8(uint8_t dst, uint8_t src, uint8_t c) { - UINT16 res = (UINT16)dst + (UINT16)src + (UINT16)c; + uint16_t res = (uint16_t)dst + (uint16_t)src + (uint16_t)c; SetCF8(res); SetOF_Add8(res,src,dst); SetAF(res,src,dst); SetSZPF8(res); - return (UINT8)res; + return (uint8_t)res; } #define ADD16(dst, src) ADC16(dst, src, 0) -UINT16 i386_device::ADC16(UINT16 dst, UINT16 src, UINT8 c) +uint16_t i386_device::ADC16(uint16_t dst, uint16_t src, uint8_t c) { - UINT32 res = (UINT32)dst + (UINT32)src + (UINT32)c; + uint32_t res = (uint32_t)dst + (uint32_t)src + (uint32_t)c; SetCF16(res); SetOF_Add16(res,src,dst); SetAF(res,src,dst); SetSZPF16(res); - return (UINT16)res; + return (uint16_t)res; } #define ADD32(dst, src) ADC32(dst, src, 0) -UINT32 i386_device::ADC32(UINT32 dst, UINT32 src, UINT32 c) +uint32_t i386_device::ADC32(uint32_t dst, uint32_t src, uint32_t c) { - UINT64 res = (UINT64)dst + (UINT64)src + (UINT64) c; + uint64_t res = (uint64_t)dst + (uint64_t)src + (uint64_t) c; SetCF32(res); SetOF_Add32(res,src,dst); SetAF(res,src,dst); SetSZPF32(res); - return (UINT32)res; + return (uint32_t)res; } -UINT8 i386_device::INC8(UINT8 dst) +uint8_t i386_device::INC8(uint8_t dst) { - UINT16 res = (UINT16)dst + 1; + uint16_t res = (uint16_t)dst + 1; SetOF_Add8(res,1,dst); SetAF(res,1,dst); SetSZPF8(res); - return (UINT8)res; + return (uint8_t)res; } -UINT16 i386_device::INC16(UINT16 dst) +uint16_t i386_device::INC16(uint16_t dst) { - UINT32 res = (UINT32)dst + 1; + uint32_t res = (uint32_t)dst + 1; SetOF_Add16(res,1,dst); SetAF(res,1,dst); SetSZPF16(res); - return (UINT16)res; + return (uint16_t)res; } -UINT32 i386_device::INC32(UINT32 dst) +uint32_t i386_device::INC32(uint32_t dst) { - UINT64 res = (UINT64)dst + 1; + uint64_t res = (uint64_t)dst + 1; SetOF_Add32(res,1,dst); SetAF(res,1,dst); SetSZPF32(res); - return (UINT32)res; + return (uint32_t)res; } -UINT8 i386_device::DEC8(UINT8 dst) +uint8_t i386_device::DEC8(uint8_t dst) { - UINT16 res = (UINT16)dst - 1; + uint16_t res = (uint16_t)dst - 1; SetOF_Sub8(res,1,dst); SetAF(res,1,dst); SetSZPF8(res); - return (UINT8)res; + return (uint8_t)res; } -UINT16 i386_device::DEC16(UINT16 dst) +uint16_t i386_device::DEC16(uint16_t dst) { - UINT32 res = (UINT32)dst - 1; + uint32_t res = (uint32_t)dst - 1; SetOF_Sub16(res,1,dst); SetAF(res,1,dst); SetSZPF16(res); - return (UINT16)res; + return (uint16_t)res; } -UINT32 i386_device::DEC32(UINT32 dst) +uint32_t i386_device::DEC32(uint32_t dst) { - UINT64 res = (UINT64)dst - 1; + uint64_t res = (uint64_t)dst - 1; SetOF_Sub32(res,1,dst); SetAF(res,1,dst); SetSZPF32(res); - return (UINT32)res; + return (uint32_t)res; } -void i386_device::PUSH16(UINT16 value) +void i386_device::PUSH16(uint16_t value) { - UINT32 ea, new_esp; + uint32_t ea, new_esp; if( STACK_32BIT ) { new_esp = REG32(ESP) - 2; ea = i386_translate(SS, new_esp, 1); @@ -985,9 +985,9 @@ void i386_device::PUSH16(UINT16 value) REG16(SP) = new_esp; } } -void i386_device::PUSH32(UINT32 value) +void i386_device::PUSH32(uint32_t value) { - UINT32 ea, new_esp; + uint32_t ea, new_esp; if( STACK_32BIT ) { new_esp = REG32(ESP) - 4; ea = i386_translate(SS, new_esp, 1); @@ -1001,9 +1001,9 @@ void i386_device::PUSH32(UINT32 value) } } -void i386_device::PUSH32SEG(UINT32 value) +void i386_device::PUSH32SEG(uint32_t value) { - UINT32 ea, new_esp; + uint32_t ea, new_esp; if( STACK_32BIT ) { new_esp = REG32(ESP) - 4; ea = i386_translate(SS, new_esp, 1); @@ -1017,19 +1017,19 @@ void i386_device::PUSH32SEG(UINT32 value) } } -void i386_device::PUSH8(UINT8 value) +void i386_device::PUSH8(uint8_t value) { if( m_operand_size ) { - PUSH32((INT32)(INT8)value); + PUSH32((int32_t)(int8_t)value); } else { - PUSH16((INT16)(INT8)value); + PUSH16((int16_t)(int8_t)value); } } -UINT8 i386_device::POP8() +uint8_t i386_device::POP8() { - UINT8 value; - UINT32 ea, new_esp; + uint8_t value; + uint32_t ea, new_esp; if( STACK_32BIT ) { new_esp = REG32(ESP) + 1; ea = i386_translate(SS, new_esp - 1, 0); @@ -1043,10 +1043,10 @@ UINT8 i386_device::POP8() } return value; } -UINT16 i386_device::POP16() +uint16_t i386_device::POP16() { - UINT16 value; - UINT32 ea, new_esp; + uint16_t value; + uint32_t ea, new_esp; if( STACK_32BIT ) { new_esp = REG32(ESP) + 2; ea = i386_translate(SS, new_esp - 2, 0); @@ -1060,10 +1060,10 @@ UINT16 i386_device::POP16() } return value; } -UINT32 i386_device::POP32() +uint32_t i386_device::POP32() { - UINT32 value; - UINT32 ea, new_esp; + uint32_t value; + uint32_t ea, new_esp; if( STACK_32BIT ) { new_esp = REG32(ESP) + 4; ea = i386_translate(SS, new_esp - 4, 0); @@ -1100,11 +1100,11 @@ void i386_device::BUMP_DI(int adjustment) I/O ACCESS ***********************************************************************************/ -void i386_device::check_ioperm(offs_t port, UINT8 mask) +void i386_device::check_ioperm(offs_t port, uint8_t mask) { - UINT8 IOPL, map; - UINT16 IOPB; - UINT32 address; + uint8_t IOPL, map; + uint16_t IOPB; + uint32_t address; if(!PROTECTED_MODE) return; @@ -1127,23 +1127,23 @@ void i386_device::check_ioperm(offs_t port, UINT8 mask) FAULT_THROW(FAULT_GP,0); } -UINT8 i386_device::READPORT8(offs_t port) +uint8_t i386_device::READPORT8(offs_t port) { check_ioperm(port, 1); return m_io->read_byte(port); } -void i386_device::WRITEPORT8(offs_t port, UINT8 value) +void i386_device::WRITEPORT8(offs_t port, uint8_t value) { check_ioperm(port, 1); m_io->write_byte(port, value); } -UINT16 i386_device::READPORT16(offs_t port) +uint16_t i386_device::READPORT16(offs_t port) { if (port & 1) { - UINT16 value = READPORT8(port); + uint16_t value = READPORT8(port); value |= (READPORT8(port + 1) << 8); return value; } @@ -1154,7 +1154,7 @@ UINT16 i386_device::READPORT16(offs_t port) } } -void i386_device::WRITEPORT16(offs_t port, UINT16 value) +void i386_device::WRITEPORT16(offs_t port, uint16_t value) { if (port & 1) { @@ -1168,11 +1168,11 @@ void i386_device::WRITEPORT16(offs_t port, UINT16 value) } } -UINT32 i386_device::READPORT32(offs_t port) +uint32_t i386_device::READPORT32(offs_t port) { if (port & 3) { - UINT32 value = READPORT8(port); + uint32_t value = READPORT8(port); value |= (READPORT8(port + 1) << 8); value |= (READPORT8(port + 2) << 16); value |= (READPORT8(port + 3) << 24); @@ -1185,7 +1185,7 @@ UINT32 i386_device::READPORT32(offs_t port) } } -void i386_device::WRITEPORT32(offs_t port, UINT32 value) +void i386_device::WRITEPORT32(offs_t port, uint32_t value) { if (port & 3) { @@ -1206,7 +1206,7 @@ void i386_device::WRITEPORT32(offs_t port, UINT32 value) ***********************************************************************************/ // Pentium MSR handling -UINT64 i386_device::pentium_msr_read(UINT32 offset,UINT8 *valid_msr) +uint64_t i386_device::pentium_msr_read(uint32_t offset,uint8_t *valid_msr) { switch(offset) { @@ -1249,7 +1249,7 @@ UINT64 i386_device::pentium_msr_read(UINT32 offset,UINT8 *valid_msr) return -1; } -void i386_device::pentium_msr_write(UINT32 offset, UINT64 data, UINT8 *valid_msr) +void i386_device::pentium_msr_write(uint32_t offset, uint64_t data, uint8_t *valid_msr) { switch(offset) { @@ -1288,14 +1288,14 @@ void i386_device::pentium_msr_write(UINT32 offset, UINT64 data, UINT8 *valid_msr logerror("WRMSR: Writing test MSR %x", offset); break; } - logerror("WRMSR: invalid MSR write %08x (%08x%08x) at %08x\n",offset,(UINT32)(data >> 32),(UINT32)data,m_pc-2); + logerror("WRMSR: invalid MSR write %08x (%08x%08x) at %08x\n",offset,(uint32_t)(data >> 32),(uint32_t)data,m_pc-2); *valid_msr = 0; break; } } // P6 (Pentium Pro, Pentium II, Pentium III) MSR handling -UINT64 i386_device::p6_msr_read(UINT32 offset,UINT8 *valid_msr) +uint64_t i386_device::p6_msr_read(uint32_t offset,uint8_t *valid_msr) { switch(offset) { @@ -1328,7 +1328,7 @@ UINT64 i386_device::p6_msr_read(UINT32 offset,UINT8 *valid_msr) return -1; } -void i386_device::p6_msr_write(UINT32 offset, UINT64 data, UINT8 *valid_msr) +void i386_device::p6_msr_write(uint32_t offset, uint64_t data, uint8_t *valid_msr) { switch(offset) { @@ -1348,7 +1348,7 @@ void i386_device::p6_msr_write(UINT32 offset, UINT64 data, UINT8 *valid_msr) *valid_msr = 1; break; default: - logerror("WRMSR: unimplemented register called %08x (%08x%08x) at %08x\n",offset,(UINT32)(data >> 32),(UINT32)data,m_pc-2); + logerror("WRMSR: unimplemented register called %08x (%08x%08x) at %08x\n",offset,(uint32_t)(data >> 32),(uint32_t)data,m_pc-2); *valid_msr = 1; break; } @@ -1356,7 +1356,7 @@ void i386_device::p6_msr_write(UINT32 offset, UINT64 data, UINT8 *valid_msr) // PIV (Pentium 4+) -UINT64 i386_device::piv_msr_read(UINT32 offset,UINT8 *valid_msr) +uint64_t i386_device::piv_msr_read(uint32_t offset,uint8_t *valid_msr) { switch(offset) { @@ -1368,21 +1368,21 @@ UINT64 i386_device::piv_msr_read(UINT32 offset,UINT8 *valid_msr) return -1; } -void i386_device::piv_msr_write(UINT32 offset, UINT64 data, UINT8 *valid_msr) +void i386_device::piv_msr_write(uint32_t offset, uint64_t data, uint8_t *valid_msr) { switch(offset) { default: - logerror("WRMSR: unimplemented register called %08x (%08x%08x) at %08x\n",offset,(UINT32)(data >> 32),(UINT32)data,m_pc-2); + logerror("WRMSR: unimplemented register called %08x (%08x%08x) at %08x\n",offset,(uint32_t)(data >> 32),(uint32_t)data,m_pc-2); *valid_msr = 1; break; } } -UINT64 i386_device::MSR_READ(UINT32 offset,UINT8 *valid_msr) +uint64_t i386_device::MSR_READ(uint32_t offset,uint8_t *valid_msr) { - UINT64 res; - UINT8 cpu_type = (m_cpu_version >> 8) & 0x0f; + uint64_t res; + uint8_t cpu_type = (m_cpu_version >> 8) & 0x0f; *valid_msr = 0; @@ -1405,10 +1405,10 @@ UINT64 i386_device::MSR_READ(UINT32 offset,UINT8 *valid_msr) return res; } -void i386_device::MSR_WRITE(UINT32 offset, UINT64 data, UINT8 *valid_msr) +void i386_device::MSR_WRITE(uint32_t offset, uint64_t data, uint8_t *valid_msr) { *valid_msr = 0; - UINT8 cpu_type = (m_cpu_version >> 8) & 0x0f; + uint8_t cpu_type = (m_cpu_version >> 8) & 0x0f; switch(cpu_type) { |