diff options
Diffstat (limited to 'src/devices/cpu/z180')
-rw-r--r-- | src/devices/cpu/z180/z180.cpp | 40 | ||||
-rw-r--r-- | src/devices/cpu/z180/z180.h | 106 | ||||
-rw-r--r-- | src/devices/cpu/z180/z180dasm.cpp | 22 | ||||
-rw-r--r-- | src/devices/cpu/z180/z180ed.hxx | 2 | ||||
-rw-r--r-- | src/devices/cpu/z180/z180ops.h | 112 | ||||
-rw-r--r-- | src/devices/cpu/z180/z180tbl.h | 22 |
6 files changed, 152 insertions, 152 deletions
diff --git a/src/devices/cpu/z180/z180.cpp b/src/devices/cpu/z180/z180.cpp index 26fee676f7e..0eab56994b8 100644 --- a/src/devices/cpu/z180/z180.cpp +++ b/src/devices/cpu/z180/z180.cpp @@ -81,7 +81,7 @@ Hitachi HD647180 series: const device_type Z180 = &device_creator<z180_device>; -z180_device::z180_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z180_device::z180_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, Z180, "Z180", tag, owner, clock, "z180", __FILE__) , z80_daisy_chain_interface(mconfig, *this) , m_program_config("program", ENDIANNESS_LITTLE, 8, 20, 0) @@ -91,7 +91,7 @@ z180_device::z180_device(const machine_config &mconfig, const char *tag, device_ } -offs_t z180_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t z180_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( z180 ); return CPU_DISASSEMBLE_NAME(z180)(this, buffer, pc, oprom, opram, options); @@ -750,14 +750,14 @@ offs_t z180_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opr -static UINT8 SZ[256]; /* zero and sign flags */ -static UINT8 SZ_BIT[256]; /* zero, sign and parity/overflow (=zero) flags for BIT opcode */ -static UINT8 SZP[256]; /* zero, sign and parity flags */ -static UINT8 SZHV_inc[256]; /* zero, sign, half carry and overflow flags INC r8 */ -static UINT8 SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r8 */ +static uint8_t SZ[256]; /* zero and sign flags */ +static uint8_t SZ_BIT[256]; /* zero, sign and parity/overflow (=zero) flags for BIT opcode */ +static uint8_t SZP[256]; /* zero, sign and parity flags */ +static uint8_t SZHV_inc[256]; /* zero, sign, half carry and overflow flags INC r8 */ +static uint8_t SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r8 */ -static std::unique_ptr<UINT8[]> SZHVC_add; -static std::unique_ptr<UINT8[]> SZHVC_sub; +static std::unique_ptr<uint8_t[]> SZHVC_add; +static std::unique_ptr<uint8_t[]> SZHVC_sub; #include "z180ops.h" #include "z180tbl.h" @@ -781,10 +781,10 @@ const address_space_config *z180_device::memory_space_config(address_spacenum sp } } -UINT8 z180_device::z180_readcontrol(offs_t port) +uint8_t z180_device::z180_readcontrol(offs_t port) { /* normal external readport */ - UINT8 data = m_iospace->read_byte(port); + uint8_t data = m_iospace->read_byte(port); /* remap internal I/O registers */ if((port & (IO_IOCR & 0xc0)) == (IO_IOCR & 0xc0)) @@ -1210,7 +1210,7 @@ data |= 0x02; // kludge for 20pacgal return data; } -void z180_device::z180_writecontrol(offs_t port, UINT8 data) +void z180_device::z180_writecontrol(offs_t port, uint8_t data) { /* normal external write port */ m_iospace->write_byte(port, data); @@ -1307,7 +1307,7 @@ void z180_device::z180_writecontrol(offs_t port, UINT8 data) case Z180_TCR: LOG(("Z180 '%s' TCR wr $%02x ($%02x)\n", tag(), data, data & Z180_TCR_WMASK)); { - UINT16 old = IO_TCR; + uint16_t old = IO_TCR; /* Force reload on state change */ IO_TCR = (IO_TCR & ~Z180_TCR_WMASK) | (data & Z180_TCR_WMASK); if (!(old & Z180_TCR_TDE0) && (IO_TCR & Z180_TCR_TDE0)) @@ -1758,9 +1758,9 @@ int z180_device::z180_dma1() return 6 + cycles; } -void z180_device::z180_write_iolines(UINT32 data) +void z180_device::z180_write_iolines(uint32_t data) { - UINT32 changes = m_iol ^ data; + uint32_t changes = m_iol ^ data; /* I/O asynchronous clock 0 (active high) or DREQ0 (mux) */ if (changes & Z180_CKA0) @@ -1887,11 +1887,11 @@ void z180_device::device_start() { int i, p; int oldval, newval, val; - UINT8 *padd, *padc, *psub, *psbc; + uint8_t *padd, *padc, *psub, *psbc; /* allocate big flag arrays once */ - SZHVC_add = std::make_unique<UINT8[]>(2*256*256); - SZHVC_sub = std::make_unique<UINT8[]>(2*256*256); + SZHVC_add = std::make_unique<uint8_t[]>(2*256*256); + SZHVC_sub = std::make_unique<uint8_t[]>(2*256*256); padd = &SZHVC_add[ 0*256]; padc = &SZHVC_add[256*256]; @@ -2158,7 +2158,7 @@ void z180_device::device_reset() m_after_EI = 0; m_ea = 0; - memcpy(m_cc, (UINT8 *)cc_default, sizeof(m_cc)); + memcpy(m_cc, (uint8_t *)cc_default, sizeof(m_cc)); _IX = _IY = 0xffff; /* IX and IY are FFFF after a reset! */ _F = ZF; /* Zero flag is set */ @@ -2459,7 +2459,7 @@ again: /**************************************************************************** * Burn 'cycles' T-states. Adjust R register for the lost time ****************************************************************************/ -void z180_device::execute_burn(INT32 cycles) +void z180_device::execute_burn(int32_t cycles) { /* FIXME: This is not appropriate for dma */ while ( (cycles > 0) ) diff --git a/src/devices/cpu/z180/z180.h b/src/devices/cpu/z180/z180.h index 36b260e7a6f..67befa3a4d3 100644 --- a/src/devices/cpu/z180/z180.h +++ b/src/devices/cpu/z180/z180.h @@ -125,7 +125,7 @@ class z180_device : public cpu_device, public z80_daisy_chain_interface { public: // construction/destruction - z180_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + z180_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); protected: // device-level overrides @@ -133,12 +133,12 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 16; } - virtual UINT32 execute_input_lines() const override { return 3; } - virtual UINT32 execute_default_irq_vector() const override { return 0xff; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 16; } + virtual uint32_t execute_input_lines() const override { return 3; } + virtual uint32_t execute_default_irq_vector() const override { return 0xff; } virtual void execute_run() override; - virtual void execute_burn(INT32 cycles) override; + virtual void execute_burn(int32_t cycles) override; virtual void execute_set_input(int inputnum, int state) override; // device_memory_interface overrides @@ -151,9 +151,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) 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: address_space_config m_program_config; @@ -162,34 +162,34 @@ private: PAIR m_PREPC,m_PC,m_SP,m_AF,m_BC,m_DE,m_HL,m_IX,m_IY; PAIR m_AF2,m_BC2,m_DE2,m_HL2; - UINT8 m_R,m_R2,m_IFF1,m_IFF2,m_HALT,m_IM,m_I; - UINT8 m_tmdr_latch; /* flag latched TMDR0H, TMDR1H values */ - UINT8 m_read_tcr_tmdr[2]; /* flag to indicate that TCR or TMDR was read */ - UINT32 m_iol; /* I/O line status bits */ - UINT8 m_io[64]; /* 64 internal 8 bit registers */ + uint8_t m_R,m_R2,m_IFF1,m_IFF2,m_HALT,m_IM,m_I; + uint8_t m_tmdr_latch; /* flag latched TMDR0H, TMDR1H values */ + uint8_t m_read_tcr_tmdr[2]; /* flag to indicate that TCR or TMDR was read */ + uint32_t m_iol; /* I/O line status bits */ + uint8_t m_io[64]; /* 64 internal 8 bit registers */ offs_t m_mmu[16]; /* MMU address translation */ - UINT8 m_tmdrh[2]; /* latched TMDR0H and TMDR1H values */ - UINT16 m_tmdr_value[2]; /* TMDR values used byt PRT0 and PRT1 as down counter */ - UINT8 m_tif[2]; /* TIF0 and TIF1 values */ - UINT8 m_nmi_state; /* nmi line state */ - UINT8 m_nmi_pending; /* nmi pending */ - UINT8 m_irq_state[3]; /* irq line states (INT0,INT1,INT2) */ - UINT8 m_int_pending[11 + 1]; /* interrupt pending */ - UINT8 m_after_EI; /* are we in the EI shadow? */ - UINT32 m_ea; - UINT8 m_timer_cnt; /* timer counter / divide by 20 */ - UINT8 m_dma0_cnt; /* dma0 counter / divide by 20 */ - UINT8 m_dma1_cnt; /* dma1 counter / divide by 20 */ + uint8_t m_tmdrh[2]; /* latched TMDR0H and TMDR1H values */ + uint16_t m_tmdr_value[2]; /* TMDR values used byt PRT0 and PRT1 as down counter */ + uint8_t m_tif[2]; /* TIF0 and TIF1 values */ + uint8_t m_nmi_state; /* nmi line state */ + uint8_t m_nmi_pending; /* nmi pending */ + uint8_t m_irq_state[3]; /* irq line states (INT0,INT1,INT2) */ + uint8_t m_int_pending[11 + 1]; /* interrupt pending */ + uint8_t m_after_EI; /* are we in the EI shadow? */ + uint32_t m_ea; + uint8_t m_timer_cnt; /* timer counter / divide by 20 */ + uint8_t m_dma0_cnt; /* dma0 counter / divide by 20 */ + uint8_t m_dma1_cnt; /* dma1 counter / divide by 20 */ address_space *m_program; direct_read_data *m_direct; address_space *m_oprogram; direct_read_data *m_odirect; address_space *m_iospace; - UINT8 m_rtemp; - UINT32 m_ioltemp; + uint8_t m_rtemp; + uint32_t m_ioltemp; int m_icount; int m_extra_cycles; /* extra cpu cycles */ - UINT8 *m_cc[6]; + uint8_t *m_cc[6]; typedef void (z180_device::*opcode_func)(); static const opcode_func s_z180ops[6][0x100]; @@ -197,33 +197,33 @@ private: inline void z180_mmu(); inline void RM16( offs_t addr, PAIR *r ); inline void WM16( offs_t addr, PAIR *r ); - inline UINT8 ROP(); - inline UINT8 ARG(); - inline UINT32 ARG16(); - inline UINT8 INC(UINT8 value); - inline UINT8 DEC(UINT8 value); - inline UINT8 RLC(UINT8 value); - inline UINT8 RRC(UINT8 value); - inline UINT8 RL(UINT8 value); - inline UINT8 RR(UINT8 value); - inline UINT8 SLA(UINT8 value); - inline UINT8 SRA(UINT8 value); - inline UINT8 SLL(UINT8 value); - inline UINT8 SRL(UINT8 value); - inline UINT8 RES(UINT8 bit, UINT8 value); - inline UINT8 SET(UINT8 bit, UINT8 value); - inline int exec_op(const UINT8 opcode); - inline int exec_cb(const UINT8 opcode); - inline int exec_dd(const UINT8 opcode); - inline int exec_ed(const UINT8 opcode); - inline int exec_fd(const UINT8 opcode); - inline int exec_xycb(const UINT8 opcode); + inline uint8_t ROP(); + inline uint8_t ARG(); + inline uint32_t ARG16(); + inline uint8_t INC(uint8_t value); + inline uint8_t DEC(uint8_t value); + inline uint8_t RLC(uint8_t value); + inline uint8_t RRC(uint8_t value); + inline uint8_t RL(uint8_t value); + inline uint8_t RR(uint8_t value); + inline uint8_t SLA(uint8_t value); + inline uint8_t SRA(uint8_t value); + inline uint8_t SLL(uint8_t value); + inline uint8_t SRL(uint8_t value); + inline uint8_t RES(uint8_t bit, uint8_t value); + inline uint8_t SET(uint8_t bit, uint8_t value); + inline int exec_op(const uint8_t opcode); + inline int exec_cb(const uint8_t opcode); + inline int exec_dd(const uint8_t opcode); + inline int exec_ed(const uint8_t opcode); + inline int exec_fd(const uint8_t opcode); + inline int exec_xycb(const uint8_t opcode); int take_interrupt(int irq); - UINT8 z180_readcontrol(offs_t port); - void z180_writecontrol(offs_t port, UINT8 data); + uint8_t z180_readcontrol(offs_t port); + void z180_writecontrol(offs_t port, uint8_t data); int z180_dma0(int max_cycles); int z180_dma1(); - void z180_write_iolines(UINT32 data); + void z180_write_iolines(uint32_t data); void clock_timers(); int check_interrupts(); void handle_io_timers(int cycles); diff --git a/src/devices/cpu/z180/z180dasm.cpp b/src/devices/cpu/z180/z180dasm.cpp index e44f6d67ae4..b4b4b6571a7 100644 --- a/src/devices/cpu/z180/z180dasm.cpp +++ b/src/devices/cpu/z180/z180dasm.cpp @@ -38,7 +38,7 @@ static const char *const s_mnemonic[] = { }; struct z80dasm { - UINT8 mnemonic; + uint8_t mnemonic; const char *arguments; }; @@ -377,12 +377,12 @@ static const z80dasm mnemonic_main[256]= { {zCALL,"m,A"}, {zDB,"fd"}, {zCP,"B"}, {zRST,"V"} }; -static char sign(INT8 offset) +static char sign(int8_t offset) { return (offset < 0)? '-':'+'; } -static int offs(INT8 offset) +static int offs(int8_t offset) { if (offset < 0) return -offset; return offset; @@ -397,11 +397,11 @@ CPU_DISASSEMBLE( z180 ) const char *src, *ixy; char *dst; unsigned PC = pc; - INT8 offset = 0; - UINT8 op, op1 = 0; - UINT16 ea; + int8_t offset = 0; + uint8_t op, op1 = 0; + uint16_t ea; int pos = 0; - UINT32 flags = 0; + uint32_t flags = 0; ixy = "oops!!"; dst = buffer; @@ -423,7 +423,7 @@ CPU_DISASSEMBLE( z180 ) op1 = oprom[pos++]; if( op1 == 0xcb ) { - offset = (INT8) opram[pos++]; + offset = (int8_t) opram[pos++]; op1 = opram[pos++]; /* fourth byte from opbase.ram! */ d = &mnemonic_xx_cb[op1]; } @@ -434,7 +434,7 @@ CPU_DISASSEMBLE( z180 ) op1 = oprom[pos++]; if( op1 == 0xcb ) { - offset = (INT8) opram[pos++]; + offset = (int8_t) opram[pos++]; op1 = opram[pos++]; /* fourth byte from opbase.ram! */ d = &mnemonic_xx_cb[op1]; } @@ -471,7 +471,7 @@ CPU_DISASSEMBLE( z180 ) dst += sprintf( dst, "$%04X", ea ); break; case 'O': /* Offset relative to PC */ - offset = (INT8) opram[pos++]; + offset = (int8_t) opram[pos++]; dst += sprintf( dst, "$%05X", PC + offset + 2 ); break; case 'P': /* Port number */ @@ -488,7 +488,7 @@ CPU_DISASSEMBLE( z180 ) dst += sprintf( dst, "$%05X", ea ); break; case 'X': - offset = (INT8) opram[pos++]; + offset = (int8_t) opram[pos++]; case 'Y': dst += sprintf( dst,"(%s%c$%02x)", ixy, sign(offset), offs(offset) ); break; diff --git a/src/devices/cpu/z180/z180ed.hxx b/src/devices/cpu/z180/z180ed.hxx index 91520228f87..df123a07a23 100644 --- a/src/devices/cpu/z180/z180ed.hxx +++ b/src/devices/cpu/z180/z180ed.hxx @@ -135,7 +135,7 @@ OP(ed,6d) { RETI; } /* RETI OP(ed,6e) { m_IM = 0; } /* IM 0 */ OP(ed,6f) { RLD; } /* RLD (HL) */ -OP(ed,70) { UINT8 res = IN(_BC); _F = (_F & CF) | SZP[res]; } /* IN 0,(C) */ +OP(ed,70) { uint8_t res = IN(_BC); _F = (_F & CF) | SZP[res]; } /* IN 0,(C) */ OP(ed,71) { OUT(_BC,0); } /* OUT (C),0 */ OP(ed,72) { SBC16( SP ); } /* SBC HL,SP */ OP(ed,73) { m_ea = ARG16(); WM16( m_ea, &m_SP ); } /* LD (w),SP */ diff --git a/src/devices/cpu/z180/z180ops.h b/src/devices/cpu/z180/z180ops.h index 6fb50e18112..3e2139fa51c 100644 --- a/src/devices/cpu/z180/z180ops.h +++ b/src/devices/cpu/z180/z180ops.h @@ -98,7 +98,7 @@ void z180_device::WM16( offs_t addr, PAIR *r ) * reading opcodes. In case of system with memory mapped I/O, * this function can be used to greatly speed up emulation ***************************************************************/ -UINT8 z180_device::ROP() +uint8_t z180_device::ROP() { offs_t addr = _PCD; _PC++; @@ -111,14 +111,14 @@ UINT8 z180_device::ROP() * support systems that use different encoding mechanisms for * opcodes and opcode arguments ***************************************************************/ -UINT8 z180_device::ARG() +uint8_t z180_device::ARG() { offs_t addr = _PCD; _PC++; return m_direct->read_byte(MMU_REMAP_ADDR(addr)); } -UINT32 z180_device::ARG16() +uint32_t z180_device::ARG16() { offs_t addr = _PCD; _PC += 2; @@ -129,8 +129,8 @@ UINT32 z180_device::ARG16() * Calculate the effective addess m_ea of an opcode using * IX+offset resp. IY+offset addressing. ***************************************************************/ -#define EAX() m_ea = (UINT32)(UINT16)(_IX + (INT8)ARG()) -#define EAY() m_ea = (UINT32)(UINT16)(_IY + (INT8)ARG()) +#define EAX() m_ea = (uint32_t)(uint16_t)(_IX + (int8_t)ARG()) +#define EAY() m_ea = (uint32_t)(uint16_t)(_IY + (int8_t)ARG()) /*************************************************************** * POP @@ -168,7 +168,7 @@ UINT32 z180_device::ARG16() ***************************************************************/ #define JR() \ { \ - INT8 arg = (INT8)ARG(); /* ARG() also increments _PC */ \ + int8_t arg = (int8_t)ARG(); /* ARG() also increments _PC */ \ _PC += arg; /* so don't do _PC += ARG() */ \ } @@ -178,7 +178,7 @@ UINT32 z180_device::ARG16() #define JR_COND(cond,opcode) \ if( cond ) \ { \ - INT8 arg = (INT8)ARG(); /* ARG() also increments _PC */ \ + int8_t arg = (int8_t)ARG(); /* ARG() also increments _PC */ \ _PC += arg; /* so don't do _PC += ARG() */ \ CC(ex,opcode); \ } \ @@ -277,19 +277,19 @@ UINT32 z180_device::ARG16() /*************************************************************** * INC r8 ***************************************************************/ -UINT8 z180_device::INC(UINT8 value) +uint8_t z180_device::INC(uint8_t value) { - UINT8 res = value + 1; + uint8_t res = value + 1; _F = (_F & CF) | SZHV_inc[res]; - return (UINT8)res; + return (uint8_t)res; } /*************************************************************** * DEC r8 ***************************************************************/ -UINT8 z180_device::DEC(UINT8 value) +uint8_t z180_device::DEC(uint8_t value) { - UINT8 res = value - 1; + uint8_t res = value - 1; _F = (_F & CF) | SZHV_dec[res]; return res; } @@ -312,8 +312,8 @@ UINT8 z180_device::DEC(UINT8 value) * RLA ***************************************************************/ #define RLA { \ - UINT8 res = (_A << 1) | (_F & CF); \ - UINT8 c = (_A & 0x80) ? CF : 0; \ + uint8_t res = (_A << 1) | (_F & CF); \ + uint8_t c = (_A & 0x80) ? CF : 0; \ _F = (_F & (SF | ZF | PF)) | c | (res & (YF | XF)); \ _A = res; \ } @@ -322,8 +322,8 @@ UINT8 z180_device::DEC(UINT8 value) * RRA ***************************************************************/ #define RRA { \ - UINT8 res = (_A >> 1) | (_F << 7); \ - UINT8 c = (_A & 0x01) ? CF : 0; \ + uint8_t res = (_A >> 1) | (_F << 7); \ + uint8_t c = (_A & 0x01) ? CF : 0; \ _F = (_F & (SF | ZF | PF)) | c | (res & (YF | XF)); \ _A = res; \ } @@ -332,7 +332,7 @@ UINT8 z180_device::DEC(UINT8 value) * RRD ***************************************************************/ #define RRD { \ - UINT8 n = RM(_HL); \ + uint8_t n = RM(_HL); \ WM( _HL, (n >> 4) | (_A << 4) ); \ _A = (_A & 0xf0) | (n & 0x0f); \ _F = (_F & CF) | SZP[_A]; \ @@ -342,7 +342,7 @@ UINT8 z180_device::DEC(UINT8 value) * RLD ***************************************************************/ #define RLD { \ - UINT8 n = RM(_HL); \ + uint8_t n = RM(_HL); \ WM( _HL, (n << 4) | (_A & 0x0f) ); \ _A = (_A & 0xf0) | (n >> 4); \ _F = (_F & CF) | SZP[_A]; \ @@ -353,8 +353,8 @@ UINT8 z180_device::DEC(UINT8 value) ***************************************************************/ #define ADD(value) \ { \ - UINT32 ah = _AFD & 0xff00; \ - UINT32 res = (UINT8)((ah >> 8) + value); \ + uint32_t ah = _AFD & 0xff00; \ + uint32_t res = (uint8_t)((ah >> 8) + value); \ _F = SZHVC_add[ah | res]; \ _A = res; \ } @@ -364,8 +364,8 @@ UINT8 z180_device::DEC(UINT8 value) ***************************************************************/ #define ADC(value) \ { \ - UINT32 ah = _AFD & 0xff00, c = _AFD & 1; \ - UINT32 res = (UINT8)((ah >> 8) + value + c); \ + uint32_t ah = _AFD & 0xff00, c = _AFD & 1; \ + uint32_t res = (uint8_t)((ah >> 8) + value + c); \ _F = SZHVC_add[(c << 16) | ah | res]; \ _A = res; \ } @@ -375,8 +375,8 @@ UINT8 z180_device::DEC(UINT8 value) ***************************************************************/ #define SUB(value) \ { \ - UINT32 ah = _AFD & 0xff00; \ - UINT32 res = (UINT8)((ah >> 8) - value); \ + uint32_t ah = _AFD & 0xff00; \ + uint32_t res = (uint8_t)((ah >> 8) - value); \ _F = SZHVC_sub[ah | res]; \ _A = res; \ } @@ -386,8 +386,8 @@ UINT8 z180_device::DEC(UINT8 value) ***************************************************************/ #define SBC(value) \ { \ - UINT32 ah = _AFD & 0xff00, c = _AFD & 1; \ - UINT32 res = (UINT8)((ah >> 8) - value - c); \ + uint32_t ah = _AFD & 0xff00, c = _AFD & 1; \ + uint32_t res = (uint8_t)((ah >> 8) - value - c); \ _F = SZHVC_sub[(c<<16) | ah | res]; \ _A = res; \ } @@ -396,7 +396,7 @@ UINT8 z180_device::DEC(UINT8 value) * NEG ***************************************************************/ #define NEG { \ - UINT8 value = _A; \ + uint8_t value = _A; \ _A = 0; \ SUB(value); \ } @@ -405,7 +405,7 @@ UINT8 z180_device::DEC(UINT8 value) * DAA ***************************************************************/ #define DAA { \ - UINT8 r = _A; \ + uint8_t r = _A; \ if (_F&NF) { \ if ((_F&HF)|((_A&0xf)>9)) r-=6; \ if ((_F&CF)|(_A>0x99)) r-=0x60; \ @@ -444,8 +444,8 @@ UINT8 z180_device::DEC(UINT8 value) ***************************************************************/ #define CP(value) \ { \ - UINT32 ah = _AFD & 0xff00; \ - UINT32 res = (UINT8)((ah >> 8) - value); \ + uint32_t ah = _AFD & 0xff00; \ + uint32_t res = (uint8_t)((ah >> 8) - value); \ _F = SZHVC_sub[ah | res]; \ } @@ -492,11 +492,11 @@ UINT8 z180_device::DEC(UINT8 value) ***************************************************************/ #define ADD16(DR,SR) \ { \ - UINT32 res = m_##DR.d + m_##SR.d; \ + uint32_t res = m_##DR.d + m_##SR.d; \ _F = (_F & (SF | ZF | VF)) | \ (((m_##DR.d ^ res ^ m_##SR.d) >> 8) & HF) | \ ((res >> 16) & CF); \ - m_##DR.w.l = (UINT16)res; \ + m_##DR.w.l = (uint16_t)res; \ } /*************************************************************** @@ -504,13 +504,13 @@ UINT8 z180_device::DEC(UINT8 value) ***************************************************************/ #define ADC16(DR) \ { \ - UINT32 res = _HLD + m_##DR.d + (_F & CF); \ + uint32_t res = _HLD + m_##DR.d + (_F & CF); \ _F = (((_HLD ^ res ^ m_##DR.d) >> 8) & HF) | \ ((res >> 16) & CF) | \ ((res >> 8) & SF) | \ ((res & 0xffff) ? 0 : ZF) | \ (((m_##DR.d ^ _HLD ^ 0x8000) & (m_##DR.d ^ res) & 0x8000) >> 13); \ - _HL = (UINT16)res; \ + _HL = (uint16_t)res; \ } /*************************************************************** @@ -518,19 +518,19 @@ UINT8 z180_device::DEC(UINT8 value) ***************************************************************/ #define SBC16(DR) \ { \ - UINT32 res = _HLD - m_##DR.d - (_F & CF); \ + uint32_t res = _HLD - m_##DR.d - (_F & CF); \ _F = (((_HLD ^ res ^ m_##DR.d) >> 8) & HF) | NF | \ ((res >> 16) & CF) | \ ((res >> 8) & SF) | \ ((res & 0xffff) ? 0 : ZF) | \ (((m_##DR.d ^ _HLD) & (_HLD ^ res) &0x8000) >> 13); \ - _HL = (UINT16)res; \ + _HL = (uint16_t)res; \ } /*************************************************************** * RLC r8 ***************************************************************/ -UINT8 z180_device::RLC(UINT8 value) +uint8_t z180_device::RLC(uint8_t value) { unsigned res = value; unsigned c = (res & 0x80) ? CF : 0; @@ -542,7 +542,7 @@ UINT8 z180_device::RLC(UINT8 value) /*************************************************************** * RRC r8 ***************************************************************/ -UINT8 z180_device::RRC(UINT8 value) +uint8_t z180_device::RRC(uint8_t value) { unsigned res = value; unsigned c = (res & 0x01) ? CF : 0; @@ -554,7 +554,7 @@ UINT8 z180_device::RRC(UINT8 value) /*************************************************************** * RL r8 ***************************************************************/ -UINT8 z180_device::RL(UINT8 value) +uint8_t z180_device::RL(uint8_t value) { unsigned res = value; unsigned c = (res & 0x80) ? CF : 0; @@ -566,7 +566,7 @@ UINT8 z180_device::RL(UINT8 value) /*************************************************************** * RR r8 ***************************************************************/ -UINT8 z180_device::RR(UINT8 value) +uint8_t z180_device::RR(uint8_t value) { unsigned res = value; unsigned c = (res & 0x01) ? CF : 0; @@ -578,7 +578,7 @@ UINT8 z180_device::RR(UINT8 value) /*************************************************************** * SLA r8 ***************************************************************/ -UINT8 z180_device::SLA(UINT8 value) +uint8_t z180_device::SLA(uint8_t value) { unsigned res = value; unsigned c = (res & 0x80) ? CF : 0; @@ -590,7 +590,7 @@ UINT8 z180_device::SLA(UINT8 value) /*************************************************************** * SRA r8 ***************************************************************/ -UINT8 z180_device::SRA(UINT8 value) +uint8_t z180_device::SRA(uint8_t value) { unsigned res = value; unsigned c = (res & 0x01) ? CF : 0; @@ -602,7 +602,7 @@ UINT8 z180_device::SRA(UINT8 value) /*************************************************************** * SLL r8 ***************************************************************/ -UINT8 z180_device::SLL(UINT8 value) +uint8_t z180_device::SLL(uint8_t value) { unsigned res = value; unsigned c = (res & 0x80) ? CF : 0; @@ -614,7 +614,7 @@ UINT8 z180_device::SLL(UINT8 value) /*************************************************************** * SRL r8 ***************************************************************/ -UINT8 z180_device::SRL(UINT8 value) +uint8_t z180_device::SRL(uint8_t value) { unsigned res = value; unsigned c = (res & 0x01) ? CF : 0; @@ -639,7 +639,7 @@ UINT8 z180_device::SRL(UINT8 value) /*************************************************************** * RES bit,r8 ***************************************************************/ -UINT8 z180_device::RES(UINT8 bit, UINT8 value) +uint8_t z180_device::RES(uint8_t bit, uint8_t value) { return value & ~(1<<bit); } @@ -647,7 +647,7 @@ UINT8 z180_device::RES(UINT8 bit, UINT8 value) /*************************************************************** * SET bit,r8 ***************************************************************/ -UINT8 z180_device::SET(UINT8 bit, UINT8 value) +uint8_t z180_device::SET(uint8_t bit, uint8_t value) { return value | (1<<bit); } @@ -656,7 +656,7 @@ UINT8 z180_device::SET(UINT8 bit, UINT8 value) * LDI ***************************************************************/ #define LDI { \ - UINT8 io = RM(_HL); \ + uint8_t io = RM(_HL); \ WM( _DE, io ); \ _F &= SF | ZF | CF; \ if( (_A + io) & 0x02 ) _F |= YF; /* bit 1 -> flag 5 */ \ @@ -669,8 +669,8 @@ UINT8 z180_device::SET(UINT8 bit, UINT8 value) * CPI ***************************************************************/ #define CPI { \ - UINT8 val = RM(_HL); \ - UINT8 res = _A - val; \ + uint8_t val = RM(_HL); \ + uint8_t res = _A - val; \ _HL++; _BC--; \ _F = (_F & CF) | (SZ[res] & ~(YF|XF)) | ((_A ^ val ^ res) & HF) | NF; \ if( _F & HF ) res -= 1; \ @@ -683,7 +683,7 @@ UINT8 z180_device::SET(UINT8 bit, UINT8 value) * INI ***************************************************************/ #define INI { \ - UINT8 io = IN(_BC); \ + uint8_t io = IN(_BC); \ _B--; \ WM( _HL, io ); \ _HL++; \ @@ -701,7 +701,7 @@ UINT8 z180_device::SET(UINT8 bit, UINT8 value) * OUTI ***************************************************************/ #define OUTI { \ - UINT8 io = RM(_HL); \ + uint8_t io = RM(_HL); \ _B--; \ OUT( _BC, io ); \ _HL++; \ @@ -719,7 +719,7 @@ UINT8 z180_device::SET(UINT8 bit, UINT8 value) * LDD ***************************************************************/ #define LDD { \ - UINT8 io = RM(_HL); \ + uint8_t io = RM(_HL); \ WM( _DE, io ); \ _F &= SF | ZF | CF; \ if( (_A + io) & 0x02 ) _F |= YF; /* bit 1 -> flag 5 */ \ @@ -732,8 +732,8 @@ UINT8 z180_device::SET(UINT8 bit, UINT8 value) * CPD ***************************************************************/ #define CPD { \ - UINT8 val = RM(_HL); \ - UINT8 res = _A - val; \ + uint8_t val = RM(_HL); \ + uint8_t res = _A - val; \ _HL--; _BC--; \ _F = (_F & CF) | (SZ[res] & ~(YF|XF)) | ((_A ^ val ^ res) & HF) | NF; \ if( _F & HF ) res -= 1; \ @@ -746,7 +746,7 @@ UINT8 z180_device::SET(UINT8 bit, UINT8 value) * IND ***************************************************************/ #define IND { \ - UINT8 io = IN(_BC); \ + uint8_t io = IN(_BC); \ _B--; \ WM( _HL, io ); \ _HL--; \ @@ -764,7 +764,7 @@ UINT8 z180_device::SET(UINT8 bit, UINT8 value) * OUTD ***************************************************************/ #define OUTD { \ - UINT8 io = RM(_HL); \ + uint8_t io = RM(_HL); \ _B--; \ OUT( _BC, io ); \ _HL--; \ diff --git a/src/devices/cpu/z180/z180tbl.h b/src/devices/cpu/z180/z180tbl.h index 4884992a5e3..57d1bed3961 100644 --- a/src/devices/cpu/z180/z180tbl.h +++ b/src/devices/cpu/z180/z180tbl.h @@ -1,17 +1,17 @@ // license:BSD-3-Clause // copyright-holders:Juergen Buchmueller /* tmp1 value for ini/inir/outi/otir for [C.1-0][io.1-0] */ -static const UINT8 irep_tmp1[4][4] = { +static const uint8_t irep_tmp1[4][4] = { {0,0,1,0},{0,1,0,1},{1,0,1,1},{0,1,1,0} }; /* tmp1 value for ind/indr/outd/otdr for [C.1-0][io.1-0] */ -static const UINT8 drep_tmp1[4][4] = { +static const uint8_t drep_tmp1[4][4] = { {0,1,0,0},{1,0,0,1},{0,0,1,0},{0,1,0,1} }; /* tmp2 value for all in/out repeated opcodes for B.7-0 */ -static const UINT8 breg_tmp2[256] = { +static const uint8_t breg_tmp2[256] = { 0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1, 0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0, 1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0, @@ -30,7 +30,7 @@ static const UINT8 breg_tmp2[256] = { 1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1 }; -static const UINT8 cc_op[0x100] = { +static const uint8_t cc_op[0x100] = { /*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */ 3, 9, 7, 4, 4, 4, 6, 3, 4, 7, 6, 4, 4, 4, 6, 3, 7, 9, 7, 4, 4, 4, 6, 3, 8, 7, 6, 4, 4, 4, 6, 3, @@ -50,7 +50,7 @@ static const UINT8 cc_op[0x100] = { 5, 9, 6, 3, 6,11, 6,11, 5, 4, 6, 3, 6, 0, 6,11 }; -static const UINT8 cc_cb[0x100] = { +static const uint8_t cc_cb[0x100] = { /*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */ 7, 7, 7, 7, 7, 7,13, 7, 7, 7, 7, 7, 7, 7,13, 7, 7, 7, 7, 7, 7, 7,13, 7, 7, 7, 7, 7, 7, 7,13, 7, @@ -70,7 +70,7 @@ static const UINT8 cc_cb[0x100] = { 7, 7, 7, 7, 7, 7,13, 7, 7, 7, 7, 7, 7, 7,13, 7 }; -static const UINT8 cc_ed[0x100] = { +static const uint8_t cc_ed[0x100] = { /*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */ 12,13, 6, 6, 9, 6, 6, 6,12,13, 6, 6, 9, 6, 6, 6, 12,13, 6, 6, 9, 6, 6, 6,12,13, 6, 6, 9, 6, 6, 6, @@ -90,7 +90,7 @@ static const UINT8 cc_ed[0x100] = { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }; -static const UINT8 cc_xy[0x100] = { +static const uint8_t cc_xy[0x100] = { /*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */ 4, 4, 4, 4, 4, 4, 4, 4, 4,10, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,10, 4, 4, 4, 4, 4, 4, @@ -110,7 +110,7 @@ static const UINT8 cc_xy[0x100] = { 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4 }; -static const UINT8 cc_xycb[0x100] = { +static const uint8_t cc_xycb[0x100] = { /*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */ 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, @@ -131,7 +131,7 @@ static const UINT8 cc_xycb[0x100] = { }; /* extra cycles if jr/jp/call taken and 'interrupt latency' on rst 0-7 */ -static const UINT8 cc_ex[0x100] = { +static const uint8_t cc_ex[0x100] = { /*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* DJNZ */ @@ -151,7 +151,7 @@ static const UINT8 cc_ex[0x100] = { 5, 0, 3, 0,10, 0, 0, 2, 5, 0, 3, 0,10, 0, 0, 2 }; -static const UINT8 *const cc_default[6] = { cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex }; +static const uint8_t *const cc_default[6] = { cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex }; #define Z180_TABLE_dd Z180_TABLE_xy #define Z180_TABLE_fd Z180_TABLE_xy @@ -218,7 +218,7 @@ const z180_device::opcode_func z180_device::s_z180ops[Z180_PREFIX_COUNT][0x100] ***************************************************************/ #define EXEC_PROTOTYPE(prefix) \ -int z180_device::exec##_##prefix(const UINT8 opcode) \ +int z180_device::exec##_##prefix(const uint8_t opcode) \ { \ (this->*s_z180ops[Z180_PREFIX_##prefix][opcode])(); \ return m_cc[Z180_TABLE_##prefix][opcode]; \ |