Previous 15994 Revisions Next

r2156 Sunday 30th March, 2008 at 08:52:39 UTC by Firewave
Use DEVICE_* macros
[src/mess/devices]appldriv.c basicdsk.c cartslot.c cassette.c chd_cd.c coco_vhd.c dsk.c harddriv.c harddriv.h mflopimg.c mfmdisk.c snapquik.c sonydriv.c
[src/mess/drivers]apexc.c arcadia.c exelv.c exidy.c genesis.c lynx.c pasogo.c snes.c tm990189.c tutor.c
[src/mess/machine]cbmserb.c vc20tape.c

src/mess/devices/harddriv.c
r2155r2156
9494 *
9595 *************************************/
9696
97int device_init_mess_hd(mess_image *image)
97DEVICE_INIT( mess_hd )
9898{
9999   struct mess_hd *hd;
100100
r2155r2156
172172
173173
174174
175int device_load_mess_hd(mess_image *image)
175DEVICE_LOAD( mess_hd )
176176{
177177   return internal_load_mess_hd(image, NULL);
178178}
179179
180180
181181#ifdef UNUSED_FUNCTION
182static int device_create_mess_hd(mess_image *image, int create_format, option_resolution *create_args)
182static DEVICE_CREATE( mess_hd )
183183{
184184   int err;
185185   char metadata[256];
r2155r2156
216216 *
217217 *************************************/
218218
219void device_unload_mess_hd(mess_image *image)
219DEVICE_UNLOAD( mess_hd )
220220{
221221   struct mess_hd *hd = get_drive(image);
222222   assert(hd->hard_disk_handle);
src/mess/devices/harddriv.h
r2155r2156
1414#include "harddisk.h"
1515
1616
17int device_init_mess_hd(mess_image *image);
18int device_load_mess_hd(mess_image *image);
19void device_unload_mess_hd(mess_image *image);
17DEVICE_INIT( mess_hd );
18DEVICE_LOAD( mess_hd );
19DEVICE_UNLOAD( mess_hd );
2020
2121hard_disk_file *mess_hd_get_hard_disk_file(mess_image *image);
2222hard_disk_file *mess_hd_get_hard_disk_file_by_number(int drivenum);
src/mess/devices/cassette.c
r2155r2156
229229   cassette device init/load/unload/specify
230230*********************************************************************/
231231
232static int device_init_cassette(mess_image *image)
232static DEVICE_INIT( cassette )
233233{
234234   const struct IODevice *dev;
235235
r2155r2156
245245
246246
247247
248static int device_load_cassette(mess_image *image)
248static DEVICE_LOAD( cassette )
249249{
250250   casserr_t err;
251251   int cassette_flags;
r2155r2156
305305
306306
307307
308static void device_unload_cassette(mess_image *image)
308static DEVICE_UNLOAD( cassette )
309309{
310310   struct mess_cassetteimg *tag;
311311
src/mess/devices/sonydriv.c
r2155r2156
488488
489489
490490
491static void device_unload_sonydriv_floppy(mess_image *image)
491static DEVICE_UNLOAD( sonydriv_floppy )
492492{
493493   int id;
494494   device_unload_handler parent_unload;
src/mess/devices/mfmdisk.c
r2155r2156
305305
306306
307307/* load image */
308int device_load_mfm_disk(mess_image *image)
308DEVICE_LOAD( mfm_disk )
309309{
310310   struct mfm_disk_info *pDisk = get_disk(image);
311311
src/mess/devices/cartslot.c
r2155r2156
141141
142142
143143
144static int device_init_cartslot_specified(mess_image *image)
144static DEVICE_INIT( cartslot_specified )
145145{
146146   process_cartridge(image, NULL);
147147   return 0;
148148}
149149
150static int device_load_cartslot_specified(mess_image *image)
150static DEVICE_LOAD( cartslot_specified )
151151{
152152   return process_cartridge(image, image);
153153}
154154
155static void device_unload_cartslot_specified(mess_image *image)
155static DEVICE_UNLOAD( cartslot_specified )
156156{
157157   process_cartridge(image, NULL);
158158}
src/mess/devices/chd_cd.c
r2155r2156
9696 *
9797 *************************************/
9898
99static int device_init_mess_cd(mess_image *image)
99static DEVICE_INIT( mess_cd )
100100{
101101   struct mess_cd *cd;
102102
r2155r2156
114114/*************************************
115115 *
116116 *   device_load_mess_cd()
117 *   device_create_mess_cd()
118117 *
119 *   Device load and create
118 *   Device load
120119 *
121120 *************************************/
122121
r2155r2156
152151
153152
154153
155static int device_load_mess_cd(mess_image *image)
154static DEVICE_LOAD( mess_cd )
156155{
157156   return internal_load_mess_cd(image, NULL);
158157}
r2155r2156
167166 *
168167 *************************************/
169168
170static void device_unload_mess_cd(mess_image *image)
169static DEVICE_UNLOAD( mess_cd )
171170{
172171   struct mess_cd *cd = get_drive(image);
173172   assert(cd->cdrom_handle);
src/mess/devices/mflopimg.c
r2155r2156
257257/* ----------------------------------------------------------------------- */
258258
259259
260static int device_init_floppy(mess_image *image)
260static DEVICE_INIT( floppy )
261261{
262262    if (!image_alloctag(image, FLOPPY_TAG, sizeof(mess_flopimg)))
263263      return INIT_FAIL;
r2155r2156
332332
333333
334334
335static int device_load_floppy(mess_image *image)
335static DEVICE_LOAD( floppy )
336336{
337337   return internal_floppy_device_load(image, -1, NULL);
338338}
339339
340340
341341
342static int device_create_floppy(mess_image *image, int create_format, option_resolution *create_args)
342static DEVICE_CREATE( floppy )
343343{
344344   return internal_floppy_device_load(image, create_format, create_args);
345345}
346346
347347
348348
349static void device_unload_floppy(mess_image *image)
349static DEVICE_UNLOAD( floppy )
350350{
351351   mess_flopimg *flopimg;
352352   flopimg = image_lookuptag(image, FLOPPY_TAG);
src/mess/devices/dsk.c
r2155r2156
7171
7272
7373
74static int device_init_dsk_floppy(mess_image *image)
74static DEVICE_INIT( dsk_floppy )
7575{
7676   return floppy_drive_init(image, NULL);
7777}
r2155r2156
7979
8080
8181/* load floppy */
82static int device_load_dsk_floppy(mess_image *image)
82static DEVICE_LOAD( dsk_floppy )
8383{
8484   int id = image_index_in_device(image);
8585   dsk_drive *thedrive = &drives[id];
r2155r2156
122122}
123123
124124
125static void device_unload_dsk_floppy(mess_image *image)
125static DEVICE_UNLOAD( dsk_floppy )
126126{
127127   int id = image_index_in_device(image);
128128   dsk_drive *thedrive = &drives[id];
src/mess/devices/appldriv.c
r2155r2156
276276
277277/* ----------------------------------------------------------------------- */
278278
279static int device_init_apple525_floppy(mess_image *image)
279static DEVICE_INIT( apple525_floppy )
280280{
281281   device_init_handler parent_init;
282282
r2155r2156
289289
290290
291291
292static int device_load_apple525_floppy(mess_image *image)
292static DEVICE_LOAD( apple525_floppy )
293293{
294294   int result;
295295   device_load_handler parent_load;
r2155r2156
304304
305305
306306
307static void device_unload_apple525_floppy(mess_image *image)
307static DEVICE_UNLOAD( apple525_floppy )
308308{
309309   device_unload_handler parent_unload;
310310
src/mess/devices/basicdsk.c
r2155r2156
8484   return &basicdsk_drives[drive];
8585}
8686
87int device_init_basicdsk_floppy(mess_image *image)
87DEVICE_INIT( basicdsk_floppy )
8888{
8989   return floppy_drive_init(image, &basicdsk_floppy_interface);
9090}
9191
9292/* attempt to insert a disk into the drive specified with id */
93int device_load_basicdsk_floppy(mess_image *image)
93DEVICE_LOAD( basicdsk_floppy )
9494{
9595   basicdsk *w = get_basicdsk(image);
9696
r2155r2156
109109   return INIT_PASS;
110110}
111111
112void device_unload_basicdsk_floppy(mess_image *image)
112DEVICE_UNLOAD( basicdsk_floppy )
113113{
114114   basicdsk *w = get_basicdsk(image);
115115   w->image_file = NULL;
src/mess/devices/coco_vhd.c
r2155r2156
6767
6868
6969
70static int device_init_coco_vhd(mess_image *image)
70static DEVICE_INIT( coco_vhd )
7171{
7272   vhd_status = VHDSTATUS_NO_VHD_ATTACHED;
7373   return INIT_PASS;
r2155r2156
7575
7676
7777
78static int device_load_coco_vhd(mess_image *image)
78static DEVICE_LOAD( coco_vhd )
7979{
8080   vhd_status = VHDSTATUS_POWER_ON_STATE;
8181   logical_record_number = 0;
src/mess/devices/snapquik.c
r2155r2156
3838
3939
4040
41static int device_load_snapquick(mess_image *image)
41static DEVICE_LOAD( snapquick )
4242{
4343   const struct IODevice *dev;
4444   struct snapquick_info *si;
r2155r2156
7070
7171
7272
73static void device_unload_snapquick(mess_image *image)
73static DEVICE_UNLOAD( snapquick )
7474{
7575   struct snapquick_info **si = &snapquick_infolist;
7676
src/mess/machine/cbmserb.c
r2155r2156
103103
104104
105105
106static int device_init_cbm_drive(mess_image *image)
106static DEVICE_INIT( cbm_drive )
107107{
108108   int id = image_index_in_device(image);
109109   if (id == 0)
r2155r2156
111111   return INIT_PASS;
112112}
113113
114static void device_exit_cbm_drive(mess_image *image)
114static DEVICE_EXIT( cbm_drive )
115115{
116116   int id = image_index_in_device(image);
117117   if (id == 0)
r2155r2156
121121
122122
123123/* open an d64 image */
124static int device_load_cbm_drive(mess_image *image)
124static DEVICE_LOAD( cbm_drive )
125125{
126126   int id = image_index_in_device(image);
127127
src/mess/machine/vc20tape.c
r2155r2156
912912   prg.c16 = 1;
913913}
914914
915static int device_load_vc20_tape(mess_image *image)
915static DEVICE_LOAD( vc20_tape )
916916{
917917   const char *cp;
918918
r2155r2156
937937   return INIT_PASS;
938938}
939939
940static void device_unload_vc20_tape(mess_image *image)
940static DEVICE_UNLOAD( vc20_tape )
941941{
942942   vc20_tape_close();
943943}
src/mess/drivers/arcadia.c
r2155r2156
371371   ROM_REGION(0x100,REGION_GFX1, ROMREGION_ERASEFF)
372372ROM_END
373373
374static int device_load_arcadia_cart(mess_image *image)
374static DEVICE_LOAD( arcadia_cart )
375375{
376376   UINT8 *rom = memory_region(REGION_CPU1);
377377   int size;
src/mess/drivers/tm990189.c
r2155r2156
483483/*
484484    Initialize rs232 unit and open image
485485*/
486static int device_load_tm990_189_rs232(mess_image *image)
486static DEVICE_LOAD( tm990_189_rs232 )
487487{
488488   int id = image_index_in_device(image);
489489
r2155r2156
502502/*
503503    close a rs232 image
504504*/
505static void device_unload_tm990_189_rs232(mess_image *image)
505static DEVICE_UNLOAD( tm990_189_rs232 )
506506{
507507   int id = image_index_in_device(image);
508508
src/mess/drivers/pasogo.c
r2155r2156
479479}
480480
481481
482static int device_load_pasogo_cart(mess_image *image)
482static DEVICE_LOAD( pasogo_cart )
483483{
484484   UINT8 *user = memory_region(REGION_USER1);
485485   int size;
src/mess/drivers/lynx.c
r2155r2156
322322    }
323323}
324324
325static int device_load_lynx_cart(mess_image *image)
325static DEVICE_LOAD( lynx_cart )
326326{
327327   UINT8 *rom = memory_region(REGION_USER1);
328328   int size;
src/mess/drivers/apexc.c
r2155r2156
4242/*
4343    Open cylinder image and read RAM
4444*/
45static int device_load_apexc_cylinder(mess_image *image)
45static DEVICE_LOAD( apexc_cylinder )
4646{
4747   /* open file */
4848   apexc_cylinder.fd = image;
r2155r2156
7272/*
7373    Save RAM to cylinder image and close it
7474*/
75static void device_unload_apexc_cylinder(mess_image *image)
75static DEVICE_UNLOAD( apexc_cylinder )
7676{
7777   if (apexc_cylinder.fd && apexc_cylinder.writable)
7878   {   /* save RAM contents */
r2155r2156
169169
170170
171171
172static int device_init_apexc_tape(mess_image *image)
172static DEVICE_INIT( apexc_tape )
173173{
174174   return INIT_PASS;
175175}
r2155r2156
179179/*
180180    Open a tape image
181181*/
182static int device_load_apexc_tape(mess_image *image)
182static DEVICE_LOAD( apexc_tape )
183183{
184184   int id = image_index_in_device(image);
185185   tape *t = &apexc_tapes[id];
src/mess/drivers/exidy.c
r2155r2156
9696#include "sound/speaker.h"
9797
9898
99static int device_load_exidy_floppy(mess_image *image)
99static DEVICE_LOAD( exidy_floppy )
100100{
101101   if (device_load_basicdsk_floppy(image)==INIT_PASS)
102102   {
src/mess/drivers/snes.c
r2155r2156
234234   MACHINE_START_CALL(snes);
235235}
236236
237static int device_load_snes_cart(mess_image *image)
237static DEVICE_LOAD( snes_cart )
238238{
239239   int i;
240240   running_machine *machine = image->machine;
src/mess/drivers/exelv.c
r2155r2156
8282    return INIT_PASS;
8383}
8484
85static void device_unload_exelv_cart(mess_image *image)
85static DEVICE_UNLOAD( exelv_cart )
8686{
8787}*/
8888
src/mess/drivers/tutor.c
r2155r2156
163163   return readinputport(offset);
164164}
165165
166static int device_load_tutor_cart(mess_image *image)
166static DEVICE_LOAD( tutor_cart )
167167{
168168   image_fread(image, memory_region(REGION_CPU1) + cartridge_base, 0x6000);
169169   return INIT_PASS;
170170}
171171
172static void device_unload_tutor_cart(mess_image *image)
172static DEVICE_UNLOAD( tutor_cart )
173173{
174174   memset(memory_region(REGION_CPU1) + cartridge_base, 0, 0x6000);
175175}
src/mess/drivers/genesis.c
r2155r2156
170170}
171171
172172
173static int device_load_genesis_cart(mess_image *image)
173static DEVICE_LOAD( genesis_cart )
174174{
175175   unsigned char *tmpROMnew, *tmpROM;
176176   unsigned char *secondhalf;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team