diff options
Diffstat (limited to 'src/devices/cpu/hd61700/hd61700.cpp')
-rw-r--r-- | src/devices/cpu/hd61700/hd61700.cpp | 652 |
1 files changed, 326 insertions, 326 deletions
diff --git a/src/devices/cpu/hd61700/hd61700.cpp b/src/devices/cpu/hd61700/hd61700.cpp index e48b83a576f..11e0ab9f0c2 100644 --- a/src/devices/cpu/hd61700/hd61700.cpp +++ b/src/devices/cpu/hd61700/hd61700.cpp @@ -89,7 +89,7 @@ #define CPU_SLP 0x02 /* HD61700 IRQ vector */ -static const UINT16 irq_vector[] = {0x0032, 0x0042, 0x0052, 0x0062, 0x0072}; +static const uint16_t irq_vector[] = {0x0032, 0x0042, 0x0052, 0x0062, 0x0072}; //************************************************************************** // HD61700 DEVICE @@ -101,7 +101,7 @@ const device_type HD61700 = &device_creator<hd61700_cpu_device>; // hd61700_cpu_device - constructor //------------------------------------------------- -hd61700_cpu_device::hd61700_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd61700_cpu_device::hd61700_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, HD61700, "HD61700", tag, owner, clock, "hd61700", __FILE__), m_program_config("program", ENDIANNESS_BIG, 16, 18, -1), m_ppc(0x0000), @@ -292,7 +292,7 @@ void hd61700_cpu_device::state_string_export(const device_state_entry &entry, st // helper function //------------------------------------------------- -offs_t hd61700_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t hd61700_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( hd61700 ); return CPU_DISASSEMBLE_NAME(hd61700)(this, buffer, pc, oprom, opram, options); @@ -344,7 +344,7 @@ void hd61700_cpu_device::execute_run() } else { - UINT8 op; + uint8_t op; check_irqs(); @@ -359,9 +359,9 @@ void hd61700_cpu_device::execute_run() case 0x08: //ad case 0x09: //sb { - UINT8 arg = read_op(); - UINT8 src = READ_REG(get_sir_im8(arg)); - UINT16 res = READ_REG(arg) + ((op&1) ? -src : +src); + uint8_t arg = read_op(); + uint8_t src = READ_REG(get_sir_im8(arg)); + uint16_t res = READ_REG(arg) + ((op&1) ? -src : +src); COND_WRITE_REG(op, arg, res & 0xff); @@ -377,7 +377,7 @@ void hd61700_cpu_device::execute_run() case 0x02: //ld { - UINT8 arg = read_op(); + uint8_t arg = read_op(); COPY_REG(arg, get_sir_im8(arg)); check_optional_jr(arg); @@ -394,9 +394,9 @@ void hd61700_cpu_device::execute_run() case 0x0e: //or case 0x0f: //xr { - UINT8 arg = read_op(); + uint8_t arg = read_op(); - UINT8 res = make_logic(op, READ_REG(arg), READ_REG(get_sir_im8(arg))); + uint8_t res = make_logic(op, READ_REG(arg), READ_REG(get_sir_im8(arg))); COND_WRITE_REG(op, arg, res); @@ -416,8 +416,8 @@ void hd61700_cpu_device::execute_run() case 0x0a: //adb case 0x0b: //sbb { - UINT8 arg = read_op(); - UINT16 res; + uint8_t arg = read_op(); + uint16_t res; if (op & 0x01) res = make_bcd_sub(READ_REG(arg), READ_REG(get_sir_im8(arg))); @@ -438,9 +438,9 @@ void hd61700_cpu_device::execute_run() case 0x10: //st { - UINT8 arg = read_op(); - UINT8 src = get_sir_im8(arg); - UINT16 offset = REG_GET16(src); + uint8_t arg = read_op(); + uint8_t src = get_sir_im8(arg); + uint16_t offset = REG_GET16(src); mem_writebyte(REG_UA>>4, offset, READ_REG(arg)); @@ -451,9 +451,9 @@ void hd61700_cpu_device::execute_run() case 0x11: //ld { - UINT8 arg = read_op(); - UINT8 src = get_sir_im8(arg); - UINT16 offset = REG_GET16(src); + uint8_t arg = read_op(); + uint8_t src = get_sir_im8(arg); + uint16_t offset = REG_GET16(src); WRITE_REG(arg, mem_readbyte(REG_UA>>4, offset)); @@ -464,7 +464,7 @@ void hd61700_cpu_device::execute_run() case 0x12: //stl { - UINT8 arg = read_op(); + uint8_t arg = read_op(); m_lcd_write_cb((offs_t)0, READ_REG(arg)); check_optional_jr(arg); @@ -474,8 +474,8 @@ void hd61700_cpu_device::execute_run() case 0x13: //ldl { - UINT8 arg = read_op(); - UINT8 res = m_lcd_read_cb(0); + uint8_t arg = read_op(); + uint8_t res = m_lcd_read_cb(0); WRITE_REG(arg, res); @@ -486,7 +486,7 @@ void hd61700_cpu_device::execute_run() case 0x14: //ppo/pfl { - UINT8 arg = read_op(); + uint8_t arg = read_op(); if (arg & 0x40) { @@ -504,7 +504,7 @@ void hd61700_cpu_device::execute_run() case 0x15: //psr { - UINT8 arg = read_op(); + uint8_t arg = read_op(); WRITE_SREG(arg, READ_REG(arg)); check_optional_jr(arg); @@ -515,9 +515,9 @@ void hd61700_cpu_device::execute_run() case 0x16: //pst case 0x17: //pst { - UINT8 arg = read_op(); - UINT8 src = READ_REG(arg); - UINT8 idx = GET_REG_IDX(op, arg); + uint8_t arg = read_op(); + uint8_t src = READ_REG(arg); + uint8_t idx = GET_REG_IDX(op, arg); switch (idx) { @@ -554,15 +554,15 @@ void hd61700_cpu_device::execute_run() case 0x18: { - UINT8 arg = read_op(); - UINT8 op1 = (arg>>5) & 0x03; + uint8_t arg = read_op(); + uint8_t op1 = (arg>>5) & 0x03; switch (op1) { case 0x00: //rod case 0x02: //bid { - UINT8 src = READ_REG(arg); - UINT8 res = (src>>1)&0x7f; + uint8_t src = READ_REG(arg); + uint8_t res = (src>>1)&0x7f; if (!(op1&0x02)) res = res | ((m_flags&FLAG_C) !=0 )<<7; @@ -579,8 +579,8 @@ void hd61700_cpu_device::execute_run() case 0x01: //rou case 0x03: //biu { - UINT8 src = READ_REG(arg); - UINT8 res = (src<<1)&0xfe; + uint8_t src = READ_REG(arg); + uint8_t res = (src<<1)&0xfe; if (!(op1&0x02)) res = res | ((m_flags&FLAG_C) !=0 )<<0; @@ -602,14 +602,14 @@ void hd61700_cpu_device::execute_run() case 0x1a: { - UINT8 arg = read_op(); - UINT8 op1 = (arg>>5) & 0x03; + uint8_t arg = read_op(); + uint8_t op1 = (arg>>5) & 0x03; switch (op1) { case 0x00: //did case 0x01: //diu { - UINT8 res; + uint8_t res; if (op1&0x01) res = (READ_REG(arg)<<4)&0xf0; @@ -639,8 +639,8 @@ void hd61700_cpu_device::execute_run() case 0x1b: //cmp/inv { - UINT8 arg = read_op(); - UINT8 res = ~(READ_REG(arg)); + uint8_t arg = read_op(); + uint8_t res = ~(READ_REG(arg)); if (!(arg & 0x40)) res++; WRITE_REG(arg, res); @@ -657,8 +657,8 @@ void hd61700_cpu_device::execute_run() case 0x1c: //gpo/gfl { - UINT8 arg = read_op(); - UINT8 src; + uint8_t arg = read_op(); + uint8_t src; if (arg&0x40) { @@ -679,7 +679,7 @@ void hd61700_cpu_device::execute_run() case 0x1d: //gsr { - UINT8 arg = read_op(); + uint8_t arg = read_op(); WRITE_REG(arg, READ_SREG(arg)); check_optional_jr(arg); m_icount -= 3; @@ -689,8 +689,8 @@ void hd61700_cpu_device::execute_run() case 0x1e: //gst case 0x1f: //gst { - UINT8 arg = read_op(); - UINT8 idx = GET_REG_IDX(op, arg); + uint8_t arg = read_op(); + uint8_t idx = GET_REG_IDX(op, arg); WRITE_REG(arg, READ_REG8(idx)); check_optional_jr(arg); m_icount -= 3; @@ -700,8 +700,8 @@ void hd61700_cpu_device::execute_run() case 0x20: //st case 0x22: //sti { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IX; + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IX; REG_IX += get_sign_mreg(arg); mem_writebyte(REG_UA>>4, REG_IX++, READ_REG(arg)); @@ -715,8 +715,8 @@ void hd61700_cpu_device::execute_run() case 0x21: //st case 0x23: //sti { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IZ; + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IZ; REG_IZ += get_sign_mreg(arg); mem_writebyte(REG_UA>>6, REG_IZ++, READ_REG(arg)); @@ -729,7 +729,7 @@ void hd61700_cpu_device::execute_run() case 0x24: //std { - UINT8 arg = read_op(); + uint8_t arg = read_op(); REG_IX += get_sign_mreg(arg); mem_writebyte(REG_UA>>4, REG_IX, READ_REG(arg)); @@ -739,7 +739,7 @@ void hd61700_cpu_device::execute_run() case 0x25: //std { - UINT8 arg = read_op(); + uint8_t arg = read_op(); REG_IZ += get_sign_mreg(arg); mem_writebyte(REG_UA>>6, REG_IZ, READ_REG(arg)); @@ -749,7 +749,7 @@ void hd61700_cpu_device::execute_run() case 0x26: //phs { - UINT8 arg = read_op(); + uint8_t arg = read_op(); push(REG_SS, READ_REG(arg)); m_icount -= 9; @@ -757,7 +757,7 @@ void hd61700_cpu_device::execute_run() break; case 0x27: //phu { - UINT8 arg = read_op(); + uint8_t arg = read_op(); push(REG_US, READ_REG(arg)); m_icount -= 9; @@ -767,8 +767,8 @@ void hd61700_cpu_device::execute_run() case 0x28: //ld case 0x2a: //ldi { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IX; + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IX; REG_IX += get_sign_mreg(arg); WRITE_REG(arg, mem_readbyte(REG_UA>>4, REG_IX++)); @@ -782,8 +782,8 @@ void hd61700_cpu_device::execute_run() case 0x29: //ld case 0x2b: //ldi { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IZ; + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IZ; REG_IZ += get_sign_mreg(arg); WRITE_REG(arg, mem_readbyte(REG_UA>>6, REG_IZ++)); @@ -796,7 +796,7 @@ void hd61700_cpu_device::execute_run() case 0x2c: //ldd { - UINT8 arg = read_op(); + uint8_t arg = read_op(); REG_IX += get_sign_mreg(arg); WRITE_REG(arg, mem_readbyte(REG_UA>>4, REG_IX)); @@ -807,7 +807,7 @@ void hd61700_cpu_device::execute_run() case 0x2d: //ldd { - UINT8 arg = read_op(); + uint8_t arg = read_op(); REG_IZ += get_sign_mreg(arg); WRITE_REG(arg, mem_readbyte(REG_UA>>6, REG_IZ)); @@ -818,7 +818,7 @@ void hd61700_cpu_device::execute_run() case 0x2e: //pps { - UINT8 arg = read_op(); + uint8_t arg = read_op(); WRITE_REG(arg, pop(REG_SS)); m_icount -= 11; @@ -826,7 +826,7 @@ void hd61700_cpu_device::execute_run() break; case 0x2f: //ppu { - UINT8 arg = read_op(); + uint8_t arg = read_op(); WRITE_REG(arg, pop(REG_US)); m_icount -= 11; @@ -842,9 +842,9 @@ void hd61700_cpu_device::execute_run() case 0x36: //jp nlz case 0x37: //unconditional jp { - UINT8 lsb = read_op(); + uint8_t lsb = read_op(); if (m_pc < INT_ROM) read_op(); - UINT8 msb = read_op(); + uint8_t msb = read_op(); if (check_cond(op)) set_pc((msb<<8) | lsb); @@ -857,11 +857,11 @@ void hd61700_cpu_device::execute_run() case 0x3c: //ad case 0x3e: //sb { - UINT8 arg = read_op(); - UINT16 offset = REG_IX + get_sign_mreg(arg); - UINT8 src = mem_readbyte(REG_UA>>4, offset); + uint8_t arg = read_op(); + uint16_t offset = REG_IX + get_sign_mreg(arg); + uint8_t src = mem_readbyte(REG_UA>>4, offset); - UINT16 res = src + ((op & 2) ? -READ_REG(arg) : +READ_REG(arg)) ; + uint16_t res = src + ((op & 2) ? -READ_REG(arg) : +READ_REG(arg)) ; if ((op & 4)) mem_writebyte(REG_UA>>4, offset, res & 0xff); @@ -880,11 +880,11 @@ void hd61700_cpu_device::execute_run() case 0x3d: //ad case 0x3f: //sb { - UINT8 arg = read_op(); - UINT16 offset = REG_IZ + get_sign_mreg(arg); - UINT8 src = mem_readbyte(REG_UA>>6, offset); + uint8_t arg = read_op(); + uint16_t offset = REG_IZ + get_sign_mreg(arg); + uint8_t src = mem_readbyte(REG_UA>>6, offset); - UINT16 res = src + ((op & 2) ? -READ_REG(arg) : +READ_REG(arg)) ; + uint16_t res = src + ((op & 2) ? -READ_REG(arg) : +READ_REG(arg)) ; if ((op & 4)) mem_writebyte(REG_UA>>6, offset, res & 0xff); @@ -903,9 +903,9 @@ void hd61700_cpu_device::execute_run() case 0x48: //ad case 0x49: //sb { - UINT8 arg = read_op(); - UINT8 src = read_op(); - UINT16 res = READ_REG(arg) + ((op&1) ? -src : +src); + uint8_t arg = read_op(); + uint8_t src = read_op(); + uint16_t res = READ_REG(arg) + ((op&1) ? -src : +src); COND_WRITE_REG(op, arg, res & 0xff); @@ -921,8 +921,8 @@ void hd61700_cpu_device::execute_run() case 0x42: //ld { - UINT8 arg = read_op(); - UINT8 src = read_op() ; + uint8_t arg = read_op(); + uint8_t src = read_op() ; WRITE_REG(arg, src); @@ -940,10 +940,10 @@ void hd61700_cpu_device::execute_run() case 0x4e: //or case 0x4f: //xr { - UINT8 arg = read_op(); - UINT8 src = read_op(); + uint8_t arg = read_op(); + uint8_t src = read_op(); - UINT8 res = make_logic(op, READ_REG(arg), src); + uint8_t res = make_logic(op, READ_REG(arg), src); COND_WRITE_REG(op, arg, res); @@ -963,9 +963,9 @@ void hd61700_cpu_device::execute_run() case 0x4a: //adb case 0x4b: //sbb { - UINT8 arg = read_op(); - UINT8 src = read_op(); - UINT16 res; + uint8_t arg = read_op(); + uint8_t src = read_op(); + uint16_t res; if (op & 0x01) res = make_bcd_sub(READ_REG(arg), src); @@ -986,9 +986,9 @@ void hd61700_cpu_device::execute_run() case 0x50: //st { - UINT8 arg = read_op(); - UINT8 src = read_op(); - UINT16 offset = REG_GET16(READ_SREG(arg)); + uint8_t arg = read_op(); + uint8_t src = read_op(); + uint16_t offset = REG_GET16(READ_SREG(arg)); mem_writebyte(REG_UA>>4, offset, src); m_icount -= 8; @@ -997,8 +997,8 @@ void hd61700_cpu_device::execute_run() case 0x51: //ld { - UINT8 arg = read_op(); - UINT8 src = read_op(); + uint8_t arg = read_op(); + uint8_t src = read_op(); WRITE_REG(arg, src); m_icount -= 8; @@ -1007,7 +1007,7 @@ void hd61700_cpu_device::execute_run() case 0x52: //stl { - UINT8 arg = read_op(); + uint8_t arg = read_op(); m_lcd_write_cb((offs_t)0, arg); m_icount -= 12; @@ -1016,8 +1016,8 @@ void hd61700_cpu_device::execute_run() case 0x54: //ppo/pfl { - UINT8 arg = read_op(); - UINT8 src = read_op(); + uint8_t arg = read_op(); + uint8_t src = read_op(); if (arg & 0x40) { @@ -1034,7 +1034,7 @@ void hd61700_cpu_device::execute_run() case 0x55: //psr { - UINT8 arg = read_op(); + uint8_t arg = read_op(); WRITE_SREG(arg, arg); m_icount -= 3; @@ -1044,9 +1044,9 @@ void hd61700_cpu_device::execute_run() case 0x56: //pst case 0x57: //pst { - UINT8 arg = read_op(); - UINT8 src = read_op(); - UINT8 idx = GET_REG_IDX(op, arg); + uint8_t arg = read_op(); + uint8_t src = read_op(); + uint8_t idx = GET_REG_IDX(op, arg); switch (idx) { @@ -1083,9 +1083,9 @@ void hd61700_cpu_device::execute_run() case 0x58: //bups case 0x59: //bdns { - UINT8 arg = read_op(); - UINT8 tmp; - UINT16 res; + uint8_t arg = read_op(); + uint8_t tmp; + uint16_t res; for(;;) { @@ -1113,8 +1113,8 @@ void hd61700_cpu_device::execute_run() case 0x5c: //sup case 0x5d: //sdn { - UINT8 arg = read_op(); - UINT16 res; + uint8_t arg = read_op(); + uint16_t res; for(;;) { @@ -1139,8 +1139,8 @@ void hd61700_cpu_device::execute_run() case 0x60: //st case 0x62: //sti { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IX; + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IX; REG_IX += get_sign_im8(arg); mem_writebyte(REG_UA>>4, REG_IX++, READ_REG(arg)); @@ -1154,8 +1154,8 @@ void hd61700_cpu_device::execute_run() case 0x61: //st case 0x63: //sti { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IZ; + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IZ; REG_IZ += get_sign_im8(arg); mem_writebyte(REG_UA>>6, REG_IZ++, READ_REG(arg)); @@ -1167,7 +1167,7 @@ void hd61700_cpu_device::execute_run() case 0x64: //std { - UINT8 arg = read_op(); + uint8_t arg = read_op(); REG_IX += get_sign_im8(arg); mem_writebyte(REG_UA>>4, REG_IX, READ_REG(arg)); @@ -1177,7 +1177,7 @@ void hd61700_cpu_device::execute_run() case 0x65: //std { - UINT8 arg = read_op(); + uint8_t arg = read_op(); REG_IZ += get_sign_im8(arg); mem_writebyte(REG_UA>>6, REG_IZ, READ_REG(arg)); @@ -1188,8 +1188,8 @@ void hd61700_cpu_device::execute_run() case 0x68: //ld case 0x6a: //ldi { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IX; + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IX; REG_IX += get_sign_im8(arg); WRITE_REG(arg, mem_readbyte(REG_UA>>4, REG_IX++)); @@ -1202,8 +1202,8 @@ void hd61700_cpu_device::execute_run() case 0x69: //ld case 0x6b: //ldi { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IZ; + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IZ; REG_IZ += get_sign_im8(arg); WRITE_REG(arg, mem_readbyte(REG_UA>>6, REG_IZ++)); @@ -1215,7 +1215,7 @@ void hd61700_cpu_device::execute_run() case 0x6c: //ldd { - UINT8 arg = read_op(); + uint8_t arg = read_op(); REG_IX += get_sign_im8(arg); WRITE_REG(arg, mem_readbyte(REG_UA>>4, REG_IX)); @@ -1225,7 +1225,7 @@ void hd61700_cpu_device::execute_run() case 0x6d: //ldd { - UINT8 arg = read_op(); + uint8_t arg = read_op(); REG_IZ += get_sign_im8(arg); WRITE_REG(arg, mem_readbyte(REG_UA>>6, REG_IZ)); @@ -1242,9 +1242,9 @@ void hd61700_cpu_device::execute_run() case 0x76: //cal nlz case 0x77: //unconditional cal { - UINT8 lsb = read_op(); + uint8_t lsb = read_op(); if (m_pc < INT_ROM) read_op(); - UINT8 msb = read_op(); + uint8_t msb = read_op(); if (check_cond(op)) { @@ -1264,11 +1264,11 @@ void hd61700_cpu_device::execute_run() case 0x7c: //ad case 0x7e: //sb { - UINT8 arg = read_op(); - UINT16 offset = REG_IX + get_sign_im8(arg); - UINT8 src = mem_readbyte(REG_UA>>4, offset); + uint8_t arg = read_op(); + uint16_t offset = REG_IX + get_sign_im8(arg); + uint8_t src = mem_readbyte(REG_UA>>4, offset); - UINT16 res = src + ((op & 2) ? -READ_REG(arg) : +READ_REG(arg)) ; + uint16_t res = src + ((op & 2) ? -READ_REG(arg) : +READ_REG(arg)) ; if ((op & 4)) mem_writebyte(REG_UA>>4, offset, res & 0xff); @@ -1287,11 +1287,11 @@ void hd61700_cpu_device::execute_run() case 0x7d: //ad case 0x7f: //sb { - UINT8 arg = read_op(); - UINT16 offset = REG_IZ + get_sign_im8(arg); - UINT8 src = mem_readbyte(REG_UA>>6, offset); + uint8_t arg = read_op(); + uint16_t offset = REG_IZ + get_sign_im8(arg); + uint8_t src = mem_readbyte(REG_UA>>6, offset); - UINT16 res = src + ((op & 2) ? -READ_REG(arg) : +READ_REG(arg)) ; + uint16_t res = src + ((op & 2) ? -READ_REG(arg) : +READ_REG(arg)) ; if ((op & 4)) mem_writebyte(REG_UA>>6, offset, res & 0xff); @@ -1310,9 +1310,9 @@ void hd61700_cpu_device::execute_run() case 0x88: //adw case 0x89: //sbw { - UINT8 arg = read_op(); - UINT8 src = get_sir_im8(arg); - UINT32 res = REG_GET16(arg) + ((op & 0x01) ? -REG_GET16(src) : +REG_GET16(src)); + uint8_t arg = read_op(); + uint8_t src = get_sir_im8(arg); + uint32_t res = REG_GET16(arg) + ((op & 0x01) ? -REG_GET16(src) : +REG_GET16(src)); if (op & 0x08) REG_PUT16(arg, res&0xffff); @@ -1328,8 +1328,8 @@ void hd61700_cpu_device::execute_run() case 0x82: //ldw { - UINT8 arg = read_op(); - UINT8 src = get_sir_im8(arg); + uint8_t arg = read_op(); + uint8_t src = get_sir_im8(arg); COPY_REG(arg, src); COPY_REG(arg+1, src+1); @@ -1348,13 +1348,13 @@ void hd61700_cpu_device::execute_run() case 0x8e: //orw case 0x8f: //xrw { - UINT8 arg = read_op(); - UINT8 src = get_sir_im8(arg); + uint8_t arg = read_op(); + uint8_t src = get_sir_im8(arg); - UINT8 res0 = make_logic(op, READ_REG(arg), READ_REG(src)); + uint8_t res0 = make_logic(op, READ_REG(arg), READ_REG(src)); COND_WRITE_REG(op, arg, res0); - UINT8 res1 = make_logic(op, READ_REG(arg+1), READ_REG(src+1)); + uint8_t res1 = make_logic(op, READ_REG(arg+1), READ_REG(src+1)); COND_WRITE_REG(op, arg+1, res1); CLEAR_FLAGS; @@ -1373,9 +1373,9 @@ void hd61700_cpu_device::execute_run() case 0x8a: //adbw case 0x8b: //sbbw { - UINT8 arg = read_op(); - UINT8 src = get_sir_im8(arg); - UINT16 res0, res1; + uint8_t arg = read_op(); + uint8_t src = get_sir_im8(arg); + uint16_t res0, res1; if (op & 0x01) res0 = make_bcd_sub(READ_REG(arg), READ_REG(src)); @@ -1405,9 +1405,9 @@ void hd61700_cpu_device::execute_run() case 0x90: //stw { - UINT8 arg = read_op(); - UINT8 src = get_sir_im8(arg); - UINT16 offset = REG_GET16(src); + uint8_t arg = read_op(); + uint8_t src = get_sir_im8(arg); + uint16_t offset = REG_GET16(src); mem_writebyte(REG_UA>>4, offset+0, READ_REG(arg+0)); mem_writebyte(REG_UA>>4, offset+1, READ_REG(arg+1)); @@ -1419,9 +1419,9 @@ void hd61700_cpu_device::execute_run() case 0x91: //ldw { - UINT8 arg = read_op(); - UINT8 src = get_sir_im8(arg); - UINT16 offset = REG_GET16(src); + uint8_t arg = read_op(); + uint8_t src = get_sir_im8(arg); + uint16_t offset = REG_GET16(src); WRITE_REG(arg+0, mem_readbyte(REG_UA>>4, offset+0)); WRITE_REG(arg+1, mem_readbyte(REG_UA>>4, offset+1)); @@ -1433,7 +1433,7 @@ void hd61700_cpu_device::execute_run() case 0x92: //stlw { - UINT8 arg = read_op(); + uint8_t arg = read_op(); m_lcd_write_cb((offs_t)0, READ_REG(arg)); m_lcd_write_cb((offs_t)0, READ_REG(arg+1)); @@ -1445,8 +1445,8 @@ void hd61700_cpu_device::execute_run() case 0x93: //ldcw { - UINT8 arg = read_op(); - UINT8 reg0, reg1; + uint8_t arg = read_op(); + uint8_t reg0, reg1; reg0 = m_lcd_read_cb(0); reg1 = m_lcd_read_cb(0); @@ -1462,8 +1462,8 @@ void hd61700_cpu_device::execute_run() case 0x96: //pre case 0x97: //pre { - UINT8 arg = read_op(); - UINT8 idx = GET_REG_IDX(op, arg); + uint8_t arg = read_op(); + uint8_t idx = GET_REG_IDX(op, arg); if (idx < 5) m_reg16bit[idx] = REG_GET16(arg); @@ -1475,15 +1475,15 @@ void hd61700_cpu_device::execute_run() case 0x98: //rodw { - UINT8 arg = read_op(); - UINT8 op1 = (arg>>5) & 0x03; + uint8_t arg = read_op(); + uint8_t op1 = (arg>>5) & 0x03; switch (op1) { case 0x00: //rodw case 0x02: //bidw { - UINT16 src = REG_GET16(arg-1); - UINT16 res = (src>>1)&0x7fff; + uint16_t src = REG_GET16(arg-1); + uint16_t res = (src>>1)&0x7fff; if (!(op1&0x02)) res = res | ((m_flags&FLAG_C) !=0 )<<15; @@ -1500,8 +1500,8 @@ void hd61700_cpu_device::execute_run() case 0x01: //rouw case 0x03: //biuw { - UINT16 src = REG_GET16(arg); - UINT16 res = (src<<1)&0xfffe; + uint16_t src = REG_GET16(arg); + uint16_t res = (src<<1)&0xfffe; if (!(op1&0x02)) res = res | ((m_flags&FLAG_C) !=0 )<<0; @@ -1523,13 +1523,13 @@ void hd61700_cpu_device::execute_run() case 0x9a: { - UINT8 arg = read_op(); - UINT8 op1 = (arg>>5) & 0x03; + uint8_t arg = read_op(); + uint8_t op1 = (arg>>5) & 0x03; switch (op1) { case 0x00: //didw { - UINT16 src = (REG_GET16(arg-1)>>4)&0x0fff; + uint16_t src = (REG_GET16(arg-1)>>4)&0x0fff; REG_PUT16(arg-1, src); CLEAR_FLAGS; @@ -1540,7 +1540,7 @@ void hd61700_cpu_device::execute_run() case 0x01: //diuw { - UINT16 src = (REG_GET16(arg)<<4)&0xfff0; + uint16_t src = (REG_GET16(arg)<<4)&0xfff0; REG_PUT16(arg, src); CLEAR_FLAGS; @@ -1551,7 +1551,7 @@ void hd61700_cpu_device::execute_run() case 0x02: //bydw { - UINT8 src = READ_REG(arg); + uint8_t src = READ_REG(arg); WRITE_REG(arg, 0); WRITE_REG(arg-1, src); @@ -1564,7 +1564,7 @@ void hd61700_cpu_device::execute_run() case 0x03: //byuw { - UINT8 src = READ_REG(arg); + uint8_t src = READ_REG(arg); WRITE_REG(arg, 0); WRITE_REG(arg+1, src); @@ -1583,8 +1583,8 @@ void hd61700_cpu_device::execute_run() case 0x9b: //cmpw/invw { - UINT8 arg = read_op(); - UINT16 res = ~(REG_GET16(arg)); + uint8_t arg = read_op(); + uint16_t res = ~(REG_GET16(arg)); if (!(arg & 0x40)) res++; REG_PUT16(arg, res); @@ -1602,8 +1602,8 @@ void hd61700_cpu_device::execute_run() case 0x9c: //gpow/gflw { - UINT8 arg = read_op(); - UINT8 reg0, reg1; + uint8_t arg = read_op(); + uint8_t reg0, reg1; if (arg&0x40) { @@ -1630,13 +1630,13 @@ void hd61700_cpu_device::execute_run() case 0x9e: //gre case 0x9f: //gre { - UINT8 arg = read_op(); - UINT8 idx = GET_REG_IDX(op, arg); - UINT16 src; + uint8_t arg = read_op(); + uint8_t idx = GET_REG_IDX(op, arg); + uint16_t src; if (idx >= 5) { - UINT16 port = m_kb_read_cb(0); + uint16_t port = m_kb_read_cb(0); src = (REG_KY & 0x0f00) | (port & 0xf0ff); } else @@ -1652,9 +1652,9 @@ void hd61700_cpu_device::execute_run() case 0xa0: //stw case 0xa2: //stiw { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IX; - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IX; + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); REG_IX += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -1669,9 +1669,9 @@ void hd61700_cpu_device::execute_run() case 0xa1: //stw case 0xa3: //stiw { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IZ; - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IZ; + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); REG_IZ += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -1685,8 +1685,8 @@ void hd61700_cpu_device::execute_run() case 0xa4: //stdw { - UINT8 arg = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); REG_IX += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -1698,8 +1698,8 @@ void hd61700_cpu_device::execute_run() break; case 0xa5: //stdw { - UINT8 arg = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); REG_IZ += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -1712,7 +1712,7 @@ void hd61700_cpu_device::execute_run() case 0xa6: //phsw { - UINT8 arg = read_op(); + uint8_t arg = read_op(); push(REG_SS, READ_REG(arg)); push(REG_SS, READ_REG(arg-1)); @@ -1721,7 +1721,7 @@ void hd61700_cpu_device::execute_run() break; case 0xa7: //phuw { - UINT8 arg = read_op(); + uint8_t arg = read_op(); push(REG_US, READ_REG(arg)); push(REG_US, READ_REG(arg-1)); @@ -1732,9 +1732,9 @@ void hd61700_cpu_device::execute_run() case 0xa8: //ldw case 0xaa: //ldiw { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IX; - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IX; + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); REG_IX += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -1750,9 +1750,9 @@ void hd61700_cpu_device::execute_run() case 0xa9: //ldw case 0xab: //ldiw { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IZ; - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IZ; + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); REG_IZ += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -1767,8 +1767,8 @@ void hd61700_cpu_device::execute_run() case 0xac: //lddw { - UINT8 arg = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); REG_IX += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -1781,8 +1781,8 @@ void hd61700_cpu_device::execute_run() case 0xad: //lddw { - UINT8 arg = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); REG_IZ += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -1796,7 +1796,7 @@ void hd61700_cpu_device::execute_run() case 0xae: //ppsw case 0xaf: //ppuw { - UINT8 arg = read_op(); + uint8_t arg = read_op(); WRITE_REG(arg, pop((op&1) ? REG_US : REG_SS)); WRITE_REG(arg+1, pop((op&1) ? REG_US : REG_SS)); @@ -1814,8 +1814,8 @@ void hd61700_cpu_device::execute_run() case 0xb6: //jr nlz case 0xb7: //unconditional jr { - UINT8 arg = read_op(); - UINT32 new_pc = m_pc-1 + get_im_7(arg); + uint8_t arg = read_op(); + uint32_t new_pc = m_pc-1 + get_im_7(arg); if (check_cond(op)) set_pc(new_pc); @@ -1826,13 +1826,13 @@ void hd61700_cpu_device::execute_run() case 0xb8: //adcw case 0xbc: //adw { - UINT8 arg = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); - UINT16 offset = REG_IX + ((arg & 0x80) ? -ir_inc : +ir_inc); + uint16_t offset = REG_IX + ((arg & 0x80) ? -ir_inc : +ir_inc); - UINT16 src0 = mem_readbyte(REG_UA>>4, offset) + READ_REG(arg); - UINT16 src1 = mem_readbyte(REG_UA>>4, offset+1) + READ_REG(arg+1) + ((src0>0xff) ? 1 : 0); + uint16_t src0 = mem_readbyte(REG_UA>>4, offset) + READ_REG(arg); + uint16_t src1 = mem_readbyte(REG_UA>>4, offset+1) + READ_REG(arg+1) + ((src0>0xff) ? 1 : 0); if (op&0x04) { @@ -1852,13 +1852,13 @@ void hd61700_cpu_device::execute_run() case 0xba: //sbcw case 0xbe: //sbw { - UINT8 arg = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); - UINT16 offset = REG_IX + ((arg & 0x80) ? -ir_inc : +ir_inc); + uint16_t offset = REG_IX + ((arg & 0x80) ? -ir_inc : +ir_inc); - UINT16 src0 = mem_readbyte(REG_UA>>4, offset) - READ_REG(arg); - UINT16 src1 = mem_readbyte(REG_UA>>4, offset+1) - READ_REG(arg+1) - ((src0>0xff) ? 1 : 0); + uint16_t src0 = mem_readbyte(REG_UA>>4, offset) - READ_REG(arg); + uint16_t src1 = mem_readbyte(REG_UA>>4, offset+1) - READ_REG(arg+1) - ((src0>0xff) ? 1 : 0); if (op&0x04) { @@ -1878,13 +1878,13 @@ void hd61700_cpu_device::execute_run() case 0xb9: //adcw case 0xbd: //adw { - UINT8 arg = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); - UINT16 offset = REG_IZ + ((arg & 0x80) ? -ir_inc : +ir_inc); + uint16_t offset = REG_IZ + ((arg & 0x80) ? -ir_inc : +ir_inc); - UINT16 src0 = mem_readbyte(REG_UA>>6, offset) + READ_REG(arg); - UINT16 src1 = mem_readbyte(REG_UA>>6, offset+1) + READ_REG(arg+1) + ((src0>0xff) ? 1 : 0); + uint16_t src0 = mem_readbyte(REG_UA>>6, offset) + READ_REG(arg); + uint16_t src1 = mem_readbyte(REG_UA>>6, offset+1) + READ_REG(arg+1) + ((src0>0xff) ? 1 : 0); if (op&0x04) { @@ -1904,13 +1904,13 @@ void hd61700_cpu_device::execute_run() case 0xbb: //sbcw case 0xbf: //sbw { - UINT8 arg = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); - UINT16 offset = REG_IZ + ((arg & 0x80) ? -ir_inc : +ir_inc); + uint16_t offset = REG_IZ + ((arg & 0x80) ? -ir_inc : +ir_inc); - UINT16 src0 = mem_readbyte(REG_UA>>6, offset) - READ_REG(arg); - UINT16 src1 = mem_readbyte(REG_UA>>6, offset+1) - READ_REG(arg+1) - ((src0>0xff) ? 1 : 0); + uint16_t src0 = mem_readbyte(REG_UA>>6, offset) - READ_REG(arg); + uint16_t src1 = mem_readbyte(REG_UA>>6, offset+1) - READ_REG(arg+1) - ((src0>0xff) ? 1 : 0); if (op&0x04) { @@ -1932,12 +1932,12 @@ void hd61700_cpu_device::execute_run() case 0xc8: //adbm case 0xc9: //sbbm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 dst = arg; - UINT8 src = get_sir_im8(arg, arg1); - UINT8 c, f; - UINT16 res = 0; + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t dst = arg; + uint8_t src = get_sir_im8(arg, arg1); + uint8_t c, f; + uint16_t res = 0; c = f = 0; for (int n=GET_IM3(arg1); n>0; n--) @@ -1969,10 +1969,10 @@ void hd61700_cpu_device::execute_run() case 0xc2: //ldm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 dst = arg; - UINT8 src = get_sir_im8(arg, arg1); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t dst = arg; + uint8_t src = get_sir_im8(arg, arg1); for (int n=GET_IM3(arg1); n>0; n--) { @@ -1994,11 +1994,11 @@ void hd61700_cpu_device::execute_run() case 0xce: //orm case 0xcf: //xrm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 dst = arg; - UINT8 src = get_sir_im8(arg, arg1); - UINT8 res = 0, f = 0; + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t dst = arg; + uint8_t src = get_sir_im8(arg, arg1); + uint8_t res = 0, f = 0; for (int n=GET_IM3(arg1); n>0; n--) { @@ -2028,11 +2028,11 @@ void hd61700_cpu_device::execute_run() case 0xca: //adbm case 0xcb: //sbbm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 dst = arg; - UINT16 res = 0; - UINT8 src, f; + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t dst = arg; + uint16_t res = 0; + uint8_t src, f; src = arg1 & 0x1f; f = 0; @@ -2065,8 +2065,8 @@ void hd61700_cpu_device::execute_run() case 0xd0: //stw { - UINT8 arg = read_op(); - UINT16 offset = REG_GET16(READ_SREG(arg)); + uint8_t arg = read_op(); + uint16_t offset = REG_GET16(READ_SREG(arg)); mem_writebyte(REG_UA>>4, offset+0, read_op()); mem_writebyte(REG_UA>>4, offset+1, read_op()); @@ -2077,9 +2077,9 @@ void hd61700_cpu_device::execute_run() case 0xd1: //ldw { - UINT8 arg = read_op(); - UINT8 reg0 = read_op(); - UINT8 reg1 = read_op(); + uint8_t arg = read_op(); + uint8_t reg0 = read_op(); + uint8_t reg1 = read_op(); WRITE_REG(arg+0, reg0); WRITE_REG(arg+1, reg1); @@ -2089,8 +2089,8 @@ void hd61700_cpu_device::execute_run() case 0xd2: //stlm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); for (int n=GET_IM3(arg1); n>0; n--) { @@ -2106,9 +2106,9 @@ void hd61700_cpu_device::execute_run() case 0xd3: //ldlm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 src; + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t src; for (int n=GET_IM3(arg1); n>0; n--) { @@ -2126,10 +2126,10 @@ void hd61700_cpu_device::execute_run() case 0xd6: //pre case 0xd7: //pre { - UINT8 arg = read_op(); - UINT8 lsb = read_op(); - UINT8 msb = read_op(); - UINT8 idx = GET_REG_IDX(op, arg); + uint8_t arg = read_op(); + uint8_t lsb = read_op(); + uint8_t msb = read_op(); + uint8_t idx = GET_REG_IDX(op, arg); if (idx < 5) m_reg16bit[idx] = (msb<<8) | lsb; @@ -2141,7 +2141,7 @@ void hd61700_cpu_device::execute_run() case 0xd8: //bup case 0xd9: //bdn { - UINT8 src; + uint8_t src; for(;;) { src = mem_readbyte(REG_UA>>4, REG_IX); @@ -2161,14 +2161,14 @@ void hd61700_cpu_device::execute_run() case 0xda: { - UINT8 arg = read_op(); - UINT8 op1 = (arg>>5) & 0x03; + uint8_t arg = read_op(); + uint8_t op1 = (arg>>5) & 0x03; switch (op1) { case 0x00: //didm { - UINT8 arg1 = read_op(); - UINT8 r1 = 0, r2 = 0; + uint8_t arg1 = read_op(); + uint8_t r1 = 0, r2 = 0; for (int n=GET_IM3(arg1); n>0; n--) { @@ -2187,8 +2187,8 @@ void hd61700_cpu_device::execute_run() case 0x01: //dium { - UINT8 arg1 = read_op(); - UINT8 r1 = 0, r2 = 0; + uint8_t arg1 = read_op(); + uint8_t r1 = 0, r2 = 0; for (int n=GET_IM3(arg1); n>0; n--) { @@ -2207,8 +2207,8 @@ void hd61700_cpu_device::execute_run() case 0x02: //bydm { - UINT8 arg1 = read_op(); - UINT8 r1 = 0, r2 = 0, f = 0; + uint8_t arg1 = read_op(); + uint8_t r1 = 0, r2 = 0, f = 0; for (int n=GET_IM3(arg1); n>0; n--) { @@ -2227,8 +2227,8 @@ void hd61700_cpu_device::execute_run() case 0x03: //byum { - UINT8 arg1 = read_op(); - UINT8 r1 = 0, r2 = 0, f = 0; + uint8_t arg1 = read_op(); + uint8_t r1 = 0, r2 = 0, f = 0; for (int n=GET_IM3(arg1); n>0; n--) { @@ -2250,9 +2250,9 @@ void hd61700_cpu_device::execute_run() case 0xdb: //cmpm/invm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 r1 = 0, r2, f = 0; + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t r1 = 0, r2, f = 0; r2 = (arg&0x40) ? 0 : 1; @@ -2278,8 +2278,8 @@ void hd61700_cpu_device::execute_run() case 0xdc: //sup case 0xdd: //sdn { - UINT8 arg = read_op(); - UINT16 res; + uint8_t arg = read_op(); + uint16_t res; for(;;) { @@ -2303,7 +2303,7 @@ void hd61700_cpu_device::execute_run() case 0xde: //jp { - UINT8 arg = read_op(); + uint8_t arg = read_op(); set_pc(REG_GET16(arg)); m_icount -= 5; @@ -2312,10 +2312,10 @@ void hd61700_cpu_device::execute_run() case 0xdf: //jp { - UINT8 arg = read_op(); - UINT16 offset = REG_GET16(arg); - UINT8 lsb = mem_readbyte(REG_UA>>4, offset+0); - UINT8 msb = mem_readbyte(REG_UA>>4, offset+1); + uint8_t arg = read_op(); + uint16_t offset = REG_GET16(arg); + uint8_t lsb = mem_readbyte(REG_UA>>4, offset+0); + uint8_t msb = mem_readbyte(REG_UA>>4, offset+1); set_pc((msb<<8) | lsb); @@ -2326,10 +2326,10 @@ void hd61700_cpu_device::execute_run() case 0xe0: //stm case 0xe2: //stim { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT16 prev_ir = REG_IX; - UINT8 ir_inc = READ_REG(get_sir_im8(arg, arg1)); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint16_t prev_ir = REG_IX; + uint8_t ir_inc = READ_REG(get_sir_im8(arg, arg1)); REG_IX += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -2348,10 +2348,10 @@ void hd61700_cpu_device::execute_run() case 0xe1: //stm case 0xe3: //stim { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT16 prev_ir = REG_IZ; - UINT8 ir_inc = READ_REG(get_sir_im8(arg, arg1)); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint16_t prev_ir = REG_IZ; + uint8_t ir_inc = READ_REG(get_sir_im8(arg, arg1)); REG_IZ += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -2369,9 +2369,9 @@ void hd61700_cpu_device::execute_run() case 0xe4: //stdm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg, arg1)); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg, arg1)); REG_IX += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -2389,9 +2389,9 @@ void hd61700_cpu_device::execute_run() case 0xe5: //stdm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg, arg1)); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg, arg1)); REG_IZ += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -2410,8 +2410,8 @@ void hd61700_cpu_device::execute_run() case 0xe6: //phsm case 0xe7: //phum { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); for (int n=GET_IM3(arg1); n>0; n--) { @@ -2427,10 +2427,10 @@ void hd61700_cpu_device::execute_run() case 0xe8: //ldm case 0xea: //ldim { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT16 prev_ir = REG_IX; - UINT8 ir_inc = READ_REG(get_sir_im8(arg, arg1)); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint16_t prev_ir = REG_IX; + uint8_t ir_inc = READ_REG(get_sir_im8(arg, arg1)); REG_IX += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -2449,10 +2449,10 @@ void hd61700_cpu_device::execute_run() case 0xe9: //ldm case 0xeb: //ldim { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT16 prev_ir = REG_IZ; - UINT8 ir_inc = READ_REG(get_sir_im8(arg, arg1)); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint16_t prev_ir = REG_IZ; + uint8_t ir_inc = READ_REG(get_sir_im8(arg, arg1)); REG_IZ += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -2470,9 +2470,9 @@ void hd61700_cpu_device::execute_run() case 0xec: //lddm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg, arg1)); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg, arg1)); REG_IX += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -2490,9 +2490,9 @@ void hd61700_cpu_device::execute_run() case 0xed: //lddm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg, arg1)); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg, arg1)); REG_IZ += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -2511,8 +2511,8 @@ void hd61700_cpu_device::execute_run() case 0xee: //ppsm case 0xef: //ppum { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); for (int n=GET_IM3(arg1); n>0; n--) { @@ -2535,8 +2535,8 @@ void hd61700_cpu_device::execute_run() { if (check_cond(op)) { - UINT8 lsb = pop(REG_SS) ; - UINT8 msb = pop(REG_SS); + uint8_t lsb = pop(REG_SS) ; + uint8_t msb = pop(REG_SS); set_pc((((msb<<8) | (lsb<<0)) + 1)); } @@ -2565,8 +2565,8 @@ void hd61700_cpu_device::execute_run() case 0xfd: //rtni { - UINT8 lsb = pop(REG_SS); - UINT8 msb = pop(REG_SS); + uint8_t lsb = pop(REG_SS); + uint8_t msb = pop(REG_SS); set_pc((msb<<8) | (lsb<<0)); @@ -2576,7 +2576,7 @@ void hd61700_cpu_device::execute_run() case 0xfc: //cani { - for (UINT8 arg=0x10; arg>0; arg>>=1) + for (uint8_t arg=0x10; arg>0; arg>>=1) { if (REG_IB & arg) { @@ -2733,7 +2733,7 @@ void hd61700_cpu_device::execute_set_input(int inputnum, int state) // INLINE HELPERS //************************************************************************** -inline void hd61700_cpu_device::set_pc(INT32 new_pc) +inline void hd61700_cpu_device::set_pc(int32_t new_pc) { m_curpc = (m_curpc & 0x30000) | new_pc; m_pc = new_pc & 0xffff; @@ -2741,10 +2741,10 @@ inline void hd61700_cpu_device::set_pc(INT32 new_pc) m_fetch_addr = new_pc<<1; } -inline UINT8 hd61700_cpu_device::read_op() +inline uint8_t hd61700_cpu_device::read_op() { - UINT16 data; - UINT32 addr18 = make_18bit_addr((m_irq_status) ? 0 : prev_ua, m_pc); + uint16_t data; + uint32_t addr18 = make_18bit_addr((m_irq_status) ? 0 : prev_ua, m_pc); if (m_pc <= INT_ROM) { @@ -2772,38 +2772,38 @@ inline UINT8 hd61700_cpu_device::read_op() return (data&0xff); } -inline UINT8 hd61700_cpu_device::mem_readbyte(UINT8 segment, UINT16 offset) +inline uint8_t hd61700_cpu_device::mem_readbyte(uint8_t segment, uint16_t offset) { return m_program->read_word(make_18bit_addr(segment, offset)<<1) & 0xff; } -inline void hd61700_cpu_device::mem_writebyte(UINT8 segment, UINT16 offset, UINT8 data) +inline void hd61700_cpu_device::mem_writebyte(uint8_t segment, uint16_t offset, uint8_t data) { m_program->write_word(make_18bit_addr(segment, offset)<<1, data); } -inline UINT32 hd61700_cpu_device::make_18bit_addr(UINT8 segment, UINT16 offset) +inline uint32_t hd61700_cpu_device::make_18bit_addr(uint8_t segment, uint16_t offset) { if (offset >= ((REG_IB>>6) & 0x03) * 0x4000) - return (UINT32)((offset | ((segment&0x03)<<16)) & 0x3ffff); + return (uint32_t)((offset | ((segment&0x03)<<16)) & 0x3ffff); else return offset; } -inline void hd61700_cpu_device::push(UINT16 &offset, UINT8 data) +inline void hd61700_cpu_device::push(uint16_t &offset, uint8_t data) { offset--; mem_writebyte(REG_UA>>2, offset, data); } -inline UINT8 hd61700_cpu_device::pop(UINT16 &offset) +inline uint8_t hd61700_cpu_device::pop(uint16_t &offset) { - UINT8 data = mem_readbyte(REG_UA>>2, offset); + uint8_t data = mem_readbyte(REG_UA>>2, offset); offset++; return data; } -inline int hd61700_cpu_device::check_cond(UINT32 op) +inline int hd61700_cpu_device::check_cond(uint32_t op) { switch ( op & 0x07 ) { @@ -2849,7 +2849,7 @@ inline int hd61700_cpu_device::check_cond(UINT32 op) return 0; } -inline UINT8 hd61700_cpu_device::make_logic(UINT8 type, UINT8 d1, UINT8 d2) +inline uint8_t hd61700_cpu_device::make_logic(uint8_t type, uint8_t d1, uint8_t d2) { switch (type&3) { @@ -2866,26 +2866,26 @@ inline UINT8 hd61700_cpu_device::make_logic(UINT8 type, UINT8 d1, UINT8 d2) } } -inline void hd61700_cpu_device::check_optional_jr(UINT8 arg) +inline void hd61700_cpu_device::check_optional_jr(uint8_t arg) { if (arg & 0x80) { if (m_pc < INT_ROM && WORD_ALIGNED(m_fetch_addr)) read_op(); - UINT8 arg1 = read_op(); + uint8_t arg1 = read_op(); - UINT32 new_pc = m_pc + get_im_7(arg1) - 1; + uint32_t new_pc = m_pc + get_im_7(arg1) - 1; set_pc(new_pc); m_icount -= 3; } } -inline UINT8 hd61700_cpu_device::get_sir_im8(UINT8 arg) +inline uint8_t hd61700_cpu_device::get_sir_im8(uint8_t arg) { if (((arg>>5) & 0x03) == 0x03) { - UINT8 arg1 = read_op(); + uint8_t arg1 = read_op(); return arg1&0x1f; } @@ -2895,7 +2895,7 @@ inline UINT8 hd61700_cpu_device::get_sir_im8(UINT8 arg) } } -inline UINT8 hd61700_cpu_device::get_sir_im8(UINT8 arg, UINT8 arg1) +inline uint8_t hd61700_cpu_device::get_sir_im8(uint8_t arg, uint8_t arg1) { if (((arg>>5) & 0x03) == 0x03) { @@ -2907,7 +2907,7 @@ inline UINT8 hd61700_cpu_device::get_sir_im8(UINT8 arg, UINT8 arg1) } } -inline int hd61700_cpu_device::get_sign_mreg(UINT8 arg) +inline int hd61700_cpu_device::get_sign_mreg(uint8_t arg) { int res = READ_REG(get_sir_im8(arg)); @@ -2916,7 +2916,7 @@ inline int hd61700_cpu_device::get_sign_mreg(UINT8 arg) return res; } -inline int hd61700_cpu_device::get_sign_im8(UINT8 arg) +inline int hd61700_cpu_device::get_sign_im8(uint8_t arg) { int res = read_op(); @@ -2925,7 +2925,7 @@ inline int hd61700_cpu_device::get_sign_im8(UINT8 arg) return res; } -inline int hd61700_cpu_device::get_im_7(UINT8 data) +inline int hd61700_cpu_device::get_im_7(uint8_t data) { if (data&0x80) return 0x80 - data; @@ -2933,10 +2933,10 @@ inline int hd61700_cpu_device::get_im_7(UINT8 data) return data; } -inline UINT16 hd61700_cpu_device::make_bcd_sub(UINT8 arg1, UINT8 arg2) +inline uint16_t hd61700_cpu_device::make_bcd_sub(uint8_t arg1, uint8_t arg2) { - UINT32 ret = (arg1&0x0f) - (arg2&0x0f); - UINT8 carry; + uint32_t ret = (arg1&0x0f) - (arg2&0x0f); + uint8_t carry; if (ret > 0x09) { @@ -2961,10 +2961,10 @@ inline UINT16 hd61700_cpu_device::make_bcd_sub(UINT8 arg1, UINT8 arg2) return ret; } -inline UINT16 hd61700_cpu_device::make_bcd_add(UINT8 arg1, UINT8 arg2) +inline uint16_t hd61700_cpu_device::make_bcd_add(uint8_t arg1, uint8_t arg2) { - UINT32 ret = (arg1&0x0f) + (arg2&0x0f); - UINT8 carry; + uint32_t ret = (arg1&0x0f) + (arg2&0x0f); + uint8_t carry; if (ret > 0x09) { |