Previous 199869 Revisions Next

r17918 Sunday 16th September, 2012 at 05:24:30 UTC by Aaron Giles
Final round of struct/union/enum normalization.
[src/emu]emupal.c hashfile.c sound.h uimenu.h video.h
[src/emu/cpu]vtlb.c vtlb.h x86log.c x86log.h
[src/emu/cpu/alph8201]alph8201.c
[src/emu/cpu/am29000]am29000.c am29ops.h
[src/emu/cpu/apexc]apexcdsm.c
[src/emu/cpu/cop400]cop400.c cop400.h
[src/emu/cpu/dsp56k]dsp56ops.c
[src/emu/cpu/e132xs]e132xs.c
[src/emu/cpu/f8]f8.c
[src/emu/cpu/hcd62121]hcd62121.c
[src/emu/cpu/i86]i86.c
[src/emu/cpu/i860]i860.h
[src/emu/cpu/lr35902]lr35902d.c
[src/emu/cpu/m6502]m4510.c m6502.c m6509.c m65ce02.c
[src/emu/cpu/m68000]m68kcpu.h
[src/emu/cpu/minx]minxd.c
[src/emu/cpu/mips]mips3com.h mips3drc.c
[src/emu/cpu/mn10200]mn10200.c
[src/emu/cpu/pic16c5x]16c5xdsm.c
[src/emu/cpu/pic16c62x]16c62xdsm.c
[src/emu/cpu/powerpc]ppccom.h ppcdrc.c
[src/emu/cpu/psx]psx.h
[src/emu/cpu/rsp]rsp.h rspdrc.c
[src/emu/cpu/saturn]saturnds.c
[src/emu/cpu/se3208]se3208dis.c
[src/emu/cpu/sharc]sharc.c
[src/emu/cpu/sm8500]sm8500d.c
[src/emu/cpu/tlcs90]tlcs90.c tlcs90.h
[src/emu/cpu/tms32010]32010dsm.c tms32010.c
[src/emu/cpu/tms32025]32025dsm.c tms32025.c
[src/emu/cpu/tms34010]tms34010.c
[src/emu/cpu/tms7000]tms7000.c
[src/emu/cpu/tms9900]9900dasm.c 99xxcore.h tms9900.h tms9900l.h tms9995.h
[src/emu/cpu/unsp]unsp.h
[src/emu/cpu/z180]z180dasm.c
[src/emu/cpu/z80]z80dasm.c
[src/emu/cpu/z8000]z8000.c z8000cpu.h
[src/emu/debug]textbuf.c textbuf.h
[src/emu/imagedev]cassette.h
[src/emu/machine]74181.c pic8259.c scsicb.h tms9901.h tms9902.h
[src/emu/sound]aica.c aicadsp.c aicadsp.h aicalfo.c disc_wav.h discrete.h k007232.c multipcm.c nes_defs.h scsp.c scspdsp.c scspdsp.h scsplfo.c sid.c sid.h sid6581.c sidvoice.h sn76496.h tms5220.h wavwrite.c wavwrite.h ymdeltat.h ymf278b.c
[src/emu/video]huc6270.h poly.c poly.h vooddefs.h
[src/lib/formats]cassimg.c cassimg.h flopimg.c flopimg.h
[src/lib/util]aviio.c aviio.h cdrom.c cdrom.h corefile.c corefile.h opresolv.c opresolv.h palette.c palette.h png.h pool.c pool.h un7z.h unzip.h
[src/mame/audio]exidy440.c micro3d.c snes_snd.c snk6502.c tx1.c
[src/mame/drivers]atarisy4.c bfcobra.c cobra.c
[src/mame/includes]atari.h irobot.h micro3d.h model2.h model3.h n64.h seta.h vectrex.h vertigo.h
[src/mame/machine]decocass.c gaelco3d.c pckeybrd.c snes7110.c snesbsx.c snesobc1.c snesrtc.c snessdd1.c steppers.c tait8741.c
[src/mame/video]atarirle.c atarirle.h bfm_dm01.c dc.c mcd212.h midzeus2.c model2.c model3.c n64.h vrender0.c ygv608.c ygv608.h
[src/mess/audio]spchroms.h wswan.c
[src/mess/drivers]vboy.c
[src/mess/includes]coco.h enterp.h kaypro.h lisa.h odyssey2.h pdp1.h rmnimbus.h tx0.h
[src/mess/machine]990_hd.c 990_tap.c amigacd.c cococart.h corvushd.c i8271.h kay_kbd.c mac.c nes_unif.c rmnimbus.c smartmed.c smc92x4.h strata.c thomflop.c upd7002.c upd7002.h upd765.h
[src/mess/machine/ti99]datamux.h evpc.h genboard.h grom.h gromport.h joyport.h mapper8.h peribox.h speech8.h ti99_hd.h videowrp.h
[src/mess/tools/imgtool]filter.h imgtool.c library.c library.h stream.c stream.h
[src/mess/tools/imgtool/modules]concept.c mac.c ti99.c ti990hd.c vzdos.c
[src/mess/video]733_asr.c 733_asr.h 911_chr.h 911_vdt.c 911_vdt.h epnick.c gime.h k1ge.c mc6847.h pc_aga.h
[src/osd]osdcore.h osdnet.h
[src/osd/osdmini]miniwork.c
[src/osd/sdl]debugwin.c draw13.c drawogl.c drawsdl.c dview.h osd_opengl.h sdldir.c sdlfile.h sdlsync.h sdlsync_ntc.c sdlsync_os2.c sdlsync_sdl.c sdlsync_tc.c sdlsync_win32.c sdlwork.c
[src/osd/windows]d3dintf.h debugwin.c ledutil.c vconv.c windir.c window.c winfile.h winsync.c winwork.c
[src/tools]jedutil.c romcmp.c unidasm.c

trunk/src/mame/audio/micro3d.c
r17917r17918
2020 *
2121 *************************************/
2222
23typedef struct _biquad_
23struct biquad
2424{
2525   double a0, a1, a2;      /* Numerator coefficients */
2626   double b0, b1, b2;      /* Denominator coefficients */
27} biquad;
27};
2828
29typedef struct _filter_
29struct lp_filter
3030{
3131   float *history;
3232   float *coef;
3333   double fs;
3434   biquad ProtoCoef[2];
35} lp_filter;
35};
3636
3737struct filter_state
3838{
r17917r17918
4040   double      exponent;
4141};
4242
43typedef struct _noise_state
43struct noise_state
4444{
4545   union
4646   {
r17917r17918
6262   filter_state      noise_filters[4];
6363   lp_filter         filter;
6464   sound_stream      *stream;
65} noise_state;
65};
6666
6767
6868/*************************************
trunk/src/mame/audio/snk6502.c
r17917r17918
2929#define FRAC_ONE   (1 << FRAC_BITS)
3030#define FRAC_MASK   (FRAC_ONE - 1)
3131
32typedef struct tone
32struct TONE
3333{
3434   int   mute;
3535   int   offset;
r17917r17918
3939   INT32   sample_step;
4040   INT32   sample_cur;
4141   INT16   form[16];
42} TONE;
42};
4343
4444struct snk6502_sound_state
4545{
trunk/src/mame/audio/exidy440.c
r17917r17918
3838
3939
4040/* channel_data structure holds info about each 6844 DMA channel */
41typedef struct m6844_channel_data
41struct m6844_channel_data
4242{
4343   int active;
4444   int address;
r17917r17918
4646   UINT8 control;
4747   int start_address;
4848   int start_counter;
49} m6844_channel_data;
49};
5050
5151
5252/* channel_data structure holds info about each active sound channel */
53typedef struct sound_channel_data
53struct sound_channel_data
5454{
5555   INT16 *base;
5656   int offset;
5757   int remaining;
58} sound_channel_data;
58};
5959
6060
6161/* sound_cache_entry structure contains info on each decoded sample */
62typedef struct sound_cache_entry
62struct sound_cache_entry
6363{
6464   struct sound_cache_entry *next;
6565   int address;
r17917r17918
6767   int bits;
6868   int frequency;
6969   INT16 data[1];
70} sound_cache_entry;
70};
7171
7272
7373
trunk/src/mame/audio/tx1.c
r17917r17918
1616 *  8253 Programmable Interval Timer
1717 *
1818 *************************************/
19struct _pit8253_state
19struct pit8253_state
2020{
2121   union
2222   {
r17917r17918
3939   UINT32 m_step1;
4040   UINT32 m_step2;
4141
42   struct _pit8253_state m_pit8253;
42   pit8253_state m_pit8253;
4343
4444   UINT8 m_ay_outputa;
4545   UINT8 m_ay_outputb;
trunk/src/mame/audio/snes_snd.c
r17917r17918
157157 TYPE DEFINITIONS
158158***************************************************************************/
159159
160typedef enum                        /* ADSR state type              */
160enum env_state_t32                        /* ADSR state type              */
161161{
162162   ATTACK,
163163   DECAY,
164164   SUSTAIN,
165165   RELEASE
166} env_state_t32;
166};
167167
168168ALLOW_SAVE_TYPE(env_state_t32);
169169
170typedef struct                      /* Voice state type             */
170struct voice_state_type                      /* Voice state type             */
171171{
172172   UINT16          mem_ptr;        /* Sample data memory pointer   */
173173   int             end;            /* End or loop after block      */
r17917r17918
186186   INT32           smp1;           /* Last sample (for BRR filter) */
187187   INT32           smp2;           /* Second-to-last sample decoded*/
188188   short           sampbuf[4];   /* Buffer for Gaussian interp   */
189} voice_state_type;
189};
190190
191typedef struct                      /* Source directory entry       */
191struct src_dir_type                      /* Source directory entry       */
192192{
193193   UINT16  vptr;           /* Ptr to start of sample data  */
194194   UINT16  lptr;           /* Loop pointer in sample data  */
195} src_dir_type;
195};
196196
197197
198198struct snes_sound_state
trunk/src/mame/machine/snes7110.c
r17917r17918
118118   { 31, 31 },
119119};
120120
121typedef struct
121struct SPC7110Decomp
122122{
123123   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
124124
r17917r17918
142142   UINT32 morton32[4][256];
143143
144144   UINT32 rom_size;
145} SPC7110Decomp;
145};
146146
147147static SPC7110Decomp* SPC7110Decomp_ctor(running_machine &machine, UINT32 size);
148148static void SPC7110Decomp_reset(SPC7110Decomp *thisptr);
r17917r17918
788788
789789static const UINT32 spc7110_months[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
790790
791struct _snes_spc7110_t
791struct snes_spc7110_t
792792{
793793   //==================
794794   //decompression unit
r17917r17918
873873   UINT32 size;
874874};
875875
876static _snes_spc7110_t snes_spc7110;
876static snes_spc7110_t snes_spc7110;
877877
878878static void spc7110_init(running_machine& machine)
879879{
trunk/src/mame/machine/snesbsx.c
r17917r17918
2121};
2222
2323
24struct _snes_bsx_state
24struct snes_bsx_state
2525{
2626   // base regs
2727   // we don't emulate the base unit yet
r17917r17918
4242   int ram_source;
4343};
4444
45static struct _snes_bsx_state bsx_state;
45static snes_bsx_state bsx_state;
4646
4747
4848static void bsx_update_memory_map(void)
trunk/src/mame/machine/pckeybrd.c
r17917r17918
167167
168168#define AT_KEYBOARD_QUEUE_MAXSIZE   256
169169
170typedef struct at_keyboard
170struct at_keyboard
171171{
172172   AT_KEYBOARD_TYPE type;
173173   int on;
r17917r17918
184184   int last_code;
185185
186186   ioport_port *ports[8];
187} at_keyboard;
187};
188188
189189static at_keyboard keyboard;
190190
191typedef struct extended_keyboard_code
191struct extended_keyboard_code
192192{
193193   const char *pressed;
194194   const char *released;
195} extended_keyboard_code;
195};
196196
197197
198198static const extended_keyboard_code keyboard_mf2_code[0x10][2/*numlock off, on*/]={
trunk/src/mame/machine/gaelco3d.c
r17917r17918
9191   buf_t            buf[2];
9292};
9393
94typedef struct _osd_shared_mem osd_shared_mem;
94struct osd_shared_mem;
9595
9696struct gaelco_serial_state
9797{
r17917r17918
110110   shmem_t *m_shmem;
111111};
112112
113struct _osd_shared_mem
113struct osd_shared_mem
114114{
115115   char *fn;
116116   size_t size;
trunk/src/mame/machine/snessdd1.c
r17917r17918
533533   SDD1_OL_launch(thisptr->OL);
534534}
535535
536typedef struct
536struct snes_sdd1_t
537537{
538538   UINT8 sdd1_enable;   // channel bit-mask
539539   UINT8 xfer_enable;   // channel bit-mask
r17917r17918
553553      UINT32 size;   // length of data buffer; reads decrement counter, set ready to false at 0
554554      UINT8 ready;   // 1 when data[] is valid; 0 to invoke sdd1emu.decompress()
555555   } buffer;
556} _snes_sdd1_t;
556} ;
557557
558static _snes_sdd1_t snes_sdd1;
558static snes_sdd1_t snes_sdd1;
559559
560560static void sdd1_init(running_machine& machine)
561561{
trunk/src/mame/machine/snesobc1.c
r17917r17918
1212
1313***************************************************************************/
1414
15struct _snes_obc1_state
15struct snes_obc1_state
1616{
1717   int address;
1818   int offset;
1919   int shift;
2020};
2121
22static struct _snes_obc1_state obc1_state;
22static snes_obc1_state obc1_state;
2323
2424
2525static READ8_HANDLER( obc1_read )
trunk/src/mame/machine/decocass.c
r17917r17918
18311831***************************************************************************/
18321832
18331833/* regions within the virtual tape */
1834enum _tape_region
1834enum tape_region
18351835{
18361836   REGION_LEADER,            /* in clear leader section */
18371837   REGION_LEADER_GAP,         /* in gap between leader and BOT */
r17917r17918
18441844   REGION_TRAILER_GAP,         /* in gap between trailer and EOT */
18451845   REGION_TRAILER            /* in clear trailer section */
18461846};
1847typedef enum _tape_region tape_region;
18481847
18491848
18501849/* bytes within a data block on a virtual tape */
1851enum _tape_byte
1850enum tape_byte
18521851{
18531852   BYTE_PRE_GAP_0,            /* 34 bytes of gap, clock held to 0, no data */
18541853   BYTE_PRE_GAP_33 = BYTE_PRE_GAP_0 + 33,
r17917r17918
18651864   BYTE_POSTGAP_33 = BYTE_POSTGAP_0 + 33,
18661865   BYTE_BLOCK_TOTAL         /* total number of bytes in block */
18671866};
1868typedef enum _tape_byte tape_byte;
18691867
18701868
18711869/* state of the tape */
trunk/src/mame/machine/snesrtc.c
r17917r17918
2222   RTCM_Write
2323};
2424
25struct _snes_rtc_state
25struct snes_rtc_state
2626{
2727   UINT8  ram[13];
2828   INT32  mode;
2929   INT8   index;
3030};
3131
32static _snes_rtc_state rtc_state;
32static snes_rtc_state rtc_state;
3333
3434static const UINT8 srtc_months[12] =
3535{
trunk/src/mame/machine/tait8741.c
r17917r17918
3131#define CMD_08 1
3232#define CMD_4a 2
3333
34typedef struct TAITO8741_status{
34struct I8741 {
3535   UINT8 toData;    /* to host data      */
3636   UINT8 fromData;  /* from host data    */
3737   UINT8 fromCmd;   /* from host command */
r17917r17918
4848   int coins;
4949   read8_space_func portHandler;
5050   const  char *portName;
51}I8741;
51};
5252
5353static const struct TAITO8741interface *intf;
5454//static I8741 *taito8741;
r17917r17918
380380
381381static int josvolly_nmi_enable;
382382
383typedef struct josvolly_8741_struct {
383struct JV8741 {
384384   UINT8 cmd;
385385   UINT8 sts;
386386   UINT8 txd;
r17917r17918
391391   UINT8 rst;
392392
393393   const char *initReadPort;
394}JV8741;
394};
395395
396396static JV8741 i8741[4];
397397
trunk/src/mame/machine/steppers.c
r17917r17918
4747
4848/* local vars */
4949
50typedef struct _stepper
50struct stepper
5151{
5252   const stepper_interface *intf;
5353   UINT8    pattern,   /* coil pattern */
r17917r17918
6464         index_patt;   /* pattern needed on coils (0=don't care) */
6565
6666   UINT8 optic;
67} stepper;
67};
6868
6969static stepper step[MAX_STEPPERS];
7070
trunk/src/mame/includes/vertigo.h
r17917r17918
1212
1313#define MC_LENGTH 512
1414
15typedef struct _am2901
15struct am2901
1616{
1717   UINT32 ram[16];     /* internal ram */
1818   UINT32 d;        /* direct data D input */
1919   UINT32 q;        /* Q register */
2020   UINT32 f;        /* F ALU result */
2121   UINT32 y;        /* Y output */
22} am2901;
22};
2323
2424class vector_generator
2525{
r17917r17918
5050   running_machine *m_machine;
5151};
5252
53typedef struct _microcode
53struct microcode
5454{
5555   UINT32 x;
5656   UINT32 a;
r17917r17918
6868   UINT32 jmp;
6969   UINT32 jcon;
7070   UINT32 ma;
71} microcode;
71};
7272
73typedef struct _vproc
73struct vproc
7474{
7575   UINT16 sram[64]; /* external sram */
7676   UINT16 ramlatch; /* latch between 2901 and sram */
r17917r17918
7878   UINT32 pc;       /* program counter */
7979   UINT32 ret;       /* return address */
8080
81} vproc;
81};
8282
8383
8484class vertigo_state : public driver_device
trunk/src/mame/includes/model2.h
r17917r17918
11#include "video/poly.h"
22
33
4typedef struct _raster_state raster_state;
5typedef struct _geo_state geo_state;
4struct raster_state;
5struct geo_state;
66
77
88class model2_state : public driver_device
trunk/src/mame/includes/model3.h
r17917r17918
1010   float x,y,z,d;
1111};
1212
13typedef struct _cached_texture cached_texture;
13struct cached_texture;
1414
1515class model3_state : public driver_device
1616{
trunk/src/mame/includes/seta.h
r17917r17918
66
77#define   __uPD71054_TIMER   1
88
9typedef struct _uPD71054_state uPD71054_state;
10struct _uPD71054_state
9struct uPD71054_state
1110{
1211   emu_timer *timer[3];         // Timer
1312   UINT16   max[3];            // Max counter
trunk/src/mame/includes/micro3d.h
r17917r17918
116116   virtual void video_reset();
117117};
118118
119typedef struct _micro3d_vtx_
119struct micro3d_vtx
120120{
121121   INT32 x, y, z;
122} micro3d_vtx;
122};
123123
124124
125125/*----------- defined in machine/micro3d.c -----------*/
trunk/src/mame/includes/atari.h
r17917r17918
169169#define COPY8(dst,s1,s2) *dst++ = s1; *dst++ = s2
170170#define COPY16(dst,s1,s2,s3,s4) *dst++ = s1; *dst++ = s2; *dst++ = s3; *dst++ = s4
171171
172typedef struct {
172struct ANTIC_R {
173173   UINT8   antic00;   /* 00 nothing */
174174   UINT8   antic01;   /* 01 nothing */
175175   UINT8   antic02;   /* 02 nothing */
r17917r17918
186186   UINT8   penv;      /* 0d light pen vertical pos */
187187   UINT8   antic0e;   /* 0e nothing */
188188   UINT8   nmist;      /* 0f NMI status */
189}   ANTIC_R;  /* read registers */
189};  /* read registers */
190190
191typedef struct {
191struct ANTIC_W {
192192   UINT8   dmactl;    /* 00 write DMA control */
193193   UINT8   chactl;    /* 01 write character control */
194194   UINT8   dlistl;    /* 02 display list low */
r17917r17918
205205   UINT8   antic0d;   /* 0d nothing */
206206   UINT8   nmien;      /* 0e NMI enable */
207207   UINT8   nmires;    /* 0f NMI reset */
208}   ANTIC_W;  /* write registers */
208};  /* write registers */
209209
210210/* per scanline buffer for video data (and optimization variables) */
211211struct VIDEO {
trunk/src/mame/includes/irobot.h
r17917r17918
66
77#define IR_TIMING            1      /* try to emulate MB and VG running time */
88
9typedef struct irmb_ops
9struct irmb_ops
1010{
1111   const struct irmb_ops *nxtop;
1212   UINT32 func;
r17917r17918
1818   UINT8 diren;
1919   UINT8 flags;
2020   UINT8 ramsel;
21} irmb_ops;
21};
2222
2323
2424class irobot_state : public driver_device
trunk/src/mame/includes/vectrex.h
r17917r17918
1111
1212#define NVECT 10000
1313
14typedef struct _vectrex_point
14struct vectrex_point
1515{
1616   int x; int y;
1717   rgb_t col;
1818   int intensity;
19} vectrex_point;
19};
2020
2121class vectrex_state : public driver_device
2222{
trunk/src/mame/includes/n64.h
r17917r17918
4242class n64_periphs : public device_t
4343{
4444private:
45   typedef struct
45   struct AUDIO_DMA
4646   {
4747      UINT32 address;
4848      UINT32 length;
49   } AUDIO_DMA;
49   };
5050
5151public:
5252    // construction/destruction
trunk/src/mame/video/mcd212.h
r17917r17918
6060    UINT8 weight_factor_b[768];
6161};
6262
63typedef struct
63struct mcd212_regs_t
6464{
6565   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
6666
r17917r17918
7171
7272    running_machine *m_machine;
7373    bitmap_rgb32 m_bitmap;
74} mcd212_regs_t;
74};
7575
7676#define MCD212_CURCNT_COLOR         0x00000f    // Cursor color
7777#define MCD212_CURCNT_CUW           0x008000    // Cursor width
trunk/src/mame/video/ygv608.c
r17917r17918
555555  // - regardless of the visible display dimensions
556556  rectangle spriteClip(0, 512, 0, 512);
557557
558  PSPRITE_ATTR sa;
558  SPRITE_ATTR *sa;
559559  int flipx = 0, flipy = 0;
560560  int i;
561561
trunk/src/mame/video/ygv608.h
r17917r17918
126126};
127127
128128
129typedef struct _ygv_ports {
129struct YGV_PORTS {
130130   UINT8 na;         // P#0 - pattern name table data port (read/write)
131131   UINT8 p1;         // P#1 - sprite data port (read/write)
132132   UINT8 p2;         // P#2 - scroll data port (read/write)
r17917r17918
135135   UINT8 p5;         // P#5 - register select port (write only)
136136   UINT8 p6;         // P#6 - status port (read/write)
137137   UINT8 p7;         // P#7 - system control port (read/write)
138} YGV_PORTS, *pYGV_PORTS;
138};
139139
140typedef struct _ygv_regs {
140struct YGV_REGS {
141141   UINT8 r0;         // R#0 - pattern name table access ptr (r/w)
142142   UINT8 r1;         // R#1 - pattern name table access ptr (r/w)
143143   UINT8 r2;         // R#2 - built in ram access control
r17917r17918
205205   UINT8 tb13;
206206   UINT8 tn4;
207207
208} YGV_REGS, *pYGV_REGS;
208};
209209
210210#define YGV608_MAX_SPRITES (YGV608_SPRITE_ATTR_TABLE_SIZE>>2)
211211
r17917r17918
272272#define VDW_SHIFT         0
273273#define VDW_MASK          0x3f
274274
275typedef struct {
275struct SPRITE_ATTR {
276276   UINT8 sy;      // y dot position 7:0
277277   UINT8 sx;      // x dot position 7:0
278278   UINT8 attr;      // 0xf0 = color, 0x0c = size, reverse, 0x02 = x hi bit, 0x01 = y hi bit
279279   UINT8 sn;    // pattern name (0-255)
280} SPRITE_ATTR, *PSPRITE_ATTR;
280};
281281
282282
283typedef struct _ygv608 {
283struct YGV608 {
284284
285285  union {
286286    UINT8      b[8];
r17917r17918
326326  UINT8 screen_resize;  // screen requires resize
327327  UINT8 tilemap_resize; // tilemap requires resize
328328
329} YGV608, *pYGV608;
329};
330330
331331
332332void ygv608_set_gfxbank(UINT8 gfxbank);
trunk/src/mame/video/model2.c
r17917r17918
129129   INT16            center[2];
130130};
131131
132struct _quad_m2
132struct quad_m2
133133{
134134   poly_vertex         v[4];
135135   UINT16            z;
r17917r17918
297297
298298#define MAX_TRIANGLES      32768
299299
300struct _raster_state
300struct raster_state
301301{
302302   UINT32            mode;            /* bit 0 = Test Mode, bit 2 = Switch 60Hz(1)/30Hz(0) operation */
303303   UINT16 *         texture_rom;      /* Texture ROM pointer */
r17917r17918
356356
357357static void model2_3d_process_quad( raster_state *raster, UINT32 attr )
358358{
359   _quad_m2   object;
359   quad_m2      object;
360360   UINT16      *th, *tp;
361361   INT32      tho;
362362   UINT32      cull, i;
r17917r17918
12821282 *
12831283 *******************************************/
12841284
1285struct _geo_state
1285struct geo_state
12861286{
12871287   raster_state *         raster;
12881288   UINT32            mode;               /* bit 0 = Enable Specular, bit 1 = Calculate Normals */
trunk/src/mame/video/dc.c
r17917r17918
136136static bitmap_rgb32 *fake_accumulationbuffer_bitmap;
137137static void render_to_accumulation_buffer(running_machine &machine,bitmap_rgb32 &bitmap,const rectangle &cliprect);
138138
139typedef struct texinfo {
139struct texinfo {
140140   UINT32 address, vqbase;
141141   int textured, sizex, sizey, stride, sizes, pf, palette, mode, mipmapped, blend_mode, filter_mode, flip_u, flip_v;
142142
143143   UINT32 (*r)(running_machine &machine, struct texinfo *t, float x, float y);
144144   UINT32 (*blend)(UINT32 s, UINT32 d);
145145   int palbase, cd;
146} texinfo;
146};
147147
148148typedef   struct
149149{
trunk/src/mame/video/midzeus2.c
r17917r17918
7777static float zbase;
7878
7979#if TRACK_REG_USAGE
80typedef struct reg_info
80struct reg_info
8181{
8282   struct reg_info *next;
8383   UINT32 value;
84} reg_info;
84};
8585
8686static reg_info *regdata[0x80];
8787static int regdata_count[0x80];
trunk/src/mame/video/model3.c
r17917r17918
2323   UINT32 color;
2424};
2525
26struct _cached_texture
26struct cached_texture
2727{
2828   cached_texture *next;
2929   UINT8      width;
trunk/src/mame/video/atarirle.c
r17917r17918
2727***************************************************************************/
2828
2929/* internal structure containing a word index, shift and mask */
30typedef struct atarirle_mask atarirle_mask;
3130struct atarirle_mask
3231{
3332   int            word;            /* word index */
r17917r17918
3635};
3736
3837/* internal structure for sorting the motion objects */
39typedef struct mo_sort_entry mo_sort_entry;
4038struct mo_sort_entry
4139{
4240   mo_sort_entry *   next;
r17917r17918
4442};
4543
4644/* internal structure describing each object in the ROMs */
47typedef struct atarirle_info atarirle_info;
4845struct atarirle_info
4946{
5047   INT16         width;
r17917r17918
5754};
5855
5956/* internal structure containing the state of the motion objects */
60typedef struct atarirle_data atarirle_data;
6157struct atarirle_data
6258{
6359   int            bitmapwidth;      /* width of the full playfield bitmap */
trunk/src/mame/video/atarirle.h
r17917r17918
3535***************************************************************************/
3636
3737/* description for an eight-word mask */
38typedef struct atarirle_entry atarirle_entry;
3938struct atarirle_entry
4039{
4140   UINT16         data[8];
4241};
4342
4443/* description of the motion objects */
45typedef struct atarirle_desc atarirle_desc;
4644struct atarirle_desc
4745{
4846   const char *   region;            /* region where the GFX data lives */
trunk/src/mame/video/vrender0.c
r17917r17918
2020
2121**************/
2222
23struct _Quad
23struct QuadInfo
2424{
2525   UINT16 *Dest;
2626   UINT32 Pitch;   //in UINT16s
r17917r17918
5050   UINT32 DstColor;
5151};
5252
53struct _RenderState
53struct RenderStateInfo
5454{
5555   UINT32 Tx;
5656   UINT32 Ty;
r17917r17918
8181   UINT16 InternalPalette[256];
8282   UINT32 LastPalUpdate;
8383
84   _RenderState RenderState;
84   RenderStateInfo RenderState;
8585};
8686
8787
r17917r17918
135135   return RGB16(scr, scg, scb);
136136}
137137
138static UINT16 Alpha(_Quad *Quad, UINT16 Src, UINT16 Dst)
138static UINT16 Alpha(QuadInfo *Quad, UINT16 Src, UINT16 Dst)
139139{
140140   UINT32 scr = (EXTRACTR8(Src) * ((Quad->Shade >> 16) & 0xff)) >> 8;
141141   UINT32 scg = (EXTRACTG8(Src) * ((Quad->Shade >>  8) & 0xff)) >> 8;
r17917r17918
238238}
239239
240240#define TILENAME(bpp, t, a) \
241static void DrawQuad##bpp##t##a(_Quad *Quad)
241static void DrawQuad##bpp##t##a(QuadInfo *Quad)
242242
243243//TRUST ON THE COMPILER OPTIMIZATIONS
244244#define TILETEMPL(bpp, t, a) \
r17917r17918
338338DrawQuad##bpp##t##a
339339
340340
341static void DrawQuadFill(_Quad *Quad)
341static void DrawQuadFill(QuadInfo *Quad)
342342{
343343   UINT32 x, y;
344344   UINT16 *line = Quad->Dest;
r17917r17918
358358   }
359359}
360360
361typedef void (*_DrawTemplate)(_Quad *);
361typedef void (*_DrawTemplate)(QuadInfo *);
362362
363363static const _DrawTemplate DrawImage[]=
364364{
r17917r17918
486486
487487   if (Packet0 & 0x100)
488488   {
489      _Quad Quad;
489      QuadInfo Quad;
490490
491491      Quad.Pitch = 512;
492492
trunk/src/mame/video/bfm_dm01.c
r17917r17918
5252
5353#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
5454
55typedef struct _dm01
55struct bfmdm01
5656{
5757   const bfmdm01_interface *intf;
5858   int       data_avail,
r17917r17918
6464UINT8 scanline[DM_BYTESPERROW],
6565      comdata;
6666
67} bfmdm01;
67};
6868
6969static bfmdm01 dm01;
7070///////////////////////////////////////////////////////////////////////////
trunk/src/mame/video/n64.h
r17917r17918
620620      bool         m_pending_mode_block;
621621      bool         m_pipe_clean;
622622
623      typedef struct
623      struct CVMASKDERIVATIVE
624624      {
625625         UINT8 cvg;
626626         UINT8 cvbit;
627627         UINT8 xoff;
628628         UINT8 yoff;
629      } CVMASKDERIVATIVE;
629      };
630630      CVMASKDERIVATIVE cvarray[(1 << 8)];
631631
632632      UINT16 z_com_table[0x40000]; //precalced table of compressed z values, 18b: 512 KB array!
trunk/src/mame/drivers/bfcobra.c
r17917r17918
101101
102102***************************************************************************/
103103
104typedef union
104union ADDR_REG
105105{
106106#ifdef LSB_FIRST
107107   struct { UINT16 loword, hiword ; } ;
r17917r17918
111111   struct { UINT8 addr2, addr1, addr0; };
112112#endif
113113   UINT32 addr;
114} ADDR_REG;
114};
115115
116116/* Blitter register flag bits */
117117#define   CMD_RUN         0x01
trunk/src/mame/drivers/atarisy4.c
r17917r17918
6868 *
6969 *************************************/
7070
71struct _gpu_
71struct gpu_
7272{
7373   /* Memory-mapped registers */
7474   UINT16 gr[8];   /* Command parameters */
trunk/src/mame/drivers/cobra.c
r17917r17918
437437class cobra_fifo
438438{
439439public:
440   typedef enum
440   enum EventType
441441   {
442442      EVENT_EMPTY,
443443      EVENT_HALF_FULL,
444444      EVENT_FULL,
445   } EventType;
445   };
446446
447447   typedef delegate<void (EventType)> event_delegate;
448448
trunk/src/tools/jedutil.c
r17917r17918
144144};
145145
146146
147typedef struct _pal_data pal_data;
147struct pal_data;
148148
149149typedef void (*print_product_terms_func)(const pal_data* pal, const jed_data* jed);
150150
151struct _pal_data
151struct pal_data
152152{
153153    const char *name;
154154    const pin_fuse_rows *pinfuserows;
trunk/src/tools/unidasm.c
r17917r17918
4040#include "emu.h"
4141#include <ctype.h>
4242
43enum _display_type
43enum display_type
4444{
4545   _8bit,
4646   _8bitx,
r17917r17918
5959   _64be,
6060   _64le
6161};
62typedef enum _display_type display_type;
6362
6463
6564struct dasm_table_entry
trunk/src/tools/romcmp.c
r17917r17918
103103   }
104104}
105105
106struct _fileinfo
106struct fileinfo
107107{
108108   char name[MAX_FILENAME_LEN+1];
109109   int size;
110110   unsigned char *buf;   /* file is read in here */
111111   int listed;
112112};
113typedef struct _fileinfo fileinfo;
114113
115114static fileinfo files[2][MAX_FILES];
116115static float matchscore[MAX_FILES][MAX_FILES][TOTAL_MODES][TOTAL_MODES];
trunk/src/osd/osdnet.h
r17917r17918
88#define CREATE_NETDEV(name) class netdev *name(const char *ifname, class device_network_interface *ifdev, int rate)
99typedef class netdev *(*create_netdev)(const char *ifname, class device_network_interface *ifdev, int rate);
1010
11typedef struct netdev_entry
11struct netdev_entry_t
1212{
1313   int id;
1414   char name[256];
1515   char description[256];
1616   create_netdev func;
17   struct netdev_entry *m_next;
18} netdev_entry_t;
17   netdev_entry_t *m_next;
18};
1919
2020class netdev
2121{
trunk/src/osd/sdl/drawsdl.c
r17917r17918
3737//  TYPES
3838//============================================================
3939
40typedef struct _sdl_scale_mode sdl_scale_mode;
40struct sdl_scale_mode;
4141
4242#if (SDLMAME_SDL2)
4343#define   DRAW2_SCALEMODE_NEAREST   "0"
r17917r17918
7575   int               old_blitheight;
7676};
7777
78struct _sdl_scale_mode
78struct sdl_scale_mode
7979{
8080   const char      *name;
8181   int            is_scale;         /* Scale mode?           */
trunk/src/osd/sdl/draw13.c
r17917r17918
6565   INT32         rotwidth, rotheight;
6666};
6767
68typedef struct _texture_info texture_info;
68struct texture_info;
6969
7070typedef void (*texture_copy_func)(texture_info *texture, const render_texinfo *texsource);
7171
r17917r17918
8888};
8989
9090/* texture_info holds information about a texture */
91struct _texture_info
91struct texture_info
9292{
9393   texture_info *      next;            // next texture in the list
9494
trunk/src/osd/sdl/sdlsync_os2.c
r17917r17918
3333#define pthread_t       int
3434#define pthread_self    _gettid
3535
36struct _osd_lock {
36struct osd_lock {
3737   volatile pthread_t   holder;
3838   INT32            count;
3939#ifdef PTR64
r17917r17918
4343#endif
4444};
4545
46struct _osd_event {
46struct osd_event {
4747    HMTX                hmtx;
4848    HEV                 hev;
4949    volatile INT32      autoreset;
r17917r17918
5454//  TYPE DEFINITIONS
5555//============================================================
5656
57struct _osd_thread {
57struct osd_thread {
5858   pthread_t         thread;
5959   osd_thread_callback callback;
6060   void *param;
6161};
6262
63struct _osd_scalable_lock
63struct osd_scalable_lock
6464{
6565   struct
6666   {
trunk/src/osd/sdl/sdlsync_tc.c
r17917r17918
3838   pthread_mutex_t id;
3939};
4040
41struct _osd_event {
41struct osd_event {
4242   pthread_mutex_t    mutex;
4343   pthread_cond_t      cond;
4444   volatile INT32      autoreset;
r17917r17918
5454//  TYPE DEFINITIONS
5555//============================================================
5656
57struct _osd_thread {
57struct osd_thread {
5858   pthread_t         thread;
5959};
6060
61struct _osd_scalable_lock
61struct osd_scalable_lock
6262{
6363   osd_lock         *lock;
6464};
trunk/src/osd/sdl/sdlsync_sdl.c
r17917r17918
3434   volatile INT32      threadid;
3535};
3636
37struct _osd_event {
37struct osd_event {
3838   SDL_mutex *         mutex;
3939   SDL_cond *         cond;
4040   volatile INT32      autoreset;
r17917r17918
4545//  TYPE DEFINITIONS
4646//============================================================
4747
48struct _osd_thread {
48struct osd_thread {
4949   SDL_Thread *      thread;
5050   osd_thread_callback callback;
5151   void *param;
5252};
5353
54struct _osd_scalable_lock
54struct osd_scalable_lock
5555{
5656   SDL_mutex *         mutex;
5757};
trunk/src/osd/sdl/sdlsync.h
r17917r17918
1818
1919/* osd_event is an opaque type which represents a setable/resetable event */
2020
21typedef struct _osd_event osd_event;
21struct osd_event;
2222
2323
2424/*-----------------------------------------------------------------------------
r17917r17918
107107***************************************************************************/
108108
109109/* osd_thread is an opaque type which represents a thread */
110typedef struct _osd_thread osd_thread;
110struct osd_thread;
111111
112112
113113/* osd_thread_callback is a callback function that will be called from the thread */
r17917r17918
191191//  Scalable Locks
192192//============================================================
193193
194typedef struct _osd_scalable_lock osd_scalable_lock;
194struct osd_scalable_lock;
195195
196196osd_scalable_lock *osd_scalable_lock_alloc(void);
197197
trunk/src/osd/sdl/sdlwork.c
r17917r17918
8888};
8989
9090
91struct _osd_work_queue
91struct osd_work_queue
9292{
9393   osd_scalable_lock *   lock;         // lock for protecting the queue
9494   osd_work_item * volatile list;      // list of items in the queue
r17917r17918
112112};
113113
114114
115struct _osd_work_item
115struct osd_work_item
116116{
117117   osd_work_item *      next;         // pointer to next item
118118   osd_work_queue *   queue;         // pointer back to the owning queue
trunk/src/osd/sdl/sdlfile.h
r17917r17918
2626//  TYPE DEFINITIONS
2727//============================================================
2828
29struct _osd_file
29struct osd_file
3030{
3131   int   handle;
3232   int   type;
trunk/src/osd/sdl/osd_opengl.h
r17917r17918
5454   #define OSD_GL(ret,func,params) ret (APIENTRY *func) params;
5555   #define OSD_GL_UNUSED(ret,func,params)
5656
57   typedef struct _osd_gl_dispatch osd_gl_dispatch;
58
59   struct _osd_gl_dispatch
57   struct osd_gl_dispatch
6058   {
6159      #define GET_GLFUNC 1
6260      #include "osd_opengl.h"
trunk/src/osd/sdl/drawogl.c
r17917r17918
160160//  TYPES
161161//============================================================
162162
163typedef struct _texture_info texture_info;
163struct texture_info;
164164
165165#if USE_OPENGL
166166typedef void (*texture_copy_func)(texture_info *texture, const render_texinfo *texsource);
167167#endif
168168
169169/* texture_info holds information about a texture */
170struct _texture_info
170struct texture_info
171171{
172172#ifdef OLD_CODE
173173   texture_info *      next;            // next texture in the list
trunk/src/osd/sdl/sdldir.c
r17917r17918
5757
5858#define HAS_DT_XXX defined(SDLMAME_LINUX) || defined(SDLMAME_BSD) || defined(SDLMAME_DARWIN)
5959
60struct _osd_directory
60struct osd_directory
6161{
6262   osd_directory_entry ent;
6363   sdl_dirent *data;
trunk/src/osd/sdl/dview.h
r17917r17918
2121#define DVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), DVIEW_TYPE, DViewClass))
2222
2323
24typedef struct _DViewClass  DViewClass;
25typedef struct _DView       DView;
24struct  DViewClass;
25struct  DView;
2626
27struct _DViewClass
27struct DViewClass
2828{
2929  GtkContainerClass parent_class;
3030  PangoFontDescription *fixedfont;
3131  int fixedfont_width, fixedfont_height;
3232};
3333
34struct _DView
34struct DView
3535{
3636  GtkContainer parent;
3737  GtkAdjustment *hadj, *vadj;
trunk/src/osd/sdl/sdlsync_win32.c
r17917r17918
3232
3333#define USE_SCALABLE_LOCKS      (0)
3434
35struct _osd_event
35struct osd_event
3636{
3737   void *   ptr;
3838};
3939
40struct _osd_thread {
40struct osd_thread {
4141   HANDLE handle;
4242   osd_thread_callback callback;
4343   void *param;
r17917r17918
9393//  Scalable Locks
9494//============================================================
9595
96struct _osd_scalable_lock
96struct osd_scalable_lock
9797{
9898#if USE_SCALABLE_LOCKS
9999   struct
trunk/src/osd/sdl/debugwin.c
r17917r17918
5151//============================================================
5252
5353
54typedef struct hentry {
54struct hentry {
5555   struct hentry *h;
5656   char *e;
57} hentry;
57};
5858
59typedef struct _win_i win_i;
59struct win_i;
6060
6161struct edit {
6262   GtkEntry *edit_w;
r17917r17918
6767   win_i *cbp;
6868};
6969
70struct _win_i {
70struct win_i {
7171   int                type;
7272   win_i *               next;
7373   GtkWidget *            win;
trunk/src/osd/sdl/sdlsync_ntc.c
r17917r17918
4040#include <errno.h>
4141#include <sys/time.h>
4242
43struct _osd_lock {
43struct osd_lock {
4444   volatile pthread_t   holder;
4545   INT32            count;
4646#ifdef PTR64
r17917r17918
5050#endif
5151};
5252
53struct _osd_event {
53struct osd_event {
5454   pthread_mutex_t    mutex;
5555   pthread_cond_t      cond;
5656   volatile INT32      autoreset;
r17917r17918
6767//  TYPE DEFINITIONS
6868//============================================================
6969
70struct _osd_thread {
70struct osd_thread {
7171   pthread_t         thread;
7272};
7373
74struct _osd_scalable_lock
74struct osd_scalable_lock
7575{
7676   struct
7777   {
trunk/src/osd/osdmini/miniwork.c
r17917r17918
4747//  TYPE DEFINITIONS
4848//============================================================
4949
50struct _osd_work_item
50struct osd_work_item
5151{
5252   void *result;
5353};
trunk/src/osd/osdcore.h
r17917r17918
7272#define OPEN_FLAG_NO_PRELOAD   0x0010      /* do not decompress on open */
7373
7474/* error codes returned by routines below */
75enum _file_error
75enum file_error
7676{
7777   FILERR_NONE,
7878   FILERR_FAILURE,
r17917r17918
8484   FILERR_INVALID_DATA,
8585   FILERR_INVALID_ACCESS
8686};
87typedef enum _file_error file_error;
8887
8988/* osd_file is an opaque type which represents an open file */
90typedef struct _osd_file osd_file;
89struct osd_file;
9190
9291/*-----------------------------------------------------------------------------
9392    osd_open: open a new file.
r17917r17918
267266***************************************************************************/
268267
269268/* types of directory entries that can be returned */
270enum _osd_dir_entry_type
269enum osd_dir_entry_type
271270{
272271   ENTTYPE_NONE,
273272   ENTTYPE_FILE,
274273   ENTTYPE_DIR,
275274   ENTTYPE_OTHER
276275};
277typedef enum _osd_dir_entry_type osd_dir_entry_type;
278276
279277/* osd_directory is an opaque type which represents an open directory */
280typedef struct _osd_directory osd_directory;
278struct osd_directory;
281279
282280/* osd_directory_entry contains basic information about a file when iterating through */
283281/* a directory */
r17917r17918
428426***************************************************************************/
429427
430428/* osd_lock is an opaque type which represents a recursive lock/mutex */
431typedef struct _osd_lock osd_lock;
429struct osd_lock;
432430
433431
434432/*-----------------------------------------------------------------------------
r17917r17918
527525#define WORK_ITEM_FLAG_AUTO_RELEASE   0x0001
528526
529527/* osd_work_queue is an opaque type which represents a queue of work items */
530typedef struct _osd_work_queue osd_work_queue;
528struct osd_work_queue;
531529
532530/* osd_work_item is an opaque type which represents a single work item */
533typedef struct _osd_work_item osd_work_item;
531struct osd_work_item;
534532
535533/* osd_work_callback is a callback function that does work */
536534typedef void *(*osd_work_callback)(void *param, int threadid);
trunk/src/osd/windows/d3dintf.h
r17917r17918
7474//  TYPE DEFINITIONS
7575//============================================================
7676
77typedef struct _d3d d3d;
78typedef struct _d3d_device d3d_device;
79typedef struct _d3d_surface d3d_surface;
80typedef struct _d3d_texture d3d_texture;
81typedef struct _d3d_vertex_buffer d3d_vertex_buffer;
82typedef struct _d3d_effect d3d_effect;
77struct d3d;
78struct d3d_device;
79struct d3d_surface;
80struct d3d_texture;
81struct d3d_vertex_buffer;
82struct d3d_effect;
8383typedef D3DXVECTOR4 d3d_vector;
8484typedef D3DMATRIX d3d_matrix;
8585
r17917r17918
129129//  Caps enumeration
130130//============================================================
131131
132enum _d3d_caps_index
132enum d3d_caps_index
133133{
134134   CAPS_PRESENTATION_INTERVALS,
135135   CAPS_CAPS2,
r17917r17918
146146   CAPS_STRETCH_RECT_FILTER,
147147   CAPS_MAX_PS30_INSN_SLOTS
148148};
149typedef enum _d3d_caps_index d3d_caps_index;
150149
151150
152151//============================================================
r17917r17918
263262//  Core D3D object
264263//============================================================
265264
266struct _d3d
265struct d3d
267266{
268267   // internal objects
269268   int                     version;
trunk/src/osd/windows/winsync.c
r17917r17918
6363
6464typedef BOOL (WINAPI *try_enter_critical_section_ptr)(LPCRITICAL_SECTION lpCriticalSection);
6565
66struct _osd_lock
66struct osd_lock
6767{
6868   CRITICAL_SECTION   critsect;
6969};
trunk/src/osd/windows/vconv.c
r17917r17918
6565//  TYPE DEFINITIONS
6666//============================================================
6767
68typedef struct _translation_info translation_info;
69struct _translation_info
68typedef struct
7069{
7170   DWORD vc_version;
7271   const char *gcc_option;
7372   const char *vc_option;
74};
73} translation_info;
7574
7675
7776
trunk/src/osd/windows/windir.c
r17917r17918
6161//  TYPE DEFINITIONS
6262//============================================================
6363
64struct _osd_directory
64struct osd_directory
6565{
6666   HANDLE            find;               // handle to the finder
6767   int               is_first;            // TRUE if this is the first entry
trunk/src/osd/windows/winwork.c
r17917r17918
138138};
139139
140140
141struct _osd_work_queue
141struct osd_work_queue
142142{
143143   scalable_lock      lock;         // lock for protecting the queue
144144   osd_work_item * volatile list;      // list of items in the queue
r17917r17918
162162};
163163
164164
165struct _osd_work_item
165struct osd_work_item
166166{
167167   osd_work_item *      next;         // pointer to next item
168168   osd_work_queue *   queue;         // pointer back to the owning queue
trunk/src/osd/windows/ledutil.c
r17917r17918
131131//  TYPE DEFINITIONS
132132//============================================================
133133
134typedef struct _KEYBOARD_INDICATOR_PARAMETERS
134struct KEYBOARD_INDICATOR_PARAMETERS
135135{
136136    USHORT UnitId;             // Unit identifier.
137137    USHORT LedFlags;           // LED indicator state.
138} KEYBOARD_INDICATOR_PARAMETERS, *PKEYBOARD_INDICATOR_PARAMETERS;
138};
139139
140140
141141struct id_map_entry
trunk/src/osd/windows/winfile.h
r17917r17918
2323//  TYPE DEFINITIONS
2424//============================================================
2525
26struct _osd_file
26struct osd_file
2727{
2828   HANDLE      handle;
2929   SOCKET      socket;
trunk/src/osd/windows/debugwin.c
r17917r17918
151151//  TYPES
152152//============================================================
153153
154typedef struct _debugview_info debugview_info;
154struct debugview_info;
155155class debugwin_info;
156156
157157
158struct _debugview_info
158struct debugview_info
159159{
160160   debugwin_info *         owner;
161161   debug_view *         view;
trunk/src/osd/windows/window.c
r17917r17918
173173
174174// temporary hacks
175175#if LOG_THREADS
176struct _mtlog
176struct mtlog
177177{
178178   osd_ticks_t   timestamp;
179179   const char *event;
180180};
181181
182static struct _mtlog mtlog[100000];
182static mtlog mtlog[100000];
183183static volatile LONG mtlogindex;
184184
185185void mtlog_add(const char *event)
trunk/src/lib/formats/flopimg.c
r17917r17918
2424#define TRACK_DIRTY         0x02
2525
2626
27struct _floppy_image
27struct floppy_image_legacy
2828{
2929   struct io_generic io;
3030
r17917r17918
4646
4747
4848
49struct _floppy_params
49struct floppy_params
5050{
5151   int param;
5252   int value;
r17917r17918
7777{
7878   floppy_image_legacy *floppy;
7979
80   floppy = (floppy_image_legacy *)malloc(sizeof(struct _floppy_image));
80   floppy = (floppy_image_legacy *)malloc(sizeof(floppy_image));
8181   if (!floppy)
8282      return NULL;
8383
trunk/src/lib/formats/flopimg.h
r17917r17918
4141
4242***************************************************************************/
4343
44typedef enum
44enum floperr_t
4545{
4646   FLOPPY_ERROR_SUCCESS,         /* no error */
4747   FLOPPY_ERROR_INTERNAL,         /* fatal internal error */
r17917r17918
5353   FLOPPY_ERROR_NOSPACE,
5454   FLOPPY_ERROR_PARAMOUTOFRANGE,
5555   FLOPPY_ERROR_PARAMNOTSPECIFIED
56}
57floperr_t;
56};
5857
59typedef struct _floppy_image floppy_image_legacy;
58struct floppy_image_legacy;
6059
6160struct FloppyCallbacks
6261{
trunk/src/lib/formats/cassimg.c
r17917r17918
8484{
8585   cassette_image *cassette;
8686
87   cassette = (cassette_image *)malloc(sizeof(struct _cassette_image));
87   cassette = (cassette_image *)malloc(sizeof(cassette_image));
8888   if (!cassette)
8989      return NULL;
9090
trunk/src/lib/formats/cassimg.h
r17917r17918
9191   size_t sample_count;
9292};
9393
94struct _cassette_image
94struct cassette_image
9595{
9696   const struct CassetteFormat *format;
9797   struct io_generic io;
r17917r17918
106106   size_t sample_count;
107107};
108108
109typedef struct _cassette_image cassette_image;
110
111109struct CassetteFormat
112110{
113111   const char *extensions;
trunk/src/lib/util/palette.c
r17917r17918
5757
5858
5959/* a single palette client */
60struct _palette_client
60struct palette_client
6161{
6262   palette_client *next;                  /* pointer to next client */
6363   palette_t *      palette;               /* reference to the palette */
r17917r17918
6767
6868
6969/* a palette object */
70struct _palette_t
70struct palette_t
7171{
7272   UINT32         refcount;               /* reference count on the palette */
7373   UINT32         numcolors;               /* number of colors in the palette */
trunk/src/lib/util/palette.h
r17917r17918
5656typedef UINT16 rgb15_t;
5757
5858/* a palette is an opaque, reference counted object */
59typedef struct _palette_t palette_t;
59struct palette_t;
6060
6161/* a palette client is someone who is tracking the dirty state of a palette */
62typedef struct _palette_client palette_client;
62struct palette_client;
6363
6464
6565
trunk/src/lib/util/cdrom.c
r17917r17918
8888    TYPE DEFINITIONS
8989***************************************************************************/
9090
91struct _cdrom_file
91struct cdrom_file
9292{
9393   chd_file *         chd;            /* CHD file */
9494   cdrom_toc         cdtoc;            /* TOC for the CD */
trunk/src/lib/util/aviio.c
r17917r17918
169169};
170170
171171
172struct _avi_file
172struct avi_file
173173{
174174   /* shared data */
175175   osd_file *         file;               /* pointer to open file */
trunk/src/lib/util/cdrom.h
r17917r17918
9090    TYPE DEFINITIONS
9191***************************************************************************/
9292
93typedef struct _cdrom_file cdrom_file;
93struct cdrom_file;
9494
9595struct cdrom_track_info
9696{
trunk/src/lib/util/opresolv.c
r17917r17918
3232   } u;
3333};
3434
35struct _option_resolution
35struct option_resolution
3636{
3737   object_pool *pool;
3838   const char *specification;
trunk/src/lib/util/aviio.h
r17917r17918
4848    CONSTANTS
4949***************************************************************************/
5050
51enum _avi_error
51enum avi_error
5252{
5353   AVIERR_NONE = 0,
5454   AVIERR_END,
r17917r17918
6868   AVIERR_UNSUPPORTED_AUDIO_FORMAT,
6969   AVIERR_EXCEEDED_SOUND_BUFFER
7070};
71typedef enum _avi_error avi_error;
7271
7372
74enum _avi_datatype
73enum avi_datatype
7574{
7675   AVIDATA_VIDEO,
7776   AVIDATA_AUDIO_CHAN0,
r17917r17918
8382   AVIDATA_AUDIO_CHAN6,
8483   AVIDATA_AUDIO_CHAN7
8584};
86typedef enum _avi_datatype avi_datatype;
8785
8886
8987
r17917r17918
104102    TYPE DEFINITIONS
105103***************************************************************************/
106104
107typedef struct _avi_file avi_file;
105struct avi_file;
108106
109107
110108struct avi_movie_info
trunk/src/lib/util/opresolv.h
r17917r17918
114114
115115
116116
117typedef struct _option_resolution option_resolution;
117struct option_resolution;
118118
119119struct OptionRange
120120{
trunk/src/lib/util/png.h
r17917r17918
8787#define PNG_PF_Paeth      4
8888
8989/* Error types */
90enum _png_error
90enum png_error
9191{
9292   PNGERR_NONE,
9393   PNGERR_OUT_OF_MEMORY,
r17917r17918
101101   PNGERR_COMPRESS_ERROR,
102102   PNGERR_UNSUPPORTED_FORMAT
103103};
104typedef enum _png_error png_error;
105104
106105
107106
trunk/src/lib/util/un7z.h
r17917r17918
5656void *SZipAllocTemp(void *p, size_t size);
5757void SZipFreeTemp(void *p, void *address);
5858
59typedef struct
59struct CSzFile
6060{
6161   long _7z_currfpos;
6262   UINT64         _7z_length;
6363   osd_file *      _7z_osdfile;               /* OSD file handle */
6464
65} CSzFile;
65};
6666
6767
68typedef struct
68struct CFileSeqInStream
6969{
7070   ISeqInStream s;
7171   CSzFile file;
72} CFileSeqInStream;
72};
7373
7474void FileSeqInStream_CreateVTable(CFileSeqInStream *p);
7575
7676
77typedef struct
77struct CFileInStream
7878{
7979   ISeekInStream s;
8080   CSzFile file;
81} CFileInStream;
81};
8282
8383void FileInStream_CreateVTable(CFileInStream *p);
8484
8585
86typedef struct
86struct CFileOutStream
8787{
8888   ISeqOutStream s;
8989   CSzFile file;
90} CFileOutStream;
90} ;
9191
9292void FileOutStream_CreateVTable(CFileOutStream *p);
9393
r17917r17918
9999
100100
101101/* Error types */
102enum __7z_error
102enum _7z_error
103103{
104104   _7ZERR_NONE = 0,
105105   _7ZERR_OUT_OF_MEMORY,
r17917r17918
111111   _7ZERR_UNSUPPORTED,
112112   _7ZERR_BUFFER_TOO_SMALL
113113};
114typedef enum __7z_error _7z_error;
115114
116115
117116
trunk/src/lib/util/pool.c
r17917r17918
9090
9191
9292/* the object pool itself */
93struct _object_pool
93struct object_pool
9494{
9595   object_entry *      hashtable[POOL_HASH_SIZE];
9696   object_entry *      globallist;
r17917r17918
102102
103103
104104/* an iterator over objects in a pool */
105struct _object_pool_iterator
105struct object_pool_iterator
106106{
107107   object_pool *      pool;
108108   object_type         type;
trunk/src/lib/util/unzip.h
r17917r17918
5252#define ZIP_DECOMPRESS_BUFSIZE   16384
5353
5454/* Error types */
55enum _zip_error
55enum zip_error
5656{
5757   ZIPERR_NONE = 0,
5858   ZIPERR_OUT_OF_MEMORY,
r17917r17918
6464   ZIPERR_UNSUPPORTED,
6565   ZIPERR_BUFFER_TOO_SMALL
6666};
67typedef enum _zip_error zip_error;
6867
6968
7069
trunk/src/lib/util/pool.h
r17917r17918
6969typedef UINT32 object_type;
7070
7171/* opaque type representing a pool of objects */
72typedef struct _object_pool object_pool;
72struct object_pool;
7373
7474/* opaque type representing an iterator over pool objects */
75typedef struct _object_pool_iterator object_pool_iterator;
75struct object_pool_iterator;
7676
7777
7878
trunk/src/lib/util/corefile.c
r17917r17918
7070    TYPE DEFINITIONS
7171***************************************************************************/
7272
73enum _text_file_type
73enum text_file_type
7474{
7575   TFT_OSD = 0,   /* OSD depdendent encoding format used when BOMs missing */
7676   TFT_UTF8,      /* UTF-8 */
r17917r17918
7979   TFT_UTF32BE,   /* UTF-32 (UCS-4) (big endian) */
8080   TFT_UTF32LE      /* UTF-32 (UCS-4) (little endian) */
8181};
82typedef enum _text_file_type text_file_type;
8382
8483
8584struct zlib_data
r17917r17918
9190};
9291
9392
94/* typedef struct _core_file core_file -- declared in corefile.h */
95struct _core_file
93struct core_file
9694{
9795   osd_file *      file;                  /* OSD file handle */
9896   zlib_data *      zdata;                  /* compression data */
trunk/src/lib/util/corefile.h
r17917r17918
6666    TYPE DEFINITIONS
6767***************************************************************************/
6868
69typedef struct _core_file core_file;
69struct core_file;
7070
7171
7272
trunk/src/emu/debug/textbuf.c
r17917r17918
2626    TYPE DEFINITIONS
2727***************************************************************************/
2828
29/* typedef struct _text_buffer text_buffer; -- declared in textbuf.h */
30struct _text_buffer
29struct text_buffer
3130{
3231   char *               buffer;
3332   INT32 *               lineoffs;
trunk/src/emu/debug/textbuf.h
r17917r17918
1717    TYPE DEFINITIONS
1818***************************************************************************/
1919
20typedef struct _text_buffer text_buffer;
20struct text_buffer;
2121
2222
2323
trunk/src/emu/cpu/pic16c62x/16c62xdsm.c
r17917r17918
9696
9797#define MAX_OPS (((sizeof(PIC16C62xFormats) / sizeof(PIC16C62xFormats[0])) - 1) / PTRS_PER_FORMAT)
9898
99typedef struct opcode {
99struct PIC16C62xOpcode {
100100   word mask;         /* instruction mask */
101101   word bits;         /* constant bits */
102102   word extcode;      /* value that gets extension code */
103103   const char *parse;   /* how to parse bits */
104104   const char *fmt;   /* instruction format */
105} PIC16C62xOpcode;
105};
106106
107107static PIC16C62xOpcode Op[MAX_OPS+1];
108108static int OpInizialized = 0;
trunk/src/emu/cpu/unsp/unsp.h
r17917r17918
1111#ifndef __UNSP_H__
1212#define __UNSP_H__
1313
14typedef struct _unspimp_state unspimp_state;
14struct unspimp_state;
1515struct unsp_state
1616{
1717   UINT16 r[16];
trunk/src/emu/cpu/am29000/am29ops.h
r17917r17918
6161    STRUCTS
6262***************************************************************************/
6363
64typedef struct _op_info
64struct op_info
6565{
6666   void (*opcode)(am29000_state *);
6767   UINT32 flags;
68} op_info;
68};
6969
7070
7171/***************************************************************************
trunk/src/emu/cpu/am29000/am29000.c
r17917r17918
7575    STRUCTURES & TYPEDEFS
7676***************************************************************************/
7777
78typedef struct _am29000_state
78struct am29000_state
7979{
8080   INT32         icount;
8181   UINT32         pc;
r17917r17918
136136   address_space *data;
137137   direct_read_data *datadirect;
138138   address_space *io;
139} am29000_state;
139};
140140
141141
142142/***************************************************************************
trunk/src/emu/cpu/m68000/m68kcpu.h
r17917r17918
529529/* =============================== PROTOTYPES ============================= */
530530/* ======================================================================== */
531531
532typedef union _fp_reg fp_reg;
533union _fp_reg
532union fp_reg
534533{
535534   UINT64 i;
536535   double f;
trunk/src/emu/cpu/tms34010/tms34010.c
r17917r17918
2929***************************************************************************/
3030
3131/* TMS34010 State */
32typedef struct _XY XY;
33struct _XY
32struct XY
3433{
3534#ifdef LSB_FIRST
3635   INT16 x;
trunk/src/emu/cpu/sharc/sharc.c
r17917r17918
8888   bool active;
8989};
9090
91typedef struct _SHARC_REGS SHARC_REGS;
92struct _SHARC_REGS
91struct SHARC_REGS
9392{
9493   UINT32 pc;
9594   SHARC_REG r[16];
trunk/src/emu/cpu/z180/z180dasm.c
r17917r17918
7373   "slp"  ,"sra"  ,"srl"  ,"sub"  ,"tst"  ,"tstio","xor "
7474};
7575
76typedef struct {
76struct z80dasm {
7777   UINT8 mnemonic;
7878   const char *arguments;
79}   z80dasm;
79};
8080
8181static const z80dasm mnemonic_xx_cb[256]= {
8282   {zRLC,"b=Y"},   {zRLC,"c=Y"},   {zRLC,"d=Y"},   {zRLC,"e=Y"},
trunk/src/emu/cpu/i86/i86.c
r17917r17918
2222
2323
2424/* I86 registers */
25typedef union
25union i8086basicregs
2626{                              /* eight general registers */
2727   UINT16 w[8];                  /* viewed as 16 bits registers */
2828   UINT8 b[16];                  /* or as 8 bit registers */
29}
30i8086basicregs;
29};
3130
3231struct i8086_state
3332{
trunk/src/emu/cpu/x86log.c
r17917r17918
4848
4949
5050/* the code logging context */
51struct _x86log_context
51struct x86log_context
5252{
5353   astring         filename;                  /* name of the file */
5454   FILE *         file;                     /* file we are logging to */
trunk/src/emu/cpu/minx/minxd.c
r17917r17918
9191   0, 0, 0, 0, 0,
9292};
9393
94typedef struct {
94struct minxdasm {
9595   UINT8   mnemonic;
9696   UINT8   argument1;
9797   UINT8   argument2;
98}   minxdasm;
98};
9999
100100static const minxdasm mnemonic[256] = {
101101   /* 00 - 0F */
trunk/src/emu/cpu/dsp56k/dsp56ops.c
r17917r17918
3434            DT_DOUBLE_WORD,
3535            DT_LONG_WORD };
3636
37struct _typed_pointer
37struct typed_pointer
3838{
3939   void* addr;
4040   char  data_type;
4141};
42typedef struct _typed_pointer typed_pointer;
4342
4443//#define ADDRESS(X) (X<<1)
4544#define BITS(CUR,MASK) (Dsp56kOpMask(CUR,MASK))
trunk/src/emu/cpu/x86log.h
r17917r17918
2222    TYPE DEFINITIONS
2323***************************************************************************/
2424
25typedef struct _x86log_context x86log_context;
25struct x86log_context;
2626
2727
2828
trunk/src/emu/cpu/tlcs90/tlcs90.c
r17917r17918
1010#include "debugger.h"
1111#include "tlcs90.h"
1212
13typedef 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;
13enum _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      };
1414typedef UINT8 e_op;
1515static 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"   };
1616
17typedef enum   {
17enum e_mode {
1818   MODE_NONE,   MODE_BIT8,   MODE_CC,
1919   MODE_I8,   MODE_D8,   MODE_R8,
2020   MODE_I16,   MODE_D16,   MODE_R16,
2121   MODE_MI16,   MODE_MR16,   MODE_MR16D8,   MODE_MR16R8,
2222   MODE_R16D8,   MODE_R16R8
23}   e_mode;
23};
2424ALLOW_SAVE_TYPE(e_mode); // allow save_item on a non-fundamental type
2525
2626typedef UINT16 e_r;
2727
28typedef struct
28struct t90_Regs
2929{
3030   PAIR      prvpc,pc,sp,af,bc,de,hl,ix,iy;
3131   PAIR      af2,bc2,de2,hl2;
r17917r17918
5959
6060   UINT32   addr;
6161
62}   t90_Regs;
62};
6363
6464INLINE t90_Regs *get_safe_token(device_t *device)
6565{
r17917r17918
12801280
12811281*************************************************************************************************************/
12821282
1283typedef enum   {   INTSWI = 0,   INTNMI,   INTWD,   INT0,   INTT0,   INTT1,   INTT2,   INTT3,   INTT4,   INT1,   INTT5,   INT2,   INTRX,   INTTX,   INTMAX   }   e_irq;
1283enum e_irq {   INTSWI = 0,   INTNMI,   INTWD,   INT0,   INTT0,   INTT1,   INTT2,   INTT3,   INTT4,   INT1,   INTT5,   INT2,   INTRX,   INTTX,   INTMAX   };
12841284DECLARE_ENUM_OPERATORS(e_irq)
12851285
12861286INLINE void leave_halt(t90_Regs *cpustate)
trunk/src/emu/cpu/tlcs90/tlcs90.h
r17917r17918
1313
1414#define T90_IOBASE   0xffc0
1515
16typedef enum
16enum e_ir
1717{
1818   T90_P0=T90_IOBASE,   T90_P1,      T90_P01CR_IRFL,   T90_IRFH,   T90_P2,      T90_P2CR,   T90_P3,      T90_P3CR,
1919   T90_P4,            T90_P4CR,   T90_P5,         T90_SMMOD,   T90_P6,      T90_P7,      T90_P67CR,   T90_SMCR,
r17917r17918
2121   T90_TCLK,         T90_TFFCR,   T90_TMOD,      T90_TRUN,   T90_CAP1L,   T90_CAP1H,   T90_CAP2L,   T90_CAL2H,
2222   T90_TREG4L,         T90_TREG4H,   T90_TREG5L,      T90_TREG5H,   T90_T4MOD,   T90_T4FFCR,   T90_INTEL,   T90_INTEH,
2323   T90_DMAEH,         T90_SCMOD,   T90_SCCR,      T90_SCBUF,   T90_BX,      T90_BY,      T90_ADREG,   T90_ADMOD
24}   e_ir;
24};
2525
2626#endif /* __TLCS90_H__ */
trunk/src/emu/cpu/se3208/se3208dis.c
r17917r17918
33#include "se3208.h"
44
55
6static struct _DisSE3208
6static struct
77{
88   UINT32 PC;
99   UINT32 SR;
trunk/src/emu/cpu/e132xs/e132xs.c
r17917r17918
285285
286286
287287/* Delay information */
288struct _delay
288struct delay_info
289289{
290290   INT32   delay_cmd;
291291   UINT32   delay_pc;
r17917r17918
315315   UINT8   timer_int_pending;
316316   emu_timer *timer;
317317
318   struct _delay delay;
318   delay_info delay;
319319
320320   device_irq_acknowledge_callback irq_callback;
321321   legacy_cpu_device *device;
trunk/src/emu/cpu/i860/i860.h
r17917r17918
5555***************************************************************************/
5656
5757/* i860 state.  */
58typedef struct {
58struct i860_state_t {
5959   /* Integer registers (32 x 32-bits).  */
6060   UINT32 iregs[32];
6161
r17917r17918
173173   UINT32 ppc;
174174   int icount;
175175
176} i860_state_t;
176};
177177
178178INLINE i860_state_t *get_safe_token(device_t *device)
179179{
trunk/src/emu/cpu/hcd62121/hcd62121.c
r17917r17918
1515#include "hcd62121.h"
1616
1717
18struct _hcd62121_state
18struct hcd62121_state
1919{
2020   UINT32 prev_pc;
2121   UINT16 sp;
r17917r17918
3636   int icount;
3737};
3838
39typedef struct _hcd62121_state hcd62121_state;
4039
41
4240/* From the battery check routine at 20:e874 it looks like
4341   bit 3 of the flag register should be the Zero flag. */
4442#define _FLAG_Z      0x08
trunk/src/emu/cpu/rsp/rsp.h
r17917r17918
153153   INT16 w[4];
154154};
155155
156typedef struct _rspimp_state rspimp_state;
156struct rspimp_state;
157157struct rsp_state
158158{
159159   const rsp_config *config;
trunk/src/emu/cpu/rsp/rspdrc.c
r17917r17918
100100   code_label   labelnum;               /* index for local labels */
101101};
102102
103struct _rspimp_state
103struct rspimp_state
104104{
105105   /* core state */
106106   drc_cache *         cache;                  /* pointer to the DRC code cache */
trunk/src/emu/cpu/cop400/cop400.c
r17917r17918
8282    TYPE DEFINITIONS
8383***************************************************************************/
8484
85typedef struct _cop400_opcode_map cop400_opcode_map;
85struct cop400_opcode_map;
8686
8787struct cop400_state
8888{
r17917r17918
151151
152152typedef void (*cop400_opcode_func) (cop400_state *cpustate, UINT8 opcode);
153153
154struct _cop400_opcode_map {
154struct cop400_opcode_map {
155155   unsigned cycles;
156156   cop400_opcode_func function;
157157};
trunk/src/emu/cpu/cop400/cop400.h
r17917r17918
7373};
7474
7575/* CKI bonding options */
76enum _cop400_cki_bond {
76enum cop400_cki_bond {
7777   COP400_CKI_DIVISOR_4 = 4,
7878   COP400_CKI_DIVISOR_8 = 8,
7979   COP400_CKI_DIVISOR_16 = 16,
8080   COP400_CKI_DIVISOR_32 = 32
8181};
82typedef enum _cop400_cki_bond cop400_cki_bond;
8382
8483/* CKO bonding options */
85enum _cop400_cko_bond {
84enum cop400_cko_bond {
8685   COP400_CKO_OSCILLATOR_OUTPUT = 0,
8786   COP400_CKO_RAM_POWER_SUPPLY,
8887   COP400_CKO_HALT_IO_PORT,
8988   COP400_CKO_SYNC_INPUT,
9089   COP400_CKO_GENERAL_PURPOSE_INPUT
9190};
92typedef enum _cop400_cko_bond cop400_cko_bond;
9391
9492/* microbus bonding options */
95enum _cop400_microbus {
93enum cop400_microbus {
9694   COP400_MICROBUS_DISABLED = 0,
9795   COP400_MICROBUS_ENABLED
9896};
99typedef enum _cop400_microbus cop400_microbus;
10097
10198/* interface */
10299struct cop400_interface
trunk/src/emu/cpu/m6502/m4510.c
r17917r17918
120120
121121#define LOG(x)   do { if (VERBOSE) logerror x; } while (0)
122122
123typedef struct _m4510_Regs m4510_Regs;
124struct _m4510_Regs {
123struct m4510_Regs {
125124   void   (*const *insn)(m4510_Regs *); /* pointer to the function pointer table */
126125   PAIR   ppc;         /* previous program counter */
127126   PAIR   pc;          /* program counter */
trunk/src/emu/cpu/m6502/m6502.c
r17917r17918
4848/****************************************************************************
4949 * The 6502 registers.
5050 ****************************************************************************/
51typedef struct _m6502_Regs m6502_Regs;
52struct _m6502_Regs
51struct m6502_Regs
5352{
5453   UINT8   subtype;      /* currently selected cpu sub type */
5554   void   (*const *insn)(m6502_Regs *); /* pointer to the function pointer table */
trunk/src/emu/cpu/m6502/m6509.c
r17917r17918
5656
5757#define LOG(x)   do { if (VERBOSE) logerror x; } while (0)
5858
59typedef struct _m6509_Regs m6509_Regs;
60struct _m6509_Regs {
59struct m6509_Regs {
6160   UINT8   subtype;      /* currently selected cpu sub type */
6261   void   (*const *insn)(m6509_Regs *); /* pointer to the function pointer table */
6362   PAIR   ppc;         /* previous program counter */
trunk/src/emu/cpu/m6502/m65ce02.c
r17917r17918
5555
5656#define LOG(x)   do { if (VERBOSE) logerror x; } while (0)
5757
58typedef struct   _m65ce02_Regs m65ce02_Regs;
59struct   _m65ce02_Regs {
58struct   m65ce02_Regs {
6059   void   (*const *insn)(m65ce02_Regs *); /* pointer to the function pointer table */
6160   PAIR   ppc;         /* previous program counter */
6261   PAIR   pc;            /* program counter */
trunk/src/emu/cpu/psx/psx.h
r17917r17918
440440
441441
442442
443typedef struct _DasmPSXCPU_state DasmPSXCPU_state;
444
445struct _DasmPSXCPU_state
443struct DasmPSXCPU_state
446444{
447445   UINT32 pc;
448446   int delayr;
trunk/src/emu/cpu/powerpc/ppcdrc.c
r17917r17918
158158
159159
160160/* PowerPC implementation state */
161struct _ppcimp_state
161struct ppcimp_state
162162{
163163   /* core state */
164164   drc_cache *         cache;                  /* pointer to the DRC code cache */
trunk/src/emu/cpu/powerpc/ppccom.h
r17917r17918
4444#define PPCCAP_604_MMU            0x100      /* TRUE if we have 604-class MMU features */
4545
4646/* PowerPC flavors */
47enum _powerpc_flavor
47enum powerpc_flavor
4848{
4949   PPC_MODEL_403GA            = 0x00200000,
5050   PPC_MODEL_403GB            = 0x00200100,
r17917r17918
7575   PPC_MODEL_MPC8241         = 0x80811014,   /* "Kahlua Lt" */
7676   PPC_MODEL_MPC8245         = 0x80811014,   /* "Kahlua II" */
7777};
78typedef enum _powerpc_flavor powerpc_flavor;
7978
8079
8180/* exception types */
r17917r17918
504503
505504
506505/* forward declaration of implementation-specific state */
507typedef struct _ppcimp_state ppcimp_state;
506struct ppcimp_state;
508507
509508
510509/* PowerPC state */
trunk/src/emu/cpu/lr35902/lr35902d.c
r17917r17918
5858   _OVER,0    ,0    ,0
5959};
6060
61typedef struct
61struct lr35902dasm
6262{
6363   UINT8   mnemonic;
6464   const char *arguments;
65}   lr35902dasm;
65};
6666
6767static const lr35902dasm mnemonic_cb[256] = {
6868   {zRLC,"b"},     {zRLC,"c"},     {zRLC,"d"},     {zRLC,"e"},
trunk/src/emu/cpu/z8000/z8000cpu.h
r17917r17918
189189#define GET_DSP16      UINT32 dsp16 = addr_add(cpustate, cpustate->pc, (INT16)get_operand(cpustate, 1))
190190#define GET_ADDR(o)    UINT32 addr = (UINT32)get_addr_operand(cpustate, o)
191191
192typedef struct _z8000_state z8000_state;
192struct z8000_state;
193193
194194/* structure for the opcode definition table */
195typedef struct {
195struct Z8000_init {
196196   int    beg, end, step;
197197   int    size, cycles;
198198   void   (*opcode)(z8000_state *cpustate);
199199   const char   *dasm;
200200    UINT32 dasmflags;
201}   Z8000_init;
201};
202202
203203/* structure for the opcode execution table / disassembler */
204typedef struct {
204struct Z8000_exec {
205205    void    (*opcode)(z8000_state *cpustate);
206206    int     cycles;
207207   int    size;
208208    const char    *dasm;
209209    UINT32 dasmflags;
210}   Z8000_exec;
210};
211211
212212/* opcode execution table */
213213extern Z8000_exec *z8000_exec;
trunk/src/emu/cpu/z8000/z8000.c
r17917r17918
5656
5757#define LOG(x)   do { if (VERBOSE) logerror x; } while (0)
5858
59typedef union _z8000_reg_file z8000_reg_file;
60union _z8000_reg_file
59union z8000_reg_file
6160{
6261    UINT8   B[16]; /* RL0,RH0,RL1,RH1...RL7,RH7 */
6362    UINT16  W[16]; /* R0,R1,R2...R15 */
r17917r17918
6564    UINT64  Q[4];  /* RQ0,RQ4,..RQ12 */
6665};
6766
68/* In z8000cpu.h: typedef struct _z8000_state z8000_state; */
69struct _z8000_state
67struct z8000_state
7068{
7169    UINT32  op[4];      /* opcodes/data of current instruction */
7270   UINT32   ppc;      /* previous program counter */
trunk/src/emu/cpu/vtlb.c
r17917r17918
2828***************************************************************************/
2929
3030/* VTLB state */
31struct _vtlb_state
31struct vtlb_state
3232{
3333   cpu_device *      cpudevice;         /* CPU device */
3434   address_spacenum   space;            /* address space */
trunk/src/emu/cpu/tms32010/tms32010.c
r17917r17918
7676
7777
7878
79typedef struct _tms32010_state tms32010_state;      /* Page 3-6 shows all registers */
80struct _tms32010_state
79struct tms32010_state
8180{
8281   /******************** CPU Internal Registers *******************/
8382   UINT16   PC;
trunk/src/emu/cpu/tms32010/32010dsm.c
r17917r17918
156156
157157#define MAX_OPS (((sizeof(TMS32010Formats) / sizeof(TMS32010Formats[0])) - 1) / PTRS_PER_FORMAT)
158158
159typedef struct opcode {
159struct TMS32010Opcode {
160160   word mask;         /* instruction mask */
161161   word bits;         /* constant bits */
162162   word extcode;      /* value that gets extension code */
163163   const char *parse;      /* how to parse bits */
164164   const char *fmt;         /* instruction format */
165} TMS32010Opcode;
165};
166166
167167static TMS32010Opcode Op[MAX_OPS+1];
168168static int OpInizialized = 0;
trunk/src/emu/cpu/sm8500/sm8500d.c
r17917r17918
6565   0, 0, 0
6666};
6767
68typedef struct
68struct sm8500dasm
6969{
7070   UINT8   mnemonic;
7171   UINT8   arguments;
72}   sm8500dasm;
72};
7373
7474static const char *const sm8500_cond[16] = {
7575   "F", "LT", "LE", "ULE", "OV",  "MI", "Z",  "C",
trunk/src/emu/cpu/vtlb.h
r17917r17918
4343
4444
4545/* opaque structure describing VTLB state */
46typedef struct _vtlb_state vtlb_state;
46struct vtlb_state;
4747
4848
4949
trunk/src/emu/cpu/mn10200/mn10200.c
r17917r17918
3434   UINT16 psw;
3535   UINT16 mdr;
3636
37   struct _simple_timer {
38   UINT8 mode;
39   UINT8 base;
40   UINT8 cur;
37   struct {
38      UINT8 mode;
39      UINT8 base;
40      UINT8 cur;
4141   } simple_timer[NUM_TIMERS_8BIT];
4242
4343   emu_timer *timer_timers[NUM_TIMERS_8BIT];
4444
45   struct _prescaler {
46   UINT8 cycles;
47   UINT8 mode;
45   struct {
46      UINT8 cycles;
47      UINT8 mode;
4848   } prescaler[NUM_PRESCALERS];
4949
50   struct _dma {
51   UINT32 adr;
52   UINT32 count;
53   UINT16 iadr;
54   UINT8 ctrll, ctrlh, irq;
50   struct {
51      UINT32 adr;
52      UINT32 count;
53      UINT16 iadr;
54      UINT8 ctrll, ctrlh, irq;
5555   } dma[8];
5656
57   struct _serial {
58   UINT8 ctrll, ctrlh;
59   UINT8 buf;
57   struct {
58      UINT8 ctrll, ctrlh;
59      UINT8 buf;
6060   } serial[2];
6161
6262   UINT8 ddr[8];
trunk/src/emu/cpu/alph8201/alph8201.c
r17917r17918
204204};
205205
206206/* The opcode table now is a combination of cycle counts and function pointers */
207typedef struct {
207struct s_opcode {
208208   unsigned cycles;
209209   void (*function) (alpha8201_state *cpustate);
210}   s_opcode;
210};
211211
212212
213213#define PC            pc.w.l
trunk/src/emu/cpu/apexc/apexcdsm.c
r17917r17918
6161    The X value shows where the data word is located, and the Y value is the
6262    address of the next instruction.
6363*/
64enum _format_type {branch, shiftl, shiftr, multiply, store, swap, one_address, two_address};
65typedef enum _format_type format_type;
64enum format_type {branch, shiftl, shiftr, multiply, store, swap, one_address, two_address};
6665
67typedef struct instr_desc
66struct instr_desc
6867{
6968   const char *mnemonic;
7069   format_type format;   /* -> X and Y are format */
71} instr_desc;
70};
7271
7372static const instr_desc instructions[16] =
7473{
trunk/src/emu/cpu/mips/mips3com.h
r17917r17918
3333#define MIPS3_CAUSE_READ_CYCLES      250
3434
3535/* MIPS flavors */
36enum _mips3_flavor
36enum mips3_flavor
3737{
3838   /* MIPS III variants */
3939   MIPS3_TYPE_MIPS_III,
r17917r17918
4848   MIPS3_TYPE_QED5271,
4949   MIPS3_TYPE_RM7000
5050};
51typedef enum _mips3_flavor mips3_flavor;
5251
5352/* TLB bits */
5453#define TLB_GLOBAL            0x01
r17917r17918
176175
177176
178177/* forward declaration of implementation-specific state */
179typedef struct _mips3imp_state mips3imp_state;
178struct mips3imp_state;
180179
181180
182181/* MIPS3 state */
trunk/src/emu/cpu/mips/mips3drc.c
r17917r17918
179179
180180
181181/* MIPS3 registers */
182struct _mips3imp_state
182struct mips3imp_state
183183{
184184   /* core state */
185185   drc_cache *         cache;                  /* pointer to the DRC code cache */
trunk/src/emu/cpu/tms7000/tms7000.c
r17917r17918
3636
3737#define LOG(x)   do { if (VERBOSE) logerror x; } while (0)
3838
39typedef struct _tms7000_state tms7000_state;
39struct tms7000_state;
4040
4141/* Private prototypes */
4242
r17917r17918
6464#define PULLBYTE(b) b = RM(pSP); pSP--
6565#define PULLWORD(w) w.b.l = RM(pSP); pSP--; w.b.h = RM(pSP); pSP--
6666
67struct _tms7000_state
67struct tms7000_state
6868{
6969   PAIR      pc;       /* Program counter */
7070   UINT8      sp;      /* Stack Pointer */
trunk/src/emu/cpu/f8/f8.c
r17917r17918
3939#define cS  4
4040#define cL   6
4141
42typedef struct _f8_Regs f8_Regs;
43struct _f8_Regs
42struct f8_Regs
4443{
4544   UINT16   pc0;   /* program counter 0 */
4645   UINT16   pc1;   /* program counter 1 */
trunk/src/emu/cpu/z80/z80dasm.c
r17917r17918
6565   0    ,0    ,0    ,0    ,0
6666};
6767
68typedef struct
68struct z80dasm
6969{
7070   UINT8 mnemonic;
7171   const char *arguments;
72}   z80dasm;
72};
7373
7474static const z80dasm mnemonic_xx_cb[256] =
7575{
trunk/src/emu/cpu/tms9900/99xxcore.h
r17917r17918
257257*/
258258#define USE_16_BIT_ACCESSORS ((TMS99XX_MODEL == TI990_10_ID) || (TMS99XX_MODEL == TMS9900_ID) || (TMS99XX_MODEL == TMS9940_ID) || (IS_99000))
259259
260typedef struct _tms99xx_state tms99xx_state;
260struct tms99xx_state;
261261
262262INLINE void execute(tms99xx_state *cpustate, UINT16 opcode);
263263
r17917r17918
394394#define R14 28
395395#define R15 30
396396
397typedef struct map_file_t
397struct map_file_t
398398{
399399   UINT16 L[3], B[3];         /* actual registers */
400400   UINT32 limit[3], bias[3];   /* equivalent in a more convenient form */
401} map_file_t;
401};
402402
403struct _tms99xx_state
403struct tms99xx_state
404404{
405405/* "actual" tms9900 registers : */
406406   UINT16 WP;  /* Workspace pointer */
trunk/src/emu/cpu/tms9900/9900dasm.c
r17917r17918
7373   sd_11_15   = 0x200      /* bits 11-15 should be cleared in lwpi, limi, idle, rset, rtwp, ckon, ckof, lrex */
7474};
7575
76typedef struct description_t
76struct description_t
7777{
7878   const char *mnemonic;
7979   format_t format;
8080   int flags;
81} description_t;
81};
8282
8383
8484enum opcodes {
trunk/src/emu/cpu/tms9900/tms9900l.h
r17917r17918
6161    structure with the parameters ti990_10_reset wants.
6262*/
6363
64typedef struct ti990_10reset_param
64struct ti990_10reset_param
6565{
6666   ti99xx_idle_func   idle_callback;
6767   ti99xx_rset_func   rset_callback;
6868   ti99xx_lrex_func   lrex_callback;
6969   ti99xx_ckon_ckof_func   ckon_ckof_callback;
7070   ti99xx_error_interrupt_func   error_interrupt_callback;
71} ti990_10reset_param;
71};
7272
7373/* accessor for the internal ROM */
7474extern READ16_HANDLER(ti990_10_internal_r);
r17917r17918
8787/*
8888    structure with optional parameters for tms9900_reset.
8989*/
90typedef struct tms9900reset_param
90struct tms9900reset_param
9191{
9292   ti99xx_idle_func   idle_callback;
93} tms9900reset_param;
93};
9494
9595
9696
r17917r17918
9999/*
100100    structure with optional parameters for tms9940_reset.
101101*/
102typedef struct tms9940reset_param
102struct tms9940reset_param
103103{
104104   ti99xx_idle_func   idle_callback;
105} tms9940reset_param;
105};
106106
107107
108108
r17917r17918
111111/*
112112    structure with optional parameters for tms9980a_reset.
113113*/
114typedef struct tms9980areset_param
114struct tms9980areset_param
115115{
116116   ti99xx_idle_func   idle_callback;
117} tms9980areset_param;
117};
118118
119119
120120
r17917r17918
123123/*//
124124    structure with optional parameters for tms9985_reset.
125125*/
126typedef struct tms9985reset_param
126struct tms9985reset_param
127127{
128128   ti99xx_idle_func   idle_callback;
129} tms9985reset_param;
129};
130130
131131
132132
r17917r17918
135135/*
136136    structure with optional parameters for tms9989_reset.
137137*/
138typedef struct tms9989reset_param
138struct tms9989reset_param
139139{
140140   ti99xx_idle_func   idle_callback;
141} tms9989reset_param;
141};
142142
143143
144144
r17917r17918
147147/*
148148  structure with the parameters tms9995_reset wants.
149149*/
150typedef struct tms9995reset_param
150struct tms9995reset_param
151151{
152152   /* auto_wait_state : a non-zero value makes tms9995 generate a wait state automatically on each
153153       memory access */
r17917r17918
159159        disabled.  This chip is used by the ti99/8 so that internal RAM does
160160        not prevent the mapper from working correctly. */
161161   int is_mp9537;
162} tms9995reset_param;
162};
163163
164164/* accessor for the first 252 bytes of internal RAM */
165165extern READ8_HANDLER(tms9995_internal1_r);
r17917r17918
175175/*
176176    structure with optional parameters for tms99000_reset.
177177*/
178typedef struct tms99000reset_param
178struct tms99000reset_param
179179{
180180   ti99xx_idle_func   idle_callback;
181} tms99000reset_param;
181};
182182
183183
184184
r17917r17918
187187/*
188188    structure with optional parameters for tms99105a_reset.
189189*/
190typedef struct tms99105areset_param
190struct tms99105areset_param
191191{
192192   ti99xx_idle_func   idle_callback;
193} tms99105areset_param;
193};
194194
195195
196196
r17917r17918
199199/*
200200    structure with optional parameters for tms99110a_reset.
201201*/
202typedef struct tms99110areset_param
202struct tms99110areset_param
203203{
204204   ti99xx_idle_func   idle_callback;
205} tms99110areset_param;
205};
206206
207207
208208unsigned Dasm9900 (char *buffer, unsigned pc, int model_id, const UINT8 *oprom, const UINT8 *opram);
trunk/src/emu/cpu/tms9900/tms9995.h
r17917r17918
6060    Configuration for the TMS9995. The connections are provided by the
6161    main board which contains the processor.
6262*/
63typedef struct _tms9995_config
63struct tms9995_config
6464{
6565   devcb_write8      external_callback;
6666   devcb_write_line   iaq_line;
r17917r17918
6969   devcb_write_line   holda_line;
7070   int               mode;
7171   int               overflow;
72} tms9995_config;
72};
7373
7474#define TMS9995_CONFIG(name) \
7575   const tms9995_config(name) =
r17917r17918
283283
284284   // ============== Prefetch support =====================
285285
286   typedef struct _decoded_instruction
286   struct decoded_instruction
287287   {
288288      UINT16         IR;
289289      UINT16        command;
290290      const UINT8*   program;
291291      bool         byteop;
292292      int            state;
293   } decoded_instruction;
293   };
294294
295295   int      m_instindex;
296296
r17917r17918
312312   typedef void (tms9995_device::*ophandler)(void);
313313
314314   // Opcode list entry
315   typedef struct _tms_instruction
315   struct tms_instruction
316316   {
317317      UINT16            opcode;
318318      int               id;
319319      int               format;
320320      microprogram      prog;      // Microprogram
321   } tms_instruction;
321   };
322322
323323   // Lookup table entry
324   typedef struct _lookup_entry
324   struct lookup_entry
325325   {
326      struct _lookup_entry *next_digit;
326      lookup_entry *next_digit;
327327      const tms_instruction *entry;
328   } lookup_entry;
328   };
329329
330330   // Pointer to the lookup table; the entry point for searching the command
331331   lookup_entry*   m_command_lookup_table;
trunk/src/emu/cpu/tms9900/tms9900.h
r17917r17918
109109   "*int"
110110};
111111
112typedef struct _tms99xx_config
112struct tms99xx_config
113113{
114114   devcb_write8      external_callback;
115115   devcb_read8         irq_level;
r17917r17918
117117   devcb_write_line   clock_out;
118118   devcb_write_line   wait_line;
119119   devcb_write_line   holda_line;
120} tms99xx_config;
120};
121121
122122#define TMS99xx_CONFIG(name) \
123123   const tms99xx_config(name) =
r17917r17918
270270   typedef void (tms99xx_device::*ophandler)(void);
271271
272272   // Opcode list entry
273   typedef struct _tms_instruction
273   struct tms_instruction
274274   {
275275      UINT16            opcode;
276276      int               id;
277277      int               format;
278278      microprogram      prog;      // Microprogram
279   } tms_instruction;
279   };
280280
281281   // Lookup table entry
282   typedef struct _lookup_entry
282   struct lookup_entry
283283   {
284      struct _lookup_entry *next_digit;
284      lookup_entry *next_digit;
285285      const tms_instruction *entry;
286   } lookup_entry;
286   };
287287
288288   // Pointer to the lookup table
289289   lookup_entry*   m_command_lookup_table;
trunk/src/emu/cpu/tms32025/tms32025.c
r17917r17918
137137
138138
139139
140typedef struct _tms32025_state tms32025_state;      /* Page 3-6 (45) shows all registers */
141struct _tms32025_state
142
140struct tms32025_state
143141{
144142   /******************** CPU Internal Registers *******************/
145143   UINT16   PREVPC;      /* previous program counter */
r17917r17918
198196   void   (*function)(tms32025_state *);
199197};
200198/* opcode table entry (Opcode CE has sub-opcodes) */
201typedef struct _tms32025_opcode_CE tms32025_opcode_CE;
202struct _tms32025_opcode_CE
199struct tms32025_opcode_CE
203200{
204201   UINT8   cycles;
205202   void   (*function)(tms32025_state *);
206203};
207204/* opcode table entry (Opcode Dx has sub-opcodes) */
208typedef struct _tms32025_opcode_Dx tms32025_opcode_Dx;
209struct _tms32025_opcode_Dx
205struct tms32025_opcode_Dx
210206{
211207   UINT8   cycles;
212208   void   (*function)(tms32025_state *);
trunk/src/emu/cpu/tms32025/32025dsm.c
r17917r17918
316316
317317#define MAX_OPS (((sizeof(TMS32025Formats) / sizeof(TMS32025Formats[0])) - 1) / PTRS_PER_FORMAT)
318318
319typedef struct opcode {
319struct TMS32025Opcode {
320320   word mask;         /* instruction mask */
321321   word bits;         /* constant bits */
322322   word extcode;      /* value that gets extension code */
323323   const char *parse;   /* how to parse bits */
324324   const char *fmt;   /* instruction format */
325} TMS32025Opcode;
325};
326326
327327static TMS32025Opcode Op[MAX_OPS+1];
328328static int OpInizialized = 0;
trunk/src/emu/cpu/pic16c5x/16c5xdsm.c
r17917r17918
8686
8787#define MAX_OPS (((sizeof(PIC16C5xFormats) / sizeof(PIC16C5xFormats[0])) - 1) / PTRS_PER_FORMAT)
8888
89typedef struct opcode {
89struct PIC16C5xOpcode {
9090   word mask;         /* instruction mask */
9191   word bits;         /* constant bits */
9292   word extcode;      /* value that gets extension code */
9393   const char *parse;   /* how to parse bits */
9494   const char *fmt;   /* instruction format */
95} PIC16C5xOpcode;
95};
9696
9797static PIC16C5xOpcode Op[MAX_OPS+1];
9898static int OpInizialized = 0;
trunk/src/emu/cpu/saturn/saturnds.c
r17917r17918
552552
553553};
554554
555enum _opcode_sel
555enum opcode_sel
556556{
557557   Complete=-1,
558558   Illegal,
r17917r17918
570570   OpcodeE,
571571   OpcodeF
572572};
573typedef enum _opcode_sel opcode_sel;
574573
575enum _opcode_adr
574enum opcode_adr
576575{
577576   AdrNone,
578577   AdrAF, AdrA, AdrB, AdrCount,
r17917r17918
584583   FieldP, FieldWP, FieldXS, FieldX, FieldS, FieldM, FieldB, FieldW, FieldA,
585584   AdrImmCount
586585};
587typedef enum _opcode_adr opcode_adr;
588586
589587struct OPCODE
590588{
trunk/src/emu/video/vooddefs.h
r17917r17918
13931393 *
13941394 *************************************/
13951395
1396typedef struct _voodoo_state voodoo_state;
1397typedef struct poly_extra_data poly_extra_data;
1396struct voodoo_state;
1397struct poly_extra_data;
13981398
13991399
14001400struct rgba
r17917r17918
14071407};
14081408
14091409
1410typedef union _voodoo_reg voodoo_reg;
1411union _voodoo_reg
1410union voodoo_reg
14121411{
14131412   INT32            i;
14141413   UINT32            u;
r17917r17918
17221721};
17231722
17241723
1725/* typedef struct _voodoo_state voodoo_state; -- declared above */
1726struct _voodoo_state
1724struct voodoo_state
17271725{
17281726   UINT8            index;               /* index of board */
17291727   device_t *device;            /* pointer to our containing device */
trunk/src/emu/video/poly.c
r17917r17918
4141***************************************************************************/
4242
4343/* forward definitions */
44typedef struct _polygon_info polygon_info;
44struct polygon_info;
4545
4646
4747/* tri_extent describes start/end points for a scanline */
r17917r17918
112112
113113
114114/* work_unit is a union of the two types */
115typedef union _work_unit work_unit;
116union _work_unit
115union work_unit
117116{
118117   work_unit_shared   shared;               /* shared data */
119118   tri_work_unit      tri;               /* triangle work unit */
r17917r17918
122121
123122
124123/* polygon_info describes a single polygon, which includes the poly_params */
125struct _polygon_info
124struct polygon_info
126125{
127126   poly_manager *      poly;               /* pointer back to the poly manager */
128127   void *            dest;               /* pointer to the destination we are rendering to */
r17917r17918
137136
138137
139138/* full poly manager description */
140struct _poly_manager
139struct poly_manager
141140{
142141   /* queue management */
143142   osd_work_queue *   queue;               /* work queue */
trunk/src/emu/video/poly.h
r17917r17918
5555***************************************************************************/
5656
5757/* opaque reference to the poly manager */
58typedef struct _poly_manager poly_manager;
58struct poly_manager;
5959
6060
6161/* input vertex data */
trunk/src/emu/video/huc6270.h
r17917r17918
1111#include "machine/devhelpr.h"
1212
1313
14enum _huc6270_v_state {
14enum huc6270_v_state {
1515   HUC6270_VSW,
1616   HUC6270_VDS,
1717   HUC6270_VDW,
1818   HUC6270_VCR
1919};
20typedef enum _huc6270_v_state huc6270_v_state;
2120
22enum _huc6270_h_state {
21enum huc6270_h_state {
2322   HUC6270_HDS,
2423   HUC6270_HDW,
2524   HUC6270_HDE,
2625   HUC6270_HSW
2726};
28typedef enum _huc6270_h_state huc6270_h_state;
2927
3028
3129#define MCFG_HUC6270_ADD( _tag, _intrf )   \
trunk/src/emu/uimenu.h
r17917r17918
3838#define UI_MENU_PROCESS_CUSTOM_ONLY   4
3939
4040/* options for ui_menu_reset */
41enum _ui_menu_reset_options
41enum ui_menu_reset_options
4242{
4343   UI_MENU_RESET_SELECT_FIRST,
4444   UI_MENU_RESET_REMEMBER_POSITION,
4545   UI_MENU_RESET_REMEMBER_REF
4646};
47typedef enum _ui_menu_reset_options ui_menu_reset_options;
4847
4948
5049
trunk/src/emu/video.h
r17917r17918
6464// forward references
6565class render_target;
6666class screen_device;
67typedef struct _avi_file avi_file;
67struct avi_file;
6868
6969
7070
trunk/src/emu/hashfile.c
r17917r17918
2424   const char *extrainfo;
2525};
2626
27typedef struct _hash_file hash_file;
27struct hash_file;
2828
2929typedef void (*hashfile_error_func)(const char *message);
3030
r17917r17918
4747    TYPE DEFINITIONS
4848***************************************************************************/
4949
50struct _hash_file
50struct hash_file
5151{
5252   emu_file *file;
5353   object_pool *pool;
trunk/src/emu/sound/aicadsp.c
r17917r17918
5353   return uval;
5454}
5555
56void aica_dsp_init(struct _AICADSP *DSP)
56void aica_dsp_init(AICADSP *DSP)
5757{
58   memset(DSP,0,sizeof(struct _AICADSP));
58   memset(DSP,0,sizeof(AICADSP));
5959   DSP->RBL=0x8000;
6060   DSP->Stopped=1;
6161}
6262
63void aica_dsp_step(struct _AICADSP *DSP)
63void aica_dsp_step(AICADSP *DSP)
6464{
6565   INT32 ACC=0;   //26 bit
6666   INT32 SHIFTED=0;   //24 bit
r17917r17918
326326//      fclose(f);
327327}
328328
329void aica_dsp_setsample(struct _AICADSP *DSP,INT32 sample,int SEL,int MXL)
329void aica_dsp_setsample(AICADSP *DSP,INT32 sample,int SEL,int MXL)
330330{
331331   //DSP->MIXS[SEL]+=sample<<(MXL+1)/*7*/;
332332   DSP->MIXS[SEL]+=sample;
r17917r17918
334334//      int a=1;
335335}
336336
337void aica_dsp_start(struct _AICADSP *DSP)
337void aica_dsp_start(AICADSP *DSP)
338338{
339339   int i;
340340   DSP->Stopped=0;
trunk/src/emu/sound/aicadsp.h
r17917r17918
44#define __AICADSP_H__
55
66//the DSP Context
7struct _AICADSP
7struct AICADSP
88{
99//Config
1010   UINT16 *AICARAM;
r17917r17918
3232   int LastStep;
3333};
3434
35void aica_dsp_init(struct _AICADSP *DSP);
36void aica_dsp_setsample(struct _AICADSP *DSP, INT32 sample, INT32 SEL, INT32 MXL);
37void aica_dsp_step(struct _AICADSP *DSP);
38void aica_dsp_start(struct _AICADSP *DSP);
35void aica_dsp_init(AICADSP *DSP);
36void aica_dsp_setsample(AICADSP *DSP, INT32 sample, INT32 SEL, INT32 MXL);
37void aica_dsp_step(AICADSP *DSP);
38void aica_dsp_start(AICADSP *DSP);
3939
4040#endif /* __AICADSP_H__ */
trunk/src/emu/sound/scsplfo.c
r17917r17918
1010
1111#define LFO_SHIFT   8
1212
13struct _LFO
13struct LFO_t
1414{
1515    unsigned short phase;
1616    UINT32 phase_step;
r17917r17918
107107   }
108108}
109109
110INLINE signed int PLFO_Step(struct _LFO *LFO)
110INLINE signed int PLFO_Step(LFO_t *LFO)
111111{
112112   int p;
113113    LFO->phase+=LFO->phase_step;
r17917r17918
119119   return p<<(SHIFT-LFO_SHIFT);
120120}
121121
122INLINE signed int ALFO_Step(struct _LFO *LFO)
122INLINE signed int ALFO_Step(LFO_t *LFO)
123123{
124124   int p;
125125    LFO->phase+=LFO->phase_step;
r17917r17918
131131   return p<<(SHIFT-LFO_SHIFT);
132132}
133133
134static void LFO_ComputeStep(struct _LFO *LFO,UINT32 LFOF,UINT32 LFOWS,UINT32 LFOS,int ALFO)
134static void LFO_ComputeStep(LFO_t *LFO,UINT32 LFOF,UINT32 LFOWS,UINT32 LFOS,int ALFO)
135135{
136136    float step=(float) LFOFreq[LFOF]*256.0/(float)44100;
137137    LFO->phase_step=(unsigned int) ((float) (1<<LFO_SHIFT)*step);
trunk/src/emu/sound/nes_defs.h
r17917r17918
4848#define QUEUE_SIZE 0x2000
4949#define QUEUE_MAX  (QUEUE_SIZE-1)
5050
51typedef struct queue_s
51struct queue_t
5252{
5353   int pos;
5454   unsigned char reg,val;
55} queue_t;
55};
5656
5757#endif
5858
r17917r17918
8484/* CHANNEL TYPE DEFINITIONS */
8585
8686/* Square Wave */
87typedef struct square_s
87struct square_t
8888{
8989   uint8 regs[4];
9090   int vbl_length;
r17917r17918
9696   uint8 adder;
9797   uint8 env_vol;
9898   boolean enabled;
99} square_t;
99};
100100
101101/* Triangle Wave */
102typedef struct triangle_s
102struct triangle_t
103103{
104104   uint8 regs[4]; /* regs[1] unused */
105105   int linear_length;
r17917r17918
110110   uint8 adder;
111111   boolean counter_started;
112112   boolean enabled;
113} triangle_t;
113};
114114
115115/* Noise Wave */
116typedef struct noise_s
116struct noise_t
117117{
118118   uint8 regs[4]; /* regs[1] unused */
119119   int cur_pos;
r17917r17918
123123   float env_phase;
124124   uint8 env_vol;
125125   boolean enabled;
126} noise_t;
126};
127127
128128/* DPCM Wave */
129typedef struct dpcm_s
129struct dpcm_t
130130{
131131   uint8 regs[4];
132132   uint32 address;
r17917r17918
139139   boolean irq_occurred;
140140   address_space *memory;
141141   signed char vol;
142} dpcm_t;
142};
143143
144144/* APU type */
145typedef struct apu
145struct apu_t
146146{
147147   /* Sound channels */
148148   square_t   squ[2];
r17917r17918
169169#endif
170170
171171   int step_mode;
172} apu_t;
172};
173173
174174/* CONSTANTS */
175175
trunk/src/emu/sound/sidvoice.h
r17917r17918
2121#endif
2222};
2323
24struct __SID6581;
24struct SID6581_t;
2525
26typedef struct _sidOperator
26struct sidOperator
2727{
28   struct __SID6581 *sid;
28   SID6581_t *sid;
2929   UINT8 reg[7];
3030   UINT32 SIDfreq;
3131   UINT16 SIDpulseWidth;
3232   UINT8 SIDctrl;
3333   UINT8 SIDAD, SIDSR;
3434
35   struct _sidOperator* carrier;
36   struct _sidOperator* modulator;
35   sidOperator* carrier;
36   sidOperator* modulator;
3737   int sync;
3838
3939   UINT16 pulseIndex, newPulseIndex;
r17917r17918
5555   UINT16 cycleLen, cycleLenPnt;
5656#endif
5757
58   INT8(*outProc)(struct _sidOperator *);
59   void(*waveProc)(struct _sidOperator *);
58   INT8(*outProc)(sidOperator *);
59   void(*waveProc)(sidOperator *);
6060
6161#if defined(DIRECT_FIXPOINT)
6262   cpuLword waveStep, waveStepAdd;
r17917r17918
8080
8181   UINT8 ADSRctrl;
8282//  int gateOnCtrl, gateOffCtrl;
83   UINT16 (*ADSRproc)(struct _sidOperator *);
83   UINT16 (*ADSRproc)(sidOperator *);
8484
8585#ifdef SID_FPUENVE
8686   float fenveStep, fenveStepAdd;
r17917r17918
9393#endif
9494   UINT8 enveVol, enveSusVol;
9595   UINT16 enveShortAttackCount;
96} sidOperator;
96};
9797
9898typedef INT8 (*ptr2sidFunc)(sidOperator *);
9999typedef UINT16 (*ptr2sidUwordFunc)(sidOperator *);
trunk/src/emu/sound/scspdsp.c
r17917r17918
5353   return uval;
5454}
5555
56void SCSPDSP_Init(struct _SCSPDSP *DSP)
56void SCSPDSP_Init(SCSPDSP *DSP)
5757{
58   memset(DSP,0,sizeof(struct _SCSPDSP));
58   memset(DSP,0,sizeof(SCSPDSP));
5959   DSP->RBL=0x8000;
6060   DSP->Stopped=1;
6161}
6262
63void SCSPDSP_Step(struct _SCSPDSP *DSP)
63void SCSPDSP_Step(SCSPDSP *DSP)
6464{
6565   INT32 ACC=0;   //26 bit
6666   INT32 SHIFTED=0;   //24 bit
r17917r17918
330330//      fclose(f);
331331}
332332
333void SCSPDSP_SetSample(struct _SCSPDSP *DSP,INT32 sample,int SEL,int MXL)
333void SCSPDSP_SetSample(SCSPDSP *DSP,INT32 sample,int SEL,int MXL)
334334{
335335   //DSP->MIXS[SEL]+=sample<<(MXL+1)/*7*/;
336336   DSP->MIXS[SEL]+=sample;
r17917r17918
338338//      int a=1;
339339}
340340
341void SCSPDSP_Start(struct _SCSPDSP *DSP)
341void SCSPDSP_Start(SCSPDSP *DSP)
342342{
343343   int i;
344344   DSP->Stopped=0;
trunk/src/emu/sound/scspdsp.h
r17917r17918
44#define __SCSPDSP_H__
55
66//the DSP Context
7struct _SCSPDSP
7struct SCSPDSP
88{
99//Config
1010   UINT16 *SCSPRAM;
r17917r17918
3232   int LastStep;
3333};
3434
35void SCSPDSP_Init(struct _SCSPDSP *DSP);
36void SCSPDSP_SetSample(struct _SCSPDSP *DSP, INT32 sample, INT32 SEL, INT32 MXL);
37void SCSPDSP_Step(struct _SCSPDSP *DSP);
38void SCSPDSP_Start(struct _SCSPDSP *DSP);
35void SCSPDSP_Init(SCSPDSP *DSP);
36void SCSPDSP_SetSample(SCSPDSP *DSP, INT32 sample, INT32 SEL, INT32 MXL);
37void SCSPDSP_Step(SCSPDSP *DSP);
38void SCSPDSP_Start(SCSPDSP *DSP);
3939
4040#endif /* __SCSPDSP_H__ */
trunk/src/emu/sound/aica.c
r17917r17918
8181               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};
8282static INT32 EG_TABLE[0x400];
8383
84enum _STATE {ATTACK,DECAY1,DECAY2,RELEASE};
85struct _EG
84enum STATE {ATTACK,DECAY1,DECAY2,RELEASE};
85struct EG_t
8686{
8787   int volume;   //
88   _STATE state;
88   STATE state;
8989   int step;
9090   //step vals
9191   int AR;      //Attack
r17917r17918
9797   UINT8 LPLINK;
9898};
9999
100struct _SLOT
100struct SLOT
101101{
102102   union
103103   {
r17917r17918
111111   UINT32 nxt_addr;   //next play address
112112   UINT32 step;      //pitch step (24.8)
113113   UINT8 Backwards;   //the wave is playing backwards
114   struct _EG EG;         //Envelope
115   struct _LFO PLFO;      //Phase LFO
116   struct _LFO ALFO;      //Amplitude LFO
114   EG_t EG;         //Envelope
115   LFO_t PLFO;      //Phase LFO
116   LFO_t ALFO;      //Amplitude LFO
117117   int slot;
118118   int cur_sample;       //current ADPCM sample
119119   int cur_quant;        //current ADPCM step
r17917r17918
155155#define SCITMA   6
156156#define SCITMB   7
157157
158typedef struct _AICA aica_state;
159struct _AICA
158struct aica_state
160159{
161160   union
162161   {
r17917r17918
165164   } udata;
166165   UINT16 IRQL, IRQR;
167166   UINT16 EFSPAN[0x48];
168   struct _SLOT Slots[64];
167   SLOT Slots[64];
169168   signed short RINGBUF[64];
170169   unsigned char BUFPTR;
171170   unsigned char *AICARAM;
r17917r17918
200199
201200   int ARTABLE[64], DRTABLE[64];
202201
203   struct _AICADSP DSP;
202   AICADSP DSP;
204203   device_t *device;
205204};
206205
r17917r17918
341340   return AICA->DRTABLE[Rate];
342341}
343342
344static void Compute_EG(aica_state *AICA,struct _SLOT *slot)
343static void Compute_EG(aica_state *AICA,SLOT *slot)
345344{
346345   int octave=(OCT(slot)^8)-8;
347346   int rate;
r17917r17918
358357   slot->EG.DL=0x1f-DL(slot);
359358}
360359
361static void AICA_StopSlot(struct _SLOT *slot,int keyoff);
360static void AICA_StopSlot(SLOT *slot,int keyoff);
362361
363static int EG_Update(struct _SLOT *slot)
362static int EG_Update(SLOT *slot)
364363{
365364   switch(slot->EG.state)
366365   {
r17917r17918
408407   return (slot->EG.volume>>EG_SHIFT)<<(SHIFT-10);
409408}
410409
411static UINT32 AICA_Step(struct _SLOT *slot)
410static UINT32 AICA_Step(SLOT *slot)
412411{
413412   int octave=(OCT(slot)^8)-8+SHIFT-10;
414413   UINT32 Fn=FNS(slot) + (0x400);
r17917r17918
420419}
421420
422421
423static void Compute_LFO(struct _SLOT *slot)
422static void Compute_LFO(SLOT *slot)
424423{
425424   if(PLFOS(slot)!=0)
426425      AICALFO_ComputeStep(&(slot->PLFO),LFOF(slot),PLFOWS(slot),PLFOS(slot),0);
r17917r17918
450449   return *PrevSignal;
451450}
452451
453static void AICA_StartSlot(aica_state *AICA, struct _SLOT *slot)
452static void AICA_StartSlot(aica_state *AICA, SLOT *slot)
454453{
455454   UINT64 start_offset;
456455
r17917r17918
480479   }
481480}
482481
483static void AICA_StopSlot(struct _SLOT *slot,int keyoff)
482static void AICA_StopSlot(SLOT *slot,int keyoff)
484483{
485484   if(keyoff /*&& slot->EG.state!=RELEASE*/)
486485   {
r17917r17918
628627
629628static void AICA_UpdateSlotReg(aica_state *AICA,int s,int r)
630629{
631   struct _SLOT *slot=AICA->Slots+s;
630   SLOT *slot=AICA->Slots+s;
632631   int sl;
633632   switch(r&0x7f)
634633   {
r17917r17918
638637         {
639638            for(sl=0;sl<64;++sl)
640639            {
641               struct _SLOT *s2=AICA->Slots+sl;
640               SLOT *s2=AICA->Slots+sl;
642641               {
643642                  if(KEYONB(s2) && s2->EG.state==RELEASE/*&& !s2->active*/)
644643                  {
r17917r17918
848847      case 0x11:
849848         {
850849            int slotnum = MSLC(AICA);
851            struct _SLOT *slot=AICA->Slots + slotnum;
850            SLOT *slot=AICA->Slots + slotnum;
852851            UINT16 LP = 0;
853852            if (!(AFSEL(AICA)))
854853            {
r17917r17918
877876      case 0x15:
878877         {
879878            int slotnum = MSLC(AICA);
880            struct _SLOT *slot=AICA->Slots+slotnum;
879            SLOT *slot=AICA->Slots+slotnum;
881880            unsigned int CA = 0;
882881
883882            if (PCMS(slot) == 0)   // 16-bit samples
r17917r17918
10361035}
10371036#endif
10381037
1039INLINE INT32 AICA_UpdateSlot(aica_state *AICA, struct _SLOT *slot)
1038INLINE INT32 AICA_UpdateSlot(aica_state *AICA, SLOT *slot)
10401039{
10411040   INT32 sample;
10421041   int step=slot->step;
r17917r17918
12111210      // mix slots' direct output
12121211      for(sl=0;sl<64;++sl)
12131212      {
1214         struct _SLOT *slot=AICA->Slots+sl;
1213         SLOT *slot=AICA->Slots+sl;
12151214         RBUFDST=AICA->RINGBUF+AICA->BUFPTR;
12161215         if(AICA->Slots[sl].active)
12171216         {
trunk/src/emu/sound/sn76496.h
r17917r17918
176176extern const device_type GAMEGEAR_NEW;
177177extern const device_type SEGAPSG_NEW;
178178
179typedef struct _sn76496_config
179struct sn76496_config
180180{
181181   devcb_write_line      ready;
182} sn76496_config;
182};
183183
184184class sn76496_base_device : public device_t, public device_sound_interface
185185{
trunk/src/emu/sound/sid.c
r17917r17918
5353}
5454
5555
56INLINE void syncEm(_SID6581 *This)
56INLINE void syncEm(SID6581_t *This)
5757{
5858   int sync1 = (This->optr1.modulator->cycleLenCount <= 0);
5959   int sync2 = (This->optr2.modulator->cycleLenCount <= 0);
r17917r17918
9696}
9797
9898
99void sidEmuFillBuffer(_SID6581 *This, stream_sample_t *buffer, UINT32 bufferLen )
99void sidEmuFillBuffer(SID6581_t *This, stream_sample_t *buffer, UINT32 bufferLen )
100100{
101//void* fill16bitMono( SID6581 *This, void* buffer, UINT32 numberOfSamples )
101//void* fill16bitMono( SID6581_t *This, void* buffer, UINT32 numberOfSamples )
102102
103103   for ( ; bufferLen > 0; bufferLen-- )
104104   {
r17917r17918
121121
122122/* Reset. */
123123
124int sidEmuReset(_SID6581 *This)
124int sidEmuReset(SID6581_t *This)
125125{
126126   sidClearOperator( &This->optr1 );
127127   enveEmuResetOperator( &This->optr1 );
r17917r17918
208208   filterResTable[15] = resDyMax;
209209}
210210
211void sid6581_init (_SID6581 *This)
211void sid6581_init (SID6581_t *This)
212212{
213213   This->optr1.sid=This;
214214   This->optr2.sid=This;
r17917r17918
245245   sidEmuReset(This);
246246}
247247
248void sid6581_port_w (_SID6581 *This, int offset, int data)
248void sid6581_port_w (SID6581_t *This, int offset, int data)
249249{
250250   offset &= 0x1f;
251251
r17917r17918
323323   }
324324}
325325
326int sid6581_port_r (running_machine &machine, _SID6581 *This, int offset)
326int sid6581_port_r (running_machine &machine, SID6581_t *This, int offset)
327327{
328328    int data;
329329/* SIDPLAY reads last written at a sid address value */
trunk/src/emu/sound/sid.h
r17917r17918
1212#include "sidvoice.h"
1313
1414/* private area */
15typedef struct __SID6581
15struct SID6581_t
1616{
1717    device_t *device;
1818    sound_stream *mixer_channel; // mame stream/ mixer channel
r17917r17918
5454
5555   sidOperator optr1, optr2, optr3;
5656    int optr3_outputmask;
57} _SID6581;
57};
5858
59void sid6581_init (_SID6581 *This);
59void sid6581_init (SID6581_t *This);
6060
61int sidEmuReset(_SID6581 *This);
61int sidEmuReset(SID6581_t *This);
6262
63int sid6581_port_r (running_machine &machine, _SID6581 *This, int offset);
64void sid6581_port_w (_SID6581 *This, int offset, int data);
63int sid6581_port_r (running_machine &machine, SID6581_t *This, int offset);
64void sid6581_port_w (SID6581_t *This, int offset, int data);
6565
66void sidEmuFillBuffer(_SID6581 *This, stream_sample_t *buffer, UINT32 bufferLen );
66void sidEmuFillBuffer(SID6581_t *This, stream_sample_t *buffer, UINT32 bufferLen );
6767
6868#endif /* __SID_H__ */
trunk/src/emu/sound/discrete.h
r17917r17918
41774177 *
41784178 *************************************/
41794179
4180typedef struct _discrete_sound_block discrete_block;
4180struct discrete_block;
41814181class discrete_node_base_factory;
41824182class discrete_task;
41834183class discrete_base_node;
r17917r17918
42024202 *
42034203 *************************************/
42044204
4205struct _discrete_sound_block
4205struct discrete_block
42064206{
42074207   int            node;                     /* Output node number */
42084208   discrete_node_base_factory   *factory;
trunk/src/emu/sound/scsp.c
r17917r17918
111111               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};
112112static INT32 EG_TABLE[0x400];
113113
114enum _STATE {ATTACK,DECAY1,DECAY2,RELEASE};
115struct _EG
114enum STATE {ATTACK,DECAY1,DECAY2,RELEASE};
115struct EG_t
116116{
117117   int volume;   //
118   _STATE state;
118   STATE state;
119119   int step;
120120   //step vals
121121   int AR;      //Attack
r17917r17918
128128   UINT8 LPLINK;
129129};
130130
131struct _SLOT
131struct SLOT
132132{
133133   union
134134   {
r17917r17918
141141   UINT32 cur_addr;   //current play address (24.8)
142142   UINT32 nxt_addr;   //next play address
143143   UINT32 step;      //pitch step (24.8)
144   struct _EG EG;         //Envelope
145   struct _LFO PLFO;      //Phase LFO
146   struct _LFO ALFO;      //Amplitude LFO
144   EG_t EG;         //Envelope
145   LFO_t PLFO;      //Phase LFO
146   LFO_t ALFO;      //Amplitude LFO
147147   int slot;
148148   signed short Prev;   //Previous sample (for interpolation)
149149};
r17917r17918
182182      UINT16 data[0x30/2];
183183      UINT8 datab[0x30];
184184   } udata;
185   struct _SLOT Slots[32];
185   SLOT Slots[32];
186186   signed short RINGBUF[128];
187187   unsigned char BUFPTR;
188188#if FM_DELAY
r17917r17918
224224
225225   int ARTABLE[64], DRTABLE[64];
226226
227   struct _SCSPDSP DSP;
227   SCSPDSP DSP;
228228   devcb_resolved_write_line main_irq;
229229
230230   device_t *device;
r17917r17918
389389   return scsp->DRTABLE[Rate];
390390}
391391
392static void Compute_EG(scsp_state *scsp,struct _SLOT *slot)
392static void Compute_EG(scsp_state *scsp,SLOT *slot)
393393{
394394   int octave=(OCT(slot)^8)-8;
395395   int rate;
r17917r17918
407407   slot->EG.EGHOLD=EGHOLD(slot);
408408}
409409
410static void SCSP_StopSlot(struct _SLOT *slot,int keyoff);
410static void SCSP_StopSlot(SLOT *slot,int keyoff);
411411
412static int EG_Update(struct _SLOT *slot)
412static int EG_Update(SLOT *slot)
413413{
414414   switch(slot->EG.state)
415415   {
r17917r17918
459459   return (slot->EG.volume>>EG_SHIFT)<<(SHIFT-10);
460460}
461461
462static UINT32 SCSP_Step(struct _SLOT *slot)
462static UINT32 SCSP_Step(SLOT *slot)
463463{
464464   int octave=(OCT(slot)^8)-8+SHIFT-10;
465465   UINT32 Fn=FNS(slot)+(1 << 10);
r17917r17918
476476}
477477
478478
479static void Compute_LFO(struct _SLOT *slot)
479static void Compute_LFO(SLOT *slot)
480480{
481481   if(PLFOS(slot)!=0)
482482      LFO_ComputeStep(&(slot->PLFO),LFOF(slot),PLFOWS(slot),PLFOS(slot),0);
r17917r17918
484484      LFO_ComputeStep(&(slot->ALFO),LFOF(slot),ALFOWS(slot),ALFOS(slot),1);
485485}
486486
487static void SCSP_StartSlot(scsp_state *scsp, struct _SLOT *slot)
487static void SCSP_StartSlot(scsp_state *scsp, SLOT *slot)
488488{
489489   UINT32 start_offset;
490490
r17917r17918
505505//  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));
506506}
507507
508static void SCSP_StopSlot(struct _SLOT *slot,int keyoff)
508static void SCSP_StopSlot(SLOT *slot,int keyoff)
509509{
510510   if(keyoff /*&& slot->EG.state!=RELEASE*/)
511511   {
r17917r17918
657657
658658static void SCSP_UpdateSlotReg(scsp_state *scsp,int s,int r)
659659{
660   struct _SLOT *slot=scsp->Slots+s;
660   SLOT *slot=scsp->Slots+s;
661661   int sl;
662662   switch(r&0x3f)
663663   {
r17917r17918
667667         {
668668            for(sl=0;sl<32;++sl)
669669            {
670               struct _SLOT *s2=scsp->Slots+sl;
670               SLOT *s2=scsp->Slots+sl;
671671               {
672672                  if(KEYONB(s2) && s2->EG.state==RELEASE/*&& !s2->active*/)
673673                  {
r17917r17918
863863            // MSLC     |  CA   |SGC|EG
864864            // f e d c b a 9 8 7 6 5 4 3 2 1 0
865865            unsigned char MSLC=(scsp->udata.data[0x8/2]>>11)&0x1f;
866            struct _SLOT *slot=scsp->Slots + MSLC;
866            SLOT *slot=scsp->Slots + MSLC;
867867            unsigned int SGC = (slot->EG.state) & 3;
868868            unsigned int CA = (slot->cur_addr>>(SHIFT+12)) & 0xf;
869869            unsigned int EG = (0x1f - (slot->EG.volume>>(EG_SHIFT+5))) & 0x1f;
r17917r17918
953953
954954#define REVSIGN(v) ((~v)+1)
955955
956INLINE INT32 SCSP_UpdateSlot(scsp_state *scsp, struct _SLOT *slot)
956INLINE INT32 SCSP_UpdateSlot(scsp_state *scsp, SLOT *slot)
957957{
958958   INT32 sample;
959959   int step=slot->step;
r17917r17918
11351135#endif
11361136         if(scsp->Slots[sl].active)
11371137         {
1138            struct _SLOT *slot=scsp->Slots+sl;
1138            SLOT *slot=scsp->Slots+sl;
11391139            unsigned short Enc;
11401140            signed int sample;
11411141
r17917r17918
11651165
11661166      for(i=0;i<16;++i)
11671167      {
1168         struct _SLOT *slot=scsp->Slots+i;
1168         SLOT *slot=scsp->Slots+i;
11691169         if(EFSDL(slot))
11701170         {
11711171            unsigned short Enc=((EFPAN(slot))<<0x8)|((EFSDL(slot))<<0xd);
trunk/src/emu/sound/wavwrite.c
r17917r17918
11#include "osdcore.h"
22#include "sound/wavwrite.h"
33
4struct _wav_file
4struct wav_file
55{
66   FILE *file;
77   UINT32 total_offs;
r17917r17918
1616   UINT16 align, temp16;
1717
1818   /* allocate memory for the wav struct */
19   wav = (wav_file *) osd_malloc(sizeof(struct _wav_file));
19   wav = (wav_file *) osd_malloc(sizeof(wav_file));
2020   if (!wav)
2121      return NULL;
2222
trunk/src/emu/sound/wavwrite.h
r17917r17918
33#ifndef __WAVWRITE_H__
44#define __WAVWRITE_H__
55
6typedef struct _wav_file wav_file;
6struct wav_file;
77
88wav_file *wav_open(const char *filename, int sample_rate, int channels);
99void wav_close(wav_file*wavptr);
trunk/src/emu/sound/ymf278b.c
r17917r17918
7171#define VERBOSE 0
7272#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
7373
74struct YMF278BChip;
75
7476struct YMF278BSlot
7577{
7678   INT16 wave;      /* wavetable number */
r17917r17918
110112   INT8 env_preverb;
111113
112114   int num;      /* slot number (for debug only) */
113   struct _YMF278BChip *chip;   /* pointer back to parent chip */
115   YMF278BChip *chip;   /* pointer back to parent chip */
114116};
115117
116typedef struct _YMF278BChip
118struct YMF278BChip
117119{
118120   UINT8 pcmregs[256];
119121   YMF278BSlot slots[24];
r17917r17918
151153   INT32 mix_level[8];
152154
153155   sound_stream * stream;
154} YMF278BChip;
156};
155157
156158INLINE YMF278BChip *get_safe_token(device_t *device)
157159{
trunk/src/emu/sound/sid6581.c
r17917r17918
1212
1313
1414
15static _SID6581 *get_sid(device_t *device)
15static SID6581_t *get_sid(device_t *device)
1616{
1717   assert(device != NULL);
1818   assert((device->type() == SID6581) || (device->type() == SID8580));
19   return (_SID6581 *) downcast<sid6581_device *>(device)->token();
19   return (SID6581_t *) downcast<sid6581_device *>(device)->token();
2020}
2121
2222
2323
2424static STREAM_UPDATE( sid_update )
2525{
26   _SID6581 *sid = (_SID6581 *) param;
26   SID6581_t *sid = (SID6581_t *) param;
2727   sidEmuFillBuffer(sid, outputs[0], samples);
2828}
2929
r17917r17918
3131
3232static void sid_start(device_t *device, SIDTYPE sidtype)
3333{
34   _SID6581 *sid = get_sid(device);
34   SID6581_t *sid = get_sid(device);
3535   const sid6581_interface *iface = (const sid6581_interface*) device->static_config();
3636   assert(iface);
3737   
r17917r17918
5353
5454static DEVICE_RESET( sid )
5555{
56   _SID6581 *sid = get_sid(device);
56   SID6581_t *sid = get_sid(device);
5757   sidEmuReset(sid);
5858}
5959
r17917r17918
9090   : device_t(mconfig, SID6581, "SID6581", tag, owner, clock),
9191     device_sound_interface(mconfig, *this)
9292{
93   m_token = global_alloc_array_clear(UINT8, sizeof(_SID6581));
93   m_token = global_alloc_array_clear(UINT8, sizeof(SID6581));
9494}
9595sid6581_device::sid6581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
9696   : device_t(mconfig, type, name, tag, owner, clock),
9797     device_sound_interface(mconfig, *this)
9898{
99   m_token = global_alloc_array_clear(UINT8, sizeof(_SID6581));
99   m_token = global_alloc_array_clear(UINT8, sizeof(SID6581));
100100}
101101
102102//-------------------------------------------------
trunk/src/emu/sound/disc_wav.h
r17917r17918
103103   DISCRETE_CLASS_CONSTRUCTOR(dss_inverter_osc, base)
104104   DISCRETE_CLASS_DESTRUCTOR(dss_inverter_osc)
105105public:
106   typedef struct
106   struct description
107107   {
108108      double   vB;
109109      double   vOutLow;
r17917r17918
112112      double   vInRise;   // voltage that triggers the gate input to go high (vGate) on rise
113113      double   clamp;      // voltage is clamped to -clamp ... vb+clamp if clamp>= 0;
114114      int      options;   // bitmaped options
115   } description;
115   };
116116   enum {
117117      IS_TYPE1 = 0x00,
118118      IS_TYPE2 = 0x01,
trunk/src/emu/sound/multipcm.c
r17917r17918
3737//????
3838#define MULTIPCM_CLOCKDIV      (180.0)
3939
40struct _Sample
40struct Sample_t
4141{
4242   unsigned int Start;
4343   unsigned int Loop;
r17917r17918
4848   unsigned char AM;
4949};
5050
51enum _STATE {ATTACK,DECAY1,DECAY2,RELEASE};
52ALLOW_SAVE_TYPE(_STATE); // allow save_item on a non-fundamental type
53struct _EG
51enum STATE {ATTACK,DECAY1,DECAY2,RELEASE};
52ALLOW_SAVE_TYPE(STATE); // allow save_item on a non-fundamental type
53struct EG_t
5454{
5555   int volume;   //
56   _STATE state;
56   STATE state;
5757   int step;
5858   //step vals
5959   int AR;      //Attack
r17917r17918
6363   int DL;      //Decay level
6464};
6565
66struct _LFO
66struct LFO_t
6767{
6868   unsigned short phase;
6969   UINT32 phase_step;
r17917r17918
7272};
7373
7474
75struct _SLOT
75struct SLOT
7676{
7777   unsigned char Num;
7878   unsigned char Regs[8];
7979   int Playing;
80   struct _Sample *Sample;
80   Sample_t *Sample;
8181   unsigned int Base;
8282   unsigned int offset;
8383   unsigned int step;
r17917r17918
8585   unsigned int DstTL;
8686   int TLStep;
8787   signed int Prev;
88   struct _EG EG;
89   struct _LFO PLFO;   //Phase lfo
90   struct _LFO ALFO;   //AM lfo
88   EG_t EG;
89   LFO_t PLFO;   //Phase lfo
90   LFO_t ALFO;   //AM lfo
9191};
9292
93typedef struct _MultiPCM MultiPCM;
94struct _MultiPCM
93struct MultiPCM
9594{
9695   sound_stream * stream;
97   struct _Sample Samples[0x200];      //Max 512 samples
98   struct _SLOT Slots[28];
96   Sample_t Samples[0x200];      //Max 512 samples
97   SLOT Slots[28];
9998   unsigned int CurSlot;
10099   unsigned int Address;
101100   unsigned int BankR,BankL;
r17917r17918
150149
151150#define EG_SHIFT   16
152151
153static int EG_Update(struct _SLOT *slot)
152static int EG_Update(SLOT *slot)
154153{
155154   switch(slot->EG.state)
156155   {
r17917r17918
202201   return Steps[r];
203202}
204203
205static void EG_Calc(MultiPCM *ptChip,struct _SLOT *slot)
204static void EG_Calc(MultiPCM *ptChip,SLOT *slot)
206205{
207206   int octave=((slot->Regs[3]>>4)-1)&0xf;
208207   int rate;
r17917r17918
284283   }
285284}
286285
287INLINE signed int PLFO_Step(struct _LFO *LFO)
286INLINE signed int PLFO_Step(LFO_t *LFO)
288287{
289288   int p;
290289   LFO->phase+=LFO->phase_step;
r17917r17918
293292   return p<<(SHIFT-LFO_SHIFT);
294293}
295294
296INLINE signed int ALFO_Step(struct _LFO *LFO)
295INLINE signed int ALFO_Step(LFO_t *LFO)
297296{
298297   int p;
299298   LFO->phase+=LFO->phase_step;
r17917r17918
302301   return p<<(SHIFT-LFO_SHIFT);
303302}
304303
305static void LFO_ComputeStep(MultiPCM *ptChip,struct _LFO *LFO,UINT32 LFOF,UINT32 LFOS,int ALFO)
304static void LFO_ComputeStep(MultiPCM *ptChip,LFO_t *LFO,UINT32 LFOF,UINT32 LFOS,int ALFO)
306305{
307306   float step=(float) LFOFreq[LFOF]*256.0/(float) ptChip->Rate;
308307   LFO->phase_step=(unsigned int) ((float) (1<<LFO_SHIFT)*step);
r17917r17918
320319
321320
322321
323static void WriteSlot(MultiPCM *ptChip,struct _SLOT *slot,int reg,unsigned char data)
322static void WriteSlot(MultiPCM *ptChip,SLOT *slot,int reg,unsigned char data)
324323{
325324   slot->Regs[reg]=data;
326325
r17917r17918
333332         //according to YMF278 sample write causes some base params written to the regs (envelope+lfos)
334333         //the game should never change the sample while playing.
335334         {
336            struct _Sample *Sample=ptChip->Samples+slot->Regs[1];
335            Sample_t *Sample=ptChip->Samples+slot->Regs[1];
337336            WriteSlot(ptChip,slot,6,Sample->LFOVIB);
338337            WriteSlot(ptChip,slot,7,Sample->AM);
339338         }
r17917r17918
441440      signed int smpr=0;
442441      for(sl=0;sl<28;++sl)
443442      {
444         struct _SLOT *slot=ptChip->Slots+sl;
443         SLOT *slot=ptChip->Slots+sl;
445444         if(slot->Playing)
446445         {
447446            unsigned int vol=(slot->TL>>SHIFT)|(slot->Pan<<7);
trunk/src/emu/sound/aicalfo.c
r17917r17918
99
1010#define LFO_SHIFT   8
1111
12struct _LFO
12struct LFO_t
1313{
1414    unsigned short phase;
1515    UINT32 phase_step;
r17917r17918
103103   }
104104}
105105
106INLINE signed int AICAPLFO_Step(struct _LFO *LFO)
106INLINE signed int AICAPLFO_Step(LFO_t *LFO)
107107{
108108   int p;
109109
r17917r17918
116116   return p<<(SHIFT-LFO_SHIFT);
117117}
118118
119INLINE signed int AICAALFO_Step(struct _LFO *LFO)
119INLINE signed int AICAALFO_Step(LFO_t *LFO)
120120{
121121   int p;
122122    LFO->phase+=LFO->phase_step;
r17917r17918
128128   return p<<(SHIFT-LFO_SHIFT);
129129}
130130
131static void AICALFO_ComputeStep(struct _LFO *LFO,UINT32 LFOF,UINT32 LFOWS,UINT32 LFOS,int ALFO)
131static void AICALFO_ComputeStep(LFO_t *LFO,UINT32 LFOF,UINT32 LFOWS,UINT32 LFOS,int ALFO)
132132{
133133    float step=(float) LFOFreq[LFOF]*256.0/(float)44100.0;
134134    LFO->phase_step=(unsigned int) ((float) (1<<LFO_SHIFT)*step);
trunk/src/emu/sound/k007232.c
r17917r17918
3030#define  KDAC_A_PCM_MAX    (2)      /* Channels per chip */
3131
3232
33typedef struct kdacApcm
33struct KDAC_A_PCM
3434{
3535   UINT8         vol[KDAC_A_PCM_MAX][2];   /* volume for the left and right channel */
3636   UINT32         addr[KDAC_A_PCM_MAX];
r17917r17918
4848   sound_stream *   stream;
4949   const k007232_interface *intf;
5050   UINT32         fncode[0x200];
51} KDAC_A_PCM;
51};
5252
5353
5454#define   BASE_SHIFT    (12)
trunk/src/emu/sound/tms5220.h
r17917r17918
121121extern const device_type TMS5200N;
122122
123123
124typedef struct _tms52xx_config
124struct tms52xx_config
125125{
126126   devcb_write_line      irq_func;               // IRQ callback function, active low, i.e. state=0  (TODO: change to ASSERT/CLEAR)
127127   devcb_write_line      readyq_func;            // Ready callback function, active low, i.e. state=0
r17917r17918
130130   devcb_write8         load_address;            // speech ROM load address callback
131131   devcb_write8         read_and_branch;         // speech ROM read and branch callback
132132
133} tms52xx_config;
133};
134134
135135// Change back from 5220n to 5220 when all client drivers will be converted
136136class tms52xx_device : public device_t, public device_sound_interface
trunk/src/emu/sound/ymdeltat.h
r17917r17918
1313
1414
1515/* DELTA-T (adpcm type B) struct */
16typedef struct deltat_adpcm_state {     /* AT: rearranged and tigntened structure */
16struct YM_DELTAT {     /* AT: rearranged and tigntened structure */
1717   UINT8   *memory;
1818   INT32   *output_pointer;/* pointer of output pointers   */
1919   INT32   *pan;         /* pan : &output_pointer[pan]   */
r17917r17918
6969
7070   UINT8   reg[16];      /* adpcm registers      */
7171   UINT8   emulation_mode;   /* which chip we're emulating */
72}YM_DELTAT;
72};
7373
7474/*void YM_DELTAT_BRDY_callback(YM_DELTAT *DELTAT);*/
7575
trunk/src/emu/emupal.c
r17917r17918
3939};
4040
4141
42/* typedef struct _palette_private palette_private; */
4342struct palette_private
4443{
4544   bitmap_format      format;            /* format assumed for palette data */
r17917r17918
5756};
5857
5958
60/* typedef struct _colortable_t colortable_t; */
6159class colortable_t
6260{
6361public:
trunk/src/emu/imagedev/cassette.h
r17917r17918
1313#include "formats/cassimg.h"
1414
1515
16enum _cassette_state
16enum cassette_state
1717{
1818   /* this part of the state is controlled by the UI */
1919   CASSETTE_STOPPED         = 0,
r17917r17918
3333   CASSETTE_MASK_DRVSTATE      = 12
3434};
3535
36typedef enum _cassette_state cassette_state;
3736
38
3937/***************************************************************************
4038    TYPE DEFINITIONS
4139***************************************************************************/
trunk/src/emu/machine/tms9901.h
r17917r17918
5050    CLASS DEFINITION
5151***************************************************************************/
5252
53typedef struct _tms9901_interface
53struct tms9901_interface
5454{
5555   int             interrupt_mask;         // a bit for each input pin whose state is always notified to the TMS9901 core
5656   devcb_read8       read_handler;         // 4*8 bits, to be selected using the offset (0-3)
5757   devcb_write_line   write_handler[16];      // 16 Pn outputs
5858   devcb_write8      interrupt_callback;    // called when interrupt bus state changes
59} tms9901_interface;
59};
6060
6161class tms9901_device : public device_t
6262{
trunk/src/emu/machine/pic8259.c
r17917r17918
2929   STATE_READY
3030};
3131
32typedef struct pic8259   pic8259_t;
33
34struct pic8259
32struct pic8259_t
3533{
3634   devcb_resolved_write_line out_int_func;
3735
trunk/src/emu/machine/tms9902.h
r17917r17918
4242
4343extern const device_type TMS9902;
4444
45typedef struct _tms9902_interface
45struct tms9902_interface
4646{
4747   devcb_write_line   int_callback;
4848   devcb_write_line   rcv_callback;
4949   devcb_write8      xmit_callback;
5050   devcb_write8      ctrl_callback;
51} tms9902_interface;
51};
5252
5353class tms9902_device : public device_t
5454{
trunk/src/emu/machine/74181.c
r17917r17918
1616
1717
1818
19typedef struct _TTL74181_state TTL74181_state;
20struct _TTL74181_state
19struct TTL74181_state
2120{
2221   UINT8 inputs[TTL74181_INPUT_TOTAL];
2322   UINT8 outputs[TTL74181_OUTPUT_TOTAL];
trunk/src/emu/machine/scsicb.h
r17917r17918
2323   MCFG_DEVICE_CONFIG(_intf)
2424
2525
26typedef struct _SCSICB_interface SCSICB_interface;
27struct _SCSICB_interface
26struct SCSICB_interface
2827{
2928   void (*line_change_cb)(device_t *, UINT8 line, UINT8 state);
3029
trunk/src/emu/sound.h
r17917r17918
6060//**************************************************************************
6161
6262// forward references
63typedef struct _wav_file wav_file;
63struct wav_file;
6464
6565
6666// structure describing an indexed mixer
trunk/src/mess/tools/imgtool/stream.h
r17917r17918
1212#include "imgterrs.h"
1313#include "corefile.h"
1414
15typedef struct _imgtool_stream imgtool_stream;
15struct imgtool_stream;
1616
1717imgtool_stream *stream_open(const char *fname, int read_or_write);   /* similar params to mame_fopen */
1818imgtool_stream *stream_open_write_stream(int filesize);
trunk/src/mess/tools/imgtool/library.c
r17917r17918
1212#include "library.h"
1313#include "pool.h"
1414
15struct _imgtool_library
15struct imgtool_library
1616{
1717   object_pool *pool;
1818   imgtool_module *first;
r17917r17918
3232      goto error;
3333
3434   /* allocate the main structure */
35   library = (imgtool_library *)pool_malloc_lib(pool, sizeof(struct _imgtool_library));
35   library = (imgtool_library *)pool_malloc_lib(pool, sizeof(imgtool_library));
3636   if (!library)
3737      goto error;
3838
trunk/src/mess/tools/imgtool/library.h
r17917r17918
2525#include "charconv.h"
2626
2727
28typedef struct _imgtool_image imgtool_image;
29typedef struct _imgtool_partition imgtool_partition;
30typedef struct _imgtool_directory imgtool_directory;
31typedef struct _imgtool_library imgtool_library;
28struct imgtool_image;
29struct imgtool_partition;
30struct imgtool_directory;
31struct imgtool_library;
3232
3333enum imgtool_suggestion_viability_t
3434{
r17917r17918
228228
229229
230230union imgtoolinfo;
231typedef struct _imgtool_class imgtool_class;
232231
232struct imgtool_class;
233233typedef void (*imgtool_get_info)(const imgtool_class *, UINT32, union imgtoolinfo *);
234234
235struct _imgtool_class
235struct imgtool_class
236236{
237237   imgtool_get_info get_info;
238238   imgtool_get_info derived_get_info;
trunk/src/mess/tools/imgtool/imgtool.c
r17917r17918
2020    TYPE DEFINITIONS
2121***************************************************************************/
2222
23struct _imgtool_image
23struct imgtool_image
2424{
2525   const imgtool_module *module;
2626   object_pool *pool;
2727};
2828
29struct _imgtool_partition
29struct imgtool_partition
3030{
3131   imgtool_image *image;
3232   object_pool *pool;
r17917r17918
6868   const char *writefile_optspec;
6969};
7070
71struct _imgtool_directory
71struct imgtool_directory
7272{
7373   imgtool_partition *partition;
7474};
r17917r17918
11211121   }
11221122
11231123   /* setup the image structure */
1124   size = sizeof(struct _imgtool_image) + module->image_extra_bytes;
1124   size = sizeof(imgtool_image) + module->image_extra_bytes;
11251125   image = (imgtool_image *) pool_malloc_lib(pool, size);
11261126   if (!image)
11271127   {
r17917r17918
26402640   if (err)
26412641      goto done;
26422642
2643   size = sizeof(struct _imgtool_directory) + partition->directory_extra_bytes;
2643   size = sizeof(imgtool_directory) + partition->directory_extra_bytes;
26442644   enumeration = (imgtool_directory *) malloc(size);
26452645   if (!enumeration)
26462646   {
trunk/src/mess/tools/imgtool/modules/ti99.c
r17917r17918
266266    Miscellaneous utilities that are used to handle TI data types
267267*/
268268
269typedef struct UINT16BE
269struct UINT16BE
270270{
271271   UINT8 bytes[2];
272} UINT16BE;
272};
273273
274typedef struct UINT16LE
274struct UINT16LE
275275{
276276   UINT8 bytes[2];
277} UINT16LE;
277};
278278
279279INLINE UINT16 get_UINT16BE(UINT16BE word)
280280{
r17917r17918
456456/*
457457    Disk geometry
458458*/
459typedef struct ti99_geometry
459struct ti99_geometry
460460{
461461   int secspertrack;
462462   int cylinders;
463463   int heads;
464} ti99_geometry;
464};
465465
466466/*
467467    Physical sector address
468468*/
469typedef struct ti99_sector_address
469struct ti99_sector_address
470470{
471471   int sector;
472472   int cylinder;
473473   int side;
474} ti99_sector_address;
474};
475475
476476/*
477477    Time stamp (used in fdr, and WIN VIB/DDR)
478478*/
479typedef struct ti99_date_time
479struct ti99_date_time
480480{
481481   UINT8 time_MSB, time_LSB;/* 0-4: hour, 5-10: minutes, 11-15: seconds/2 */
482482   UINT8 date_MSB, date_LSB;/* 0-6: year, 7-10: month, 11-15: day */
483} ti99_date_time;
483};
484484
485485/*
486486    Subdirectory descriptor (HFDC only)
487487
488488    The HFDC supports up to 3 subdirectories.
489489*/
490typedef struct dsk_subdir
490struct dsk_subdir
491491{
492492   char name[10];         /* subdirectory name (10 characters, pad with spaces) */
493493   UINT16BE fdir_aphysrec;   /* aphysrec address of fdir record for this subdirectory */
494} dsk_subdir;
494};
495495
496496/*
497497    DSK VIB record
r17917r17918
499499    Most fields in this record are only revelant to level 2 routines, but level
500500    1 routines need the disk geometry information extracted from the VIB.
501501*/
502typedef struct dsk_vib
502struct dsk_vib
503503{
504504   char name[10];         /* disk volume name (10 characters, pad with spaces) */
505505   UINT16BE totphysrecs;   /* total number of physrecs on disk (usually 360, */
r17917r17918
526526                        /* (AU 0 is associated to LSBit of byte 0, */
527527                        /* AU 7 to MSBit of byte 0, AU 8 to LSBit */
528528                        /* of byte 1, etc.) */
529} dsk_vib;
529};
530530
531531enum ti99_img_format
532532{
r17917r17918
540540/*
541541    level-1 disk image descriptor
542542*/
543typedef struct ti99_lvl1_imgref
543struct ti99_lvl1_imgref
544544{
545545   ti99_img_format img_format;   /* tells the image format */
546546   imgtool_stream *file_handle;      /* imgtool file handle */
r17917r17918
548548   ti99_geometry geometry;      /* geometry */
549549   unsigned pc99_track_len;      /* unformatted track length (pc99 format) */
550550   UINT32 *pc99_data_offset_array;   /* offset for each sector (pc99 format) */
551} ti99_lvl1_imgref;
551};
552552
553553/*
554554    calculate CRC for data address marks or sector data
r17917r17918
13841384/*
13851385    WIN VIB/DDR record
13861386*/
1387typedef struct win_vib_ddr
1387struct win_vib_ddr
13881388{
13891389   char name[10];         /* disk volume name (10 characters, pad with spaces) */
13901390   UINT16BE totAUs;      /* total number of AUs */
r17917r17918
14371437      } ddr;
14381438   } u2;
14391439   UINT16BE subdir_AU[114];/* points to all subdirectory DDRs */
1440} win_vib_ddr;
1440};
14411441
14421442/*
14431443    AU format
14441444*/
1445typedef struct ti99_AUformat
1445struct ti99_AUformat
14461446{
14471447   int totAUs;            /* total number of AUs */
14481448   int physrecsperAU;      /* number of 256-byte physical records per AU */
1449} ti99_AUformat;
1449};
14501450
14511451/*
14521452    DSK directory reference: 0 for root, 1 for 1st subdir, 2 for 2nd subdir, 3
r17917r17918
14571457/*
14581458    catalog entry (used for in-memory catalog)
14591459*/
1460typedef struct dir_entry
1460struct dir_entry
14611461{
14621462   UINT16 dir_ptr;         /* DSK: unused */
14631463                     /* WIN: AU address of the DDR for this directory */
14641464   char name[10];         /* name of this directory (copied from the VIB for DSK, DDR for WIN) */
1465} dir_entry;
1465};
14661466
1467typedef struct file_entry
1467struct file_entry
14681468{
14691469   UINT16 fdr_ptr;         /* DSK: aphysrec address of the FDR for this file */
14701470                     /* WIN: AU address of the FDR for this file */
14711471   char name[10];         /* name of this file (copied from FDR) */
1472} file_entry;
1472};
14731473
1474typedef struct ti99_catalog
1474struct ti99_catalog
14751475{
14761476   int num_subdirs;      /* number of subdirectories */
14771477   int num_files;         /* number of files */
14781478   dir_entry subdirs[114];   /* description of each subdir */
14791479   file_entry files[128];   /* description of each file */
1480} ti99_catalog;
1480};
14811481
14821482/*
14831483    level-2 disk image descriptor
14841484*/
1485typedef struct ti99_lvl2_imgref_dsk
1485struct ti99_lvl2_imgref_dsk
14861486{
14871487   UINT16 totphysrecs;            /* total number of aphysrecs (extracted from vib record in aphysrec 0) */
14881488   ti99_catalog catalogs[4];      /* catalog of root directory and up to 3 subdirectories */
14891489   UINT16 fdir_aphysrec[4];      /* fdir aphysrec address for root directory
14901490                                        and up to 3 subdirectories */
1491} ti99_lvl2_imgref_dsk;
1491};
14921492
14931493enum win_vib_t
14941494{
14951495   win_vib_v1,
14961496   win_vib_v2
14971497};
1498typedef struct ti99_lvl2_imgref_win
1498struct ti99_lvl2_imgref_win
14991499{
15001500   win_vib_t vib_version;         /* version of the vib record in aphysrec 0 (see win_vib_ddr) */
1501} ti99_lvl2_imgref_win;
1501};
15021502
15031503enum l2i_t
15041504{
15051505   L2I_DSK,
15061506   L2I_WIN
15071507};
1508typedef struct ti99_lvl2_imgref
1508struct u
15091509{
15101510   ti99_lvl1_imgref l1_img;/* image format, imgtool image handle, image geometry */
15111511   ti99_AUformat AUformat;   /* AU format */
r17917r17918
15351535   {
15361536      ti99_lvl2_imgref_dsk dsk;
15371537      ti99_lvl2_imgref_win win;
1538   } u;               /* structure-specific info */
1538   };               /* structure-specific info */
15391539} ti99_lvl2_imgref;
15401540
15411541/*
r17917r17918
15541554/*
15551555    DSK FDR record
15561556*/
1557typedef struct dsk_fdr
1557struct dsk_fdr
15581558{
15591559   char name[10];         /* file name (10 characters, pad with spaces) */
15601560   UINT16BE xreclen;      /* extended record len: if record len is >= 256, */
r17917r17918
15951595                        /* bytes each), one entry for each file cluster. */
15961596                        /* 12 bits: address of first AU of cluster */
15971597                        /* 12 bits: offset of last 256-byte record in cluster */
1598} dsk_fdr;
1598};
15991599
16001600/*
16011601    WIN FDR record
16021602*/
1603typedef struct win_fdr
1603struct win_fdr
16041604{
16051605   char name[10];         /* file name (10 characters, pad with spaces) */
16061606   UINT16BE xreclen;      /* extended record len: if record len is >= 256, */
r17917r17918
16571657                        /* bytes each), one entry for each file cluster. */
16581658                        /* 16 bits: address of first AU of cluster */
16591659                        /* 16 bits: address of last AU of cluster */
1660} win_fdr;
1660};
16611661
16621662/*
16631663    tifile header: stand-alone file
16641664*/
1665typedef struct tifile_header
1665struct tifile_header
16661666{
16671667   char tifiles[8];      /* always '\7TIFILES' */
16681668   UINT16BE fphysrecs;      /* file length in physrecs */
r17917r17918
16971697                           /* 4 bytes: time & date of last update */
16981698                           /* 2 bytes: unknown (always >0000) */
16991699                           /* 96 chars: 0xCA53 repeated 56 times */
1700} tifile_header;
1700};
17011701
17021702/*
17031703    level-2 file descriptor
17041704*/
1705typedef struct ti99_lvl2_fileref_dsk
1705struct ti99_lvl2_fileref_dsk
17061706{
17071707   ti99_lvl2_imgref *l2_img;
17081708   int fdr_aphysrec;
17091709   dsk_fdr fdr;
1710} ti99_lvl2_fileref_dsk;
1710};
17111711
1712typedef struct ti99_lvl2_fileref_win
1712struct ti99_lvl2_fileref_win
17131713{
17141714   ti99_lvl2_imgref *l2_img;
17151715   unsigned fphysrecs;            /* copy of field in the eldest FDR */
17161716   unsigned eldestfdr_aphysrec;   /* aphysrec address of the eldest FDR */
17171717   unsigned curfdr_aphysrec;      /* aphysrec address of the currently open sibling FDR */
17181718   win_fdr curfdr;               /* buffer with currently open sibling FDR */
1719} ti99_lvl2_fileref_win;
1719};
17201720
1721typedef struct ti99_lvl2_fileref_tifiles
1721struct ti99_lvl2_fileref_tifiles
17221722{
17231723   imgtool_stream *file_handle;
17241724   tifile_header hdr;
1725} ti99_lvl2_fileref_tifiles;
1725};
17261726
17271727enum l2f_type_t
17281728{
r17917r17918
17301730   L2F_WIN,
17311731   L2F_TIFILES
17321732};
1733typedef struct ti99_lvl2_fileref
1733struct u
17341734{
17351735   l2f_type_t type;
17361736   union
r17917r17918
17381738      ti99_lvl2_fileref_dsk dsk;
17391739      ti99_lvl2_fileref_win win;
17401740      ti99_lvl2_fileref_tifiles tifiles;
1741   } u;
1741   };
17421742} ti99_lvl2_fileref;
17431743
17441744
r17917r17918
36963696    * files with variable-size records (sequential-access)
36973697*/
36983698
3699typedef struct ti99_lvl3_fileref
3699struct ti99_lvl3_fileref
37003700{
37013701   ti99_lvl2_fileref l2_file;
37023702
37033703   int cur_log_rec;
37043704   int cur_phys_rec;
37053705   int cur_pos_in_phys_rec;
3706} ti99_lvl3_fileref;
3706};
37073707
37083708#ifdef UNUSED_FUNCTION
37093709/*
r17917r17918
38273827/*
38283828    ti99 catalog iterator, used when imgtool reads the catalog
38293829*/
3830typedef struct dsk_iterator
3830struct dsk_iterator
38313831{
38323832   ti99_lvl2_imgref *image;
38333833   int level;
38343834   int listing_subdirs;      /* true if we are listing subdirectories at current level */
38353835   int index[2];            /* current index in the disk catalog */
38363836   ti99_catalog *cur_catalog;   /* current catalog */
3837} dsk_iterator;
3837};
38383838
3839typedef struct win_iterator
3839struct win_iterator
38403840{
38413841   ti99_lvl2_imgref *image;
38423842   int level;
38433843   int listing_subdirs;      /* true if we are listing subdirectories at current level */
38443844   int index[MAX_DIR_LEVEL];   /* current index in the disk catalog */
38453845   ti99_catalog catalog[MAX_DIR_LEVEL];   /* current catalog */
3846} win_iterator;
3846};
38473847
38483848
38493849static imgtoolerr_t dsk_image_init_mess(imgtool_image *image, imgtool_stream *f);
trunk/src/mess/tools/imgtool/modules/mac.c
r17917r17918
114114#pragma mark MISCELLANEOUS UTILITIES
115115#endif
116116
117typedef struct UINT16BE
117struct UINT16BE
118118{
119119   UINT8 bytes[2];
120} UINT16BE;
120};
121121
122typedef struct UINT24BE
122struct UINT24BE
123123{
124124   UINT8 bytes[3];
125} UINT24BE;
125};
126126
127typedef struct UINT32BE
127struct UINT32BE
128128{
129129   UINT8 bytes[4];
130} UINT32BE;
130};
131131
132132INLINE UINT16 get_UINT16BE(UINT16BE word)
133133{
r17917r17918
181181/*
182182    point record, with the y and x coordinates
183183*/
184typedef struct mac_point
184struct mac_point
185185{
186186   UINT16BE v;      /* actually signed */
187187   UINT16BE h;      /* actually signed */
188} mac_point;
188};
189189
190190/*
191191    rect record, with the corner coordinates
192192*/
193typedef struct mac_rect
193struct mac_rect
194194{
195195   UINT16BE top;   /* actually signed */
196196   UINT16BE left;   /* actually signed */
197197   UINT16BE bottom;/* actually signed */
198198   UINT16BE right;   /* actually signed */
199} mac_rect;
199};
200200
201201/*
202202    FInfo (Finder file info) record
203203*/
204typedef struct mac_FInfo
204struct mac_FInfo
205205{
206206   mac_type  type;         /* file type */
207207   mac_type  creator;      /* file creator */
r17917r17918
221221                     /* HFS & HFS+:
222222                                System 7: The window in which the file???s icon appears
223223                                System 8: reserved (set to 0) */
224} mac_FInfo;
224};
225225
226226/*
227227    FXInfo (Finder extended file info) record -- not found in MFS
228228*/
229typedef struct mac_FXInfo
229struct mac_FXInfo
230230{
231231   UINT16BE iconID;      /* System 7: An ID number for the file???s icon; the
232232                                numbers that identify icons are assigned by the
r17917r17918
243243                                file onto the desktop, the directory ID of the
244244                                folder from which the user moves the file is
245245                                saved here) */
246} mac_FXInfo;
246};
247247
248248/*
249249    DInfo (Finder folder info) record -- not found in MFS
250250*/
251typedef struct mac_DInfo
251struct mac_DInfo
252252{
253253   mac_rect rect;         /* Folder's window bounds */
254254   UINT16BE flags;         /* Finder flags, e.g. kIsInvisible, kNameLocked, etc */
r17917r17918
259259   UINT16BE view;         /* System 7: The manner in which folders are
260260                                displayed */
261261                     /* System 8: reserved (set to 0) */
262} mac_DInfo;
262};
263263
264264/*
265265    DXInfo (Finder extended folder info) record -- not found in MFS
266266*/
267typedef struct mac_DXInfo
267struct mac_DXInfo
268268{
269269   mac_point scroll;      /* Scroll position */
270270   UINT32BE openChain;      /* System 7: chain of directory IDs for open folders */
r17917r17918
279279                                folder onto the desktop, the directory ID of
280280                                the folder from which the user moves it is
281281                                saved here) */
282} mac_DXInfo;
282};
283283
284284/*
285285    defines for FInfo & DInfo flags fields
r17917r17918
609609/*
610610    disk image reference
611611*/
612typedef struct mac_l1_imgref
612struct mac_l1_imgref
613613{
614614   imgtool_image *image;
615615   UINT32 heads;
616} mac_l1_imgref;
616};
617617
618618
619619
r17917r17918
752752
753753enum mac_forkID { data_fork = 0x00, rsrc_fork = 0xff };
754754
755typedef struct mac_l2_imgref mac_l2_imgref;
756
757755/*
758756    MFS image ref
759757*/
760typedef struct mfs_l2_imgref
758struct mfs_l2_imgref
761759{
762760   UINT16 dir_num_files;
763761   UINT16 dir_start;
r17917r17918
769767
770768   unsigned char ABlink_dirty[13];   /* dirty flag for each disk block in the ABlink array */
771769   UINT8 ABlink[6141];
772} mfs_l2_imgref;
770};
773771
774772/*
775773    HFS extent descriptor
776774*/
777typedef struct hfs_extent
775struct hfs_extent
778776{
779777   UINT16BE stABN;         /* first allocation block */
780778   UINT16BE numABlks;      /* number of allocation blocks */
781} hfs_extent;
779};
782780
783781/*
784782    HFS likes to group extents by 3 (it is 8 with HFS+), so we create a
r17917r17918
789787/*
790788    MFS open file ref
791789*/
792typedef struct mfs_fileref
790struct mfs_fileref
793791{
794792   UINT16 stBlk;               /* first allocation block of file */
795} mfs_fileref;
793};
796794
797795/*
798796    HFS open file ref
799797*/
800typedef struct hfs_fileref
798struct hfs_fileref
801799{
802800   hfs_extent_3 extents;         /* first 3 file extents */
803801
804802   UINT32 parID;               /* CNID of parent directory (undefined for extent & catalog files) */
805803   mac_str31 filename;            /* file name (undefined for extent & catalog files) */
806} hfs_fileref;
804};
807805
808806/*
809807    MFS/HFS open file ref
810808*/
811typedef struct mac_fileref
809struct u
812810{
813811   mac_l2_imgref *l2_img;         /* image pointer */
814812
r17917r17918
828826   {
829827      mfs_fileref mfs;
830828      hfs_fileref hfs;
831   } u;
829   };
832830} mac_fileref;
833831
834832/*
835833    open BT ref
836834*/
837typedef struct mac_BTref
835struct mac_BTref
838836{
839837   mac_fileref fileref;   /* open B-tree file ref */
840838
r17917r17918
849847   int (*key_compare_func)(const void *key1, const void *key2);
850848
851849   void *node_buf;         /* current node buffer */
852} mac_BTref;
850};
853851
854852/*
855853    Constants for BTHeaderRec attributes field
r17917r17918
864862/*
865863    HFS image ref
866864*/
867typedef struct hfs_l2_imgref
865struct hfs_l2_imgref
868866{
869867   UINT16 VBM_start;
870868
r17917r17918
876874   mac_BTref cat_BT;
877875
878876   UINT8 VBM[8192];
879} hfs_l2_imgref;
877};
880878
881879/*
882880    MFS/HFS image ref
r17917r17918
903901/*
904902    MFS Master Directory Block
905903*/
906typedef struct mfs_mdb_t
904struct mfs_mdb_
907905{
908906   UINT8    sigWord[2];   /* volume signature - always $D2D7 */
909907   UINT32BE crDate;      /* date and time of volume creation */
r17917r17918
938936                            was that the disk utility could rely on the tag
939937                            data to rebuild the link array if it should ever
940938                            be corrupted. */
941} mfs_mdb_;
939};
942940
943941/*
944942    HFS Master Directory Block
945943*/
946typedef struct hfs_mdb_t
944struct v1
947945{
948946/* First fields are similar to MFS, though several fields have a different meaning */
949947   UINT8    sigWord[2];   /* volume signature - always $D2D7 */
r17917r17918
983981         UINT16BE VCSize;      /* size (in blocks) of volume cache */
984982         UINT16BE VBMCSize;      /* size (in blocks) of volume bitmap cache */
985983         UINT16BE ctlCSize;      /* size (in blocks) of common volume cache */
986      } v1;
984      };
987985      struct
988986      {
989987         UINT16BE embedSigWord;   /* embedded volume signature */
r17917r17918
998996} hfs_mdb_t;
999997
1000998/* to save a little stack space, we use the same buffer for MDB and next blocks */
1001typedef union img_open_buf
999union img_open_buf
10021000{
10031001   mfs_mdb_t mfs_mdb;
10041002   hfs_mdb_t hfs_mdb;
10051003   UINT8 raw[512];
1006} img_open_buf;
1004};
10071005
10081006/*
10091007    Information extracted from catalog/directory
10101008*/
1011typedef struct mac_dirent
1009struct mac_dirent
10121010{
10131011   UINT16 dataRecType;         /* type of data record */
10141012
r17917r17918
10261024
10271025   UINT32 createDate;         /* date and time of creation */
10281026   UINT32 modifyDate;         /* date and time of last modification */
1029} mac_dirent;
1027};
10301028
10311029/*
10321030    Tag record for GCR floppies (12 bytes)
10331031
10341032    And, no, I don't know the format of the 20-byte tag record of the HD20
10351033*/
1036typedef struct floppy_tag_record
1034struct floppy_tag_record
10371035{
10381036   UINT32BE fileID;         /* a.k.a. CNID */
10391037                        /* a value of 1 seems to be the default for non-AB blocks, but this is not consistent */
r17917r17918
10511049                                    each time a volume is written to, the current value of
10521050                                    wrCnt is written in the tag field, then it is incremented */
10531051                        /* (DV17 says "disk block number", but it cannot be true) */
1054} floppy_tag_record;
1052};
10551053
10561054#ifdef UNUSED_FUNCTION
10571055static void hfs_image_close(mac_l2_imgref *l2_img);
r17917r17918
14521450    files appear does not match file names, and it does not always match file
14531451    IDs.
14541452*/
1455typedef struct mfs_dir_entry
1453struct mfs_dir_entry
14561454{
14571455   UINT8    flags;            /* bit 7=1 if entry used, bit 0=1 if file locked */
14581456                        /* 0x00 means end of block: if we are not done
r17917r17918
14781476                        /* next chars are file name - 255 chars at most */
14791477                        /* IIRC, Finder 7 only supports 31 chars,
14801478                                wheareas earlier versions support 63 chars */
1481} mfs_dir_entry;
1479};
14821480
14831481/*
14841482    FOBJ desktop resource: describes a folder, or the location of the volume
r17917r17918
14871485    In typical Apple manner, this resource is not documented.  However, I have
14881486    managed to reverse engineer some parts of it.
14891487*/
1490typedef struct mfs_FOBJ
1488struct mfs_FOBJ
14911489{
14921490   UINT8 unknown0[2];      /* $00: $0004 for disk, $0008 for folder??? */
14931491   mac_point location;      /* $02: location in parent window */
r17917r17918
15221520         UINT8 name[1];         /* variable-length macintosh string */
15231521      } v2;
15241522   } u;
1525} mfs_FOBJ;
1523};
15261524
15271525/*
15281526    MFS open dir ref
15291527*/
1530typedef struct mfs_dirref
1528struct mfs_dirref
15311529{
15321530   mac_l2_imgref *l2_img;         /* image pointer */
15331531   UINT16 index;               /* current file index in the disk directory */
15341532   UINT16 cur_block;            /* current block offset in directory file */
15351533   UINT16 cur_offset;            /* current byte offset in current block of directory file */
15361534   UINT8 block_buffer[512];      /* buffer with current directory block */
1537} mfs_dirref;
1535};
15381536
15391537
15401538
r17917r17918
27702768/*
27712769    HFS extents B-tree key
27722770*/
2773typedef struct hfs_extentKey
2771struct hfs_extentKey
27742772{
27752773   UINT8    keyLength;      /* length of key, excluding this field */
27762774   UINT8    forkType;      /* 0 = data fork, FF = resource fork */
27772775   UINT32BE fileID;      /* file ID */
27782776   UINT16BE startBlock;   /* first file allocation block number in this extent */
2779} hfs_extentKey;
2777};
27802778enum
27812779{
27822780   keyLength_hfs_extentKey = sizeof(hfs_extentKey) - sizeof(UINT8)
r17917r17918
27852783/*
27862784    HFS catalog B-tree key
27872785*/
2788typedef struct hfs_catKey
2786struct hfs_catKey
27892787{
27902788   UINT8    keyLen;      /* key length */
27912789   UINT8    resrv1;      /* reserved */
r17917r17918
27932791   mac_str31 cName;      /* catalog node name */
27942792                     /* note that in index nodes, it is a mac_str31, but
27952793                                in leaf keys it's a variable-length string */
2796} hfs_catKey;
2794};
27972795
27982796/*
27992797    HFS catalog data record for a folder - 70 bytes
28002798*/
2801typedef struct hfs_catFolderData
2799struct hfs_catFolderData
28022800{
28032801   UINT16BE recordType;      /* record type */
28042802   UINT16BE flags;            /* folder flags */
r17917r17918
28102808   mac_DInfo userInfo;         /* Finder information */
28112809   mac_DXInfo finderInfo;      /* additional Finder information */
28122810   UINT32BE reserved[4];      /* reserved - set to zero */
2813} hfs_catFolderData;
2811};
28142812
28152813/*
28162814    HFS catalog data record for a file - 102 bytes
28172815*/
2818typedef struct hfs_catFileData
2816struct hfs_catFileData
28192817{
28202818   UINT16BE recordType;      /* record type */
28212819   UINT8    flags;            /* file flags */
r17917r17918
28362834   hfs_extent_3 dataExtents;   /* first data fork extent record */
28372835   hfs_extent_3 rsrcExtents;   /* first resource fork extent record */
28382836   UINT32BE reserved;         /* reserved - set to zero */
2839} hfs_catFileData;
2837};
28402838
28412839/*
28422840    HFS catalog data record for a thread - 46 bytes
r17917r17918
28442842    The key for a thread record features the CNID of the item and an empty
28452843    name, instead of the CNID of the parent and the item name.
28462844*/
2847typedef struct hfs_catThreadData
2845struct hfs_catThreadData
28482846{
28492847   UINT16BE recordType;      /* record type */
28502848   UINT32BE reserved[2];      /* reserved - set to zero */
28512849   UINT32BE parID;            /* parent ID for this catalog node */
28522850   mac_str31 nodeName;         /* name of this catalog node */
2853} hfs_catThreadData;
2851};
28542852
28552853/*
28562854    union for all types at once
28572855*/
2858typedef union hfs_catData
2856union hfs_catData
28592857{
28602858   UINT16BE dataType;
28612859   hfs_catFolderData folder;
28622860   hfs_catFileData file;
28632861   hfs_catThreadData thread;
2864} hfs_catData;
2862};
28652863
28662864/*
28672865    HFS catalog record types
r17917r17918
28902888/*
28912889    BT functions used by HFS functions
28922890*/
2893typedef struct BT_leaf_rec_enumerator
2891struct BT_leaf_rec_enumerator
28942892{
28952893   mac_BTref *BTref;
28962894   UINT32 cur_node;
28972895   int cur_rec;
2898} BT_leaf_rec_enumerator;
2896};
28992897
29002898static imgtoolerr_t BT_open(mac_BTref *BTref, int (*key_compare_func)(const void *key1, const void *key2), int is_extent);
29012899static void BT_close(mac_BTref *BTref);
r17917r17918
29072905static imgtoolerr_t BT_leaf_rec_enumerator_open(mac_BTref *BTref, BT_leaf_rec_enumerator *enumerator);
29082906static imgtoolerr_t BT_leaf_rec_enumerator_read(BT_leaf_rec_enumerator *enumerator, void **record_ptr, int *rec_len);
29092907
2910typedef struct hfs_cat_enumerator
2908struct hfs_cat_enumerator
29112909{
29122910   mac_l2_imgref *l2_img;
29132911   BT_leaf_rec_enumerator BT_enumerator;
29142912   UINT32 parID;
2915} hfs_cat_enumerator;
2913};
29162914
29172915/*
29182916    hfs_open_extents_file
r17917r17918
36403638
36413639    Header of a node record
36423640*/
3643typedef struct BTNodeHeader
3641struct BTNodeHeader
36443642{
36453643   UINT32BE fLink;         /* (index of) next node at this level */
36463644   UINT32BE bLink;         /* (index of) previous node at this level */
r17917r17918
36503648                                parent, whatever IM says) */
36513649   UINT16BE numRecords;   /* number of records in this node */
36523650   UINT16BE reserved;      /* reserved; set to zero */
3653} BTNodeHeader;
3651};
36543652
36553653/*
36563654    Constants for BTNodeHeader kind field
r17917r17918
36723670    BTHeaderRecord: first record of a B-tree header node (second record is
36733671    unused, and third is node allocation bitmap).
36743672*/
3675typedef struct BTHeaderRecord
3673struct BTHeaderRecord
36763674{
36773675   UINT16BE treeDepth;      /* maximum height (usually leaf nodes) */
36783676   UINT32BE rootNode;      /* node number of root node */
r17917r17918
36933691   UINT8    reserved2;      /* reserved */
36943692   UINT32BE attributes;   /* persistent attributes about the tree */
36953693   UINT32BE reserved3[16];   /* reserved */
3696} BTHeaderRecord;
3694};
36973695
36983696static imgtoolerr_t BT_check(mac_BTref *BTref, int is_extent);
36993697
r17917r17918
39553953
39563954    Return imgtool error code
39573955*/
3958typedef struct data_nodes_t
3956struct data_nodes_t
39593957{
39603958   void *buf;
39613959   UINT32 node_num;
39623960   UINT32 cur_rec;
39633961   UINT32 num_recs;
3964} data_nodes_t;
3962};
39653963static imgtoolerr_t BT_check(mac_BTref *BTref, int is_extent)
39663964{
39673965   UINT16 node_numRecords;
r17917r17918
48424840/*
48434841    Resource header
48444842*/
4845typedef struct rsrc_header
4843struct rsrc_header
48464844{
48474845   UINT32BE data_offs;      /* Offset from beginning of resource fork to resource data */
48484846   UINT32BE map_offs;      /* Offset from beginning of resource fork to resource map */
48494847   UINT32BE data_len;      /* Length of resource data */
48504848   UINT32BE map_len;      /* Length of resource map */
4851} rsrc_header;
4849};
48524850
48534851/*
48544852    Resource data: each data entry is preceded by its len (UINT32BE)
r17917r17918
48584856/*
48594857    Resource map:
48604858*/
4861typedef struct rsrc_map_header
4859struct rsrc_map_header
48624860{
48634861   rsrc_header reserved0;   /* Reserved for copy of resource header */
48644862   UINT32BE reserved1;      /* Reserved for handle to next resource map */
r17917r17918
48694867   UINT16BE namelist_offs;   /* Offset from beginning of map to resource name list */
48704868   UINT16BE type_count;   /* Number of types in the map minus 1 */
48714869                     /* This is actually part of the type list, which matters for offsets */
4872} rsrc_map_header;
4870};
48734871
48744872/*
48754873    Resource type list entry
48764874*/
4877typedef struct rsrc_type_entry
4875struct rsrc_type_entry
48784876{
48794877   UINT32BE type;         /* Resource type */
48804878   UINT16BE ref_count;      /* Number of resources of this type in map minus 1 */
48814879   UINT16BE ref_offs;      /* Offset from beginning of resource type list to reference list for this type */
4882} rsrc_type_entry;
4880};
48834881
48844882/*
48854883    Resource reference list entry
48864884*/
4887typedef struct rsrc_ref_entry
4885struct rsrc_ref_entry
48884886{
48894887   UINT16BE id;         /* Resource ID */
48904888   UINT16BE name_offs;      /* Offset from beginning of resource name list to resource name */
r17917r17918
48924890   UINT8 attr;            /* Resource attributes */
48934891   UINT24BE data_offs;      /* Offset from beginning of resource data to data for this resource */
48944892   UINT32BE reserved;      /* Reserved for handle to resource */
4895} rsrc_ref_entry;
4893};
48964894
48974895/*
48984896    Resource name list entry: this is just a standard macintosh string
48994897*/
49004898
4901typedef struct mac_resfileref
4899struct mac_resfileref
49024900{
49034901   mac_fileref fileref;   /* open resource fork ref (you may open resources
49044902                                files in data fork, too, if you ever need to,
r17917r17918
49114909   UINT16 namelist_offs;   /* Offset from beginning of map to resource name list */
49124910   UINT16 type_count;      /* Number of types in the map minus 1 */
49134911                     /* This is actually part of the type list, which matters for offsets */
4914} mac_resfileref;
4912};
49154913
49164914#ifdef UNUSED_FUNCTION
49174915/*
r17917r17918
53115309/*
53125310    MFS/HFS catalog iterator, used when imgtool reads the catalog
53135311*/
5314typedef struct mac_iterator
5312struct mac_iterator
53155313{
53165314   mac_format format;
53175315   mac_l2_imgref *l2_img;
r17917r17918
53265324         hfs_cat_enumerator catref;      /* catalog file enumerator */
53275325      } hfs;
53285326   } u;
5329} mac_iterator;
5327};
53305328
53315329/*
53325330    Open the disk catalog for enumeration
trunk/src/mess/tools/imgtool/modules/vzdos.c
r17917r17918
4040#define MAX_DIRENTS   (15*8)
4141
4242/* vzdos directry entry */
43typedef struct vzdos_dirent
43struct vzdos_dirent
4444{
4545   char ftype;
4646   char delimitor;
r17917r17918
4949   UINT8 start_sector;
5050   UINT16 start_address;
5151   UINT16 end_address;
52} vzdos_dirent;
52};
5353
54typedef struct vz_iterator
54struct vz_iterator
5555{
5656   int index;
5757   int eof;
58} vz_iterator;
58};
5959
6060static const UINT8 sector_order[] =
6161{
trunk/src/mess/tools/imgtool/modules/ti990hd.c
r17917r17918
3535#define MAX_DIR_LEVEL 25   /* We need to put a recursion limit to avoid endless recursion hazard */
3636
3737
38typedef struct UINT16BE
38struct UINT16BE
3939{
4040   UINT8 bytes[2];
41} UINT16BE;
41};
4242
43typedef struct UINT32BE
43struct UINT32BE
4444{
4545   UINT8 bytes[4];
46} UINT32BE;
46};
4747
4848INLINE UINT16 get_UINT16BE(UINT16BE word)
4949{
r17917r17918
7272/*
7373    disk image header
7474*/
75typedef struct disk_image_header
75struct disk_image_header
7676{
7777   UINT32BE cylinders;         /* number of cylinders on hard disk (big-endian) */
7878   UINT32BE heads;            /* number of heads on hard disk (big-endian) */
7979   UINT32BE sectors_per_track;   /* number of sectors per track on hard disk (big-endian) */
8080   UINT32BE bytes_per_sector;   /* number of bytes of data per sector on hard disk (big-endian) */
81} disk_image_header;
81};
8282
8383enum
8484{
r17917r17918
101101/*
102102    SC0 record (Disk sector 0)
103103*/
104typedef struct ti990_sc0
104struct ti990_sc0
105105{
106106   char      vnm[8];         /* volume name */
107107   UINT16BE   tna;         /* total number of ADUs */
r17917r17918
148148   UINT16BE   dct;         /* disk creation time */
149149   UINT16BE   fsf;         /* * * RESERVED * * */
150150   /* SCOSIZ = >AA */
151} ti990_sc0;
151};
152152
153153/*
154154    DOR (Directory Overhead Record)
155155*/
156typedef struct ti990_dor
156struct ti990_dor
157157{
158158   UINT16BE nrc;            /* # records in directory (minus DOR) nrc = nfl + nar (+ tfc???) */
159159   UINT16BE nfl;            /* # files currently in directory */
r17917r17918
164164   char pnm[8];            /* name of parent directory (VCATALOG for root, even though it makes little sense) */
165165   UINT16BE prs;            /* "default physical record length (used for file creation)" */
166166   /* DORSIZ = >1C */
167} ti990_dor;
167};
168168
169169/*
170170    file flags found in fdr
r17917r17918
198198/*
199199    ACE subrecord found in FDR
200200*/
201typedef struct ti990_ace
201struct ti990_ace
202202{
203203   char      agn[8];            /* access group name */
204204   UINT16BE   flg;            /* flags */
205} ti990_ace;
205};
206206
207207/*
208208    FDR record
209209*/
210typedef struct ti990_fdr
210struct ti990_fdr
211211{
212212   UINT16BE   hkc;         /* hask key count: the number of file descriptor records that are present in the directory that hashed to this record number */
213213   UINT16BE   hkv;         /* hask key value: the result of the hash algorithm for the file name actually covered in this record */
r17917r17918
243243   UINT16BE   psa;         /* public security attribute */
244244   ti990_ace   ace[9];         /* 9 access control entries */
245245   UINT8      fil[2];         /* not used */
246} ti990_fdr;
246};
247247
248248/*
249249    ADR record: variant of FDR for Aliases
r17917r17918
251251    The fields marked here with *** are in the ADR template to maintain
252252    compatability with the FDR template.
253253*/
254typedef struct ti990_adr
254struct ti990_adr
255255{
256256   UINT16BE   hkc;         /* hask key count */
257257   UINT16BE   hkv;         /* hask key value */
r17917r17918
266266   UINT16BE   fill05;         /* *** secondary allocation address */
267267   UINT16BE   rna;         /* record number of next ADR */
268268   UINT16BE   raf;         /* record # of actual FDR (from 1 through dor.nrc) */
269} ti990_adr;
269};
270270
271271/*
272272    CDR record: variant of FDR for Channel
r17917r17918
274274    The CDR is the permanent record of a channel.  It is carried as an alias
275275    of the program file in which the channel owner task resides.
276276*/
277typedef struct ti990_cdr
277struct ti990_cdr
278278{
279279   UINT16BE   hkc;         /* hask key count */
280280   UINT16BE   hkv;         /* hask key value */
r17917r17918
295295   UINT16BE   psa;         /* public security attribute */
296296   UINT8      scg[94];      /* "SDT with 9 control groups" (whatever it means - and, no, 94 is not dividable by 9) */
297297   UINT8      fill06[8];      /* reserved */
298} ti990_cdr;
298};
299299
300300/*
301301    Based on contents of the flags field, catalog entries may be either an FDR,
r17917r17918
305305    field starts at offset 4, and therefore if we try to interpret a KDR as an
306306    FDR (or ADR, CDR), we will find fnm[0] and assume the FDR is empty.
307307*/
308typedef union directory_entry
308union directory_entry
309309{
310310   ti990_fdr fdr;
311311   ti990_adr adr;
312312   ti990_cdr cdr;
313} directory_entry;
313};
314314
315315#if 0
316316
317317/*
318318    tifile header: stand-alone file
319319*/
320typedef struct tifile_header
320struct tifile_header
321321{
322322   char tifiles[8];      /* always '\7TIFILES' */
323323   UINT8 secsused_MSB;      /* file length in sectors (big-endian) */
r17917r17918
329329   UINT8 fixrecs_MSB;      /* file length in records (big-endian) */
330330   UINT8 fixrecs_LSB;
331331   UINT8 res[128-16];      /* reserved */
332} tifile_header;
332};
333333
334334
335335/*
336336    catalog entry (used for in-memory catalog)
337337*/
338typedef struct catalog_entry
338struct catalog_entry
339339{
340340   UINT16 fdr_secnum;
341341   char filename[10];
342} catalog_entry;
342};
343343
344344#endif
345345
346346/*
347347    Disk geometry
348348*/
349typedef struct ti990_geometry
349struct ti990_geometry
350350{
351351   unsigned int cylinders, heads, sectors_per_track, bytes_per_sector;
352} ti990_geometry;
352};
353353
354354/*
355355    Physical sector address
356356*/
357typedef struct ti990_phys_sec_address
357struct ti990_phys_sec_address
358358{
359359   int cylinder;
360360   int head;
361361   int sector;
362} ti990_phys_sec_address;
362};
363363
364364/*
365365    ti99 disk image descriptor
366366*/
367typedef struct ti990_image
367struct ti990_image
368368{
369369   imgtool_stream *file_handle;      /* imgtool file handle */
370370   ti990_geometry geometry;   /* geometry */
371371   ti990_sc0 sec0;            /* cached copy of sector 0 */
372} ti990_image;
372};
373373
374374/*
375375    ti990 catalog iterator, used when imgtool reads the catalog
376376*/
377typedef struct ti990_iterator
377struct ti990_iterator
378378{
379379   ti990_image *image;
380380   int level;                     /* current recursion level */
381381   int nrc[MAX_DIR_LEVEL];            /* length of disk catalogs in records */
382382   int index[MAX_DIR_LEVEL];         /* current index in the disk catalog */
383383   directory_entry xdr[MAX_DIR_LEVEL];   /* fdr records */
384} ti990_iterator;
384};
385385
386386
387387static imgtoolerr_t ti990_image_init(imgtool_image *img, imgtool_stream *f);
trunk/src/mess/tools/imgtool/modules/concept.c
r17917r17918
1212#include <limits.h>
1313#include "imgtool.h"
1414
15typedef struct UINT16xE
15struct UINT16xE
1616{
1717   UINT8 bytes[2];
18} UINT16xE;
18};
1919
2020/*
2121    get_UINT16xE
r17917r17918
6969    device directory record (Disk sector 2-5)
7070*/
7171
72typedef struct concept_vol_hdr_entry
72struct concept_vol_hdr_entry
7373{
7474   UINT16xE   first_block;
7575   UINT16xE   next_block;
r17917r17918
8383   char      mem_flipped;
8484   char      disk_flipped;
8585   UINT16xE   unused;
86} concept_vol_hdr_entry;
86};
8787
88typedef struct concept_file_dir_entry
88struct concept_file_dir_entry
8989{
9090   UINT16xE   first_block;
9191   UINT16xE   next_block;
r17917r17918
9494   unsigned char   filename[16];
9595   UINT16xE   last_byte;
9696   UINT16xE   last_access;
97} concept_file_dir_entry;
97};
9898
99typedef struct concept_dev_dir
99struct concept_dev_dir
100100{
101101   concept_vol_hdr_entry vol_hdr;
102102   concept_file_dir_entry file_dir[77];
103103   char unused[20];
104} concept_dev_dir;
104};
105105
106106/*
107107    concept disk image descriptor
108108*/
109typedef struct concept_image
109struct concept_image
110110{
111111   imgtool_stream *file_handle;      /* imgtool file handle */
112112   concept_dev_dir dev_dir;   /* cached copy of device directory */
113} concept_image;
113};
114114
115115/*
116116    concept catalog iterator, used when imgtool reads the catalog
117117*/
118typedef struct concept_iterator
118struct concept_iterator
119119{
120120   concept_image *image;
121121   int index;                     /* current index */
122} concept_iterator;
122};
123123
124124
125125static imgtoolerr_t concept_image_init(imgtool_image *img, imgtool_stream *f);
trunk/src/mess/tools/imgtool/filter.h
r17917r17918
1414
1515#include "library.h"
1616
17typedef struct _imgtool_filter imgtool_filter;
17struct imgtool_filter;
1818
1919enum
2020{
trunk/src/mess/tools/imgtool/stream.c
r17917r17918
2020   IMG_MEM
2121};
2222
23struct _imgtool_stream
23struct imgtool_stream
2424{
2525   imgtype_t imgtype;
2626   int write_protect;
r17917r17918
5454      goto error;
5555   fclose(f);
5656
57   imgfile = (imgtool_stream *)malloc(sizeof(struct _imgtool_stream));
57   imgfile = (imgtool_stream *)malloc(sizeof(imgtool_stream));
5858   if (!imgfile)
5959      goto error;
6060
r17917r17918
156156      goto error;
157157   }
158158
159   imgfile = (imgtool_stream *)malloc(sizeof(struct _imgtool_stream));
159   imgfile = (imgtool_stream *)malloc(sizeof(imgtool_stream));
160160   if (!imgfile)
161161      goto error;
162162
r17917r17918
186186{
187187   imgtool_stream *imgfile;
188188
189   imgfile = (imgtool_stream *)malloc(sizeof(struct _imgtool_stream));
189   imgfile = (imgtool_stream *)malloc(sizeof(imgtool_stream));
190190   if (!imgfile)
191191      return NULL;
192192
r17917r17918
211211{
212212   imgtool_stream *imgfile;
213213
214   imgfile = (imgtool_stream *)malloc(sizeof(struct _imgtool_stream));
214   imgfile = (imgtool_stream *)malloc(sizeof(imgtool_stream));
215215   if (!imgfile)
216216      return NULL;
217217
trunk/src/mess/audio/wswan.c
r17917r17918
2121   INT8   signal;         /* signal */
2222};
2323
24typedef struct SND wswan_sound_state;
25struct SND {
24struct wswan_sound_state {
2625   sound_stream *channel;
2726   struct CHAN audio1;      /* Audio channel 1 */
2827   struct CHAN audio2;      /* Audio channel 2 */
trunk/src/mess/audio/spchroms.h
r17917r17918
11#ifndef __SPCHROMS_H
22#define __SPCHROMS_H
33
4typedef struct spchroms_interface
4struct spchroms_interface
55{
66   const char *memory_region;         /* memory region where the speech ROM is.  NULL means no speech ROM */
7} spchroms_interface;
7};
88
99void spchroms_config(running_machine &machine, const spchroms_interface *intf);
1010
trunk/src/mess/machine/strata.c
r17917r17918
229229}
230230
231231/* bus width for 8/16-bit handlers */
232typedef enum bus_width_t
232enum bus_width_t
233233{
234234   bw_8,
235235   bw_16
236} bus_width_t;
236};
237237
238238/*
239239    read a 8/16-bit word from FEEPROM
trunk/src/mess/machine/cococart.h
r17917r17918
2323***************************************************************************/
2424
2525/* output lines on the CoCo cartridge slot */
26enum _cococart_line
26enum cococart_line
2727{
2828   COCOCART_LINE_CART,            /* connects to PIA1 CB1 */
2929   COCOCART_LINE_NMI,            /* connects to NMI line on CPU */
3030   COCOCART_LINE_HALT,            /* connects to HALT line on CPU */
3131   COCOCART_LINE_SOUND_ENABLE      /* sound enable */
3232};
33typedef enum _cococart_line cococart_line;
3433
3534/* since we have a special value "Q" - we have to use a special enum here */
36enum _cococart_line_value
35enum cococart_line_value
3736{
3837   COCOCART_LINE_VALUE_CLEAR,
3938   COCOCART_LINE_VALUE_ASSERT,
4039   COCOCART_LINE_VALUE_Q
4140};
42typedef enum _cococart_line_value cococart_line_value;
4341
4442struct coco_cartridge_line
4543{
trunk/src/mess/machine/smartmed.c
r17917r17918
2727#define MAX_SMARTMEDIA   1
2828
2929/* machine-independent big-endian 32-bit integer */
30typedef struct UINT32BE
30struct UINT32BE
3131{
3232   UINT8 bytes[4];
33} UINT32BE;
33};
3434
3535INLINE UINT32 get_UINT32BE(UINT32BE word)
3636{
r17917r17918
4848#endif
4949
5050/* SmartMedia image header */
51typedef struct disk_image_header
51struct disk_image_header
5252{
5353   UINT8 version;
5454   UINT32BE page_data_size;
5555   UINT32BE page_total_size;
5656   UINT32BE num_pages;
5757   UINT32BE log2_pages_per_block;
58} disk_image_header;
58};
5959
60typedef struct disk_image_format_2_header
60struct disk_image_format_2_header
6161{
6262   UINT8 data1[3];
6363   UINT8 padding1[256-3];
6464   UINT8 data2[16];
6565   UINT8 data3[16];
6666   UINT8 padding2[768-32];
67} disk_image_format_2_header;
67};
6868
6969enum
7070{
trunk/src/mess/machine/990_tap.c
r17917r17918
3636
3737#define MAX_TAPE_UNIT 4
3838
39typedef struct tape_unit_t
39struct tape_unit_t
4040{
4141   device_image_interface *img;      /* image descriptor */
4242   unsigned int bot : 1;   /* TRUE if we are at the beginning of tape */
4343   unsigned int eot : 1;   /* TRUE if we are at the end of tape */
4444   unsigned int wp : 1;   /* TRUE if tape is write-protected */
45} tape_unit_t;
45};
4646
4747struct tap_990_t
4848{
trunk/src/mess/machine/upd765.h
r17917r17918
9191#define UPD765_GET_IMAGE(name)   device_t *name(device_t *device, int floppy_index )
9292
9393
94typedef struct upd765_interface
94struct upd765_interface
9595{
9696   /* interrupt issued */
9797   devcb_write_line out_int_func;
r17917r17918
105105   UPD765_RDY_PIN rdy_pin;
106106
107107   const char *floppy_drive_tags[4];
108} upd765_interface;
108};
109109
110110
111111/***************************************************************************
trunk/src/mess/machine/ti99/grom.h
r17917r17918
1313
1414#include "ti99defs.h"
1515
16typedef struct _ti99grom_config
16struct ti99grom_config
1717{
1818   bool            writable;
1919   int             ident;
r17917r17918
2222   int               size;
2323   devcb_write_line   ready;
2424   int               clockrate;
25} ti99grom_config;
25};
2626
2727#define GROM_CONFIG(name) \
2828   const ti99grom_config(name) =
trunk/src/mess/machine/ti99/joyport.h
r17917r17918
2222
2323extern const device_type JOYPORT;
2424
25typedef struct _joyport_config
25struct joyport_config
2626{
2727   devcb_write_line      interrupt;
2828   int                  vdp_clock;
29} joyport_config;
29};
3030
3131#define JOYPORT_CONFIG(name) \
3232   const joyport_config(name) =
trunk/src/mess/machine/ti99/gromport.h
r17917r17918
1818#define GROMPORT_CONFIG(name) \
1919   const gromport_config(name) =
2020
21typedef struct _gromport_config
21struct gromport_config
2222{
2323   devcb_write_line   ready;
2424   devcb_write_line   reset;
25} gromport_config;
25};
2626
2727class ti99_cartridge_connector_device;
2828
r17917r17918
366366};
367367
368368
369typedef struct _pcb_type
369struct pcb_type
370370{
371371   int id;
372372   const char* name;
373} pcb_type;
373};
374374
375375/*************************************************************************
376376    RPK support
r17917r17918
437437   void add_socket(const char* id, rpk_socket *newsock);
438438};
439439
440enum _rpk_open_error
440enum rpk_open_error
441441{
442442   RPK_OK,
443443   RPK_NOT_ZIP_FORMAT,
r17917r17918
455455   RPK_NO_PCB_OR_RESOURCES,
456456   RPK_UNKNOWN_PCB_TYPE
457457};
458typedef enum _rpk_open_error rpk_open_error;
459458
460459static const char error_text[15][30] =
461460{
trunk/src/mess/machine/ti99/ti99_hd.h
r17917r17918
2525    Needed to adapt to higher cylinder numbers. Floppies do not have such
2626    high numbers.
2727*/
28typedef struct chrn_id_hd
28struct chrn_id_hd
2929{
3030   UINT16 C;
3131   UINT8 H;
r17917r17918
3333   UINT8 N;
3434   int data_id;         // id for read/write data command
3535   unsigned long flags;
36} chrn_id_hd;
36};
3737
3838class mfm_harddisk_device : public device_t
3939{
trunk/src/mess/machine/ti99/genboard.h
r17917r17918
4444
4545/*****************************************************************************/
4646
47typedef struct _geneve_keyboard_config
47struct geneve_keyboard_config
4848{
4949   devcb_write_line   interrupt;
50} geneve_keyboard_config;
50};
5151
5252#define GENEVE_KEYBOARD_CONFIG(name) \
5353   const geneve_keyboard_config(name) =
r17917r17918
110110
111111/*****************************************************************************/
112112
113typedef struct _geneve_mapper_config
113struct geneve_mapper_config
114114{
115115   devcb_write_line   ready;
116} geneve_mapper_config;
116};
117117
118118class geneve_mapper_device : public device_t
119119{
trunk/src/mess/machine/ti99/evpc.h
r17917r17918
2020
2121extern const device_type TI99_EVPC;
2222
23typedef struct _evpc_palette
23struct evpc_palette
2424{
2525   UINT8      read_index, write_index, mask;
2626   int       read;
2727   int       state;
2828   struct { UINT8 red, green, blue; } color[0x100];
2929   //int dirty;
30} evpc_palette;
30};
3131
3232class snug_enhanced_video_device : public ti_expansion_card_device, public device_nvram_interface
3333{
trunk/src/mess/machine/ti99/videowrp.h
r17917r17918
7777extern const device_type TISOUND_94624;
7878extern const device_type TISOUND_76496;
7979
80typedef struct _ti_sound_config
80struct ti_sound_config
8181{
8282   devcb_write_line            ready;
83} ti_sound_config;
83};
8484
8585#define TI_SOUND_CONFIG(name) \
8686   const ti_sound_config(name) =
trunk/src/mess/machine/ti99/speech8.h
r17917r17918
2121#define SPEECH8_CONFIG(name) \
2222   const speech8_config(name) =
2323
24typedef struct _speech8_config
24struct speech8_config
2525{
2626   devcb_write_line ready;
27} speech8_config;
27};
2828
2929
3030class ti998_spsyn_device : public bus8z_device
trunk/src/mess/machine/ti99/datamux.h
r17917r17918
2323    if the HGSPL expansion card is used, the GROMs in the console must be
2424    removed.
2525*/
26typedef struct _dmux_device_list_entry
26struct dmux_device_list_entry
2727{
2828   const char            *name;            // Name of the device (used for looking up the device)
2929   UINT16               select;            // State of the address line bits when addressing this device
r17917r17918
3232   const char            *setting;         // configuration switch that may have an effect for the presence of this device
3333   UINT8               set;            // bits that must be set for this switch so that this device is present
3434   UINT8               unset;            // bits that must be reset for this switch so that this device is present
35} dmux_device_list_entry;
35};
3636
3737#define DMUX_CONFIG(name) \
3838   const datamux_config(name) =
3939
40typedef struct _datamux_config
40struct datamux_config
4141{
4242   devcb_write_line            ready;
4343   const dmux_device_list_entry   *devlist;
44} datamux_config;
44};
4545
4646/*
4747    Device list of this datamux.
trunk/src/mess/machine/ti99/peribox.h
r17917r17918
2323
2424#define DSRROM "dsrrom"
2525
26typedef struct _peribox_config
26struct peribox_config
2727{
2828   devcb_write_line   inta;
2929   devcb_write_line   intb;
3030   devcb_write_line   ready;
3131   int               prefix;
32} peribox_config;
32};
3333
3434#define PERIBOX_CONFIG(name) \
3535   const peribox_config(name) =
trunk/src/mess/machine/ti99/mapper8.h
r17917r17918
3636#define SRAM_SIZE 2048
3737#define DRAM_SIZE 65536
3838
39typedef struct _mapper8_list_entry
39struct mapper8_list_entry
4040{
4141   const char*   name;            // Name of the device (used for looking up the device)
4242   int         mode;            // Mode of the system which applies to this entry
r17917r17918
4444   UINT32      select_pattern;      // State of the address line bits when addressing this device
4545   UINT32      address_mask;      // Bits of the address bus used to address this device
4646   UINT32      write_select;      // Additional bits set when doing write accesses to this device
47} mapper8_list_entry;
47};
4848
4949#define MAPPER8_CONFIG(name) \
5050   const mapper8_config(name) =
5151
52typedef struct _mapper8_config
52struct mapper8_config
5353{
5454   devcb_write_line            ready;
5555   const mapper8_list_entry      *devlist;
56} mapper8_config;
56};
5757
5858/*
5959    Device list of the mapper.
trunk/src/mess/machine/990_hd.c
r17917r17918
4040/* We can use MAME's harddisk.c image format instead. */
4141
4242/* machine-independent big-endian 32-bit integer */
43typedef struct UINT32BE
43struct UINT32BE
4444{
4545   UINT8 bytes[4];
46} UINT32BE;
46};
4747
4848INLINE UINT32 get_UINT32BE(UINT32BE word)
4949{
r17917r17918
6161#endif
6262
6363/* disk image header */
64typedef struct disk_image_header
64struct disk_image_header
6565{
6666   UINT32BE cylinders;         /* number of cylinders on hard disk (big-endian) */
6767   UINT32BE heads;            /* number of heads on hard disk (big-endian) */
6868   UINT32BE sectors_per_track;   /* number of sectors per track on hard disk (big-endian) */
6969   UINT32BE bytes_per_sector;   /* number of bytes of data per sector on hard disk (big-endian) */
70} disk_image_header;
70};
7171
7272enum
7373{
r17917r17918
8181};
8282
8383/* disk drive unit descriptor */
84typedef struct hd_unit_t
84struct hd_unit_t
8585{
8686   device_image_interface *img;                  /* image descriptor */
8787   format_t format;
r17917r17918
9191
9292   /* disk geometry */
9393   unsigned int cylinders, heads, sectors_per_track, bytes_per_sector;
94} hd_unit_t;
94};
9595
9696/* disk controller */
97typedef struct hdc_t
97struct hdc_t
9898{
9999   UINT16 w[8];
100100
101101   void (*interrupt_callback)(running_machine &machine, int state);
102102
103103   hd_unit_t d[MAX_DISK_UNIT];
104} hdc_t;
104};
105105
106106/* masks for individual bits controller registers */
107107enum
trunk/src/mess/machine/kay_kbd.c
r17917r17918
6464 * - "Keypad ," is not mapped
6565 */
6666
67typedef struct _kay_kbd_t
67struct kay_kbd_t
6868{
6969   device_t *beeper;
7070   UINT8 buff[16];
r17917r17918
7878   int key;
7979   int repeat;
8080   int repeater;
81} kay_kbd_t;
81};
8282
8383INPUT_PORTS_START( kay_kbd )
8484   PORT_START("ROW0")
trunk/src/mess/machine/thomflop.c
r17917r17918
495495#define QDD_MAXBUF ( THOM_QDD_SIZE_ID + THOM_QDD_SIZE_DATA ) * 512
496496
497497
498static struct _to7qdd
498struct to7qdd_t
499499{
500500   /* MC6852 registers */
501501   UINT8 status;
r17917r17918
514514   UINT8  data_crc;          /* checksum when writing */
515515   UINT8  index_pulse;       /* one pulse per track */
516516
517} * to7qdd;
517};
518518
519static to7qdd_t * to7qdd;
519520
520521
522
521523static void to7_qdd_index_pulse_cb ( device_t *controller,device_t *image, int state )
522524{
523525   to7qdd->index_pulse = state;
r17917r17918
860862{
861863   LOG(( "to7_qdd_init: CQ 90-028 controller\n" ));
862864
863   to7qdd = auto_alloc(machine, struct _to7qdd);
865   to7qdd = auto_alloc(machine, to7qdd_t);
864866
865867   state_save_register_global( machine, to7qdd->status );
866868   state_save_register_global( machine, to7qdd->ctrl1 );
r17917r17918
904906#define THOM_MAXBUF ( THOM_QDD_SIZE_ID + THOM_QDD_SIZE_DATA ) * 512
905907
906908
907static struct _thmfc1
909struct thmfc1_t
908910{
909911
910912   UINT8   op;
r17917r17918
928930
929931   UINT8   stat0;             /* status register */
930932
931} * thmfc1;
933};
932934
935static thmfc1_t * thmfc1;
933936
937
934938static emu_timer* thmfc_floppy_cmd;
935939
936940
r17917r17918
15601564{
15611565   LOG(( "thmfc_floppy_init: THMFC1 controller\n" ));
15621566
1563   thmfc1 = auto_alloc(machine, struct _thmfc1);
1567   thmfc1 = auto_alloc(machine, thmfc1_t);
15641568
15651569   thmfc_floppy_cmd = machine.scheduler().timer_alloc(FUNC(thmfc_floppy_cmd_complete_cb));
15661570
trunk/src/mess/machine/corvushd.c
r17917r17918
320320};
321321
322322// Structure of Block #1, the Disk Parameter Block
323typedef struct {
323struct disk_parameter_block_t {
324324   struct {
325325      UINT8   lsb;
326326      UINT8   msb;
r17917r17918
337337      UINT8   lsb;
338338      UINT8   msb;
339339   } revh_spare_table[16];
340} disk_parameter_block_t;
340};
341341
342342// Structure of Block #3, the Constellation Parameter Block
343343struct constellation_parameter_block_t {
r17917r17918
351351};
352352
353353// Structure of Block #7, the Semaphore Table Block
354typedef struct {
354struct semaphore_table_block_t {
355355   union {
356356      UINT8   semaphore_table[256];         // Table consists of 256 bytes
357357      struct {
r17917r17918
359359      } semaphore_entry[32];               // 32 Entries
360360   } semaphore_block;
361361   UINT8   unused[256];                  // Remaining half of block is unused
362} semaphore_table_block_t;
362};
363363
364364// Command size structure (number of bytes to xmit and recv for each command)
365365struct corvus_cmd_t {
trunk/src/mess/machine/mac.c
r17917r17918
31663166#ifdef MAC_TRACETRAP
31673167static void mac_tracetrap(const char *cpu_name_local, int addr, int trap)
31683168{
3169   typedef struct
3169   struct sonycscodeentry
31703170   {
31713171      int csCode;
31723172      const char *name;
3173   } sonycscodeentry;
3173   };
31743174
31753175   static const sonycscodeentry cscodes[] =
31763176   {
trunk/src/mess/machine/i8271.h
r17917r17918
3636    TYPE DEFINITIONS
3737***************************************************************************/
3838
39typedef struct i8271_interface
39struct i8271_interface
4040{
4141   void (*interrupt)(device_t *device, int state);
4242   void (*dma_request)(device_t *device, int state, int read_);
4343   const char *floppy_drive_tags[2];
44} i8271_interface;
44};
4545
4646/***************************************************************************
4747    FUNCTION PROTOTYPES
trunk/src/mess/machine/amigacd.c
r17917r17918
5959#define ISTR_FF_FLG     (1<<1)  /* FIFO-Full Flag */
6060#define ISTR_FE_FLG     (1<<0)  /* FIFO-Empty Flag */
6161
62struct _dmac_data
62struct dmac_data_t
6363{
6464   UINT16      istr;      /* Interrupt Status Register (R) */
6565   UINT16      cntr;      /* Control Register (RW) */
r17917r17918
6969   emu_timer *dma_timer;
7070};
7171
72static _dmac_data dmac_data;
72static dmac_data_t dmac_data;
7373
7474static void check_interrupts( running_machine &machine )
7575{
trunk/src/mess/machine/upd7002.c
r17917r17918
1212#include "upd7002.h"
1313
1414
15typedef struct _uPD7002_t uPD7002_t;
16struct _uPD7002_t
15struct uPD7002_t
1716{
1817   /* Pointer to our interface */
1918   const uPD7002_interface *intf;
trunk/src/mess/machine/nes_unif.c
r17917r17918
99
1010****************************************************************************************/
1111
12typedef struct __unif
12struct unif
1313{
1414   const char *board; /* UNIF board */
1515
r17917r17918
1717   int wram;
1818   int chrram;
1919   int board_idx;
20} unif;
20};
2121
2222
2323/*************************************************************
trunk/src/mess/machine/upd7002.h
r17917r17918
4747#define UPD7002_EOC(name)   void name(device_t *device, int data )
4848
4949
50typedef struct _uPD7002_interface uPD7002_interface;
51struct _uPD7002_interface
50struct uPD7002_interface
5251{
5352   uPD7002_get_analogue_func get_analogue_func;
5453   uPD7002_eoc_func        EOC_func;
trunk/src/mess/machine/rmnimbus.c
r17917r17918
28312831static void mouse_js_reset(running_machine &machine)
28322832{
28332833   rmnimbus_state *drvstate = machine.driver_data<rmnimbus_state>();
2834    _mouse_joy_state *state = &drvstate->m_nimbus_mouse;
2834    mouse_joy_state *state = &drvstate->m_nimbus_mouse;
28352835
28362836    state->m_mouse_px=0;
28372837    state->m_mouse_py=0;
r17917r17918
28602860    int     xint;
28612861    int     yint;
28622862
2863    _mouse_joy_state *state = &drvstate->m_nimbus_mouse;
2863    mouse_joy_state *state = &drvstate->m_nimbus_mouse;
28642864
28652865
28662866   state->m_reg0a4 = machine.root_device().ioport(MOUSE_BUTTON_TAG)->read() | 0xC0;
r17917r17918
30003000    */
30013001   UINT8 result;
30023002   //int pc=machine().device(MAINCPU_TAG)->safe_pc();
3003   _mouse_joy_state *state = &m_nimbus_mouse;
3003   mouse_joy_state *state = &m_nimbus_mouse;
30043004
30053005   if (ioport("config")->read() & 0x01)
30063006   {
trunk/src/mess/machine/smc92x4.h
r17917r17918
3636#define DS_READY   0x02      /* drive ready bit */
3737#define DS_WRFAULT   0x01      /* write fault */
3838
39typedef struct _smc92x4_interface
39struct smc92x4_interface
4040{
4141   // Disk format support. This flag allows to choose between the full
4242   // FM/MFM format and an abbreviated track layout. The difference results
r17917r17918
7070   // by external circuitry. */
7171   devcb_write8   dma_write;
7272
73} smc92x4_interface;
73};
7474
7575
7676class smc92x4_device : public device_t
trunk/src/mess/includes/pdp1.h
r17917r17918
164164};
165165
166166/* tape reader registers */
167typedef struct tape_reader_t
167struct tape_reader_t
168168{
169169   device_image_interface *fd;   /* file descriptor of tape image */
170170
r17917r17918
177177   int rcp;      /* 1-bit reader "need a completion pulse" flip-flop */
178178
179179   emu_timer *timer;   /* timer to simulate reader timing */
180} tape_reader_t;
180};
181181
182182
183183
184184/* tape puncher registers */
185typedef struct tape_puncher_t
185struct tape_puncher_t
186186{
187187   device_image_interface *fd;   /* file descriptor of tape image */
188188
189189   emu_timer *timer;   /* timer to generate completion pulses */
190} tape_puncher_t;
190};
191191
192192
193193
194194/* typewriter registers */
195typedef struct typewriter_t
195struct typewriter_t
196196{
197197   device_image_interface *fd;   /* file descriptor of output image */
198198
199199   int tb;         /* typewriter buffer */
200200
201201   emu_timer *tyo_timer;/* timer to generate completion pulses */
202} typewriter_t;
202};
203203
204204/* MIT parallel drum (mostly similar to type 23) */
205typedef struct parallel_drum_t
205struct parallel_drum_t
206206{
207207   device_image_interface *fd;   /* file descriptor of drum image */
208208
r17917r17918
216216
217217   emu_timer *rotation_timer;   /* timer called each time dc is 0 */
218218   emu_timer *il_timer;      /* timer called each time dc is il */
219} parallel_drum_t;
219};
220220
221221
222typedef struct lightpen_t
222struct lightpen_t
223223{
224224   char active;
225225   char down;
226226   short x, y;
227227   short radius;
228} lightpen_t;
228};
229229
230230
231231class pdp1_state : public driver_device
trunk/src/mess/includes/coco.h
r17917r17918
179179   static const device_timer_id TIMER_HIRES_JOYSTICK_Y = 1;
180180   static const device_timer_id TIMER_DIECOM_LIGHTGUN = 2;
181181
182   typedef enum
182   enum soundmux_status_t
183183   {
184184      SOUNDMUX_SEL1 = 1,
185185      SOUNDMUX_SEL2 = 2,
186186      SOUNDMUX_ENABLE = 4
187   } soundmux_status_t;
187   };
188188
189   typedef enum
189   enum joystick_type_t
190190   {
191191      JOYSTICK_NONE = 0x00,
192192      JOYSTICK_NORMAL = 0x01,
193193      JOYSTICK_RAT_MOUSE = 0x02,
194194      JOYSTICK_DIECOM_LIGHT_GUN = 0x03
195   } joystick_type_t;
195   };
196196
197   typedef enum
197   enum hires_type_t
198198   {
199199      HIRES_NONE = 0x00,
200200      HIRES_RIGHT = 0x01,
201201      HIRES_RIGHT_COCOMAX3 = 0x02,
202202      HIRES_LEFT = 0x03,
203203      HIRES_LEFT_COCOMAX3 = 0x04,
204   } hires_type_t;
204   };
205205
206   typedef struct
206   struct analog_input_t
207207   {
208208      ioport_port *m_input[2][2];
209209      ioport_port *m_buttons;
210210
211211      UINT8 input(int joystick, int axis) const { return m_input[joystick][axis] ? m_input[joystick][axis]->read() : 0x00; }
212212      UINT8 buttons(void) const { return m_buttons ? m_buttons->read() : 0x00; }
213   } analog_input_t;
213   };
214214
215215   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);
216216
trunk/src/mess/includes/lisa.h
r17917r17918
1616#define KB_COP421_TAG   "kbcop"
1717
1818/* lisa MMU segment regs */
19typedef struct real_mmu_entry
19struct real_mmu_entry
2020{
2121   UINT16 sorg;
2222   UINT16 slim;
23} real_mmu_entry;
23};
2424
2525/* MMU regs translated into a more efficient format */
2626enum mmu_entry_t { RAM_stack_r, RAM_r, RAM_stack_rw, RAM_rw, IO, invalid, special_IO };
2727
28typedef struct mmu_entry
28struct mmu_entry
2929{
3030   offs_t sorg;   /* (real_sorg & 0x0fff) << 9 */
3131   mmu_entry_t type;   /* <-> (real_slim & 0x0f00) */
3232   int slim;   /* (~ ((real_slim & 0x00ff) << 9)) & 0x01ffff */
33} mmu_entry;
33};
3434
3535enum floppy_hardware_t
3636{
r17917r17918
4848};         /* clock mode */
4949
5050/* clock registers */
51typedef struct _clock_regs_t
51struct clock_regs_t
5252{
5353   long alarm;      /* alarm (20-bit binary) */
5454   int years;      /* years (4-bit binary ) */
r17917r17918
6666   int clock_write_ptr;   /* clock byte to be written next (-1 if clock write disabled) */
6767
6868   enum clock_mode_t clock_mode;
69} clock_regs_t;
69};
7070
71typedef struct _lisa_features_t
71struct lisa_features_t
7272{
7373   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) */
7474                              /* Note that the beep routine in boot ROMs implies that
r17917r17918
8686   floppy_hardware_t floppy_hardware;
8787   unsigned int has_double_sided_floppy : 1;   /* true on lisa 1 and *hacked* lisa 2/10 / Mac XL */
8888   unsigned int has_mac_xl_video : 1;   /* modified video for MacXL */
89} lisa_features_t;
89};
9090
9191
9292class lisa_state : public driver_device
trunk/src/mess/includes/kaypro.h
r17917r17918
1212#include "sound/beep.h"
1313#include "video/mc6845.h"
1414
15struct kay_kbd_t;
1516
1617class kaypro_state : public driver_device
1718{
r17917r17918
6566   UINT8 m_framecnt;
6667   UINT16 m_cursor;
6768   UINT16 m_mc6845_video_address;
68   struct _kay_kbd_t *m_kbd;
69   kay_kbd_t *m_kbd;
6970   void mc6845_cursor_configure();
7071   void mc6845_screen_configure();
7172   DECLARE_MACHINE_START(kayproii);
trunk/src/mess/includes/tx0.h
r17917r17918
5555
5656
5757/* tape reader registers */
58typedef struct tape_reader_t
58struct tape_reader_t
5959{
6060   device_image_interface *fd;   /* file descriptor of tape image */
6161
r17917r17918
6565   int rc;         /* 2-bit reader counter */
6666
6767   emu_timer *timer;   /* timer to simulate reader timing */
68} tape_reader_t;
68};
6969
7070
7171
7272/* tape puncher registers */
73typedef struct tape_puncher_t
73struct tape_puncher_t
7474{
7575   device_image_interface *fd;   /* file descriptor of tape image */
7676
7777   emu_timer *timer;   /* timer to generate completion pulses */
78} tape_puncher_t;
78};
7979
8080
8181
8282/* typewriter registers */
83typedef struct typewriter_t
83struct typewriter_t
8484{
8585   device_image_interface *fd;   /* file descriptor of output image */
8686
8787   emu_timer *prt_timer;/* timer to generate completion pulses */
88} typewriter_t;
88};
8989
9090
9191/* magnetic tape unit registers */
92typedef struct magtape_t
92struct magtape_t
9393{
9494   device_image_interface *img;      /* image descriptor */
9595
r17917r17918
121121   int long_parity;
122122
123123   emu_timer *timer;   /* timer to simulate reader timing */
124} magtape_t;
124};
125125
126126
127127class tx0_state : public driver_device
trunk/src/mess/includes/enterp.h
r17917r17918
1414#define NICK_PALETTE_SIZE   256
1515
1616
17struct NICK_STATE;
18
1719class ep_state : public driver_device
1820{
1921public:
r17917r17918
2325   UINT8 exdos_card_value;  /* state of the wd1770 irq/drq lines */
2426   UINT8 keyboard_line;     /* index of keyboard line to read */
2527   bitmap_ind16 m_bitmap;
26   struct _NICK_STATE *nick;
28   NICK_STATE *nick;
2729   DECLARE_READ8_MEMBER(exdos_card_r);
2830   DECLARE_WRITE8_MEMBER(exdos_card_w);
2931   virtual void machine_reset();
trunk/src/mess/includes/rmnimbus.h
r17917r17918
152152};
153153
154154/* Mouse/Joystick */
155struct _mouse_joy_state
155struct mouse_joy_state
156156{
157157   UINT8   m_mouse_px;
158158   UINT8   m_mouse_py;
r17917r17918
186186   UINT8 m_mcu_reg080;
187187   UINT8 m_iou_reg092;
188188   UINT8 m_last_playmode;
189   _mouse_joy_state m_nimbus_mouse;
189   mouse_joy_state m_nimbus_mouse;
190190   UINT8 m_ay8910_a;
191191   UINT16 m_IOPorts[num_ioports];
192192   UINT8 m_sio_int_state;
trunk/src/mess/includes/odyssey2.h
r17917r17918
2424#define I824X_SCREEN_HEIGHT            243
2525#define I824X_LINE_CLOCKS            228
2626
27typedef union {
27union o2_vdc_t {
2828    UINT8 reg[0x100];
2929    struct {
3030   struct {
r17917r17918
5252   UINT8 hgrid[2][0x10];
5353   UINT8 vgrid[0x10];
5454    } s;
55} o2_vdc_t;
55};
5656
5757struct ef9341_t
5858{
trunk/src/mess/video/911_vdt.c
r17917r17918
7979   2, 1   /* low intensity, reverse */
8080};
8181
82typedef struct vdt_t
82struct vdt_t
8383{
8484   vdt911_screen_size_t screen_size;   /* char_960 for 960-char, 12-line model; char_1920 for 1920-char, 24-line model */
8585   vdt911_model_t model;            /* country code */
r17917r17918
110110   UINT8 last_key_pressed;
111111   int last_modifier_state;
112112   char foreign_mode;
113} vdt_t;
113};
114114
115115/*
116116    Macros for model features
r17917r17918
576576{
577577   vdt_t *vdt = get_safe_token(device);
578578
579   typedef enum
579   enum modifier_state_t
580580   {
581581      /* states for western keyboards and katakana/arabic keyboards in romaji/latin mode */
582582      lower_case = 0, upper_case, shift, control,
r17917r17918
584584      foreign, foreign_shift,
585585      /* special value to stop repeat if the modifier state changes */
586586      special_debounce = -1
587   } modifier_state_t;
587   };
588588
589589   static unsigned char repeat_timer;
590590   enum { repeat_delay = 5 /* approx. 1/10s */ };
trunk/src/mess/video/911_vdt.h
r17917r17918
3333   vdt911_model_FrenchWP   /* French word processing */
3434};
3535
36typedef struct vdt911_init_params_t
36struct vdt911_init_params_t
3737{
3838   vdt911_screen_size_t screen_size;
3939   vdt911_model_t model;
4040   void (*int_callback)(running_machine &machine, int state);
41} vdt911_init_params_t;
41};
4242
4343PALETTE_INIT( vdt911 );
4444
trunk/src/mess/video/epnick.c
r17917r17918
4343
4444/* Nick executes a Display list, in the form of a list of Line Parameter
4545Tables, this is the form of the data */
46typedef struct LPT_ENTRY
46struct LPT_ENTRY
4747{
4848   unsigned char SC;      /* scanlines in this modeline (two's complement) */
4949   unsigned char MB;      /* the MODEBYTE (defines video display mode) */
r17917r17918
5454   unsigned char LD2L;   /* (a7..a0) of line data pointer LD2 */
5555   unsigned char LD2H;   /* (a8..a15) of line data pointer LD2 */
5656   unsigned char COL[8];   /* COL0..COL7 */
57} LPT_ENTRY;
57};
5858
59typedef struct _NICK_STATE
59struct NICK_STATE
6060{
6161   /* horizontal position */
6262   unsigned char HorizontalClockCount;
r17917r17918
9090   unsigned int PenIndexLookup_16Colour[256];
9191
9292   UINT8 *videoram;
93} NICK_STATE;
93};
9494
9595/* colour mode types */
9696#define   NICK_2_COLOUR_MODE   0
trunk/src/mess/video/911_chr.h
r17917r17918
7575/* structure used to describe differences between national character sets and
7676US character set */
7777/* much more compact than defining the complete 128-char vector */
78typedef struct char_override_t
78struct char_override_t
7979{
8080   unsigned char char_index;      /* char to replace */
8181   unsigned short symbol_index;   /* replacement symbol */
82} char_override_t;
82};
8383
8484/* One UK-specific character */
8585static const char_override_t UK_overrides[1] =
trunk/src/mess/video/mc6847.h
r17917r17918
261261      static pixel_t mix_color(double factor, UINT8 c0, UINT8 c1);
262262   };
263263
264   typedef enum
264   enum border_color_t
265265   {
266266      BORDER_COLOR_BLACK,
267267      BORDER_COLOR_GREEN,
268268      BORDER_COLOR_WHITE,
269269      BORDER_COLOR_ORANGE
270   } border_color_t;
270   };
271271
272272   // callbacks
273273   devcb_resolved_write_line m_res_out_hsync_func;
trunk/src/mess/video/pc_aga.h
r17917r17918
2525MACHINE_CONFIG_EXTERN( pcvideo_pc200 );
2626
2727
28typedef enum AGA_MODE { AGA_OFF, AGA_COLOR, AGA_MONO } AGA_MODE;
28enum AGA_MODE { AGA_OFF, AGA_COLOR, AGA_MONO };
2929void pc_aga_set_mode(running_machine &machine, AGA_MODE mode);
3030
3131READ8_HANDLER( pc_aga_videoram_r );
trunk/src/mess/video/733_asr.c
r17917r17918
658658void asr733_keyboard(device_t *device)
659659{
660660   asr_t *asr = get_safe_token(device);
661   typedef enum
661   enum modifier_state_t
662662   {
663663      /* key modifier states */
664664      unshifted = 0, shift, control,
665665      /* special value to stop repeat if the modifier state changes */
666666      special_debounce = -1
667   } modifier_state_t;
667   } ;
668668
669669   enum { repeat_delay = 5 /* approx. 1/10s */ };
670670
trunk/src/mess/video/733_asr.h
r17917r17918
99   asr733_chr_region_len   = 128*asr733_single_char_len
1010};
1111
12typedef struct asr733_init_params_t
12struct asr733_init_params_t
1313{
1414   void (*int_callback)(running_machine &machine, int state);
15} asr733_init_params_t;
15};
1616
1717GFXDECODE_EXTERN( asr733 );
1818
trunk/src/mess/video/gime.h
r17917r17918
141141      INTERRUPT_EI0      = 0x01
142142   };
143143
144   typedef enum
144   enum timer_type_t
145145   {
146146      GIME_TIMER_HBORD,
147147      GIME_TIMER_CLOCK
148   } timer_type_t;
148   };
149149
150150   // timer constants
151151   static const device_timer_id TIMER_GIME_CLOCK = 4;
trunk/src/mess/video/k1ge.c
r17917r17918
1010#include "emu.h"
1111#include "k1ge.h"
1212
13typedef struct k1ge k1ge_t;
14struct k1ge
13struct k1ge_t
1514{
1615   const k1ge_interface *intf;
1716   screen_device *screen;
trunk/src/mess/drivers/vboy.c
r17917r17918
3030#include "audio/vboy.h"
3131#include "vboy.lh"
3232
33typedef struct _vboy_regs_t vboy_regs_t;
34
3533/* FIXME: most if not all of these must be UINT8 */
36struct _vboy_regs_t
34struct vboy_regs_t
3735{
3836   UINT32 lpc, lpc2, lpt, lpr;
3937   UINT32 khb, klb;
r17917r17918
6361   UINT16 BKCOL;
6462};
6563
66struct _vboy_timer_t
64struct vboy_timer_t
6765{
6866   UINT16 count;
6967   UINT16 latch;
7068};
7169
72typedef struct _vboy_timer_t vboy_timer_t;
70struct vboy_timer_t;
7371
7472class vboy_state : public driver_device
7573{

Previous 199869 Revisions Next


© 1997-2024 The MAME Team