Previous 15994 Revisions Next

r9937 Thursday 6th January, 2011 at 09:20:32 UTC by Miodrag Milanović
Removed mess from names of some calls in image device code
[src/emu/imagedev]cassette.c cassette.h chd_cd.c chd_cd.h harddriv.c harddriv.h
[src/emu/machine]idectrl.c scsicd.c scsihd.c
[src/mame/drivers]megadriv.c
[src/mame/machine]stvcd.c
[src/mess]tiny.mak
[src/mess/devices]ti99_hd.c
[src/mess/drivers]fmtowns.c psx.c
[src/mess/machine]990_hd.c cdicdic.c corvushd.c dc.c gdrom.c matsucd.c pc_hdc.c pce.c
[src/mess/tools/imgtool]modules.c

src/mame/machine/stvcd.c
r9936r9937
256256   }
257257
258258   #ifdef MESS
259   cdrom = mess_cd_get_cdrom_file(machine->device( "cdrom" ));
259   cdrom = cd_get_cdrom_file(machine->device( "cdrom" ));
260260   #else
261261   cdrom = cdrom_open(get_disk_handle(machine, "cdrom"));
262262   #endif
src/mame/drivers/megadriv.c
r9936r9937
51365136      device = machine->device("cdrom");
51375137      if ( device )
51385138      {
5139         segacd.cd = mess_cd_get_cdrom_file(device);
5139         segacd.cd = cd_get_cdrom_file(device);
51405140         if ( segacd.cd )
51415141         {
51425142            segacd.toc = cdrom_get_toc( segacd.cd );
src/emu/imagedev/harddriv.c
r9936r9937
11/*********************************************************************
22
3    Code to interface the MESS image code with MAME's harddisk core.
3    Code to interface the image code with harddisk core.
44
55    We do not support diff files as it will involve some changes in
6    the MESS image code.  Additionally, the need for diff files comes
6    the image code.  Additionally, the need for diff files comes
77    from MAME's need for "cannonical" hard drive images.
88
99    Raphael Nabet 2003
r9936r9937
5555
5656
5757
58static OPTION_GUIDE_START(mess_hd_option_guide)
58static OPTION_GUIDE_START(hd_option_guide)
5959   OPTION_INT('C', "cylinders",      "Cylinders")
6060   OPTION_INT('H', "heads",         "Heads")
6161   OPTION_INT('S', "sectors",         "Sectors")
r9936r9937
6363   OPTION_INT('K', "hunksize",         "Hunk Bytes")
6464OPTION_GUIDE_END
6565
66static const char *mess_hd_option_spec =
66static const char *hd_option_spec =
6767   "C1-[512]-1024;H1/2/[4]/8;S1-[16]-64;L128/256/[512]/1024;K512/1024/2048/[4096]";
6868
6969
r9936r9937
8787
8888/*************************************
8989 *
90 *  DEVICE_IMAGE_LOAD(mess_hd)
91 *  DEVICE_IMAGE_CREATE(mess_hd)
90 *  DEVICE_IMAGE_LOAD(hd)
91 *  DEVICE_IMAGE_CREATE(hd)
9292 *
9393 *  Device load and create
9494 *
9595 *************************************/
9696
97static int internal_load_mess_hd(device_image_interface &image, const char *metadata)
97static int internal_load_hd(device_image_interface &image, const char *metadata)
9898{
9999   dev_harddisk_t   *harddisk = get_safe_token( &image.device() );
100100   chd_error      err = (chd_error)0;
r9936r9937
146146
147147
148148
149static DEVICE_IMAGE_LOAD( mess_hd )
149static DEVICE_IMAGE_LOAD( hd )
150150{
151151   dev_harddisk_t   *harddisk = get_safe_token( image );
152152   int our_result;
153153
154   our_result = internal_load_mess_hd(image, NULL);
154   our_result = internal_load_hd(image, NULL);
155155
156156   /* Check if there is an image_load callback defined */
157157   if ( harddisk->config && harddisk->config->device_image_load )
r9936r9937
163163}
164164
165165
166static DEVICE_IMAGE_CREATE( mess_hd )
166static DEVICE_IMAGE_CREATE( hd )
167167{
168168   int err;
169169   char metadata[256];
r9936r9937
184184      goto error;
185185
186186   sprintf(metadata, HARD_DISK_METADATA_FORMAT, cylinders, heads, sectors, sectorsize);
187   return internal_load_mess_hd(image, metadata);
187   return internal_load_hd(image, metadata);
188188
189189error:
190190   return IMAGE_INIT_FAIL;
r9936r9937
194194
195195/*************************************
196196 *
197 *  DEVICE_IMAGE_UNLOAD(mess_hd)
197 *  DEVICE_IMAGE_UNLOAD(hd)
198198 *
199199 *  Device unload
200200 *
201201 *************************************/
202202
203static DEVICE_IMAGE_UNLOAD( mess_hd )
203static DEVICE_IMAGE_UNLOAD( hd )
204204{
205205   dev_harddisk_t   *harddisk = get_safe_token( image );
206206
r9936r9937
226226
227227/*************************************
228228 *
229 *  Get the MESS/MAME hard disk handle (from the src/harddisk.c core)
230 *  after an image has been opened with the mess_hd core
229 *  Get the hard disk handle (from the src/harddisk.c core)
230 *  after an image has been opened with the hd core
231231 *
232232 *************************************/
233233
234hard_disk_file *mess_hd_get_hard_disk_file(device_t *device)
234hard_disk_file *hd_get_hard_disk_file(device_t *device)
235235{
236236   dev_harddisk_t   *harddisk = get_safe_token( device );
237237
r9936r9937
241241
242242/*************************************
243243 *
244 *  Get the MESS/MAME CHD file (from the src/chd.c core)
245 *  after an image has been opened with the mess_hd core
244 *  Get the CHD file (from the src/chd.c core)
245 *  after an image has been opened with the hd core
246246 *
247247 *************************************/
248248
249chd_file *mess_hd_get_chd_file(device_t *device)
249chd_file *hd_get_chd_file(device_t *device)
250250{
251251   chd_file *result = NULL;
252252   hard_disk_file *hd_file;
253253
254254   if (device)
255255   {
256      hd_file = mess_hd_get_hard_disk_file(device);
256      hd_file = hd_get_hard_disk_file(device);
257257      if (hd_file)
258258         result = hard_disk_get_chd(hd_file);
259259   }
r9936r9937
262262
263263
264264/*-------------------------------------------------
265    DEVICE_START(mess_hd)
265    DEVICE_START(hd)
266266-------------------------------------------------*/
267267
268static DEVICE_START(mess_hd)
268static DEVICE_START(hd)
269269{
270270   dev_harddisk_t   *harddisk = get_safe_token( device );
271271
r9936r9937
276276
277277
278278/*-------------------------------------------------
279    DEVICE_GET_INFO(mess_hd)
279    DEVICE_GET_INFO(hd)
280280-------------------------------------------------*/
281281
282DEVICE_GET_INFO(mess_hd)
282DEVICE_GET_INFO(hd)
283283{
284284   switch( state )
285285   {
r9936r9937
293293      case DEVINFO_INT_IMAGE_CREATE_OPTCOUNT:      info->i = 1; break;
294294
295295      /* --- the following bits of info are returned as pointers to data or functions --- */
296      case DEVINFO_FCT_START:                  info->start = DEVICE_START_NAME(mess_hd); break;
297      case DEVINFO_FCT_IMAGE_LOAD:            info->f = (genf *) DEVICE_IMAGE_LOAD_NAME(mess_hd); break;
298      case DEVINFO_FCT_IMAGE_UNLOAD:            info->f = (genf *) DEVICE_IMAGE_UNLOAD_NAME(mess_hd); break;
299      case DEVINFO_FCT_IMAGE_CREATE:            info->f = (genf *) DEVICE_IMAGE_CREATE_NAME(mess_hd); break;
300      case DEVINFO_PTR_IMAGE_CREATE_OPTGUIDE:      info->p = (void *) mess_hd_option_guide; break;
301      case DEVINFO_PTR_IMAGE_CREATE_OPTSPEC+0:   info->p = (void *) mess_hd_option_spec; break;
296      case DEVINFO_FCT_START:                  info->start = DEVICE_START_NAME(hd); break;
297      case DEVINFO_FCT_IMAGE_LOAD:            info->f = (genf *) DEVICE_IMAGE_LOAD_NAME(hd); break;
298      case DEVINFO_FCT_IMAGE_UNLOAD:            info->f = (genf *) DEVICE_IMAGE_UNLOAD_NAME(hd); break;
299      case DEVINFO_FCT_IMAGE_CREATE:            info->f = (genf *) DEVICE_IMAGE_CREATE_NAME(hd); break;
300      case DEVINFO_PTR_IMAGE_CREATE_OPTGUIDE:      info->p = (void *) hd_option_guide; break;
301      case DEVINFO_PTR_IMAGE_CREATE_OPTSPEC+0:   info->p = (void *) hd_option_spec; break;
302302
303303      /* --- the following bits of info are returned as NULL-terminated strings --- */
304304      case DEVINFO_STR_NAME:                  strcpy(info->s, "Harddisk"); break;
r9936r9937
306306      case DEVINFO_STR_SOURCE_FILE:            strcpy(info->s, __FILE__); break;
307307      case DEVINFO_STR_IMAGE_FILE_EXTENSIONS:      strcpy(info->s, "chd,hd"); break;
308308      case DEVINFO_STR_IMAGE_CREATE_OPTNAME+0:   strcpy(info->s, "chd"); break;
309      case DEVINFO_STR_IMAGE_CREATE_OPTDESC+0:   strcpy(info->s, "MAME/MESS CHD Hard drive"); break;
309      case DEVINFO_STR_IMAGE_CREATE_OPTDESC+0:   strcpy(info->s, "CHD Hard drive"); break;
310310      case DEVINFO_STR_IMAGE_CREATE_OPTEXTS+0:   strcpy(info->s, "chd,hd"); break;
311311   }
312312}
313313
314314
315static DEVICE_START(mess_ide)
315static DEVICE_START(ide)
316316{
317317   /* old code from idedrive.c */
318318#ifdef UNUSED_FUNCTION
r9936r9937
333333}
334334
335335
336static DEVICE_IMAGE_LOAD(mess_ide)
336static DEVICE_IMAGE_LOAD(ide)
337337{
338338   /* old code from idedrive.c */
339339#ifdef UNUSED_FUNCTION
r9936r9937
351351
352352   /* configure IDE */
353353   /* FIXME IDE */
354   /* ide_controller_init_custom(which_bus, intf, mess_hd_get_chd_file(image)); */
354   /* ide_controller_init_custom(which_bus, intf, hd_get_chd_file(image)); */
355355   /* ide_controller_reset(which_bus); */
356356   return IMAGE_INIT_PASS;
357357#endif
358   return device_load_mess_hd( image );
358   return device_load_hd( image );
359359}
360360
361361
362static DEVICE_IMAGE_UNLOAD(mess_ide)
362static DEVICE_IMAGE_UNLOAD(ide)
363363{
364364   /* old code from idedrive.c */
365365#ifdef UNUSED_FUNCTION
r9936r9937
378378   /* ide_controller_init_custom(which_bus, intf, NULL); */
379379   /* ide_controller_reset(which_bus); */
380380#endif
381   device_unload_mess_hd( image );
381   device_unload_hd( image );
382382}
383383
384384
385DEVICE_GET_INFO(mess_ide)
385DEVICE_GET_INFO(ide)
386386{
387387   switch( state )
388388   {
389389      /* --- the following bits of info are returned as pointers to data or functions --- */
390      case DEVINFO_FCT_START:                  info->start = DEVICE_START_NAME(mess_ide); break;
391      case DEVINFO_FCT_IMAGE_LOAD:            info->f = (genf *) DEVICE_IMAGE_LOAD_NAME(mess_ide); break;
392      case DEVINFO_FCT_IMAGE_UNLOAD:            info->f = (genf *) DEVICE_IMAGE_UNLOAD_NAME(mess_ide); break;
390      case DEVINFO_FCT_START:                  info->start = DEVICE_START_NAME(ide); break;
391      case DEVINFO_FCT_IMAGE_LOAD:            info->f = (genf *) DEVICE_IMAGE_LOAD_NAME(ide); break;
392      case DEVINFO_FCT_IMAGE_UNLOAD:            info->f = (genf *) DEVICE_IMAGE_UNLOAD_NAME(ide); break;
393393
394394      /* --- the following bits of info are returned as NULL-terminated strings --- */
395395      case DEVINFO_STR_NAME:                  strcpy(info->s, "IDE harddisk"); break;
396396      case DEVINFO_STR_IMAGE_INSTANCE_NAME:      strcpy(info->s, "ideharddrive"); break;
397397      case DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME:   strcpy(info->s, "idehd"); break;
398398
399      default:                           DEVICE_GET_INFO_CALL( mess_hd ); break;
399      default:                           DEVICE_GET_INFO_CALL( hd ); break;
400400   }
401401}
402402
403DEFINE_LEGACY_IMAGE_DEVICE(HARDDISK, mess_hd);
404DEFINE_LEGACY_IMAGE_DEVICE(IDE_HARDDISK, mess_ide);
403DEFINE_LEGACY_IMAGE_DEVICE(HARDDISK, hd);
404DEFINE_LEGACY_IMAGE_DEVICE(IDE_HARDDISK, ide);
src/emu/imagedev/chd_cd.c
r9936r9937
11/*********************************************************************
22
3    Code to interface the MESS image code with MAME's CHD-CD core.
3    Code to interface the image code with CHD-CD core.
44
55    Based on harddriv.c by Raphael Nabet 2003
66
r9936r9937
5252}
5353
5454
55static OPTION_GUIDE_START(mess_cd_option_guide)
55static OPTION_GUIDE_START(cd_option_guide)
5656   OPTION_INT('K', "hunksize",         "Hunk Bytes")
5757OPTION_GUIDE_END
5858
59static const char mess_cd_option_spec[] =
59static const char cd_option_spec[] =
6060   "K512/1024/2048/[4096]";
6161
6262
r9936r9937
112112
113113/*************************************
114114 *
115 *  Get the MESS/MAME cdrom handle (from the src/cdrom.c core)
116 *  after an image has been opened with the mess_cd core
115 *  Get the cdrom handle (from the src/cdrom.c core)
116 *  after an image has been opened with the cd core
117117 *
118118 *************************************/
119119
120cdrom_file *mess_cd_get_cdrom_file(device_t *image)
120cdrom_file *cd_get_cdrom_file(device_t *image)
121121{
122122   dev_cdrom_t   *cdrom = get_safe_token( image );
123123
r9936r9937
166166      case DEVINFO_FCT_IMAGE_LOAD:            info->f = (genf *) DEVICE_IMAGE_LOAD_NAME(cdrom); break;
167167      case DEVINFO_FCT_IMAGE_UNLOAD:            info->f = (genf *) DEVICE_IMAGE_UNLOAD_NAME(cdrom); break;
168168      case DEVINFO_FCT_IMAGE_SOFTLIST_LOAD:      info->f = (genf *) DEVICE_IMAGE_SOFTLIST_LOAD_NAME(cdrom);   break;
169      case DEVINFO_PTR_IMAGE_CREATE_OPTGUIDE:      info->p = (void *) mess_cd_option_guide; break;
170      case DEVINFO_PTR_IMAGE_CREATE_OPTSPEC+0:   info->p = (void *) mess_cd_option_spec; break;
169      case DEVINFO_PTR_IMAGE_CREATE_OPTGUIDE:      info->p = (void *) cd_option_guide; break;
170      case DEVINFO_PTR_IMAGE_CREATE_OPTSPEC+0:   info->p = (void *) cd_option_spec; break;
171171
172172      /* --- the following bits of info are returned as NULL-terminated strings --- */
173173      case DEVINFO_STR_NAME:                  strcpy(info->s, "Cdrom"); break;
r9936r9937
175175      case DEVINFO_STR_SOURCE_FILE:            strcpy(info->s, __FILE__); break;
176176      case DEVINFO_STR_IMAGE_FILE_EXTENSIONS:      strcpy(info->s, "chd"); break;
177177      case DEVINFO_STR_IMAGE_CREATE_OPTNAME+0:   strcpy(info->s, "chdcd"); break;
178      case DEVINFO_STR_IMAGE_CREATE_OPTDESC+0:   strcpy(info->s, "MAME/MESS CHD CD-ROM drive"); break;
178      case DEVINFO_STR_IMAGE_CREATE_OPTDESC+0:   strcpy(info->s, "CHD CD-ROM drive"); break;
179179      case DEVINFO_STR_IMAGE_CREATE_OPTEXTS+0:   strcpy(info->s, "chd"); break;
180180
181181      case DEVINFO_STR_IMAGE_INTERFACE:
src/emu/imagedev/harddriv.h
r9936r9937
22
33    harddriv.h
44
5    MESS interface to the MAME CHD code
5    Interface to the CHD code
66
77*********************************************************************/
88
9#ifndef MESS_HD_H
10#define MESS_HD_H
9#ifndef HARDDRIV_H
10#define HARDDRIV_H
1111
1212#include "image.h"
1313#include "harddisk.h"
1414
15DECLARE_LEGACY_IMAGE_DEVICE(HARDDISK, mess_hd);
16DECLARE_LEGACY_IMAGE_DEVICE(IDE_HARDDISK, mess_ide);
15DECLARE_LEGACY_IMAGE_DEVICE(HARDDISK, hd);
16DECLARE_LEGACY_IMAGE_DEVICE(IDE_HARDDISK, ide);
1717
1818#define MCFG_HARDDISK_ADD(_tag) \
1919   MCFG_DEVICE_ADD(_tag, HARDDISK, 0) \
r9936r9937
2121#define MCFG_IDE_HARDDISK_ADD(_tag) \
2222   MCFG_DEVICE_ADD(_tag, IDE_HARDDISK, 0) \
2323
24hard_disk_file *mess_hd_get_hard_disk_file(device_t *device);
25chd_file *mess_hd_get_chd_file(device_t *device);
24hard_disk_file *hd_get_hard_disk_file(device_t *device);
25chd_file *hd_get_chd_file(device_t *device);
2626
2727struct harddisk_callback_config
2828{
r9936r9937
3131};
3232
3333
34#endif /* MESS_HD_H */
34#endif /* HARDDRIV_H */
src/emu/imagedev/chd_cd.h
r9936r9937
22
33    chd_cd.h
44
5    MESS interface to the MAME CHD CDROM code
5    Interface to the CHD CDROM code
66
77*********************************************************************/
88
9#ifndef MESS_CD_H
10#define MESS_CD_H
9#ifndef CHD_CD_H
10#define CHD_CD_H
1111
1212#include "cdrom.h"
1313
r9936r9937
2727DECLARE_LEGACY_IMAGE_DEVICE(CDROM, cdrom);
2828
2929
30cdrom_file *mess_cd_get_cdrom_file(device_t *device);
30cdrom_file *cd_get_cdrom_file(device_t *device);
3131
3232/***************************************************************************
3333    DEVICE CONFIGURATION MACROS
r9936r9937
4040#define MCFG_CDROM_INTERFACE(_interface)                     \
4141   MCFG_DEVICE_CONFIG_DATAPTR(cdrom_config, interface, _interface )
4242
43#endif /* MESS_CD_H */
43#endif /* CHD_CD_H */
src/emu/imagedev/cassette.c
r9936r9937
22
33    cassette.c
44
5    MESS interface to the cassette image abstraction code
5    Interface to the cassette image abstraction code
66
77*********************************************************************/
88
src/emu/imagedev/cassette.h
r9936r9937
22
33    cassette.h
44
5    MESS interface to the cassette image abstraction code
5    Interface to the cassette image abstraction code
66
77*********************************************************************/
88
src/emu/machine/scsihd.c
r9936r9937
255255
256256#ifdef MESS
257257   /* TODO: get rid of this ifdef MESS section */
258   our_this->disk = mess_hd_get_hard_disk_file( machine->device( diskregion ) );
258   our_this->disk = hd_get_hard_disk_file( machine->device( diskregion ) );
259259#else
260260   our_this->disk = hard_disk_open(get_disk_handle( machine, diskregion ));
261261#endif
src/emu/machine/idectrl.c
r9936r9937
19141914#ifdef MESS
19151915   if (!ide->disk)
19161916   {
1917      ide->handle = mess_hd_get_chd_file( device->machine->device( "harddisk" ) );   // should be config->master
1917      ide->handle = hd_get_chd_file( device->machine->device( "harddisk" ) );   // should be config->master
19181918
19191919      if (ide->handle)
19201920      {
1921         ide->disk = mess_hd_get_hard_disk_file( device->machine->device( "harddisk" ) );   // should be config->master
1921         ide->disk = hd_get_hard_disk_file( device->machine->device( "harddisk" ) );   // should be config->master
19221922
19231923         if (ide->disk != NULL)
19241924         {
src/emu/machine/scsicd.c
r9936r9937
691691
692692#ifdef MESS
693693   /* TODO: get rid of this ifdef MESS section */
694   our_this->cdrom = mess_cd_get_cdrom_file( machine->device( diskregion ) );
694   our_this->cdrom = cd_get_cdrom_file( machine->device( diskregion ) );
695695#else
696696   our_this->cdrom = cdrom_open(get_disk_handle( machine, diskregion ));
697697
src/mess/devices/ti99_hd.c
r9936r9937
7272   UINT32 lba;
7373   mfmhd_state *hd = (mfmhd_state *)downcast<legacy_device_base *>(harddisk)->token();
7474   device_t *drive = harddisk->subdevice("drive");
75   hard_disk_file *file = mess_hd_get_hard_disk_file(drive);
75   hard_disk_file *file = hd_get_hard_disk_file(drive);
7676
7777   *sector_length = 256;
7878   *buf = (UINT8 *)malloc(*sector_length);
r9936r9937
108108   UINT32 lba;
109109   mfmhd_state *hd = (mfmhd_state *)downcast<legacy_device_base *>(harddisk)->token();
110110   device_t *drive = harddisk->subdevice("drive");
111   hard_disk_file *file = mess_hd_get_hard_disk_file(drive);
111   hard_disk_file *file = hd_get_hard_disk_file(drive);
112112
113113   if (file==NULL)
114114   {
r9936r9937
191191   int crc;
192192
193193   const hard_disk_info *info;
194   hard_disk_file *file = mess_hd_get_hard_disk_file(drive);
194   hard_disk_file *file = hd_get_hard_disk_file(drive);
195195
196196   if (file==NULL)
197197   {
r9936r9937
308308   UINT32 lba;
309309   mfmhd_state *hd = (mfmhd_state *)downcast<legacy_device_base *>(harddisk)->token();
310310   device_t *drive = harddisk->subdevice("drive");
311   hard_disk_file *file = mess_hd_get_hard_disk_file(drive);
311   hard_disk_file *file = hd_get_hard_disk_file(drive);
312312
313313   /* printf("ti99_hd write track c=%d h=%d\n", hd->current_cylinder, head); */
314314
r9936r9937
411411   device_t *drive;
412412   mfmhd_state *hd = (mfmhd_state *)downcast<legacy_device_base *>(harddisk)->token();
413413   drive = harddisk->subdevice("drive");
414   hard_disk_file *file = mess_hd_get_hard_disk_file(drive);
414   hard_disk_file *file = hd_get_hard_disk_file(drive);
415415
416416   if (file!=NULL)
417417      status |= MFMHD_READY;
r9936r9937
434434   device_t *drive = harddisk->subdevice("drive");
435435   mfmhd_state *hd = (mfmhd_state *)downcast<legacy_device_base *>(harddisk)->token();
436436   const hard_disk_info *info;
437   hard_disk_file *file = mess_hd_get_hard_disk_file(drive);
437   hard_disk_file *file = hd_get_hard_disk_file(drive);
438438
439439   if (file==NULL)   return;
440440
r9936r9937
464464   hard_disk_file *file;
465465   int interleave = 3;
466466
467   file = mess_hd_get_hard_disk_file(drive);
467   file = hd_get_hard_disk_file(drive);
468468   if (file==NULL)
469469   {
470470      hd->status &= ~MFMHD_READY;
src/mess/tiny.mak
r9936r9937
5252   $(EMU_VIDEO)/tms9928a.o \
5353
5454
55
5655#-------------------------------------------------
57# layout dependencies
58#-------------------------------------------------
59
60$(MESSOBJ)/mess.o:   $(MESS_LAYOUT)/lcd.lh
61$(MESSOBJ)/mess.o:   $(MESS_LAYOUT)/lcd_rot.lh
62
63
64#-------------------------------------------------
6556# MESS special OSD rules
6657#-------------------------------------------------
6758
src/mess/tools/imgtool/modules.c
r9936r9937
9292MODULE(concept)
9393MODULE(mac_mfs)
9494MODULE(mac_hfs)
95MODULE(mess_hd)
95MODULE(hd)
9696MODULE(rsdos)
9797MODULE(vzdos)
9898MODULE(os9)
src/mess/machine/gdrom.c
r9936r9937
793793
794794#ifdef MESS
795795   /* TODO: get rid of this ifdef MESS section */
796   our_this->cdrom = mess_cd_get_cdrom_file( machine->device( diskregion ) );
796   our_this->cdrom = cd_get_cdrom_file( machine->device( diskregion ) );
797797#else
798798   our_this->cdrom = cdrom_open(get_disk_handle( diskregion ));
799799
src/mess/machine/990_hd.c
r9936r9937
212212   d = &hdc.d[id];
213213   d->img = &image;
214214
215   hd_file = mess_hd_get_hard_disk_file( image );
215   hd_file = hd_get_hard_disk_file( image );
216216
217217   if ( hd_file )
218218   {
src/mess/machine/cdicdic.c
r9936r9937
12341234    device_t *cdrom_dev = m_machine.device("cdrom");
12351235    if( cdrom_dev )
12361236    {
1237        m_cd = mess_cd_get_cdrom_file(cdrom_dev);
1237        m_cd = cd_get_cdrom_file(cdrom_dev);
12381238        cdda_set_cdrom(m_machine.device("cdda"), m_cd);
12391239    }
12401240    else
src/mess/machine/pc_hdc.c
r9936r9937
250250   if (!img->exists())
251251      return NULL;
252252
253   return mess_hd_get_hard_disk_file(&img->device());
253   return hd_get_hard_disk_file(&img->device());
254254}
255255
256256static void pc_hdc_result(running_machine *machine,int n, int set_error_info)
src/mess/machine/matsucd.c
r9936r9937
6666{
6767   memset(&cd, 0, sizeof( matsucd ) );
6868
69   cd.cdrom = mess_cd_get_cdrom_file( cdrom_device );
69   cd.cdrom = cd_get_cdrom_file( cdrom_device );
7070   cd.cdda = cdrom_device->machine->device(cdda_tag);
7171
7272   cd.frame_timer = timer_alloc(cdrom_device->machine, matsu_subcode_proc, NULL);
src/mess/machine/corvushd.c
r9936r9937
11901190   if (!img->exists())
11911191      return NULL;
11921192
1193   return mess_hd_get_hard_disk_file(&img->device());
1193   return hd_get_hard_disk_file(&img->device());
11941194}
11951195
11961196
src/mess/machine/dc.c
r9936r9937
578578   atapi_xferlen = 0;
579579   atapi_xfermod = 0;
580580
581   if ( mess_cd_get_cdrom_file(machine->device( "cdrom" )) != NULL )
581   if ( cd_get_cdrom_file(machine->device( "cdrom" )) != NULL )
582582   {
583583      SCSIAllocInstance( machine, &SCSIClassGDROM, &gdrom_device, "cdrom" );
584584   }
src/mess/machine/pce.c
r9936r9937
12511251   device = machine->device("cdrom");
12521252   if ( device )
12531253   {
1254      pce_cd.cd = mess_cd_get_cdrom_file(device);
1254      pce_cd.cd = cd_get_cdrom_file(device);
12551255      if ( pce_cd.cd )
12561256      {
12571257         pce_cd.toc = cdrom_get_toc( pce_cd.cd );
src/mess/drivers/fmtowns.c
r9936r9937
12291229
12301230   for(track=1;track<99;track++)
12311231   {
1232      if(cdrom_get_track_start(mess_cd_get_cdrom_file(cdrom),track) > lba)
1232      if(cdrom_get_track_start(cd_get_cdrom_file(cdrom),track) > lba)
12331233         break;
12341234   }
12351235   return track;
r9936r9937
12781278            state->towns_cd.extra_status = 0;
12791279            towns_cd_set_status(device->machine,0x22,0x00,0x00,0x00);
12801280            towns_cdrom_set_irq(device->machine,TOWNS_CD_IRQ_DMA,1);
1281            cdrom_read_data(mess_cd_get_cdrom_file(state->cdrom),++state->towns_cd.lba_current,state->towns_cd.buffer,CD_TRACK_MODE1);
1281            cdrom_read_data(cd_get_cdrom_file(state->cdrom),++state->towns_cd.lba_current,state->towns_cd.buffer,CD_TRACK_MODE1);
12821282            timer_adjust_oneshot(state->towns_cd.read_timer,ATTOTIME_IN_HZ(300000),1);
12831283            state->towns_cd.buffer_ptr = -1;
12841284         }
r9936r9937
13081308   state->towns_cd.lba_last = msf_to_lba(lba2);
13091309
13101310   // first track starts at 00:02:00 - this is hardcoded in the boot procedure
1311   track = cdrom_get_track(mess_cd_get_cdrom_file(device),state->towns_cd.lba_current);
1311   track = cdrom_get_track(cd_get_cdrom_file(device),state->towns_cd.lba_current);
13121312   if(track < 2)
13131313   {  // recalculate LBA
13141314      state->towns_cd.lba_current -= 150;
r9936r9937
13281328   }
13291329   else
13301330   {
1331      cdrom_read_data(mess_cd_get_cdrom_file(device),state->towns_cd.lba_current,state->towns_cd.buffer,CD_TRACK_MODE1);
1331      cdrom_read_data(cd_get_cdrom_file(device),state->towns_cd.lba_current,state->towns_cd.buffer,CD_TRACK_MODE1);
13321332      state->towns_cd.status |= 0x10;  // DMA transfer begin
13331333      state->towns_cd.status &= ~0x20;  // not a software transfer
13341334//      state->towns_cd.buffer_ptr = 0;
r9936r9937
13661366   state->towns_cd.cdda_current = msf_to_lba(lba1);
13671367   state->towns_cd.cdda_length = msf_to_lba(lba2) - state->towns_cd.cdda_current;
13681368
1369   cdda_set_cdrom(cdda,mess_cd_get_cdrom_file(device));
1369   cdda_set_cdrom(cdda,cd_get_cdrom_file(device));
13701370   cdda_start_audio(cdda,state->towns_cd.cdda_current,state->towns_cd.cdda_length);
13711371   logerror("CD: CD-DA start from LBA:%i length:%i\n",state->towns_cd.cdda_current,state->towns_cd.cdda_length);
13721372   if(state->towns_cd.command & 0x20)
r9936r9937
13851385{
13861386   towns_state* state = device->machine->driver_data<towns_state>();
13871387
1388   if(mess_cd_get_cdrom_file(device) == NULL)
1388   if(cd_get_cdrom_file(device) == NULL)
13891389   {  // No CD in drive
13901390      if(state->towns_cd.command & 0x20)
13911391      {
r9936r9937
15441544                           break;
15451545                        case 4: // st1 = last track number (BCD)
15461546                           towns_cd_set_status(space->machine,0x17,
1547                              byte_to_bcd(cdrom_get_last_track(mess_cd_get_cdrom_file(state->cdrom))),
1547                              byte_to_bcd(cdrom_get_last_track(cd_get_cdrom_file(state->cdrom))),
15481548                              0x00,0x00);
15491549                           state->towns_cd.extra_status++;
15501550                           break;
15511551                        case 5:  // st1 = control/adr of track 0xaa?
15521552                           towns_cd_set_status(space->machine,0x16,
1553                              cdrom_get_adr_control(mess_cd_get_cdrom_file(state->cdrom),0xaa),
1553                              cdrom_get_adr_control(cd_get_cdrom_file(state->cdrom),0xaa),
15541554                              0xaa,0x00);
15551555                           state->towns_cd.extra_status++;
15561556                           break;
15571557                        case 6:  // st1/2/3 = address of track 0xaa? (BCD)
1558                           addr = cdrom_get_track_start(mess_cd_get_cdrom_file(state->cdrom),0xaa);
1558                           addr = cdrom_get_track_start(cd_get_cdrom_file(state->cdrom),0xaa);
15591559                           addr = lba_to_msf(addr);
15601560                           towns_cd_set_status(space->machine,0x17,
15611561                              (addr & 0xff0000) >> 16,(addr & 0x00ff00) >> 8,addr & 0x0000ff);
r9936r9937
15651565                           if(state->towns_cd.extra_status & 0x01)
15661566                           {
15671567                              towns_cd_set_status(space->machine,0x16,
1568                                 ((cdrom_get_adr_control(mess_cd_get_cdrom_file(state->cdrom),(state->towns_cd.extra_status/2)-3) & 0x0f) << 4)
1569                                 | ((cdrom_get_adr_control(mess_cd_get_cdrom_file(state->cdrom),(state->towns_cd.extra_status/2)-3) & 0xf0) >> 4),
1568                                 ((cdrom_get_adr_control(cd_get_cdrom_file(state->cdrom),(state->towns_cd.extra_status/2)-3) & 0x0f) << 4)
1569                                 | ((cdrom_get_adr_control(cd_get_cdrom_file(state->cdrom),(state->towns_cd.extra_status/2)-3) & 0xf0) >> 4),
15701570                                 (state->towns_cd.extra_status/2)-3,0x00);
15711571                              state->towns_cd.extra_status++;
15721572                           }
15731573                           else
15741574                           {
1575                              addr = cdrom_get_track_start(mess_cd_get_cdrom_file(state->cdrom),(state->towns_cd.extra_status/2)-4);
1575                              addr = cdrom_get_track_start(cd_get_cdrom_file(state->cdrom),(state->towns_cd.extra_status/2)-4);
15761576                              addr = lba_to_msf(addr);
15771577                              towns_cd_set_status(space->machine,0x17,
15781578                                 (addr & 0xff0000) >> 16,(addr & 0x00ff00) >> 8,addr & 0x0000ff);
1579                              if(((state->towns_cd.extra_status/2)-3) >= cdrom_get_last_track(mess_cd_get_cdrom_file(state->cdrom)))
1579                              if(((state->towns_cd.extra_status/2)-3) >= cdrom_get_last_track(cd_get_cdrom_file(state->cdrom)))
15801580                              {
15811581                                 state->towns_cd.extra_status = 0;
15821582                              }
src/mess/drivers/psx.c
r9936r9937
10341034   device_t *cdrom_dev = machine->device("cdrom");
10351035   if( cdrom_dev )
10361036   {
1037      state->cdrom = mess_cd_get_cdrom_file(cdrom_dev);
1037      state->cdrom = cd_get_cdrom_file(cdrom_dev);
10381038   }
10391039
10401040   psx_machine_init(machine);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team