diff options
Diffstat (limited to 'src/devices/cpu/tms7000/tms7000op.cpp')
-rw-r--r-- | src/devices/cpu/tms7000/tms7000op.cpp | 202 |
1 files changed, 101 insertions, 101 deletions
diff --git a/src/devices/cpu/tms7000/tms7000op.cpp b/src/devices/cpu/tms7000/tms7000op.cpp index 24880caafe8..dcc2db25a44 100644 --- a/src/devices/cpu/tms7000/tms7000op.cpp +++ b/src/devices/cpu/tms7000/tms7000op.cpp @@ -33,7 +33,7 @@ void tms7000_device::am_b(op_func op) void tms7000_device::am_r(op_func op) { m_icount -= 7; - UINT8 r = imm8(); + uint8_t r = imm8(); AM_WB(write_r8, r, read_r8(r), 0); } @@ -52,14 +52,14 @@ void tms7000_device::am_a2b(op_func op) void tms7000_device::am_a2p(op_func op) { m_icount -= 10; - UINT8 r = imm8(); + uint8_t r = imm8(); AM_WB(write_p, r, read_p(r), read_r8(0)); } void tms7000_device::am_a2r(op_func op) { m_icount -= 8; - UINT8 r = imm8(); + uint8_t r = imm8(); AM_WB(write_r8, r, read_r8(r), read_r8(0)); } @@ -78,14 +78,14 @@ void tms7000_device::am_b2b(op_func op) void tms7000_device::am_b2r(op_func op) { m_icount -= 7; - UINT8 r = imm8(); + uint8_t r = imm8(); AM_WB(write_r8, r, read_r8(r), read_r8(1)); } void tms7000_device::am_b2p(op_func op) { m_icount -= 9; - UINT8 r = imm8(); + uint8_t r = imm8(); AM_WB(write_p, r, read_p(r), read_r8(1)); } @@ -104,8 +104,8 @@ void tms7000_device::am_r2b(op_func op) void tms7000_device::am_r2r(op_func op) { m_icount -= 10; - UINT8 param2 = read_r8(imm8()); - UINT8 r = imm8(); + uint8_t param2 = read_r8(imm8()); + uint8_t r = imm8(); AM_WB(write_r8, r, read_r8(r), param2); } @@ -124,16 +124,16 @@ void tms7000_device::am_i2b(op_func op) void tms7000_device::am_i2r(op_func op) { m_icount -= 9; - UINT8 param2 = imm8(); - UINT8 r = imm8(); + uint8_t param2 = imm8(); + uint8_t r = imm8(); AM_WB(write_r8, r, read_r8(r), param2); } void tms7000_device::am_i2p(op_func op) { m_icount -= 11; - UINT8 param2 = imm8(); - UINT8 r = imm8(); + uint8_t param2 = imm8(); + uint8_t r = imm8(); AM_WB(write_p, r, read_p(r), param2); } @@ -153,177 +153,177 @@ void tms7000_device::am_p2b(op_func op) // common opcodes // 1 param -int tms7000_device::op_clr(UINT8 param1, UINT8 param2) +int tms7000_device::op_clr(uint8_t param1, uint8_t param2) { - UINT8 t = 0; + uint8_t t = 0; SET_CNZ(t); return t; } -int tms7000_device::op_dec(UINT8 param1, UINT8 param2) +int tms7000_device::op_dec(uint8_t param1, uint8_t param2) { - UINT16 t = param1 - 1; + uint16_t t = param1 - 1; SET_NZ(t); SET_C(~t); return t; } -int tms7000_device::op_inc(UINT8 param1, UINT8 param2) +int tms7000_device::op_inc(uint8_t param1, uint8_t param2) { - UINT16 t = param1 + 1; + uint16_t t = param1 + 1; SET_CNZ(t); return t; } -int tms7000_device::op_inv(UINT8 param1, UINT8 param2) +int tms7000_device::op_inv(uint8_t param1, uint8_t param2) { - UINT8 t = ~param1; + uint8_t t = ~param1; SET_CNZ(t); return t; } -int tms7000_device::op_rl(UINT8 param1, UINT8 param2) +int tms7000_device::op_rl(uint8_t param1, uint8_t param2) { - UINT16 t = param1 << 1 | param1 >> 7; + uint16_t t = param1 << 1 | param1 >> 7; SET_CNZ(t); return t; } -int tms7000_device::op_rlc(UINT8 param1, UINT8 param2) +int tms7000_device::op_rlc(uint8_t param1, uint8_t param2) { - UINT16 t = param1 << 1 | GET_C(); + uint16_t t = param1 << 1 | GET_C(); SET_CNZ(t); return t; } -int tms7000_device::op_rr(UINT8 param1, UINT8 param2) +int tms7000_device::op_rr(uint8_t param1, uint8_t param2) { - UINT16 t = param1 >> 1 | param1 << 8 | (param1 << 7 & 0x80); + uint16_t t = param1 >> 1 | param1 << 8 | (param1 << 7 & 0x80); SET_CNZ(t); return t; } -int tms7000_device::op_rrc(UINT8 param1, UINT8 param2) +int tms7000_device::op_rrc(uint8_t param1, uint8_t param2) { - UINT16 t = param1 >> 1 | param1 << 8 | GET_C() << 7; + uint16_t t = param1 >> 1 | param1 << 8 | GET_C() << 7; SET_CNZ(t); return t; } -int tms7000_device::op_swap(UINT8 param1, UINT8 param2) +int tms7000_device::op_swap(uint8_t param1, uint8_t param2) { m_icount -= 3; - UINT16 t = param1 >> 4 | param1 << 4; + uint16_t t = param1 >> 4 | param1 << 4; SET_CNZ(t); return t; } -int tms7000_device::op_xchb(UINT8 param1, UINT8 param2) +int tms7000_device::op_xchb(uint8_t param1, uint8_t param2) { m_icount -= 1; - UINT8 t = read_r8(1); + uint8_t t = read_r8(1); SET_CNZ(t); write_r8(1, param1); return t; } // 2 params -int tms7000_device::op_adc(UINT8 param1, UINT8 param2) +int tms7000_device::op_adc(uint8_t param1, uint8_t param2) { - UINT16 t = param1 + param2 + GET_C(); + uint16_t t = param1 + param2 + GET_C(); SET_CNZ(t); return t; } -int tms7000_device::op_add(UINT8 param1, UINT8 param2) +int tms7000_device::op_add(uint8_t param1, uint8_t param2) { - UINT16 t = param1 + param2; + uint16_t t = param1 + param2; SET_CNZ(t); return t; } -int tms7000_device::op_and(UINT8 param1, UINT8 param2) +int tms7000_device::op_and(uint8_t param1, uint8_t param2) { - UINT8 t = param1 & param2; + uint8_t t = param1 & param2; SET_CNZ(t); return t; } -int tms7000_device::op_cmp(UINT8 param1, UINT8 param2) +int tms7000_device::op_cmp(uint8_t param1, uint8_t param2) { - UINT16 t = param1 - param2; + uint16_t t = param1 - param2; SET_NZ(t); SET_C(~t); return WB_NO; } -int tms7000_device::op_mpy(UINT8 param1, UINT8 param2) +int tms7000_device::op_mpy(uint8_t param1, uint8_t param2) { m_icount -= 39; - UINT16 t = param1 * param2; + uint16_t t = param1 * param2; SET_CNZ(t >> 8); write_mem16(0, t); // always writes result to regs A-B return WB_NO; } -int tms7000_device::op_mov(UINT8 param1, UINT8 param2) +int tms7000_device::op_mov(uint8_t param1, uint8_t param2) { - UINT8 t = param2; + uint8_t t = param2; SET_CNZ(t); return t; } -int tms7000_device::op_or(UINT8 param1, UINT8 param2) +int tms7000_device::op_or(uint8_t param1, uint8_t param2) { - UINT8 t = param1 | param2; + uint8_t t = param1 | param2; SET_CNZ(t); return t; } -int tms7000_device::op_sbb(UINT8 param1, UINT8 param2) +int tms7000_device::op_sbb(uint8_t param1, uint8_t param2) { - UINT16 t = param1 - param2 - (!GET_C()); + uint16_t t = param1 - param2 - (!GET_C()); SET_NZ(t); SET_C(~t); return t; } -int tms7000_device::op_sub(UINT8 param1, UINT8 param2) +int tms7000_device::op_sub(uint8_t param1, uint8_t param2) { - UINT16 t = param1 - param2; + uint16_t t = param1 - param2; SET_NZ(t); SET_C(~t); return t; } -int tms7000_device::op_xor(UINT8 param1, UINT8 param2) +int tms7000_device::op_xor(uint8_t param1, uint8_t param2) { - UINT8 t = param1 ^ param2; + uint8_t t = param1 ^ param2; SET_CNZ(t); return t; } // BCD arthrimetic handling -static const UINT8 lut_bcd_out[6] = { 0x00, 0x06, 0x00, 0x66, 0x60, 0x66 }; +static const uint8_t lut_bcd_out[6] = { 0x00, 0x06, 0x00, 0x66, 0x60, 0x66 }; -int tms7000_device::op_dac(UINT8 param1, UINT8 param2) +int tms7000_device::op_dac(uint8_t param1, uint8_t param2) { m_icount -= 2; int c = GET_C(); - UINT8 h1 = param1 >> 4 & 0xf; - UINT8 l1 = param1 >> 0 & 0xf; - UINT8 h2 = param2 >> 4 & 0xf; - UINT8 l2 = param2 >> 0 & 0xf; + uint8_t h1 = param1 >> 4 & 0xf; + uint8_t l1 = param1 >> 0 & 0xf; + uint8_t h2 = param2 >> 4 & 0xf; + uint8_t l2 = param2 >> 0 & 0xf; // compute bcd constant - UINT8 d = ((l1 + l2 + c) < 10) ? 0 : 1; + uint8_t d = ((l1 + l2 + c) < 10) ? 0 : 1; if ((h1 + h2) == 9) d |= 2; else if ((h1 + h2) > 9) d |= 4; - UINT8 t = param1 + param2 + c + lut_bcd_out[d]; + uint8_t t = param1 + param2 + c + lut_bcd_out[d]; SET_CNZ(t); if (d > 2) m_sr |= SR_C; @@ -331,24 +331,24 @@ int tms7000_device::op_dac(UINT8 param1, UINT8 param2) return t; } -int tms7000_device::op_dsb(UINT8 param1, UINT8 param2) +int tms7000_device::op_dsb(uint8_t param1, uint8_t param2) { m_icount -= 2; int c = !GET_C(); - UINT8 h1 = param1 >> 4 & 0xf; - UINT8 l1 = param1 >> 0 & 0xf; - UINT8 h2 = param2 >> 4 & 0xf; - UINT8 l2 = param2 >> 0 & 0xf; + uint8_t h1 = param1 >> 4 & 0xf; + uint8_t l1 = param1 >> 0 & 0xf; + uint8_t h2 = param2 >> 4 & 0xf; + uint8_t l2 = param2 >> 0 & 0xf; // compute bcd constant - UINT8 d = ((l1 - c) >= l2) ? 0 : 1; + uint8_t d = ((l1 - c) >= l2) ? 0 : 1; if (h1 == h2) d |= 2; else if (h1 < h2) d |= 4; - UINT8 t = param1 - param2 - c - lut_bcd_out[d]; + uint8_t t = param1 - param2 - c - lut_bcd_out[d]; SET_CNZ(t); if (d <= 2) m_sr |= SR_C; @@ -360,7 +360,7 @@ int tms7000_device::op_dsb(UINT8 param1, UINT8 param2) void tms7000_device::shortbranch(bool check) { m_icount -= 2; - INT8 d = (INT8)imm8(); + int8_t d = (int8_t)imm8(); if (check) { @@ -375,24 +375,24 @@ void tms7000_device::jmp(bool check) shortbranch(check); } -int tms7000_device::op_djnz(UINT8 param1, UINT8 param2) +int tms7000_device::op_djnz(uint8_t param1, uint8_t param2) { - UINT16 t = param1 - 1; + uint16_t t = param1 - 1; shortbranch(t != 0); return t; } -int tms7000_device::op_btjo(UINT8 param1, UINT8 param2) +int tms7000_device::op_btjo(uint8_t param1, uint8_t param2) { - UINT8 t = param1 & param2; + uint8_t t = param1 & param2; SET_CNZ(t); shortbranch(t != 0); return WB_NO; } -int tms7000_device::op_btjz(UINT8 param1, UINT8 param2) +int tms7000_device::op_btjz(uint8_t param1, uint8_t param2) { - UINT8 t = ~param1 & param2; + uint8_t t = ~param1 & param2; SET_CNZ(t); shortbranch(t != 0); return WB_NO; @@ -405,7 +405,7 @@ int tms7000_device::op_btjz(UINT8 param1, UINT8 param2) void tms7000_device::decd_a() { m_icount -= 9; - UINT32 t = read_r16(0) - 1; + uint32_t t = read_r16(0) - 1; write_r16(0, t); SET_NZ(t >> 8); SET_C(~(t >> 8)); @@ -414,7 +414,7 @@ void tms7000_device::decd_a() void tms7000_device::decd_b() { m_icount -= 9; - UINT32 t = read_r16(1) - 1; + uint32_t t = read_r16(1) - 1; write_r16(1, t); SET_NZ(t >> 8); SET_C(~(t >> 8)); @@ -423,8 +423,8 @@ void tms7000_device::decd_b() void tms7000_device::decd_r() { m_icount -= 11; - UINT8 r = imm8(); - UINT32 t = read_r16(r) - 1; + uint8_t r = imm8(); + uint32_t t = read_r16(r) - 1; write_r16(r, t); SET_NZ(t >> 8); SET_C(~(t >> 8)); @@ -434,7 +434,7 @@ void tms7000_device::decd_r() void tms7000_device::cmpa_dir() { m_icount -= 12; - UINT16 t = read_r8(0) - read_mem8(imm16()); + uint16_t t = read_r8(0) - read_mem8(imm16()); SET_NZ(t); SET_C(~t); } @@ -442,7 +442,7 @@ void tms7000_device::cmpa_dir() void tms7000_device::cmpa_inx() { m_icount -= 14; - UINT16 t = read_r8(0) - read_mem8(imm16() + read_r8(1)); + uint16_t t = read_r8(0) - read_mem8(imm16() + read_r8(1)); SET_NZ(t); SET_C(~t); } @@ -450,7 +450,7 @@ void tms7000_device::cmpa_inx() void tms7000_device::cmpa_ind() { m_icount -= 11; - UINT16 t = read_r8(0) - read_mem8(read_r16(imm8())); + uint16_t t = read_r8(0) - read_mem8(read_r16(imm8())); SET_NZ(t); SET_C(~t); } @@ -459,7 +459,7 @@ void tms7000_device::cmpa_ind() void tms7000_device::lda_dir() { m_icount -= 11; - UINT8 t = read_mem8(imm16()); + uint8_t t = read_mem8(imm16()); write_r8(0, t); SET_CNZ(t); } @@ -467,7 +467,7 @@ void tms7000_device::lda_dir() void tms7000_device::lda_inx() { m_icount -= 13; - UINT8 t = read_mem8(imm16() + read_r8(1)); + uint8_t t = read_mem8(imm16() + read_r8(1)); write_r8(0, t); SET_CNZ(t); } @@ -475,7 +475,7 @@ void tms7000_device::lda_inx() void tms7000_device::lda_ind() { m_icount -= 10; - UINT8 t = read_mem8(read_r16(imm8())); + uint8_t t = read_mem8(read_r16(imm8())); write_r8(0, t); SET_CNZ(t); } @@ -484,7 +484,7 @@ void tms7000_device::lda_ind() void tms7000_device::sta_dir() { m_icount -= 11; - UINT8 t = read_r8(0); + uint8_t t = read_r8(0); write_mem8(imm16(), t); SET_CNZ(t); } @@ -492,7 +492,7 @@ void tms7000_device::sta_dir() void tms7000_device::sta_inx() { m_icount -= 13; - UINT8 t = read_r8(0); + uint8_t t = read_r8(0); write_mem8(imm16() + read_r8(1), t); SET_CNZ(t); } @@ -500,7 +500,7 @@ void tms7000_device::sta_inx() void tms7000_device::sta_ind() { m_icount -= 10; - UINT8 t = read_r8(0); + uint8_t t = read_r8(0); write_mem8(read_r16(imm8()), t); SET_CNZ(t); } @@ -509,7 +509,7 @@ void tms7000_device::sta_ind() void tms7000_device::movd_dir() { m_icount -= 15; - UINT16 t = imm16(); + uint16_t t = imm16(); write_r16(imm8(), t); SET_CNZ(t >> 8); } @@ -517,7 +517,7 @@ void tms7000_device::movd_dir() void tms7000_device::movd_inx() { m_icount -= 17; - UINT16 t = imm16() + read_r8(1); + uint16_t t = imm16() + read_r8(1); write_r16(imm8(), t); SET_CNZ(t >> 8); } @@ -525,7 +525,7 @@ void tms7000_device::movd_inx() void tms7000_device::movd_ind() { m_icount -= 14; - UINT16 t = read_r16(imm8()); + uint16_t t = read_r16(imm8()); write_r16(imm8(), t); SET_CNZ(t >> 8); } @@ -553,7 +553,7 @@ void tms7000_device::br_ind() void tms7000_device::call_dir() { m_icount -= 14; - UINT16 t = imm16(); + uint16_t t = imm16(); push16(m_pc); m_pc = t; } @@ -561,7 +561,7 @@ void tms7000_device::call_dir() void tms7000_device::call_inx() { m_icount -= 16; - UINT16 t = imm16() + read_r8(1); + uint16_t t = imm16() + read_r8(1); push16(m_pc); m_pc = t; } @@ -569,12 +569,12 @@ void tms7000_device::call_inx() void tms7000_device::call_ind() { m_icount -= 13; - UINT16 t = read_r16(imm8()); + uint16_t t = read_r16(imm8()); push16(m_pc); m_pc = t; } -void tms7000_device::trap(UINT8 address) +void tms7000_device::trap(uint8_t address) { m_icount -= 14; push16(m_pc); @@ -599,7 +599,7 @@ void tms7000_device::rets() void tms7000_device::pop_a() { m_icount -= 6; - UINT8 t = pull8(); + uint8_t t = pull8(); write_r8(0, t); SET_CNZ(t); } @@ -607,7 +607,7 @@ void tms7000_device::pop_a() void tms7000_device::pop_b() { m_icount -= 6; - UINT8 t = pull8(); + uint8_t t = pull8(); write_r8(1, t); SET_CNZ(t); } @@ -615,7 +615,7 @@ void tms7000_device::pop_b() void tms7000_device::pop_r() { m_icount -= 8; - UINT8 t = pull8(); + uint8_t t = pull8(); write_r8(imm8(), t); SET_CNZ(t); } @@ -631,7 +631,7 @@ void tms7000_device::pop_st() void tms7000_device::push_a() { m_icount -= 6; - UINT8 t = read_r8(0); + uint8_t t = read_r8(0); push8(t); SET_CNZ(t); } @@ -639,7 +639,7 @@ void tms7000_device::push_a() void tms7000_device::push_b() { m_icount -= 6; - UINT8 t = read_r8(1); + uint8_t t = read_r8(1); push8(t); SET_CNZ(t); } @@ -647,7 +647,7 @@ void tms7000_device::push_b() void tms7000_device::push_r() { m_icount -= 8; - UINT8 t = read_r8(imm8()); + uint8_t t = read_r8(imm8()); push8(t); SET_CNZ(t); } @@ -712,13 +712,13 @@ void tms7020_exl_device::lvdp() m_icount -= 10; // TODO: check real timing imm8(); // always 0x28? discarded? read_p(0x28); - UINT8 t = read_p(0x24); + uint8_t t = read_p(0x24); write_r8(0, t); SET_CNZ(t); } // illegal opcode handling -void tms7000_device::illegal(UINT8 op) +void tms7000_device::illegal(uint8_t op) { m_icount -= 5; // guessed logerror("%s: illegal opcode $%02X @ $%04x\n", tag(), op, m_pc); |