diff options
author | 2012-09-16 05:24:30 +0000 | |
---|---|---|
committer | 2012-09-16 05:24:30 +0000 | |
commit | 1a301849034da9956b893453acce8e0f9168e150 (patch) | |
tree | a39f7a6c6b4c54b7993e58cd22ea6b6bd25f37cf /src/mess | |
parent | 91f928d6cd774c9526c7fde7e0860aded24d08a5 (diff) |
Final round of struct/union/enum normalization.
Diffstat (limited to 'src/mess')
60 files changed, 359 insertions, 363 deletions
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 ); |