diff options
Diffstat (limited to 'src/devices/cpu/i86/i286.cpp')
-rw-r--r-- | src/devices/cpu/i86/i286.cpp | 218 |
1 files changed, 109 insertions, 109 deletions
diff --git a/src/devices/cpu/i86/i286.cpp b/src/devices/cpu/i86/i286.cpp index d7743897d35..e6358a2f88b 100644 --- a/src/devices/cpu/i86/i286.cpp +++ b/src/devices/cpu/i86/i286.cpp @@ -92,7 +92,7 @@ /* these come from the 80286 timings in OPCODE.LST */ /* many of these numbers are suspect TODO: add protmode insns*/ -const UINT8 i80286_cpu_device::m_i80286_timing[] = +const uint8_t i80286_cpu_device::m_i80286_timing[] = { 23,17, /* exception, IRET */ 0, 2, 3, 1, /* INTs */ @@ -166,7 +166,7 @@ const UINT8 i80286_cpu_device::m_i80286_timing[] = const device_type I80286 = &device_creator<i80286_cpu_device>; -i80286_cpu_device::i80286_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i80286_cpu_device::i80286_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8086_common_cpu_device(mconfig, I80286, "I80286", tag, owner, clock, "i80286", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0) , m_io_config("io", ENDIANNESS_LITTLE, 16, 16, 0) @@ -289,7 +289,7 @@ void i80286_cpu_device::state_string_export(const device_state_entry &entry, std case STATE_GENFLAGS: { - UINT16 flags = CompressFlags(); + uint16_t flags = CompressFlags(); str = string_format("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", flags & 0x8000 ? '0':'.', flags & 0x4000 ? 'N':'.', @@ -353,10 +353,10 @@ void i80286_cpu_device::execute_set_input(int inptnum, int state) // of the nvram. if yes, after init, it sets the stack pointer to the value in 0040:0067 // in the bios data segment then pops es and ds off that stack, does popa then a far ret. -void i80286_cpu_device::trap(UINT32 error) +void i80286_cpu_device::trap(uint32_t error) { int error_code = error & 0xffff; - UINT16 number = error >> 16; + uint16_t number = error >> 16; if(error_code == 0xffff) error_code = -1; m_ip = m_prev_ip; @@ -383,7 +383,7 @@ void i80286_cpu_device::trap(UINT32 error) interrupt_descriptor(number,1,-1); } } - catch(UINT32 e) + catch(uint32_t e) { trap(e); } @@ -395,10 +395,10 @@ void i80286_cpu_device::trap(UINT32 error) m_trap_level = 0; } -UINT32 i80286_cpu_device::selector_address(UINT16 sel) +uint32_t i80286_cpu_device::selector_address(uint16_t sel) { - UINT32 base; - UINT16 limit; + uint32_t base; + uint16_t limit; if(TBL(sel)) { base = m_ldtr.base; @@ -412,7 +412,7 @@ UINT32 i80286_cpu_device::selector_address(UINT16 sel) return ((IDX(sel) >= limit) || !IDXTBL(sel) ? -1 : base + IDX(sel)); } -int i80286_cpu_device::verify(UINT16 selector, int operation, UINT8 rights, bool valid) +int i80286_cpu_device::verify(uint16_t selector, int operation, uint8_t rights, bool valid) { if(!IDXTBL(selector) && !valid) return FAULT_GP; @@ -439,7 +439,7 @@ int i80286_cpu_device::verify(UINT16 selector, int operation, UINT8 rights, bool void i80286_cpu_device::pop_seg(int reg) { - UINT16 sel; + uint16_t sel; if(PM) check_permission(SS, m_regs.w[SP], 2, I8086_READ); sel = read_word(m_base[SS] + m_regs.w[SP]); @@ -447,13 +447,13 @@ void i80286_cpu_device::pop_seg(int reg) m_regs.w[SP] += 2; } -void i80286_cpu_device::data_descriptor(int reg, UINT16 selector, int cpl, UINT32 trap, UINT16 offset, int size) +void i80286_cpu_device::data_descriptor(int reg, uint16_t selector, int cpl, uint32_t trap, uint16_t offset, int size) { if(PM) { - UINT16 desc[3]; - UINT8 r; - UINT32 addr; + uint16_t desc[3]; + uint8_t r; + uint32_t addr; if((reg != SS) && !IDXTBL(selector)) { m_sregs[reg] = 0; @@ -522,16 +522,16 @@ void i80286_cpu_device::data_descriptor(int reg, UINT16 selector, int cpl, UINT3 m_valid[reg] = 1; } -void i80286_cpu_device::data_descriptor(int reg, UINT16 selector) +void i80286_cpu_device::data_descriptor(int reg, uint16_t selector) { data_descriptor(reg, selector, CPL, TRAP(FAULT_GP,IDXTBL(selector))); } -void i80286_cpu_device::switch_task(UINT16 ntask, int type) +void i80286_cpu_device::switch_task(uint16_t ntask, int type) { - UINT16 ndesc[3], desc[3], ntss[22], otss[22], flags; - UINT8 r, lr; - UINT32 naddr, oaddr, ldtaddr; + uint16_t ndesc[3], desc[3], ntss[22], otss[22], flags; + uint8_t r, lr; + uint32_t naddr, oaddr, ldtaddr; int i; logerror("i286: %06x This program uses TSSs, how rare. Please report this to the developers.\n", pc()); @@ -658,7 +658,7 @@ void i80286_cpu_device::switch_task(UINT16 ntask, int type) { code_descriptor(ntss[TSS_CS], ntss[TSS_IP], 0); } - catch (UINT32 e) + catch (uint32_t e) { int error_code = e & 0xffff; if(error_code == FAULT_GP) @@ -670,13 +670,13 @@ void i80286_cpu_device::switch_task(UINT16 ntask, int type) data_descriptor(DS, ntss[TSS_DS], CPL, TRAP(FAULT_TS, IDXTBL(ntss[TSS_DS]))); } -void i80286_cpu_device::code_descriptor(UINT16 selector, UINT16 offset, int gate) +void i80286_cpu_device::code_descriptor(uint16_t selector, uint16_t offset, int gate) { if(PM) { - UINT16 desc[3]; - UINT8 r; - UINT32 addr; + uint16_t desc[3]; + uint8_t r; + uint32_t addr; if((addr = selector_address(selector)) == -1) throw TRAP(FAULT_GP, IDXTBL(selector)); @@ -715,7 +715,7 @@ void i80286_cpu_device::code_descriptor(UINT16 selector, UINT16 offset, int gate } else { // systemdescriptor - UINT16 gatesel = GATESEL(desc); + uint16_t gatesel = GATESEL(desc); if(!gate) throw TRAP(FAULT_GP, IDXTBL(selector)); // tss cs must be segment @@ -728,7 +728,7 @@ void i80286_cpu_device::code_descriptor(UINT16 selector, UINT16 offset, int gate { case CALLGATE: { - UINT16 gatedesc[3]; + uint16_t gatedesc[3]; if((addr = selector_address(gatesel)) == -1) throw TRAP(FAULT_GP, IDXTBL(gatesel)); @@ -750,8 +750,8 @@ void i80286_cpu_device::code_descriptor(UINT16 selector, UINT16 offset, int gate if (!CONF(r) && (DPL(r) < CPL)) { // inner call - UINT16 tss_ss, tss_sp, oldss, oldsp; - UINT32 oldstk; + uint16_t tss_ss, tss_sp, oldss, oldsp; + uint32_t oldstk; int i; if(gate == NT_JMP) throw TRAP(FAULT_GP, IDXTBL(gatesel)); // can't jmp to inner @@ -814,8 +814,8 @@ void i80286_cpu_device::code_descriptor(UINT16 selector, UINT16 offset, int gate void i80286_cpu_device::interrupt_descriptor(int number, int hwint, int error) { - UINT16 desc[3], gatesel, flags = CompressFlags(); - UINT8 r; + uint16_t desc[3], gatesel, flags = CompressFlags(); + uint8_t r; hwint = hwint ? 1 : 0; if(number == -1) @@ -832,8 +832,8 @@ void i80286_cpu_device::interrupt_descriptor(int number, int hwint, int error) PUSH(flags & ~0xf000); m_TF = m_IF = 0; - UINT16 dest_off = read_word(number * 4 + 0); - UINT16 dest_seg = read_word(number * 4 + 2); + uint16_t dest_off = read_word(number * 4 + 0); + uint16_t dest_seg = read_word(number * 4 + 2); PUSH(m_sregs[CS]); PUSH(m_ip); @@ -862,7 +862,7 @@ void i80286_cpu_device::interrupt_descriptor(int number, int hwint, int error) { switch_task(gatesel, NT_CALL); } - catch (UINT32 e) + catch (uint32_t e) { throw e + hwint; } @@ -874,8 +874,8 @@ void i80286_cpu_device::interrupt_descriptor(int number, int hwint, int error) case INTGATE: case TRAPGATE: { - UINT16 gatedesc[3]; - UINT32 addr; + uint16_t gatedesc[3]; + uint32_t addr; if((addr = selector_address(gatesel)) == -1) throw TRAP(FAULT_GP, (IDXTBL(gatesel) + hwint)); @@ -896,7 +896,7 @@ void i80286_cpu_device::interrupt_descriptor(int number, int hwint, int error) if(!CONF(r) && (DPL(r) < CPL)) { // inner call - UINT16 tss_ss, tss_sp, oldss, oldsp; + uint16_t tss_ss, tss_sp, oldss, oldsp; tss_ss = read_word(m_tr.base + TSS_SS0 * 2 + (DPL(r) * 4)); tss_sp = read_word(m_tr.base + TSS_SP0 * 2 + (DPL(r) * 4)); @@ -933,37 +933,37 @@ void i80286_cpu_device::interrupt_descriptor(int number, int hwint, int error) } } -UINT8 i80286_cpu_device::read_port_byte(UINT16 port) +uint8_t i80286_cpu_device::read_port_byte(uint16_t port) { if(PM && (CPL > m_IOPL)) throw TRAP(FAULT_GP, 0); return m_io->read_byte(port); } -UINT16 i80286_cpu_device::read_port_word(UINT16 port) +uint16_t i80286_cpu_device::read_port_word(uint16_t port) { if(PM && (CPL > m_IOPL)) throw TRAP(FAULT_GP, 0); return m_io->read_word_unaligned(port); } -void i80286_cpu_device::write_port_byte(UINT16 port, UINT8 data) +void i80286_cpu_device::write_port_byte(uint16_t port, uint8_t data) { if(PM && (CPL > m_IOPL)) throw TRAP(FAULT_GP, 0); m_io->write_byte(port, data); } -void i80286_cpu_device::write_port_word(UINT16 port, UINT16 data) +void i80286_cpu_device::write_port_word(uint16_t port, uint16_t data) { if(PM && (CPL > m_IOPL)) throw TRAP(FAULT_GP, 0); m_io->write_word_unaligned(port, data); } -UINT8 i80286_cpu_device::fetch_op() +uint8_t i80286_cpu_device::fetch_op() { - UINT8 data; + uint8_t data; if(m_ip > m_limit[CS]) throw TRAP(FAULT_GP, 0); @@ -972,9 +972,9 @@ UINT8 i80286_cpu_device::fetch_op() return data; } -UINT8 i80286_cpu_device::fetch() +uint8_t i80286_cpu_device::fetch() { - UINT8 data; + uint8_t data; if(m_ip > m_limit[CS]) throw TRAP(FAULT_GP, 0); @@ -983,7 +983,7 @@ UINT8 i80286_cpu_device::fetch() return data; } -UINT32 i80286_cpu_device::calc_addr(int seg, UINT16 offset, int size, int op, bool override) +uint32_t i80286_cpu_device::calc_addr(int seg, uint16_t offset, int size, int op, bool override) { seg = (m_seg_prefix && (seg==DS || seg==SS) && override) ? m_prefix_seg : seg; if(op != I8086_NONE) @@ -1055,7 +1055,7 @@ void i80286_cpu_device::execute_run() debugger_instruction_hook( this, pc() & m_amask ); - UINT8 op = fetch_op(); + uint8_t op = fetch_op(); switch(op) { @@ -1067,15 +1067,15 @@ void i80286_cpu_device::execute_run() case 0x0f: { unsigned next = fetch_op(); - UINT16 desc[3], tmp, msw, sel; - UINT8 r; - UINT32 addr; + uint16_t desc[3], tmp, msw, sel; + uint8_t r; + uint32_t addr; switch (next) { case 0: if(!PM) - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); m_modrm = fetch(); switch (m_modrm & 0x38) { @@ -1168,15 +1168,15 @@ void i80286_cpu_device::execute_run() break; default: - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); } break; case 1: { - UINT32 ea; + uint32_t ea; m_modrm = fetch(); if((m_modrm >= 0xc0) && (m_modrm < 0xe0)) - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); switch (m_modrm & 0x38) { case 0: /* sgdt */ @@ -1215,13 +1215,13 @@ void i80286_cpu_device::execute_run() m_msw = (m_msw & 1) | msw; break; default: - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); } break; } case 2: /* LAR */ if(!PM) - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); m_modrm = fetch_op(); tmp = GetRMWord(); if((addr = selector_address(tmp)) == -1) @@ -1244,7 +1244,7 @@ void i80286_cpu_device::execute_run() break; case 3: /* LSL */ if(!PM) - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); m_modrm = fetch_op(); tmp = GetRMWord(); if((addr = selector_address(tmp)) == -1) @@ -1309,7 +1309,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } m_msw &= ~8; break; default: - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); } break; } @@ -1333,7 +1333,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0x60: // i_pusha { check_permission(SS, m_regs.w[SP]-16, 16, I8086_WRITE); - UINT32 tmp = m_regs.w[SP]; + uint32_t tmp = m_regs.w[SP]; PUSH(m_regs.w[AX]); PUSH(m_regs.w[CX]); PUSH(m_regs.w[DX]); @@ -1361,7 +1361,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0x62: // i_bound { - UINT32 low,high,tmp; + uint32_t low,high,tmp; m_modrm = fetch(); low = GetRMWord(); high = GetnextRMWord(); @@ -1375,8 +1375,8 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0x63: // arpl { - UINT16 tmp, source; - if (!PM) throw TRAP(FAULT_UD,(UINT16)-1); + uint16_t tmp, source; + if (!PM) throw TRAP(FAULT_UD,(uint16_t)-1); m_modrm=fetch_op(); tmp=GetRMWord(); @@ -1399,28 +1399,28 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0x69: // i_imul_d16 { - UINT32 tmp; + uint32_t tmp; DEF_r16w(); tmp = fetch_word(); - m_dst = (INT32)((INT16)m_src)*(INT32)((INT16)tmp); - m_CarryVal = m_OverVal = (((INT32)m_dst) >> 15 != 0) && (((INT32)m_dst) >> 15 != -1); + m_dst = (int32_t)((int16_t)m_src)*(int32_t)((int16_t)tmp); + m_CarryVal = m_OverVal = (((int32_t)m_dst) >> 15 != 0) && (((int32_t)m_dst) >> 15 != -1); RegWord(m_dst); CLKM(IMUL_RRI16, IMUL_RMI16); } break; case 0x6a: // i_push_d8 - PUSH( (UINT16)((INT16)((INT8)fetch())) ); + PUSH( (uint16_t)((int16_t)((int8_t)fetch())) ); CLK(PUSH_IMM); break; case 0x6b: // i_imul_d8 { - UINT32 src2; + uint32_t src2; DEF_r16w(); - src2= (UINT16)((INT16)((INT8)fetch())); - m_dst = (INT32)((INT16)m_src)*(INT32)((INT16)src2); - m_CarryVal = m_OverVal = (((INT32)m_dst) >> 15 != 0) && (((INT32)m_dst) >> 15 != -1); + src2= (uint16_t)((int16_t)((int8_t)fetch())); + m_dst = (int32_t)((int16_t)m_src)*(int32_t)((int16_t)src2); + m_CarryVal = m_OverVal = (((int32_t)m_dst) >> 15 != 0) && (((int32_t)m_dst) >> 15 != -1); RegWord(m_dst); CLKM(IMUL_RRI8, IMUL_RMI8); } @@ -1447,7 +1447,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } if((m_modrm & 0x38) > 0x18) { logerror("%s: %06x: Mov Sreg - Invalid register\n", tag(), pc()); - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); } PutRMWord(m_sregs[(m_modrm & 0x38) >> 3]); CLKM(MOV_RS,MOV_MS); @@ -1471,14 +1471,14 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } break; default: logerror("%s: %06x: Mov Sreg - Invalid register\n", tag(), pc()); - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); } break; case 0x8f: // i_popw { m_modrm = fetch(); - UINT16 tmp = read_word(calc_addr(SS, m_regs.w[SP], 2, I8086_READ, false)); + uint16_t tmp = read_word(calc_addr(SS, m_regs.w[SP], 2, I8086_READ, false)); PutRMWord( tmp ); m_regs.w[SP] += 2; CLKM(POP_R16,POP_M16); @@ -1487,10 +1487,10 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0x9a: // i_call_far { - UINT16 cs = m_sregs[CS]; - UINT16 tmp = fetch_word(); - UINT16 tmp2 = fetch_word(); - UINT16 ip = m_ip; + uint16_t cs = m_sregs[CS]; + uint16_t tmp = fetch_word(); + uint16_t tmp2 = fetch_word(); + uint16_t ip = m_ip; code_descriptor(tmp2, tmp, NT_CALL); PUSH(cs); PUSH(ip); @@ -1500,13 +1500,13 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0x9b: // i_wait if((m_msw & 0x0a) == 0x0a) - throw TRAP(FAULT_NM, (UINT16)-1); + throw TRAP(FAULT_NM, (uint16_t)-1); CLK(WAIT); break; case 0x9c: // pushf { - UINT16 flags = CompressFlags(); + uint16_t flags = CompressFlags(); if(!PM) flags &= ~0xf000; PUSH(flags); @@ -1516,7 +1516,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0x9d: // popf { - UINT16 flags; + uint16_t flags; flags = POP(); CLK(POPF); load_flags(flags, CPL); @@ -1525,7 +1525,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xc0: // i_rotshft_bd8 { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMByte(); m_dst = m_src; @@ -1551,7 +1551,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xc1: // i_rotshft_wd8 { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMWord(); m_dst = m_src; @@ -1579,8 +1579,8 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } { m_modrm = fetch(); if(m_modrm >= 0xc0) - throw TRAP(FAULT_UD, (UINT16)-1); - UINT16 tmp = GetRMWord(); + throw TRAP(FAULT_UD, (uint16_t)-1); + uint16_t tmp = GetRMWord(); data_descriptor(ES, GetnextRMWord()); RegWord(tmp); CLK(LOAD_PTR); @@ -1591,8 +1591,8 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } { m_modrm = fetch(); if(m_modrm >= 0xc0) - throw TRAP(FAULT_UD, (UINT16)-1); - UINT16 tmp = GetRMWord(); + throw TRAP(FAULT_UD, (uint16_t)-1); + uint16_t tmp = GetRMWord(); data_descriptor(DS, GetnextRMWord()); RegWord(tmp); CLK(LOAD_PTR); @@ -1601,8 +1601,8 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xc8: // i_enter { - UINT16 nb = fetch(); - UINT32 level; + uint16_t nb = fetch(); + uint32_t level; nb |= fetch() << 8; level = fetch(); @@ -1644,7 +1644,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xcf: // iret { int oldcpl = (PM) ? CPL : 0; - UINT16 flags = far_return(1, 0); + uint16_t flags = far_return(1, 0); CLK(IRET); load_flags(flags, oldcpl); break; @@ -1652,7 +1652,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xd2: // i_rotshft_bcl { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMByte(); @@ -1679,7 +1679,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xd3: // i_rotshft_wcl { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMWord(); @@ -1713,7 +1713,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xde: case 0xdf: if((m_msw & 8) || (m_msw & 4)) - throw TRAP(FAULT_NM, (UINT16)-1); + throw TRAP(FAULT_NM, (uint16_t)-1); m_modrm = fetch(); GetRMByte(); CLK(NOP); @@ -1723,8 +1723,8 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xea: // i_jmp_far { - UINT16 tmp = fetch_word(); - UINT16 tmp1 = fetch_word(); + uint16_t tmp = fetch_word(); + uint16_t tmp1 = fetch_word(); code_descriptor(tmp1, tmp, NT_JMP); CLK(JMP_FAR); break; @@ -1761,7 +1761,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xff: // i_ffpre { - UINT32 tmp, tmp1; + uint32_t tmp, tmp1; m_modrm = fetch(); tmp = GetRMWord(); switch ( m_modrm & 0x38 ) @@ -1789,7 +1789,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } break; case 0x18: /* CALL FAR */ { - UINT16 ip = m_ip; + uint16_t ip = m_ip; tmp1 = m_sregs[CS]; code_descriptor(GetnextRMWord(), tmp, NT_CALL); PUSH(tmp1); @@ -1811,7 +1811,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } break; default: logerror("%s: %06x: FF Pre with unimplemented mod\n", tag(), pc()); - throw TRAP(FAULT_UD,(UINT16)-1); + throw TRAP(FAULT_UD,(uint16_t)-1); } } break; @@ -1820,8 +1820,8 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xf3: { bool pass = false; - UINT8 next = repx_op(); - UINT16 c = m_regs.w[CX]; + uint8_t next = repx_op(); + uint16_t c = m_regs.w[CX]; switch (next) { @@ -1848,12 +1848,12 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } m_icount -= 10; // UD fault timing? logerror("%s: %06x: Invalid Opcode %02x\n", tag(), pc(), op); m_ip = m_prev_ip; - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); } break; } } - catch(UINT32 e) + catch(uint32_t e) { trap(e); } @@ -1861,13 +1861,13 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } } -void i80286_cpu_device::load_flags(UINT16 flags, int cpl) +void i80286_cpu_device::load_flags(uint16_t flags, int cpl) { - UINT16 oldflags = CompressFlags(); + uint16_t oldflags = CompressFlags(); flags &= ~0x8000; if(PM && cpl) { - UINT16 mask = 0x3000; + uint16_t mask = 0x3000; if(cpl > m_IOPL) mask |= 0x200; flags &= ~mask; @@ -1881,9 +1881,9 @@ void i80286_cpu_device::load_flags(UINT16 flags, int cpl) m_fire_trap = 1; } -UINT16 i80286_cpu_device::far_return(int iret, int bytes) +uint16_t i80286_cpu_device::far_return(int iret, int bytes) { - UINT16 sel, off, flags = 0; + uint16_t sel, off, flags = 0; int spaddr; if(PM && m_NT && iret) @@ -1904,7 +1904,7 @@ UINT16 i80286_cpu_device::far_return(int iret, int bytes) if(PM) { - UINT16 desc[3], newsp, newss; + uint16_t desc[3], newsp, newss; int addr, r; if((addr = selector_address(sel)) == -1) @@ -1970,10 +1970,10 @@ UINT16 i80286_cpu_device::far_return(int iret, int bytes) return flags; } -void i80286_cpu_device::check_permission(UINT8 check_seg, UINT32 offset, UINT16 size, int operation) +void i80286_cpu_device::check_permission(uint8_t check_seg, uint32_t offset, uint16_t size, int operation) { int trap; - UINT8 rights; + uint8_t rights; if(PM) { rights = m_rights[check_seg]; |