From 361f0a7691f67c513b538754ddb1cf2ab4abed2a Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Fri, 25 Nov 2016 04:09:04 +1100 Subject: [PATCH] clean up tabulation, fix some things (nw) --- src/devices/cpu/alph8201/8201dasm.cpp | 2 +- src/devices/cpu/alph8201/alph8201.cpp | 34 +++--- src/devices/cpu/alph8201/alph8201.h | 144 +++++++++++++------------- src/devices/video/mc6847.h | 2 +- src/mame/drivers/lordgun.cpp | 2 +- src/mame/video/stic.h | 2 +- src/osd/modules/render/drawd3d.cpp | 2 +- 7 files changed, 94 insertions(+), 94 deletions(-) diff --git a/src/devices/cpu/alph8201/8201dasm.cpp b/src/devices/cpu/alph8201/8201dasm.cpp index 307456f0633..8e5e99ffd37 100644 --- a/src/devices/cpu/alph8201/8201dasm.cpp +++ b/src/devices/cpu/alph8201/8201dasm.cpp @@ -334,7 +334,7 @@ static void InitDasm8201(void) Op[i].type = type; /* 2 byte code ? */ - while (isspace((uint8_t)*p)) p++; + while (isspace(u8(*p))) p++; if( (*p) ) Op[i].type |= 0x10; /* number of param */ diff --git a/src/devices/cpu/alph8201/alph8201.cpp b/src/devices/cpu/alph8201/alph8201.cpp index eb4390e251f..e06b05f39a2 100644 --- a/src/devices/cpu/alph8201/alph8201.cpp +++ b/src/devices/cpu/alph8201/alph8201.cpp @@ -184,7 +184,7 @@ const device_type ALPHA8301L = &device_creator; #define FN(x) &alpha8201_cpu_device::x -alpha8201_cpu_device::alpha8201_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +alpha8201_cpu_device::alpha8201_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : cpu_device(mconfig, ALPHA8201L, "ALPHA-8201L", tag, owner, clock, "alpha8201l", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 8, 10, 0) , m_io_config("io", ENDIANNESS_LITTLE, 8, 6, 0) @@ -193,7 +193,7 @@ alpha8201_cpu_device::alpha8201_cpu_device(const machine_config &mconfig, const } -alpha8201_cpu_device::alpha8201_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) +alpha8201_cpu_device::alpha8201_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 8, 10, 0) , m_io_config("io", ENDIANNESS_LITTLE, 8, 6, 0) @@ -201,7 +201,7 @@ alpha8201_cpu_device::alpha8201_cpu_device(const machine_config &mconfig, device { } -alpha8301_cpu_device::alpha8301_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +alpha8301_cpu_device::alpha8301_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : alpha8201_cpu_device(mconfig, ALPHA8301L, "ALPHA-8301L", tag, owner, clock, "alpha8301l", __FILE__) { m_opmap = opcode_8301; @@ -217,49 +217,49 @@ unsigned alpha8201_cpu_device::M_RDMEM_OPCODE() return retval; } -void alpha8201_cpu_device::M_ADD(uint8_t dat) +void alpha8201_cpu_device::M_ADD(u8 dat) { - uint16_t temp = m_A + dat; + u16 temp = m_A + dat; m_A = temp & 0xff; m_zf = (m_A==0); m_cf = temp>>8; } -void alpha8201_cpu_device::M_ADDB(uint8_t dat) +void alpha8201_cpu_device::M_ADDB(u8 dat) { - uint16_t temp = m_B + dat; + u16 temp = m_B + dat; m_B = temp & 0xff; m_zf = (m_B==0); m_cf = temp>>8; } -void alpha8201_cpu_device::M_SUB(uint8_t dat) +void alpha8201_cpu_device::M_SUB(u8 dat) { m_cf = (m_A>=dat); // m_cf is No Borrow m_A -= dat; m_zf = (m_A==0); } -void alpha8201_cpu_device::M_AND(uint8_t dat) +void alpha8201_cpu_device::M_AND(u8 dat) { m_A &= dat; m_zf = (m_A==0); } -void alpha8201_cpu_device::M_OR(uint8_t dat) +void alpha8201_cpu_device::M_OR(u8 dat) { m_A |= dat; m_zf = (m_A==0); } -void alpha8201_cpu_device::M_XOR(uint8_t dat) +void alpha8201_cpu_device::M_XOR(u8 dat) { m_A ^= dat; m_zf = (m_A==0); m_cf = 0; } -void alpha8201_cpu_device::M_JMP(uint8_t dat) +void alpha8201_cpu_device::M_JMP(u8 dat) { m_pc.b.l = dat; /* update pc page */ @@ -279,8 +279,8 @@ void alpha8201_cpu_device::M_UNDEFINED() void alpha8201_cpu_device::M_UNDEFINED2() { - uint8_t op = M_RDOP(m_pc.w.l-1); - uint8_t imm = M_RDMEM_OPCODE(); + u8 op = M_RDOP(m_pc.w.l-1); + u8 imm = M_RDMEM_OPCODE(); logerror("alpha8201: PC = %03x, Unimplemented opcode = %02x,%02x\n", m_pc.w.l-2, op,imm); #if SHOW_MESSAGE_CONSOLE osd_printf_debug("alpha8201: PC = %03x, Unimplemented opcode = %02x,%02x\n", m_pc.w.l-2, op,imm); @@ -293,7 +293,7 @@ void alpha8201_cpu_device::M_UNDEFINED2() void alpha8201_cpu_device::stop() { - uint8_t pcptr = M_RDMEM(0x001) & 0x1f; + u8 pcptr = M_RDMEM(0x001) & 0x1f; M_WRMEM(pcptr,(M_RDMEM(pcptr)&0xf)+0x08); /* mark entry point ODD to HALT */ m_mb |= 0x08; /* mark internal HALT state */ } @@ -600,7 +600,7 @@ void alpha8201_cpu_device::device_reset() void alpha8201_cpu_device::execute_run() { unsigned opcode; - uint8_t pcptr; + u8 pcptr; if(m_halt) { @@ -688,7 +688,7 @@ void alpha8201_cpu_device::execute_set_input(int inputnum, int state) } -offs_t alpha8201_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) +offs_t alpha8201_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) { extern CPU_DISASSEMBLE( alpha8201 ); return CPU_DISASSEMBLE_NAME(alpha8201)(this, stream, pc, oprom, opram, options); diff --git a/src/devices/cpu/alph8201/alph8201.h b/src/devices/cpu/alph8201/alph8201.h index 2366ba3c474..2f098b4d779 100644 --- a/src/devices/cpu/alph8201/alph8201.h +++ b/src/devices/cpu/alph8201/alph8201.h @@ -20,11 +20,11 @@ cpu/alph8201/ will be removed when the alpha 8304 has been dumped. * * \**************************************************************************/ -#pragma once - #ifndef __ALPH8201_H__ #define __ALPH8201_H__ +#pragma once + enum { ALPHA8201_PC = STATE_GENPC, @@ -50,8 +50,8 @@ class alpha8201_cpu_device : public cpu_device { public: // construction/destruction - alpha8201_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - alpha8201_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); + alpha8201_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + alpha8201_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, const char *shortname, const char *source); protected: // device-level overrides @@ -59,9 +59,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - 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 1; } + virtual u32 execute_min_cycles() const override { return 1; } + virtual u32 execute_max_cycles() const override { return 16; } + virtual u32 execute_input_lines() const override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -74,25 +74,25 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - 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(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; + virtual u32 disasm_min_opcode_bytes() const override { return 1; } + virtual u32 disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) override; - uint8_t M_RDMEM(uint16_t A) { return m_program->read_byte(A); } - void M_WRMEM(uint16_t A,uint8_t V) { m_program->write_byte(A, V); } - uint8_t M_RDOP(uint16_t A) { return m_direct->read_byte(A); } - uint8_t M_RDOP_ARG(uint16_t A) { return m_direct->read_byte(A); } - uint8_t RD_REG(uint8_t x) { return m_RAM[(m_regPtr<<3)+(x)]; } - void WR_REG(uint8_t x, uint8_t d) { m_RAM[(m_regPtr<<3)+(x)]=(d); } + u8 M_RDMEM(u16 A) { return m_program->read_byte(A); } + void M_WRMEM(u16 A, u8 V) { m_program->write_byte(A, V); } + u8 M_RDOP(u16 A) { return m_direct->read_byte(A); } + u8 M_RDOP_ARG(u16 A) { return m_direct->read_byte(A); } + u8 RD_REG(u8 x) { return m_RAM[(m_regPtr<<3)+(x)]; } + void WR_REG(u8 x, u8 d) { m_RAM[(m_regPtr<<3)+(x)]=(d); } unsigned M_RDMEM_OPCODE(); - void M_ADD(uint8_t dat); - void M_ADDB(uint8_t dat); - void M_SUB(uint8_t dat); - void M_AND(uint8_t dat); - void M_OR(uint8_t dat); - void M_XOR(uint8_t dat); - void M_JMP(uint8_t dat); + void M_ADD(u8 dat); + void M_ADDB(u8 dat); + void M_SUB(u8 dat); + void M_AND(u8 dat); + void M_OR(u8 dat); + void M_XOR(u8 dat); + void M_JMP(u8 dat); void M_UNDEFINED(); void M_UNDEFINED2(); @@ -102,10 +102,10 @@ protected: void nop() { } void rora() { m_cf = m_A &1; m_A = (m_A>>1) | (m_A<<7); } void rola() { m_cf = (m_A>>7)&1; m_A = (m_A<<1) | (m_A>>7); } - void inc_b() { M_ADDB(0x02); } - void dec_b() { M_ADDB(0xfe); } - void inc_a() { M_ADD(0x01); } - void dec_a() { M_ADD(0xff); } + void inc_b() { M_ADDB(0x02); } + void dec_b() { M_ADDB(0xfe); } + void inc_a() { M_ADD(0x01); } + void dec_a() { M_ADD(0xff); } void cpl() { m_A ^= 0xff; }; void ld_a_ix0_0() { m_A = M_RDMEM(m_ix0.w.l+0); } @@ -290,26 +290,26 @@ protected: void ld_lp2_n() { m_lp2 = M_RDMEM_OPCODE(); } void ld_b_n() { m_B = M_RDMEM_OPCODE(); } - void djnz_lp0() { uint8_t i=M_RDMEM_OPCODE(); m_lp0--; if (m_lp0 != 0) M_JMP(i); } - void djnz_lp1() { uint8_t i=M_RDMEM_OPCODE(); m_lp1--; if (m_lp1 != 0) M_JMP(i); } - void djnz_lp2() { uint8_t i=M_RDMEM_OPCODE(); m_lp2--; if (m_lp2 != 0) M_JMP(i); } - void jnz() { uint8_t i=M_RDMEM_OPCODE(); if (!m_zf) M_JMP(i); } - void jnc() { uint8_t i=M_RDMEM_OPCODE(); if (!m_cf) M_JMP(i);} - void jz() { uint8_t i=M_RDMEM_OPCODE(); if ( m_zf) M_JMP(i); } - void jc() { uint8_t i=M_RDMEM_OPCODE(); if ( m_cf) M_JMP(i);} - void jmp() { M_JMP(M_RDMEM_OPCODE() ); } + void djnz_lp0() { u8 i=M_RDMEM_OPCODE(); m_lp0--; if (m_lp0 != 0) M_JMP(i); } + void djnz_lp1() { u8 i=M_RDMEM_OPCODE(); m_lp1--; if (m_lp1 != 0) M_JMP(i); } + void djnz_lp2() { u8 i=M_RDMEM_OPCODE(); m_lp2--; if (m_lp2 != 0) M_JMP(i); } + void jnz() { u8 i=M_RDMEM_OPCODE(); if (!m_zf) M_JMP(i); } + void jnc() { u8 i=M_RDMEM_OPCODE(); if (!m_cf) M_JMP(i);} + void jz() { u8 i=M_RDMEM_OPCODE(); if ( m_zf) M_JMP(i); } + void jc() { u8 i=M_RDMEM_OPCODE(); if ( m_cf) M_JMP(i);} + void jmp() { M_JMP(M_RDMEM_OPCODE() ); } void stop(); /* ALPHA 8301 : added instruction */ - void exg_a_ix0() { uint8_t t=m_A; m_A = m_ix0.b.l; m_ix0.b.l = t; } - void exg_a_ix1() { uint8_t t=m_A; m_A = m_ix1.b.l; m_ix1.b.l = t; } - void exg_a_ix2() { uint8_t t=m_A; m_A = m_ix2.b.l; m_ix2.b.l = t; } - void exg_a_lp0() { uint8_t t=m_A; m_A = m_lp0; m_lp0 = t; } - void exg_a_lp1() { uint8_t t=m_A; m_A = m_lp1; m_lp1 = t; } - void exg_a_lp2() { uint8_t t=m_A; m_A = m_lp2; m_lp2 = t; } - void exg_a_b() { uint8_t t=m_A; m_A = m_B; m_B = t; } - void exg_a_rb() { uint8_t t=m_A; m_A = m_regPtr; m_regPtr = t; } + void exg_a_ix0() { u8 t=m_A; m_A = m_ix0.b.l; m_ix0.b.l = t; } + void exg_a_ix1() { u8 t=m_A; m_A = m_ix1.b.l; m_ix1.b.l = t; } + void exg_a_ix2() { u8 t=m_A; m_A = m_ix2.b.l; m_ix2.b.l = t; } + void exg_a_lp0() { u8 t=m_A; m_A = m_lp0; m_lp0 = t; } + void exg_a_lp1() { u8 t=m_A; m_A = m_lp1; m_lp1 = t; } + void exg_a_lp2() { u8 t=m_A; m_A = m_lp2; m_lp2 = t; } + void exg_a_b() { u8 t=m_A; m_A = m_B; m_B = t; } + void exg_a_rb() { u8 t=m_A; m_A = m_regPtr; m_regPtr = t; } void ld_ix0_a() { m_ix0.b.l = m_A; } void ld_ix1_a() { m_ix1.b.l = m_A; } @@ -320,8 +320,8 @@ protected: void ld_b_a() { m_B = m_A; } void ld_rb_a() { m_regPtr = m_A; } - void exg_ix0_ix1() { uint8_t t=m_ix1.b.l; m_ix1.b.l = m_ix0.b.l; m_ix0.b.l = t; } - void exg_ix0_ix2() { uint8_t t=m_ix2.b.l; m_ix2.b.l = m_ix0.b.l; m_ix0.b.l = t; } + void exg_ix0_ix1() { u8 t=m_ix1.b.l; m_ix1.b.l = m_ix0.b.l; m_ix0.b.l = t; } + void exg_ix0_ix2() { u8 t=m_ix2.b.l; m_ix2.b.l = m_ix0.b.l; m_ix0.b.l = t; } void op_d4() { m_A = M_RDMEM( ((m_RAM[(7<<3)+7] & 3) << 8) | M_RDMEM_OPCODE() ); } void op_d5() { M_WRMEM( ((m_RAM[(7<<3)+7] & 3) << 8) | M_RDMEM_OPCODE(), m_A ); } @@ -337,16 +337,16 @@ protected: void op_rep_ld_b_ix0() { do { m_RAM[(m_B>>1)&0x3f] = M_RDMEM(m_ix0.w.l); m_ix0.b.l++; m_B+=2; m_lp0--; } while (m_lp0 != 0); } void ld_rxb_a() { m_RAM[(m_B>>1)&0x3f] = m_A; } void ld_a_rxb() { m_A = m_RAM[(m_B>>1)&0x3f]; } - void cmp_a_rxb() { uint8_t i=m_RAM[(m_B>>1)&0x3f]; m_zf = (m_A==i); m_cf = (m_A>=i); } + void cmp_a_rxb() { u8 i=m_RAM[(m_B>>1)&0x3f]; m_zf = (m_A==i); m_cf = (m_A>=i); } void xor_a_rxb() { M_XOR(m_RAM[(m_B>>1)&0x3f] ); } void add_a_cf() { if (m_cf) inc_a(); } void sub_a_cf() { if (m_cf) dec_a(); } - void tst_a() { m_zf = (m_A==0); } - void clr_a() { m_A = 0; m_zf = (m_A==0); } - void cmp_a_n() { uint8_t i=M_RDMEM_OPCODE(); m_zf = (m_A==i); m_cf = (m_A>=i); } + void tst_a() { m_zf = (m_A==0); } + void clr_a() { m_A = 0; m_zf = (m_A==0); } + void cmp_a_n() { u8 i=M_RDMEM_OPCODE(); m_zf = (m_A==i); m_cf = (m_A>=i); } void xor_a_n() { M_XOR(M_RDMEM_OPCODE() ); } - void call() { uint8_t i=M_RDMEM_OPCODE(); m_retptr.w.l = m_pc.w.l; M_JMP(i); }; + void call() { u8 i=M_RDMEM_OPCODE(); m_retptr.w.l = m_pc.w.l; M_JMP(i); }; void ld_a_ix0_a() { m_A = M_RDMEM(m_ix0.w.l+m_A); } void ret() { m_mb = m_retptr.b.h; M_JMP( m_retptr.b.l ); }; void save_zc() { m_savez = m_zf; m_savec = m_cf; }; @@ -366,27 +366,27 @@ protected: address_space_config m_program_config; address_space_config m_io_config; - uint8_t m_RAM[8*8]; /* internal GP register 8 * 8bank */ + u8 m_RAM[8*8]; /* internal GP register 8 * 8bank */ unsigned m_PREVPC; PAIR m_retptr; /* for 8301, return address of CALL */ PAIR m_pc; /* 2bit+8bit program counter */ - uint8_t m_regPtr; /* RB register base */ - uint8_t m_mb; /* MB memory bank reg. latch after Branch */ - uint8_t m_cf; /* C flag */ - uint8_t m_zf; /* Z flag */ - uint8_t m_savec; /* for 8301, save flags */ - uint8_t m_savez; /* for 8301, save flags */ -// - PAIR m_ix0; /* 8bit memory read index reg. */ - PAIR m_ix1; /* 8bitmemory read index reg. */ - PAIR m_ix2; /* 8bitmemory write index reg. */ - uint8_t m_lp0; /* 8bit loop reg. */ - uint8_t m_lp1; /* 8bit loop reg. */ - uint8_t m_lp2; /* 8bit loop reg. */ - uint8_t m_A; /* 8bit accumulator */ - uint8_t m_B; /* 8bit register */ -// - uint8_t m_halt; /* halt input line */ + u8 m_regPtr; /* RB register base */ + u8 m_mb; /* MB memory bank reg. latch after Branch */ + u8 m_cf; /* C flag */ + u8 m_zf; /* Z flag */ + u8 m_savec; /* for 8301, save flags */ + u8 m_savez; /* for 8301, save flags */ + + PAIR m_ix0; /* 8bit memory read index reg. */ + PAIR m_ix1; /* 8bitmemory read index reg. */ + PAIR m_ix2; /* 8bitmemory write index reg. */ + u8 m_lp0; /* 8bit loop reg. */ + u8 m_lp1; /* 8bit loop reg. */ + u8 m_lp2; /* 8bit loop reg. */ + u8 m_A; /* 8bit accumulator */ + u8 m_B; /* 8bit register */ + + u8 m_halt; /* halt input line */ address_space *m_program; direct_read_data *m_direct; @@ -396,9 +396,9 @@ protected: const s_opcode *m_opmap; // Used for import/export only - uint8_t m_sp; - uint8_t m_R[8]; - uint8_t m_flags; + u8 m_sp; + u8 m_R[8]; + u8 m_flags; }; @@ -406,7 +406,7 @@ class alpha8301_cpu_device : public alpha8201_cpu_device { public: // construction/destruction - alpha8301_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + alpha8301_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); }; diff --git a/src/devices/video/mc6847.h b/src/devices/video/mc6847.h index 996fddbce13..1d408c5f560 100644 --- a/src/devices/video/mc6847.h +++ b/src/devices/video/mc6847.h @@ -202,7 +202,7 @@ protected: } }; - // artificator internal class + // artificater internal class class artifacter { public: diff --git a/src/mame/drivers/lordgun.cpp b/src/mame/drivers/lordgun.cpp index caa9c2b3036..d80dfc1d1b8 100644 --- a/src/mame/drivers/lordgun.cpp +++ b/src/mame/drivers/lordgun.cpp @@ -900,7 +900,7 @@ Game modes explained: NOTE: Speakers should be connected serially to Speaker (+) and Speaker (-). - You must avoid connecting speakers parallely or connecting speakers + You must avoid connecting speakers parallelly or connecting speakers to Speaker (+) and GND, to keep the amplifier from being damaged or from malfunctioning. diff --git a/src/mame/video/stic.h b/src/mame/video/stic.h index f80c91955cb..14b1bf1999e 100644 --- a/src/mame/video/stic.h +++ b/src/mame/video/stic.h @@ -177,7 +177,7 @@ enum * +-+-+-+-+-+-+----+----+----+----+----+----+----+----+----+----+ * * * * SPRn 1=collision with sprite #n * - * BKGD 1=collision with set background bit * + * BKGD 1=collision with set background bit * * BRDR 1=collision with screen border * * * **************************************************************************** diff --git a/src/osd/modules/render/drawd3d.cpp b/src/osd/modules/render/drawd3d.cpp index ec1a8af0898..d0a1ce6c9d1 100644 --- a/src/osd/modules/render/drawd3d.cpp +++ b/src/osd/modules/render/drawd3d.cpp @@ -852,7 +852,7 @@ try_again: m_adapter, D3DDEVTYPE_HAL, device_hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, &m_presentation, &m_device); if (FAILED(result)) { - // if we got a "DEVICELOST" error, it may be transistory; count it and only fail if + // if we got a "DEVICELOST" error, it may be transitory; count it and only fail if // we exceed a threshold if (result == D3DERR_DEVICELOST) {