diff options
author | 2012-09-16 05:24:30 +0000 | |
---|---|---|
committer | 2012-09-16 05:24:30 +0000 | |
commit | 1a301849034da9956b893453acce8e0f9168e150 (patch) | |
tree | a39f7a6c6b4c54b7993e58cd22ea6b6bd25f37cf /src | |
parent | 91f928d6cd774c9526c7fde7e0860aded24d08a5 (diff) |
Final round of struct/union/enum normalization.
Diffstat (limited to 'src')
243 files changed, 906 insertions, 981 deletions
diff --git a/src/emu/cpu/alph8201/alph8201.c b/src/emu/cpu/alph8201/alph8201.c index f4c11bd19e8..363401bf7ba 100644 --- a/src/emu/cpu/alph8201/alph8201.c +++ b/src/emu/cpu/alph8201/alph8201.c @@ -204,10 +204,10 @@ struct alpha8201_state }; /* The opcode table now is a combination of cycle counts and function pointers */ -typedef struct { +struct s_opcode { unsigned cycles; void (*function) (alpha8201_state *cpustate); -} s_opcode; +}; #define PC pc.w.l diff --git a/src/emu/cpu/am29000/am29000.c b/src/emu/cpu/am29000/am29000.c index 4c117d9500a..b4b27fd9f93 100644 --- a/src/emu/cpu/am29000/am29000.c +++ b/src/emu/cpu/am29000/am29000.c @@ -75,7 +75,7 @@ STRUCTURES & TYPEDEFS ***************************************************************************/ -typedef struct _am29000_state +struct am29000_state { INT32 icount; UINT32 pc; @@ -136,7 +136,7 @@ typedef struct _am29000_state address_space *data; direct_read_data *datadirect; address_space *io; -} am29000_state; +}; /*************************************************************************** diff --git a/src/emu/cpu/am29000/am29ops.h b/src/emu/cpu/am29000/am29ops.h index f23189a043a..972778904e4 100644 --- a/src/emu/cpu/am29000/am29ops.h +++ b/src/emu/cpu/am29000/am29ops.h @@ -61,11 +61,11 @@ STRUCTS ***************************************************************************/ -typedef struct _op_info +struct op_info { void (*opcode)(am29000_state *); UINT32 flags; -} op_info; +}; /*************************************************************************** diff --git a/src/emu/cpu/apexc/apexcdsm.c b/src/emu/cpu/apexc/apexcdsm.c index 61752703f74..fcc5650bffa 100644 --- a/src/emu/cpu/apexc/apexcdsm.c +++ b/src/emu/cpu/apexc/apexcdsm.c @@ -61,14 +61,13 @@ The X value shows where the data word is located, and the Y value is the address of the next instruction. */ -enum _format_type {branch, shiftl, shiftr, multiply, store, swap, one_address, two_address}; -typedef enum _format_type format_type; +enum format_type {branch, shiftl, shiftr, multiply, store, swap, one_address, two_address}; -typedef struct instr_desc +struct instr_desc { const char *mnemonic; format_type format; /* -> X and Y are format */ -} instr_desc; +}; static const instr_desc instructions[16] = { diff --git a/src/emu/cpu/cop400/cop400.c b/src/emu/cpu/cop400/cop400.c index 6b571e7d648..263e62a447b 100644 --- a/src/emu/cpu/cop400/cop400.c +++ b/src/emu/cpu/cop400/cop400.c @@ -82,7 +82,7 @@ TYPE DEFINITIONS ***************************************************************************/ -typedef struct _cop400_opcode_map cop400_opcode_map; +struct cop400_opcode_map; struct cop400_state { @@ -151,7 +151,7 @@ struct cop400_state typedef void (*cop400_opcode_func) (cop400_state *cpustate, UINT8 opcode); -struct _cop400_opcode_map { +struct cop400_opcode_map { unsigned cycles; cop400_opcode_func function; }; diff --git a/src/emu/cpu/cop400/cop400.h b/src/emu/cpu/cop400/cop400.h index 2540a0d4aa0..1b0a0dfdf0e 100644 --- a/src/emu/cpu/cop400/cop400.h +++ b/src/emu/cpu/cop400/cop400.h @@ -73,30 +73,27 @@ enum }; /* CKI bonding options */ -enum _cop400_cki_bond { +enum cop400_cki_bond { COP400_CKI_DIVISOR_4 = 4, COP400_CKI_DIVISOR_8 = 8, COP400_CKI_DIVISOR_16 = 16, COP400_CKI_DIVISOR_32 = 32 }; -typedef enum _cop400_cki_bond cop400_cki_bond; /* CKO bonding options */ -enum _cop400_cko_bond { +enum cop400_cko_bond { COP400_CKO_OSCILLATOR_OUTPUT = 0, COP400_CKO_RAM_POWER_SUPPLY, COP400_CKO_HALT_IO_PORT, COP400_CKO_SYNC_INPUT, COP400_CKO_GENERAL_PURPOSE_INPUT }; -typedef enum _cop400_cko_bond cop400_cko_bond; /* microbus bonding options */ -enum _cop400_microbus { +enum cop400_microbus { COP400_MICROBUS_DISABLED = 0, COP400_MICROBUS_ENABLED }; -typedef enum _cop400_microbus cop400_microbus; /* interface */ struct cop400_interface diff --git a/src/emu/cpu/dsp56k/dsp56ops.c b/src/emu/cpu/dsp56k/dsp56ops.c index 56b7460a684..221145de9d1 100644 --- a/src/emu/cpu/dsp56k/dsp56ops.c +++ b/src/emu/cpu/dsp56k/dsp56ops.c @@ -34,12 +34,11 @@ enum dataType { DT_BYTE, DT_DOUBLE_WORD, DT_LONG_WORD }; -struct _typed_pointer +struct typed_pointer { void* addr; char data_type; }; -typedef struct _typed_pointer typed_pointer; //#define ADDRESS(X) (X<<1) #define BITS(CUR,MASK) (Dsp56kOpMask(CUR,MASK)) diff --git a/src/emu/cpu/e132xs/e132xs.c b/src/emu/cpu/e132xs/e132xs.c index 055627f8e4b..c5a532a0741 100644 --- a/src/emu/cpu/e132xs/e132xs.c +++ b/src/emu/cpu/e132xs/e132xs.c @@ -285,7 +285,7 @@ enum /* Delay information */ -struct _delay +struct delay_info { INT32 delay_cmd; UINT32 delay_pc; @@ -315,7 +315,7 @@ struct hyperstone_state UINT8 timer_int_pending; emu_timer *timer; - struct _delay delay; + delay_info delay; device_irq_acknowledge_callback irq_callback; legacy_cpu_device *device; diff --git a/src/emu/cpu/f8/f8.c b/src/emu/cpu/f8/f8.c index f696c37449e..616c7322c4c 100644 --- a/src/emu/cpu/f8/f8.c +++ b/src/emu/cpu/f8/f8.c @@ -39,8 +39,7 @@ #define cS 4 #define cL 6 -typedef struct _f8_Regs f8_Regs; -struct _f8_Regs +struct f8_Regs { UINT16 pc0; /* program counter 0 */ UINT16 pc1; /* program counter 1 */ diff --git a/src/emu/cpu/hcd62121/hcd62121.c b/src/emu/cpu/hcd62121/hcd62121.c index 30b80ea3f19..9a892590883 100644 --- a/src/emu/cpu/hcd62121/hcd62121.c +++ b/src/emu/cpu/hcd62121/hcd62121.c @@ -15,7 +15,7 @@ Martin Poupe's site can be found at http://prg.rkk.cz/~mpoupe/ #include "hcd62121.h" -struct _hcd62121_state +struct hcd62121_state { UINT32 prev_pc; UINT16 sp; @@ -36,8 +36,6 @@ struct _hcd62121_state int icount; }; -typedef struct _hcd62121_state hcd62121_state; - /* From the battery check routine at 20:e874 it looks like bit 3 of the flag register should be the Zero flag. */ diff --git a/src/emu/cpu/i86/i86.c b/src/emu/cpu/i86/i86.c index ebafea4fcd1..bafca70648f 100644 --- a/src/emu/cpu/i86/i86.c +++ b/src/emu/cpu/i86/i86.c @@ -22,12 +22,11 @@ extern int i386_dasm_one(char *buffer, UINT32 eip, const UINT8 *oprom, int mode) /* I86 registers */ -typedef union +union i8086basicregs { /* eight general registers */ UINT16 w[8]; /* viewed as 16 bits registers */ UINT8 b[16]; /* or as 8 bit registers */ -} -i8086basicregs; +}; struct i8086_state { diff --git a/src/emu/cpu/i860/i860.h b/src/emu/cpu/i860/i860.h index 8f3d4a8d74e..773be12beb5 100644 --- a/src/emu/cpu/i860/i860.h +++ b/src/emu/cpu/i860/i860.h @@ -55,7 +55,7 @@ DECLARE_LEGACY_CPU_DEVICE(I860, i860); ***************************************************************************/ /* i860 state. */ -typedef struct { +struct i860_state_t { /* Integer registers (32 x 32-bits). */ UINT32 iregs[32]; @@ -173,7 +173,7 @@ typedef struct { UINT32 ppc; int icount; -} i860_state_t; +}; INLINE i860_state_t *get_safe_token(device_t *device) { diff --git a/src/emu/cpu/lr35902/lr35902d.c b/src/emu/cpu/lr35902/lr35902d.c index aa1bfccd4e8..fc1a0958962 100644 --- a/src/emu/cpu/lr35902/lr35902d.c +++ b/src/emu/cpu/lr35902/lr35902d.c @@ -58,11 +58,11 @@ static const UINT32 s_flags[] = { _OVER,0 ,0 ,0 }; -typedef struct +struct lr35902dasm { UINT8 mnemonic; const char *arguments; -} lr35902dasm; +}; static const lr35902dasm mnemonic_cb[256] = { {zRLC,"b"}, {zRLC,"c"}, {zRLC,"d"}, {zRLC,"e"}, diff --git a/src/emu/cpu/m6502/m4510.c b/src/emu/cpu/m6502/m4510.c index b23de572fff..9b8afb813fd 100644 --- a/src/emu/cpu/m6502/m4510.c +++ b/src/emu/cpu/m6502/m4510.c @@ -120,8 +120,7 @@ z: xxxx address bits a19 .. a16 for memory accesses with a15 1 ? #define LOG(x) do { if (VERBOSE) logerror x; } while (0) -typedef struct _m4510_Regs m4510_Regs; -struct _m4510_Regs { +struct m4510_Regs { void (*const *insn)(m4510_Regs *); /* pointer to the function pointer table */ PAIR ppc; /* previous program counter */ PAIR pc; /* program counter */ diff --git a/src/emu/cpu/m6502/m6502.c b/src/emu/cpu/m6502/m6502.c index 68ae825dae4..203b07d313b 100644 --- a/src/emu/cpu/m6502/m6502.c +++ b/src/emu/cpu/m6502/m6502.c @@ -48,8 +48,7 @@ /**************************************************************************** * The 6502 registers. ****************************************************************************/ -typedef struct _m6502_Regs m6502_Regs; -struct _m6502_Regs +struct m6502_Regs { UINT8 subtype; /* currently selected cpu sub type */ void (*const *insn)(m6502_Regs *); /* pointer to the function pointer table */ diff --git a/src/emu/cpu/m6502/m6509.c b/src/emu/cpu/m6502/m6509.c index 99e9abd1b64..1978c7483f3 100644 --- a/src/emu/cpu/m6502/m6509.c +++ b/src/emu/cpu/m6502/m6509.c @@ -56,8 +56,7 @@ addresses take place. #define LOG(x) do { if (VERBOSE) logerror x; } while (0) -typedef struct _m6509_Regs m6509_Regs; -struct _m6509_Regs { +struct m6509_Regs { UINT8 subtype; /* currently selected cpu sub type */ void (*const *insn)(m6509_Regs *); /* pointer to the function pointer table */ PAIR ppc; /* previous program counter */ diff --git a/src/emu/cpu/m6502/m65ce02.c b/src/emu/cpu/m6502/m65ce02.c index 3f2fd6356ef..4eae03063a4 100644 --- a/src/emu/cpu/m6502/m65ce02.c +++ b/src/emu/cpu/m6502/m65ce02.c @@ -55,8 +55,7 @@ #define LOG(x) do { if (VERBOSE) logerror x; } while (0) -typedef struct _m65ce02_Regs m65ce02_Regs; -struct _m65ce02_Regs { +struct m65ce02_Regs { void (*const *insn)(m65ce02_Regs *); /* pointer to the function pointer table */ PAIR ppc; /* previous program counter */ PAIR pc; /* program counter */ diff --git a/src/emu/cpu/m68000/m68kcpu.h b/src/emu/cpu/m68000/m68kcpu.h index 044eccef392..a264f2cf21a 100644 --- a/src/emu/cpu/m68000/m68kcpu.h +++ b/src/emu/cpu/m68000/m68kcpu.h @@ -529,8 +529,7 @@ typedef class _m68ki_cpu_core m68ki_cpu_core; /* =============================== PROTOTYPES ============================= */ /* ======================================================================== */ -typedef union _fp_reg fp_reg; -union _fp_reg +union fp_reg { UINT64 i; double f; diff --git a/src/emu/cpu/minx/minxd.c b/src/emu/cpu/minx/minxd.c index c51f0f833d0..305d3d55614 100644 --- a/src/emu/cpu/minx/minxd.c +++ b/src/emu/cpu/minx/minxd.c @@ -91,11 +91,11 @@ static const UINT32 s_flags[] = { 0, 0, 0, 0, 0, }; -typedef struct { +struct minxdasm { UINT8 mnemonic; UINT8 argument1; UINT8 argument2; -} minxdasm; +}; static const minxdasm mnemonic[256] = { /* 00 - 0F */ diff --git a/src/emu/cpu/mips/mips3com.h b/src/emu/cpu/mips/mips3com.h index 032ad248f9e..9402022a41f 100644 --- a/src/emu/cpu/mips/mips3com.h +++ b/src/emu/cpu/mips/mips3com.h @@ -33,7 +33,7 @@ #define MIPS3_CAUSE_READ_CYCLES 250 /* MIPS flavors */ -enum _mips3_flavor +enum mips3_flavor { /* MIPS III variants */ MIPS3_TYPE_MIPS_III, @@ -48,7 +48,6 @@ enum _mips3_flavor MIPS3_TYPE_QED5271, MIPS3_TYPE_RM7000 }; -typedef enum _mips3_flavor mips3_flavor; /* TLB bits */ #define TLB_GLOBAL 0x01 @@ -176,7 +175,7 @@ struct mips3_tlb_entry /* forward declaration of implementation-specific state */ -typedef struct _mips3imp_state mips3imp_state; +struct mips3imp_state; /* MIPS3 state */ diff --git a/src/emu/cpu/mips/mips3drc.c b/src/emu/cpu/mips/mips3drc.c index 609e92732c1..cf6d12430ed 100644 --- a/src/emu/cpu/mips/mips3drc.c +++ b/src/emu/cpu/mips/mips3drc.c @@ -179,7 +179,7 @@ struct compiler_state /* MIPS3 registers */ -struct _mips3imp_state +struct mips3imp_state { /* core state */ drc_cache * cache; /* pointer to the DRC code cache */ diff --git a/src/emu/cpu/mn10200/mn10200.c b/src/emu/cpu/mn10200/mn10200.c index 279b995a872..c63e1a11ca5 100644 --- a/src/emu/cpu/mn10200/mn10200.c +++ b/src/emu/cpu/mn10200/mn10200.c @@ -34,29 +34,29 @@ struct mn102_info UINT16 psw; UINT16 mdr; - struct _simple_timer { - UINT8 mode; - UINT8 base; - UINT8 cur; + struct { + UINT8 mode; + UINT8 base; + UINT8 cur; } simple_timer[NUM_TIMERS_8BIT]; emu_timer *timer_timers[NUM_TIMERS_8BIT]; - struct _prescaler { - UINT8 cycles; - UINT8 mode; + struct { + UINT8 cycles; + UINT8 mode; } prescaler[NUM_PRESCALERS]; - struct _dma { - UINT32 adr; - UINT32 count; - UINT16 iadr; - UINT8 ctrll, ctrlh, irq; + struct { + UINT32 adr; + UINT32 count; + UINT16 iadr; + UINT8 ctrll, ctrlh, irq; } dma[8]; - struct _serial { - UINT8 ctrll, ctrlh; - UINT8 buf; + struct { + UINT8 ctrll, ctrlh; + UINT8 buf; } serial[2]; UINT8 ddr[8]; diff --git a/src/emu/cpu/pic16c5x/16c5xdsm.c b/src/emu/cpu/pic16c5x/16c5xdsm.c index dcaa0d86cd2..18fa45cb1a1 100644 --- a/src/emu/cpu/pic16c5x/16c5xdsm.c +++ b/src/emu/cpu/pic16c5x/16c5xdsm.c @@ -86,13 +86,13 @@ static const char *const PIC16C5xFormats[] = { #define MAX_OPS (((sizeof(PIC16C5xFormats) / sizeof(PIC16C5xFormats[0])) - 1) / PTRS_PER_FORMAT) -typedef struct opcode { +struct PIC16C5xOpcode { word mask; /* instruction mask */ word bits; /* constant bits */ word extcode; /* value that gets extension code */ const char *parse; /* how to parse bits */ const char *fmt; /* instruction format */ -} PIC16C5xOpcode; +}; static PIC16C5xOpcode Op[MAX_OPS+1]; static int OpInizialized = 0; diff --git a/src/emu/cpu/pic16c62x/16c62xdsm.c b/src/emu/cpu/pic16c62x/16c62xdsm.c index 208e2145f57..90edbf2adda 100644 --- a/src/emu/cpu/pic16c62x/16c62xdsm.c +++ b/src/emu/cpu/pic16c62x/16c62xdsm.c @@ -96,13 +96,13 @@ static const char *const PIC16C62xFormats[] = { #define MAX_OPS (((sizeof(PIC16C62xFormats) / sizeof(PIC16C62xFormats[0])) - 1) / PTRS_PER_FORMAT) -typedef struct opcode { +struct PIC16C62xOpcode { word mask; /* instruction mask */ word bits; /* constant bits */ word extcode; /* value that gets extension code */ const char *parse; /* how to parse bits */ const char *fmt; /* instruction format */ -} PIC16C62xOpcode; +}; static PIC16C62xOpcode Op[MAX_OPS+1]; static int OpInizialized = 0; diff --git a/src/emu/cpu/powerpc/ppccom.h b/src/emu/cpu/powerpc/ppccom.h index e474e4fa6ec..5c58c8bd642 100644 --- a/src/emu/cpu/powerpc/ppccom.h +++ b/src/emu/cpu/powerpc/ppccom.h @@ -44,7 +44,7 @@ #define PPCCAP_604_MMU 0x100 /* TRUE if we have 604-class MMU features */ /* PowerPC flavors */ -enum _powerpc_flavor +enum powerpc_flavor { PPC_MODEL_403GA = 0x00200000, PPC_MODEL_403GB = 0x00200100, @@ -75,7 +75,6 @@ enum _powerpc_flavor PPC_MODEL_MPC8241 = 0x80811014, /* "Kahlua Lt" */ PPC_MODEL_MPC8245 = 0x80811014, /* "Kahlua II" */ }; -typedef enum _powerpc_flavor powerpc_flavor; /* exception types */ @@ -504,7 +503,7 @@ struct ppc4xx_spu_state /* forward declaration of implementation-specific state */ -typedef struct _ppcimp_state ppcimp_state; +struct ppcimp_state; /* PowerPC state */ diff --git a/src/emu/cpu/powerpc/ppcdrc.c b/src/emu/cpu/powerpc/ppcdrc.c index 5cd33a0b256..c44e48b3996 100644 --- a/src/emu/cpu/powerpc/ppcdrc.c +++ b/src/emu/cpu/powerpc/ppcdrc.c @@ -158,7 +158,7 @@ struct compiler_state /* PowerPC implementation state */ -struct _ppcimp_state +struct ppcimp_state { /* core state */ drc_cache * cache; /* pointer to the DRC code cache */ diff --git a/src/emu/cpu/psx/psx.h b/src/emu/cpu/psx/psx.h index 6c984186f5f..2770d004e26 100644 --- a/src/emu/cpu/psx/psx.h +++ b/src/emu/cpu/psx/psx.h @@ -440,9 +440,7 @@ extern const device_type CXD8606CQ; -typedef struct _DasmPSXCPU_state DasmPSXCPU_state; - -struct _DasmPSXCPU_state +struct DasmPSXCPU_state { UINT32 pc; int delayr; diff --git a/src/emu/cpu/rsp/rsp.h b/src/emu/cpu/rsp/rsp.h index 308b3ed86e2..8b8b1f7fdb7 100644 --- a/src/emu/cpu/rsp/rsp.h +++ b/src/emu/cpu/rsp/rsp.h @@ -153,7 +153,7 @@ union ACCUMULATOR_REG INT16 w[4]; }; -typedef struct _rspimp_state rspimp_state; +struct rspimp_state; struct rsp_state { const rsp_config *config; diff --git a/src/emu/cpu/rsp/rspdrc.c b/src/emu/cpu/rsp/rspdrc.c index 0d114f64600..41f0f412463 100644 --- a/src/emu/cpu/rsp/rspdrc.c +++ b/src/emu/cpu/rsp/rspdrc.c @@ -100,7 +100,7 @@ struct compiler_state code_label labelnum; /* index for local labels */ }; -struct _rspimp_state +struct rspimp_state { /* core state */ drc_cache * cache; /* pointer to the DRC code cache */ diff --git a/src/emu/cpu/saturn/saturnds.c b/src/emu/cpu/saturn/saturnds.c index 46e1760549a..1acfafa36ee 100644 --- a/src/emu/cpu/saturn/saturnds.c +++ b/src/emu/cpu/saturn/saturnds.c @@ -552,7 +552,7 @@ static const struct { }; -enum _opcode_sel +enum opcode_sel { Complete=-1, Illegal, @@ -570,9 +570,8 @@ enum _opcode_sel OpcodeE, OpcodeF }; -typedef enum _opcode_sel opcode_sel; -enum _opcode_adr +enum opcode_adr { AdrNone, AdrAF, AdrA, AdrB, AdrCount, @@ -584,7 +583,6 @@ enum _opcode_adr FieldP, FieldWP, FieldXS, FieldX, FieldS, FieldM, FieldB, FieldW, FieldA, AdrImmCount }; -typedef enum _opcode_adr opcode_adr; struct OPCODE { diff --git a/src/emu/cpu/se3208/se3208dis.c b/src/emu/cpu/se3208/se3208dis.c index a348d2b070e..82c758496c7 100644 --- a/src/emu/cpu/se3208/se3208dis.c +++ b/src/emu/cpu/se3208/se3208dis.c @@ -3,7 +3,7 @@ #include "se3208.h" -static struct _DisSE3208 +static struct { UINT32 PC; UINT32 SR; diff --git a/src/emu/cpu/sharc/sharc.c b/src/emu/cpu/sharc/sharc.c index c844825dc7d..58a08f13e49 100644 --- a/src/emu/cpu/sharc/sharc.c +++ b/src/emu/cpu/sharc/sharc.c @@ -88,8 +88,7 @@ struct DMA_OP bool active; }; -typedef struct _SHARC_REGS SHARC_REGS; -struct _SHARC_REGS +struct SHARC_REGS { UINT32 pc; SHARC_REG r[16]; diff --git a/src/emu/cpu/sm8500/sm8500d.c b/src/emu/cpu/sm8500/sm8500d.c index 7ea4eb3fa58..f2746ebad19 100644 --- a/src/emu/cpu/sm8500/sm8500d.c +++ b/src/emu/cpu/sm8500/sm8500d.c @@ -65,11 +65,11 @@ static const UINT32 s_flags[] = { 0, 0, 0 }; -typedef struct +struct sm8500dasm { UINT8 mnemonic; UINT8 arguments; -} sm8500dasm; +}; static const char *const sm8500_cond[16] = { "F", "LT", "LE", "ULE", "OV", "MI", "Z", "C", diff --git a/src/emu/cpu/tlcs90/tlcs90.c b/src/emu/cpu/tlcs90/tlcs90.c index 26b4cfbd010..fbada882f9f 100644 --- a/src/emu/cpu/tlcs90/tlcs90.c +++ b/src/emu/cpu/tlcs90/tlcs90.c @@ -10,22 +10,22 @@ #include "debugger.h" #include "tlcs90.h" -typedef enum { UNKNOWN, NOP, EX, EXX, LD, LDW, LDA, LDI, LDIR, LDD, LDDR, CPI, CPIR, CPD, CPDR, PUSH, POP, JP, JR, CALL, CALLR, RET, RETI, HALT, DI, EI, SWI, DAA, CPL, NEG, LDAR, RCF, SCF, CCF, TSET, BIT, SET, RES, INC, DEC, INCX, DECX, INCW, DECW, ADD, ADC, SUB, SBC, AND, XOR, OR, CP, RLC, RRC, RL, RR, SLA, SRA, SLL, SRL, RLD, RRD, DJNZ, MUL, DIV } _e_op; +enum _e_op { UNKNOWN, NOP, EX, EXX, LD, LDW, LDA, LDI, LDIR, LDD, LDDR, CPI, CPIR, CPD, CPDR, PUSH, POP, JP, JR, CALL, CALLR, RET, RETI, HALT, DI, EI, SWI, DAA, CPL, NEG, LDAR, RCF, SCF, CCF, TSET, BIT, SET, RES, INC, DEC, INCX, DECX, INCW, DECW, ADD, ADC, SUB, SBC, AND, XOR, OR, CP, RLC, RRC, RL, RR, SLA, SRA, SLL, SRL, RLD, RRD, DJNZ, MUL, DIV }; typedef UINT8 e_op; static const char *const op_names[] = { "??", "nop", "ex", "exx", "ld", "ldw", "lda", "ldi", "ldir", "ldd", "lddr", "cpi", "cpir", "cpd", "cpdr", "push", "pop", "jp", "jr", "call", "callr", "ret", "reti", "halt", "di", "ei", "swi", "daa", "cpl", "neg", "ldar", "rcf", "scf", "ccf", "tset", "bit", "set", "res", "inc", "dec", "incx", "decx", "incw", "decw", "add", "adc", "sub", "sbc", "and", "xor", "or", "cp", "rlc", "rrc", "rl", "rr", "sla", "sra", "sll", "srl", "rld", "rrd", "djnz", "mul", "div" }; -typedef enum { +enum e_mode { MODE_NONE, MODE_BIT8, MODE_CC, MODE_I8, MODE_D8, MODE_R8, MODE_I16, MODE_D16, MODE_R16, MODE_MI16, MODE_MR16, MODE_MR16D8, MODE_MR16R8, MODE_R16D8, MODE_R16R8 -} e_mode; +}; ALLOW_SAVE_TYPE(e_mode); // allow save_item on a non-fundamental type typedef UINT16 e_r; -typedef struct +struct t90_Regs { PAIR prvpc,pc,sp,af,bc,de,hl,ix,iy; PAIR af2,bc2,de2,hl2; @@ -59,7 +59,7 @@ typedef struct UINT32 addr; -} t90_Regs; +}; INLINE t90_Regs *get_safe_token(device_t *device) { @@ -1280,7 +1280,7 @@ INT2 P82 Rising Edge - *************************************************************************************************************/ -typedef enum { INTSWI = 0, INTNMI, INTWD, INT0, INTT0, INTT1, INTT2, INTT3, INTT4, INT1, INTT5, INT2, INTRX, INTTX, INTMAX } e_irq; +enum e_irq { INTSWI = 0, INTNMI, INTWD, INT0, INTT0, INTT1, INTT2, INTT3, INTT4, INT1, INTT5, INT2, INTRX, INTTX, INTMAX }; DECLARE_ENUM_OPERATORS(e_irq) INLINE void leave_halt(t90_Regs *cpustate) diff --git a/src/emu/cpu/tlcs90/tlcs90.h b/src/emu/cpu/tlcs90/tlcs90.h index e584d444e97..f90723b3640 100644 --- a/src/emu/cpu/tlcs90/tlcs90.h +++ b/src/emu/cpu/tlcs90/tlcs90.h @@ -13,7 +13,7 @@ CPU_DISASSEMBLE( t90 ); #define T90_IOBASE 0xffc0 -typedef enum +enum e_ir { T90_P0=T90_IOBASE, T90_P1, T90_P01CR_IRFL, T90_IRFH, T90_P2, T90_P2CR, T90_P3, T90_P3CR, T90_P4, T90_P4CR, T90_P5, T90_SMMOD, T90_P6, T90_P7, T90_P67CR, T90_SMCR, @@ -21,6 +21,6 @@ typedef enum T90_TCLK, T90_TFFCR, T90_TMOD, T90_TRUN, T90_CAP1L, T90_CAP1H, T90_CAP2L, T90_CAL2H, T90_TREG4L, T90_TREG4H, T90_TREG5L, T90_TREG5H, T90_T4MOD, T90_T4FFCR, T90_INTEL, T90_INTEH, T90_DMAEH, T90_SCMOD, T90_SCCR, T90_SCBUF, T90_BX, T90_BY, T90_ADREG, T90_ADMOD -} e_ir; +}; #endif /* __TLCS90_H__ */ diff --git a/src/emu/cpu/tms32010/32010dsm.c b/src/emu/cpu/tms32010/32010dsm.c index 9bc4edcfedf..37bc63b690c 100644 --- a/src/emu/cpu/tms32010/32010dsm.c +++ b/src/emu/cpu/tms32010/32010dsm.c @@ -156,13 +156,13 @@ static const char *const TMS32010Formats[] = { #define MAX_OPS (((sizeof(TMS32010Formats) / sizeof(TMS32010Formats[0])) - 1) / PTRS_PER_FORMAT) -typedef struct opcode { +struct TMS32010Opcode { word mask; /* instruction mask */ word bits; /* constant bits */ word extcode; /* value that gets extension code */ const char *parse; /* how to parse bits */ const char *fmt; /* instruction format */ -} TMS32010Opcode; +}; static TMS32010Opcode Op[MAX_OPS+1]; static int OpInizialized = 0; diff --git a/src/emu/cpu/tms32010/tms32010.c b/src/emu/cpu/tms32010/tms32010.c index abb696acfe7..7ce87d70a2e 100644 --- a/src/emu/cpu/tms32010/tms32010.c +++ b/src/emu/cpu/tms32010/tms32010.c @@ -76,8 +76,7 @@ -typedef struct _tms32010_state tms32010_state; /* Page 3-6 shows all registers */ -struct _tms32010_state +struct tms32010_state { /******************** CPU Internal Registers *******************/ UINT16 PC; diff --git a/src/emu/cpu/tms32025/32025dsm.c b/src/emu/cpu/tms32025/32025dsm.c index eafda068b59..4115e5ff965 100644 --- a/src/emu/cpu/tms32025/32025dsm.c +++ b/src/emu/cpu/tms32025/32025dsm.c @@ -316,13 +316,13 @@ static const char *const TMS32025Formats[] = { #define MAX_OPS (((sizeof(TMS32025Formats) / sizeof(TMS32025Formats[0])) - 1) / PTRS_PER_FORMAT) -typedef struct opcode { +struct TMS32025Opcode { word mask; /* instruction mask */ word bits; /* constant bits */ word extcode; /* value that gets extension code */ const char *parse; /* how to parse bits */ const char *fmt; /* instruction format */ -} TMS32025Opcode; +}; static TMS32025Opcode Op[MAX_OPS+1]; static int OpInizialized = 0; diff --git a/src/emu/cpu/tms32025/tms32025.c b/src/emu/cpu/tms32025/tms32025.c index d31a1452f3d..53976a27757 100644 --- a/src/emu/cpu/tms32025/tms32025.c +++ b/src/emu/cpu/tms32025/tms32025.c @@ -137,9 +137,7 @@ Table 3-2. TMS32025/26 Memory Blocks -typedef struct _tms32025_state tms32025_state; /* Page 3-6 (45) shows all registers */ -struct _tms32025_state - +struct tms32025_state { /******************** CPU Internal Registers *******************/ UINT16 PREVPC; /* previous program counter */ @@ -198,15 +196,13 @@ struct tms32025_opcode void (*function)(tms32025_state *); }; /* opcode table entry (Opcode CE has sub-opcodes) */ -typedef struct _tms32025_opcode_CE tms32025_opcode_CE; -struct _tms32025_opcode_CE +struct tms32025_opcode_CE { UINT8 cycles; void (*function)(tms32025_state *); }; /* opcode table entry (Opcode Dx has sub-opcodes) */ -typedef struct _tms32025_opcode_Dx tms32025_opcode_Dx; -struct _tms32025_opcode_Dx +struct tms32025_opcode_Dx { UINT8 cycles; void (*function)(tms32025_state *); diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c index 43511e1136d..ba1e9963a76 100644 --- a/src/emu/cpu/tms34010/tms34010.c +++ b/src/emu/cpu/tms34010/tms34010.c @@ -29,8 +29,7 @@ ***************************************************************************/ /* TMS34010 State */ -typedef struct _XY XY; -struct _XY +struct XY { #ifdef LSB_FIRST INT16 x; diff --git a/src/emu/cpu/tms7000/tms7000.c b/src/emu/cpu/tms7000/tms7000.c index a9766421c1f..346f2bb9b14 100644 --- a/src/emu/cpu/tms7000/tms7000.c +++ b/src/emu/cpu/tms7000/tms7000.c @@ -36,7 +36,7 @@ #define LOG(x) do { if (VERBOSE) logerror x; } while (0) -typedef struct _tms7000_state tms7000_state; +struct tms7000_state; /* Private prototypes */ @@ -64,7 +64,7 @@ static UINT16 bcd_sub( UINT16 a, UINT16 b); #define PULLBYTE(b) b = RM(pSP); pSP-- #define PULLWORD(w) w.b.l = RM(pSP); pSP--; w.b.h = RM(pSP); pSP-- -struct _tms7000_state +struct tms7000_state { PAIR pc; /* Program counter */ UINT8 sp; /* Stack Pointer */ diff --git a/src/emu/cpu/tms9900/9900dasm.c b/src/emu/cpu/tms9900/9900dasm.c index 6be25b8a40b..2391ac660cf 100644 --- a/src/emu/cpu/tms9900/9900dasm.c +++ b/src/emu/cpu/tms9900/9900dasm.c @@ -73,12 +73,12 @@ enum sd_11_15 = 0x200 /* bits 11-15 should be cleared in lwpi, limi, idle, rset, rtwp, ckon, ckof, lrex */ }; -typedef struct description_t +struct description_t { const char *mnemonic; format_t format; int flags; -} description_t; +}; enum opcodes { diff --git a/src/emu/cpu/tms9900/99xxcore.h b/src/emu/cpu/tms9900/99xxcore.h index 6bc090d0518..6d50dfb148b 100644 --- a/src/emu/cpu/tms9900/99xxcore.h +++ b/src/emu/cpu/tms9900/99xxcore.h @@ -257,7 +257,7 @@ Other references can be found on spies.com: */ #define USE_16_BIT_ACCESSORS ((TMS99XX_MODEL == TI990_10_ID) || (TMS99XX_MODEL == TMS9900_ID) || (TMS99XX_MODEL == TMS9940_ID) || (IS_99000)) -typedef struct _tms99xx_state tms99xx_state; +struct tms99xx_state; INLINE void execute(tms99xx_state *cpustate, UINT16 opcode); @@ -394,13 +394,13 @@ a ST_MASK */ #define R14 28 #define R15 30 -typedef struct map_file_t +struct map_file_t { UINT16 L[3], B[3]; /* actual registers */ UINT32 limit[3], bias[3]; /* equivalent in a more convenient form */ -} map_file_t; +}; -struct _tms99xx_state +struct tms99xx_state { /* "actual" tms9900 registers : */ UINT16 WP; /* Workspace pointer */ diff --git a/src/emu/cpu/tms9900/tms9900.h b/src/emu/cpu/tms9900/tms9900.h index d0260a7d13e..43f57c5e600 100644 --- a/src/emu/cpu/tms9900/tms9900.h +++ b/src/emu/cpu/tms9900/tms9900.h @@ -109,7 +109,7 @@ static const char opname[][5] = "*int" }; -typedef struct _tms99xx_config +struct tms99xx_config { devcb_write8 external_callback; devcb_read8 irq_level; @@ -117,7 +117,7 @@ typedef struct _tms99xx_config devcb_write_line clock_out; devcb_write_line wait_line; devcb_write_line holda_line; -} tms99xx_config; +}; #define TMS99xx_CONFIG(name) \ const tms99xx_config(name) = @@ -270,20 +270,20 @@ private: typedef void (tms99xx_device::*ophandler)(void); // Opcode list entry - typedef struct _tms_instruction + struct tms_instruction { UINT16 opcode; int id; int format; microprogram prog; // Microprogram - } tms_instruction; + }; // Lookup table entry - typedef struct _lookup_entry + struct lookup_entry { - struct _lookup_entry *next_digit; + lookup_entry *next_digit; const tms_instruction *entry; - } lookup_entry; + }; // Pointer to the lookup table lookup_entry* m_command_lookup_table; diff --git a/src/emu/cpu/tms9900/tms9900l.h b/src/emu/cpu/tms9900/tms9900l.h index e2e778d96d7..3ca20312bed 100644 --- a/src/emu/cpu/tms9900/tms9900l.h +++ b/src/emu/cpu/tms9900/tms9900l.h @@ -61,14 +61,14 @@ DECLARE_LEGACY_CPU_DEVICE(TI990_10L, ti990_10l); structure with the parameters ti990_10_reset wants. */ -typedef struct ti990_10reset_param +struct ti990_10reset_param { ti99xx_idle_func idle_callback; ti99xx_rset_func rset_callback; ti99xx_lrex_func lrex_callback; ti99xx_ckon_ckof_func ckon_ckof_callback; ti99xx_error_interrupt_func error_interrupt_callback; -} ti990_10reset_param; +}; /* accessor for the internal ROM */ extern READ16_HANDLER(ti990_10_internal_r); @@ -87,10 +87,10 @@ DECLARE_LEGACY_CPU_DEVICE(TMS9900L, tms9900l); /* structure with optional parameters for tms9900_reset. */ -typedef struct tms9900reset_param +struct tms9900reset_param { ti99xx_idle_func idle_callback; -} tms9900reset_param; +}; @@ -99,10 +99,10 @@ typedef struct tms9900reset_param /* structure with optional parameters for tms9940_reset. */ -typedef struct tms9940reset_param +struct tms9940reset_param { ti99xx_idle_func idle_callback; -} tms9940reset_param; +}; @@ -111,10 +111,10 @@ DECLARE_LEGACY_CPU_DEVICE(TMS9980L, tms9980al); /* structure with optional parameters for tms9980a_reset. */ -typedef struct tms9980areset_param +struct tms9980areset_param { ti99xx_idle_func idle_callback; -} tms9980areset_param; +}; @@ -123,10 +123,10 @@ typedef struct tms9980areset_param /*// structure with optional parameters for tms9985_reset. */ -typedef struct tms9985reset_param +struct tms9985reset_param { ti99xx_idle_func idle_callback; -} tms9985reset_param; +}; @@ -135,10 +135,10 @@ typedef struct tms9985reset_param /* structure with optional parameters for tms9989_reset. */ -typedef struct tms9989reset_param +struct tms9989reset_param { ti99xx_idle_func idle_callback; -} tms9989reset_param; +}; @@ -147,7 +147,7 @@ DECLARE_LEGACY_CPU_DEVICE(TMS9995L, tms9995l); /* structure with the parameters tms9995_reset wants. */ -typedef struct tms9995reset_param +struct tms9995reset_param { /* auto_wait_state : a non-zero value makes tms9995 generate a wait state automatically on each memory access */ @@ -159,7 +159,7 @@ typedef struct tms9995reset_param disabled. This chip is used by the ti99/8 so that internal RAM does not prevent the mapper from working correctly. */ int is_mp9537; -} tms9995reset_param; +}; /* accessor for the first 252 bytes of internal RAM */ extern READ8_HANDLER(tms9995_internal1_r); @@ -175,10 +175,10 @@ extern WRITE8_HANDLER(tms9995_internal2_w); /* structure with optional parameters for tms99000_reset. */ -typedef struct tms99000reset_param +struct tms99000reset_param { ti99xx_idle_func idle_callback; -} tms99000reset_param; +}; @@ -187,10 +187,10 @@ typedef struct tms99000reset_param /* structure with optional parameters for tms99105a_reset. */ -typedef struct tms99105areset_param +struct tms99105areset_param { ti99xx_idle_func idle_callback; -} tms99105areset_param; +}; @@ -199,10 +199,10 @@ typedef struct tms99105areset_param /* structure with optional parameters for tms99110a_reset. */ -typedef struct tms99110areset_param +struct tms99110areset_param { ti99xx_idle_func idle_callback; -} tms99110areset_param; +}; unsigned Dasm9900 (char *buffer, unsigned pc, int model_id, const UINT8 *oprom, const UINT8 *opram); diff --git a/src/emu/cpu/tms9900/tms9995.h b/src/emu/cpu/tms9900/tms9995.h index 7688ba9a90c..72933e78c02 100644 --- a/src/emu/cpu/tms9900/tms9995.h +++ b/src/emu/cpu/tms9900/tms9995.h @@ -60,7 +60,7 @@ enum Configuration for the TMS9995. The connections are provided by the main board which contains the processor. */ -typedef struct _tms9995_config +struct tms9995_config { devcb_write8 external_callback; devcb_write_line iaq_line; @@ -69,7 +69,7 @@ typedef struct _tms9995_config devcb_write_line holda_line; int mode; int overflow; -} tms9995_config; +}; #define TMS9995_CONFIG(name) \ const tms9995_config(name) = @@ -283,14 +283,14 @@ private: // ============== Prefetch support ===================== - typedef struct _decoded_instruction + struct decoded_instruction { UINT16 IR; UINT16 command; const UINT8* program; bool byteop; int state; - } decoded_instruction; + }; int m_instindex; @@ -312,20 +312,20 @@ private: typedef void (tms9995_device::*ophandler)(void); // Opcode list entry - typedef struct _tms_instruction + struct tms_instruction { UINT16 opcode; int id; int format; microprogram prog; // Microprogram - } tms_instruction; + }; // Lookup table entry - typedef struct _lookup_entry + struct lookup_entry { - struct _lookup_entry *next_digit; + lookup_entry *next_digit; const tms_instruction *entry; - } lookup_entry; + }; // Pointer to the lookup table; the entry point for searching the command lookup_entry* m_command_lookup_table; diff --git a/src/emu/cpu/unsp/unsp.h b/src/emu/cpu/unsp/unsp.h index b6209c4dff7..9e0481dfe90 100644 --- a/src/emu/cpu/unsp/unsp.h +++ b/src/emu/cpu/unsp/unsp.h @@ -11,7 +11,7 @@ #ifndef __UNSP_H__ #define __UNSP_H__ -typedef struct _unspimp_state unspimp_state; +struct unspimp_state; struct unsp_state { UINT16 r[16]; diff --git a/src/emu/cpu/vtlb.c b/src/emu/cpu/vtlb.c index 4e364f59011..b6092f4ecae 100644 --- a/src/emu/cpu/vtlb.c +++ b/src/emu/cpu/vtlb.c @@ -28,7 +28,7 @@ ***************************************************************************/ /* VTLB state */ -struct _vtlb_state +struct vtlb_state { cpu_device * cpudevice; /* CPU device */ address_spacenum space; /* address space */ diff --git a/src/emu/cpu/vtlb.h b/src/emu/cpu/vtlb.h index 3777668fa99..98805fe949e 100644 --- a/src/emu/cpu/vtlb.h +++ b/src/emu/cpu/vtlb.h @@ -43,7 +43,7 @@ typedef UINT32 vtlb_entry; /* opaque structure describing VTLB state */ -typedef struct _vtlb_state vtlb_state; +struct vtlb_state; diff --git a/src/emu/cpu/x86log.c b/src/emu/cpu/x86log.c index 159b0044018..e72483e823f 100644 --- a/src/emu/cpu/x86log.c +++ b/src/emu/cpu/x86log.c @@ -48,7 +48,7 @@ struct data_range_t /* the code logging context */ -struct _x86log_context +struct x86log_context { astring filename; /* name of the file */ FILE * file; /* file we are logging to */ diff --git a/src/emu/cpu/x86log.h b/src/emu/cpu/x86log.h index ddaebfe43c6..ff3834c0208 100644 --- a/src/emu/cpu/x86log.h +++ b/src/emu/cpu/x86log.h @@ -22,7 +22,7 @@ TYPE DEFINITIONS ***************************************************************************/ -typedef struct _x86log_context x86log_context; +struct x86log_context; diff --git a/src/emu/cpu/z180/z180dasm.c b/src/emu/cpu/z180/z180dasm.c index a772bb0e2cf..21fcc66f39b 100644 --- a/src/emu/cpu/z180/z180dasm.c +++ b/src/emu/cpu/z180/z180dasm.c @@ -73,10 +73,10 @@ static const char *const s_mnemonic[] = { "slp" ,"sra" ,"srl" ,"sub" ,"tst" ,"tstio","xor " }; -typedef struct { +struct z80dasm { UINT8 mnemonic; const char *arguments; -} z80dasm; +}; static const z80dasm mnemonic_xx_cb[256]= { {zRLC,"b=Y"}, {zRLC,"c=Y"}, {zRLC,"d=Y"}, {zRLC,"e=Y"}, diff --git a/src/emu/cpu/z80/z80dasm.c b/src/emu/cpu/z80/z80dasm.c index f0b494e67d0..f9cd3a72d78 100644 --- a/src/emu/cpu/z80/z80dasm.c +++ b/src/emu/cpu/z80/z80dasm.c @@ -65,11 +65,11 @@ static const UINT32 s_flags[] = 0 ,0 ,0 ,0 ,0 }; -typedef struct +struct z80dasm { UINT8 mnemonic; const char *arguments; -} z80dasm; +}; static const z80dasm mnemonic_xx_cb[256] = { diff --git a/src/emu/cpu/z8000/z8000.c b/src/emu/cpu/z8000/z8000.c index bfc515cb12c..47a79ca2d57 100644 --- a/src/emu/cpu/z8000/z8000.c +++ b/src/emu/cpu/z8000/z8000.c @@ -56,8 +56,7 @@ #define LOG(x) do { if (VERBOSE) logerror x; } while (0) -typedef union _z8000_reg_file z8000_reg_file; -union _z8000_reg_file +union z8000_reg_file { UINT8 B[16]; /* RL0,RH0,RL1,RH1...RL7,RH7 */ UINT16 W[16]; /* R0,R1,R2...R15 */ @@ -65,8 +64,7 @@ union _z8000_reg_file UINT64 Q[4]; /* RQ0,RQ4,..RQ12 */ }; -/* In z8000cpu.h: typedef struct _z8000_state z8000_state; */ -struct _z8000_state +struct z8000_state { UINT32 op[4]; /* opcodes/data of current instruction */ UINT32 ppc; /* previous program counter */ diff --git a/src/emu/cpu/z8000/z8000cpu.h b/src/emu/cpu/z8000/z8000cpu.h index ff38255dd07..2054f00ba0e 100644 --- a/src/emu/cpu/z8000/z8000cpu.h +++ b/src/emu/cpu/z8000/z8000cpu.h @@ -189,25 +189,25 @@ #define GET_DSP16 UINT32 dsp16 = addr_add(cpustate, cpustate->pc, (INT16)get_operand(cpustate, 1)) #define GET_ADDR(o) UINT32 addr = (UINT32)get_addr_operand(cpustate, o) -typedef struct _z8000_state z8000_state; +struct z8000_state; /* structure for the opcode definition table */ -typedef struct { +struct Z8000_init { int beg, end, step; int size, cycles; void (*opcode)(z8000_state *cpustate); const char *dasm; UINT32 dasmflags; -} Z8000_init; +}; /* structure for the opcode execution table / disassembler */ -typedef struct { +struct Z8000_exec { void (*opcode)(z8000_state *cpustate); int cycles; int size; const char *dasm; UINT32 dasmflags; -} Z8000_exec; +}; /* opcode execution table */ extern Z8000_exec *z8000_exec; diff --git a/src/emu/debug/textbuf.c b/src/emu/debug/textbuf.c index 08b8fb2214e..0721c75327f 100644 --- a/src/emu/debug/textbuf.c +++ b/src/emu/debug/textbuf.c @@ -26,8 +26,7 @@ TYPE DEFINITIONS ***************************************************************************/ -/* typedef struct _text_buffer text_buffer; -- declared in textbuf.h */ -struct _text_buffer +struct text_buffer { char * buffer; INT32 * lineoffs; diff --git a/src/emu/debug/textbuf.h b/src/emu/debug/textbuf.h index 64347dab179..86b66caa952 100644 --- a/src/emu/debug/textbuf.h +++ b/src/emu/debug/textbuf.h @@ -17,7 +17,7 @@ TYPE DEFINITIONS ***************************************************************************/ -typedef struct _text_buffer text_buffer; +struct text_buffer; diff --git a/src/emu/emupal.c b/src/emu/emupal.c index dd3b0df3988..8bf85386e7a 100644 --- a/src/emu/emupal.c +++ b/src/emu/emupal.c @@ -39,7 +39,6 @@ struct shadow_table_data }; -/* typedef struct _palette_private palette_private; */ struct palette_private { bitmap_format format; /* format assumed for palette data */ @@ -57,7 +56,6 @@ struct palette_private }; -/* typedef struct _colortable_t colortable_t; */ class colortable_t { public: diff --git a/src/emu/hashfile.c b/src/emu/hashfile.c index 14e37b8f638..a7da359c420 100644 --- a/src/emu/hashfile.c +++ b/src/emu/hashfile.c @@ -24,7 +24,7 @@ struct hash_info const char *extrainfo; }; -typedef struct _hash_file hash_file; +struct hash_file; typedef void (*hashfile_error_func)(const char *message); @@ -47,7 +47,7 @@ const hash_info *hashfile_lookup(hash_file *hashfile, const hash_collection *has TYPE DEFINITIONS ***************************************************************************/ -struct _hash_file +struct hash_file { emu_file *file; object_pool *pool; diff --git a/src/emu/imagedev/cassette.h b/src/emu/imagedev/cassette.h index d43681d9ffa..3d273b93251 100644 --- a/src/emu/imagedev/cassette.h +++ b/src/emu/imagedev/cassette.h @@ -13,7 +13,7 @@ #include "formats/cassimg.h" -enum _cassette_state +enum cassette_state { /* this part of the state is controlled by the UI */ CASSETTE_STOPPED = 0, @@ -33,8 +33,6 @@ enum _cassette_state CASSETTE_MASK_DRVSTATE = 12 }; -typedef enum _cassette_state cassette_state; - /*************************************************************************** TYPE DEFINITIONS diff --git a/src/emu/machine/74181.c b/src/emu/machine/74181.c index dca07ad01fe..3232d9b54cf 100644 --- a/src/emu/machine/74181.c +++ b/src/emu/machine/74181.c @@ -16,8 +16,7 @@ -typedef struct _TTL74181_state TTL74181_state; -struct _TTL74181_state +struct TTL74181_state { UINT8 inputs[TTL74181_INPUT_TOTAL]; UINT8 outputs[TTL74181_OUTPUT_TOTAL]; diff --git a/src/emu/machine/pic8259.c b/src/emu/machine/pic8259.c index aef316bcccc..e0e9bda9c70 100644 --- a/src/emu/machine/pic8259.c +++ b/src/emu/machine/pic8259.c @@ -29,9 +29,7 @@ enum pic8259_state_t STATE_READY }; -typedef struct pic8259 pic8259_t; - -struct pic8259 +struct pic8259_t { devcb_resolved_write_line out_int_func; diff --git a/src/emu/machine/scsicb.h b/src/emu/machine/scsicb.h index e9cff5385fd..83144bd31e3 100644 --- a/src/emu/machine/scsicb.h +++ b/src/emu/machine/scsicb.h @@ -23,8 +23,7 @@ MCFG_DEVICE_CONFIG(_intf) -typedef struct _SCSICB_interface SCSICB_interface; -struct _SCSICB_interface +struct SCSICB_interface { void (*line_change_cb)(device_t *, UINT8 line, UINT8 state); diff --git a/src/emu/machine/tms9901.h b/src/emu/machine/tms9901.h index df154ab1da8..6f7be85bb1e 100644 --- a/src/emu/machine/tms9901.h +++ b/src/emu/machine/tms9901.h @@ -50,13 +50,13 @@ enum CLASS DEFINITION ***************************************************************************/ -typedef struct _tms9901_interface +struct tms9901_interface { int interrupt_mask; // a bit for each input pin whose state is always notified to the TMS9901 core devcb_read8 read_handler; // 4*8 bits, to be selected using the offset (0-3) devcb_write_line write_handler[16]; // 16 Pn outputs devcb_write8 interrupt_callback; // called when interrupt bus state changes -} tms9901_interface; +}; class tms9901_device : public device_t { diff --git a/src/emu/machine/tms9902.h b/src/emu/machine/tms9902.h index 530814deb6f..9efb0ded5c1 100644 --- a/src/emu/machine/tms9902.h +++ b/src/emu/machine/tms9902.h @@ -42,13 +42,13 @@ extern const device_type TMS9902; -typedef struct _tms9902_interface +struct tms9902_interface { devcb_write_line int_callback; devcb_write_line rcv_callback; devcb_write8 xmit_callback; devcb_write8 ctrl_callback; -} tms9902_interface; +}; class tms9902_device : public device_t { diff --git a/src/emu/sound.h b/src/emu/sound.h index 7f4e3dd095a..05385c14285 100644 --- a/src/emu/sound.h +++ b/src/emu/sound.h @@ -60,7 +60,7 @@ //************************************************************************** // forward references -typedef struct _wav_file wav_file; +struct wav_file; // structure describing an indexed mixer diff --git a/src/emu/sound/aica.c b/src/emu/sound/aica.c index 1d660884f26..94e84cf476e 100644 --- a/src/emu/sound/aica.c +++ b/src/emu/sound/aica.c @@ -81,11 +81,11 @@ static const double DRTimes[64]={100000/*infinity*/,100000/*infinity*/,118200.0, 28.0,25.0,22.0,18.0,14.0,12.0,11.0,8.5,7.1,6.1,5.4,4.3,3.6,3.1}; static INT32 EG_TABLE[0x400]; -enum _STATE {ATTACK,DECAY1,DECAY2,RELEASE}; -struct _EG +enum STATE {ATTACK,DECAY1,DECAY2,RELEASE}; +struct EG_t { int volume; // - _STATE state; + STATE state; int step; //step vals int AR; //Attack @@ -97,7 +97,7 @@ struct _EG UINT8 LPLINK; }; -struct _SLOT +struct SLOT { union { @@ -111,9 +111,9 @@ struct _SLOT UINT32 nxt_addr; //next play address UINT32 step; //pitch step (24.8) UINT8 Backwards; //the wave is playing backwards - struct _EG EG; //Envelope - struct _LFO PLFO; //Phase LFO - struct _LFO ALFO; //Amplitude LFO + EG_t EG; //Envelope + LFO_t PLFO; //Phase LFO + LFO_t ALFO; //Amplitude LFO int slot; int cur_sample; //current ADPCM sample int cur_quant; //current ADPCM step @@ -155,8 +155,7 @@ struct _SLOT #define SCITMA 6 #define SCITMB 7 -typedef struct _AICA aica_state; -struct _AICA +struct aica_state { union { @@ -165,7 +164,7 @@ struct _AICA } udata; UINT16 IRQL, IRQR; UINT16 EFSPAN[0x48]; - struct _SLOT Slots[64]; + SLOT Slots[64]; signed short RINGBUF[64]; unsigned char BUFPTR; unsigned char *AICARAM; @@ -200,7 +199,7 @@ struct _AICA int ARTABLE[64], DRTABLE[64]; - struct _AICADSP DSP; + AICADSP DSP; device_t *device; }; @@ -341,7 +340,7 @@ static int Get_RR(aica_state *AICA,int base,int R) return AICA->DRTABLE[Rate]; } -static void Compute_EG(aica_state *AICA,struct _SLOT *slot) +static void Compute_EG(aica_state *AICA,SLOT *slot) { int octave=(OCT(slot)^8)-8; int rate; @@ -358,9 +357,9 @@ static void Compute_EG(aica_state *AICA,struct _SLOT *slot) slot->EG.DL=0x1f-DL(slot); } -static void AICA_StopSlot(struct _SLOT *slot,int keyoff); +static void AICA_StopSlot(SLOT *slot,int keyoff); -static int EG_Update(struct _SLOT *slot) +static int EG_Update(SLOT *slot) { switch(slot->EG.state) { @@ -408,7 +407,7 @@ static int EG_Update(struct _SLOT *slot) return (slot->EG.volume>>EG_SHIFT)<<(SHIFT-10); } -static UINT32 AICA_Step(struct _SLOT *slot) +static UINT32 AICA_Step(SLOT *slot) { int octave=(OCT(slot)^8)-8+SHIFT-10; UINT32 Fn=FNS(slot) + (0x400); @@ -420,7 +419,7 @@ static UINT32 AICA_Step(struct _SLOT *slot) } -static void Compute_LFO(struct _SLOT *slot) +static void Compute_LFO(SLOT *slot) { if(PLFOS(slot)!=0) AICALFO_ComputeStep(&(slot->PLFO),LFOF(slot),PLFOWS(slot),PLFOS(slot),0); @@ -450,7 +449,7 @@ INLINE signed short DecodeADPCM(int *PrevSignal, unsigned char Delta, int *PrevQ return *PrevSignal; } -static void AICA_StartSlot(aica_state *AICA, struct _SLOT *slot) +static void AICA_StartSlot(aica_state *AICA, SLOT *slot) { UINT64 start_offset; @@ -480,7 +479,7 @@ static void AICA_StartSlot(aica_state *AICA, struct _SLOT *slot) } } -static void AICA_StopSlot(struct _SLOT *slot,int keyoff) +static void AICA_StopSlot(SLOT *slot,int keyoff) { if(keyoff /*&& slot->EG.state!=RELEASE*/) { @@ -628,7 +627,7 @@ static void AICA_Init(device_t *device, aica_state *AICA, const aica_interface * static void AICA_UpdateSlotReg(aica_state *AICA,int s,int r) { - struct _SLOT *slot=AICA->Slots+s; + SLOT *slot=AICA->Slots+s; int sl; switch(r&0x7f) { @@ -638,7 +637,7 @@ static void AICA_UpdateSlotReg(aica_state *AICA,int s,int r) { for(sl=0;sl<64;++sl) { - struct _SLOT *s2=AICA->Slots+sl; + SLOT *s2=AICA->Slots+sl; { if(KEYONB(s2) && s2->EG.state==RELEASE/*&& !s2->active*/) { @@ -848,7 +847,7 @@ static void AICA_UpdateRegR(aica_state *AICA, int reg) case 0x11: { int slotnum = MSLC(AICA); - struct _SLOT *slot=AICA->Slots + slotnum; + SLOT *slot=AICA->Slots + slotnum; UINT16 LP = 0; if (!(AFSEL(AICA))) { @@ -877,7 +876,7 @@ static void AICA_UpdateRegR(aica_state *AICA, int reg) case 0x15: { int slotnum = MSLC(AICA); - struct _SLOT *slot=AICA->Slots+slotnum; + SLOT *slot=AICA->Slots+slotnum; unsigned int CA = 0; if (PCMS(slot) == 0) // 16-bit samples @@ -1036,7 +1035,7 @@ static void AICA_TimersAddTicks(aica_state *AICA, int ticks) } #endif -INLINE INT32 AICA_UpdateSlot(aica_state *AICA, struct _SLOT *slot) +INLINE INT32 AICA_UpdateSlot(aica_state *AICA, SLOT *slot) { INT32 sample; int step=slot->step; @@ -1211,7 +1210,7 @@ static void AICA_DoMasterSamples(aica_state *AICA, int nsamples) // mix slots' direct output for(sl=0;sl<64;++sl) { - struct _SLOT *slot=AICA->Slots+sl; + SLOT *slot=AICA->Slots+sl; RBUFDST=AICA->RINGBUF+AICA->BUFPTR; if(AICA->Slots[sl].active) { diff --git a/src/emu/sound/aicadsp.c b/src/emu/sound/aicadsp.c index 8c5f6635995..b0ceff8a0b9 100644 --- a/src/emu/sound/aicadsp.c +++ b/src/emu/sound/aicadsp.c @@ -53,14 +53,14 @@ static INT32 UNPACK(UINT16 val) return uval; } -void aica_dsp_init(struct _AICADSP *DSP) +void aica_dsp_init(AICADSP *DSP) { - memset(DSP,0,sizeof(struct _AICADSP)); + memset(DSP,0,sizeof(AICADSP)); DSP->RBL=0x8000; DSP->Stopped=1; } -void aica_dsp_step(struct _AICADSP *DSP) +void aica_dsp_step(AICADSP *DSP) { INT32 ACC=0; //26 bit INT32 SHIFTED=0; //24 bit @@ -326,7 +326,7 @@ void aica_dsp_step(struct _AICADSP *DSP) // fclose(f); } -void aica_dsp_setsample(struct _AICADSP *DSP,INT32 sample,int SEL,int MXL) +void aica_dsp_setsample(AICADSP *DSP,INT32 sample,int SEL,int MXL) { //DSP->MIXS[SEL]+=sample<<(MXL+1)/*7*/; DSP->MIXS[SEL]+=sample; @@ -334,7 +334,7 @@ void aica_dsp_setsample(struct _AICADSP *DSP,INT32 sample,int SEL,int MXL) // int a=1; } -void aica_dsp_start(struct _AICADSP *DSP) +void aica_dsp_start(AICADSP *DSP) { int i; DSP->Stopped=0; diff --git a/src/emu/sound/aicadsp.h b/src/emu/sound/aicadsp.h index 9f256d68773..d766edf0221 100644 --- a/src/emu/sound/aicadsp.h +++ b/src/emu/sound/aicadsp.h @@ -4,7 +4,7 @@ #define __AICADSP_H__ //the DSP Context -struct _AICADSP +struct AICADSP { //Config UINT16 *AICARAM; @@ -32,9 +32,9 @@ struct _AICADSP int LastStep; }; -void aica_dsp_init(struct _AICADSP *DSP); -void aica_dsp_setsample(struct _AICADSP *DSP, INT32 sample, INT32 SEL, INT32 MXL); -void aica_dsp_step(struct _AICADSP *DSP); -void aica_dsp_start(struct _AICADSP *DSP); +void aica_dsp_init(AICADSP *DSP); +void aica_dsp_setsample(AICADSP *DSP, INT32 sample, INT32 SEL, INT32 MXL); +void aica_dsp_step(AICADSP *DSP); +void aica_dsp_start(AICADSP *DSP); #endif /* __AICADSP_H__ */ diff --git a/src/emu/sound/aicalfo.c b/src/emu/sound/aicalfo.c index f992ea29a2d..b61f25eb346 100644 --- a/src/emu/sound/aicalfo.c +++ b/src/emu/sound/aicalfo.c @@ -9,7 +9,7 @@ #define LFO_SHIFT 8 -struct _LFO +struct LFO_t { unsigned short phase; UINT32 phase_step; @@ -103,7 +103,7 @@ static void AICALFO_Init(running_machine &machine) } } -INLINE signed int AICAPLFO_Step(struct _LFO *LFO) +INLINE signed int AICAPLFO_Step(LFO_t *LFO) { int p; @@ -116,7 +116,7 @@ INLINE signed int AICAPLFO_Step(struct _LFO *LFO) return p<<(SHIFT-LFO_SHIFT); } -INLINE signed int AICAALFO_Step(struct _LFO *LFO) +INLINE signed int AICAALFO_Step(LFO_t *LFO) { int p; LFO->phase+=LFO->phase_step; @@ -128,7 +128,7 @@ INLINE signed int AICAALFO_Step(struct _LFO *LFO) return p<<(SHIFT-LFO_SHIFT); } -static void AICALFO_ComputeStep(struct _LFO *LFO,UINT32 LFOF,UINT32 LFOWS,UINT32 LFOS,int ALFO) +static void AICALFO_ComputeStep(LFO_t *LFO,UINT32 LFOF,UINT32 LFOWS,UINT32 LFOS,int ALFO) { float step=(float) LFOFreq[LFOF]*256.0/(float)44100.0; LFO->phase_step=(unsigned int) ((float) (1<<LFO_SHIFT)*step); diff --git a/src/emu/sound/disc_wav.h b/src/emu/sound/disc_wav.h index 2c711205a13..f0d37544ba6 100644 --- a/src/emu/sound/disc_wav.h +++ b/src/emu/sound/disc_wav.h @@ -103,7 +103,7 @@ class DISCRETE_CLASS_NAME(dss_inverter_osc): public discrete_base_node, public d DISCRETE_CLASS_CONSTRUCTOR(dss_inverter_osc, base) DISCRETE_CLASS_DESTRUCTOR(dss_inverter_osc) public: - typedef struct + struct description { double vB; double vOutLow; @@ -112,7 +112,7 @@ public: double vInRise; // voltage that triggers the gate input to go high (vGate) on rise double clamp; // voltage is clamped to -clamp ... vb+clamp if clamp>= 0; int options; // bitmaped options - } description; + }; enum { IS_TYPE1 = 0x00, IS_TYPE2 = 0x01, diff --git a/src/emu/sound/discrete.h b/src/emu/sound/discrete.h index 97837f5434c..46fe8c671a2 100644 --- a/src/emu/sound/discrete.h +++ b/src/emu/sound/discrete.h @@ -4177,7 +4177,7 @@ enum discrete_node_type * *************************************/ -typedef struct _discrete_sound_block discrete_block; +struct discrete_block; class discrete_node_base_factory; class discrete_task; class discrete_base_node; @@ -4202,7 +4202,7 @@ typedef dynamic_array_t<discrete_task *> task_list_t; * *************************************/ -struct _discrete_sound_block +struct discrete_block { int node; /* Output node number */ discrete_node_base_factory *factory; diff --git a/src/emu/sound/k007232.c b/src/emu/sound/k007232.c index 6ef4da8711b..15aa230ceef 100644 --- a/src/emu/sound/k007232.c +++ b/src/emu/sound/k007232.c @@ -30,7 +30,7 @@ added external port callback, and functions to set the volume of the channels #define KDAC_A_PCM_MAX (2) /* Channels per chip */ -typedef struct kdacApcm +struct KDAC_A_PCM { UINT8 vol[KDAC_A_PCM_MAX][2]; /* volume for the left and right channel */ UINT32 addr[KDAC_A_PCM_MAX]; @@ -48,7 +48,7 @@ typedef struct kdacApcm sound_stream * stream; const k007232_interface *intf; UINT32 fncode[0x200]; -} KDAC_A_PCM; +}; #define BASE_SHIFT (12) diff --git a/src/emu/sound/multipcm.c b/src/emu/sound/multipcm.c index 1f86058e85b..5a2f036229e 100644 --- a/src/emu/sound/multipcm.c +++ b/src/emu/sound/multipcm.c @@ -37,7 +37,7 @@ //???? #define MULTIPCM_CLOCKDIV (180.0) -struct _Sample +struct Sample_t { unsigned int Start; unsigned int Loop; @@ -48,12 +48,12 @@ struct _Sample unsigned char AM; }; -enum _STATE {ATTACK,DECAY1,DECAY2,RELEASE}; -ALLOW_SAVE_TYPE(_STATE); // allow save_item on a non-fundamental type -struct _EG +enum STATE {ATTACK,DECAY1,DECAY2,RELEASE}; +ALLOW_SAVE_TYPE(STATE); // allow save_item on a non-fundamental type +struct EG_t { int volume; // - _STATE state; + STATE state; int step; //step vals int AR; //Attack @@ -63,7 +63,7 @@ struct _EG int DL; //Decay level }; -struct _LFO +struct LFO_t { unsigned short phase; UINT32 phase_step; @@ -72,12 +72,12 @@ struct _LFO }; -struct _SLOT +struct SLOT { unsigned char Num; unsigned char Regs[8]; int Playing; - struct _Sample *Sample; + Sample_t *Sample; unsigned int Base; unsigned int offset; unsigned int step; @@ -85,17 +85,16 @@ struct _SLOT unsigned int DstTL; int TLStep; signed int Prev; - struct _EG EG; - struct _LFO PLFO; //Phase lfo - struct _LFO ALFO; //AM lfo + EG_t EG; + LFO_t PLFO; //Phase lfo + LFO_t ALFO; //AM lfo }; -typedef struct _MultiPCM MultiPCM; -struct _MultiPCM +struct MultiPCM { sound_stream * stream; - struct _Sample Samples[0x200]; //Max 512 samples - struct _SLOT Slots[28]; + Sample_t Samples[0x200]; //Max 512 samples + SLOT Slots[28]; unsigned int CurSlot; unsigned int Address; unsigned int BankR,BankL; @@ -150,7 +149,7 @@ static int TLSteps[2]; #define EG_SHIFT 16 -static int EG_Update(struct _SLOT *slot) +static int EG_Update(SLOT *slot) { switch(slot->EG.state) { @@ -202,7 +201,7 @@ static unsigned int Get_RATE(unsigned int *Steps,unsigned int rate,unsigned int return Steps[r]; } -static void EG_Calc(MultiPCM *ptChip,struct _SLOT *slot) +static void EG_Calc(MultiPCM *ptChip,SLOT *slot) { int octave=((slot->Regs[3]>>4)-1)&0xf; int rate; @@ -284,7 +283,7 @@ static void LFO_Init(void) } } -INLINE signed int PLFO_Step(struct _LFO *LFO) +INLINE signed int PLFO_Step(LFO_t *LFO) { int p; LFO->phase+=LFO->phase_step; @@ -293,7 +292,7 @@ INLINE signed int PLFO_Step(struct _LFO *LFO) return p<<(SHIFT-LFO_SHIFT); } -INLINE signed int ALFO_Step(struct _LFO *LFO) +INLINE signed int ALFO_Step(LFO_t *LFO) { int p; LFO->phase+=LFO->phase_step; @@ -302,7 +301,7 @@ INLINE signed int ALFO_Step(struct _LFO *LFO) return p<<(SHIFT-LFO_SHIFT); } -static void LFO_ComputeStep(MultiPCM *ptChip,struct _LFO *LFO,UINT32 LFOF,UINT32 LFOS,int ALFO) +static void LFO_ComputeStep(MultiPCM *ptChip,LFO_t *LFO,UINT32 LFOF,UINT32 LFOS,int ALFO) { float step=(float) LFOFreq[LFOF]*256.0/(float) ptChip->Rate; LFO->phase_step=(unsigned int) ((float) (1<<LFO_SHIFT)*step); @@ -320,7 +319,7 @@ static void LFO_ComputeStep(MultiPCM *ptChip,struct _LFO *LFO,UINT32 LFOF,UINT32 -static void WriteSlot(MultiPCM *ptChip,struct _SLOT *slot,int reg,unsigned char data) +static void WriteSlot(MultiPCM *ptChip,SLOT *slot,int reg,unsigned char data) { slot->Regs[reg]=data; @@ -333,7 +332,7 @@ static void WriteSlot(MultiPCM *ptChip,struct _SLOT *slot,int reg,unsigned char //according to YMF278 sample write causes some base params written to the regs (envelope+lfos) //the game should never change the sample while playing. { - struct _Sample *Sample=ptChip->Samples+slot->Regs[1]; + Sample_t *Sample=ptChip->Samples+slot->Regs[1]; WriteSlot(ptChip,slot,6,Sample->LFOVIB); WriteSlot(ptChip,slot,7,Sample->AM); } @@ -441,7 +440,7 @@ static STREAM_UPDATE( MultiPCM_update ) signed int smpr=0; for(sl=0;sl<28;++sl) { - struct _SLOT *slot=ptChip->Slots+sl; + SLOT *slot=ptChip->Slots+sl; if(slot->Playing) { unsigned int vol=(slot->TL>>SHIFT)|(slot->Pan<<7); diff --git a/src/emu/sound/nes_defs.h b/src/emu/sound/nes_defs.h index 0f3932fe575..280c96d7aa2 100644 --- a/src/emu/sound/nes_defs.h +++ b/src/emu/sound/nes_defs.h @@ -48,11 +48,11 @@ typedef UINT8 boolean; #define QUEUE_SIZE 0x2000 #define QUEUE_MAX (QUEUE_SIZE-1) -typedef struct queue_s +struct queue_t { int pos; unsigned char reg,val; -} queue_t; +}; #endif @@ -84,7 +84,7 @@ typedef struct queue_s /* CHANNEL TYPE DEFINITIONS */ /* Square Wave */ -typedef struct square_s +struct square_t { uint8 regs[4]; int vbl_length; @@ -96,10 +96,10 @@ typedef struct square_s uint8 adder; uint8 env_vol; boolean enabled; -} square_t; +}; /* Triangle Wave */ -typedef struct triangle_s +struct triangle_t { uint8 regs[4]; /* regs[1] unused */ int linear_length; @@ -110,10 +110,10 @@ typedef struct triangle_s uint8 adder; boolean counter_started; boolean enabled; -} triangle_t; +}; /* Noise Wave */ -typedef struct noise_s +struct noise_t { uint8 regs[4]; /* regs[1] unused */ int cur_pos; @@ -123,10 +123,10 @@ typedef struct noise_s float env_phase; uint8 env_vol; boolean enabled; -} noise_t; +}; /* DPCM Wave */ -typedef struct dpcm_s +struct dpcm_t { uint8 regs[4]; uint32 address; @@ -139,10 +139,10 @@ typedef struct dpcm_s boolean irq_occurred; address_space *memory; signed char vol; -} dpcm_t; +}; /* APU type */ -typedef struct apu +struct apu_t { /* Sound channels */ square_t squ[2]; @@ -169,7 +169,7 @@ typedef struct apu #endif int step_mode; -} apu_t; +}; /* CONSTANTS */ diff --git a/src/emu/sound/scsp.c b/src/emu/sound/scsp.c index 3adf4b9fb8c..e221cf8f482 100644 --- a/src/emu/sound/scsp.c +++ b/src/emu/sound/scsp.c @@ -111,11 +111,11 @@ static const double DRTimes[64]={100000/*infinity*/,100000/*infinity*/,118200.0, 28.0,25.0,22.0,18.0,14.0,12.0,11.0,8.5,7.1,6.1,5.4,4.3,3.6,3.1}; static INT32 EG_TABLE[0x400]; -enum _STATE {ATTACK,DECAY1,DECAY2,RELEASE}; -struct _EG +enum STATE {ATTACK,DECAY1,DECAY2,RELEASE}; +struct EG_t { int volume; // - _STATE state; + STATE state; int step; //step vals int AR; //Attack @@ -128,7 +128,7 @@ struct _EG UINT8 LPLINK; }; -struct _SLOT +struct SLOT { union { @@ -141,9 +141,9 @@ struct _SLOT UINT32 cur_addr; //current play address (24.8) UINT32 nxt_addr; //next play address UINT32 step; //pitch step (24.8) - struct _EG EG; //Envelope - struct _LFO PLFO; //Phase LFO - struct _LFO ALFO; //Amplitude LFO + EG_t EG; //Envelope + LFO_t PLFO; //Phase LFO + LFO_t ALFO; //Amplitude LFO int slot; signed short Prev; //Previous sample (for interpolation) }; @@ -182,7 +182,7 @@ struct scsp_state UINT16 data[0x30/2]; UINT8 datab[0x30]; } udata; - struct _SLOT Slots[32]; + SLOT Slots[32]; signed short RINGBUF[128]; unsigned char BUFPTR; #if FM_DELAY @@ -224,7 +224,7 @@ struct scsp_state int ARTABLE[64], DRTABLE[64]; - struct _SCSPDSP DSP; + SCSPDSP DSP; devcb_resolved_write_line main_irq; device_t *device; @@ -389,7 +389,7 @@ static int Get_RR(scsp_state *scsp,int base,int R) return scsp->DRTABLE[Rate]; } -static void Compute_EG(scsp_state *scsp,struct _SLOT *slot) +static void Compute_EG(scsp_state *scsp,SLOT *slot) { int octave=(OCT(slot)^8)-8; int rate; @@ -407,9 +407,9 @@ static void Compute_EG(scsp_state *scsp,struct _SLOT *slot) slot->EG.EGHOLD=EGHOLD(slot); } -static void SCSP_StopSlot(struct _SLOT *slot,int keyoff); +static void SCSP_StopSlot(SLOT *slot,int keyoff); -static int EG_Update(struct _SLOT *slot) +static int EG_Update(SLOT *slot) { switch(slot->EG.state) { @@ -459,7 +459,7 @@ static int EG_Update(struct _SLOT *slot) return (slot->EG.volume>>EG_SHIFT)<<(SHIFT-10); } -static UINT32 SCSP_Step(struct _SLOT *slot) +static UINT32 SCSP_Step(SLOT *slot) { int octave=(OCT(slot)^8)-8+SHIFT-10; UINT32 Fn=FNS(slot)+(1 << 10); @@ -476,7 +476,7 @@ static UINT32 SCSP_Step(struct _SLOT *slot) } -static void Compute_LFO(struct _SLOT *slot) +static void Compute_LFO(SLOT *slot) { if(PLFOS(slot)!=0) LFO_ComputeStep(&(slot->PLFO),LFOF(slot),PLFOWS(slot),PLFOS(slot),0); @@ -484,7 +484,7 @@ static void Compute_LFO(struct _SLOT *slot) LFO_ComputeStep(&(slot->ALFO),LFOF(slot),ALFOWS(slot),ALFOS(slot),1); } -static void SCSP_StartSlot(scsp_state *scsp, struct _SLOT *slot) +static void SCSP_StartSlot(scsp_state *scsp, SLOT *slot) { UINT32 start_offset; @@ -505,7 +505,7 @@ static void SCSP_StartSlot(scsp_state *scsp, struct _SLOT *slot) // printf("StartSlot[%p]: SA %x PCM8B %x LPCTL %x ALFOS %x STWINH %x TL %x EFSDL %x\n", slot, SA(slot), PCM8B(slot), LPCTL(slot), ALFOS(slot), STWINH(slot), TL(slot), EFSDL(slot)); } -static void SCSP_StopSlot(struct _SLOT *slot,int keyoff) +static void SCSP_StopSlot(SLOT *slot,int keyoff) { if(keyoff /*&& slot->EG.state!=RELEASE*/) { @@ -657,7 +657,7 @@ static void SCSP_Init(device_t *device, scsp_state *scsp, const scsp_interface * static void SCSP_UpdateSlotReg(scsp_state *scsp,int s,int r) { - struct _SLOT *slot=scsp->Slots+s; + SLOT *slot=scsp->Slots+s; int sl; switch(r&0x3f) { @@ -667,7 +667,7 @@ static void SCSP_UpdateSlotReg(scsp_state *scsp,int s,int r) { for(sl=0;sl<32;++sl) { - struct _SLOT *s2=scsp->Slots+sl; + SLOT *s2=scsp->Slots+sl; { if(KEYONB(s2) && s2->EG.state==RELEASE/*&& !s2->active*/) { @@ -863,7 +863,7 @@ static void SCSP_UpdateRegR(scsp_state *scsp, int reg) // MSLC | CA |SGC|EG // f e d c b a 9 8 7 6 5 4 3 2 1 0 unsigned char MSLC=(scsp->udata.data[0x8/2]>>11)&0x1f; - struct _SLOT *slot=scsp->Slots + MSLC; + SLOT *slot=scsp->Slots + MSLC; unsigned int SGC = (slot->EG.state) & 3; unsigned int CA = (slot->cur_addr>>(SHIFT+12)) & 0xf; unsigned int EG = (0x1f - (slot->EG.volume>>(EG_SHIFT+5))) & 0x1f; @@ -953,7 +953,7 @@ static unsigned short SCSP_r16(scsp_state *scsp, unsigned int addr) #define REVSIGN(v) ((~v)+1) -INLINE INT32 SCSP_UpdateSlot(scsp_state *scsp, struct _SLOT *slot) +INLINE INT32 SCSP_UpdateSlot(scsp_state *scsp, SLOT *slot) { INT32 sample; int step=slot->step; @@ -1135,7 +1135,7 @@ static void SCSP_DoMasterSamples(scsp_state *scsp, int nsamples) #endif if(scsp->Slots[sl].active) { - struct _SLOT *slot=scsp->Slots+sl; + SLOT *slot=scsp->Slots+sl; unsigned short Enc; signed int sample; @@ -1165,7 +1165,7 @@ static void SCSP_DoMasterSamples(scsp_state *scsp, int nsamples) for(i=0;i<16;++i) { - struct _SLOT *slot=scsp->Slots+i; + SLOT *slot=scsp->Slots+i; if(EFSDL(slot)) { unsigned short Enc=((EFPAN(slot))<<0x8)|((EFSDL(slot))<<0xd); diff --git a/src/emu/sound/scspdsp.c b/src/emu/sound/scspdsp.c index 6beab9db278..2ddc62fdecb 100644 --- a/src/emu/sound/scspdsp.c +++ b/src/emu/sound/scspdsp.c @@ -53,14 +53,14 @@ static INT32 UNPACK(UINT16 val) return uval; } -void SCSPDSP_Init(struct _SCSPDSP *DSP) +void SCSPDSP_Init(SCSPDSP *DSP) { - memset(DSP,0,sizeof(struct _SCSPDSP)); + memset(DSP,0,sizeof(SCSPDSP)); DSP->RBL=0x8000; DSP->Stopped=1; } -void SCSPDSP_Step(struct _SCSPDSP *DSP) +void SCSPDSP_Step(SCSPDSP *DSP) { INT32 ACC=0; //26 bit INT32 SHIFTED=0; //24 bit @@ -330,7 +330,7 @@ void SCSPDSP_Step(struct _SCSPDSP *DSP) // fclose(f); } -void SCSPDSP_SetSample(struct _SCSPDSP *DSP,INT32 sample,int SEL,int MXL) +void SCSPDSP_SetSample(SCSPDSP *DSP,INT32 sample,int SEL,int MXL) { //DSP->MIXS[SEL]+=sample<<(MXL+1)/*7*/; DSP->MIXS[SEL]+=sample; @@ -338,7 +338,7 @@ void SCSPDSP_SetSample(struct _SCSPDSP *DSP,INT32 sample,int SEL,int MXL) // int a=1; } -void SCSPDSP_Start(struct _SCSPDSP *DSP) +void SCSPDSP_Start(SCSPDSP *DSP) { int i; DSP->Stopped=0; diff --git a/src/emu/sound/scspdsp.h b/src/emu/sound/scspdsp.h index 5040aa17c26..59205a19407 100644 --- a/src/emu/sound/scspdsp.h +++ b/src/emu/sound/scspdsp.h @@ -4,7 +4,7 @@ #define __SCSPDSP_H__ //the DSP Context -struct _SCSPDSP +struct SCSPDSP { //Config UINT16 *SCSPRAM; @@ -32,9 +32,9 @@ struct _SCSPDSP int LastStep; }; -void SCSPDSP_Init(struct _SCSPDSP *DSP); -void SCSPDSP_SetSample(struct _SCSPDSP *DSP, INT32 sample, INT32 SEL, INT32 MXL); -void SCSPDSP_Step(struct _SCSPDSP *DSP); -void SCSPDSP_Start(struct _SCSPDSP *DSP); +void SCSPDSP_Init(SCSPDSP *DSP); +void SCSPDSP_SetSample(SCSPDSP *DSP, INT32 sample, INT32 SEL, INT32 MXL); +void SCSPDSP_Step(SCSPDSP *DSP); +void SCSPDSP_Start(SCSPDSP *DSP); #endif /* __SCSPDSP_H__ */ diff --git a/src/emu/sound/scsplfo.c b/src/emu/sound/scsplfo.c index ca658d1d4ec..3b493a87800 100644 --- a/src/emu/sound/scsplfo.c +++ b/src/emu/sound/scsplfo.c @@ -10,7 +10,7 @@ #define LFO_SHIFT 8 -struct _LFO +struct LFO_t { unsigned short phase; UINT32 phase_step; @@ -107,7 +107,7 @@ static void LFO_Init(running_machine &machine) } } -INLINE signed int PLFO_Step(struct _LFO *LFO) +INLINE signed int PLFO_Step(LFO_t *LFO) { int p; LFO->phase+=LFO->phase_step; @@ -119,7 +119,7 @@ INLINE signed int PLFO_Step(struct _LFO *LFO) return p<<(SHIFT-LFO_SHIFT); } -INLINE signed int ALFO_Step(struct _LFO *LFO) +INLINE signed int ALFO_Step(LFO_t *LFO) { int p; LFO->phase+=LFO->phase_step; @@ -131,7 +131,7 @@ INLINE signed int ALFO_Step(struct _LFO *LFO) return p<<(SHIFT-LFO_SHIFT); } -static void LFO_ComputeStep(struct _LFO *LFO,UINT32 LFOF,UINT32 LFOWS,UINT32 LFOS,int ALFO) +static void LFO_ComputeStep(LFO_t *LFO,UINT32 LFOF,UINT32 LFOWS,UINT32 LFOS,int ALFO) { float step=(float) LFOFreq[LFOF]*256.0/(float)44100; LFO->phase_step=(unsigned int) ((float) (1<<LFO_SHIFT)*step); diff --git a/src/emu/sound/sid.c b/src/emu/sound/sid.c index 8b081f5dbf0..63d7ae06e42 100644 --- a/src/emu/sound/sid.c +++ b/src/emu/sound/sid.c @@ -53,7 +53,7 @@ static void MixerInit(int threeVoiceAmplify) } -INLINE void syncEm(_SID6581 *This) +INLINE void syncEm(SID6581_t *This) { int sync1 = (This->optr1.modulator->cycleLenCount <= 0); int sync2 = (This->optr2.modulator->cycleLenCount <= 0); @@ -96,9 +96,9 @@ INLINE void syncEm(_SID6581 *This) } -void sidEmuFillBuffer(_SID6581 *This, stream_sample_t *buffer, UINT32 bufferLen ) +void sidEmuFillBuffer(SID6581_t *This, stream_sample_t *buffer, UINT32 bufferLen ) { -//void* fill16bitMono( SID6581 *This, void* buffer, UINT32 numberOfSamples ) +//void* fill16bitMono( SID6581_t *This, void* buffer, UINT32 numberOfSamples ) for ( ; bufferLen > 0; bufferLen-- ) { @@ -121,7 +121,7 @@ void sidEmuFillBuffer(_SID6581 *This, stream_sample_t *buffer, UINT32 bufferLen /* Reset. */ -int sidEmuReset(_SID6581 *This) +int sidEmuReset(SID6581_t *This) { sidClearOperator( &This->optr1 ); enveEmuResetOperator( &This->optr1 ); @@ -208,7 +208,7 @@ static void filterTableInit(running_machine &machine) filterResTable[15] = resDyMax; } -void sid6581_init (_SID6581 *This) +void sid6581_init (SID6581_t *This) { This->optr1.sid=This; This->optr2.sid=This; @@ -245,7 +245,7 @@ void sid6581_init (_SID6581 *This) sidEmuReset(This); } -void sid6581_port_w (_SID6581 *This, int offset, int data) +void sid6581_port_w (SID6581_t *This, int offset, int data) { offset &= 0x1f; @@ -323,7 +323,7 @@ void sid6581_port_w (_SID6581 *This, int offset, int data) } } -int sid6581_port_r (running_machine &machine, _SID6581 *This, int offset) +int sid6581_port_r (running_machine &machine, SID6581_t *This, int offset) { int data; /* SIDPLAY reads last written at a sid address value */ diff --git a/src/emu/sound/sid.h b/src/emu/sound/sid.h index 8b8f338fda8..82a28d3309e 100644 --- a/src/emu/sound/sid.h +++ b/src/emu/sound/sid.h @@ -12,7 +12,7 @@ #include "sidvoice.h" /* private area */ -typedef struct __SID6581 +struct SID6581_t { device_t *device; sound_stream *mixer_channel; // mame stream/ mixer channel @@ -54,15 +54,15 @@ typedef struct __SID6581 sidOperator optr1, optr2, optr3; int optr3_outputmask; -} _SID6581; +}; -void sid6581_init (_SID6581 *This); +void sid6581_init (SID6581_t *This); -int sidEmuReset(_SID6581 *This); +int sidEmuReset(SID6581_t *This); -int sid6581_port_r (running_machine &machine, _SID6581 *This, int offset); -void sid6581_port_w (_SID6581 *This, int offset, int data); +int sid6581_port_r (running_machine &machine, SID6581_t *This, int offset); +void sid6581_port_w (SID6581_t *This, int offset, int data); -void sidEmuFillBuffer(_SID6581 *This, stream_sample_t *buffer, UINT32 bufferLen ); +void sidEmuFillBuffer(SID6581_t *This, stream_sample_t *buffer, UINT32 bufferLen ); #endif /* __SID_H__ */ diff --git a/src/emu/sound/sid6581.c b/src/emu/sound/sid6581.c index 248838ae47a..3329f574d6f 100644 --- a/src/emu/sound/sid6581.c +++ b/src/emu/sound/sid6581.c @@ -12,18 +12,18 @@ -static _SID6581 *get_sid(device_t *device) +static SID6581_t *get_sid(device_t *device) { assert(device != NULL); assert((device->type() == SID6581) || (device->type() == SID8580)); - return (_SID6581 *) downcast<sid6581_device *>(device)->token(); + return (SID6581_t *) downcast<sid6581_device *>(device)->token(); } static STREAM_UPDATE( sid_update ) { - _SID6581 *sid = (_SID6581 *) param; + SID6581_t *sid = (SID6581_t *) param; sidEmuFillBuffer(sid, outputs[0], samples); } @@ -31,7 +31,7 @@ static STREAM_UPDATE( sid_update ) static void sid_start(device_t *device, SIDTYPE sidtype) { - _SID6581 *sid = get_sid(device); + SID6581_t *sid = get_sid(device); const sid6581_interface *iface = (const sid6581_interface*) device->static_config(); assert(iface); @@ -53,7 +53,7 @@ static void sid_start(device_t *device, SIDTYPE sidtype) static DEVICE_RESET( sid ) { - _SID6581 *sid = get_sid(device); + SID6581_t *sid = get_sid(device); sidEmuReset(sid); } @@ -90,13 +90,13 @@ sid6581_device::sid6581_device(const machine_config &mconfig, const char *tag, d : device_t(mconfig, SID6581, "SID6581", tag, owner, clock), device_sound_interface(mconfig, *this) { - m_token = global_alloc_array_clear(UINT8, sizeof(_SID6581)); + m_token = global_alloc_array_clear(UINT8, sizeof(SID6581)); } sid6581_device::sid6581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, type, name, tag, owner, clock), device_sound_interface(mconfig, *this) { - m_token = global_alloc_array_clear(UINT8, sizeof(_SID6581)); + m_token = global_alloc_array_clear(UINT8, sizeof(SID6581)); } //------------------------------------------------- diff --git a/src/emu/sound/sidvoice.h b/src/emu/sound/sidvoice.h index 58e6ca856b5..92fb9b35e44 100644 --- a/src/emu/sound/sidvoice.h +++ b/src/emu/sound/sidvoice.h @@ -21,19 +21,19 @@ struct sw_storage #endif }; -struct __SID6581; +struct SID6581_t; -typedef struct _sidOperator +struct sidOperator { - struct __SID6581 *sid; + SID6581_t *sid; UINT8 reg[7]; UINT32 SIDfreq; UINT16 SIDpulseWidth; UINT8 SIDctrl; UINT8 SIDAD, SIDSR; - struct _sidOperator* carrier; - struct _sidOperator* modulator; + sidOperator* carrier; + sidOperator* modulator; int sync; UINT16 pulseIndex, newPulseIndex; @@ -55,8 +55,8 @@ typedef struct _sidOperator UINT16 cycleLen, cycleLenPnt; #endif - INT8(*outProc)(struct _sidOperator *); - void(*waveProc)(struct _sidOperator *); + INT8(*outProc)(sidOperator *); + void(*waveProc)(sidOperator *); #if defined(DIRECT_FIXPOINT) cpuLword waveStep, waveStepAdd; @@ -80,7 +80,7 @@ typedef struct _sidOperator UINT8 ADSRctrl; // int gateOnCtrl, gateOffCtrl; - UINT16 (*ADSRproc)(struct _sidOperator *); + UINT16 (*ADSRproc)(sidOperator *); #ifdef SID_FPUENVE float fenveStep, fenveStepAdd; @@ -93,7 +93,7 @@ typedef struct _sidOperator #endif UINT8 enveVol, enveSusVol; UINT16 enveShortAttackCount; -} sidOperator; +}; typedef INT8 (*ptr2sidFunc)(sidOperator *); typedef UINT16 (*ptr2sidUwordFunc)(sidOperator *); diff --git a/src/emu/sound/sn76496.h b/src/emu/sound/sn76496.h index 5a4c8461371..03d7e0c97a1 100644 --- a/src/emu/sound/sn76496.h +++ b/src/emu/sound/sn76496.h @@ -176,10 +176,10 @@ extern const device_type NCR7496_NEW; extern const device_type GAMEGEAR_NEW; extern const device_type SEGAPSG_NEW; -typedef struct _sn76496_config +struct sn76496_config { devcb_write_line ready; -} sn76496_config; +}; class sn76496_base_device : public device_t, public device_sound_interface { diff --git a/src/emu/sound/tms5220.h b/src/emu/sound/tms5220.h index 34a3105fcdb..e570d4d8968 100644 --- a/src/emu/sound/tms5220.h +++ b/src/emu/sound/tms5220.h @@ -121,7 +121,7 @@ extern const device_type TMC0285N; extern const device_type TMS5200N; -typedef struct _tms52xx_config +struct tms52xx_config { devcb_write_line irq_func; // IRQ callback function, active low, i.e. state=0 (TODO: change to ASSERT/CLEAR) devcb_write_line readyq_func; // Ready callback function, active low, i.e. state=0 @@ -130,7 +130,7 @@ typedef struct _tms52xx_config devcb_write8 load_address; // speech ROM load address callback devcb_write8 read_and_branch; // speech ROM read and branch callback -} tms52xx_config; +}; // Change back from 5220n to 5220 when all client drivers will be converted class tms52xx_device : public device_t, public device_sound_interface diff --git a/src/emu/sound/wavwrite.c b/src/emu/sound/wavwrite.c index dba7250194f..780ab7384f5 100644 --- a/src/emu/sound/wavwrite.c +++ b/src/emu/sound/wavwrite.c @@ -1,7 +1,7 @@ #include "osdcore.h" #include "sound/wavwrite.h" -struct _wav_file +struct wav_file { FILE *file; UINT32 total_offs; @@ -16,7 +16,7 @@ wav_file *wav_open(const char *filename, int sample_rate, int channels) UINT16 align, temp16; /* allocate memory for the wav struct */ - wav = (wav_file *) osd_malloc(sizeof(struct _wav_file)); + wav = (wav_file *) osd_malloc(sizeof(wav_file)); if (!wav) return NULL; diff --git a/src/emu/sound/wavwrite.h b/src/emu/sound/wavwrite.h index a1f21a8237d..8776a0eed0b 100644 --- a/src/emu/sound/wavwrite.h +++ b/src/emu/sound/wavwrite.h @@ -3,7 +3,7 @@ #ifndef __WAVWRITE_H__ #define __WAVWRITE_H__ -typedef struct _wav_file wav_file; +struct wav_file; wav_file *wav_open(const char *filename, int sample_rate, int channels); void wav_close(wav_file*wavptr); diff --git a/src/emu/sound/ymdeltat.h b/src/emu/sound/ymdeltat.h index 6806a531f83..51a1c2a3eaf 100644 --- a/src/emu/sound/ymdeltat.h +++ b/src/emu/sound/ymdeltat.h @@ -13,7 +13,7 @@ typedef void (*STATUS_CHANGE_HANDLER)(void *chip, UINT8 status_bits); /* DELTA-T (adpcm type B) struct */ -typedef struct deltat_adpcm_state { /* AT: rearranged and tigntened structure */ +struct YM_DELTAT { /* AT: rearranged and tigntened structure */ UINT8 *memory; INT32 *output_pointer;/* pointer of output pointers */ INT32 *pan; /* pan : &output_pointer[pan] */ @@ -69,7 +69,7 @@ typedef struct deltat_adpcm_state { /* AT: rearranged and tigntened structur UINT8 reg[16]; /* adpcm registers */ UINT8 emulation_mode; /* which chip we're emulating */ -}YM_DELTAT; +}; /*void YM_DELTAT_BRDY_callback(YM_DELTAT *DELTAT);*/ diff --git a/src/emu/sound/ymf278b.c b/src/emu/sound/ymf278b.c index 07875b3da6d..df12602dafe 100644 --- a/src/emu/sound/ymf278b.c +++ b/src/emu/sound/ymf278b.c @@ -71,6 +71,8 @@ #define VERBOSE 0 #define LOG(x) do { if (VERBOSE) logerror x; } while (0) +struct YMF278BChip; + struct YMF278BSlot { INT16 wave; /* wavetable number */ @@ -110,10 +112,10 @@ struct YMF278BSlot INT8 env_preverb; int num; /* slot number (for debug only) */ - struct _YMF278BChip *chip; /* pointer back to parent chip */ + YMF278BChip *chip; /* pointer back to parent chip */ }; -typedef struct _YMF278BChip +struct YMF278BChip { UINT8 pcmregs[256]; YMF278BSlot slots[24]; @@ -151,7 +153,7 @@ typedef struct _YMF278BChip INT32 mix_level[8]; sound_stream * stream; -} YMF278BChip; +}; INLINE YMF278BChip *get_safe_token(device_t *device) { diff --git a/src/emu/uimenu.h b/src/emu/uimenu.h index 9b7d4311216..188ee055281 100644 --- a/src/emu/uimenu.h +++ b/src/emu/uimenu.h @@ -38,13 +38,12 @@ #define UI_MENU_PROCESS_CUSTOM_ONLY 4 /* options for ui_menu_reset */ -enum _ui_menu_reset_options +enum ui_menu_reset_options { UI_MENU_RESET_SELECT_FIRST, UI_MENU_RESET_REMEMBER_POSITION, UI_MENU_RESET_REMEMBER_REF }; -typedef enum _ui_menu_reset_options ui_menu_reset_options; diff --git a/src/emu/video.h b/src/emu/video.h index ba37e1d9b38..ca37d63db65 100644 --- a/src/emu/video.h +++ b/src/emu/video.h @@ -64,7 +64,7 @@ const int MAX_FRAMESKIP = FRAMESKIP_LEVELS - 2; // forward references class render_target; class screen_device; -typedef struct _avi_file avi_file; +struct avi_file; diff --git a/src/emu/video/huc6270.h b/src/emu/video/huc6270.h index 7afce7a92e7..e4ac3bcb26c 100644 --- a/src/emu/video/huc6270.h +++ b/src/emu/video/huc6270.h @@ -11,21 +11,19 @@ #include "machine/devhelpr.h" -enum _huc6270_v_state { +enum huc6270_v_state { HUC6270_VSW, HUC6270_VDS, HUC6270_VDW, HUC6270_VCR }; -typedef enum _huc6270_v_state huc6270_v_state; -enum _huc6270_h_state { +enum huc6270_h_state { HUC6270_HDS, HUC6270_HDW, HUC6270_HDE, HUC6270_HSW }; -typedef enum _huc6270_h_state huc6270_h_state; #define MCFG_HUC6270_ADD( _tag, _intrf ) \ diff --git a/src/emu/video/poly.c b/src/emu/video/poly.c index 6f75912229f..6813295182c 100644 --- a/src/emu/video/poly.c +++ b/src/emu/video/poly.c @@ -41,7 +41,7 @@ ***************************************************************************/ /* forward definitions */ -typedef struct _polygon_info polygon_info; +struct polygon_info; /* tri_extent describes start/end points for a scanline */ @@ -112,8 +112,7 @@ struct quad_work_unit /* work_unit is a union of the two types */ -typedef union _work_unit work_unit; -union _work_unit +union work_unit { work_unit_shared shared; /* shared data */ tri_work_unit tri; /* triangle work unit */ @@ -122,7 +121,7 @@ union _work_unit /* polygon_info describes a single polygon, which includes the poly_params */ -struct _polygon_info +struct polygon_info { poly_manager * poly; /* pointer back to the poly manager */ void * dest; /* pointer to the destination we are rendering to */ @@ -137,7 +136,7 @@ struct _polygon_info /* full poly manager description */ -struct _poly_manager +struct poly_manager { /* queue management */ osd_work_queue * queue; /* work queue */ diff --git a/src/emu/video/poly.h b/src/emu/video/poly.h index 560b9875966..b9038970331 100644 --- a/src/emu/video/poly.h +++ b/src/emu/video/poly.h @@ -55,7 +55,7 @@ ***************************************************************************/ /* opaque reference to the poly manager */ -typedef struct _poly_manager poly_manager; +struct poly_manager; /* input vertex data */ diff --git a/src/emu/video/vooddefs.h b/src/emu/video/vooddefs.h index 2bd7ae8a119..09edb2ea734 100644 --- a/src/emu/video/vooddefs.h +++ b/src/emu/video/vooddefs.h @@ -1393,8 +1393,8 @@ static const UINT8 dither_matrix_2x2[16] = * *************************************/ -typedef struct _voodoo_state voodoo_state; -typedef struct poly_extra_data poly_extra_data; +struct voodoo_state; +struct poly_extra_data; struct rgba @@ -1407,8 +1407,7 @@ struct rgba }; -typedef union _voodoo_reg voodoo_reg; -union _voodoo_reg +union voodoo_reg { INT32 i; UINT32 u; @@ -1722,8 +1721,7 @@ struct banshee_info }; -/* typedef struct _voodoo_state voodoo_state; -- declared above */ -struct _voodoo_state +struct voodoo_state { UINT8 index; /* index of board */ device_t *device; /* pointer to our containing device */ diff --git a/src/lib/formats/cassimg.c b/src/lib/formats/cassimg.c index f17f0f1906f..9cb9dc1996f 100644 --- a/src/lib/formats/cassimg.c +++ b/src/lib/formats/cassimg.c @@ -84,7 +84,7 @@ static cassette_image *cassette_init(const struct CassetteFormat *format, void * { cassette_image *cassette; - cassette = (cassette_image *)malloc(sizeof(struct _cassette_image)); + cassette = (cassette_image *)malloc(sizeof(cassette_image)); if (!cassette) return NULL; diff --git a/src/lib/formats/cassimg.h b/src/lib/formats/cassimg.h index 9f665ff0d42..fd34c91dbaf 100644 --- a/src/lib/formats/cassimg.h +++ b/src/lib/formats/cassimg.h @@ -91,7 +91,7 @@ struct CassetteInfo size_t sample_count; }; -struct _cassette_image +struct cassette_image { const struct CassetteFormat *format; struct io_generic io; @@ -106,8 +106,6 @@ struct _cassette_image size_t sample_count; }; -typedef struct _cassette_image cassette_image; - struct CassetteFormat { const char *extensions; diff --git a/src/lib/formats/flopimg.c b/src/lib/formats/flopimg.c index 01c73a84979..c1ab25eb1d6 100644 --- a/src/lib/formats/flopimg.c +++ b/src/lib/formats/flopimg.c @@ -24,7 +24,7 @@ #define TRACK_DIRTY 0x02 -struct _floppy_image +struct floppy_image_legacy { struct io_generic io; @@ -46,7 +46,7 @@ struct _floppy_image -struct _floppy_params +struct floppy_params { int param; int value; @@ -77,7 +77,7 @@ static floppy_image_legacy *floppy_init(void *fp, const struct io_procs *procs, { floppy_image_legacy *floppy; - floppy = (floppy_image_legacy *)malloc(sizeof(struct _floppy_image)); + floppy = (floppy_image_legacy *)malloc(sizeof(floppy_image)); if (!floppy) return NULL; diff --git a/src/lib/formats/flopimg.h b/src/lib/formats/flopimg.h index 3ba7e7ae562..c55ee463265 100644 --- a/src/lib/formats/flopimg.h +++ b/src/lib/formats/flopimg.h @@ -41,7 +41,7 @@ ***************************************************************************/ -typedef enum +enum floperr_t { FLOPPY_ERROR_SUCCESS, /* no error */ FLOPPY_ERROR_INTERNAL, /* fatal internal error */ @@ -53,10 +53,9 @@ typedef enum FLOPPY_ERROR_NOSPACE, FLOPPY_ERROR_PARAMOUTOFRANGE, FLOPPY_ERROR_PARAMNOTSPECIFIED -} -floperr_t; +}; -typedef struct _floppy_image floppy_image_legacy; +struct floppy_image_legacy; struct FloppyCallbacks { diff --git a/src/lib/util/aviio.c b/src/lib/util/aviio.c index 13b34692936..aec1a68b81a 100644 --- a/src/lib/util/aviio.c +++ b/src/lib/util/aviio.c @@ -169,7 +169,7 @@ struct avi_stream }; -struct _avi_file +struct avi_file { /* shared data */ osd_file * file; /* pointer to open file */ diff --git a/src/lib/util/aviio.h b/src/lib/util/aviio.h index cf524a44381..6c07c9b2669 100644 --- a/src/lib/util/aviio.h +++ b/src/lib/util/aviio.h @@ -48,7 +48,7 @@ CONSTANTS ***************************************************************************/ -enum _avi_error +enum avi_error { AVIERR_NONE = 0, AVIERR_END, @@ -68,10 +68,9 @@ enum _avi_error AVIERR_UNSUPPORTED_AUDIO_FORMAT, AVIERR_EXCEEDED_SOUND_BUFFER }; -typedef enum _avi_error avi_error; -enum _avi_datatype +enum avi_datatype { AVIDATA_VIDEO, AVIDATA_AUDIO_CHAN0, @@ -83,7 +82,6 @@ enum _avi_datatype AVIDATA_AUDIO_CHAN6, AVIDATA_AUDIO_CHAN7 }; -typedef enum _avi_datatype avi_datatype; @@ -104,7 +102,7 @@ typedef enum _avi_datatype avi_datatype; TYPE DEFINITIONS ***************************************************************************/ -typedef struct _avi_file avi_file; +struct avi_file; struct avi_movie_info diff --git a/src/lib/util/cdrom.c b/src/lib/util/cdrom.c index 964051b6fcf..924d45770f0 100644 --- a/src/lib/util/cdrom.c +++ b/src/lib/util/cdrom.c @@ -88,7 +88,7 @@ const int ECC_Q_COMP = 43; // 43 bytes each TYPE DEFINITIONS ***************************************************************************/ -struct _cdrom_file +struct cdrom_file { chd_file * chd; /* CHD file */ cdrom_toc cdtoc; /* TOC for the CD */ diff --git a/src/lib/util/cdrom.h b/src/lib/util/cdrom.h index 8e3d776f99c..437501618b3 100644 --- a/src/lib/util/cdrom.h +++ b/src/lib/util/cdrom.h @@ -90,7 +90,7 @@ enum TYPE DEFINITIONS ***************************************************************************/ -typedef struct _cdrom_file cdrom_file; +struct cdrom_file; struct cdrom_track_info { diff --git a/src/lib/util/corefile.c b/src/lib/util/corefile.c index ad32a0e4d1a..cf154c3c529 100644 --- a/src/lib/util/corefile.c +++ b/src/lib/util/corefile.c @@ -70,7 +70,7 @@ TYPE DEFINITIONS ***************************************************************************/ -enum _text_file_type +enum text_file_type { TFT_OSD = 0, /* OSD depdendent encoding format used when BOMs missing */ TFT_UTF8, /* UTF-8 */ @@ -79,7 +79,6 @@ enum _text_file_type TFT_UTF32BE, /* UTF-32 (UCS-4) (big endian) */ TFT_UTF32LE /* UTF-32 (UCS-4) (little endian) */ }; -typedef enum _text_file_type text_file_type; struct zlib_data @@ -91,8 +90,7 @@ struct zlib_data }; -/* typedef struct _core_file core_file -- declared in corefile.h */ -struct _core_file +struct core_file { osd_file * file; /* OSD file handle */ zlib_data * zdata; /* compression data */ diff --git a/src/lib/util/corefile.h b/src/lib/util/corefile.h index 182d8c76ad9..79ec9518cac 100644 --- a/src/lib/util/corefile.h +++ b/src/lib/util/corefile.h @@ -66,7 +66,7 @@ TYPE DEFINITIONS ***************************************************************************/ -typedef struct _core_file core_file; +struct core_file; diff --git a/src/lib/util/opresolv.c b/src/lib/util/opresolv.c index efc9306b8b5..d39bcc10c4e 100644 --- a/src/lib/util/opresolv.c +++ b/src/lib/util/opresolv.c @@ -32,7 +32,7 @@ struct option_resolution_entry } u; }; -struct _option_resolution +struct option_resolution { object_pool *pool; const char *specification; diff --git a/src/lib/util/opresolv.h b/src/lib/util/opresolv.h index 3cc3ad1cc24..dbd891181ea 100644 --- a/src/lib/util/opresolv.h +++ b/src/lib/util/opresolv.h @@ -114,7 +114,7 @@ struct OptionResolutionError -typedef struct _option_resolution option_resolution; +struct option_resolution; struct OptionRange { diff --git a/src/lib/util/palette.c b/src/lib/util/palette.c index 10b7dfc0fe8..b44f0e8cdb1 100644 --- a/src/lib/util/palette.c +++ b/src/lib/util/palette.c @@ -57,7 +57,7 @@ struct dirty_state /* a single palette client */ -struct _palette_client +struct palette_client { palette_client *next; /* pointer to next client */ palette_t * palette; /* reference to the palette */ @@ -67,7 +67,7 @@ struct _palette_client /* a palette object */ -struct _palette_t +struct palette_t { UINT32 refcount; /* reference count on the palette */ UINT32 numcolors; /* number of colors in the palette */ diff --git a/src/lib/util/palette.h b/src/lib/util/palette.h index c8c15f4734b..d54ee279fbf 100644 --- a/src/lib/util/palette.h +++ b/src/lib/util/palette.h @@ -56,10 +56,10 @@ typedef UINT32 rgb_t; typedef UINT16 rgb15_t; /* a palette is an opaque, reference counted object */ -typedef struct _palette_t palette_t; +struct palette_t; /* a palette client is someone who is tracking the dirty state of a palette */ -typedef struct _palette_client palette_client; +struct palette_client; diff --git a/src/lib/util/png.h b/src/lib/util/png.h index 9e00f423b11..ce7b7f7e261 100644 --- a/src/lib/util/png.h +++ b/src/lib/util/png.h @@ -87,7 +87,7 @@ #define PNG_PF_Paeth 4 /* Error types */ -enum _png_error +enum png_error { PNGERR_NONE, PNGERR_OUT_OF_MEMORY, @@ -101,7 +101,6 @@ enum _png_error PNGERR_COMPRESS_ERROR, PNGERR_UNSUPPORTED_FORMAT }; -typedef enum _png_error png_error; diff --git a/src/lib/util/pool.c b/src/lib/util/pool.c index 97d6236f66d..ab0c0ef3270 100644 --- a/src/lib/util/pool.c +++ b/src/lib/util/pool.c @@ -90,7 +90,7 @@ struct object_entry_block /* the object pool itself */ -struct _object_pool +struct object_pool { object_entry * hashtable[POOL_HASH_SIZE]; object_entry * globallist; @@ -102,7 +102,7 @@ struct _object_pool /* an iterator over objects in a pool */ -struct _object_pool_iterator +struct object_pool_iterator { object_pool * pool; object_type type; diff --git a/src/lib/util/pool.h b/src/lib/util/pool.h index ed65741a48a..77bf7456da4 100644 --- a/src/lib/util/pool.h +++ b/src/lib/util/pool.h @@ -69,10 +69,10 @@ typedef UINT32 object_type; /* opaque type representing a pool of objects */ -typedef struct _object_pool object_pool; +struct object_pool; /* opaque type representing an iterator over pool objects */ -typedef struct _object_pool_iterator object_pool_iterator; +struct object_pool_iterator; diff --git a/src/lib/util/un7z.h b/src/lib/util/un7z.h index 1051887f81c..f80bc4b12ab 100644 --- a/src/lib/util/un7z.h +++ b/src/lib/util/un7z.h @@ -56,38 +56,38 @@ void SZipFree(void *p, void *address); void *SZipAllocTemp(void *p, size_t size); void SZipFreeTemp(void *p, void *address); -typedef struct +struct CSzFile { long _7z_currfpos; UINT64 _7z_length; osd_file * _7z_osdfile; /* OSD file handle */ -} CSzFile; +}; -typedef struct +struct CFileSeqInStream { ISeqInStream s; CSzFile file; -} CFileSeqInStream; +}; void FileSeqInStream_CreateVTable(CFileSeqInStream *p); -typedef struct +struct CFileInStream { ISeekInStream s; CSzFile file; -} CFileInStream; +}; void FileInStream_CreateVTable(CFileInStream *p); -typedef struct +struct CFileOutStream { ISeqOutStream s; CSzFile file; -} CFileOutStream; +} ; void FileOutStream_CreateVTable(CFileOutStream *p); @@ -99,7 +99,7 @@ void FileOutStream_CreateVTable(CFileOutStream *p); /* Error types */ -enum __7z_error +enum _7z_error { _7ZERR_NONE = 0, _7ZERR_OUT_OF_MEMORY, @@ -111,7 +111,6 @@ enum __7z_error _7ZERR_UNSUPPORTED, _7ZERR_BUFFER_TOO_SMALL }; -typedef enum __7z_error _7z_error; diff --git a/src/lib/util/unzip.h b/src/lib/util/unzip.h index 078d38c8736..e199e1c3b74 100644 --- a/src/lib/util/unzip.h +++ b/src/lib/util/unzip.h @@ -52,7 +52,7 @@ #define ZIP_DECOMPRESS_BUFSIZE 16384 /* Error types */ -enum _zip_error +enum zip_error { ZIPERR_NONE = 0, ZIPERR_OUT_OF_MEMORY, @@ -64,7 +64,6 @@ enum _zip_error ZIPERR_UNSUPPORTED, ZIPERR_BUFFER_TOO_SMALL }; -typedef enum _zip_error zip_error; diff --git a/src/mame/audio/exidy440.c b/src/mame/audio/exidy440.c index e709f2bcc02..488c2fea2d0 100644 --- a/src/mame/audio/exidy440.c +++ b/src/mame/audio/exidy440.c @@ -38,7 +38,7 @@ /* channel_data structure holds info about each 6844 DMA channel */ -typedef struct m6844_channel_data +struct m6844_channel_data { int active; int address; @@ -46,20 +46,20 @@ typedef struct m6844_channel_data UINT8 control; int start_address; int start_counter; -} m6844_channel_data; +}; /* channel_data structure holds info about each active sound channel */ -typedef struct sound_channel_data +struct sound_channel_data { INT16 *base; int offset; int remaining; -} sound_channel_data; +}; /* sound_cache_entry structure contains info on each decoded sample */ -typedef struct sound_cache_entry +struct sound_cache_entry { struct sound_cache_entry *next; int address; @@ -67,7 +67,7 @@ typedef struct sound_cache_entry int bits; int frequency; INT16 data[1]; -} sound_cache_entry; +}; diff --git a/src/mame/audio/micro3d.c b/src/mame/audio/micro3d.c index 0f467cbf1b8..8787b8a2e72 100644 --- a/src/mame/audio/micro3d.c +++ b/src/mame/audio/micro3d.c @@ -20,19 +20,19 @@ * *************************************/ -typedef struct _biquad_ +struct biquad { double a0, a1, a2; /* Numerator coefficients */ double b0, b1, b2; /* Denominator coefficients */ -} biquad; +}; -typedef struct _filter_ +struct lp_filter { float *history; float *coef; double fs; biquad ProtoCoef[2]; -} lp_filter; +}; struct filter_state { @@ -40,7 +40,7 @@ struct filter_state double exponent; }; -typedef struct _noise_state +struct noise_state { union { @@ -62,7 +62,7 @@ typedef struct _noise_state filter_state noise_filters[4]; lp_filter filter; sound_stream *stream; -} noise_state; +}; /************************************* diff --git a/src/mame/audio/snes_snd.c b/src/mame/audio/snes_snd.c index a8c51275619..323e9e15e43 100644 --- a/src/mame/audio/snes_snd.c +++ b/src/mame/audio/snes_snd.c @@ -157,17 +157,17 @@ static int advance_envelope( device_t *device, int v); TYPE DEFINITIONS ***************************************************************************/ -typedef enum /* ADSR state type */ +enum env_state_t32 /* ADSR state type */ { ATTACK, DECAY, SUSTAIN, RELEASE -} env_state_t32; +}; ALLOW_SAVE_TYPE(env_state_t32); -typedef struct /* Voice state type */ +struct voice_state_type /* Voice state type */ { UINT16 mem_ptr; /* Sample data memory pointer */ int end; /* End or loop after block */ @@ -186,13 +186,13 @@ typedef struct /* Voice state type */ INT32 smp1; /* Last sample (for BRR filter) */ INT32 smp2; /* Second-to-last sample decoded*/ short sampbuf[4]; /* Buffer for Gaussian interp */ -} voice_state_type; +}; -typedef struct /* Source directory entry */ +struct src_dir_type /* Source directory entry */ { UINT16 vptr; /* Ptr to start of sample data */ UINT16 lptr; /* Loop pointer in sample data */ -} src_dir_type; +}; struct snes_sound_state diff --git a/src/mame/audio/snk6502.c b/src/mame/audio/snk6502.c index b4829d443ed..0e32bf2a3fe 100644 --- a/src/mame/audio/snk6502.c +++ b/src/mame/audio/snk6502.c @@ -29,7 +29,7 @@ #define FRAC_ONE (1 << FRAC_BITS) #define FRAC_MASK (FRAC_ONE - 1) -typedef struct tone +struct TONE { int mute; int offset; @@ -39,7 +39,7 @@ typedef struct tone INT32 sample_step; INT32 sample_cur; INT16 form[16]; -} TONE; +}; struct snk6502_sound_state { diff --git a/src/mame/audio/tx1.c b/src/mame/audio/tx1.c index 0f1e23a0b5e..e76e75348f4 100644 --- a/src/mame/audio/tx1.c +++ b/src/mame/audio/tx1.c @@ -16,7 +16,7 @@ * 8253 Programmable Interval Timer * *************************************/ -struct _pit8253_state +struct pit8253_state { union { @@ -39,7 +39,7 @@ struct tx1_sound_state UINT32 m_step1; UINT32 m_step2; - struct _pit8253_state m_pit8253; + pit8253_state m_pit8253; UINT8 m_ay_outputa; UINT8 m_ay_outputb; diff --git a/src/mame/drivers/atarisy4.c b/src/mame/drivers/atarisy4.c index e55b4a9c629..4fe2e989c85 100644 --- a/src/mame/drivers/atarisy4.c +++ b/src/mame/drivers/atarisy4.c @@ -68,7 +68,7 @@ public: * *************************************/ -struct _gpu_ +struct gpu_ { /* Memory-mapped registers */ UINT16 gr[8]; /* Command parameters */ diff --git a/src/mame/drivers/bfcobra.c b/src/mame/drivers/bfcobra.c index e8162756c42..d198cc9c081 100644 --- a/src/mame/drivers/bfcobra.c +++ b/src/mame/drivers/bfcobra.c @@ -101,7 +101,7 @@ INLINE void z80_bank(running_machine &machine, int num, int data); ***************************************************************************/ -typedef union +union ADDR_REG { #ifdef LSB_FIRST struct { UINT16 loword, hiword ; } ; @@ -111,7 +111,7 @@ typedef union struct { UINT8 addr2, addr1, addr0; }; #endif UINT32 addr; -} ADDR_REG; +}; /* Blitter register flag bits */ #define CMD_RUN 0x01 diff --git a/src/mame/drivers/cobra.c b/src/mame/drivers/cobra.c index 4f1e3a6a21d..b0542d1a6e8 100644 --- a/src/mame/drivers/cobra.c +++ b/src/mame/drivers/cobra.c @@ -437,12 +437,12 @@ private: class cobra_fifo { public: - typedef enum + enum EventType { EVENT_EMPTY, EVENT_HALF_FULL, EVENT_FULL, - } EventType; + }; typedef delegate<void (EventType)> event_delegate; diff --git a/src/mame/includes/atari.h b/src/mame/includes/atari.h index ee6d27e3f60..01d14d55325 100644 --- a/src/mame/includes/atari.h +++ b/src/mame/includes/atari.h @@ -169,7 +169,7 @@ POKEY_KEYBOARD_HANDLER(atari_a5200_keypads); #define COPY8(dst,s1,s2) *dst++ = s1; *dst++ = s2 #define COPY16(dst,s1,s2,s3,s4) *dst++ = s1; *dst++ = s2; *dst++ = s3; *dst++ = s4 -typedef struct { +struct ANTIC_R { UINT8 antic00; /* 00 nothing */ UINT8 antic01; /* 01 nothing */ UINT8 antic02; /* 02 nothing */ @@ -186,9 +186,9 @@ typedef struct { UINT8 penv; /* 0d light pen vertical pos */ UINT8 antic0e; /* 0e nothing */ UINT8 nmist; /* 0f NMI status */ -} ANTIC_R; /* read registers */ +}; /* read registers */ -typedef struct { +struct ANTIC_W { UINT8 dmactl; /* 00 write DMA control */ UINT8 chactl; /* 01 write character control */ UINT8 dlistl; /* 02 display list low */ @@ -205,7 +205,7 @@ typedef struct { UINT8 antic0d; /* 0d nothing */ UINT8 nmien; /* 0e NMI enable */ UINT8 nmires; /* 0f NMI reset */ -} ANTIC_W; /* write registers */ +}; /* write registers */ /* per scanline buffer for video data (and optimization variables) */ struct VIDEO { diff --git a/src/mame/includes/irobot.h b/src/mame/includes/irobot.h index b8cacd80035..257d03d585d 100644 --- a/src/mame/includes/irobot.h +++ b/src/mame/includes/irobot.h @@ -6,7 +6,7 @@ #define IR_TIMING 1 /* try to emulate MB and VG running time */ -typedef struct irmb_ops +struct irmb_ops { const struct irmb_ops *nxtop; UINT32 func; @@ -18,7 +18,7 @@ typedef struct irmb_ops UINT8 diren; UINT8 flags; UINT8 ramsel; -} irmb_ops; +}; class irobot_state : public driver_device diff --git a/src/mame/includes/micro3d.h b/src/mame/includes/micro3d.h index cbc7ae979d7..1aa83afb5a3 100644 --- a/src/mame/includes/micro3d.h +++ b/src/mame/includes/micro3d.h @@ -116,10 +116,10 @@ public: virtual void video_reset(); }; -typedef struct _micro3d_vtx_ +struct micro3d_vtx { INT32 x, y, z; -} micro3d_vtx; +}; /*----------- defined in machine/micro3d.c -----------*/ diff --git a/src/mame/includes/model2.h b/src/mame/includes/model2.h index a6a23144787..d6dc3d45c57 100644 --- a/src/mame/includes/model2.h +++ b/src/mame/includes/model2.h @@ -1,8 +1,8 @@ #include "video/poly.h" -typedef struct _raster_state raster_state; -typedef struct _geo_state geo_state; +struct raster_state; +struct geo_state; class model2_state : public driver_device diff --git a/src/mame/includes/model3.h b/src/mame/includes/model3.h index 313a1426f69..f4d1c074673 100644 --- a/src/mame/includes/model3.h +++ b/src/mame/includes/model3.h @@ -10,7 +10,7 @@ struct PLANE { float x,y,z,d; }; -typedef struct _cached_texture cached_texture; +struct cached_texture; class model3_state : public driver_device { diff --git a/src/mame/includes/n64.h b/src/mame/includes/n64.h index 0d79cd0da5a..b4f86f66c7b 100644 --- a/src/mame/includes/n64.h +++ b/src/mame/includes/n64.h @@ -42,11 +42,11 @@ struct n64_savable_data_t class n64_periphs : public device_t { private: - typedef struct + struct AUDIO_DMA { UINT32 address; UINT32 length; - } AUDIO_DMA; + }; public: // construction/destruction diff --git a/src/mame/includes/seta.h b/src/mame/includes/seta.h index 4dc65804152..58653ec938b 100644 --- a/src/mame/includes/seta.h +++ b/src/mame/includes/seta.h @@ -6,8 +6,7 @@ #define __uPD71054_TIMER 1 -typedef struct _uPD71054_state uPD71054_state; -struct _uPD71054_state +struct uPD71054_state { emu_timer *timer[3]; // Timer UINT16 max[3]; // Max counter diff --git a/src/mame/includes/vectrex.h b/src/mame/includes/vectrex.h index 74e03f1d61a..c34f4c308cf 100644 --- a/src/mame/includes/vectrex.h +++ b/src/mame/includes/vectrex.h @@ -11,12 +11,12 @@ #define NVECT 10000 -typedef struct _vectrex_point +struct vectrex_point { int x; int y; rgb_t col; int intensity; -} vectrex_point; +}; class vectrex_state : public driver_device { diff --git a/src/mame/includes/vertigo.h b/src/mame/includes/vertigo.h index 11bdc20d770..ea8d6f8e636 100644 --- a/src/mame/includes/vertigo.h +++ b/src/mame/includes/vertigo.h @@ -12,14 +12,14 @@ #define MC_LENGTH 512 -typedef struct _am2901 +struct am2901 { UINT32 ram[16]; /* internal ram */ UINT32 d; /* direct data D input */ UINT32 q; /* Q register */ UINT32 f; /* F ALU result */ UINT32 y; /* Y output */ -} am2901; +}; class vector_generator { @@ -50,7 +50,7 @@ private: running_machine *m_machine; }; -typedef struct _microcode +struct microcode { UINT32 x; UINT32 a; @@ -68,9 +68,9 @@ typedef struct _microcode UINT32 jmp; UINT32 jcon; UINT32 ma; -} microcode; +}; -typedef struct _vproc +struct vproc { UINT16 sram[64]; /* external sram */ UINT16 ramlatch; /* latch between 2901 and sram */ @@ -78,7 +78,7 @@ typedef struct _vproc UINT32 pc; /* program counter */ UINT32 ret; /* return address */ -} vproc; +}; class vertigo_state : public driver_device diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c index 3f438324671..76b144e7ace 100644 --- a/src/mame/machine/decocass.c +++ b/src/mame/machine/decocass.c @@ -1831,7 +1831,7 @@ READ8_HANDLER( i8041_p2_r ) ***************************************************************************/ /* regions within the virtual tape */ -enum _tape_region +enum tape_region { REGION_LEADER, /* in clear leader section */ REGION_LEADER_GAP, /* in gap between leader and BOT */ @@ -1844,11 +1844,10 @@ enum _tape_region REGION_TRAILER_GAP, /* in gap between trailer and EOT */ REGION_TRAILER /* in clear trailer section */ }; -typedef enum _tape_region tape_region; /* bytes within a data block on a virtual tape */ -enum _tape_byte +enum tape_byte { BYTE_PRE_GAP_0, /* 34 bytes of gap, clock held to 0, no data */ BYTE_PRE_GAP_33 = BYTE_PRE_GAP_0 + 33, @@ -1865,7 +1864,6 @@ enum _tape_byte BYTE_POSTGAP_33 = BYTE_POSTGAP_0 + 33, BYTE_BLOCK_TOTAL /* total number of bytes in block */ }; -typedef enum _tape_byte tape_byte; /* state of the tape */ diff --git a/src/mame/machine/gaelco3d.c b/src/mame/machine/gaelco3d.c index d6abc3fa80c..4d03d4920d4 100644 --- a/src/mame/machine/gaelco3d.c +++ b/src/mame/machine/gaelco3d.c @@ -91,7 +91,7 @@ struct shmem_t buf_t buf[2]; }; -typedef struct _osd_shared_mem osd_shared_mem; +struct osd_shared_mem; struct gaelco_serial_state { @@ -110,7 +110,7 @@ struct gaelco_serial_state shmem_t *m_shmem; }; -struct _osd_shared_mem +struct osd_shared_mem { char *fn; size_t size; diff --git a/src/mame/machine/pckeybrd.c b/src/mame/machine/pckeybrd.c index eb0697b1ece..9617a3ea034 100644 --- a/src/mame/machine/pckeybrd.c +++ b/src/mame/machine/pckeybrd.c @@ -167,7 +167,7 @@ static const int at_keyboard_scancode_set_2_3[]= #define AT_KEYBOARD_QUEUE_MAXSIZE 256 -typedef struct at_keyboard +struct at_keyboard { AT_KEYBOARD_TYPE type; int on; @@ -184,15 +184,15 @@ typedef struct at_keyboard int last_code; ioport_port *ports[8]; -} at_keyboard; +}; static at_keyboard keyboard; -typedef struct extended_keyboard_code +struct extended_keyboard_code { const char *pressed; const char *released; -} extended_keyboard_code; +}; static const extended_keyboard_code keyboard_mf2_code[0x10][2/*numlock off, on*/]={ diff --git a/src/mame/machine/snes7110.c b/src/mame/machine/snes7110.c index ae2deb69d0e..214e6acbbe9 100644 --- a/src/mame/machine/snes7110.c +++ b/src/mame/machine/snes7110.c @@ -118,7 +118,7 @@ static const UINT8 spc7110_mode2_context_table[32][2] = { 31, 31 }, }; -typedef struct +struct SPC7110Decomp { running_machine &machine() const { assert(m_machine != NULL); return *m_machine; } @@ -142,7 +142,7 @@ typedef struct UINT32 morton32[4][256]; UINT32 rom_size; -} SPC7110Decomp; +}; static SPC7110Decomp* SPC7110Decomp_ctor(running_machine &machine, UINT32 size); static void SPC7110Decomp_reset(SPC7110Decomp *thisptr); @@ -788,7 +788,7 @@ enum RTC_Mode static const UINT32 spc7110_months[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; -struct _snes_spc7110_t +struct snes_spc7110_t { //================== //decompression unit @@ -873,7 +873,7 @@ struct _snes_spc7110_t UINT32 size; }; -static _snes_spc7110_t snes_spc7110; +static snes_spc7110_t snes_spc7110; static void spc7110_init(running_machine& machine) { diff --git a/src/mame/machine/snesbsx.c b/src/mame/machine/snesbsx.c index 7fec8916d69..900a2c6c991 100644 --- a/src/mame/machine/snesbsx.c +++ b/src/mame/machine/snesbsx.c @@ -21,7 +21,7 @@ enum }; -struct _snes_bsx_state +struct snes_bsx_state { // base regs // we don't emulate the base unit yet @@ -42,7 +42,7 @@ struct _snes_bsx_state int ram_source; }; -static struct _snes_bsx_state bsx_state; +static snes_bsx_state bsx_state; static void bsx_update_memory_map(void) diff --git a/src/mame/machine/snesobc1.c b/src/mame/machine/snesobc1.c index b12c01f0679..5be5f0eacbe 100644 --- a/src/mame/machine/snesobc1.c +++ b/src/mame/machine/snesobc1.c @@ -12,14 +12,14 @@ ***************************************************************************/ -struct _snes_obc1_state +struct snes_obc1_state { int address; int offset; int shift; }; -static struct _snes_obc1_state obc1_state; +static snes_obc1_state obc1_state; static READ8_HANDLER( obc1_read ) diff --git a/src/mame/machine/snesrtc.c b/src/mame/machine/snesrtc.c index 31f415db131..4e1ac3c9e64 100644 --- a/src/mame/machine/snesrtc.c +++ b/src/mame/machine/snesrtc.c @@ -22,14 +22,14 @@ enum RTCM_Write }; -struct _snes_rtc_state +struct snes_rtc_state { UINT8 ram[13]; INT32 mode; INT8 index; }; -static _snes_rtc_state rtc_state; +static snes_rtc_state rtc_state; static const UINT8 srtc_months[12] = { diff --git a/src/mame/machine/snessdd1.c b/src/mame/machine/snessdd1.c index 0fc8d121873..5d3dbd45b5e 100644 --- a/src/mame/machine/snessdd1.c +++ b/src/mame/machine/snessdd1.c @@ -533,7 +533,7 @@ static void SDD1emu_decompress(SDD1emu* thisptr, UINT32 in_buf, UINT16 out_len, SDD1_OL_launch(thisptr->OL); } -typedef struct +struct snes_sdd1_t { UINT8 sdd1_enable; // channel bit-mask UINT8 xfer_enable; // channel bit-mask @@ -553,9 +553,9 @@ typedef struct UINT32 size; // length of data buffer; reads decrement counter, set ready to false at 0 UINT8 ready; // 1 when data[] is valid; 0 to invoke sdd1emu.decompress() } buffer; -} _snes_sdd1_t; +} ; -static _snes_sdd1_t snes_sdd1; +static snes_sdd1_t snes_sdd1; static void sdd1_init(running_machine& machine) { diff --git a/src/mame/machine/steppers.c b/src/mame/machine/steppers.c index 7923093a6dd..e95d44a4be6 100644 --- a/src/mame/machine/steppers.c +++ b/src/mame/machine/steppers.c @@ -47,7 +47,7 @@ static void update_optic(int which); /* local vars */ -typedef struct _stepper +struct stepper { const stepper_interface *intf; UINT8 pattern, /* coil pattern */ @@ -64,7 +64,7 @@ typedef struct _stepper index_patt; /* pattern needed on coils (0=don't care) */ UINT8 optic; -} stepper; +}; static stepper step[MAX_STEPPERS]; diff --git a/src/mame/machine/tait8741.c b/src/mame/machine/tait8741.c index d72d1786dcd..9eb50ad9e09 100644 --- a/src/mame/machine/tait8741.c +++ b/src/mame/machine/tait8741.c @@ -31,7 +31,7 @@ gladiatr and Great Swordsman set. #define CMD_08 1 #define CMD_4a 2 -typedef struct TAITO8741_status{ +struct I8741 { UINT8 toData; /* to host data */ UINT8 fromData; /* from host data */ UINT8 fromCmd; /* from host command */ @@ -48,7 +48,7 @@ typedef struct TAITO8741_status{ int coins; read8_space_func portHandler; const char *portName; -}I8741; +}; static const struct TAITO8741interface *intf; //static I8741 *taito8741; @@ -380,7 +380,7 @@ joshi Vollyball set. static int josvolly_nmi_enable; -typedef struct josvolly_8741_struct { +struct JV8741 { UINT8 cmd; UINT8 sts; UINT8 txd; @@ -391,7 +391,7 @@ typedef struct josvolly_8741_struct { UINT8 rst; const char *initReadPort; -}JV8741; +}; static JV8741 i8741[4]; diff --git a/src/mame/video/atarirle.c b/src/mame/video/atarirle.c index 7b055cef4c8..5daefeb7f13 100644 --- a/src/mame/video/atarirle.c +++ b/src/mame/video/atarirle.c @@ -27,7 +27,6 @@ ***************************************************************************/ /* internal structure containing a word index, shift and mask */ -typedef struct atarirle_mask atarirle_mask; struct atarirle_mask { int word; /* word index */ @@ -36,7 +35,6 @@ struct atarirle_mask }; /* internal structure for sorting the motion objects */ -typedef struct mo_sort_entry mo_sort_entry; struct mo_sort_entry { mo_sort_entry * next; @@ -44,7 +42,6 @@ struct mo_sort_entry }; /* internal structure describing each object in the ROMs */ -typedef struct atarirle_info atarirle_info; struct atarirle_info { INT16 width; @@ -57,7 +54,6 @@ struct atarirle_info }; /* internal structure containing the state of the motion objects */ -typedef struct atarirle_data atarirle_data; struct atarirle_data { int bitmapwidth; /* width of the full playfield bitmap */ diff --git a/src/mame/video/atarirle.h b/src/mame/video/atarirle.h index f01d1a9edb7..41b6974cd01 100644 --- a/src/mame/video/atarirle.h +++ b/src/mame/video/atarirle.h @@ -35,14 +35,12 @@ ***************************************************************************/ /* description for an eight-word mask */ -typedef struct atarirle_entry atarirle_entry; struct atarirle_entry { UINT16 data[8]; }; /* description of the motion objects */ -typedef struct atarirle_desc atarirle_desc; struct atarirle_desc { const char * region; /* region where the GFX data lives */ diff --git a/src/mame/video/bfm_dm01.c b/src/mame/video/bfm_dm01.c index e486f592e07..a9c608c79bd 100644 --- a/src/mame/video/bfm_dm01.c +++ b/src/mame/video/bfm_dm01.c @@ -52,7 +52,7 @@ Standard dm01 memorymap #define LOG(x) do { if (VERBOSE) logerror x; } while (0) -typedef struct _dm01 +struct bfmdm01 { const bfmdm01_interface *intf; int data_avail, @@ -64,7 +64,7 @@ typedef struct _dm01 UINT8 scanline[DM_BYTESPERROW], comdata; -} bfmdm01; +}; static bfmdm01 dm01; /////////////////////////////////////////////////////////////////////////// diff --git a/src/mame/video/dc.c b/src/mame/video/dc.c index 630e8c37cc0..2ed7a7f74d6 100644 --- a/src/mame/video/dc.c +++ b/src/mame/video/dc.c @@ -136,14 +136,14 @@ static void pvr_accumulationbuffer_to_framebuffer(address_space *space, int x,in static bitmap_rgb32 *fake_accumulationbuffer_bitmap; static void render_to_accumulation_buffer(running_machine &machine,bitmap_rgb32 &bitmap,const rectangle &cliprect); -typedef struct texinfo { +struct texinfo { UINT32 address, vqbase; int textured, sizex, sizey, stride, sizes, pf, palette, mode, mipmapped, blend_mode, filter_mode, flip_u, flip_v; UINT32 (*r)(running_machine &machine, struct texinfo *t, float x, float y); UINT32 (*blend)(UINT32 s, UINT32 d); int palbase, cd; -} texinfo; +}; typedef struct { diff --git a/src/mame/video/mcd212.h b/src/mame/video/mcd212.h index 1070678a8a7..396ea504cfc 100644 --- a/src/mame/video/mcd212.h +++ b/src/mame/video/mcd212.h @@ -60,7 +60,7 @@ struct mcd212_channel_t UINT8 weight_factor_b[768]; }; -typedef struct +struct mcd212_regs_t { running_machine &machine() const { assert(m_machine != NULL); return *m_machine; } @@ -71,7 +71,7 @@ typedef struct running_machine *m_machine; bitmap_rgb32 m_bitmap; -} mcd212_regs_t; +}; #define MCD212_CURCNT_COLOR 0x00000f // Cursor color #define MCD212_CURCNT_CUW 0x008000 // Cursor width diff --git a/src/mame/video/midzeus2.c b/src/mame/video/midzeus2.c index 50bf01ce902..e8e624c10a9 100644 --- a/src/mame/video/midzeus2.c +++ b/src/mame/video/midzeus2.c @@ -77,11 +77,11 @@ static int texel_width; static float zbase; #if TRACK_REG_USAGE -typedef struct reg_info +struct reg_info { struct reg_info *next; UINT32 value; -} reg_info; +}; static reg_info *regdata[0x80]; static int regdata_count[0x80]; diff --git a/src/mame/video/model2.c b/src/mame/video/model2.c index 4dd560ea20a..39d8878b318 100644 --- a/src/mame/video/model2.c +++ b/src/mame/video/model2.c @@ -129,7 +129,7 @@ struct triangle INT16 center[2]; }; -struct _quad_m2 +struct quad_m2 { poly_vertex v[4]; UINT16 z; @@ -297,7 +297,7 @@ static INT32 clip_polygon(poly_vertex *v, INT32 num_vertices, plane *cp, poly_ve #define MAX_TRIANGLES 32768 -struct _raster_state +struct raster_state { UINT32 mode; /* bit 0 = Test Mode, bit 2 = Switch 60Hz(1)/30Hz(0) operation */ UINT16 * texture_rom; /* Texture ROM pointer */ @@ -356,7 +356,7 @@ void model2_3d_set_zclip( running_machine &machine, UINT8 clip ) static void model2_3d_process_quad( raster_state *raster, UINT32 attr ) { - _quad_m2 object; + quad_m2 object; UINT16 *th, *tp; INT32 tho; UINT32 cull, i; @@ -1282,7 +1282,7 @@ static void model2_3d_push( raster_state *raster, UINT32 input ) * *******************************************/ -struct _geo_state +struct geo_state { raster_state * raster; UINT32 mode; /* bit 0 = Enable Specular, bit 1 = Calculate Normals */ diff --git a/src/mame/video/model3.c b/src/mame/video/model3.c index 21bf161b293..10d6265e55e 100644 --- a/src/mame/video/model3.c +++ b/src/mame/video/model3.c @@ -23,7 +23,7 @@ struct TRIANGLE UINT32 color; }; -struct _cached_texture +struct cached_texture { cached_texture *next; UINT8 width; diff --git a/src/mame/video/n64.h b/src/mame/video/n64.h index 772521f478f..0d82d398880 100644 --- a/src/mame/video/n64.h +++ b/src/mame/video/n64.h @@ -620,13 +620,13 @@ class n64_rdp : public poly_manager<UINT32, rdp_poly_state, 8, 32000> bool m_pending_mode_block; bool m_pipe_clean; - typedef struct + struct CVMASKDERIVATIVE { UINT8 cvg; UINT8 cvbit; UINT8 xoff; UINT8 yoff; - } CVMASKDERIVATIVE; + }; CVMASKDERIVATIVE cvarray[(1 << 8)]; UINT16 z_com_table[0x40000]; //precalced table of compressed z values, 18b: 512 KB array! diff --git a/src/mame/video/vrender0.c b/src/mame/video/vrender0.c index 151b11f7d24..e0445dfabb3 100644 --- a/src/mame/video/vrender0.c +++ b/src/mame/video/vrender0.c @@ -20,7 +20,7 @@ Missing: **************/ -struct _Quad +struct QuadInfo { UINT16 *Dest; UINT32 Pitch; //in UINT16s @@ -50,7 +50,7 @@ struct _Quad UINT32 DstColor; }; -struct _RenderState +struct RenderStateInfo { UINT32 Tx; UINT32 Ty; @@ -81,7 +81,7 @@ struct vr0video_state UINT16 InternalPalette[256]; UINT32 LastPalUpdate; - _RenderState RenderState; + RenderStateInfo RenderState; }; @@ -135,7 +135,7 @@ INLINE UINT16 Shade(UINT16 Src, UINT32 Shade) return RGB16(scr, scg, scb); } -static UINT16 Alpha(_Quad *Quad, UINT16 Src, UINT16 Dst) +static UINT16 Alpha(QuadInfo *Quad, UINT16 Src, UINT16 Dst) { UINT32 scr = (EXTRACTR8(Src) * ((Quad->Shade >> 16) & 0xff)) >> 8; UINT32 scg = (EXTRACTG8(Src) * ((Quad->Shade >> 8) & 0xff)) >> 8; @@ -238,7 +238,7 @@ static UINT16 Alpha(_Quad *Quad, UINT16 Src, UINT16 Dst) } #define TILENAME(bpp, t, a) \ -static void DrawQuad##bpp##t##a(_Quad *Quad) +static void DrawQuad##bpp##t##a(QuadInfo *Quad) //TRUST ON THE COMPILER OPTIMIZATIONS #define TILETEMPL(bpp, t, a) \ @@ -338,7 +338,7 @@ TILETEMPL(4,1,0) TILETEMPL(4,1,1) TILETEMPL(4,1,2) DrawQuad##bpp##t##a -static void DrawQuadFill(_Quad *Quad) +static void DrawQuadFill(QuadInfo *Quad) { UINT32 x, y; UINT16 *line = Quad->Dest; @@ -358,7 +358,7 @@ static void DrawQuadFill(_Quad *Quad) } } -typedef void (*_DrawTemplate)(_Quad *); +typedef void (*_DrawTemplate)(QuadInfo *); static const _DrawTemplate DrawImage[]= { @@ -486,7 +486,7 @@ int vrender0_ProcessPacket(device_t *device, UINT32 PacketPtr, UINT16 *Dest, UIN if (Packet0 & 0x100) { - _Quad Quad; + QuadInfo Quad; Quad.Pitch = 512; diff --git a/src/mame/video/ygv608.c b/src/mame/video/ygv608.c index 0d08b46447b..5536d82a102 100644 --- a/src/mame/video/ygv608.c +++ b/src/mame/video/ygv608.c @@ -555,7 +555,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r // - regardless of the visible display dimensions rectangle spriteClip(0, 512, 0, 512); - PSPRITE_ATTR sa; + SPRITE_ATTR *sa; int flipx = 0, flipy = 0; int i; diff --git a/src/mame/video/ygv608.h b/src/mame/video/ygv608.h index 0863bca79a3..476c377a354 100644 --- a/src/mame/video/ygv608.h +++ b/src/mame/video/ygv608.h @@ -126,7 +126,7 @@ enum { }; -typedef struct _ygv_ports { +struct YGV_PORTS { UINT8 na; // P#0 - pattern name table data port (read/write) UINT8 p1; // P#1 - sprite data port (read/write) UINT8 p2; // P#2 - scroll data port (read/write) @@ -135,9 +135,9 @@ typedef struct _ygv_ports { UINT8 p5; // P#5 - register select port (write only) UINT8 p6; // P#6 - status port (read/write) UINT8 p7; // P#7 - system control port (read/write) -} YGV_PORTS, *pYGV_PORTS; +}; -typedef struct _ygv_regs { +struct YGV_REGS { UINT8 r0; // R#0 - pattern name table access ptr (r/w) UINT8 r1; // R#1 - pattern name table access ptr (r/w) UINT8 r2; // R#2 - built in ram access control @@ -205,7 +205,7 @@ typedef struct _ygv_regs { UINT8 tb13; UINT8 tn4; -} YGV_REGS, *pYGV_REGS; +}; #define YGV608_MAX_SPRITES (YGV608_SPRITE_ATTR_TABLE_SIZE>>2) @@ -272,15 +272,15 @@ typedef struct _ygv_regs { #define VDW_SHIFT 0 #define VDW_MASK 0x3f -typedef struct { +struct SPRITE_ATTR { UINT8 sy; // y dot position 7:0 UINT8 sx; // x dot position 7:0 UINT8 attr; // 0xf0 = color, 0x0c = size, reverse, 0x02 = x hi bit, 0x01 = y hi bit UINT8 sn; // pattern name (0-255) -} SPRITE_ATTR, *PSPRITE_ATTR; +}; -typedef struct _ygv608 { +struct YGV608 { union { UINT8 b[8]; @@ -326,7 +326,7 @@ typedef struct _ygv608 { UINT8 screen_resize; // screen requires resize UINT8 tilemap_resize; // tilemap requires resize -} YGV608, *pYGV608; +}; void ygv608_set_gfxbank(UINT8 gfxbank); diff --git a/src/mess/audio/spchroms.h b/src/mess/audio/spchroms.h index ce97dc8474b..c10ce25ee04 100644 --- a/src/mess/audio/spchroms.h +++ b/src/mess/audio/spchroms.h @@ -1,10 +1,10 @@ #ifndef __SPCHROMS_H #define __SPCHROMS_H -typedef struct spchroms_interface +struct spchroms_interface { const char *memory_region; /* memory region where the speech ROM is. NULL means no speech ROM */ -} spchroms_interface; +}; void spchroms_config(running_machine &machine, const spchroms_interface *intf); diff --git a/src/mess/audio/wswan.c b/src/mess/audio/wswan.c index 28a7eb7af06..4fe4684ee67 100644 --- a/src/mess/audio/wswan.c +++ b/src/mess/audio/wswan.c @@ -21,8 +21,7 @@ struct CHAN { INT8 signal; /* signal */ }; -typedef struct SND wswan_sound_state; -struct SND { +struct wswan_sound_state { sound_stream *channel; struct CHAN audio1; /* Audio channel 1 */ struct CHAN audio2; /* Audio channel 2 */ diff --git a/src/mess/drivers/vboy.c b/src/mess/drivers/vboy.c index ca449f3908f..573511b8594 100644 --- a/src/mess/drivers/vboy.c +++ b/src/mess/drivers/vboy.c @@ -30,10 +30,8 @@ #include "audio/vboy.h" #include "vboy.lh" -typedef struct _vboy_regs_t vboy_regs_t; - /* FIXME: most if not all of these must be UINT8 */ -struct _vboy_regs_t +struct vboy_regs_t { UINT32 lpc, lpc2, lpt, lpr; UINT32 khb, klb; @@ -63,13 +61,13 @@ struct vip_regs_t UINT16 BKCOL; }; -struct _vboy_timer_t +struct vboy_timer_t { UINT16 count; UINT16 latch; }; -typedef struct _vboy_timer_t vboy_timer_t; +struct vboy_timer_t; class vboy_state : public driver_device { diff --git a/src/mess/includes/coco.h b/src/mess/includes/coco.h index 6e8ff9f80b2..50681d0a45a 100644 --- a/src/mess/includes/coco.h +++ b/src/mess/includes/coco.h @@ -179,38 +179,38 @@ private: static const device_timer_id TIMER_HIRES_JOYSTICK_Y = 1; static const device_timer_id TIMER_DIECOM_LIGHTGUN = 2; - typedef enum + enum soundmux_status_t { SOUNDMUX_SEL1 = 1, SOUNDMUX_SEL2 = 2, SOUNDMUX_ENABLE = 4 - } soundmux_status_t; + }; - typedef enum + enum joystick_type_t { JOYSTICK_NONE = 0x00, JOYSTICK_NORMAL = 0x01, JOYSTICK_RAT_MOUSE = 0x02, JOYSTICK_DIECOM_LIGHT_GUN = 0x03 - } joystick_type_t; + }; - typedef enum + enum hires_type_t { HIRES_NONE = 0x00, HIRES_RIGHT = 0x01, HIRES_RIGHT_COCOMAX3 = 0x02, HIRES_LEFT = 0x03, HIRES_LEFT_COCOMAX3 = 0x04, - } hires_type_t; + }; - typedef struct + struct analog_input_t { ioport_port *m_input[2][2]; ioport_port *m_buttons; UINT8 input(int joystick, int axis) const { return m_input[joystick][axis] ? m_input[joystick][axis]->read() : 0x00; } UINT8 buttons(void) const { return m_buttons ? m_buttons->read() : 0x00; } - } analog_input_t; + }; void analog_port_start(analog_input_t *analog, const char *rx_tag, const char *ry_tag, const char *lx_tag, const char *ly_tag, const char *buttons_tag); diff --git a/src/mess/includes/enterp.h b/src/mess/includes/enterp.h index 1b0adba3f74..50f84645a42 100644 --- a/src/mess/includes/enterp.h +++ b/src/mess/includes/enterp.h @@ -14,6 +14,8 @@ #define NICK_PALETTE_SIZE 256 +struct NICK_STATE; + class ep_state : public driver_device { public: @@ -23,7 +25,7 @@ public: UINT8 exdos_card_value; /* state of the wd1770 irq/drq lines */ UINT8 keyboard_line; /* index of keyboard line to read */ bitmap_ind16 m_bitmap; - struct _NICK_STATE *nick; + NICK_STATE *nick; DECLARE_READ8_MEMBER(exdos_card_r); DECLARE_WRITE8_MEMBER(exdos_card_w); virtual void machine_reset(); diff --git a/src/mess/includes/kaypro.h b/src/mess/includes/kaypro.h index 76092fe0ecc..1bc6aac752c 100644 --- a/src/mess/includes/kaypro.h +++ b/src/mess/includes/kaypro.h @@ -12,6 +12,7 @@ #include "sound/beep.h" #include "video/mc6845.h" +struct kay_kbd_t; class kaypro_state : public driver_device { @@ -65,7 +66,7 @@ public: UINT8 m_framecnt; UINT16 m_cursor; UINT16 m_mc6845_video_address; - struct _kay_kbd_t *m_kbd; + kay_kbd_t *m_kbd; void mc6845_cursor_configure(); void mc6845_screen_configure(); DECLARE_MACHINE_START(kayproii); diff --git a/src/mess/includes/lisa.h b/src/mess/includes/lisa.h index 13423f4e29a..10cc368119b 100644 --- a/src/mess/includes/lisa.h +++ b/src/mess/includes/lisa.h @@ -16,21 +16,21 @@ #define KB_COP421_TAG "kbcop" /* lisa MMU segment regs */ -typedef struct real_mmu_entry +struct real_mmu_entry { UINT16 sorg; UINT16 slim; -} real_mmu_entry; +}; /* MMU regs translated into a more efficient format */ enum mmu_entry_t { RAM_stack_r, RAM_r, RAM_stack_rw, RAM_rw, IO, invalid, special_IO }; -typedef struct mmu_entry +struct mmu_entry { offs_t sorg; /* (real_sorg & 0x0fff) << 9 */ mmu_entry_t type; /* <-> (real_slim & 0x0f00) */ int slim; /* (~ ((real_slim & 0x00ff) << 9)) & 0x01ffff */ -} mmu_entry; +}; enum floppy_hardware_t { @@ -48,7 +48,7 @@ enum clock_mode_t }; /* clock mode */ /* clock registers */ -typedef struct _clock_regs_t +struct clock_regs_t { long alarm; /* alarm (20-bit binary) */ int years; /* years (4-bit binary ) */ @@ -66,9 +66,9 @@ typedef struct _clock_regs_t int clock_write_ptr; /* clock byte to be written next (-1 if clock write disabled) */ enum clock_mode_t clock_mode; -} clock_regs_t; +}; -typedef struct _lisa_features_t +struct lisa_features_t { unsigned int has_fast_timers : 1; /* I/O board VIAs are clocked at 1.25 MHz (?) instead of .5 MHz (?) (Lisa 2/10, Mac XL) */ /* Note that the beep routine in boot ROMs implies that @@ -86,7 +86,7 @@ typedef struct _lisa_features_t floppy_hardware_t floppy_hardware; unsigned int has_double_sided_floppy : 1; /* true on lisa 1 and *hacked* lisa 2/10 / Mac XL */ unsigned int has_mac_xl_video : 1; /* modified video for MacXL */ -} lisa_features_t; +}; class lisa_state : public driver_device diff --git a/src/mess/includes/odyssey2.h b/src/mess/includes/odyssey2.h index 2dd88787ee9..93e00f109ed 100644 --- a/src/mess/includes/odyssey2.h +++ b/src/mess/includes/odyssey2.h @@ -24,7 +24,7 @@ #define I824X_SCREEN_HEIGHT 243 #define I824X_LINE_CLOCKS 228 -typedef union { +union o2_vdc_t { UINT8 reg[0x100]; struct { struct { @@ -52,7 +52,7 @@ typedef union { UINT8 hgrid[2][0x10]; UINT8 vgrid[0x10]; } s; -} o2_vdc_t; +}; struct ef9341_t { diff --git a/src/mess/includes/pdp1.h b/src/mess/includes/pdp1.h index 20534a5b44e..3f66c5e18c3 100644 --- a/src/mess/includes/pdp1.h +++ b/src/mess/includes/pdp1.h @@ -164,7 +164,7 @@ enum }; /* tape reader registers */ -typedef struct tape_reader_t +struct tape_reader_t { device_image_interface *fd; /* file descriptor of tape image */ @@ -177,32 +177,32 @@ typedef struct tape_reader_t int rcp; /* 1-bit reader "need a completion pulse" flip-flop */ emu_timer *timer; /* timer to simulate reader timing */ -} tape_reader_t; +}; /* tape puncher registers */ -typedef struct tape_puncher_t +struct tape_puncher_t { device_image_interface *fd; /* file descriptor of tape image */ emu_timer *timer; /* timer to generate completion pulses */ -} tape_puncher_t; +}; /* typewriter registers */ -typedef struct typewriter_t +struct typewriter_t { device_image_interface *fd; /* file descriptor of output image */ int tb; /* typewriter buffer */ emu_timer *tyo_timer;/* timer to generate completion pulses */ -} typewriter_t; +}; /* MIT parallel drum (mostly similar to type 23) */ -typedef struct parallel_drum_t +struct parallel_drum_t { device_image_interface *fd; /* file descriptor of drum image */ @@ -216,16 +216,16 @@ typedef struct parallel_drum_t emu_timer *rotation_timer; /* timer called each time dc is 0 */ emu_timer *il_timer; /* timer called each time dc is il */ -} parallel_drum_t; +}; -typedef struct lightpen_t +struct lightpen_t { char active; char down; short x, y; short radius; -} lightpen_t; +}; class pdp1_state : public driver_device diff --git a/src/mess/includes/rmnimbus.h b/src/mess/includes/rmnimbus.h index 7d25dbfeacc..e59a469c762 100644 --- a/src/mess/includes/rmnimbus.h +++ b/src/mess/includes/rmnimbus.h @@ -152,7 +152,7 @@ struct ipc_interface_t }; /* Mouse/Joystick */ -struct _mouse_joy_state +struct mouse_joy_state { UINT8 m_mouse_px; UINT8 m_mouse_py; @@ -186,7 +186,7 @@ public: UINT8 m_mcu_reg080; UINT8 m_iou_reg092; UINT8 m_last_playmode; - _mouse_joy_state m_nimbus_mouse; + mouse_joy_state m_nimbus_mouse; UINT8 m_ay8910_a; UINT16 m_IOPorts[num_ioports]; UINT8 m_sio_int_state; diff --git a/src/mess/includes/tx0.h b/src/mess/includes/tx0.h index c0545234d18..67a7c38d88d 100644 --- a/src/mess/includes/tx0.h +++ b/src/mess/includes/tx0.h @@ -55,7 +55,7 @@ enum irg_pos_t /* tape reader registers */ -typedef struct tape_reader_t +struct tape_reader_t { device_image_interface *fd; /* file descriptor of tape image */ @@ -65,31 +65,31 @@ typedef struct tape_reader_t int rc; /* 2-bit reader counter */ emu_timer *timer; /* timer to simulate reader timing */ -} tape_reader_t; +}; /* tape puncher registers */ -typedef struct tape_puncher_t +struct tape_puncher_t { device_image_interface *fd; /* file descriptor of tape image */ emu_timer *timer; /* timer to generate completion pulses */ -} tape_puncher_t; +}; /* typewriter registers */ -typedef struct typewriter_t +struct typewriter_t { device_image_interface *fd; /* file descriptor of output image */ emu_timer *prt_timer;/* timer to generate completion pulses */ -} typewriter_t; +}; /* magnetic tape unit registers */ -typedef struct magtape_t +struct magtape_t { device_image_interface *img; /* image descriptor */ @@ -121,7 +121,7 @@ typedef struct magtape_t int long_parity; emu_timer *timer; /* timer to simulate reader timing */ -} magtape_t; +}; class tx0_state : public driver_device diff --git a/src/mess/machine/990_hd.c b/src/mess/machine/990_hd.c index 318009bdb73..27aa6cab4ba 100644 --- a/src/mess/machine/990_hd.c +++ b/src/mess/machine/990_hd.c @@ -40,10 +40,10 @@ for TI990. */ /* We can use MAME's harddisk.c image format instead. */ /* machine-independent big-endian 32-bit integer */ -typedef struct UINT32BE +struct UINT32BE { UINT8 bytes[4]; -} UINT32BE; +}; INLINE UINT32 get_UINT32BE(UINT32BE word) { @@ -61,13 +61,13 @@ INLINE void set_UINT32BE(UINT32BE *word, UINT32 data) #endif /* disk image header */ -typedef struct disk_image_header +struct disk_image_header { UINT32BE cylinders; /* number of cylinders on hard disk (big-endian) */ UINT32BE heads; /* number of heads on hard disk (big-endian) */ UINT32BE sectors_per_track; /* number of sectors per track on hard disk (big-endian) */ UINT32BE bytes_per_sector; /* number of bytes of data per sector on hard disk (big-endian) */ -} disk_image_header; +}; enum { @@ -81,7 +81,7 @@ enum format_t }; /* disk drive unit descriptor */ -typedef struct hd_unit_t +struct hd_unit_t { device_image_interface *img; /* image descriptor */ format_t format; @@ -91,17 +91,17 @@ typedef struct hd_unit_t /* disk geometry */ unsigned int cylinders, heads, sectors_per_track, bytes_per_sector; -} hd_unit_t; +}; /* disk controller */ -typedef struct hdc_t +struct hdc_t { UINT16 w[8]; void (*interrupt_callback)(running_machine &machine, int state); hd_unit_t d[MAX_DISK_UNIT]; -} hdc_t; +}; /* masks for individual bits controller registers */ enum diff --git a/src/mess/machine/990_tap.c b/src/mess/machine/990_tap.c index 475cf791887..ccc280f8e59 100644 --- a/src/mess/machine/990_tap.c +++ b/src/mess/machine/990_tap.c @@ -36,13 +36,13 @@ static void update_interrupt(device_t *device); #define MAX_TAPE_UNIT 4 -typedef struct tape_unit_t +struct tape_unit_t { device_image_interface *img; /* image descriptor */ unsigned int bot : 1; /* TRUE if we are at the beginning of tape */ unsigned int eot : 1; /* TRUE if we are at the end of tape */ unsigned int wp : 1; /* TRUE if tape is write-protected */ -} tape_unit_t; +}; struct tap_990_t { diff --git a/src/mess/machine/amigacd.c b/src/mess/machine/amigacd.c index 802ea4390e0..901123c27a8 100644 --- a/src/mess/machine/amigacd.c +++ b/src/mess/machine/amigacd.c @@ -59,7 +59,7 @@ DMAC controller. #define ISTR_FF_FLG (1<<1) /* FIFO-Full Flag */ #define ISTR_FE_FLG (1<<0) /* FIFO-Empty Flag */ -struct _dmac_data +struct dmac_data_t { UINT16 istr; /* Interrupt Status Register (R) */ UINT16 cntr; /* Control Register (RW) */ @@ -69,7 +69,7 @@ struct _dmac_data emu_timer *dma_timer; }; -static _dmac_data dmac_data; +static dmac_data_t dmac_data; static void check_interrupts( running_machine &machine ) { diff --git a/src/mess/machine/cococart.h b/src/mess/machine/cococart.h index a62dbbc56d4..8bd3d979b6a 100644 --- a/src/mess/machine/cococart.h +++ b/src/mess/machine/cococart.h @@ -23,23 +23,21 @@ ***************************************************************************/ /* output lines on the CoCo cartridge slot */ -enum _cococart_line +enum cococart_line { COCOCART_LINE_CART, /* connects to PIA1 CB1 */ COCOCART_LINE_NMI, /* connects to NMI line on CPU */ COCOCART_LINE_HALT, /* connects to HALT line on CPU */ COCOCART_LINE_SOUND_ENABLE /* sound enable */ }; -typedef enum _cococart_line cococart_line; /* since we have a special value "Q" - we have to use a special enum here */ -enum _cococart_line_value +enum cococart_line_value { COCOCART_LINE_VALUE_CLEAR, COCOCART_LINE_VALUE_ASSERT, COCOCART_LINE_VALUE_Q }; -typedef enum _cococart_line_value cococart_line_value; struct coco_cartridge_line { diff --git a/src/mess/machine/corvushd.c b/src/mess/machine/corvushd.c index 51168e85fc1..13c0b8818f2 100644 --- a/src/mess/machine/corvushd.c +++ b/src/mess/machine/corvushd.c @@ -320,7 +320,7 @@ struct corvus_hdc_t { }; // Structure of Block #1, the Disk Parameter Block -typedef struct { +struct disk_parameter_block_t { struct { UINT8 lsb; UINT8 msb; @@ -337,7 +337,7 @@ typedef struct { UINT8 lsb; UINT8 msb; } revh_spare_table[16]; -} disk_parameter_block_t; +}; // Structure of Block #3, the Constellation Parameter Block struct constellation_parameter_block_t { @@ -351,7 +351,7 @@ struct constellation_parameter_block_t { }; // Structure of Block #7, the Semaphore Table Block -typedef struct { +struct semaphore_table_block_t { union { UINT8 semaphore_table[256]; // Table consists of 256 bytes struct { @@ -359,7 +359,7 @@ typedef struct { } semaphore_entry[32]; // 32 Entries } semaphore_block; UINT8 unused[256]; // Remaining half of block is unused -} semaphore_table_block_t; +}; // Command size structure (number of bytes to xmit and recv for each command) struct corvus_cmd_t { diff --git a/src/mess/machine/i8271.h b/src/mess/machine/i8271.h index 3030b5eca13..7bcefc6e2cd 100644 --- a/src/mess/machine/i8271.h +++ b/src/mess/machine/i8271.h @@ -36,12 +36,12 @@ extern const device_type I8271; TYPE DEFINITIONS ***************************************************************************/ -typedef struct i8271_interface +struct i8271_interface { void (*interrupt)(device_t *device, int state); void (*dma_request)(device_t *device, int state, int read_); const char *floppy_drive_tags[2]; -} i8271_interface; +}; /*************************************************************************** FUNCTION PROTOTYPES diff --git a/src/mess/machine/kay_kbd.c b/src/mess/machine/kay_kbd.c index fef580f2b29..1a12077e8a0 100644 --- a/src/mess/machine/kay_kbd.c +++ b/src/mess/machine/kay_kbd.c @@ -64,7 +64,7 @@ * - "Keypad ," is not mapped */ -typedef struct _kay_kbd_t +struct kay_kbd_t { device_t *beeper; UINT8 buff[16]; @@ -78,7 +78,7 @@ typedef struct _kay_kbd_t int key; int repeat; int repeater; -} kay_kbd_t; +}; INPUT_PORTS_START( kay_kbd ) PORT_START("ROW0") diff --git a/src/mess/machine/mac.c b/src/mess/machine/mac.c index 1e0a1154571..70d16fece52 100644 --- a/src/mess/machine/mac.c +++ b/src/mess/machine/mac.c @@ -3166,11 +3166,11 @@ static offs_t mac_dasm_override(device_t &device, char *buffer, offs_t pc, const #ifdef MAC_TRACETRAP static void mac_tracetrap(const char *cpu_name_local, int addr, int trap) { - typedef struct + struct sonycscodeentry { int csCode; const char *name; - } sonycscodeentry; + }; static const sonycscodeentry cscodes[] = { diff --git a/src/mess/machine/nes_unif.c b/src/mess/machine/nes_unif.c index 83f8a937921..3a374983d99 100644 --- a/src/mess/machine/nes_unif.c +++ b/src/mess/machine/nes_unif.c @@ -9,7 +9,7 @@ ****************************************************************************************/ -typedef struct __unif +struct unif { const char *board; /* UNIF board */ @@ -17,7 +17,7 @@ typedef struct __unif int wram; int chrram; int board_idx; -} unif; +}; /************************************************************* diff --git a/src/mess/machine/rmnimbus.c b/src/mess/machine/rmnimbus.c index f1cac74b308..fd621684400 100644 --- a/src/mess/machine/rmnimbus.c +++ b/src/mess/machine/rmnimbus.c @@ -2831,7 +2831,7 @@ static const int MOUSE_XYB[3][4] = { { 0, 0, 0, 0 }, { 0, 1, 1, 0 }, { 1, 1, 0, static void mouse_js_reset(running_machine &machine) { rmnimbus_state *drvstate = machine.driver_data<rmnimbus_state>(); - _mouse_joy_state *state = &drvstate->m_nimbus_mouse; + mouse_joy_state *state = &drvstate->m_nimbus_mouse; state->m_mouse_px=0; state->m_mouse_py=0; @@ -2860,7 +2860,7 @@ static TIMER_CALLBACK(mouse_callback) int xint; int yint; - _mouse_joy_state *state = &drvstate->m_nimbus_mouse; + mouse_joy_state *state = &drvstate->m_nimbus_mouse; state->m_reg0a4 = machine.root_device().ioport(MOUSE_BUTTON_TAG)->read() | 0xC0; @@ -3000,7 +3000,7 @@ READ8_MEMBER(rmnimbus_state::nimbus_mouse_js_r) */ UINT8 result; //int pc=machine().device(MAINCPU_TAG)->safe_pc(); - _mouse_joy_state *state = &m_nimbus_mouse; + mouse_joy_state *state = &m_nimbus_mouse; if (ioport("config")->read() & 0x01) { diff --git a/src/mess/machine/smartmed.c b/src/mess/machine/smartmed.c index 87e62ddb513..1d1251dfdc2 100644 --- a/src/mess/machine/smartmed.c +++ b/src/mess/machine/smartmed.c @@ -27,10 +27,10 @@ #define MAX_SMARTMEDIA 1 /* machine-independent big-endian 32-bit integer */ -typedef struct UINT32BE +struct UINT32BE { UINT8 bytes[4]; -} UINT32BE; +}; INLINE UINT32 get_UINT32BE(UINT32BE word) { @@ -48,23 +48,23 @@ INLINE void set_UINT32BE(UINT32BE *word, UINT32 data) #endif /* SmartMedia image header */ -typedef struct disk_image_header +struct disk_image_header { UINT8 version; UINT32BE page_data_size; UINT32BE page_total_size; UINT32BE num_pages; UINT32BE log2_pages_per_block; -} disk_image_header; +}; -typedef struct disk_image_format_2_header +struct disk_image_format_2_header { UINT8 data1[3]; UINT8 padding1[256-3]; UINT8 data2[16]; UINT8 data3[16]; UINT8 padding2[768-32]; -} disk_image_format_2_header; +}; enum { diff --git a/src/mess/machine/smc92x4.h b/src/mess/machine/smc92x4.h index af4b17f1341..3c3b73832e9 100644 --- a/src/mess/machine/smc92x4.h +++ b/src/mess/machine/smc92x4.h @@ -36,7 +36,7 @@ extern const device_type SMC92X4; #define DS_READY 0x02 /* drive ready bit */ #define DS_WRFAULT 0x01 /* write fault */ -typedef struct _smc92x4_interface +struct smc92x4_interface { // Disk format support. This flag allows to choose between the full // FM/MFM format and an abbreviated track layout. The difference results @@ -70,7 +70,7 @@ typedef struct _smc92x4_interface // by external circuitry. */ devcb_write8 dma_write; -} smc92x4_interface; +}; class smc92x4_device : public device_t diff --git a/src/mess/machine/strata.c b/src/mess/machine/strata.c index b0f190c8a2e..06dad0ab893 100644 --- a/src/mess/machine/strata.c +++ b/src/mess/machine/strata.c @@ -229,11 +229,11 @@ int strataflash_save(device_t *device, emu_file *file) } /* bus width for 8/16-bit handlers */ -typedef enum bus_width_t +enum bus_width_t { bw_8, bw_16 -} bus_width_t; +}; /* read a 8/16-bit word from FEEPROM diff --git a/src/mess/machine/thomflop.c b/src/mess/machine/thomflop.c index fbd85c2b763..d47f4005cee 100644 --- a/src/mess/machine/thomflop.c +++ b/src/mess/machine/thomflop.c @@ -495,7 +495,7 @@ static void to7_5p14sd_init( running_machine &machine ) #define QDD_MAXBUF ( THOM_QDD_SIZE_ID + THOM_QDD_SIZE_DATA ) * 512 -static struct _to7qdd +struct to7qdd_t { /* MC6852 registers */ UINT8 status; @@ -514,7 +514,9 @@ static struct _to7qdd UINT8 data_crc; /* checksum when writing */ UINT8 index_pulse; /* one pulse per track */ -} * to7qdd; +}; + +static to7qdd_t * to7qdd; @@ -860,7 +862,7 @@ static void to7_qdd_init( running_machine &machine ) { LOG(( "to7_qdd_init: CQ 90-028 controller\n" )); - to7qdd = auto_alloc(machine, struct _to7qdd); + to7qdd = auto_alloc(machine, to7qdd_t); state_save_register_global( machine, to7qdd->status ); state_save_register_global( machine, to7qdd->ctrl1 ); @@ -904,7 +906,7 @@ static void to7_qdd_init( running_machine &machine ) #define THOM_MAXBUF ( THOM_QDD_SIZE_ID + THOM_QDD_SIZE_DATA ) * 512 -static struct _thmfc1 +struct thmfc1_t { UINT8 op; @@ -928,7 +930,9 @@ static struct _thmfc1 UINT8 stat0; /* status register */ -} * thmfc1; +}; + +static thmfc1_t * thmfc1; static emu_timer* thmfc_floppy_cmd; @@ -1560,7 +1564,7 @@ void thmfc_floppy_init( running_machine &machine ) { LOG(( "thmfc_floppy_init: THMFC1 controller\n" )); - thmfc1 = auto_alloc(machine, struct _thmfc1); + thmfc1 = auto_alloc(machine, thmfc1_t); thmfc_floppy_cmd = machine.scheduler().timer_alloc(FUNC(thmfc_floppy_cmd_complete_cb)); diff --git a/src/mess/machine/ti99/datamux.h b/src/mess/machine/ti99/datamux.h index 9f5dd7711f6..3575f2c2ce7 100644 --- a/src/mess/machine/ti99/datamux.h +++ b/src/mess/machine/ti99/datamux.h @@ -23,7 +23,7 @@ extern const device_type DATAMUX; if the HGSPL expansion card is used, the GROMs in the console must be removed. */ -typedef struct _dmux_device_list_entry +struct dmux_device_list_entry { const char *name; // Name of the device (used for looking up the device) UINT16 select; // State of the address line bits when addressing this device @@ -32,16 +32,16 @@ typedef struct _dmux_device_list_entry const char *setting; // configuration switch that may have an effect for the presence of this device UINT8 set; // bits that must be set for this switch so that this device is present UINT8 unset; // bits that must be reset for this switch so that this device is present -} dmux_device_list_entry; +}; #define DMUX_CONFIG(name) \ const datamux_config(name) = -typedef struct _datamux_config +struct datamux_config { devcb_write_line ready; const dmux_device_list_entry *devlist; -} datamux_config; +}; /* Device list of this datamux. diff --git a/src/mess/machine/ti99/evpc.h b/src/mess/machine/ti99/evpc.h index 0c78328cc33..6cb64e54a0b 100644 --- a/src/mess/machine/ti99/evpc.h +++ b/src/mess/machine/ti99/evpc.h @@ -20,14 +20,14 @@ extern const device_type TI99_EVPC; -typedef struct _evpc_palette +struct evpc_palette { UINT8 read_index, write_index, mask; int read; int state; struct { UINT8 red, green, blue; } color[0x100]; //int dirty; -} evpc_palette; +}; class snug_enhanced_video_device : public ti_expansion_card_device, public device_nvram_interface { diff --git a/src/mess/machine/ti99/genboard.h b/src/mess/machine/ti99/genboard.h index 0a0afb754e3..0d55611f071 100644 --- a/src/mess/machine/ti99/genboard.h +++ b/src/mess/machine/ti99/genboard.h @@ -44,10 +44,10 @@ private: /*****************************************************************************/ -typedef struct _geneve_keyboard_config +struct geneve_keyboard_config { devcb_write_line interrupt; -} geneve_keyboard_config; +}; #define GENEVE_KEYBOARD_CONFIG(name) \ const geneve_keyboard_config(name) = @@ -110,10 +110,10 @@ private: /*****************************************************************************/ -typedef struct _geneve_mapper_config +struct geneve_mapper_config { devcb_write_line ready; -} geneve_mapper_config; +}; class geneve_mapper_device : public device_t { diff --git a/src/mess/machine/ti99/grom.h b/src/mess/machine/ti99/grom.h index 3093e8bc45b..d8b5b864db5 100644 --- a/src/mess/machine/ti99/grom.h +++ b/src/mess/machine/ti99/grom.h @@ -13,7 +13,7 @@ #include "ti99defs.h" -typedef struct _ti99grom_config +struct ti99grom_config { bool writable; int ident; @@ -22,7 +22,7 @@ typedef struct _ti99grom_config int size; devcb_write_line ready; int clockrate; -} ti99grom_config; +}; #define GROM_CONFIG(name) \ const ti99grom_config(name) = diff --git a/src/mess/machine/ti99/gromport.h b/src/mess/machine/ti99/gromport.h index e36476d84ef..43df56c3a01 100644 --- a/src/mess/machine/ti99/gromport.h +++ b/src/mess/machine/ti99/gromport.h @@ -18,11 +18,11 @@ extern const device_type GROMPORT; #define GROMPORT_CONFIG(name) \ const gromport_config(name) = -typedef struct _gromport_config +struct gromport_config { devcb_write_line ready; devcb_write_line reset; -} gromport_config; +}; class ti99_cartridge_connector_device; @@ -366,11 +366,11 @@ private: }; -typedef struct _pcb_type +struct pcb_type { int id; const char* name; -} pcb_type; +}; /************************************************************************* RPK support @@ -437,7 +437,7 @@ private: void add_socket(const char* id, rpk_socket *newsock); }; -enum _rpk_open_error +enum rpk_open_error { RPK_OK, RPK_NOT_ZIP_FORMAT, @@ -455,7 +455,6 @@ enum _rpk_open_error RPK_NO_PCB_OR_RESOURCES, RPK_UNKNOWN_PCB_TYPE }; -typedef enum _rpk_open_error rpk_open_error; static const char error_text[15][30] = { diff --git a/src/mess/machine/ti99/joyport.h b/src/mess/machine/ti99/joyport.h index f51c6a86599..9e9a2caa78a 100644 --- a/src/mess/machine/ti99/joyport.h +++ b/src/mess/machine/ti99/joyport.h @@ -22,11 +22,11 @@ extern const device_type JOYPORT; -typedef struct _joyport_config +struct joyport_config { devcb_write_line interrupt; int vdp_clock; -} joyport_config; +}; #define JOYPORT_CONFIG(name) \ const joyport_config(name) = diff --git a/src/mess/machine/ti99/mapper8.h b/src/mess/machine/ti99/mapper8.h index 8e164ef45bf..53bf2a1ca67 100644 --- a/src/mess/machine/ti99/mapper8.h +++ b/src/mess/machine/ti99/mapper8.h @@ -36,7 +36,7 @@ extern const device_type MAPPER8; #define SRAM_SIZE 2048 #define DRAM_SIZE 65536 -typedef struct _mapper8_list_entry +struct mapper8_list_entry { const char* name; // Name of the device (used for looking up the device) int mode; // Mode of the system which applies to this entry @@ -44,16 +44,16 @@ typedef struct _mapper8_list_entry UINT32 select_pattern; // State of the address line bits when addressing this device UINT32 address_mask; // Bits of the address bus used to address this device UINT32 write_select; // Additional bits set when doing write accesses to this device -} mapper8_list_entry; +}; #define MAPPER8_CONFIG(name) \ const mapper8_config(name) = -typedef struct _mapper8_config +struct mapper8_config { devcb_write_line ready; const mapper8_list_entry *devlist; -} mapper8_config; +}; /* Device list of the mapper. diff --git a/src/mess/machine/ti99/peribox.h b/src/mess/machine/ti99/peribox.h index c7b163fdfbe..2ba6bb47b5d 100644 --- a/src/mess/machine/ti99/peribox.h +++ b/src/mess/machine/ti99/peribox.h @@ -23,13 +23,13 @@ extern const device_type PERIBOX_GEN; #define DSRROM "dsrrom" -typedef struct _peribox_config +struct peribox_config { devcb_write_line inta; devcb_write_line intb; devcb_write_line ready; int prefix; -} peribox_config; +}; #define PERIBOX_CONFIG(name) \ const peribox_config(name) = diff --git a/src/mess/machine/ti99/speech8.h b/src/mess/machine/ti99/speech8.h index 1b0ab35d712..c50324c6428 100644 --- a/src/mess/machine/ti99/speech8.h +++ b/src/mess/machine/ti99/speech8.h @@ -21,10 +21,10 @@ extern const device_type TI99_SPEECH8; #define SPEECH8_CONFIG(name) \ const speech8_config(name) = -typedef struct _speech8_config +struct speech8_config { devcb_write_line ready; -} speech8_config; +}; class ti998_spsyn_device : public bus8z_device diff --git a/src/mess/machine/ti99/ti99_hd.h b/src/mess/machine/ti99/ti99_hd.h index 42ceaa892dc..1457eb25299 100644 --- a/src/mess/machine/ti99/ti99_hd.h +++ b/src/mess/machine/ti99/ti99_hd.h @@ -25,7 +25,7 @@ extern const device_type TI99_MFMHD; Needed to adapt to higher cylinder numbers. Floppies do not have such high numbers. */ -typedef struct chrn_id_hd +struct chrn_id_hd { UINT16 C; UINT8 H; @@ -33,7 +33,7 @@ typedef struct chrn_id_hd UINT8 N; int data_id; // id for read/write data command unsigned long flags; -} chrn_id_hd; +}; class mfm_harddisk_device : public device_t { diff --git a/src/mess/machine/ti99/videowrp.h b/src/mess/machine/ti99/videowrp.h index 4433a5a72e9..f0e765eb42f 100644 --- a/src/mess/machine/ti99/videowrp.h +++ b/src/mess/machine/ti99/videowrp.h @@ -77,10 +77,10 @@ extern const device_type V9938VIDEO; extern const device_type TISOUND_94624; extern const device_type TISOUND_76496; -typedef struct _ti_sound_config +struct ti_sound_config { devcb_write_line ready; -} ti_sound_config; +}; #define TI_SOUND_CONFIG(name) \ const ti_sound_config(name) = diff --git a/src/mess/machine/upd7002.c b/src/mess/machine/upd7002.c index 2ba476cf950..087be183fd0 100644 --- a/src/mess/machine/upd7002.c +++ b/src/mess/machine/upd7002.c @@ -12,8 +12,7 @@ #include "upd7002.h" -typedef struct _uPD7002_t uPD7002_t; -struct _uPD7002_t +struct uPD7002_t { /* Pointer to our interface */ const uPD7002_interface *intf; diff --git a/src/mess/machine/upd7002.h b/src/mess/machine/upd7002.h index 82b7cc1eacb..4d93d0344eb 100644 --- a/src/mess/machine/upd7002.h +++ b/src/mess/machine/upd7002.h @@ -47,8 +47,7 @@ typedef void (*uPD7002_eoc_func)(device_t *device, int data); #define UPD7002_EOC(name) void name(device_t *device, int data ) -typedef struct _uPD7002_interface uPD7002_interface; -struct _uPD7002_interface +struct uPD7002_interface { uPD7002_get_analogue_func get_analogue_func; uPD7002_eoc_func EOC_func; diff --git a/src/mess/machine/upd765.h b/src/mess/machine/upd765.h index 88101db4b5d..23ce05cf78f 100644 --- a/src/mess/machine/upd765.h +++ b/src/mess/machine/upd765.h @@ -91,7 +91,7 @@ typedef device_t *(*upd765_get_image_func)(device_t *device, int floppy_index); #define UPD765_GET_IMAGE(name) device_t *name(device_t *device, int floppy_index ) -typedef struct upd765_interface +struct upd765_interface { /* interrupt issued */ devcb_write_line out_int_func; @@ -105,7 +105,7 @@ typedef struct upd765_interface UPD765_RDY_PIN rdy_pin; const char *floppy_drive_tags[4]; -} upd765_interface; +}; /*************************************************************************** diff --git a/src/mess/tools/imgtool/filter.h b/src/mess/tools/imgtool/filter.h index 0e93d5e2092..324c891d5dd 100644 --- a/src/mess/tools/imgtool/filter.h +++ b/src/mess/tools/imgtool/filter.h @@ -14,7 +14,7 @@ #include "library.h" -typedef struct _imgtool_filter imgtool_filter; +struct imgtool_filter; enum { diff --git a/src/mess/tools/imgtool/imgtool.c b/src/mess/tools/imgtool/imgtool.c index 4236050f870..ce958f67f2a 100644 --- a/src/mess/tools/imgtool/imgtool.c +++ b/src/mess/tools/imgtool/imgtool.c @@ -20,13 +20,13 @@ TYPE DEFINITIONS ***************************************************************************/ -struct _imgtool_image +struct imgtool_image { const imgtool_module *module; object_pool *pool; }; -struct _imgtool_partition +struct imgtool_partition { imgtool_image *image; object_pool *pool; @@ -68,7 +68,7 @@ struct _imgtool_partition const char *writefile_optspec; }; -struct _imgtool_directory +struct imgtool_directory { imgtool_partition *partition; }; @@ -1121,7 +1121,7 @@ static imgtoolerr_t internal_open(const imgtool_module *module, const char *fnam } /* setup the image structure */ - size = sizeof(struct _imgtool_image) + module->image_extra_bytes; + size = sizeof(imgtool_image) + module->image_extra_bytes; image = (imgtool_image *) pool_malloc_lib(pool, size); if (!image) { @@ -2640,7 +2640,7 @@ imgtoolerr_t imgtool_directory_open(imgtool_partition *partition, const char *pa if (err) goto done; - size = sizeof(struct _imgtool_directory) + partition->directory_extra_bytes; + size = sizeof(imgtool_directory) + partition->directory_extra_bytes; enumeration = (imgtool_directory *) malloc(size); if (!enumeration) { diff --git a/src/mess/tools/imgtool/library.c b/src/mess/tools/imgtool/library.c index a564f37dd38..b0fa99d648d 100644 --- a/src/mess/tools/imgtool/library.c +++ b/src/mess/tools/imgtool/library.c @@ -12,7 +12,7 @@ #include "library.h" #include "pool.h" -struct _imgtool_library +struct imgtool_library { object_pool *pool; imgtool_module *first; @@ -32,7 +32,7 @@ imgtool_library *imgtool_library_create(void) goto error; /* allocate the main structure */ - library = (imgtool_library *)pool_malloc_lib(pool, sizeof(struct _imgtool_library)); + library = (imgtool_library *)pool_malloc_lib(pool, sizeof(imgtool_library)); if (!library) goto error; diff --git a/src/mess/tools/imgtool/library.h b/src/mess/tools/imgtool/library.h index 2a785a6b26d..9717e52e088 100644 --- a/src/mess/tools/imgtool/library.h +++ b/src/mess/tools/imgtool/library.h @@ -25,10 +25,10 @@ #include "charconv.h" -typedef struct _imgtool_image imgtool_image; -typedef struct _imgtool_partition imgtool_partition; -typedef struct _imgtool_directory imgtool_directory; -typedef struct _imgtool_library imgtool_library; +struct imgtool_image; +struct imgtool_partition; +struct imgtool_directory; +struct imgtool_library; enum imgtool_suggestion_viability_t { @@ -228,11 +228,11 @@ enum union imgtoolinfo; -typedef struct _imgtool_class imgtool_class; +struct imgtool_class; typedef void (*imgtool_get_info)(const imgtool_class *, UINT32, union imgtoolinfo *); -struct _imgtool_class +struct imgtool_class { imgtool_get_info get_info; imgtool_get_info derived_get_info; diff --git a/src/mess/tools/imgtool/modules/concept.c b/src/mess/tools/imgtool/modules/concept.c index 3a111074f31..0aa608e983e 100644 --- a/src/mess/tools/imgtool/modules/concept.c +++ b/src/mess/tools/imgtool/modules/concept.c @@ -12,10 +12,10 @@ #include <limits.h> #include "imgtool.h" -typedef struct UINT16xE +struct UINT16xE { UINT8 bytes[2]; -} UINT16xE; +}; /* get_UINT16xE @@ -69,7 +69,7 @@ INLINE void set_UINT16xE(int little_endian, UINT16xE *word, UINT16 data) device directory record (Disk sector 2-5) */ -typedef struct concept_vol_hdr_entry +struct concept_vol_hdr_entry { UINT16xE first_block; UINT16xE next_block; @@ -83,9 +83,9 @@ typedef struct concept_vol_hdr_entry char mem_flipped; char disk_flipped; UINT16xE unused; -} concept_vol_hdr_entry; +}; -typedef struct concept_file_dir_entry +struct concept_file_dir_entry { UINT16xE first_block; UINT16xE next_block; @@ -94,32 +94,32 @@ typedef struct concept_file_dir_entry unsigned char filename[16]; UINT16xE last_byte; UINT16xE last_access; -} concept_file_dir_entry; +}; -typedef struct concept_dev_dir +struct concept_dev_dir { concept_vol_hdr_entry vol_hdr; concept_file_dir_entry file_dir[77]; char unused[20]; -} concept_dev_dir; +}; /* concept disk image descriptor */ -typedef struct concept_image +struct concept_image { imgtool_stream *file_handle; /* imgtool file handle */ concept_dev_dir dev_dir; /* cached copy of device directory */ -} concept_image; +}; /* concept catalog iterator, used when imgtool reads the catalog */ -typedef struct concept_iterator +struct concept_iterator { concept_image *image; int index; /* current index */ -} concept_iterator; +}; static imgtoolerr_t concept_image_init(imgtool_image *img, imgtool_stream *f); diff --git a/src/mess/tools/imgtool/modules/mac.c b/src/mess/tools/imgtool/modules/mac.c index fd7c8c349fe..c8d0a65f4d5 100644 --- a/src/mess/tools/imgtool/modules/mac.c +++ b/src/mess/tools/imgtool/modules/mac.c @@ -114,20 +114,20 @@ #pragma mark MISCELLANEOUS UTILITIES #endif -typedef struct UINT16BE +struct UINT16BE { UINT8 bytes[2]; -} UINT16BE; +}; -typedef struct UINT24BE +struct UINT24BE { UINT8 bytes[3]; -} UINT24BE; +}; -typedef struct UINT32BE +struct UINT32BE { UINT8 bytes[4]; -} UINT32BE; +}; INLINE UINT16 get_UINT16BE(UINT16BE word) { @@ -181,27 +181,27 @@ typedef UINT32BE mac_type; /* point record, with the y and x coordinates */ -typedef struct mac_point +struct mac_point { UINT16BE v; /* actually signed */ UINT16BE h; /* actually signed */ -} mac_point; +}; /* rect record, with the corner coordinates */ -typedef struct mac_rect +struct mac_rect { UINT16BE top; /* actually signed */ UINT16BE left; /* actually signed */ UINT16BE bottom;/* actually signed */ UINT16BE right; /* actually signed */ -} mac_rect; +}; /* FInfo (Finder file info) record */ -typedef struct mac_FInfo +struct mac_FInfo { mac_type type; /* file type */ mac_type creator; /* file creator */ @@ -221,12 +221,12 @@ typedef struct mac_FInfo /* HFS & HFS+: System 7: The window in which the file???s icon appears System 8: reserved (set to 0) */ -} mac_FInfo; +}; /* FXInfo (Finder extended file info) record -- not found in MFS */ -typedef struct mac_FXInfo +struct mac_FXInfo { UINT16BE iconID; /* System 7: An ID number for the file???s icon; the numbers that identify icons are assigned by the @@ -243,12 +243,12 @@ typedef struct mac_FXInfo file onto the desktop, the directory ID of the folder from which the user moves the file is saved here) */ -} mac_FXInfo; +}; /* DInfo (Finder folder info) record -- not found in MFS */ -typedef struct mac_DInfo +struct mac_DInfo { mac_rect rect; /* Folder's window bounds */ UINT16BE flags; /* Finder flags, e.g. kIsInvisible, kNameLocked, etc */ @@ -259,12 +259,12 @@ typedef struct mac_DInfo UINT16BE view; /* System 7: The manner in which folders are displayed */ /* System 8: reserved (set to 0) */ -} mac_DInfo; +}; /* DXInfo (Finder extended folder info) record -- not found in MFS */ -typedef struct mac_DXInfo +struct mac_DXInfo { mac_point scroll; /* Scroll position */ UINT32BE openChain; /* System 7: chain of directory IDs for open folders */ @@ -279,7 +279,7 @@ typedef struct mac_DXInfo folder onto the desktop, the directory ID of the folder from which the user moves it is saved here) */ -} mac_DXInfo; +}; /* defines for FInfo & DInfo flags fields @@ -609,11 +609,11 @@ static void mac_strncpy(UINT8 *dest, int n, const UINT8 *src) /* disk image reference */ -typedef struct mac_l1_imgref +struct mac_l1_imgref { imgtool_image *image; UINT32 heads; -} mac_l1_imgref; +}; @@ -752,12 +752,10 @@ enum mac_format enum mac_forkID { data_fork = 0x00, rsrc_fork = 0xff }; -typedef struct mac_l2_imgref mac_l2_imgref; - /* MFS image ref */ -typedef struct mfs_l2_imgref +struct mfs_l2_imgref { UINT16 dir_num_files; UINT16 dir_start; @@ -769,16 +767,16 @@ typedef struct mfs_l2_imgref unsigned char ABlink_dirty[13]; /* dirty flag for each disk block in the ABlink array */ UINT8 ABlink[6141]; -} mfs_l2_imgref; +}; /* HFS extent descriptor */ -typedef struct hfs_extent +struct hfs_extent { UINT16BE stABN; /* first allocation block */ UINT16BE numABlks; /* number of allocation blocks */ -} hfs_extent; +}; /* HFS likes to group extents by 3 (it is 8 with HFS+), so we create a @@ -789,26 +787,26 @@ typedef hfs_extent hfs_extent_3[3]; /* MFS open file ref */ -typedef struct mfs_fileref +struct mfs_fileref { UINT16 stBlk; /* first allocation block of file */ -} mfs_fileref; +}; /* HFS open file ref */ -typedef struct hfs_fileref +struct hfs_fileref { hfs_extent_3 extents; /* first 3 file extents */ UINT32 parID; /* CNID of parent directory (undefined for extent & catalog files) */ mac_str31 filename; /* file name (undefined for extent & catalog files) */ -} hfs_fileref; +}; /* MFS/HFS open file ref */ -typedef struct mac_fileref +struct u { mac_l2_imgref *l2_img; /* image pointer */ @@ -828,13 +826,13 @@ typedef struct mac_fileref { mfs_fileref mfs; hfs_fileref hfs; - } u; + }; } mac_fileref; /* open BT ref */ -typedef struct mac_BTref +struct mac_BTref { mac_fileref fileref; /* open B-tree file ref */ @@ -849,7 +847,7 @@ typedef struct mac_BTref int (*key_compare_func)(const void *key1, const void *key2); void *node_buf; /* current node buffer */ -} mac_BTref; +}; /* Constants for BTHeaderRec attributes field @@ -864,7 +862,7 @@ enum /* HFS image ref */ -typedef struct hfs_l2_imgref +struct hfs_l2_imgref { UINT16 VBM_start; @@ -876,7 +874,7 @@ typedef struct hfs_l2_imgref mac_BTref cat_BT; UINT8 VBM[8192]; -} hfs_l2_imgref; +}; /* MFS/HFS image ref @@ -903,7 +901,7 @@ struct mac_l2_imgref /* MFS Master Directory Block */ -typedef struct mfs_mdb_t +struct mfs_mdb_ { UINT8 sigWord[2]; /* volume signature - always $D2D7 */ UINT32BE crDate; /* date and time of volume creation */ @@ -938,12 +936,12 @@ typedef struct mfs_mdb_t was that the disk utility could rely on the tag data to rebuild the link array if it should ever be corrupted. */ -} mfs_mdb_; +}; /* HFS Master Directory Block */ -typedef struct hfs_mdb_t +struct v1 { /* First fields are similar to MFS, though several fields have a different meaning */ UINT8 sigWord[2]; /* volume signature - always $D2D7 */ @@ -983,7 +981,7 @@ typedef struct hfs_mdb_t UINT16BE VCSize; /* size (in blocks) of volume cache */ UINT16BE VBMCSize; /* size (in blocks) of volume bitmap cache */ UINT16BE ctlCSize; /* size (in blocks) of common volume cache */ - } v1; + }; struct { UINT16BE embedSigWord; /* embedded volume signature */ @@ -998,17 +996,17 @@ typedef struct hfs_mdb_t } hfs_mdb_t; /* to save a little stack space, we use the same buffer for MDB and next blocks */ -typedef union img_open_buf +union img_open_buf { mfs_mdb_t mfs_mdb; hfs_mdb_t hfs_mdb; UINT8 raw[512]; -} img_open_buf; +}; /* Information extracted from catalog/directory */ -typedef struct mac_dirent +struct mac_dirent { UINT16 dataRecType; /* type of data record */ @@ -1026,14 +1024,14 @@ typedef struct mac_dirent UINT32 createDate; /* date and time of creation */ UINT32 modifyDate; /* date and time of last modification */ -} mac_dirent; +}; /* Tag record for GCR floppies (12 bytes) And, no, I don't know the format of the 20-byte tag record of the HD20 */ -typedef struct floppy_tag_record +struct floppy_tag_record { UINT32BE fileID; /* a.k.a. CNID */ /* a value of 1 seems to be the default for non-AB blocks, but this is not consistent */ @@ -1051,7 +1049,7 @@ typedef struct floppy_tag_record each time a volume is written to, the current value of wrCnt is written in the tag field, then it is incremented */ /* (DV17 says "disk block number", but it cannot be true) */ -} floppy_tag_record; +}; #ifdef UNUSED_FUNCTION static void hfs_image_close(mac_l2_imgref *l2_img); @@ -1452,7 +1450,7 @@ static imgtoolerr_t mac_file_seteof(mac_fileref *fileref, UINT32 newEof) files appear does not match file names, and it does not always match file IDs. */ -typedef struct mfs_dir_entry +struct mfs_dir_entry { UINT8 flags; /* bit 7=1 if entry used, bit 0=1 if file locked */ /* 0x00 means end of block: if we are not done @@ -1478,7 +1476,7 @@ typedef struct mfs_dir_entry /* next chars are file name - 255 chars at most */ /* IIRC, Finder 7 only supports 31 chars, wheareas earlier versions support 63 chars */ -} mfs_dir_entry; +}; /* FOBJ desktop resource: describes a folder, or the location of the volume @@ -1487,7 +1485,7 @@ typedef struct mfs_dir_entry In typical Apple manner, this resource is not documented. However, I have managed to reverse engineer some parts of it. */ -typedef struct mfs_FOBJ +struct mfs_FOBJ { UINT8 unknown0[2]; /* $00: $0004 for disk, $0008 for folder??? */ mac_point location; /* $02: location in parent window */ @@ -1522,19 +1520,19 @@ typedef struct mfs_FOBJ UINT8 name[1]; /* variable-length macintosh string */ } v2; } u; -} mfs_FOBJ; +}; /* MFS open dir ref */ -typedef struct mfs_dirref +struct mfs_dirref { mac_l2_imgref *l2_img; /* image pointer */ UINT16 index; /* current file index in the disk directory */ UINT16 cur_block; /* current block offset in directory file */ UINT16 cur_offset; /* current byte offset in current block of directory file */ UINT8 block_buffer[512]; /* buffer with current directory block */ -} mfs_dirref; +}; @@ -2770,13 +2768,13 @@ static int mfs_hashString(const mac_str255 string) /* HFS extents B-tree key */ -typedef struct hfs_extentKey +struct hfs_extentKey { UINT8 keyLength; /* length of key, excluding this field */ UINT8 forkType; /* 0 = data fork, FF = resource fork */ UINT32BE fileID; /* file ID */ UINT16BE startBlock; /* first file allocation block number in this extent */ -} hfs_extentKey; +}; enum { keyLength_hfs_extentKey = sizeof(hfs_extentKey) - sizeof(UINT8) @@ -2785,7 +2783,7 @@ enum /* HFS catalog B-tree key */ -typedef struct hfs_catKey +struct hfs_catKey { UINT8 keyLen; /* key length */ UINT8 resrv1; /* reserved */ @@ -2793,12 +2791,12 @@ typedef struct hfs_catKey mac_str31 cName; /* catalog node name */ /* note that in index nodes, it is a mac_str31, but in leaf keys it's a variable-length string */ -} hfs_catKey; +}; /* HFS catalog data record for a folder - 70 bytes */ -typedef struct hfs_catFolderData +struct hfs_catFolderData { UINT16BE recordType; /* record type */ UINT16BE flags; /* folder flags */ @@ -2810,12 +2808,12 @@ typedef struct hfs_catFolderData mac_DInfo userInfo; /* Finder information */ mac_DXInfo finderInfo; /* additional Finder information */ UINT32BE reserved[4]; /* reserved - set to zero */ -} hfs_catFolderData; +}; /* HFS catalog data record for a file - 102 bytes */ -typedef struct hfs_catFileData +struct hfs_catFileData { UINT16BE recordType; /* record type */ UINT8 flags; /* file flags */ @@ -2836,7 +2834,7 @@ typedef struct hfs_catFileData hfs_extent_3 dataExtents; /* first data fork extent record */ hfs_extent_3 rsrcExtents; /* first resource fork extent record */ UINT32BE reserved; /* reserved - set to zero */ -} hfs_catFileData; +}; /* HFS catalog data record for a thread - 46 bytes @@ -2844,24 +2842,24 @@ typedef struct hfs_catFileData The key for a thread record features the CNID of the item and an empty name, instead of the CNID of the parent and the item name. */ -typedef struct hfs_catThreadData +struct hfs_catThreadData { UINT16BE recordType; /* record type */ UINT32BE reserved[2]; /* reserved - set to zero */ UINT32BE parID; /* parent ID for this catalog node */ mac_str31 nodeName; /* name of this catalog node */ -} hfs_catThreadData; +}; /* union for all types at once */ -typedef union hfs_catData +union hfs_catData { UINT16BE dataType; hfs_catFolderData folder; hfs_catFileData file; hfs_catThreadData thread; -} hfs_catData; +}; /* HFS catalog record types @@ -2890,12 +2888,12 @@ enum /* BT functions used by HFS functions */ -typedef struct BT_leaf_rec_enumerator +struct BT_leaf_rec_enumerator { mac_BTref *BTref; UINT32 cur_node; int cur_rec; -} BT_leaf_rec_enumerator; +}; static imgtoolerr_t BT_open(mac_BTref *BTref, int (*key_compare_func)(const void *key1, const void *key2), int is_extent); static void BT_close(mac_BTref *BTref); @@ -2907,12 +2905,12 @@ static imgtoolerr_t BT_get_keyed_record_data(mac_BTref *BTref, void *rec_ptr, in static imgtoolerr_t BT_leaf_rec_enumerator_open(mac_BTref *BTref, BT_leaf_rec_enumerator *enumerator); static imgtoolerr_t BT_leaf_rec_enumerator_read(BT_leaf_rec_enumerator *enumerator, void **record_ptr, int *rec_len); -typedef struct hfs_cat_enumerator +struct hfs_cat_enumerator { mac_l2_imgref *l2_img; BT_leaf_rec_enumerator BT_enumerator; UINT32 parID; -} hfs_cat_enumerator; +}; /* hfs_open_extents_file @@ -3640,7 +3638,7 @@ static imgtoolerr_t hfs_file_get_nth_block_address(mac_fileref *fileref, UINT32 Header of a node record */ -typedef struct BTNodeHeader +struct BTNodeHeader { UINT32BE fLink; /* (index of) next node at this level */ UINT32BE bLink; /* (index of) previous node at this level */ @@ -3650,7 +3648,7 @@ typedef struct BTNodeHeader parent, whatever IM says) */ UINT16BE numRecords; /* number of records in this node */ UINT16BE reserved; /* reserved; set to zero */ -} BTNodeHeader; +}; /* Constants for BTNodeHeader kind field @@ -3672,7 +3670,7 @@ enum BTHeaderRecord: first record of a B-tree header node (second record is unused, and third is node allocation bitmap). */ -typedef struct BTHeaderRecord +struct BTHeaderRecord { UINT16BE treeDepth; /* maximum height (usually leaf nodes) */ UINT32BE rootNode; /* node number of root node */ @@ -3693,7 +3691,7 @@ typedef struct BTHeaderRecord UINT8 reserved2; /* reserved */ UINT32BE attributes; /* persistent attributes about the tree */ UINT32BE reserved3[16]; /* reserved */ -} BTHeaderRecord; +}; static imgtoolerr_t BT_check(mac_BTref *BTref, int is_extent); @@ -3955,13 +3953,13 @@ static imgtoolerr_t BT_get_keyed_record_data(mac_BTref *BTref, void *rec_ptr, in Return imgtool error code */ -typedef struct data_nodes_t +struct data_nodes_t { void *buf; UINT32 node_num; UINT32 cur_rec; UINT32 num_recs; -} data_nodes_t; +}; static imgtoolerr_t BT_check(mac_BTref *BTref, int is_extent) { UINT16 node_numRecords; @@ -4842,13 +4840,13 @@ static imgtoolerr_t BT_leaf_rec_enumerator_read(BT_leaf_rec_enumerator *enumerat /* Resource header */ -typedef struct rsrc_header +struct rsrc_header { UINT32BE data_offs; /* Offset from beginning of resource fork to resource data */ UINT32BE map_offs; /* Offset from beginning of resource fork to resource map */ UINT32BE data_len; /* Length of resource data */ UINT32BE map_len; /* Length of resource map */ -} rsrc_header; +}; /* Resource data: each data entry is preceded by its len (UINT32BE) @@ -4858,7 +4856,7 @@ typedef struct rsrc_header /* Resource map: */ -typedef struct rsrc_map_header +struct rsrc_map_header { rsrc_header reserved0; /* Reserved for copy of resource header */ UINT32BE reserved1; /* Reserved for handle to next resource map */ @@ -4869,22 +4867,22 @@ typedef struct rsrc_map_header UINT16BE namelist_offs; /* Offset from beginning of map to resource name list */ UINT16BE type_count; /* Number of types in the map minus 1 */ /* This is actually part of the type list, which matters for offsets */ -} rsrc_map_header; +}; /* Resource type list entry */ -typedef struct rsrc_type_entry +struct rsrc_type_entry { UINT32BE type; /* Resource type */ UINT16BE ref_count; /* Number of resources of this type in map minus 1 */ UINT16BE ref_offs; /* Offset from beginning of resource type list to reference list for this type */ -} rsrc_type_entry; +}; /* Resource reference list entry */ -typedef struct rsrc_ref_entry +struct rsrc_ref_entry { UINT16BE id; /* Resource ID */ UINT16BE name_offs; /* Offset from beginning of resource name list to resource name */ @@ -4892,13 +4890,13 @@ typedef struct rsrc_ref_entry UINT8 attr; /* Resource attributes */ UINT24BE data_offs; /* Offset from beginning of resource data to data for this resource */ UINT32BE reserved; /* Reserved for handle to resource */ -} rsrc_ref_entry; +}; /* Resource name list entry: this is just a standard macintosh string */ -typedef struct mac_resfileref +struct mac_resfileref { mac_fileref fileref; /* open resource fork ref (you may open resources files in data fork, too, if you ever need to, @@ -4911,7 +4909,7 @@ typedef struct mac_resfileref UINT16 namelist_offs; /* Offset from beginning of map to resource name list */ UINT16 type_count; /* Number of types in the map minus 1 */ /* This is actually part of the type list, which matters for offsets */ -} mac_resfileref; +}; #ifdef UNUSED_FUNCTION /* @@ -5311,7 +5309,7 @@ static void mac_image_info(imgtool_image *img, char *string, size_t len) /* MFS/HFS catalog iterator, used when imgtool reads the catalog */ -typedef struct mac_iterator +struct mac_iterator { mac_format format; mac_l2_imgref *l2_img; @@ -5326,7 +5324,7 @@ typedef struct mac_iterator hfs_cat_enumerator catref; /* catalog file enumerator */ } hfs; } u; -} mac_iterator; +}; /* Open the disk catalog for enumeration diff --git a/src/mess/tools/imgtool/modules/ti99.c b/src/mess/tools/imgtool/modules/ti99.c index 0b1172d4f31..54870a2dc47 100644 --- a/src/mess/tools/imgtool/modules/ti99.c +++ b/src/mess/tools/imgtool/modules/ti99.c @@ -266,15 +266,15 @@ will accept paths of such length). */ Miscellaneous utilities that are used to handle TI data types */ -typedef struct UINT16BE +struct UINT16BE { UINT8 bytes[2]; -} UINT16BE; +}; -typedef struct UINT16LE +struct UINT16LE { UINT8 bytes[2]; -} UINT16LE; +}; INLINE UINT16 get_UINT16BE(UINT16BE word) { @@ -456,42 +456,42 @@ static int check_fpath(const char *fpath) /* Disk geometry */ -typedef struct ti99_geometry +struct ti99_geometry { int secspertrack; int cylinders; int heads; -} ti99_geometry; +}; /* Physical sector address */ -typedef struct ti99_sector_address +struct ti99_sector_address { int sector; int cylinder; int side; -} ti99_sector_address; +}; /* Time stamp (used in fdr, and WIN VIB/DDR) */ -typedef struct ti99_date_time +struct ti99_date_time { UINT8 time_MSB, time_LSB;/* 0-4: hour, 5-10: minutes, 11-15: seconds/2 */ UINT8 date_MSB, date_LSB;/* 0-6: year, 7-10: month, 11-15: day */ -} ti99_date_time; +}; /* Subdirectory descriptor (HFDC only) The HFDC supports up to 3 subdirectories. */ -typedef struct dsk_subdir +struct dsk_subdir { char name[10]; /* subdirectory name (10 characters, pad with spaces) */ UINT16BE fdir_aphysrec; /* aphysrec address of fdir record for this subdirectory */ -} dsk_subdir; +}; /* DSK VIB record @@ -499,7 +499,7 @@ typedef struct dsk_subdir Most fields in this record are only revelant to level 2 routines, but level 1 routines need the disk geometry information extracted from the VIB. */ -typedef struct dsk_vib +struct dsk_vib { char name[10]; /* disk volume name (10 characters, pad with spaces) */ UINT16BE totphysrecs; /* total number of physrecs on disk (usually 360, */ @@ -526,7 +526,7 @@ typedef struct dsk_vib /* (AU 0 is associated to LSBit of byte 0, */ /* AU 7 to MSBit of byte 0, AU 8 to LSBit */ /* of byte 1, etc.) */ -} dsk_vib; +}; enum ti99_img_format { @@ -540,7 +540,7 @@ enum ti99_img_format /* level-1 disk image descriptor */ -typedef struct ti99_lvl1_imgref +struct ti99_lvl1_imgref { ti99_img_format img_format; /* tells the image format */ imgtool_stream *file_handle; /* imgtool file handle */ @@ -548,7 +548,7 @@ typedef struct ti99_lvl1_imgref ti99_geometry geometry; /* geometry */ unsigned pc99_track_len; /* unformatted track length (pc99 format) */ UINT32 *pc99_data_offset_array; /* offset for each sector (pc99 format) */ -} ti99_lvl1_imgref; +}; /* calculate CRC for data address marks or sector data @@ -1384,7 +1384,7 @@ static int write_absolute_physrec(ti99_lvl1_imgref *l1_img, unsigned aphysrec, c /* WIN VIB/DDR record */ -typedef struct win_vib_ddr +struct win_vib_ddr { char name[10]; /* disk volume name (10 characters, pad with spaces) */ UINT16BE totAUs; /* total number of AUs */ @@ -1437,16 +1437,16 @@ typedef struct win_vib_ddr } ddr; } u2; UINT16BE subdir_AU[114];/* points to all subdirectory DDRs */ -} win_vib_ddr; +}; /* AU format */ -typedef struct ti99_AUformat +struct ti99_AUformat { int totAUs; /* total number of AUs */ int physrecsperAU; /* number of 256-byte physical records per AU */ -} ti99_AUformat; +}; /* DSK directory reference: 0 for root, 1 for 1st subdir, 2 for 2nd subdir, 3 @@ -1457,55 +1457,55 @@ typedef struct ti99_AUformat /* catalog entry (used for in-memory catalog) */ -typedef struct dir_entry +struct dir_entry { UINT16 dir_ptr; /* DSK: unused */ /* WIN: AU address of the DDR for this directory */ char name[10]; /* name of this directory (copied from the VIB for DSK, DDR for WIN) */ -} dir_entry; +}; -typedef struct file_entry +struct file_entry { UINT16 fdr_ptr; /* DSK: aphysrec address of the FDR for this file */ /* WIN: AU address of the FDR for this file */ char name[10]; /* name of this file (copied from FDR) */ -} file_entry; +}; -typedef struct ti99_catalog +struct ti99_catalog { int num_subdirs; /* number of subdirectories */ int num_files; /* number of files */ dir_entry subdirs[114]; /* description of each subdir */ file_entry files[128]; /* description of each file */ -} ti99_catalog; +}; /* level-2 disk image descriptor */ -typedef struct ti99_lvl2_imgref_dsk +struct ti99_lvl2_imgref_dsk { UINT16 totphysrecs; /* total number of aphysrecs (extracted from vib record in aphysrec 0) */ ti99_catalog catalogs[4]; /* catalog of root directory and up to 3 subdirectories */ UINT16 fdir_aphysrec[4]; /* fdir aphysrec address for root directory and up to 3 subdirectories */ -} ti99_lvl2_imgref_dsk; +}; enum win_vib_t { win_vib_v1, win_vib_v2 }; -typedef struct ti99_lvl2_imgref_win +struct ti99_lvl2_imgref_win { win_vib_t vib_version; /* version of the vib record in aphysrec 0 (see win_vib_ddr) */ -} ti99_lvl2_imgref_win; +}; enum l2i_t { L2I_DSK, L2I_WIN }; -typedef struct ti99_lvl2_imgref +struct u { ti99_lvl1_imgref l1_img;/* image format, imgtool image handle, image geometry */ ti99_AUformat AUformat; /* AU format */ @@ -1535,7 +1535,7 @@ typedef struct ti99_lvl2_imgref { ti99_lvl2_imgref_dsk dsk; ti99_lvl2_imgref_win win; - } u; /* structure-specific info */ + }; /* structure-specific info */ } ti99_lvl2_imgref; /* @@ -1554,7 +1554,7 @@ enum /* DSK FDR record */ -typedef struct dsk_fdr +struct dsk_fdr { char name[10]; /* file name (10 characters, pad with spaces) */ UINT16BE xreclen; /* extended record len: if record len is >= 256, */ @@ -1595,12 +1595,12 @@ typedef struct dsk_fdr /* bytes each), one entry for each file cluster. */ /* 12 bits: address of first AU of cluster */ /* 12 bits: offset of last 256-byte record in cluster */ -} dsk_fdr; +}; /* WIN FDR record */ -typedef struct win_fdr +struct win_fdr { char name[10]; /* file name (10 characters, pad with spaces) */ UINT16BE xreclen; /* extended record len: if record len is >= 256, */ @@ -1657,12 +1657,12 @@ typedef struct win_fdr /* bytes each), one entry for each file cluster. */ /* 16 bits: address of first AU of cluster */ /* 16 bits: address of last AU of cluster */ -} win_fdr; +}; /* tifile header: stand-alone file */ -typedef struct tifile_header +struct tifile_header { char tifiles[8]; /* always '\7TIFILES' */ UINT16BE fphysrecs; /* file length in physrecs */ @@ -1697,32 +1697,32 @@ typedef struct tifile_header /* 4 bytes: time & date of last update */ /* 2 bytes: unknown (always >0000) */ /* 96 chars: 0xCA53 repeated 56 times */ -} tifile_header; +}; /* level-2 file descriptor */ -typedef struct ti99_lvl2_fileref_dsk +struct ti99_lvl2_fileref_dsk { ti99_lvl2_imgref *l2_img; int fdr_aphysrec; dsk_fdr fdr; -} ti99_lvl2_fileref_dsk; +}; -typedef struct ti99_lvl2_fileref_win +struct ti99_lvl2_fileref_win { ti99_lvl2_imgref *l2_img; unsigned fphysrecs; /* copy of field in the eldest FDR */ unsigned eldestfdr_aphysrec; /* aphysrec address of the eldest FDR */ unsigned curfdr_aphysrec; /* aphysrec address of the currently open sibling FDR */ win_fdr curfdr; /* buffer with currently open sibling FDR */ -} ti99_lvl2_fileref_win; +}; -typedef struct ti99_lvl2_fileref_tifiles +struct ti99_lvl2_fileref_tifiles { imgtool_stream *file_handle; tifile_header hdr; -} ti99_lvl2_fileref_tifiles; +}; enum l2f_type_t { @@ -1730,7 +1730,7 @@ enum l2f_type_t L2F_WIN, L2F_TIFILES }; -typedef struct ti99_lvl2_fileref +struct u { l2f_type_t type; union @@ -1738,7 +1738,7 @@ typedef struct ti99_lvl2_fileref ti99_lvl2_fileref_dsk dsk; ti99_lvl2_fileref_win win; ti99_lvl2_fileref_tifiles tifiles; - } u; + }; } ti99_lvl2_fileref; @@ -3696,14 +3696,14 @@ static void current_date_time(ti99_date_time *reply) * files with variable-size records (sequential-access) */ -typedef struct ti99_lvl3_fileref +struct ti99_lvl3_fileref { ti99_lvl2_fileref l2_file; int cur_log_rec; int cur_phys_rec; int cur_pos_in_phys_rec; -} ti99_lvl3_fileref; +}; #ifdef UNUSED_FUNCTION /* @@ -3827,23 +3827,23 @@ static int read_next_record(ti99_lvl3_fileref *l3_file, void *dest, int *out_rec /* ti99 catalog iterator, used when imgtool reads the catalog */ -typedef struct dsk_iterator +struct dsk_iterator { ti99_lvl2_imgref *image; int level; int listing_subdirs; /* true if we are listing subdirectories at current level */ int index[2]; /* current index in the disk catalog */ ti99_catalog *cur_catalog; /* current catalog */ -} dsk_iterator; +}; -typedef struct win_iterator +struct win_iterator { ti99_lvl2_imgref *image; int level; int listing_subdirs; /* true if we are listing subdirectories at current level */ int index[MAX_DIR_LEVEL]; /* current index in the disk catalog */ ti99_catalog catalog[MAX_DIR_LEVEL]; /* current catalog */ -} win_iterator; +}; static imgtoolerr_t dsk_image_init_mess(imgtool_image *image, imgtool_stream *f); diff --git a/src/mess/tools/imgtool/modules/ti990hd.c b/src/mess/tools/imgtool/modules/ti990hd.c index a9607efb3ef..44fde6df08b 100644 --- a/src/mess/tools/imgtool/modules/ti990hd.c +++ b/src/mess/tools/imgtool/modules/ti990hd.c @@ -35,15 +35,15 @@ that is longer than 39 characters. */ #define MAX_DIR_LEVEL 25 /* We need to put a recursion limit to avoid endless recursion hazard */ -typedef struct UINT16BE +struct UINT16BE { UINT8 bytes[2]; -} UINT16BE; +}; -typedef struct UINT32BE +struct UINT32BE { UINT8 bytes[4]; -} UINT32BE; +}; INLINE UINT16 get_UINT16BE(UINT16BE word) { @@ -72,13 +72,13 @@ INLINE void set_UINT32BE(UINT32BE *word, UINT32 data) /* disk image header */ -typedef struct disk_image_header +struct disk_image_header { UINT32BE cylinders; /* number of cylinders on hard disk (big-endian) */ UINT32BE heads; /* number of heads on hard disk (big-endian) */ UINT32BE sectors_per_track; /* number of sectors per track on hard disk (big-endian) */ UINT32BE bytes_per_sector; /* number of bytes of data per sector on hard disk (big-endian) */ -} disk_image_header; +}; enum { @@ -101,7 +101,7 @@ enum /* SC0 record (Disk sector 0) */ -typedef struct ti990_sc0 +struct ti990_sc0 { char vnm[8]; /* volume name */ UINT16BE tna; /* total number of ADUs */ @@ -148,12 +148,12 @@ typedef struct ti990_sc0 UINT16BE dct; /* disk creation time */ UINT16BE fsf; /* * * RESERVED * * */ /* SCOSIZ = >AA */ -} ti990_sc0; +}; /* DOR (Directory Overhead Record) */ -typedef struct ti990_dor +struct ti990_dor { UINT16BE nrc; /* # records in directory (minus DOR) nrc = nfl + nar (+ tfc???) */ UINT16BE nfl; /* # files currently in directory */ @@ -164,7 +164,7 @@ typedef struct ti990_dor char pnm[8]; /* name of parent directory (VCATALOG for root, even though it makes little sense) */ UINT16BE prs; /* "default physical record length (used for file creation)" */ /* DORSIZ = >1C */ -} ti990_dor; +}; /* file flags found in fdr @@ -198,16 +198,16 @@ enum /* ACE subrecord found in FDR */ -typedef struct ti990_ace +struct ti990_ace { char agn[8]; /* access group name */ UINT16BE flg; /* flags */ -} ti990_ace; +}; /* FDR record */ -typedef struct ti990_fdr +struct ti990_fdr { UINT16BE hkc; /* hask key count: the number of file descriptor records that are present in the directory that hashed to this record number */ UINT16BE hkv; /* hask key value: the result of the hash algorithm for the file name actually covered in this record */ @@ -243,7 +243,7 @@ typedef struct ti990_fdr UINT16BE psa; /* public security attribute */ ti990_ace ace[9]; /* 9 access control entries */ UINT8 fil[2]; /* not used */ -} ti990_fdr; +}; /* ADR record: variant of FDR for Aliases @@ -251,7 +251,7 @@ typedef struct ti990_fdr The fields marked here with *** are in the ADR template to maintain compatability with the FDR template. */ -typedef struct ti990_adr +struct ti990_adr { UINT16BE hkc; /* hask key count */ UINT16BE hkv; /* hask key value */ @@ -266,7 +266,7 @@ typedef struct ti990_adr UINT16BE fill05; /* *** secondary allocation address */ UINT16BE rna; /* record number of next ADR */ UINT16BE raf; /* record # of actual FDR (from 1 through dor.nrc) */ -} ti990_adr; +}; /* CDR record: variant of FDR for Channel @@ -274,7 +274,7 @@ typedef struct ti990_adr The CDR is the permanent record of a channel. It is carried as an alias of the program file in which the channel owner task resides. */ -typedef struct ti990_cdr +struct ti990_cdr { UINT16BE hkc; /* hask key count */ UINT16BE hkv; /* hask key value */ @@ -295,7 +295,7 @@ typedef struct ti990_cdr UINT16BE psa; /* public security attribute */ UINT8 scg[94]; /* "SDT with 9 control groups" (whatever it means - and, no, 94 is not dividable by 9) */ UINT8 fill06[8]; /* reserved */ -} ti990_cdr; +}; /* Based on contents of the flags field, catalog entries may be either an FDR, @@ -305,19 +305,19 @@ typedef struct ti990_cdr field starts at offset 4, and therefore if we try to interpret a KDR as an FDR (or ADR, CDR), we will find fnm[0] and assume the FDR is empty. */ -typedef union directory_entry +union directory_entry { ti990_fdr fdr; ti990_adr adr; ti990_cdr cdr; -} directory_entry; +}; #if 0 /* tifile header: stand-alone file */ -typedef struct tifile_header +struct tifile_header { char tifiles[8]; /* always '\7TIFILES' */ UINT8 secsused_MSB; /* file length in sectors (big-endian) */ @@ -329,59 +329,59 @@ typedef struct tifile_header UINT8 fixrecs_MSB; /* file length in records (big-endian) */ UINT8 fixrecs_LSB; UINT8 res[128-16]; /* reserved */ -} tifile_header; +}; /* catalog entry (used for in-memory catalog) */ -typedef struct catalog_entry +struct catalog_entry { UINT16 fdr_secnum; char filename[10]; -} catalog_entry; +}; #endif /* Disk geometry */ -typedef struct ti990_geometry +struct ti990_geometry { unsigned int cylinders, heads, sectors_per_track, bytes_per_sector; -} ti990_geometry; +}; /* Physical sector address */ -typedef struct ti990_phys_sec_address +struct ti990_phys_sec_address { int cylinder; int head; int sector; -} ti990_phys_sec_address; +}; /* ti99 disk image descriptor */ -typedef struct ti990_image +struct ti990_image { imgtool_stream *file_handle; /* imgtool file handle */ ti990_geometry geometry; /* geometry */ ti990_sc0 sec0; /* cached copy of sector 0 */ -} ti990_image; +}; /* ti990 catalog iterator, used when imgtool reads the catalog */ -typedef struct ti990_iterator +struct ti990_iterator { ti990_image *image; int level; /* current recursion level */ int nrc[MAX_DIR_LEVEL]; /* length of disk catalogs in records */ int index[MAX_DIR_LEVEL]; /* current index in the disk catalog */ directory_entry xdr[MAX_DIR_LEVEL]; /* fdr records */ -} ti990_iterator; +}; static imgtoolerr_t ti990_image_init(imgtool_image *img, imgtool_stream *f); diff --git a/src/mess/tools/imgtool/modules/vzdos.c b/src/mess/tools/imgtool/modules/vzdos.c index 741f068a68b..5c93a3b94d4 100644 --- a/src/mess/tools/imgtool/modules/vzdos.c +++ b/src/mess/tools/imgtool/modules/vzdos.c @@ -40,7 +40,7 @@ as track map, with one bit for each sector used. #define MAX_DIRENTS (15*8) /* vzdos directry entry */ -typedef struct vzdos_dirent +struct vzdos_dirent { char ftype; char delimitor; @@ -49,13 +49,13 @@ typedef struct vzdos_dirent UINT8 start_sector; UINT16 start_address; UINT16 end_address; -} vzdos_dirent; +}; -typedef struct vz_iterator +struct vz_iterator { int index; int eof; -} vz_iterator; +}; static const UINT8 sector_order[] = { diff --git a/src/mess/tools/imgtool/stream.c b/src/mess/tools/imgtool/stream.c index 95c385d3ee8..5b7c22148aa 100644 --- a/src/mess/tools/imgtool/stream.c +++ b/src/mess/tools/imgtool/stream.c @@ -20,7 +20,7 @@ enum imgtype_t IMG_MEM }; -struct _imgtool_stream +struct imgtool_stream { imgtype_t imgtype; int write_protect; @@ -54,7 +54,7 @@ static imgtool_stream *stream_open_zip(const char *zipname, const char *subname, goto error; fclose(f); - imgfile = (imgtool_stream *)malloc(sizeof(struct _imgtool_stream)); + imgfile = (imgtool_stream *)malloc(sizeof(imgtool_stream)); if (!imgfile) goto error; @@ -156,7 +156,7 @@ imgtool_stream *stream_open(const char *fname, int read_or_write) goto error; } - imgfile = (imgtool_stream *)malloc(sizeof(struct _imgtool_stream)); + imgfile = (imgtool_stream *)malloc(sizeof(imgtool_stream)); if (!imgfile) goto error; @@ -186,7 +186,7 @@ imgtool_stream *stream_open_write_stream(int size) { imgtool_stream *imgfile; - imgfile = (imgtool_stream *)malloc(sizeof(struct _imgtool_stream)); + imgfile = (imgtool_stream *)malloc(sizeof(imgtool_stream)); if (!imgfile) return NULL; @@ -211,7 +211,7 @@ imgtool_stream *stream_open_mem(void *buf, size_t sz) { imgtool_stream *imgfile; - imgfile = (imgtool_stream *)malloc(sizeof(struct _imgtool_stream)); + imgfile = (imgtool_stream *)malloc(sizeof(imgtool_stream)); if (!imgfile) return NULL; diff --git a/src/mess/tools/imgtool/stream.h b/src/mess/tools/imgtool/stream.h index b798501cd1b..fedf899a96e 100644 --- a/src/mess/tools/imgtool/stream.h +++ b/src/mess/tools/imgtool/stream.h @@ -12,7 +12,7 @@ #include "imgterrs.h" #include "corefile.h" -typedef struct _imgtool_stream imgtool_stream; +struct imgtool_stream; imgtool_stream *stream_open(const char *fname, int read_or_write); /* similar params to mame_fopen */ imgtool_stream *stream_open_write_stream(int filesize); diff --git a/src/mess/video/733_asr.c b/src/mess/video/733_asr.c index 0771b4ba5b3..73272696c96 100644 --- a/src/mess/video/733_asr.c +++ b/src/mess/video/733_asr.c @@ -658,13 +658,13 @@ static const unsigned char key_translate[3][51] = void asr733_keyboard(device_t *device) { asr_t *asr = get_safe_token(device); - typedef enum + enum modifier_state_t { /* key modifier states */ unshifted = 0, shift, control, /* special value to stop repeat if the modifier state changes */ special_debounce = -1 - } modifier_state_t; + } ; enum { repeat_delay = 5 /* approx. 1/10s */ }; diff --git a/src/mess/video/733_asr.h b/src/mess/video/733_asr.h index 0a349102d80..a48ed344891 100644 --- a/src/mess/video/733_asr.h +++ b/src/mess/video/733_asr.h @@ -9,10 +9,10 @@ enum asr733_chr_region_len = 128*asr733_single_char_len }; -typedef struct asr733_init_params_t +struct asr733_init_params_t { void (*int_callback)(running_machine &machine, int state); -} asr733_init_params_t; +}; GFXDECODE_EXTERN( asr733 ); diff --git a/src/mess/video/911_chr.h b/src/mess/video/911_chr.h index 85da783835f..fe72017cee9 100644 --- a/src/mess/video/911_chr.h +++ b/src/mess/video/911_chr.h @@ -75,11 +75,11 @@ enum /* structure used to describe differences between national character sets and US character set */ /* much more compact than defining the complete 128-char vector */ -typedef struct char_override_t +struct char_override_t { unsigned char char_index; /* char to replace */ unsigned short symbol_index; /* replacement symbol */ -} char_override_t; +}; /* One UK-specific character */ static const char_override_t UK_overrides[1] = diff --git a/src/mess/video/911_vdt.c b/src/mess/video/911_vdt.c index f3681f20e0e..c471b197656 100644 --- a/src/mess/video/911_vdt.c +++ b/src/mess/video/911_vdt.c @@ -79,7 +79,7 @@ static const unsigned short vdt911_palette[] = 2, 1 /* low intensity, reverse */ }; -typedef struct vdt_t +struct vdt_t { vdt911_screen_size_t screen_size; /* char_960 for 960-char, 12-line model; char_1920 for 1920-char, 24-line model */ vdt911_model_t model; /* country code */ @@ -110,7 +110,7 @@ typedef struct vdt_t UINT8 last_key_pressed; int last_modifier_state; char foreign_mode; -} vdt_t; +}; /* Macros for model features @@ -576,7 +576,7 @@ void vdt911_keyboard(device_t *device) { vdt_t *vdt = get_safe_token(device); - typedef enum + enum modifier_state_t { /* states for western keyboards and katakana/arabic keyboards in romaji/latin mode */ lower_case = 0, upper_case, shift, control, @@ -584,7 +584,7 @@ void vdt911_keyboard(device_t *device) foreign, foreign_shift, /* special value to stop repeat if the modifier state changes */ special_debounce = -1 - } modifier_state_t; + }; static unsigned char repeat_timer; enum { repeat_delay = 5 /* approx. 1/10s */ }; diff --git a/src/mess/video/911_vdt.h b/src/mess/video/911_vdt.h index a9ea3e425bb..c9204c77eb7 100644 --- a/src/mess/video/911_vdt.h +++ b/src/mess/video/911_vdt.h @@ -33,12 +33,12 @@ enum vdt911_model_t vdt911_model_FrenchWP /* French word processing */ }; -typedef struct vdt911_init_params_t +struct vdt911_init_params_t { vdt911_screen_size_t screen_size; vdt911_model_t model; void (*int_callback)(running_machine &machine, int state); -} vdt911_init_params_t; +}; PALETTE_INIT( vdt911 ); diff --git a/src/mess/video/epnick.c b/src/mess/video/epnick.c index eec9824b569..d020401c922 100644 --- a/src/mess/video/epnick.c +++ b/src/mess/video/epnick.c @@ -43,7 +43,7 @@ /* Nick executes a Display list, in the form of a list of Line Parameter Tables, this is the form of the data */ -typedef struct LPT_ENTRY +struct LPT_ENTRY { unsigned char SC; /* scanlines in this modeline (two's complement) */ unsigned char MB; /* the MODEBYTE (defines video display mode) */ @@ -54,9 +54,9 @@ typedef struct LPT_ENTRY unsigned char LD2L; /* (a7..a0) of line data pointer LD2 */ unsigned char LD2H; /* (a8..a15) of line data pointer LD2 */ unsigned char COL[8]; /* COL0..COL7 */ -} LPT_ENTRY; +}; -typedef struct _NICK_STATE +struct NICK_STATE { /* horizontal position */ unsigned char HorizontalClockCount; @@ -90,7 +90,7 @@ typedef struct _NICK_STATE unsigned int PenIndexLookup_16Colour[256]; UINT8 *videoram; -} NICK_STATE; +}; /* colour mode types */ #define NICK_2_COLOUR_MODE 0 diff --git a/src/mess/video/gime.h b/src/mess/video/gime.h index abc31d57a95..0e578d22d11 100644 --- a/src/mess/video/gime.h +++ b/src/mess/video/gime.h @@ -141,11 +141,11 @@ private: INTERRUPT_EI0 = 0x01 }; - typedef enum + enum timer_type_t { GIME_TIMER_HBORD, GIME_TIMER_CLOCK - } timer_type_t; + }; // timer constants static const device_timer_id TIMER_GIME_CLOCK = 4; diff --git a/src/mess/video/k1ge.c b/src/mess/video/k1ge.c index 12dd583ea59..fcc3d817130 100644 --- a/src/mess/video/k1ge.c +++ b/src/mess/video/k1ge.c @@ -10,8 +10,7 @@ used in the Neogeo pocket color. #include "emu.h" #include "k1ge.h" -typedef struct k1ge k1ge_t; -struct k1ge +struct k1ge_t { const k1ge_interface *intf; screen_device *screen; diff --git a/src/mess/video/mc6847.h b/src/mess/video/mc6847.h index b8d6527b519..fd6e849f66d 100644 --- a/src/mess/video/mc6847.h +++ b/src/mess/video/mc6847.h @@ -261,13 +261,13 @@ protected: static pixel_t mix_color(double factor, UINT8 c0, UINT8 c1); }; - typedef enum + enum border_color_t { BORDER_COLOR_BLACK, BORDER_COLOR_GREEN, BORDER_COLOR_WHITE, BORDER_COLOR_ORANGE - } border_color_t; + }; // callbacks devcb_resolved_write_line m_res_out_hsync_func; diff --git a/src/mess/video/pc_aga.h b/src/mess/video/pc_aga.h index 24c8856f669..039b90b5007 100644 --- a/src/mess/video/pc_aga.h +++ b/src/mess/video/pc_aga.h @@ -25,7 +25,7 @@ MACHINE_CONFIG_EXTERN( pcvideo_aga ); MACHINE_CONFIG_EXTERN( pcvideo_pc200 ); -typedef enum AGA_MODE { AGA_OFF, AGA_COLOR, AGA_MONO } AGA_MODE; +enum AGA_MODE { AGA_OFF, AGA_COLOR, AGA_MONO }; void pc_aga_set_mode(running_machine &machine, AGA_MODE mode); READ8_HANDLER( pc_aga_videoram_r ); diff --git a/src/osd/osdcore.h b/src/osd/osdcore.h index 25cee8510eb..6c9d3dec4e9 100644 --- a/src/osd/osdcore.h +++ b/src/osd/osdcore.h @@ -72,7 +72,7 @@ extern "C" { #define OPEN_FLAG_NO_PRELOAD 0x0010 /* do not decompress on open */ /* error codes returned by routines below */ -enum _file_error +enum file_error { FILERR_NONE, FILERR_FAILURE, @@ -84,10 +84,9 @@ enum _file_error FILERR_INVALID_DATA, FILERR_INVALID_ACCESS }; -typedef enum _file_error file_error; /* osd_file is an opaque type which represents an open file */ -typedef struct _osd_file osd_file; +struct osd_file; /*----------------------------------------------------------------------------- osd_open: open a new file. @@ -267,17 +266,16 @@ int osd_uchar_from_osdchar(UINT32 /* unicode_char */ *uchar, const char *osdchar ***************************************************************************/ /* types of directory entries that can be returned */ -enum _osd_dir_entry_type +enum osd_dir_entry_type { ENTTYPE_NONE, ENTTYPE_FILE, ENTTYPE_DIR, ENTTYPE_OTHER }; -typedef enum _osd_dir_entry_type osd_dir_entry_type; /* osd_directory is an opaque type which represents an open directory */ -typedef struct _osd_directory osd_directory; +struct osd_directory; /* osd_directory_entry contains basic information about a file when iterating through */ /* a directory */ @@ -428,7 +426,7 @@ void osd_sleep(osd_ticks_t duration); ***************************************************************************/ /* osd_lock is an opaque type which represents a recursive lock/mutex */ -typedef struct _osd_lock osd_lock; +struct osd_lock; /*----------------------------------------------------------------------------- @@ -527,10 +525,10 @@ void osd_lock_free(osd_lock *lock); #define WORK_ITEM_FLAG_AUTO_RELEASE 0x0001 /* osd_work_queue is an opaque type which represents a queue of work items */ -typedef struct _osd_work_queue osd_work_queue; +struct osd_work_queue; /* osd_work_item is an opaque type which represents a single work item */ -typedef struct _osd_work_item osd_work_item; +struct osd_work_item; /* osd_work_callback is a callback function that does work */ typedef void *(*osd_work_callback)(void *param, int threadid); diff --git a/src/osd/osdmini/miniwork.c b/src/osd/osdmini/miniwork.c index 911d145f17b..c788deb8928 100644 --- a/src/osd/osdmini/miniwork.c +++ b/src/osd/osdmini/miniwork.c @@ -47,7 +47,7 @@ // TYPE DEFINITIONS //============================================================ -struct _osd_work_item +struct osd_work_item { void *result; }; diff --git a/src/osd/osdnet.h b/src/osd/osdnet.h index 74c75c3781a..9d661da21cd 100644 --- a/src/osd/osdnet.h +++ b/src/osd/osdnet.h @@ -8,14 +8,14 @@ class netdev; #define CREATE_NETDEV(name) class netdev *name(const char *ifname, class device_network_interface *ifdev, int rate) typedef class netdev *(*create_netdev)(const char *ifname, class device_network_interface *ifdev, int rate); -typedef struct netdev_entry +struct netdev_entry_t { int id; char name[256]; char description[256]; create_netdev func; - struct netdev_entry *m_next; -} netdev_entry_t; + netdev_entry_t *m_next; +}; class netdev { diff --git a/src/osd/sdl/debugwin.c b/src/osd/sdl/debugwin.c index fb99313c38a..ef3193f9cba 100644 --- a/src/osd/sdl/debugwin.c +++ b/src/osd/sdl/debugwin.c @@ -51,12 +51,12 @@ enum { //============================================================ -typedef struct hentry { +struct hentry { struct hentry *h; char *e; -} hentry; +}; -typedef struct _win_i win_i; +struct win_i; struct edit { GtkEntry *edit_w; @@ -67,7 +67,7 @@ struct edit { win_i *cbp; }; -struct _win_i { +struct win_i { int type; win_i * next; GtkWidget * win; diff --git a/src/osd/sdl/draw13.c b/src/osd/sdl/draw13.c index ab41b544391..365a91ec856 100644 --- a/src/osd/sdl/draw13.c +++ b/src/osd/sdl/draw13.c @@ -65,7 +65,7 @@ struct quad_setup_data INT32 rotwidth, rotheight; }; -typedef struct _texture_info texture_info; +struct texture_info; typedef void (*texture_copy_func)(texture_info *texture, const render_texinfo *texsource); @@ -88,7 +88,7 @@ struct copy_info { }; /* texture_info holds information about a texture */ -struct _texture_info +struct texture_info { texture_info * next; // next texture in the list diff --git a/src/osd/sdl/drawogl.c b/src/osd/sdl/drawogl.c index f34f8732959..734c2b0b8ff 100644 --- a/src/osd/sdl/drawogl.c +++ b/src/osd/sdl/drawogl.c @@ -160,14 +160,14 @@ enum // TYPES //============================================================ -typedef struct _texture_info texture_info; +struct texture_info; #if USE_OPENGL typedef void (*texture_copy_func)(texture_info *texture, const render_texinfo *texsource); #endif /* texture_info holds information about a texture */ -struct _texture_info +struct texture_info { #ifdef OLD_CODE texture_info * next; // next texture in the list diff --git a/src/osd/sdl/drawsdl.c b/src/osd/sdl/drawsdl.c index 2bb1a809b43..49e9f85ac75 100644 --- a/src/osd/sdl/drawsdl.c +++ b/src/osd/sdl/drawsdl.c @@ -37,7 +37,7 @@ // TYPES //============================================================ -typedef struct _sdl_scale_mode sdl_scale_mode; +struct sdl_scale_mode; #if (SDLMAME_SDL2) #define DRAW2_SCALEMODE_NEAREST "0" @@ -75,7 +75,7 @@ struct sdl_info int old_blitheight; }; -struct _sdl_scale_mode +struct sdl_scale_mode { const char *name; int is_scale; /* Scale mode? */ diff --git a/src/osd/sdl/dview.h b/src/osd/sdl/dview.h index b785c6590cd..f6e26aa1441 100644 --- a/src/osd/sdl/dview.h +++ b/src/osd/sdl/dview.h @@ -21,17 +21,17 @@ GType dview_get_type(void); #define DVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), DVIEW_TYPE, DViewClass)) -typedef struct _DViewClass DViewClass; -typedef struct _DView DView; +struct DViewClass; +struct DView; -struct _DViewClass +struct DViewClass { GtkContainerClass parent_class; PangoFontDescription *fixedfont; int fixedfont_width, fixedfont_height; }; -struct _DView +struct DView { GtkContainer parent; GtkAdjustment *hadj, *vadj; diff --git a/src/osd/sdl/osd_opengl.h b/src/osd/sdl/osd_opengl.h index c84d0a94139..e51b7e52559 100644 --- a/src/osd/sdl/osd_opengl.h +++ b/src/osd/sdl/osd_opengl.h @@ -54,9 +54,7 @@ #define OSD_GL(ret,func,params) ret (APIENTRY *func) params; #define OSD_GL_UNUSED(ret,func,params) - typedef struct _osd_gl_dispatch osd_gl_dispatch; - - struct _osd_gl_dispatch + struct osd_gl_dispatch { #define GET_GLFUNC 1 #include "osd_opengl.h" diff --git a/src/osd/sdl/sdldir.c b/src/osd/sdl/sdldir.c index b107db36767..988cde22bab 100644 --- a/src/osd/sdl/sdldir.c +++ b/src/osd/sdl/sdldir.c @@ -57,7 +57,7 @@ typedef struct stat64 sdl_stat; #define HAS_DT_XXX defined(SDLMAME_LINUX) || defined(SDLMAME_BSD) || defined(SDLMAME_DARWIN) -struct _osd_directory +struct osd_directory { osd_directory_entry ent; sdl_dirent *data; diff --git a/src/osd/sdl/sdlfile.h b/src/osd/sdl/sdlfile.h index cb048e100e0..16a8eec66ad 100644 --- a/src/osd/sdl/sdlfile.h +++ b/src/osd/sdl/sdlfile.h @@ -26,7 +26,7 @@ enum // TYPE DEFINITIONS //============================================================ -struct _osd_file +struct osd_file { int handle; int type; diff --git a/src/osd/sdl/sdlsync.h b/src/osd/sdl/sdlsync.h index d581418460d..d7b273313ec 100644 --- a/src/osd/sdl/sdlsync.h +++ b/src/osd/sdl/sdlsync.h @@ -18,7 +18,7 @@ /* osd_event is an opaque type which represents a setable/resetable event */ -typedef struct _osd_event osd_event; +struct osd_event; /*----------------------------------------------------------------------------- @@ -107,7 +107,7 @@ void osd_event_free(osd_event *event); ***************************************************************************/ /* osd_thread is an opaque type which represents a thread */ -typedef struct _osd_thread osd_thread; +struct osd_thread; /* osd_thread_callback is a callback function that will be called from the thread */ @@ -191,7 +191,7 @@ void osd_process_kill(void); // Scalable Locks //============================================================ -typedef struct _osd_scalable_lock osd_scalable_lock; +struct osd_scalable_lock; osd_scalable_lock *osd_scalable_lock_alloc(void); diff --git a/src/osd/sdl/sdlsync_ntc.c b/src/osd/sdl/sdlsync_ntc.c index b7d3c2fa994..4afd5cacdf6 100644 --- a/src/osd/sdl/sdlsync_ntc.c +++ b/src/osd/sdl/sdlsync_ntc.c @@ -40,7 +40,7 @@ #include <errno.h> #include <sys/time.h> -struct _osd_lock { +struct osd_lock { volatile pthread_t holder; INT32 count; #ifdef PTR64 @@ -50,7 +50,7 @@ struct _osd_lock { #endif }; -struct _osd_event { +struct osd_event { pthread_mutex_t mutex; pthread_cond_t cond; volatile INT32 autoreset; @@ -67,11 +67,11 @@ struct _osd_event { // TYPE DEFINITIONS //============================================================ -struct _osd_thread { +struct osd_thread { pthread_t thread; }; -struct _osd_scalable_lock +struct osd_scalable_lock { struct { diff --git a/src/osd/sdl/sdlsync_os2.c b/src/osd/sdl/sdlsync_os2.c index 96ce1656a68..de23ea104b2 100644 --- a/src/osd/sdl/sdlsync_os2.c +++ b/src/osd/sdl/sdlsync_os2.c @@ -33,7 +33,7 @@ #define pthread_t int #define pthread_self _gettid -struct _osd_lock { +struct osd_lock { volatile pthread_t holder; INT32 count; #ifdef PTR64 @@ -43,7 +43,7 @@ struct _osd_lock { #endif }; -struct _osd_event { +struct osd_event { HMTX hmtx; HEV hev; volatile INT32 autoreset; @@ -54,13 +54,13 @@ struct _osd_event { // TYPE DEFINITIONS //============================================================ -struct _osd_thread { +struct osd_thread { pthread_t thread; osd_thread_callback callback; void *param; }; -struct _osd_scalable_lock +struct osd_scalable_lock { struct { diff --git a/src/osd/sdl/sdlsync_sdl.c b/src/osd/sdl/sdlsync_sdl.c index 734cbcc67f0..3ee7cc41060 100644 --- a/src/osd/sdl/sdlsync_sdl.c +++ b/src/osd/sdl/sdlsync_sdl.c @@ -34,7 +34,7 @@ struct hidden_mutex_t { volatile INT32 threadid; }; -struct _osd_event { +struct osd_event { SDL_mutex * mutex; SDL_cond * cond; volatile INT32 autoreset; @@ -45,13 +45,13 @@ struct _osd_event { // TYPE DEFINITIONS //============================================================ -struct _osd_thread { +struct osd_thread { SDL_Thread * thread; osd_thread_callback callback; void *param; }; -struct _osd_scalable_lock +struct osd_scalable_lock { SDL_mutex * mutex; }; diff --git a/src/osd/sdl/sdlsync_tc.c b/src/osd/sdl/sdlsync_tc.c index d1ad72e9bde..7d8cb7d5682 100644 --- a/src/osd/sdl/sdlsync_tc.c +++ b/src/osd/sdl/sdlsync_tc.c @@ -38,7 +38,7 @@ struct hidden_mutex_t { pthread_mutex_t id; }; -struct _osd_event { +struct osd_event { pthread_mutex_t mutex; pthread_cond_t cond; volatile INT32 autoreset; @@ -54,11 +54,11 @@ struct _osd_event { // TYPE DEFINITIONS //============================================================ -struct _osd_thread { +struct osd_thread { pthread_t thread; }; -struct _osd_scalable_lock +struct osd_scalable_lock { osd_lock *lock; }; diff --git a/src/osd/sdl/sdlsync_win32.c b/src/osd/sdl/sdlsync_win32.c index 354d4c32b16..91f8c6b97e5 100644 --- a/src/osd/sdl/sdlsync_win32.c +++ b/src/osd/sdl/sdlsync_win32.c @@ -32,12 +32,12 @@ #define USE_SCALABLE_LOCKS (0) -struct _osd_event +struct osd_event { void * ptr; }; -struct _osd_thread { +struct osd_thread { HANDLE handle; osd_thread_callback callback; void *param; @@ -93,7 +93,7 @@ int osd_event_wait(osd_event *event, osd_ticks_t timeout) // Scalable Locks //============================================================ -struct _osd_scalable_lock +struct osd_scalable_lock { #if USE_SCALABLE_LOCKS struct diff --git a/src/osd/sdl/sdlwork.c b/src/osd/sdl/sdlwork.c index df9aae7efbe..fca2a0272c0 100644 --- a/src/osd/sdl/sdlwork.c +++ b/src/osd/sdl/sdlwork.c @@ -88,7 +88,7 @@ struct work_thread_info }; -struct _osd_work_queue +struct osd_work_queue { osd_scalable_lock * lock; // lock for protecting the queue osd_work_item * volatile list; // list of items in the queue @@ -112,7 +112,7 @@ struct _osd_work_queue }; -struct _osd_work_item +struct osd_work_item { osd_work_item * next; // pointer to next item osd_work_queue * queue; // pointer back to the owning queue diff --git a/src/osd/windows/d3dintf.h b/src/osd/windows/d3dintf.h index ae4a84d4b6e..a34a654e03e 100644 --- a/src/osd/windows/d3dintf.h +++ b/src/osd/windows/d3dintf.h @@ -74,12 +74,12 @@ // TYPE DEFINITIONS //============================================================ -typedef struct _d3d d3d; -typedef struct _d3d_device d3d_device; -typedef struct _d3d_surface d3d_surface; -typedef struct _d3d_texture d3d_texture; -typedef struct _d3d_vertex_buffer d3d_vertex_buffer; -typedef struct _d3d_effect d3d_effect; +struct d3d; +struct d3d_device; +struct d3d_surface; +struct d3d_texture; +struct d3d_vertex_buffer; +struct d3d_effect; typedef D3DXVECTOR4 d3d_vector; typedef D3DMATRIX d3d_matrix; @@ -129,7 +129,7 @@ struct d3d_adapter_identifier // Caps enumeration //============================================================ -enum _d3d_caps_index +enum d3d_caps_index { CAPS_PRESENTATION_INTERVALS, CAPS_CAPS2, @@ -146,7 +146,6 @@ enum _d3d_caps_index CAPS_STRETCH_RECT_FILTER, CAPS_MAX_PS30_INSN_SLOTS }; -typedef enum _d3d_caps_index d3d_caps_index; //============================================================ @@ -263,7 +262,7 @@ struct d3d_effect_interface // Core D3D object //============================================================ -struct _d3d +struct d3d { // internal objects int version; diff --git a/src/osd/windows/debugwin.c b/src/osd/windows/debugwin.c index 3605139b045..debb293363b 100644 --- a/src/osd/windows/debugwin.c +++ b/src/osd/windows/debugwin.c @@ -151,11 +151,11 @@ enum // TYPES //============================================================ -typedef struct _debugview_info debugview_info; +struct debugview_info; class debugwin_info; -struct _debugview_info +struct debugview_info { debugwin_info * owner; debug_view * view; diff --git a/src/osd/windows/ledutil.c b/src/osd/windows/ledutil.c index 962b4ab1498..7630bfc15fe 100644 --- a/src/osd/windows/ledutil.c +++ b/src/osd/windows/ledutil.c @@ -131,11 +131,11 @@ typedef int running_machine; // TYPE DEFINITIONS //============================================================ -typedef struct _KEYBOARD_INDICATOR_PARAMETERS +struct KEYBOARD_INDICATOR_PARAMETERS { USHORT UnitId; // Unit identifier. USHORT LedFlags; // LED indicator state. -} KEYBOARD_INDICATOR_PARAMETERS, *PKEYBOARD_INDICATOR_PARAMETERS; +}; struct id_map_entry diff --git a/src/osd/windows/vconv.c b/src/osd/windows/vconv.c index 1719309c974..3cb677f57c4 100644 --- a/src/osd/windows/vconv.c +++ b/src/osd/windows/vconv.c @@ -65,13 +65,12 @@ // TYPE DEFINITIONS //============================================================ -typedef struct _translation_info translation_info; -struct _translation_info +typedef struct { DWORD vc_version; const char *gcc_option; const char *vc_option; -}; +} translation_info; diff --git a/src/osd/windows/windir.c b/src/osd/windows/windir.c index bb58676f339..6b41a63f04a 100644 --- a/src/osd/windows/windir.c +++ b/src/osd/windows/windir.c @@ -61,7 +61,7 @@ // TYPE DEFINITIONS //============================================================ -struct _osd_directory +struct osd_directory { HANDLE find; // handle to the finder int is_first; // TRUE if this is the first entry diff --git a/src/osd/windows/window.c b/src/osd/windows/window.c index 405bf57b79e..b4d8114815a 100644 --- a/src/osd/windows/window.c +++ b/src/osd/windows/window.c @@ -173,13 +173,13 @@ static void set_fullscreen(win_window_info *window, int fullscreen); // temporary hacks #if LOG_THREADS -struct _mtlog +struct mtlog { osd_ticks_t timestamp; const char *event; }; -static struct _mtlog mtlog[100000]; +static mtlog mtlog[100000]; static volatile LONG mtlogindex; void mtlog_add(const char *event) diff --git a/src/osd/windows/winfile.h b/src/osd/windows/winfile.h index b71d9434490..cae70873982 100644 --- a/src/osd/windows/winfile.h +++ b/src/osd/windows/winfile.h @@ -23,7 +23,7 @@ enum // TYPE DEFINITIONS //============================================================ -struct _osd_file +struct osd_file { HANDLE handle; SOCKET socket; diff --git a/src/osd/windows/winsync.c b/src/osd/windows/winsync.c index 829b5f42edc..6876dd11de3 100644 --- a/src/osd/windows/winsync.c +++ b/src/osd/windows/winsync.c @@ -63,7 +63,7 @@ typedef BOOL (WINAPI *try_enter_critical_section_ptr)(LPCRITICAL_SECTION lpCriticalSection); -struct _osd_lock +struct osd_lock { CRITICAL_SECTION critsect; }; diff --git a/src/osd/windows/winwork.c b/src/osd/windows/winwork.c index 5871ccbafdb..5bfa1ebd2ae 100644 --- a/src/osd/windows/winwork.c +++ b/src/osd/windows/winwork.c @@ -138,7 +138,7 @@ struct work_thread_info }; -struct _osd_work_queue +struct osd_work_queue { scalable_lock lock; // lock for protecting the queue osd_work_item * volatile list; // list of items in the queue @@ -162,7 +162,7 @@ struct _osd_work_queue }; -struct _osd_work_item +struct osd_work_item { osd_work_item * next; // pointer to next item osd_work_queue * queue; // pointer back to the owning queue diff --git a/src/tools/jedutil.c b/src/tools/jedutil.c index da94583d6db..64cabca43cc 100644 --- a/src/tools/jedutil.c +++ b/src/tools/jedutil.c @@ -144,11 +144,11 @@ struct pin_fuse_columns }; -typedef struct _pal_data pal_data; +struct pal_data; typedef void (*print_product_terms_func)(const pal_data* pal, const jed_data* jed); -struct _pal_data +struct pal_data { const char *name; const pin_fuse_rows *pinfuserows; diff --git a/src/tools/romcmp.c b/src/tools/romcmp.c index a164a163fc4..eef3a65c5dc 100644 --- a/src/tools/romcmp.c +++ b/src/tools/romcmp.c @@ -103,14 +103,13 @@ static void compatiblemodes(int mode,int *start,int *end) } } -struct _fileinfo +struct fileinfo { char name[MAX_FILENAME_LEN+1]; int size; unsigned char *buf; /* file is read in here */ int listed; }; -typedef struct _fileinfo fileinfo; static fileinfo files[2][MAX_FILES]; static float matchscore[MAX_FILES][MAX_FILES][TOTAL_MODES][TOTAL_MODES]; diff --git a/src/tools/unidasm.c b/src/tools/unidasm.c index 946e84a27fc..df9ec912e8f 100644 --- a/src/tools/unidasm.c +++ b/src/tools/unidasm.c @@ -40,7 +40,7 @@ #include "emu.h" #include <ctype.h> -enum _display_type +enum display_type { _8bit, _8bitx, @@ -59,7 +59,6 @@ enum _display_type _64be, _64le }; -typedef enum _display_type display_type; struct dasm_table_entry |