diff options
author | 2016-10-22 13:13:17 +0200 | |
---|---|---|
committer | 2016-10-22 13:13:17 +0200 | |
commit | ddb290d5f615019c33c42b8d94e5a5254cabcf33 (patch) | |
tree | a70f688b0df3acd19da7b1151e5902e3c6af3fa5 /src/devices/cpu/lc8670 | |
parent | 333bff8de64dfaeb98134000412796b4fdef970b (diff) |
NOTICE (TYPE NAME CONSOLIDATION)
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8
also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
Diffstat (limited to 'src/devices/cpu/lc8670')
-rw-r--r-- | src/devices/cpu/lc8670/lc8670.cpp | 204 | ||||
-rw-r--r-- | src/devices/cpu/lc8670/lc8670.h | 86 | ||||
-rw-r--r-- | src/devices/cpu/lc8670/lc8670dsm.cpp | 6 |
3 files changed, 148 insertions, 148 deletions
diff --git a/src/devices/cpu/lc8670/lc8670.cpp b/src/devices/cpu/lc8670/lc8670.cpp index 9ea32374479..71e674c9221 100644 --- a/src/devices/cpu/lc8670/lc8670.cpp +++ b/src/devices/cpu/lc8670/lc8670.cpp @@ -144,7 +144,7 @@ const lc8670_cpu_device::op_handler lc8670_cpu_device::s_opcode_table[] = // IRQ vectors //************************************************************************** -const UINT16 lc8670_cpu_device::s_irq_vectors[] = +const uint16_t lc8670_cpu_device::s_irq_vectors[] = { 0x0000, 0x0003, 0x000b, 0x0013, 0x001b, 0x0023, 0x002b, 0x0033, 0x003b, 0x0043, 0x004b, 0x004f, 0x0052, 0x0055, 0x005a, 0x005d @@ -170,7 +170,7 @@ ADDRESS_MAP_END // lc8670_cpu_device - constructor //------------------------------------------------- -lc8670_cpu_device::lc8670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +lc8670_cpu_device::lc8670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, LC8670, "Sanyo LC8670", tag, owner, clock, "lc8670", __FILE__), m_program_config("program", ENDIANNESS_BIG, 8, 16, 0), m_data_config("data", ENDIANNESS_BIG, 8, 9, 0, ADDRESS_MAP_NAME(lc8670_internal_map)), @@ -554,7 +554,7 @@ void lc8670_cpu_device::execute_set_input(int inputnum, int state) // screen_update - handle updating the screen //------------------------------------------------- -UINT32 lc8670_cpu_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t lc8670_cpu_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_lcd_update_func) return m_lcd_update_func(*this, bitmap, cliprect, m_xram, (REG_MCR & 0x08) && (REG_VCCR & 0x80), REG_STAD); @@ -575,7 +575,7 @@ void lc8670_cpu_device::check_irqs() if (m_irq_flag && !m_after_reti) { int irq = 0; - UINT8 priority = 0; + uint8_t priority = 0; // highest priority IRQ if (!(REG_IE & 0x01) && (m_irq_flag & 0x02)) @@ -663,8 +663,8 @@ void lc8670_cpu_device::base_timer_tick() { if (REG_BTCR & 0x40) { - UINT16 base_counter_l = m_base_timer[0] + 1; - UINT16 base_counter_h = m_base_timer[1]; + uint16_t base_counter_l = m_base_timer[0] + 1; + uint16_t base_counter_h = m_base_timer[1]; if (REG_BTCR & 0x80) // 6-bit mode base_counter_h++; @@ -724,7 +724,7 @@ void lc8670_cpu_device::base_timer_tick() void lc8670_cpu_device::timer0_prescaler_tick() { - UINT16 prescaler = m_timer0_prescaler + 1; + uint16_t prescaler = m_timer0_prescaler + 1; if (prescaler & 0x100) { if (LOG_TIMERS) logerror("%s: timer0 prescaler overflow\n", tag()); @@ -755,7 +755,7 @@ void lc8670_cpu_device::timer0_tick(bool ext_line) // 16-bit timer/counter mode if ((REG_T0CNT & 0xc0) == 0xc0 && (((REG_T0CNT & 0x10) && ext_line) || (!(REG_T0CNT & 0x10) && !ext_line))) { - UINT32 timer0 = ((m_timer0[1] << 8) | m_timer0[0]) + 1; + uint32_t timer0 = ((m_timer0[1] << 8) | m_timer0[0]) + 1; if (timer0 & 0x10000) { @@ -778,7 +778,7 @@ void lc8670_cpu_device::timer0_tick(bool ext_line) // 8-bit timer/counter mode if ((REG_T0CNT & 0x40) && (((REG_T0CNT & 0x10) && ext_line) || (!(REG_T0CNT & 0x10) && !ext_line))) { - UINT16 timer0l = m_timer0[0] + 1; + uint16_t timer0l = m_timer0[0] + 1; if (timer0l & 0x100) { @@ -795,7 +795,7 @@ void lc8670_cpu_device::timer0_tick(bool ext_line) } if ((REG_T0CNT & 0x80) && !ext_line) { - UINT16 timer0h = m_timer0[1] + 1; + uint16_t timer0h = m_timer0[1] + 1; if (timer0h & 0x100) { if (LOG_TIMERS) logerror("%s: timer0 high overflow, IRQ: %d\n", tag(), BIT(REG_T0CNT,3)); @@ -826,10 +826,10 @@ void lc8670_cpu_device::timer1_tick() if (REG_T1CNT & 0x40) { // 16-bit timer mode - UINT16 timer1l = m_timer1[0] + (REG_T1CNT & 0x80 ? 1 : 2); + uint16_t timer1l = m_timer1[0] + (REG_T1CNT & 0x80 ? 1 : 2); if (timer1l & 0x100) { - UINT16 timer1h = m_timer1[1] + 1; + uint16_t timer1h = m_timer1[1] + 1; m_timer1[0] = REG_T1LR; REG_T1CNT |= 0x04; @@ -857,7 +857,7 @@ void lc8670_cpu_device::timer1_tick() // 8-bit timer/pulse generator mode if (REG_T1CNT & 0x40) { - UINT16 timer1l = m_timer1[0] + 1; + uint16_t timer1l = m_timer1[0] + 1; if (timer1l == m_timer1_comparator[0]) update_port1(m_p1_data | 0x80); @@ -878,7 +878,7 @@ void lc8670_cpu_device::timer1_tick() } if (REG_T1CNT & 0x80) { - UINT16 timer1h = m_timer1[1] + 1; + uint16_t timer1h = m_timer1[1] + 1; if (timer1h & 0x100) { @@ -916,7 +916,7 @@ READ8_MEMBER(lc8670_cpu_device::xram_r) { if (!(REG_VCCR & 0x40) || space.debugger_access()) // XRAM access enabled { - UINT8 * xram_bank = m_xram + (REG_XBNK & 0x03) * 0x60; + uint8_t * xram_bank = m_xram + (REG_XBNK & 0x03) * 0x60; switch(REG_XBNK & 0x03) { @@ -939,7 +939,7 @@ WRITE8_MEMBER(lc8670_cpu_device::xram_w) { if (!(REG_VCCR & 0x40) || space.debugger_access()) // XRAM access enabled { - UINT8 * xram_bank = m_xram + (REG_XBNK & 0x03) * 0x60; + uint8_t * xram_bank = m_xram + (REG_XBNK & 0x03) * 0x60; switch(REG_XBNK & 0x03) { @@ -976,10 +976,10 @@ READ8_MEMBER(lc8670_cpu_device::regs_r) return m_io->read_byte(LC8670_PORT7) | 0xf0; // 4-bit read-only port case 0x66: { - UINT8 data = m_vtrbf[((REG_VRMAD2<<8) | REG_VRMAD1) & 0x1ff]; + uint8_t data = m_vtrbf[((REG_VRMAD2<<8) | REG_VRMAD1) & 0x1ff]; if (!space.debugger_access() && (REG_VSEL & 0x10)) { - UINT16 vrmad = (REG_VRMAD1 | (REG_VRMAD2<<8)) + 1; + uint16_t vrmad = (REG_VRMAD1 | (REG_VRMAD2<<8)) + 1; REG_VRMAD1 = vrmad & 0xff; REG_VRMAD2 = (vrmad >> 8) & 0x01; } @@ -1046,7 +1046,7 @@ WRITE8_MEMBER(lc8670_cpu_device::regs_w) m_vtrbf[((REG_VRMAD2<<8) | REG_VRMAD1) & 0x1ff] = data; if (!space.debugger_access() && (REG_VSEL & 0x10)) { - UINT16 vrmad = (REG_VRMAD1 | (REG_VRMAD2<<8)) + 1; + uint16_t vrmad = (REG_VRMAD1 | (REG_VRMAD2<<8)) + 1; REG_VRMAD1 = vrmad & 0xff; REG_VRMAD2 = (vrmad >> 8) & 0x01; } @@ -1070,26 +1070,26 @@ WRITE8_MEMBER(lc8670_cpu_device::regs_w) // HELPERS //************************************************************************** -inline UINT8 lc8670_cpu_device::fetch() +inline uint8_t lc8670_cpu_device::fetch() { - UINT8 data = m_direct->read_byte(m_pc); + uint8_t data = m_direct->read_byte(m_pc); set_pc(m_pc + 1); return data; } -inline UINT8 lc8670_cpu_device::read_data(UINT16 offset) +inline uint8_t lc8670_cpu_device::read_data(uint16_t offset) { return m_data->read_byte(offset); } -inline void lc8670_cpu_device::write_data(UINT16 offset, UINT8 data) +inline void lc8670_cpu_device::write_data(uint16_t offset, uint8_t data) { m_data->write_byte(offset, data); } -inline UINT8 lc8670_cpu_device::read_data_latch(UINT16 offset) +inline uint8_t lc8670_cpu_device::read_data_latch(uint16_t offset) { if (offset == 0x144) return REG_P1; @@ -1099,7 +1099,7 @@ inline UINT8 lc8670_cpu_device::read_data_latch(UINT16 offset) return read_data(offset); } -inline void lc8670_cpu_device::write_data_latch(UINT16 offset, UINT8 data) +inline void lc8670_cpu_device::write_data_latch(uint16_t offset, uint8_t data) { if (offset == 0x144) REG_P1 = data; @@ -1109,34 +1109,34 @@ inline void lc8670_cpu_device::write_data_latch(UINT16 offset, UINT8 data) write_data(offset, data); } -inline void lc8670_cpu_device::update_port1(UINT8 data) +inline void lc8670_cpu_device::update_port1(uint8_t data) { m_p1_data = data; m_io->write_byte(LC8670_PORT1, ((REG_P1 | (m_p1_data & REG_P1FCR)) & REG_P1DDR) | (m_io->read_byte(LC8670_PORT1) & (REG_P1DDR ^ 0xff))); } -inline void lc8670_cpu_device::set_pc(UINT16 new_pc) +inline void lc8670_cpu_device::set_pc(uint16_t new_pc) { m_pc = new_pc; } -inline void lc8670_cpu_device::push(UINT8 data) +inline void lc8670_cpu_device::push(uint8_t data) { REG_SP++; m_mram[REG_SP] = data; } -inline UINT8 lc8670_cpu_device::pop() +inline uint8_t lc8670_cpu_device::pop() { - UINT8 data = m_mram[REG_SP]; + uint8_t data = m_mram[REG_SP]; REG_SP--; return data; } -inline UINT16 lc8670_cpu_device::get_addr() +inline uint16_t lc8670_cpu_device::get_addr() { int mode = m_op & 0x0f; - UINT16 addr; + uint16_t addr; if (mode > 0x01 && mode <= 0x03) addr = GET_D9; @@ -1148,10 +1148,10 @@ inline UINT16 lc8670_cpu_device::get_addr() return addr; } -inline UINT8 lc8670_cpu_device::get_data() +inline uint8_t lc8670_cpu_device::get_data() { int mode = m_op & 0x0f; - UINT8 data; + uint8_t data; if (mode == 0x01) data = GET_I8; @@ -1163,7 +1163,7 @@ inline UINT8 lc8670_cpu_device::get_data() inline void lc8670_cpu_device::change_clock_source() { - UINT32 new_clock = 0; + uint32_t new_clock = 0; switch(REG_OCR & 0x30) { @@ -1187,7 +1187,7 @@ inline void lc8670_cpu_device::change_clock_source() inline void lc8670_cpu_device::check_p_flag() { - UINT8 p_plag = 0; + uint8_t p_plag = 0; for(int i=0; i<8; i++) p_plag ^= BIT(REG_A, i); @@ -1216,7 +1216,7 @@ inline void lc8670_cpu_device::set_irq_flag(int source) m_irq_flag |= 1<<source; } -int lc8670_cpu_device::decode_op(UINT8 op) +int lc8670_cpu_device::decode_op(uint8_t op) { int idx; switch (op & 0x0f) @@ -1249,7 +1249,7 @@ int lc8670_cpu_device::op_nop() int lc8670_cpu_device::op_br() { - UINT8 r8 = GET_R8; + uint8_t r8 = GET_R8; set_pc(m_pc + SIGNED(r8)); return 2; @@ -1265,7 +1265,7 @@ int lc8670_cpu_device::op_ld() int lc8670_cpu_device::op_call() { - UINT16 new_pc = GET_A12; + uint16_t new_pc = GET_A12; push((m_pc>>0) & 0xff); push((m_pc>>8) & 0xff); @@ -1278,7 +1278,7 @@ int lc8670_cpu_device::op_call() int lc8670_cpu_device::op_callr() { - UINT16 r16 = fetch(); + uint16_t r16 = fetch(); r16 |= fetch()<<8; push((m_pc>>0) & 0xff); @@ -1290,7 +1290,7 @@ int lc8670_cpu_device::op_callr() int lc8670_cpu_device::op_brf() { - UINT16 r16 = fetch(); + uint16_t r16 = fetch(); r16 |= fetch()<<8; set_pc(m_pc - 1 + r16); @@ -1306,7 +1306,7 @@ int lc8670_cpu_device::op_st() int lc8670_cpu_device::op_callf() { - UINT16 a16 = fetch()<<8; + uint16_t a16 = fetch()<<8; a16 |= fetch(); push((m_pc>>0) & 0xff); @@ -1318,7 +1318,7 @@ int lc8670_cpu_device::op_callf() int lc8670_cpu_device::op_jmpf() { - UINT16 a16 = fetch()<<8; + uint16_t a16 = fetch()<<8; a16 |= fetch(); set_pc(a16); @@ -1329,8 +1329,8 @@ int lc8670_cpu_device::op_jmpf() int lc8670_cpu_device::op_mov() { - UINT16 addr = get_addr(); - UINT8 i8 = GET_I8; + uint16_t addr = get_addr(); + uint8_t i8 = GET_I8; write_data(addr, i8); return 1; @@ -1338,7 +1338,7 @@ int lc8670_cpu_device::op_mov() int lc8670_cpu_device::op_jmp() { - UINT16 new_pc = GET_A12; + uint16_t new_pc = GET_A12; set_pc((m_pc & 0xf000) | new_pc); return 2; @@ -1346,7 +1346,7 @@ int lc8670_cpu_device::op_jmp() int lc8670_cpu_device::op_mul() { - UINT32 res = REG_B * ((REG_A<<8) | REG_C); + uint32_t res = REG_B * ((REG_A<<8) | REG_C); REG_A = (res>>8) & 0xff; REG_B = (res>>16) & 0xff; @@ -1361,8 +1361,8 @@ int lc8670_cpu_device::op_mul() int lc8670_cpu_device::op_be() { - UINT8 data = get_data(); - UINT8 r8 = GET_R8; + uint8_t data = get_data(); + uint8_t r8 = GET_R8; if (REG_A == data) set_pc(m_pc + SIGNED(r8)); @@ -1374,9 +1374,9 @@ int lc8670_cpu_device::op_be() int lc8670_cpu_device::op_be_ri() { - UINT8 data = get_data(); - UINT8 i8 = GET_I8; - UINT8 r8 = GET_R8; + uint8_t data = get_data(); + uint8_t i8 = GET_I8; + uint8_t r8 = GET_R8; if (i8 == data) set_pc(m_pc + SIGNED(r8)); @@ -1389,11 +1389,11 @@ int lc8670_cpu_device::op_be_ri() int lc8670_cpu_device::op_div() { - UINT32 res, mod; + uint32_t res, mod; if (REG_B != 0) { - UINT16 v = ((REG_A<<8) | REG_C); + uint16_t v = ((REG_A<<8) | REG_C); res = v / REG_B; mod = v % REG_B; @@ -1416,8 +1416,8 @@ int lc8670_cpu_device::op_div() int lc8670_cpu_device::op_bne() { - UINT8 data = get_data(); - UINT8 r8 = GET_R8; + uint8_t data = get_data(); + uint8_t r8 = GET_R8; if (REG_A != data) set_pc(m_pc + SIGNED(r8)); @@ -1429,9 +1429,9 @@ int lc8670_cpu_device::op_bne() int lc8670_cpu_device::op_bne_ri() { - UINT8 data = get_data(); - UINT8 i8 = GET_I8; - UINT8 r8 = GET_R8; + uint8_t data = get_data(); + uint8_t i8 = GET_I8; + uint8_t r8 = GET_R8; if (i8 != data) set_pc(m_pc + SIGNED(r8)); @@ -1443,7 +1443,7 @@ int lc8670_cpu_device::op_bne_ri() int lc8670_cpu_device::op_ldf() { - UINT16 addr = REG_TRL | (REG_TRH<<8); + uint16_t addr = REG_TRL | (REG_TRH<<8); m_bankswitch_func(REG_FPR & 0x01 ? 2 : 1); REG_A = m_program->read_byte(addr); @@ -1455,7 +1455,7 @@ int lc8670_cpu_device::op_ldf() int lc8670_cpu_device::op_stf() { - UINT16 addr = REG_TRL | (REG_TRH<<8); + uint16_t addr = REG_TRL | (REG_TRH<<8); m_bankswitch_func(REG_FPR & 0x01 ? 2 : 1); m_program->write_byte(addr, REG_A); @@ -1466,9 +1466,9 @@ int lc8670_cpu_device::op_stf() int lc8670_cpu_device::op_dbnz() { - UINT16 addr = get_addr(); - UINT8 r8 = GET_R8; - UINT8 data = read_data_latch(addr) - 1; + uint16_t addr = get_addr(); + uint8_t r8 = GET_R8; + uint8_t data = read_data_latch(addr) - 1; write_data_latch(addr, data); @@ -1480,10 +1480,10 @@ int lc8670_cpu_device::op_dbnz() int lc8670_cpu_device::op_bpc() { - UINT8 b3 = GET_B3; - UINT16 d9 = GET_D9B3; - UINT8 r8 = GET_R8; - UINT8 data = read_data_latch(d9); + uint8_t b3 = GET_B3; + uint16_t d9 = GET_D9B3; + uint8_t r8 = GET_R8; + uint8_t data = read_data_latch(d9); if (data & (1<<b3)) { @@ -1496,7 +1496,7 @@ int lc8670_cpu_device::op_bpc() int lc8670_cpu_device::op_push() { - UINT16 d9 = GET_D9; + uint16_t d9 = GET_D9; push(read_data(d9)); return 2; @@ -1504,8 +1504,8 @@ int lc8670_cpu_device::op_push() int lc8670_cpu_device::op_inc() { - UINT16 addr = get_addr(); - UINT8 data = read_data_latch(addr); + uint16_t addr = get_addr(); + uint8_t data = read_data_latch(addr); write_data_latch(addr, data + 1); @@ -1514,9 +1514,9 @@ int lc8670_cpu_device::op_inc() int lc8670_cpu_device::op_bp() { - UINT8 b3 = GET_B3; - UINT16 d9 = GET_D9B3; - UINT8 r8 = GET_R8; + uint8_t b3 = GET_B3; + uint16_t d9 = GET_D9B3; + uint8_t r8 = GET_R8; if (read_data(d9) & (1<<b3)) set_pc(m_pc + SIGNED(r8)); @@ -1526,7 +1526,7 @@ int lc8670_cpu_device::op_bp() int lc8670_cpu_device::op_pop() { - UINT16 d9 = GET_D9; + uint16_t d9 = GET_D9; write_data(d9, pop()); return 2; @@ -1534,8 +1534,8 @@ int lc8670_cpu_device::op_pop() int lc8670_cpu_device::op_dec() { - UINT16 addr = get_addr(); - UINT8 data = read_data_latch(addr); + uint16_t addr = get_addr(); + uint8_t data = read_data_latch(addr); write_data_latch(addr, data - 1); @@ -1544,7 +1544,7 @@ int lc8670_cpu_device::op_dec() int lc8670_cpu_device::op_bz() { - UINT8 r8 = GET_R8; + uint8_t r8 = GET_R8; if (REG_A == 0) set_pc(m_pc + SIGNED(r8)); @@ -1554,8 +1554,8 @@ int lc8670_cpu_device::op_bz() int lc8670_cpu_device::op_add() { - UINT8 data = get_data(); - INT32 res = (REG_A + data); + uint8_t data = get_data(); + int32_t res = (REG_A + data); SET_CY(res > 0xff ? 1 : 0); SET_AC(((REG_A & 0x0f) + (data & 0x0f)) > 0x0f ? 1 : 0); @@ -1569,9 +1569,9 @@ int lc8670_cpu_device::op_add() int lc8670_cpu_device::op_bn() { - UINT8 b3 = GET_B3; - UINT16 d9 = GET_D9B3; - UINT8 r8 = GET_R8; + uint8_t b3 = GET_B3; + uint16_t d9 = GET_D9B3; + uint8_t r8 = GET_R8; if (!(read_data(d9) & (1<<b3))) set_pc(m_pc + SIGNED(r8)); @@ -1581,7 +1581,7 @@ int lc8670_cpu_device::op_bn() int lc8670_cpu_device::op_bnz() { - UINT8 r8 = GET_R8; + uint8_t r8 = GET_R8; if (REG_A != 0) set_pc(m_pc + SIGNED(r8)); @@ -1591,8 +1591,8 @@ int lc8670_cpu_device::op_bnz() int lc8670_cpu_device::op_addc() { - UINT8 data = get_data(); - INT32 res = (REG_A + data + GET_CY); + uint8_t data = get_data(); + int32_t res = (REG_A + data + GET_CY); SET_CY(res > 0xff ? 1 : 0); SET_AC(((REG_A & 0x0f) + (data & 0x0f) + GET_CY) > 0x0f ? 1 : 0); @@ -1606,7 +1606,7 @@ int lc8670_cpu_device::op_addc() int lc8670_cpu_device::op_ret() { - UINT16 new_pc = pop()<<8; + uint16_t new_pc = pop()<<8; new_pc |= pop(); set_pc(new_pc); @@ -1615,8 +1615,8 @@ int lc8670_cpu_device::op_ret() int lc8670_cpu_device::op_sub() { - UINT8 data = get_data(); - INT32 res = (REG_A - data); + uint8_t data = get_data(); + int32_t res = (REG_A - data); SET_CY(res < 0x00 ? 1 : 0); SET_AC(((REG_A & 0x0f) - (data & 0x0f)) < 0x00 ? 1 : 0); @@ -1630,8 +1630,8 @@ int lc8670_cpu_device::op_sub() int lc8670_cpu_device::op_not1() { - UINT16 d9 = GET_D9B3; - UINT8 data = read_data_latch(d9); + uint16_t d9 = GET_D9B3; + uint8_t data = read_data_latch(d9); data ^= (1<<GET_B3); write_data_latch(d9, data); @@ -1641,7 +1641,7 @@ int lc8670_cpu_device::op_not1() int lc8670_cpu_device::op_reti() { - UINT16 new_pc = pop()<<8; + uint16_t new_pc = pop()<<8; new_pc |= pop(); set_pc(new_pc); @@ -1660,8 +1660,8 @@ int lc8670_cpu_device::op_reti() int lc8670_cpu_device::op_subc() { - UINT8 data = get_data(); - INT32 res = (REG_A - data - GET_CY); + uint8_t data = get_data(); + int32_t res = (REG_A - data - GET_CY); SET_CY(res < 0x00 ? 1 : 0); SET_AC(((REG_A & 0x0f) - (data & 0x0f) - GET_CY) < 0x00 ? 1 : 0); @@ -1691,8 +1691,8 @@ int lc8670_cpu_device::op_ldc() int lc8670_cpu_device::op_xch() { - UINT16 addr = get_addr(); - UINT8 data = read_data(addr); + uint16_t addr = get_addr(); + uint8_t data = read_data(addr); write_data(addr, REG_A); REG_A = data; @@ -1703,8 +1703,8 @@ int lc8670_cpu_device::op_xch() int lc8670_cpu_device::op_clr1() { - UINT16 d9 = GET_D9B3; - UINT8 data = read_data_latch(d9); + uint16_t d9 = GET_D9B3; + uint8_t data = read_data_latch(d9); data &= ~(1<<GET_B3); write_data_latch(d9, data); @@ -1714,7 +1714,7 @@ int lc8670_cpu_device::op_clr1() int lc8670_cpu_device::op_rorc() { - UINT8 a = (REG_A>>1) | (GET_CY ? 0x80 : 0x00); + uint8_t a = (REG_A>>1) | (GET_CY ? 0x80 : 0x00); SET_CY(BIT(REG_A,0)); REG_A = a; @@ -1749,8 +1749,8 @@ int lc8670_cpu_device::op_and() int lc8670_cpu_device::op_set1() { - UINT16 d9 = GET_D9B3; - UINT8 data = read_data_latch(d9); + uint16_t d9 = GET_D9B3; + uint8_t data = read_data_latch(d9); data |= (1<<GET_B3); write_data_latch(d9, data); @@ -1760,7 +1760,7 @@ int lc8670_cpu_device::op_set1() int lc8670_cpu_device::op_rolc() { - UINT8 a = (REG_A<<1) | (GET_CY ? 0x01 : 0x00); + uint8_t a = (REG_A<<1) | (GET_CY ? 0x01 : 0x00); SET_CY(BIT(REG_A,7)); REG_A = a; diff --git a/src/devices/cpu/lc8670/lc8670.h b/src/devices/cpu/lc8670/lc8670.h index e6211a4522f..51c78b602c9 100644 --- a/src/devices/cpu/lc8670/lc8670.h +++ b/src/devices/cpu/lc8670/lc8670.h @@ -52,8 +52,8 @@ enum // TYPE DEFINITIONS //************************************************************************** -typedef UINT32 (*lc8670_lcd_update)(device_t &device, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8* vram, bool lcd_enabled, UINT8 stad); -#define LC8670_LCD_UPDATE(name) UINT32 name(device_t &device, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8* vram, bool lcd_enabled, UINT8 stad) +typedef uint32_t (*lc8670_lcd_update)(device_t &device, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t* vram, bool lcd_enabled, uint8_t stad); +#define LC8670_LCD_UPDATE(name) uint32_t name(device_t &device, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t* vram, bool lcd_enabled, uint8_t stad) //************************************************************************** @@ -77,10 +77,10 @@ class lc8670_cpu_device : public cpu_device { public: // construction/destruction - lc8670_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + lc8670_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); // public interfaces - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); // internal map handlers DECLARE_READ8_MEMBER(regs_r); @@ -91,7 +91,7 @@ public: DECLARE_WRITE8_MEMBER(xram_w); // static configuration helpers - static void static_set_cpu_clock(device_t &device, int _source, UINT32 _clock) { downcast<lc8670_cpu_device &>(device).m_clocks[_source] = _clock; } + static void static_set_cpu_clock(device_t &device, int _source, uint32_t _clock) { downcast<lc8670_cpu_device &>(device).m_clocks[_source] = _clock; } static void static_set_lcd_update_cb(device_t &device, lc8670_lcd_update _cb) { downcast<lc8670_cpu_device &>(device).m_lcd_update_func = _cb; } template<class _Object> static devcb_base & static_set_bankswitch_cb(device_t &device, _Object object) { return downcast<lc8670_cpu_device &>(device).m_bankswitch_func.set_callback(object); } @@ -102,9 +102,9 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 7; } - virtual UINT32 execute_input_lines() const override { return 4; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 7; } + virtual uint32_t execute_input_lines() const override { return 4; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -116,34 +116,34 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: // helpers - inline UINT8 fetch(); - inline void push(UINT8 data); - inline UINT8 pop(); - inline UINT8 read_data(UINT16 offset); - inline void write_data(UINT16 offset, UINT8 data); - inline UINT8 read_data_latch(UINT16 offset); - inline void write_data_latch(UINT16 offset, UINT8 data); - inline void update_port1(UINT8 data); - inline void set_pc(UINT16 new_pc); - inline UINT8 get_data(); - inline UINT16 get_addr(); + inline uint8_t fetch(); + inline void push(uint8_t data); + inline uint8_t pop(); + inline uint8_t read_data(uint16_t offset); + inline void write_data(uint16_t offset, uint8_t data); + inline uint8_t read_data_latch(uint16_t offset); + inline void write_data_latch(uint16_t offset, uint8_t data); + inline void update_port1(uint8_t data); + inline void set_pc(uint16_t new_pc); + inline uint8_t get_data(); + inline uint16_t get_addr(); inline void change_clock_source(); inline void check_p_flag(); inline void check_p3int(); inline void set_irq_flag(int source); - int decode_op(UINT8 op); + int decode_op(uint8_t op); void check_irqs(); void timer0_prescaler_tick(); void timer0_tick(bool ext_line = false); void timer1_tick(); void base_timer_tick(); - static void dasm_arg(UINT8 op, char *buffer, offs_t pc, int arg, const UINT8 *oprom, int &pos); + static void dasm_arg(uint8_t op, char *buffer, offs_t pc, int arg, const uint8_t *oprom, int &pos); // opcodes handlers int op_nop(); @@ -212,32 +212,32 @@ private: // internal state int m_icount; - UINT16 m_pc; - UINT16 m_ppc; - UINT8 m_op; - UINT8 m_sfr[0x80]; // special function registers - UINT8 m_mram[0x200]; // main RAM - UINT8 m_xram[0xc6]; // XRAM - UINT8 m_vtrbf[0x200]; // work RAM - UINT16 m_irq_flag; - UINT8 m_irq_lev; + uint16_t m_pc; + uint16_t m_ppc; + uint8_t m_op; + uint8_t m_sfr[0x80]; // special function registers + uint8_t m_mram[0x200]; // main RAM + uint8_t m_xram[0xc6]; // XRAM + uint8_t m_vtrbf[0x200]; // work RAM + uint16_t m_irq_flag; + uint8_t m_irq_lev; bool m_after_reti; - UINT8 m_p1_data; - UINT8 m_timer0_prescaler; - UINT8 m_timer0[2]; - UINT8 m_timer1[2]; - UINT8 m_timer1_comparator[2]; - UINT8 m_base_timer[2]; + uint8_t m_p1_data; + uint8_t m_timer0_prescaler; + uint8_t m_timer0[2]; + uint8_t m_timer1[2]; + uint8_t m_timer1_comparator[2]; + uint8_t m_base_timer[2]; bool m_clock_changed; int m_input_lines[4]; // configuration - UINT32 m_clocks[3]; // clock sources + uint32_t m_clocks[3]; // clock sources devcb_write8 m_bankswitch_func; // bankswitch CB lc8670_lcd_update m_lcd_update_func; // LCD update CB // interrupts vectors - static const UINT16 s_irq_vectors[16]; + static const uint16_t s_irq_vectors[16]; // opcodes table typedef int (lc8670_cpu_device::*op_handler)(); @@ -264,8 +264,8 @@ private: struct dasm_entry { const char *str; - UINT8 arg1; - UINT8 arg2; + uint8_t arg1; + uint8_t arg2; bool inv; }; static const dasm_entry s_dasm_table[80]; diff --git a/src/devices/cpu/lc8670/lc8670dsm.cpp b/src/devices/cpu/lc8670/lc8670dsm.cpp index 45985ea6e5f..af2672a88bc 100644 --- a/src/devices/cpu/lc8670/lc8670dsm.cpp +++ b/src/devices/cpu/lc8670/lc8670dsm.cpp @@ -94,7 +94,7 @@ const lc8670_cpu_device::dasm_entry lc8670_cpu_device::s_dasm_table[] = { "SET1", OP_D9B3, OP_NULL, 0 }, }; -void lc8670_cpu_device::dasm_arg(UINT8 op, char *buffer, offs_t pc, int arg, const UINT8 *oprom, int &pos) +void lc8670_cpu_device::dasm_arg(uint8_t op, char *buffer, offs_t pc, int arg, const uint8_t *oprom, int &pos) { switch( arg ) { @@ -151,12 +151,12 @@ void lc8670_cpu_device::dasm_arg(UINT8 op, char *buffer, offs_t pc, int arg, con // helper function //------------------------------------------------- -offs_t lc8670_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t lc8670_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { int pos = 0; char arg1[16], arg2[16]; - UINT8 op = oprom[pos++]; + uint8_t op = oprom[pos++]; int op_idx = decode_op(op); const dasm_entry *inst = &s_dasm_table[op_idx]; |