Previous 15994 Revisions Next

r5610 Sunday 6th September, 2009 at 17:04:05 UTC by Miodrag Milanović
Floppy cleanup - phase 1
[src/mess]mess.mak
[src/mess/drivers]a310.c abc80.c abc80x.c amstrad.c apf.c aquarius.c atm.c atom.c b2m.c bbc.c bw12.c bw2.c coco.c dgn_beta.c einstein.c enterp.c exidy.c kaypro.c kc.c mbee.c mikromik.c msx.c nanos.c nascom1.c newbrain.c orion.c osi.c partner.c pc8801.c pentagon.c pk8020.c prof80.c pyl601.c ql.c sg1000.c special.c tiki100.c tmc2000e.c tmc600.c v1050.c vector06.c xor100.c z80ne.c
[src/mess/includes]adam.h apf.h atom.h b2m.h bbc.h exidy.h kaypro.h kc.h mbee.h msx.h orion.h partner.h pk8020.h special.h vector06.h
[src/mess/machine]abcbus.c abcbus.h adam.c apf.c atom.c b2m.c bbc.c compis.c concept.c exidy.c kaypro.c kc.c mbee.c msx.c nascom1.c orion.c partner.c pk8020.c samcoupe.c special.c vector06.c z80ne.c

src/mess/includes/kc.h
r5609r5610
5151MACHINE_RESET( kc85_4d );
5252
5353/* cassette */
54DEVICE_IMAGE_LOAD( kc85_floppy );
55
5654READ8_HANDLER(kc85_4_84_r);
5755WRITE8_HANDLER(kc85_4_84_w);
5856
src/mess/includes/adam.h
r5609r5610
2727void adam_clear_keyboard_buffer(void);
2828void adam_explore_keyboard(running_machine *machine);
2929
30DEVICE_IMAGE_LOAD( adam_floppy );
31DEVICE_IMAGE_UNLOAD( adam_floppy );
32
3330READ8_HANDLER  ( adamnet_r );
3431WRITE8_HANDLER ( adamnet_w );
3532READ8_HANDLER  ( adam_paddle_r );
src/mess/includes/mbee.h
r5609r5610
1414#include "devices/cassette.h"
1515#include "machine/ctronics.h"
1616#include "sound/speaker.h"
17#include "devices/basicdsk.h"
1817
1918
2019/*----------- defined in drivers/mbee.c -----------*/
r5609r5610
3231READ8_DEVICE_HANDLER( mbee_pio_r );
3332WRITE8_HANDLER ( mbee_fdc_motor_w );
3433WRITE8_DEVICE_HANDLER( mbee_pio_w );
35void mbee_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
3634INTERRUPT_GEN( mbee_interrupt );
3735Z80BIN_EXECUTE( mbee );
3836QUICKLOAD_LOAD( mbee );
src/mess/includes/msx.h
r5609r5610
7979WRITE8_HANDLER ( msx_90in1_w );
8080
8181/* disk functions */
82DEVICE_IMAGE_LOAD( msx_floppy );
82FLOPPY_OPTIONS_EXTERN(msx);
8383
8484/* new memory emulation */
8585WRITE8_HANDLER (msx_page0_w);
src/mess/includes/b2m.h
r5609r5610
3232extern WRITE8_HANDLER( b2m_palette_w );
3333extern READ8_HANDLER( b2m_localmachine_r );
3434extern WRITE8_HANDLER( b2m_localmachine_w );
35extern DEVICE_IMAGE_LOAD( b2m_floppy );
3635
3736#define SOUND_B2M      DEVICE_GET_INFO_NAME( b2m_sound )
3837
src/mess/includes/kaypro.h
r5609r5610
2929WRITE8_HANDLER( kaypro2x_baud_a_w );
3030WRITE8_HANDLER( kaypro2x_system_port_w );
3131
32void kayproii_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
33void kaypro2x_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
34
3532MACHINE_RESET( kayproii );
3633MACHINE_RESET( kaypro2x );
3734
src/mess/includes/exidy.h
r5609r5610
2424MACHINE_RESET( exidyd );
2525MACHINE_RESET( exidy );
2626Z80BIN_EXECUTE( exidy );
27void exidy_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
2827
2928
3029/*----------- defined in video/exidy.c -----------*/
src/mess/includes/atom.h
r5609r5610
3939WRITE8_DEVICE_HANDLER (atom_8255_portb_w );
4040WRITE8_DEVICE_HANDLER (atom_8255_portc_w );
4141
42DEVICE_IMAGE_LOAD( atom_floppy );
43
4442READ8_HANDLER(atom_eprom_box_r);
4543WRITE8_HANDLER(atom_eprom_box_w);
4644void atom_eprom_box_init(running_machine *machine);
src/mess/includes/apf.h
r5609r5610
2222
2323void apf_update_ints(running_machine *machine);
2424
25/*----------- defined in machine/apf.c -----------*/
26
27DEVICE_IMAGE_LOAD( apfimag_floppy );
28
29
3025#endif /* APF_H_ */
src/mess/includes/vector06.h
r5609r5610
3232extern UINT8 vector_color_index;
3333extern UINT8 vector_video_mode;
3434
35extern DEVICE_IMAGE_LOAD( vector_floppy );
36
3735/*----------- defined in video/vector06.c -----------*/
3836
3937extern PALETTE_INIT( vector06 );
src/mess/includes/partner.h
r5609r5610
1717extern MACHINE_RESET( partner );
1818extern MACHINE_START( partner );
1919
20extern DEVICE_IMAGE_LOAD( partner_floppy );
21
2220extern const dma8257_interface partner_dma;
2321extern const wd17xx_interface partner_wd17xx_interface;
2422
src/mess/includes/orion.h
r5609r5610
4040extern WRITE8_HANDLER ( orionz80_sound_w );
4141extern READ8_HANDLER ( orion128_floppy_r );
4242extern WRITE8_HANDLER ( orion128_floppy_w );
43extern DEVICE_IMAGE_LOAD( orion_floppy );
4443extern READ8_HANDLER ( orionz80_io_r );
4544extern WRITE8_HANDLER ( orionz80_io_w );
4645
src/mess/includes/special.h
r5609r5610
2525extern DRIVER_INIT( specimx );
2626extern MACHINE_RESET( specimx );
2727extern MACHINE_START ( specimx );
28extern DEVICE_IMAGE_LOAD( specimx_floppy );
2928
3029extern WRITE8_HANDLER( specimx_select_bank );
3130
src/mess/includes/pk8020.h
r5609r5610
1212#include "machine/pic8259.h"
1313#include "machine/msm8251.h"
1414#include "machine/wd17xx.h"
15#include "devices/basicdsk.h"
1615#include "devices/cassette.h"
1716#include "sound/speaker.h"
1817#include "sound/wave.h"
r5609r5610
2928extern const i8255a_interface pk8020_ppi8255_interface_3;
3029extern const struct pit8253_config pk8020_pit8253_intf;
3130extern const struct pic8259_interface pk8020_pic8259_config;
32extern DEVICE_IMAGE_LOAD( pk8020_floppy );
3331extern INTERRUPT_GEN( pk8020_interrupt );
3432/*----------- defined in video/pk8020.c -----------*/
3533
src/mess/includes/bbc.h
r5609r5610
7373/* disc support */
7474
7575DEVICE_IMAGE_LOAD ( bbcb_cart );
76DEVICE_IMAGE_LOAD( bbc_floppy );
7776
7877READ8_HANDLER  ( bbc_disc_r );
7978WRITE8_HANDLER ( bbc_disc_w );
src/mess/machine/apf.c
r5609r5610
1/***********************************************************************
2
3   apf.c
4
5   Functions to emulate general aspects of the machine (RAM, ROM,
6   interrupts, I/O ports)
7
8***********************************************************************/
9
10#include "driver.h"
11#include "includes/apf.h"
12#include "devices/cassette.h"
13#include "devices/basicdsk.h"
14
15
16/* 256 bytes per sector, single sided, single density, 40 track  */
17DEVICE_IMAGE_LOAD( apfimag_floppy )
18{
19   if (device_load_basicdsk_floppy(image)==INIT_PASS)
20   {
21      basicdsk_set_geometry(image, 40, 1, 8, 256, 1, 0, FALSE);
22      return INIT_PASS;
23   }
24
25   return INIT_FAIL;
26}
src/mess/machine/adam.c
r5609r5610
99#include "driver.h"
1010#include "video/tms9928a.h"
1111#include "includes/adam.h"
12#include "devices/flopdrv.h"
1213#include "devices/cartslot.h"
13#include "devices/basicdsk.h"
1414
1515int adam_lower_memory; /* Lower 32k memory Z80 address configuration */
1616int adam_upper_memory; /* Upper 32k memory Z80 address configuration */
r5609r5610
4040   return retval;
4141}
4242
43DEVICE_IMAGE_LOAD( adam_floppy )
44{
45   if (device_load_basicdsk_floppy(image)==INIT_PASS)
46   {
47      /* img, tracks, sides, sectors_per_track, sector_length, first_sector_id, offset_track_zero, track_skipping */
48      basicdsk_set_geometry(image, 40, 1, 8, 512, 0, 0, FALSE);
49      return INIT_PASS;
50   }
51   else
52   {
53      return INIT_FAIL;
54   }
55}
56
57
58
59DEVICE_IMAGE_UNLOAD( adam_floppy )
60{
61    device_unload_basicdsk_floppy(image);
62}
63
64
65
6643void adam_clear_keyboard_buffer(void)
6744{
6845    int i;
src/mess/machine/mbee.c
r5609r5610
154154   wd17xx_set_density(mbee_fdc, (data & 8) ? 1 : 0);
155155}
156156
157static DEVICE_IMAGE_LOAD( mbee_floppy )
158{
159   if (device_load_basicdsk_floppy(image)==INIT_PASS)
160   {
161      if (!mame_stricmp(image_filetype(image), "ss80"))
162      {
163         basicdsk_set_geometry(image, 80, 1, 10, 512, 1, 0, FALSE);
164         return INIT_PASS;
165      }
166      else
167      if (!mame_stricmp(image_filetype(image), "ds40"))
168      {
169         basicdsk_set_geometry(image, 80, 2, 10, 512, 1, 0, FALSE);
170         return INIT_PASS;
171      }
172      else
173      if (!mame_stricmp(image_filetype(image), "ds80"))
174      {
175         basicdsk_set_geometry(image, 160, 2, 10, 512, 1, 0, FALSE);
176         return INIT_PASS;
177      }
178      else
179      if (!mame_stricmp(image_filetype(image), "ds84"))
180      {
181         basicdsk_set_geometry(image, 168, 2, 10, 512, 1, 0, FALSE);
182         return INIT_PASS;
183      }
184      else
185      if (!mame_stricmp(image_filetype(image), "dsk"))
186      {
187         return INIT_FAIL;   // not handled yet - CPC-EMU formatted image
188      }
189      else
190      if (!mame_stricmp(image_filetype(image), "img"))
191      {
192         return INIT_FAIL;   // not handled - not investigated yet
193      }
194   }
195
196   return INIT_FAIL;
197}
198
199void mbee_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
200{
201   /* floppy */
202   switch(state)
203   {
204      /* --- the following bits of info are returned as 64-bit signed integers --- */
205      case MESS_DEVINFO_INT_COUNT:      info->i = 2; break;
206
207      /* --- the following bits of info are returned as pointers to data or functions --- */
208      case MESS_DEVINFO_PTR_LOAD:      info->load = DEVICE_IMAGE_LOAD_NAME(mbee_floppy); break;
209
210      /* --- the following bits of info are returned as NULL-terminated strings --- */
211      case MESS_DEVINFO_STR_FILE_EXTENSIONS:   strcpy(info->s = device_temp_str(), "ss80,ds40,ds80,ds84,dsk,img"); break;
212
213      default:            legacybasicdsk_device_getinfo(devclass, state, info); break;
214   }
215}
216
217
218157/***********************************************************
219158
220159   Machine
src/mess/machine/b2m.c
r5609r5610
1010#include "driver.h"
1111#include "cpu/i8085/i8085.h"
1212#include "devices/cassette.h"
13#include "devices/basicdsk.h"
1413#include "machine/i8255a.h"
1514#include "machine/pit8253.h"
1615#include "machine/wd17xx.h"
r5609r5610
360359   b2m_set_bank(machine, 7);
361360}
362361
363DEVICE_IMAGE_LOAD( b2m_floppy )
364{
365   int size;
366
367   if (! image_has_been_created(image))
368      {
369      size = image_length(image);
370
371      switch (size)
372         {
373         case 800*1024:
374            break;
375         default:
376            return INIT_FAIL;
377         }
378      }
379   else
380      return INIT_FAIL;
381
382   if (device_load_basicdsk_floppy (image) != INIT_PASS)
383      return INIT_FAIL;
384
385   basicdsk_set_geometry (image, 80, 2, 5, 1024, 1, 0, FALSE);   
386   return INIT_PASS;
387}
388
389
390362static STREAM_UPDATE( b2m_sh_update )
391363{
392364   INT16 channel_1_signal;
src/mess/machine/vector06.c
r5609r5610
1212#include "machine/i8255a.h"
1313#include "machine/wd17xx.h"
1414#include "devices/cassette.h"
15#include "devices/basicdsk.h"
1615#include "includes/vector06.h"
1716
1817UINT8 vector06_keyboard_mask;
r5609r5610
176175    wd17xx_set_drive(fdc,data & 1);               
177176}
178177
179DEVICE_IMAGE_LOAD( vector_floppy )
180{
181   int size;
182
183   if (! image_has_been_created(image))
184      {
185      size = image_length(image);
186
187      switch (size)
188         {
189         case 820*1024:
190            break;
191         default:
192            return INIT_FAIL;
193         }
194      }
195   else
196      return INIT_FAIL;
197
198   if (device_load_basicdsk_floppy (image) != INIT_PASS)
199      return INIT_FAIL;
200
201   basicdsk_set_geometry (image, 82, 2, 5, 1024, 1, 0, FALSE);   
202   return INIT_PASS;
203}
204
205
206178MACHINE_START( vector06 )
207179{
208180   const device_config *fdc = devtag_get_device(machine, "wd1793");
src/mess/machine/orion.c
r5609r5610
1111#include "driver.h"
1212#include "cpu/i8085/i8085.h"
1313#include "devices/cassette.h"
14#include "devices/basicdsk.h"
1514#include "machine/mc146818.h"
1615#include "machine/wd17xx.h"
1716#include "sound/speaker.h"
r5609r5610
185184   radio86_init_keyboard();
186185}
187186
188
189DEVICE_IMAGE_LOAD( orion_floppy )
190{
191   int size;
192
193   if (! image_has_been_created(image))
194      {
195      size = image_length(image);
196
197      switch (size)
198         {
199         case 800*1024:
200            break;
201         case 720*1024:
202            break;
203         default:
204            return INIT_FAIL;
205         }
206      }
207   else
208      return INIT_FAIL;
209
210   if (device_load_basicdsk_floppy (image) != INIT_PASS)
211      return INIT_FAIL;
212
213   if (size==800*1024)
214   {
215      basicdsk_set_geometry (image, 80, 2, 5, 1024, 1, 0, FALSE);
216   }
217   else
218   {
219      basicdsk_set_geometry (image, 80, 2, 9, 512, 1, 0, FALSE);
220   }
221   return INIT_PASS;
222}
223
224187static WRITE8_HANDLER ( orion_disk_control_w )
225188{
226189   const device_config *fdc = devtag_get_device(space->machine, "wd1793");
src/mess/machine/abcbus.c
r5609r5610
11#include "driver.h"
22#include "abcbus.h"
3#include "devices/basicdsk.h"
43
4#include "formats/basicdsk.h"
5
56typedef struct _abcbus_daisy_state abcbus_daisy_state;
67struct _abcbus_daisy_state
78{
r5609r5610
6667   return 0xff;
6768}
6869
69DEVICE_IMAGE_LOAD( abc_floppy )
70{
71   int size, tracks, heads, sectors;
72
73   if (image_has_been_created(image))
74      return INIT_FAIL;
75
76   size = image_length (image);
77   switch (size)
78   {
79   case 80*1024: /* Scandia Metric FD2 */
80      tracks = 40;
81      heads = 1;
82      sectors = 8;
83      break;
84   case 160*1024: /* ABC 830 */
85      tracks = 40;
86      heads = 1;
87      sectors = 16;
88      break;
89   case 640*1024: /* ABC 832/834 */
90      tracks = 80;
91      heads = 2;
92      sectors = 16;
93      break;
94   case 1001*1024: /* ABC 838 */
95      tracks = 77;
96      heads = 2;
97      sectors = 26;
98      break;
99   default:
100      return INIT_FAIL;
101   }
102
103   if (device_load_basicdsk_floppy(image)==INIT_PASS)
104   {
105      /* sector id's 0-9 */
106      /* drive, tracks, heads, sectors per track, sector length, dir_sector, dir_length, first sector id */
107      basicdsk_set_geometry(image, tracks, heads, sectors, 256, 0, 0, FALSE);
108      return INIT_PASS;
109   }
110
111   return INIT_FAIL;
112}
70FLOPPY_OPTIONS_START(abc80)
71   FLOPPY_OPTION(abc80, "dsk", "Scandia Metric FD2", basicdsk_identify_default, basicdsk_construct_default,
72      HEADS([1])
73      TRACKS([40])
74      SECTORS([8])
75      SECTOR_LENGTH([256])
76      FIRST_SECTOR_ID([0]))
77   FLOPPY_OPTION(abc80, "dsk", "ABC 830", basicdsk_identify_default, basicdsk_construct_default,
78      HEADS([1])
79      TRACKS([40])
80      SECTORS([16])
81      SECTOR_LENGTH([256])
82      FIRST_SECTOR_ID([0]))
83   FLOPPY_OPTION(abc80, "dsk", "ABC 832/834", basicdsk_identify_default, basicdsk_construct_default,
84      HEADS([2])
85      TRACKS([80])
86      SECTORS([16])
87      SECTOR_LENGTH([256])
88      FIRST_SECTOR_ID([0]))
89   FLOPPY_OPTION(abc80, "dsk", "ABC 838", basicdsk_identify_default, basicdsk_construct_default,
90      HEADS([2])
91      TRACKS([77])
92      SECTORS([26])
93      SECTOR_LENGTH([256])
94      FIRST_SECTOR_ID([0]))
95FLOPPY_OPTIONS_END
src/mess/machine/nascom1.c
r5609r5610
1414#include "machine/ay31015.h"
1515
1616/* Devices */
17#include "devices/basicdsk.h"
1817#include "devices/snapquik.h"
1918#include "devices/cassette.h"
2019
r5609r5610
103102   return (nascom2_fdc.drq << 7) | nascom2_fdc.irq;
104103}
105104
106
107DEVICE_IMAGE_LOAD( nascom2_floppy )
108{
109   int sides, sectors;
110   const device_config *fdc = devtag_get_device(image->machine, "wd1793");
111   if (!image_has_been_created(image))
112   {
113      switch (image_length(image))
114      {
115      case 80 * 2 * 2 * 8 * 256:
116         sides = 2;
117         sectors = 2 * 8;
118         wd17xx_set_density(fdc,DEN_FM_HI);
119         break;
120
121      case 80 * 1 * 2 * 8 * 256:
122         sides = 1;
123         sectors = 2 * 8;
124         wd17xx_set_density(fdc,DEN_FM_HI);
125         break;
126
127      default:
128         return INIT_FAIL;
129      }
130   }
131   else
132   {
133      return INIT_FAIL;
134   }
135
136   if (device_load_basicdsk_floppy(image) != INIT_PASS)
137   {
138      return INIT_FAIL;
139   }
140
141   basicdsk_set_geometry(image, 80, sides, sectors, 256, 1, 0, FALSE);
142
143   return INIT_PASS;
144}
145
146
147
148105/*************************************
149106 *
150107 *  Keyboard
r5609r5610
296253
297254MACHINE_RESET( nascom1 )
298255{
256   const device_config *fdc = devtag_get_device(machine, "wd1793");
257   
258   wd17xx_set_density(fdc,DEN_FM_HI);
259   
299260   nascom1_hd6402 = devtag_get_device(machine, "hd6402");
300261
301262   /* Set up hd6402 pins */
src/mess/machine/abcbus.h
r5609r5610
8080#ifndef __ABCBUS__
8181#define __ABCBUS__
8282
83#include "formats/flopimg.h"
84
8385#define DEVINFO_FCT_ABCBUS_CARD_SELECT   DEVINFO_FCT_DEVICE_SPECIFIC
8486
8587enum
r5609r5610
116118WRITE8_HANDLER( abcbus_channel_w );
117119READ8_HANDLER( abcbus_reset_r );
118120
119DEVICE_IMAGE_LOAD( abc_floppy );
121FLOPPY_OPTIONS_EXTERN(abc80);
120122
121123#endif
src/mess/machine/samcoupe.c
r5609r5610
99
1010#include "driver.h"
1111#include "includes/samcoupe.h"
12#include "devices/basicdsk.h"
1312#include "machine/msm6242.h"
1413
1514
src/mess/machine/compis.c
r5609r5610
2222#include "machine/nec765.h"
2323#include "machine/msm8251.h"
2424#include "machine/ctronics.h"
25#include "devices/basicdsk.h"
2625
27
2826/*-------------------------------------------------------------------------*/
2927/* Defines, constants, and global variables                                */
3028/*-------------------------------------------------------------------------*/
src/mess/machine/z80ne.c
r5609r5610
1818#include "video/m6847.h"
1919
2020/* Devices */
21#include "devices/basicdsk.h"
2221#include "devices/cassette.h"
2322#include "devices/flopdrv.h"
2423
r5609r5610
7372   UINT8 head;  /* current head */
7473} wd17xx_state;
7574
76
77DEVICE_IMAGE_LOAD( z80ne_floppy )
78{
79   static UINT8 pdrive[4*16];
80   int i;
81   int tracks;    /* total tracks count per drive */
82   int heads;      /* total heads count per drive */
83   int spt;      /* sector per track count per drive */
84   int dir_sector; /* first directory sector (aka DDSL) */
85   int dir_length; /* length of directory in sectors (aka DDGA) */
86   int id = image_index_in_device(image);
87
88   if (device_load_basicdsk_floppy(image) != INIT_PASS)
89      return INIT_FAIL;
90
91   if (image_index_in_device(image) == 0)        /* first floppy? */
92   {
93      image_fseek(image, 0, SEEK_SET);
94      image_fread(image, pdrive, 2);
95#if 0
96      if (pdrive[0] != 0x00 || pdrive[1] != 0xfe)
97      {
98         basicdsk_read_sectormap(image, &tracks[id], &heads[id], &spt[id]);
99      }
100      else
101#endif
102
103      image_fseek(image, 2 * 256, SEEK_SET);
104      image_fread(image, pdrive, 4*16);
105   }
106
107   tracks = pdrive[id*16+3] + 1;
108   heads = (pdrive[id*16+7] & 0x40) ? 2 : 1;
109   spt = pdrive[id*16+4] / heads;
110   dir_sector = 5 * pdrive[id*16+0] * pdrive[id*16+5];
111   dir_length = 5 * pdrive[id*16+9];
112
113    /* set geometry so disk image can be read */
114   basicdsk_set_geometry(image, tracks, heads, spt, 256, 0, 0, FALSE);
115
116   /* mark directory sectors with deleted data address mark */
117   /* assumption dir_sector is a sector offset */
118   for (i = 0; i < dir_length; i++)
119   {
120      int track, side, sector_id;
121      int track_offset, sector_offset;
122
123      /* calc sector offset */
124      sector_offset = dir_sector + i;
125
126      /* get track offset */
127      track_offset = sector_offset / spt;
128
129      /* calc track */
130      track = track_offset / heads;
131
132      /* calc side */
133      side = track_offset % heads;
134
135      /* calc sector id - first sector id is 0! */
136      sector_id = sector_offset % spt;
137
138      /* set deleted data address mark for sector specified */
139      basicdsk_set_ddam(image, track, side, sector_id, 1);
140   }
141   return INIT_PASS;
142}
143
144
14575static const device_config *cassette_device_image(running_machine *machine)
14676{
14777   if (lx385_ctrl & 0x08)
src/mess/machine/concept.c
r5609r5610
1111//#include "machine/6551.h"
1212#include "machine/wd17xx.h"
1313#include "cpu/m68000/m68000.h"
14#include "devices/basicdsk.h"
1514#include "includes/corvushd.h"
1615
1716#define VERBOSE 1
src/mess/machine/msx.c
r5609r5610
1717#include "includes/msx.h"
1818#include "machine/tc8521.h"
1919#include "machine/wd17xx.h"
20#include "devices/basicdsk.h"
20#include "devices/mflopimg.h"
21#include "formats/basicdsk.h"
2122#include "video/tms9928a.h"
2223#include "cpu/z80/z80.h"
2324#include "video/v9938.h"
r5609r5610
722723
723724const wd17xx_interface msx_wd17xx_interface = { msx_wd179x_int, NULL };
724725
725DEVICE_IMAGE_LOAD( msx_floppy )
726{
727   int size, heads = 2;
726FLOPPY_OPTIONS_START(msx)
727   FLOPPY_OPTION(msx, "dsk", "MSX SS", basicdsk_identify_default, basicdsk_construct_default,
728      HEADS([1])
729      TRACKS([80])
730      SECTORS([9])
731      SECTOR_LENGTH([512])
732      FIRST_SECTOR_ID([1]))
733   FLOPPY_OPTION(msx, "dsk", "MSX DS", basicdsk_identify_default, basicdsk_construct_default,
734      HEADS([2])
735      TRACKS([80])
736      SECTORS([9])
737      SECTOR_LENGTH([512])
738      FIRST_SECTOR_ID([1]))
739FLOPPY_OPTIONS_END
728740
729   if (! image_has_been_created(image))
730      {
731      size = image_length(image);
732
733      switch (size)
734         {
735         case 360*1024:
736            heads = 1;
737         case 720*1024:
738            break;
739         default:
740            return INIT_FAIL;
741         }
742      }
743   else
744      return INIT_FAIL;
745
746   if (device_load_basicdsk_floppy (image) != INIT_PASS)
747      return INIT_FAIL;
748
749   basicdsk_set_geometry (image, 80, heads, 9, 512, 1, 0, FALSE);
750
751   return INIT_PASS;
752}
753
754741/*
755742** The PPI functions
756743*/
src/mess/machine/kaypro.c
r5609r5610
33#include "cpu/z80/z80.h"
44#include "machine/ctronics.h"
55#include "machine/kay_kbd.h"
6#include "devices/basicdsk.h"
76#include "devices/snapquik.h"
87#include "includes/kaypro.h"
98
r5609r5610
348347
349348const wd17xx_interface kaypro_wd1793_interface = { kaypro_fdc_callback, NULL };
350349
351static DEVICE_IMAGE_LOAD( kayproii_floppy )
352{
353   if (device_load_basicdsk_floppy(image)==INIT_PASS)
354   {
355      basicdsk_set_geometry(image, 40, 1, 10, 512, 0, 0, FALSE);
356      return INIT_PASS;
357   }
358
359   return INIT_FAIL;
360}
361
362static DEVICE_IMAGE_LOAD( kaypro2x_floppy )
363{
364   if (device_load_basicdsk_floppy(image)==INIT_PASS)
365   {
366      basicdsk_set_geometry(image, 80, 2, 10, 512, 0, 0, FALSE);
367      return INIT_PASS;
368   }
369
370   return INIT_FAIL;
371}
372
373void kayproii_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
374{
375   /* floppy */
376   switch(state)
377   {
378      /* --- the following bits of info are returned as 64-bit signed integers --- */
379      case MESS_DEVINFO_INT_COUNT:         info->i = 2; break;
380
381      /* --- the following bits of info are returned as pointers to data or functions --- */
382      case MESS_DEVINFO_PTR_LOAD:         info->load = DEVICE_IMAGE_LOAD_NAME(kayproii_floppy); break;
383
384      /* --- the following bits of info are returned as NULL-terminated strings --- */
385      case MESS_DEVINFO_STR_FILE_EXTENSIONS:      strcpy(info->s = device_temp_str(), "dsk"); break;
386
387      default:               legacybasicdsk_device_getinfo(devclass, state, info); break;
388   }
389}
390
391/* all machines have 2 floppies except kaypro 10 has one floppy and one hard drive */
392void kaypro2x_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
393{
394   /* floppy */
395   switch(state)
396   {
397      /* --- the following bits of info are returned as 64-bit signed integers --- */
398      case MESS_DEVINFO_INT_COUNT:         info->i = 2; break;
399
400      /* --- the following bits of info are returned as pointers to data or functions --- */
401      case MESS_DEVINFO_PTR_LOAD:         info->load = DEVICE_IMAGE_LOAD_NAME(kaypro2x_floppy); break;
402
403      /* --- the following bits of info are returned as NULL-terminated strings --- */
404      case MESS_DEVINFO_STR_FILE_EXTENSIONS:      strcpy(info->s = device_temp_str(), "dsk"); break;
405
406      default:               legacybasicdsk_device_getinfo(devclass, state, info); break;
407   }
408}
409
410
411350/***********************************************************
412351
413352   Machine
src/mess/machine/exidy.c
r5609r5610
88#include "sound/speaker.h"
99#include "sound/wave.h"
1010#include "machine/ctronics.h"
11#include "devices/basicdsk.h"
1211#include "devices/cassette.h"
1312#include "devices/snapquik.h"
1413#include "devices/cartslot.h"
1514#include "machine/ay31015.h"
1615#include "includes/exidy.h"
16#include "devices/mflopimg.h"
1717
1818
1919static const device_config *exidy_ay31015;
2020
21
22static DEVICE_IMAGE_LOAD( exidy_floppy )
23{
24   if (device_load_basicdsk_floppy(image)==INIT_PASS)
25   {
26      /* not correct */
27      basicdsk_set_geometry(image, 80, 2, 9, 512, 1, 0, FALSE);
28      return INIT_PASS;
29   }
30
31   return INIT_FAIL;
32}
33
34
3521static UINT8 exidy_fe = 0xff;
3622static UINT8 exidy_keyboard_line;
3723
r5609r5610
404390   }
405391}
406392
407void exidy_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
408{
409   /* floppy */
410   switch(state)
411   {
412      /* --- the following bits of info are returned as 64-bit signed integers --- */
413      case MESS_DEVINFO_INT_COUNT:         info->i = 4; break;
414
415      /* --- the following bits of info are returned as pointers to data or functions --- */
416      case MESS_DEVINFO_PTR_LOAD:         info->load = DEVICE_IMAGE_LOAD_NAME(exidy_floppy); break;
417
418      /* --- the following bits of info are returned as NULL-terminated strings --- */
419      case MESS_DEVINFO_STR_FILE_EXTENSIONS:      strcpy(info->s = device_temp_str(), "dsk"); break;
420
421      default:               legacybasicdsk_device_getinfo(devclass, state, info); break;
422   }
423}
424
425393MACHINE_START( exidyd )
426394{
427395//   serial_timer = timer_alloc(machine, exidy_serial_timer_callback, NULL);
src/mess/machine/atom.c
r5609r5610
2121#include "machine/ctronics.h"
2222#include "machine/i8271.h"
2323#include "machine/6522via.h"
24#include "devices/basicdsk.h"
2524#include "devices/flopdrv.h"
2625#include "devices/cassette.h"
2726#include "devices/snapquik.h"
r5609r5610
268267   return INIT_PASS;
269268}
270269
271
272/* load floppy */
273DEVICE_IMAGE_LOAD( atom_floppy )
274{
275   if (device_load_basicdsk_floppy(image)==INIT_PASS)
276   {
277      /* sector id's 0-9 */
278      /* drive, tracks, heads, sectors per track, sector length, dir_sector, dir_length, first sector id */
279      basicdsk_set_geometry(image, 80, 1, 10, 256, 0, 0, FALSE);
280
281      return INIT_PASS;
282   }
283
284   return INIT_PASS;
285}
286
287
288270READ8_DEVICE_HANDLER (atom_8255_porta_r )
289271{
290272   /* logerror("8255: Read port a\n"); */
src/mess/machine/partner.c
r5609r5610
1010#include "driver.h"
1111#include "cpu/i8085/i8085.h"
1212#include "devices/cassette.h"
13#include "devices/basicdsk.h"
1413#include "machine/i8255a.h"
1514#include "machine/8257dma.h"
1615#include "machine/wd17xx.h"
r5609r5610
5453   wd17xx_set_pause_time(fdc,10);
5554}
5655
57DEVICE_IMAGE_LOAD( partner_floppy )
58{
59   int size;
60
61   if (! image_has_been_created(image))
62      {
63      size = image_length(image);
64
65      switch (size)
66         {
67         case 800*1024:
68            break;
69         default:
70            return INIT_FAIL;
71         }
72      }
73   else
74      return INIT_FAIL;
75
76   if (device_load_basicdsk_floppy (image) != INIT_PASS)
77      return INIT_FAIL;
78
79   basicdsk_set_geometry (image, 80, 2, 5, 1024, 0, 0, FALSE);
80   return INIT_PASS;
81}
82
8356static void partner_window_1(running_machine *machine, UINT8 bank, UINT16 offset,UINT8 *rom)
8457{
8558   switch(partner_win_mem_page) {
src/mess/machine/special.c
r5609r5610
1212#include "cpu/i8085/i8085.h"
1313#include "sound/dac.h"
1414#include "devices/cassette.h"
15#include "devices/basicdsk.h"
1615#include "machine/i8255a.h"
1716#include "machine/pit8253.h"
1817#include "machine/wd17xx.h"
r5609r5610
294293  } 
295294}
296295
297static unsigned long specimx_calcoffset(UINT8 t, UINT8 h, UINT8 s,
298   UINT8 tracks, UINT8 heads, UINT8 sec_per_track, UINT16 sector_length, UINT8 first_sector_id, UINT16 offset_track_zero)
299{
300   unsigned long o;   
301    o = (t * 1024 * 5 * 2) + (h * 1024 * 5) + 1024 * (s-1);
302   return o;
303}
304
305DEVICE_IMAGE_LOAD( specimx_floppy )
306{
307   int size;
308
309   if (! image_has_been_created(image))
310      {
311      size = image_length(image);
312
313      switch (size)
314         {
315         case 800*1024:
316            break;
317         default:
318            return INIT_FAIL;
319         }
320      }
321   else
322      return INIT_FAIL;
323
324   if (device_load_basicdsk_floppy (image) != INIT_PASS)
325      return INIT_FAIL;
326
327   basicdsk_set_geometry (image, 80, 2, 6, 1024, 1, 0, FALSE);
328   basicdsk_set_calcoffset(image, specimx_calcoffset);
329   return INIT_PASS;
330}
331
332
333296/*
334297   Erik
335298*/
src/mess/machine/pk8020.c
r5609r5610
992992   sound_level = 0;   
993993}
994994
995DEVICE_IMAGE_LOAD( pk8020_floppy )
996{
997   int size;
998
999   if (! image_has_been_created(image))
1000      {
1001      size = image_length(image);
1002
1003      switch (size)
1004         {
1005         case 800*1024:
1006            break;
1007         default:
1008            return INIT_FAIL;
1009         }
1010      }
1011   else
1012      return INIT_FAIL;
1013
1014   if (device_load_basicdsk_floppy (image) != INIT_PASS)
1015      return INIT_FAIL;
1016
1017   basicdsk_set_geometry (image, 80, 2, 5, 1024, 1, 0, FALSE);   
1018   return INIT_PASS;
1019}
1020995INTERRUPT_GEN( pk8020_interrupt )
1021996{
1022997   takt ^= 1;
src/mess/machine/bbc.c
r5609r5610
2020#include "machine/i8271.h"
2121#include "machine/mc146818.h"
2222#include "machine/ctronics.h"
23#include "devices/basicdsk.h"
2423#include "devices/cassette.h"
2524
2625/* BBC Memory Size */
r5609r5610
14591458   BBC_Cassette_motor(space->machine, (data & 0x80) >> 7);
14601459}
14611460
1462
1463
1464
14651461/**************************************
1466   load floppy disc
1467***************************************/
1468
1469DEVICE_IMAGE_LOAD( bbc_floppy )
1470{
1471   if (device_load_basicdsk_floppy(image)==INIT_PASS)
1472   {
1473      /* sector id's 0-9 */
1474      /* drive, tracks, heads, sectors per track, sector length, dir_sector, dir_length, first sector id */
1475      basicdsk_set_geometry(image, 80, 1, 10, 256, 0, 0, FALSE);
1476
1477      return INIT_PASS;
1478   }
1479
1480   return INIT_FAIL;
1481}
1482
1483
1484/**************************************
14851462   i8271 disc control function
14861463***************************************/
14871464
src/mess/machine/kc.c
r5609r5610
1212
1313/* Devices */
1414#include "devices/cassette.h"
15#include "devices/basicdsk.h"
1615
17
1816#define KC_DEBUG 1
1917#define LOG(x) do { if (KC_DEBUG) logerror x; } while (0)
2018
r5609r5610
136134/* bit 4: Index pulse from disc */
137135static unsigned char kc85_disc_hw_input_gate;
138136
139DEVICE_IMAGE_LOAD( kc85_floppy )
140{
141   if (device_load_basicdsk_floppy(image)==INIT_PASS)
142   {
143      basicdsk_set_geometry(image, 80, 2, 9, 512, 1, 0, FALSE);
144      return INIT_PASS;
145   }
146
147   return INIT_FAIL;
148}
149
150137#if 0
151138static void kc85_disc_hw_ctc_interrupt(int state)
152139{
src/mess/mess.mak
r5609r5610
542542
543543$(MESSOBJ)/apf.a:            \
544544   $(MESS_DRIVERS)/apf.o      \
545   $(MESS_MACHINE)/apf.o      \
546545   $(MESS_VIDEO)/apf.o         \
547546   $(MESS_FORMATS)/apf_apt.o   \
548547
src/mess/drivers/dgn_beta.c
r5609r5610
4343#include "machine/6821pia.h"
4444#include "includes/coco.h"
4545#include "includes/dgn_beta.h"
46#include "devices/basicdsk.h"
4746#include "machine/6551.h"
4847#include "formats/coco_dsk.h"
4948#include "devices/mflopimg.h"
src/mess/drivers/mbee.c
r5609r5610
6666#include "cpu/z80/z80.h"
6767#include "cpu/z80/z80daisy.h"
6868#include "sound/wave.h"
69#include "devices/mflopimg.h"
70#include "formats/basicdsk.h"
6971#include "includes/mbee.h"
7072
7173size_t mbee_size;
r5609r5610
667669  Game driver(s)
668670
669671***************************************************************************/
672static FLOPPY_OPTIONS_START(mbee)
673   FLOPPY_OPTION(mbee, "ss80", "SS80 disk image", basicdsk_identify_default, basicdsk_construct_default,
674      HEADS([1])
675      TRACKS([80])
676      SECTORS([10])
677      SECTOR_LENGTH([512])
678      FIRST_SECTOR_ID([1]))
679   FLOPPY_OPTION(mbee, "ds40", "DS40 disk image", basicdsk_identify_default, basicdsk_construct_default,
680      HEADS([2])
681      TRACKS([80])
682      SECTORS([10])
683      SECTOR_LENGTH([512])
684      FIRST_SECTOR_ID([1]))
685   FLOPPY_OPTION(mbee, "ds80", "DS80 disk image", basicdsk_identify_default, basicdsk_construct_default,
686      HEADS([2])
687      TRACKS([160])
688      SECTORS([10])
689      SECTOR_LENGTH([512])
690      FIRST_SECTOR_ID([1]))
691   FLOPPY_OPTION(mbee, "ds84", "DS84 disk image", basicdsk_identify_default, basicdsk_construct_default,
692      HEADS([2])
693      TRACKS([168])
694      SECTORS([10])
695      SECTOR_LENGTH([512])
696      FIRST_SECTOR_ID([1]))                 
697FLOPPY_OPTIONS_END
670698
699static void mbee_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
700{
701   /* floppy */
702   switch(state)
703   {
704      /* --- the following bits of info are returned as 64-bit signed integers --- */
705      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
706
707      /* --- the following bits of info are returned as pointers to data or functions --- */
708      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_mbee; break;
709
710      default:                              floppy_device_getinfo(devclass, state, info); break;
711   }
712}
713
671714static SYSTEM_CONFIG_START(mbeeic)
672715   CONFIG_DEVICE(mbee_floppy_getinfo)
673716SYSTEM_CONFIG_END
src/mess/drivers/coco.c
r5609r5610
3333#include "machine/ds1315.h"
3434#include "machine/6883sam.h"
3535#include "includes/coco.h"
36#include "devices/basicdsk.h"
3736#include "machine/wd17xx.h"
3837#include "machine/6551.h"
3938#include "formats/coco_dsk.h"
src/mess/drivers/xor100.c
r5609r5610
4242#include "includes/xor100.h"
4343#include "cpu/z80/z80.h"
4444#include "formats/basicdsk.h"
45#include "devices/basicdsk.h"
4645#include "devices/mflopimg.h"
4746#include "devices/cassette.h"
4847#include "machine/com8116.h"
src/mess/drivers/tmc600.c
r5609r5610
8181
8282#include "driver.h"
8383#include "machine/ctronics.h"
84#include "devices/basicdsk.h"
84#include "devices/mflopimg.h"
85#include "formats/basicdsk.h"
8586#include "devices/cassette.h"
8687#include "devices/snapquik.h"
8788#include "cpu/cdp1802/cdp1802.h"
r5609r5610
363364ROM_END
364365
365366/* System Configuration */
367static FLOPPY_OPTIONS_START(tmc600)
368   // dsk
369FLOPPY_OPTIONS_END
366370
367371static void tmc600_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
368372{
r5609r5610
370374   switch(state)
371375   {
372376      /* --- the following bits of info are returned as 64-bit signed integers --- */
373      case MESS_DEVINFO_INT_COUNT:               info->i = 4; break;
377      case MESS_DEVINFO_INT_COUNT:                     info->i = 4; break;
374378
375379      /* --- the following bits of info are returned as pointers to data or functions --- */
376      case MESS_DEVINFO_PTR_LOAD:                  info->load = DEVICE_IMAGE_LOAD_NAME(basicdsk_floppy); break;
380      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_tmc600; break;
377381
378      /* --- the following bits of info are returned as NULL-terminated strings --- */
379      case MESS_DEVINFO_STR_FILE_EXTENSIONS:         strcpy(info->s = device_temp_str(), "dsk"); break;
380
381      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
382      default:                              floppy_device_getinfo(devclass, state, info); break;
382383   }
383384}
384385
src/mess/drivers/b2m.c
r5609r5610
1515#include "machine/pic8259.h"
1616#include "machine/msm8251.h"
1717#include "machine/wd17xx.h"
18#include "devices/basicdsk.h"
18#include "devices/mflopimg.h"
19#include "formats/basicdsk.h"
1920#include "includes/b2m.h"
2021
2122   
r5609r5610
225226     MDRV_CPU_IO_MAP(b2m_rom_io)
226227MACHINE_DRIVER_END
227228 
228 static void b2m_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
229static FLOPPY_OPTIONS_START(b2m)
230   FLOPPY_OPTION(b2m, "cpm", "Bashkiria-2M disk image", basicdsk_identify_default, basicdsk_construct_default,
231      HEADS([2])
232      TRACKS([80])
233      SECTORS([5])
234      SECTOR_LENGTH([1024])
235      FIRST_SECTOR_ID([1]))
236FLOPPY_OPTIONS_END
237
238static void b2m_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
229239{
230240   /* floppy */
231241   switch(state)
r5609r5610
234244      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
235245
236246      /* --- the following bits of info are returned as pointers to data or functions --- */
237      case MESS_DEVINFO_PTR_LOAD:                     info->load = device_load_b2m_floppy; break;
247      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_b2m; break;
238248
239      /* --- the following bits of info are returned as NULL-terminated strings --- */
240      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "cpm"); break;
249      default:                              floppy_device_getinfo(devclass, state, info); break;
250   }
251}
241252
242      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
243   }   
244}
245253/* ROM definition */
246254
247255ROM_START( b2m )
src/mess/drivers/abc80.c
r5609r5610
8787#include "machine/conkort.h"
8888
8989/* Devices */
90#include "devices/basicdsk.h"
90#include "devices/mflopimg.h"
9191#include "devices/cassette.h"
9292#include "devices/printer.h"
9393
r5609r5610
623623ROM_END
624624
625625/* System Configuration */
626
627626static void abc80_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
628627{
629628   /* floppy */
630629   switch(state)
631630   {
632631      /* --- the following bits of info are returned as 64-bit signed integers --- */
633      case MESS_DEVINFO_INT_COUNT:               info->i = 2; break;
632      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
634633
635634      /* --- the following bits of info are returned as pointers to data or functions --- */
636      case MESS_DEVINFO_PTR_LOAD:                  info->load = DEVICE_IMAGE_LOAD_NAME(abc_floppy); break;
635      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_abc80; break;
637636
638      /* --- the following bits of info are returned as NULL-terminated strings --- */
639      case MESS_DEVINFO_STR_FILE_EXTENSIONS:         strcpy(info->s = device_temp_str(), "dsk"); break;
640
641      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
637      default:                              floppy_device_getinfo(devclass, state, info); break;
642638   }
643639}
644640
src/mess/drivers/sg1000.c
r5609r5610
6666#include "driver.h"
6767#include "cpu/z80/z80.h"
6868#include "includes/sg1000.h"
69#include "devices/basicdsk.h"
69#include "devices/mflopimg.h"
70#include "formats/basicdsk.h"
7071#include "devices/cartslot.h"
7172#include "devices/cassette.h"
7273#include "devices/printer.h"
r5609r5610
979980ROM_END
980981
981982/* System Configuration */
983static FLOPPY_OPTIONS_START(sf7000)
984   FLOPPY_OPTION(sf7000, "sf7", "SF7 disk image", basicdsk_identify_default, basicdsk_construct_default,
985      HEADS([1])
986      TRACKS([40])
987      SECTORS([16])
988      SECTOR_LENGTH([256])
989      FIRST_SECTOR_ID([1]))
990FLOPPY_OPTIONS_END
982991
983static DEVICE_IMAGE_LOAD( sf7000_floppy )
984{
985   if (image_has_been_created(image))
986      return INIT_FAIL;
987
988   if (image_length(image) == 40*1*16*256) // 160K
989   {
990      if (DEVICE_IMAGE_LOAD_NAME(basicdsk_floppy)(image) == INIT_PASS)
991      {
992         /* image, tracks, sides, sectors per track, sector length, first sector id, offset of track 0, track skipping */
993         basicdsk_set_geometry(image, 40, 1, 16, 256, 1, 0, FALSE);
994
995         return INIT_PASS;
996      }
997   }
998
999   return INIT_FAIL;
1000}
1001
1002992static void sf7000_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
1003993{
994   /* floppy */
1004995   switch(state)
1005996   {
1006997      /* --- the following bits of info are returned as 64-bit signed integers --- */
1007      case MESS_DEVINFO_INT_COUNT:               info->i = 1; break;
998      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
1008999
10091000      /* --- the following bits of info are returned as pointers to data or functions --- */
1010      case MESS_DEVINFO_PTR_LOAD:                  info->load = DEVICE_IMAGE_LOAD_NAME(sf7000_floppy); break;
1001      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_sf7000; break;
10111002
1012      /* --- the following bits of info are returned as NULL-terminated strings --- */
1013      case MESS_DEVINFO_STR_FILE_EXTENSIONS:         strcpy(info->s = device_temp_str(), "sf7"); break;
1014
1015      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
1003      default:                              floppy_device_getinfo(devclass, state, info); break;
10161004   }
10171005}
10181006
src/mess/drivers/mikromik.c
r5609r5610
11#include "driver.h"
22#include "includes/mikromik.h"
33#include "formats/basicdsk.h"
4#include "devices/basicdsk.h"
54#include "devices/mflopimg.h"
65#include "cpu/i8085/i8085.h"
76#include "machine/8237dma.h"
src/mess/drivers/osi.c
r5609r5610
183183#include "machine/6821pia.h"
184184#include "sound/discrete.h"
185185#include "sound/beep.h"
186#include "devices/basicdsk.h"
186#include "devices/mflopimg.h"
187#include "formats/basicdsk.h"
187188#include "devices/cassette.h"
188189
189190/* Sound */
r5609r5610
883884   CONFIG_RAM        (20 * 1024 )
884885SYSTEM_CONFIG_END
885886
886static DEVICE_IMAGE_LOAD( osi )
887{
888   if (image_has_been_created(image))
889      return INIT_FAIL;
887static FLOPPY_OPTIONS_START(osi)
888   FLOPPY_OPTION(osi, "img", "OSI disk image", basicdsk_identify_default, basicdsk_construct_default,
889      HEADS([1])
890      TRACKS([36])
891      SECTORS([10])
892      SECTOR_LENGTH([256])
893      FIRST_SECTOR_ID([0]))
894FLOPPY_OPTIONS_END
890895
891   switch (image_length(image))
892   {
893   case 36*1*10*256: // 90KB 5.25"
894      basicdsk_set_geometry(image, 36, 1, 10, 256, 0, 0, FALSE);
895      break;
896/*
897   case 77*1*12*256: // 231KB 8"
898      basicdsk_set_geometry(image, 77, 1, 12, 256, 0, 0, FALSE);
899      break;
900*/
901   default:
902      return INIT_FAIL;
903   }
904
905   return device_load_basicdsk_floppy(image);
906}
907
908896static void osi_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
909897{
898   /* floppy */
910899   switch(state)
911900   {
912901      /* --- the following bits of info are returned as 64-bit signed integers --- */
913      case MESS_DEVINFO_INT_COUNT:                  info->i = 1; break;
902      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
914903
915904      /* --- the following bits of info are returned as pointers to data or functions --- */
916      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(osi); break;
905      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_osi; break;
917906
918      /* --- the following bits of info are returned as NULL-terminated strings --- */
919      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "img"); break;
920
921      default:                                 legacybasicdsk_device_getinfo(devclass, state, info); break;
907      default:                              floppy_device_getinfo(devclass, state, info); break;
922908   }
923909}
924
925910static SYSTEM_CONFIG_START( c1pmf )
926911   CONFIG_RAM_DEFAULT(20 * 1024 )
927912   CONFIG_DEVICE( osi_floppy_getinfo )
src/mess/drivers/vector06.c
r5609r5610
1515#include "machine/wd17xx.h"
1616#include "devices/cassette.h"
1717#include "devices/cartslot.h"
18#include "devices/basicdsk.h"
18#include "devices/mflopimg.h"
19#include "formats/basicdsk.h"
1920#include "includes/vector06.h"
2021
2122/* Address maps */
r5609r5610
134135   CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED
135136};
136137
138static FLOPPY_OPTIONS_START(vector)
139   FLOPPY_OPTION(vector, "fdd", "Vector disk image", basicdsk_identify_default, basicdsk_construct_default,
140      HEADS([2])
141      TRACKS([82])
142      SECTORS([5])
143      SECTOR_LENGTH([1024])
144      FIRST_SECTOR_ID([1]))
145FLOPPY_OPTIONS_END
146
137147static void vector_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
138148{
139149   /* floppy */
140150   switch(state)
141151   {
142152      /* --- the following bits of info are returned as 64-bit signed integers --- */
143      case MESS_DEVINFO_INT_COUNT:               info->i = 2; break;
153      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
144154
145155      /* --- the following bits of info are returned as pointers to data or functions --- */
146      case MESS_DEVINFO_PTR_LOAD:                  info->load = device_load_vector_floppy; break;
156      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_vector; break;
147157
148      /* --- the following bits of info are returned as NULL-terminated strings --- */
149      case MESS_DEVINFO_STR_FILE_EXTENSIONS:         strcpy(info->s = device_temp_str(), "fdd"); break;
150
151      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
152   }   
158      default:                              floppy_device_getinfo(devclass, state, info); break;
159   }
153160}
154161
155162/* Machine driver */
src/mess/drivers/v1050.c
r5609r5610
113113#include "cpu/m6502/m6502.h"
114114#include "cpu/mcs48/mcs48.h"
115115#include "formats/basicdsk.h"
116#include "devices/basicdsk.h"
117116#include "devices/mflopimg.h"
118117#include "machine/ctronics.h"
119118#include "machine/i8214.h"
src/mess/drivers/ql.c
r5609r5610
4242#include "includes/ql.h"
4343#include "cpu/mcs48/mcs48.h"
4444#include "cpu/m68000/m68000.h"
45#include "devices/basicdsk.h"
45#include "devices/mflopimg.h"
46#include "formats/basicdsk.h"
4647#include "devices/cartslot.h"
4748#include "devices/microdrv.h"
4849#include "devices/snapquik.h"
r5609r5610
867868   }
868869}
869870
870static DEVICE_IMAGE_LOAD( ql_floppy )
871{
872   if (image_has_been_created(image))
873      return INIT_FAIL;
871static FLOPPY_OPTIONS_START(ql)
872   FLOPPY_OPTION(ql, "dsk", "SSSD disk image", basicdsk_identify_default, basicdsk_construct_default,
873      HEADS([1])
874      TRACKS([40])
875      SECTORS([9])
876      SECTOR_LENGTH([512])
877      FIRST_SECTOR_ID([1]))
878   FLOPPY_OPTION(ql, "dsk", "DSSD disk image", basicdsk_identify_default, basicdsk_construct_default,
879      HEADS([2])
880      TRACKS([40])
881      SECTORS([9])
882      SECTOR_LENGTH([512])
883      FIRST_SECTOR_ID([1]))
884   FLOPPY_OPTION(ql, "dsk", "DSDD disk image", basicdsk_identify_default, basicdsk_construct_default,
885      HEADS([2])
886      TRACKS([80])
887      SECTORS([9])
888      SECTOR_LENGTH([512])
889      FIRST_SECTOR_ID([1]))
890   FLOPPY_OPTION(ql, "dsk", "DSHD disk image", basicdsk_identify_default, basicdsk_construct_default,
891      HEADS([2])
892      TRACKS([80])
893      SECTORS([18])
894      SECTOR_LENGTH([512])
895      FIRST_SECTOR_ID([1]))
896   FLOPPY_OPTION(ql, "dsk", "DSED disk image", basicdsk_identify_default, basicdsk_construct_default,
897      HEADS([2])
898      TRACKS([80])
899      SECTORS([40])
900      SECTOR_LENGTH([512])
901      FIRST_SECTOR_ID([1]))     
902FLOPPY_OPTIONS_END
874903
875   switch (image_length(image))
876   {
877   case 40*1*9*512: // 184320 (SSSD)
878      basicdsk_set_geometry(image, 40, 1, 9, 512, 1, 0, FALSE);
879      return INIT_PASS;
880
881   case 40*2*9*512: // 368640 (DSSD)
882      basicdsk_set_geometry(image, 40, 2, 9, 512, 1, 0, FALSE);
883      return INIT_PASS;
884
885   case 80*2*9*512: // 737280 (DSDD)
886      basicdsk_set_geometry(image, 80, 2, 9, 512, 1, 0, FALSE);
887      return INIT_PASS;
888
889   case 80*2*18*512: // 1474560 (HD)
890      basicdsk_set_geometry(image, 80, 2, 18, 512, 1, 0, FALSE);
891      return INIT_PASS;
892
893   case 80*2*40*512: // 3276800 (ED)
894      basicdsk_set_geometry(image, 80, 2, 40, 512, 1, 0, FALSE);
895      return INIT_PASS;
896   }
897
898   return INIT_FAIL;
899}
900
901904static void ql_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
902905{
906   /* floppy */
903907   switch(state)
904908   {
905909      /* --- the following bits of info are returned as 64-bit signed integers --- */
906      case MESS_DEVINFO_INT_COUNT:               info->i = 2; break;
910      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
907911
908912      /* --- the following bits of info are returned as pointers to data or functions --- */
909      case MESS_DEVINFO_PTR_LOAD:                  info->load = DEVICE_IMAGE_LOAD_NAME(ql_floppy); break;
913      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_ql; break;
910914
911      /* --- the following bits of info are returned as NULL-terminated strings --- */
912      case MESS_DEVINFO_STR_FILE_EXTENSIONS:         strcpy(info->s = device_temp_str(), "dsk"); break;
913
914      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
915      default:                              floppy_device_getinfo(devclass, state, info); break;
915916   }
916917}
917
918918static SYSTEM_CONFIG_START( ql )
919919   CONFIG_RAM_DEFAULT   (128 * 1024)
920920   CONFIG_RAM         (192 * 1024) // 64K expansion
src/mess/drivers/abc80x.c
r5609r5610
8080#include "sound/discrete.h"
8181
8282/* Devices */
83#include "devices/basicdsk.h"
83#include "devices/mflopimg.h"
8484#include "devices/cassette.h"
8585#include "devices/printer.h"
8686
r5609r5610
14571457ROM_END
14581458
14591459/* System Configuration */
1460
14611460static void abc800_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
14621461{
14631462   /* floppy */
14641463   switch(state)
14651464   {
14661465      /* --- the following bits of info are returned as 64-bit signed integers --- */
1467      case MESS_DEVINFO_INT_COUNT:                  info->i = 2; break;
1466      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
14681467
14691468      /* --- the following bits of info are returned as pointers to data or functions --- */
1470      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(abc_floppy); break;
1469      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_abc80; break;
14711470
1472      /* --- the following bits of info are returned as NULL-terminated strings --- */
1473      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "dsk"); break;
1474
1475      default:                                 legacybasicdsk_device_getinfo(devclass, state, info); break;
1471      default:                              floppy_device_getinfo(devclass, state, info); break;
14761472   }
14771473}
14781474
src/mess/drivers/orion.c
r5609r5610
1616#include "sound/wave.h"
1717#include "machine/mc146818.h"
1818#include "machine/wd17xx.h"
19#include "devices/basicdsk.h"
19#include "devices/mflopimg.h"
20#include "formats/basicdsk.h"
2021#include "devices/cassette.h"
2122#include "devices/cartslot.h"
2223#include "formats/rk_cas.h"
r5609r5610
231232   MDRV_CARTSLOT_ADD("cart")
232233MACHINE_DRIVER_END
233234
235static FLOPPY_OPTIONS_START(orion)
236   FLOPPY_OPTION(orion, "odi,img", "Orion disk image", basicdsk_identify_default, basicdsk_construct_default,
237      HEADS([2])
238      TRACKS([80])
239      SECTORS([5])
240      SECTOR_LENGTH([1024])
241      FIRST_SECTOR_ID([1]))
242   FLOPPY_OPTION(orion, "odi,img", "Lucksian Key Orion disk image", basicdsk_identify_default, basicdsk_construct_default,
243      HEADS([2])
244      TRACKS([80])
245      SECTORS([9])
246      SECTOR_LENGTH([512])
247      FIRST_SECTOR_ID([1]))
248FLOPPY_OPTIONS_END
234249
235250static void orion_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
236251{
r5609r5610
241256      case MESS_DEVINFO_INT_COUNT:                     info->i = 4; break;
242257
243258      /* --- the following bits of info are returned as pointers to data or functions --- */
244      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(orion_floppy); break;
259      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_orion; break;
245260
246      /* --- the following bits of info are returned as NULL-terminated strings --- */
247      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "odi,img"); break;
248
249      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
261      default:                              floppy_device_getinfo(devclass, state, info); break;
250262   }
251263}
252264
src/mess/drivers/nascom1.c
r5609r5610
5959#include "machine/z80pio.h"
6060
6161/* Devices */
62#include "devices/basicdsk.h"
62#include "devices/mflopimg.h"
63#include "formats/basicdsk.h"
6364#include "devices/cartslot.h"
6465#include "devices/cassette.h"
6566
r5609r5610
384385//   }
385386//}
386387
388static FLOPPY_OPTIONS_START(nascom2)
389   FLOPPY_OPTION(nascom2, "dsk", "Nascom 2 SS disk image", basicdsk_identify_default, basicdsk_construct_default,
390      HEADS([1])
391      TRACKS([80])
392      SECTORS([16])
393      SECTOR_LENGTH([256])
394      FIRST_SECTOR_ID([1]))
395   FLOPPY_OPTION(nascom2, "dsk", "Nascom 2 DS disk image", basicdsk_identify_default, basicdsk_construct_default,
396      HEADS([2])
397      TRACKS([80])
398      SECTORS([16])
399      SECTOR_LENGTH([256])
400      FIRST_SECTOR_ID([1]))
401FLOPPY_OPTIONS_END
387402
388403static void nascom2_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
389404{
r5609r5610
394409      case MESS_DEVINFO_INT_COUNT:                     info->i = 4; break;
395410
396411      /* --- the following bits of info are returned as pointers to data or functions --- */
397      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(nascom2_floppy); break;
412      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_nascom2; break;
398413
399      /* --- the following bits of info are returned as NULL-terminated strings --- */
400      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "dsk"); break;
401
402      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
414      default:                              floppy_device_getinfo(devclass, state, info); break;
403415   }
404416}
405417
406
407418static SYSTEM_CONFIG_START( nascom1 )
408419   CONFIG_RAM(1 * 1024)
409420   CONFIG_RAM(16 * 1024)
src/mess/drivers/newbrain.c
r5609r5610
99#include "machine/z80sio.h"
1010#include "includes/newbrain.h"
1111#include "includes/serial.h"
12#include "devices/basicdsk.h"
12#include "devices/mflopimg.h"
13#include "formats/basicdsk.h"
1314#include "devices/cassette.h"
1415#include "machine/rescap.h"
1516
r5609r5610
16331634ROM_END
16341635
16351636/* System Configuration */
1637static FLOPPY_OPTIONS_START(newbrain)
1638   // 180K img
1639FLOPPY_OPTIONS_END
16361640
1637static DEVICE_IMAGE_LOAD( newbrain_floppy )
1638{
1639   if (image_has_been_created(image))
1640      return INIT_FAIL;
1641
1642   if (device_load_basicdsk_floppy(image) == INIT_PASS)
1643   {
1644      // 180K
1645   }
1646
1647   return INIT_PASS;
1648}
1649
16501641static void newbrain_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
16511642{
16521643   /* floppy */
16531644   switch(state)
16541645   {
16551646      /* --- the following bits of info are returned as 64-bit signed integers --- */
1656      case MESS_DEVINFO_INT_COUNT:               info->i = 2; break;
1647      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
16571648
16581649      /* --- the following bits of info are returned as pointers to data or functions --- */
1659      case MESS_DEVINFO_PTR_LOAD:                  info->load = DEVICE_IMAGE_LOAD_NAME(newbrain_floppy); break;
1650      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_newbrain; break;
16601651
1661      /* --- the following bits of info are returned as NULL-terminated strings --- */
1662      case MESS_DEVINFO_STR_FILE_EXTENSIONS:         strcpy(info->s = device_temp_str(), "img"); break;
1663
1664      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
1652      default:                              floppy_device_getinfo(devclass, state, info); break;
16651653   }
16661654}
16671655
src/mess/drivers/einstein.c
r5609r5610
5858#include "machine/ctronics.h"
5959#include "machine/msm8251.h"
6060#include "devices/dsk.h"
61#include "devices/basicdsk.h"
6261#include "sound/ay8910.h"
6362#include "video/mc6845.h"
6463#include "rendlay.h"
src/mess/drivers/amstrad.c
r5609r5610
9999
100100/* Devices */
101101#include "devices/dsk.h"      /* for CPCEMU style disk images */
102#include "devices/basicdsk.h"   /* for 720k MSX disk images (Aleste supports these) */
102#include "devices/mflopimg.h"
103#include "formats/basicdsk.h"
103104#include "includes/msx_slot.h"
104105#include "includes/msx.h"  /* MSX floppy device load */
105106#include "devices/snapquik.h"
r5609r5610
11371138   {
11381139      /* --- the following bits of info are returned as 64-bit signed integers --- */
11391140      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
1140      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(msx_floppy); break;
1141      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "dsk"); break;
11421141
1143      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
1142      /* --- the following bits of info are returned as pointers to data or functions --- */
1143      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_msx; break;
1144
1145      default:                              floppy_device_getinfo(devclass, state, info); break;
11441146   }
11451147}
11461148
src/mess/drivers/atm.c
r5609r5610
66#include "devices/cassette.h"
77#include "sound/ay8910.h"
88#include "sound/speaker.h"
9#include "formats/tzx_cas.h"
10#include "devices/basicdsk.h"
119#include "machine/wd17xx.h"
1210#include "machine/beta.h"
1311
src/mess/drivers/tiki100.c
r5609r5610
2727#include "includes/tiki100.h"
2828#include "cpu/z80/z80.h"
2929#include "cpu/z80/z80daisy.h"
30#include "devices/basicdsk.h"
30#include "devices/mflopimg.h"
31#include "formats/basicdsk.h"
3132#include "machine/z80ctc.h"
3233#include "machine/z80dart.h"
3334#include "machine/z80pio.h"
r5609r5610
678679ROM_END
679680
680681/* System Configuration */
682static FLOPPY_OPTIONS_START(tiki100)
683   FLOPPY_OPTION(tiki100, "dsk", "SSSD disk image", basicdsk_identify_default, basicdsk_construct_default,
684      HEADS([1])
685      TRACKS([40])
686      SECTORS([18])
687      SECTOR_LENGTH([128])
688      FIRST_SECTOR_ID([1]))
689   FLOPPY_OPTION(tiki100, "dsk", "SSDD disk image", basicdsk_identify_default, basicdsk_construct_default,
690      HEADS([1])
691      TRACKS([40])
692      SECTORS([10])
693      SECTOR_LENGTH([512])
694      FIRST_SECTOR_ID([1]))
695   FLOPPY_OPTION(tiki100, "dsk", "DSDD disk image", basicdsk_identify_default, basicdsk_construct_default,
696      HEADS([2])
697      TRACKS([40])
698      SECTORS([10])
699      SECTOR_LENGTH([512])
700      FIRST_SECTOR_ID([1]))
701   FLOPPY_OPTION(tiki100, "dsk", "DSHD disk image", basicdsk_identify_default, basicdsk_construct_default,
702      HEADS([2])
703      TRACKS([80])
704      SECTORS([10])
705      SECTOR_LENGTH([512])
706      FIRST_SECTOR_ID([1]))
707FLOPPY_OPTIONS_END
681708
682static DEVICE_IMAGE_LOAD( tiki100_floppy )
683{
684   if (image_has_been_created(image))
685   {
686      return INIT_FAIL;
687   }
688
689   if (DEVICE_IMAGE_LOAD_NAME(basicdsk_floppy)(image) == INIT_PASS)
690   {
691      switch (image_length(image))
692      {
693      case 40*1*18*128: /* 90KB SSSD */
694         basicdsk_set_geometry(image, 40, 1, 18, 128, 1, 0, FALSE);
695         break;
696     
697      case 40*1*10*512: /* 200KB SSDD */
698         basicdsk_set_geometry(image, 40, 1, 10, 512, 1, 0, FALSE);
699         break;
700
701      case 40*2*10*512: /* 400KB DSDD */
702         basicdsk_set_geometry(image, 40, 2, 10, 512, 1, 0, FALSE);
703         break;
704
705      case 80*2*10*512: // 800KB DSHD
706         basicdsk_set_geometry(image, 80, 2, 10, 512, 1, 0, FALSE);
707         break;
708
709      default:
710         return INIT_FAIL;
711      }
712
713      return INIT_PASS;
714   }
715
716   return INIT_FAIL;
717}
718
719709static void tiki100_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
720710{
721   switch (state)
711   /* floppy */
712   switch(state)
722713   {
723714      /* --- the following bits of info are returned as 64-bit signed integers --- */
724      case MESS_DEVINFO_INT_COUNT:               info->i = 2; break;
715      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
725716
726717      /* --- the following bits of info are returned as pointers to data or functions --- */
727      case MESS_DEVINFO_PTR_LOAD:                  info->load = DEVICE_IMAGE_LOAD_NAME(tiki100_floppy); break;
718      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_tiki100; break;
728719
729      /* --- the following bits of info are returned as NULL-terminated strings --- */
730      case MESS_DEVINFO_STR_FILE_EXTENSIONS:         strcpy(info->s = device_temp_str(), "dsk"); break;
731
732      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
720      default:                              floppy_device_getinfo(devclass, state, info); break;
733721   }
734722}
735723
src/mess/drivers/nanos.c
r5609r5610
1313#include "machine/z80sio.h"
1414#include "machine/z80ctc.h"
1515#include "machine/nec765.h"
16#include "devices/basicdsk.h"
16#include "devices/mflopimg.h"
17#include "formats/basicdsk.h"
1718
18
1919static const UINT8 *FNT;
2020
2121static ADDRESS_MAP_START(nanos_mem, ADDRESS_SPACE_PROGRAM, 8)
r5609r5610
470470   
471471MACHINE_DRIVER_END
472472
473static DEVICE_IMAGE_LOAD( nanos_floppy )
474{
475   int size;
476   if (! image_has_been_created(image))
477      {
478      size = image_length(image);
473static FLOPPY_OPTIONS_START(nanos)
474   FLOPPY_OPTION(nanos, "img", "NANOS disk image", basicdsk_identify_default, basicdsk_construct_default,
475      HEADS([2])
476      TRACKS([80])
477      SECTORS([5])
478      SECTOR_LENGTH([1024])
479      FIRST_SECTOR_ID([1]))
480FLOPPY_OPTIONS_END
479481
480      switch (size)
481         {
482         case 800*1024:
483            break;
484         default:
485            return INIT_FAIL;
486         }
487      }
488   else
489      return INIT_FAIL;
490
491   if (device_load_basicdsk_floppy (image) != INIT_PASS)
492      return INIT_FAIL;
493         
494   basicdsk_set_geometry (image, 80, 2, 5, 1024, 1, 0, FALSE);
495   return INIT_PASS;
496}
497
498482static void nanos_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
499483{
484   /* floppy */
500485   switch(state)
501486   {
502487      /* --- the following bits of info are returned as 64-bit signed integers --- */
503      case MESS_DEVINFO_INT_COUNT:               info->i = 4; break;
488      case MESS_DEVINFO_INT_COUNT:                     info->i = 4; break;
504489
505490      /* --- the following bits of info are returned as pointers to data or functions --- */
506      case MESS_DEVINFO_PTR_LOAD:                  info->load = DEVICE_IMAGE_LOAD_NAME(nanos_floppy); break;
491      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_nanos; break;
507492
508      /* --- the following bits of info are returned as NULL-terminated strings --- */
509      case MESS_DEVINFO_STR_FILE_EXTENSIONS:         strcpy(info->s = device_temp_str(), "img"); break;
510
511      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
493      default:                              floppy_device_getinfo(devclass, state, info); break;
512494   }
513495}
514496
src/mess/drivers/z80ne.c
r5609r5610
9292#include "driver.h"
9393#include "cpu/z80/z80.h"
9494#include "includes/z80ne.h"
95#include "devices/basicdsk.h"
9695#include "devices/mflopimg.h"
9796#include "devices/cassette.h"
9897#include "formats/z80ne_dsk.h"
r5609r5610
598597      case MESS_DEVINFO_INT_COUNT:         info->i = 4; break;
599598
600599      /* --- the following bits of info are returned as pointers to data or functions --- */
601/*      case MESS_DEVINFO_PTR_LOAD:         info->load = DEVICE_IMAGE_LOAD_NAME(z80ne_floppy); break; */
602      /* --- the following bits of info are returned as pointers to data or functions --- */
603600
604601      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:   info->p = (void *) floppyoptions_z80ne; break;
605602
src/mess/drivers/bw12.c
r5609r5610
2626#include "driver.h"
2727#include "includes/bw12.h"
2828#include "cpu/z80/z80.h"
29#include "devices/basicdsk.h"
29#include "devices/mflopimg.h"
30#include "formats/basicdsk.h"
3031#include "machine/6821pia.h"
3132#include "machine/ctronics.h"
3233#include "machine/nec765.h"
r5609r5610
775776#define rom_bw14 rom_bw12
776777
777778/* System Configurations */
779static FLOPPY_OPTIONS_START(bw12)
780   FLOPPY_OPTION(bw12, "dsk", "180KB BW 12 SSDD", basicdsk_identify_default, basicdsk_construct_default,
781      HEADS([1])
782      TRACKS([40])
783      SECTORS([18])
784      SECTOR_LENGTH([256])
785      FIRST_SECTOR_ID([0]))
786   FLOPPY_OPTION(bw12, "dsk", "360KB BW 14 DSDD", basicdsk_identify_default, basicdsk_construct_default,
787      HEADS([2])
788      TRACKS([40])
789      SECTORS([18])
790      SECTOR_LENGTH([256])
791      FIRST_SECTOR_ID([0]))
792   FLOPPY_OPTION(bw12, "dsk", "SVI-328 SSDD", basicdsk_identify_default, basicdsk_construct_default,
793      HEADS([1])
794      TRACKS([40])
795      SECTORS([17])
796      SECTOR_LENGTH([256])
797      FIRST_SECTOR_ID([0]))
798   FLOPPY_OPTION(bw12, "dsk", "SVI-328 DSDD", basicdsk_identify_default, basicdsk_construct_default,
799      HEADS([2])
800      TRACKS([40])
801      SECTORS([17])
802      SECTOR_LENGTH([256])
803      FIRST_SECTOR_ID([0]))
804   FLOPPY_OPTION(bw12, "dsk", "Kaypro II SSDD", basicdsk_identify_default, basicdsk_construct_default,
805      HEADS([1])
806      TRACKS([40])
807      SECTORS([10])
808      SECTOR_LENGTH([512])
809      FIRST_SECTOR_ID([0]))
810FLOPPY_OPTIONS_END
778811
779static DEVICE_IMAGE_LOAD( bw12_floppy )
780{
781   if (image_has_been_created(image))
782   {
783      return INIT_FAIL;
784   }
785
786   if (DEVICE_IMAGE_LOAD_NAME(basicdsk_floppy)(image) == INIT_PASS)
787   {
788      switch (image_length(image))
789      {
790      case 40*1*18*256: /* 180KB BW 12 SSDD */
791         basicdsk_set_geometry(image, 40, 1, 18, 256, 0, 0, FALSE);
792         break;
793     
794      case 40*2*18*256: /* 360KB BW 14 DSDD */
795         basicdsk_set_geometry(image, 40, 2, 18, 256, 0, 0, FALSE);
796         break;
797
798      case 40*1*17*256: /* SVI-328 SSDD */
799         basicdsk_set_geometry(image, 40, 1, 17, 256, 0, 0, FALSE);
800         break;
801
802      case 40*2*17*256: /* SVI-328 DSDD */
803         basicdsk_set_geometry(image, 40, 2, 17, 256, 0, 0, FALSE);
804         break;
805
806      case 40*1*10*512: /* Kaypro II SSDD */
807         basicdsk_set_geometry(image, 40, 1, 10, 512, 0, 0, FALSE);
808         break;
809
810      default:
811         return INIT_FAIL;
812      }
813
814      return INIT_PASS;
815   }
816
817   return INIT_FAIL;
818}
819
820812static void bw12_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
821813{
822   switch (state)
814   /* floppy */
815   switch(state)
823816   {
824817      /* --- the following bits of info are returned as 64-bit signed integers --- */
825      case MESS_DEVINFO_INT_COUNT:               info->i = 2; break;
818      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
826819
827820      /* --- the following bits of info are returned as pointers to data or functions --- */
828      case MESS_DEVINFO_PTR_LOAD:                  info->load = DEVICE_IMAGE_LOAD_NAME(bw12_floppy); break;
821      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_bw12; break;
829822
830      /* --- the following bits of info are returned as NULL-terminated strings --- */
831      case MESS_DEVINFO_STR_FILE_EXTENSIONS:         strcpy(info->s = device_temp_str(), "dsk"); break;
832
833      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
823      default:                              floppy_device_getinfo(devclass, state, info); break;
834824   }
835825}
836
837826static SYSTEM_CONFIG_START( bw12 )
838827   CONFIG_RAM_DEFAULT( 64 * 1024 )
839828   CONFIG_DEVICE( bw12_floppy_getinfo )
src/mess/drivers/pentagon.c
r5609r5610
77#include "sound/ay8910.h"
88#include "sound/speaker.h"
99#include "formats/tzx_cas.h"
10#include "devices/basicdsk.h"
1110#include "machine/wd17xx.h"
1211#include "machine/beta.h"
1312
src/mess/drivers/msx.c
r5609r5610
286286#include "machine/ctronics.h"
287287#include "includes/msx_slot.h"
288288#include "includes/msx.h"
289#include "devices/basicdsk.h"
289#include "devices/mflopimg.h"
290290#include "devices/cartslot.h"
291291#include "devices/cassette.h"
292292#include "formats/fmsx_cas.h"
r5609r5610
36583658      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
36593659
36603660      /* --- the following bits of info are returned as pointers to data or functions --- */
3661      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(msx_floppy); break;
3661      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_msx; break;
36623662
3663      /* --- the following bits of info are returned as NULL-terminated strings --- */
3664      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "dsk"); break;
3665
3666      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
3663      default:                              floppy_device_getinfo(devclass, state, info); break;
36673664   }
36683665}
36693666
3670
36713667static SYSTEM_CONFIG_START(msx)
36723668   CONFIG_DEVICE(msx_floppy_getinfo)
36733669SYSTEM_CONFIG_END
src/mess/drivers/prof80.c
r5609r5610
3232#include "includes/prof80.h"
3333#include "cpu/z80/z80.h"
3434#include "cpu/z80/z80daisy.h"
35#include "devices/basicdsk.h"
3635#include "video/mc6845.h"
3736#include "machine/i8255a.h"
3837#include "machine/nec765.h"
r5609r5610
4039#include "machine/z80sti.h"
4140#include "machine/ctronics.h"
4241#include "machine/rescap.h"
42#include "devices/mflopimg.h"
43#include "formats/basicdsk.h"
4344
45
4446INLINE const device_config *get_floppy_image(running_machine *machine, int drive)
4547{
4648   return image_from_devtype_and_index(machine, IO_FLOPPY, drive);
r5609r5610
12531255ROM_END
12541256
12551257/* System Configurations */
1258static FLOPPY_OPTIONS_START(prof80)
1259   // dsk
1260FLOPPY_OPTIONS_END
12561261
1257static DEVICE_IMAGE_LOAD( prof80_floppy )
1258{
1259   if (image_has_been_created(image))
1260      return INIT_FAIL;
1261
1262   return INIT_FAIL;
1263}
1264
12651262static void prof80_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
12661263{
1264   /* floppy */
12671265   switch(state)
12681266   {
12691267      /* --- the following bits of info are returned as 64-bit signed integers --- */
1270      case MESS_DEVINFO_INT_COUNT:               info->i = 2; break;
1268      case MESS_DEVINFO_INT_COUNT:                     info->i = 4; break;
12711269
12721270      /* --- the following bits of info are returned as pointers to data or functions --- */
1273      case MESS_DEVINFO_PTR_LOAD:                  info->load = DEVICE_IMAGE_LOAD_NAME(prof80_floppy); break;
1271      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_prof80; break;
12741272
1275      /* --- the following bits of info are returned as NULL-terminated strings --- */
1276      case MESS_DEVINFO_STR_FILE_EXTENSIONS:         strcpy(info->s = device_temp_str(), "dsk"); break;
1277
1278      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
1273      default:                              floppy_device_getinfo(devclass, state, info); break;
12791274   }
12801275}
1281
12821276static SYSTEM_CONFIG_START( prof80 )
12831277   CONFIG_RAM_DEFAULT   (128 * 1024)
12841278   CONFIG_DEVICE(prof80_floppy_getinfo)
src/mess/drivers/aquarius.c
r5609r5610
2323#include "cpu/z80/z80.h"
2424#include "sound/ay8910.h"
2525#include "sound/speaker.h"
26#include "devices/basicdsk.h"
26#include "devices/mflopimg.h"
27#include "formats/basicdsk.h"
2728#include "devices/cartslot.h"
2829#include "devices/cassette.h"
2930#include "devices/printer.h"
r5609r5610
486487/***************************************************************************
487488    SYSTEM CONFIG
488489***************************************************************************/
489
490static DEVICE_IMAGE_LOAD( aquarius_floppy )
491{
490static FLOPPY_OPTIONS_START(aquarius)
492491   /* 128K images, 64K/side */
493   return INIT_FAIL;
494}
492FLOPPY_OPTIONS_END
495493
496494static void aquarius_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
497495{
r5609r5610
499497   switch(state)
500498   {
501499      /* --- the following bits of info are returned as 64-bit signed integers --- */
502      case MESS_DEVINFO_INT_COUNT:               info->i = 2; break;
500      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
503501
504502      /* --- the following bits of info are returned as pointers to data or functions --- */
505      case MESS_DEVINFO_PTR_LOAD:                  info->load = DEVICE_IMAGE_LOAD_NAME(aquarius_floppy); break;
503      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_aquarius; break;
506504
507      /* --- the following bits of info are returned as NULL-terminated strings --- */
508      case MESS_DEVINFO_STR_FILE_EXTENSIONS:         strcpy(info->s = device_temp_str(), "dsk"); break;
509
510      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
505      default:                              floppy_device_getinfo(devclass, state, info); break;
511506   }
512507}
513508
src/mess/drivers/kaypro.c
r5609r5610
4141#include "machine/kay_kbd.h"
4242#include "sound/beep.h"
4343#include "devices/snapquik.h"
44#include "devices/mflopimg.h"
45#include "formats/basicdsk.h"
4446#include "includes/kaypro.h"
4547
4648
r5609r5610
307309   ROM_LOAD("81-817.u31",   0x0000, 0x1000, CRC(5f72da5b) SHA1(8a597000cce1a7e184abfb7bebcb564c6bf24fb7) )
308310ROM_END
309311
312static FLOPPY_OPTIONS_START(kayproii)
313   FLOPPY_OPTION(kayproii, "img", "Kaypro II disk image", basicdsk_identify_default, basicdsk_construct_default,
314      HEADS([1])
315      TRACKS([40])
316      SECTORS([10])
317      SECTOR_LENGTH([512])
318      FIRST_SECTOR_ID([0]))
319FLOPPY_OPTIONS_END
310320
321static FLOPPY_OPTIONS_START(kaypro2x)
322   FLOPPY_OPTION(kaypro2x, "img", "Kaypro 2x disk image", basicdsk_identify_default, basicdsk_construct_default,
323      HEADS([2])
324      TRACKS([80])
325      SECTORS([10])
326      SECTOR_LENGTH([512])
327      FIRST_SECTOR_ID([0]))
328FLOPPY_OPTIONS_END
329
330static void kayproii_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
331{
332   /* floppy */
333   switch(state)
334   {
335      /* --- the following bits of info are returned as 64-bit signed integers --- */
336      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
337
338      /* --- the following bits of info are returned as pointers to data or functions --- */
339      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_kayproii; break;
340
341      default:                              floppy_device_getinfo(devclass, state, info); break;
342   }
343}
344
345static void kaypro2x_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
346{
347   /* floppy */
348   switch(state)
349   {
350      /* --- the following bits of info are returned as 64-bit signed integers --- */
351      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
352
353      /* --- the following bits of info are returned as pointers to data or functions --- */
354      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_kaypro2x; break;
355
356      default:                              floppy_device_getinfo(devclass, state, info); break;
357   }
358}
359
311360static SYSTEM_CONFIG_START(kayproii)
312361   CONFIG_DEVICE(kayproii_floppy_getinfo)
313362SYSTEM_CONFIG_END
src/mess/drivers/exidy.c
r5609r5610
146146#include "devices/snapquik.h"
147147#include "devices/cartslot.h"
148148#include "machine/ay31015.h"
149#include "devices/mflopimg.h"
150#include "formats/basicdsk.h"
149151#include "includes/exidy.h"
150152
151153
r5609r5610
432434   ROM_LOAD_OPTIONAL("bruce.dat",   0x0000, 0x0020, CRC(fae922cb) SHA1(470a86844cfeab0d9282242e03ff1d8a1b2238d1)) /* video prom */
433435ROM_END
434436
437static FLOPPY_OPTIONS_START(exidy)
438   FLOPPY_OPTION(exidy, "dsk", "Exidy disk image", basicdsk_identify_default, basicdsk_construct_default,
439      HEADS([2])
440      TRACKS([80])
441      SECTORS([9])
442      SECTOR_LENGTH([512])
443      FIRST_SECTOR_ID([1]))
444FLOPPY_OPTIONS_END
445
446static void exidy_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
447{
448   /* floppy */
449   switch(state)
450   {
451      /* --- the following bits of info are returned as 64-bit signed integers --- */
452      case MESS_DEVINFO_INT_COUNT:                     info->i = 4; break;
453
454      /* --- the following bits of info are returned as pointers to data or functions --- */
455      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_exidy; break;
456
457      default:                              floppy_device_getinfo(devclass, state, info); break;
458   }
459}
460
435461static SYSTEM_CONFIG_START(exidy)
436462   CONFIG_DEVICE(exidy_floppy_getinfo)
437463SYSTEM_CONFIG_END
src/mess/drivers/pc8801.c
r5609r5610
8989#include "includes/pc8801.h"
9090#include "machine/nec765.h"
9191#include "includes/d88.h"
92#include "devices/basicdsk.h"
9392#include "sound/2203intf.h"
9493
9594static const gfx_layout char_layout_40L_h =
src/mess/drivers/bw2.c
r5609r5610
3636#include "machine/msm8251.h"
3737#include "machine/wd17xx.h"
3838#include "machine/pit8253.h"
39#include "devices/basicdsk.h"
39#include "devices/mflopimg.h"
40#include "formats/basicdsk.h"
4041#include "video/msm6255.h"
4142
4243
r5609r5610
259260
260261
261262/* Floppy */
262
263static DEVICE_IMAGE_LOAD( bw2_floppy )
264{
265   if (image_has_been_created(image)) {
266      return INIT_FAIL;
267   }
268
269   if (device_load_basicdsk_floppy(image) == INIT_PASS)
270   {
271      switch (image_length(image))
272      {
273      case 80*1*17*256: // 340K
274         basicdsk_set_geometry(image, 80, 1, 17, 256, 0, 0, FALSE);
275         return INIT_PASS;
276
277      case 80*1*18*256: // 360K
278         basicdsk_set_geometry(image, 80, 1, 18, 256, 0, 0, FALSE);
279         return INIT_PASS;
280      }
281   }
282
283   return INIT_FAIL;
284}
285
286263static WD17XX_CALLBACK( bw2_wd17xx_callback )
287264{
288265   switch(state)
r5609r5610
862839   ROM_LOAD("ramcard-10.bin", 0x0000, 0x4000, CRC(68cde1ba) SHA1(a776a27d64f7b857565594beb63aa2cd692dcf04))
863840ROM_END
864841
842static FLOPPY_OPTIONS_START(bw2)
843   FLOPPY_OPTION(bw2, "dsk", "BW2 340K disk image", basicdsk_identify_default, basicdsk_construct_default,
844      HEADS([1])
845      TRACKS([80])
846      SECTORS([17])
847      SECTOR_LENGTH([256])
848      FIRST_SECTOR_ID([0]))
849   FLOPPY_OPTION(bw2, "dsk", "BW2 360K disk image", basicdsk_identify_default, basicdsk_construct_default,
850      HEADS([1])
851      TRACKS([80])
852      SECTORS([18])
853      SECTOR_LENGTH([256])
854      FIRST_SECTOR_ID([0]))     
855FLOPPY_OPTIONS_END
856
865857static void bw2_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
866858{
867859   /* floppy */
868860   switch(state)
869861   {
870862      /* --- the following bits of info are returned as 64-bit signed integers --- */
871      case MESS_DEVINFO_INT_COUNT:
872         info->i = 2;
873         break;
863      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
874864
875865      /* --- the following bits of info are returned as pointers to data or functions --- */
876      case MESS_DEVINFO_PTR_LOAD:
877         info->load = DEVICE_IMAGE_LOAD_NAME(bw2_floppy);
878         break;
866      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_bw2; break;
879867
880      /* --- the following bits of info are returned as NULL-terminated strings --- */
881      case MESS_DEVINFO_STR_FILE_EXTENSIONS:
882         strcpy(info->s = device_temp_str(), "dsk");
883         break;
884
885      default:
886         legacybasicdsk_device_getinfo(devclass, state, info);
887         break;
868      default:                              floppy_device_getinfo(devclass, state, info); break;
888869   }
889870}
890
891871static void bw2_serial_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
892872{
893873   /* serial */
src/mess/drivers/enterp.c
r5609r5610
2020#include "audio/dave.h"
2121#include "video/epnick.h"
2222#include "machine/wd17xx.h"
23#include "devices/basicdsk.h"
23#include "devices/mflopimg.h"
24#include "formats/basicdsk.h"
2425
25
2626#define ENTERPRISE_XTAL_X1   XTAL_8MHz
2727
2828
r5609r5610
173173
174174static MACHINE_RESET( enterprise )
175175{
176   const device_config *fdc = devtag_get_device(machine, "wd1770");
176177   cpu_set_input_line_vector(cputag_get_cpu(machine, "maincpu"), 0, 0xff);
177178
178179   floppy_drive_set_geometry(image_from_devtype_and_index(machine, IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80);
180   wd17xx_set_density(fdc, DEN_FM_HI);
179181}
180182
181183
r5609r5610
236238   wd17xx_set_side(fdc, BIT(data, 4));
237239}
238240
239
240static DEVICE_IMAGE_LOAD( enterprise_floppy )
241{
242   const device_config *fdc = devtag_get_device(image->machine, "wd1770");
243
244   wd17xx_set_density(fdc, DEN_FM_HI);
245
246   if (device_load_basicdsk_floppy(image) != INIT_PASS)
247      return INIT_FAIL;
248
249   basicdsk_set_geometry(image, 80, 2, 9, 512, 1, 0, FALSE);
250   return INIT_PASS;
251}
252
253
254241/***************************************************************************
255242    ADDRESS MAPS
256243***************************************************************************/
r5609r5610
517504/***************************************************************************
518505    SYSTEM CONFIG
519506***************************************************************************/
507static FLOPPY_OPTIONS_START(enterprise)
508   FLOPPY_OPTION(enterprise, "dsk,img", "Enterprise disk image", basicdsk_identify_default, basicdsk_construct_default,
509      HEADS([2])
510      TRACKS([80])
511      SECTORS([9])
512      SECTOR_LENGTH([512])
513      FIRST_SECTOR_ID([1]))
514FLOPPY_OPTIONS_END
520515
521516static void enterprise_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
522517{
r5609r5610
524519   switch(state)
525520   {
526521      /* --- the following bits of info are returned as 64-bit signed integers --- */
527      case MESS_DEVINFO_INT_COUNT:         info->i = 4; break;
522      case MESS_DEVINFO_INT_COUNT:                     info->i = 4; break;
528523
529524      /* --- the following bits of info are returned as pointers to data or functions --- */
530      case MESS_DEVINFO_PTR_LOAD:            info->load = DEVICE_IMAGE_LOAD_NAME(enterprise_floppy); break;
525      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_enterprise; break;
531526
532      /* --- the following bits of info are returned as NULL-terminated strings --- */
533      case MESS_DEVINFO_STR_FILE_EXTENSIONS:   strcpy(info->s = device_temp_str(), "dsk,img"); break;
534
535      default:                        legacybasicdsk_device_getinfo(devclass, state, info); break;
527      default:                              floppy_device_getinfo(devclass, state, info); break;
536528   }
537529}
538
539
540530static SYSTEM_CONFIG_START(ep64)
541531   CONFIG_RAM_DEFAULT(64*1024)
542532   CONFIG_DEVICE(enterprise_floppy_getinfo)
src/mess/drivers/atom.c
r5609r5610
6969#include "video/m6847.h"
7070
7171/* Devices */
72#include "devices/basicdsk.h"
73#include "devices/flopdrv.h"
72#include "devices/mflopimg.h"
73#include "formats/basicdsk.h"
7474#include "devices/cassette.h"
7575#include "devices/snapquik.h"
7676#include "sound/speaker.h"
r5609r5610
334334   ROM_LOAD ("atomicw.rom",0x018000,0x1000, CRC(a3fd737d) SHA1(d418d9322c69c49106ed2c268ad0864c0f2c4c1b))    // Atomic Windows
335335ROM_END
336336
337static FLOPPY_OPTIONS_START(atom)
338   FLOPPY_OPTION(atom, "ssd", "Atom disk image", basicdsk_identify_default, basicdsk_construct_default,
339      HEADS([1])
340      TRACKS([80])
341      SECTORS([10])
342      SECTOR_LENGTH([256])
343      FIRST_SECTOR_ID([0]))
344FLOPPY_OPTIONS_END
337345
338346static void atom_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
339347{
r5609r5610
344352      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
345353
346354      /* --- the following bits of info are returned as pointers to data or functions --- */
347      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(atom_floppy); break;
355      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_atom; break;
348356
349      /* --- the following bits of info are returned as NULL-terminated strings --- */
350      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "ssd"); break;
351
352      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
357      default:                              floppy_device_getinfo(devclass, state, info); break;
353358   }
354359}
355360
src/mess/drivers/apf.c
r5609r5610
2020
2121#include "machine/6821pia.h"
2222#include "machine/wd17xx.h"
23#include "devices/basicdsk.h"
23#include "devices/mflopimg.h"
24#include "formats/basicdsk.h"
2425#include "devices/cassette.h"
2526#include "devices/cartslot.h"
2627#include "formats/apf_apt.h"
r5609r5610
685686   ROM_CART_LOAD("cart", 0x8000, 0x2000, ROM_OPTIONAL)
686687ROM_END
687688
689static FLOPPY_OPTIONS_START(apfimag)
690   FLOPPY_OPTION(apfimag, "apd", "APF disk image", basicdsk_identify_default, basicdsk_construct_default,
691      HEADS([1])
692      TRACKS([40])
693      SECTORS([8])
694      SECTOR_LENGTH([256])
695      FIRST_SECTOR_ID([1]))
696FLOPPY_OPTIONS_END
688697
689698static void apfimag_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
690699{
r5609r5610
695704      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
696705
697706      /* --- the following bits of info are returned as pointers to data or functions --- */
698      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(apfimag_floppy); break;
707      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_apfimag; break;
699708
700      /* --- the following bits of info are returned as NULL-terminated strings --- */
701      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "apd"); break;
702
703      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
709      default:                              floppy_device_getinfo(devclass, state, info); break;
704710   }
705711}
706712
707
708713static SYSTEM_CONFIG_START( apfimag )
709714   CONFIG_DEVICE(apfimag_floppy_getinfo)
710715SYSTEM_CONFIG_END
src/mess/drivers/partner.c
r5609r5610
1515#include "machine/wd17xx.h"
1616#include "video/i8275.h"
1717#include "devices/cassette.h"
18#include "devices/basicdsk.h"
18#include "devices/mflopimg.h"
19#include "formats/basicdsk.h"
1920#include "formats/rk_cas.h"
2021#include "includes/radio86.h"
2122#include "includes/partner.h"
r5609r5610
179180   MDRV_WD1793_ADD("wd1793", partner_wd17xx_interface )
180181MACHINE_DRIVER_END
181182
183static FLOPPY_OPTIONS_START(partner)
184   FLOPPY_OPTION(partner, "cpm", "Partner disk image", basicdsk_identify_default, basicdsk_construct_default,
185      HEADS([2])
186      TRACKS([80])
187      SECTORS([5])
188      SECTOR_LENGTH([1024])
189      FIRST_SECTOR_ID([1]))
190FLOPPY_OPTIONS_END
182191
183192static void partner_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
184193{
r5609r5610
189198      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
190199
191200      /* --- the following bits of info are returned as pointers to data or functions --- */
192      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(partner_floppy); break;
201      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_partner; break;
193202
194      /* --- the following bits of info are returned as NULL-terminated strings --- */
195      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "cpm"); break;
196
197      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
203      default:                              floppy_device_getinfo(devclass, state, info); break;
198204   }
199205}
200206
src/mess/drivers/tmc2000e.c
r5609r5610
3333#include "includes/tmc2000e.h"
3434#include "cpu/cdp1802/cdp1802.h"
3535#include "devices/printer.h"
36#include "devices/basicdsk.h"
36#include "devices/mflopimg.h"
37#include "formats/basicdsk.h"
3738#include "devices/cassette.h"
3839#include "video/cdp1864.h"
3940#include "sound/beep.h"
r5609r5610
326327ROM_END
327328
328329/* System Configuration */
330static FLOPPY_OPTIONS_START(tmc2000e)
331   // dsk
332FLOPPY_OPTIONS_END
329333
330334static void tmc2000e_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
331335{
r5609r5610
336340      case MESS_DEVINFO_INT_COUNT:                     info->i = 4; break;
337341
338342      /* --- the following bits of info are returned as pointers to data or functions --- */
339      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(basicdsk_floppy); break;
343      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_tmc2000e; break;
340344
341      /* --- the following bits of info are returned as NULL-terminated strings --- */
342      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "dsk"); break;
343
344      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
345      default:                              floppy_device_getinfo(devclass, state, info); break;
345346   }
346347}
347348
src/mess/drivers/special.c
r5609r5610
1717#include "machine/i8255a.h"
1818#include "machine/pit8253.h"
1919#include "devices/cassette.h"
20#include "devices/basicdsk.h"
20#include "devices/mflopimg.h"
21#include "formats/basicdsk.h"
2122#include "formats/rk_cas.h"
2223#include "machine/wd17xx.h"
2324
r5609r5610
537538    ROM_LOAD( "erik.bin", 0x10000, 0x10000, CRC(6F3208F4) SHA1(41f6e2763ef60d3c7214c98893e580d25346fa2d))
538539ROM_END
539540
541static FLOPPY_OPTIONS_START(specimx)
542   FLOPPY_OPTION(specimx, "odi,img", "Specialist MX disk image", basicdsk_identify_default, basicdsk_construct_default,
543      HEADS([2])
544      TRACKS([80])
545      SECTORS([5])
546      SECTOR_LENGTH([1024])
547      FIRST_SECTOR_ID([1]))
548FLOPPY_OPTIONS_END
549
540550static void specimx_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
541551{
542552   /* floppy */
r5609r5610
546556      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
547557
548558      /* --- the following bits of info are returned as pointers to data or functions --- */
549      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(specimx_floppy); break;
559      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_specimx; break;
550560
551      /* --- the following bits of info are returned as NULL-terminated strings --- */
552      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "odi,img"); break;
553
554      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
561      default:                              floppy_device_getinfo(devclass, state, info); break;
555562   }
556563}
557564
src/mess/drivers/pyl601.c
r5609r5610
99#include "driver.h"
1010#include "cpu/m6800/m6800.h"
1111#include "video/mc6845.h"
12#include "devices/basicdsk.h"
12#include "devices/mflopimg.h"
13#include "formats/basicdsk.h"
1314#include "machine/nec765.h"
1415
1516static UINT8 rom_page;
r5609r5610
493494   MDRV_MC6845_ADD("crtc", MC6845, XTAL_2MHz, pyl601a_crtc6845_interface)
494495MACHINE_DRIVER_END
495496
496static DEVICE_IMAGE_LOAD( pyldin_floppy )
497{
498   if (image_has_been_created(image))
499   {
500      return INIT_FAIL;
501   }
497static FLOPPY_OPTIONS_START(pyldin)
498   FLOPPY_OPTION(pyldin, "img", "Pyldin disk image", basicdsk_identify_default, basicdsk_construct_default,
499      HEADS([2])
500      TRACKS([80])
501      SECTORS([9])
502      SECTOR_LENGTH([512])
503      FIRST_SECTOR_ID([1]))
504FLOPPY_OPTIONS_END
502505
503   if (DEVICE_IMAGE_LOAD_NAME(basicdsk_floppy)(image) == INIT_PASS)
504   {
505      switch (image_length(image))
506      {
507      case 720*1024:
508         basicdsk_set_geometry(image, 80, 2, 9, 512, 1, 0, FALSE);
509         break;
510      default:
511         return INIT_FAIL;
512      }
513
514      return INIT_PASS;
515   }
516
517   return INIT_FAIL;
518} 
519
520506static void pyldin_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
521507{
522   switch (state)
508   /* floppy */
509   switch(state)
523510   {
524511      /* --- the following bits of info are returned as 64-bit signed integers --- */
525      case MESS_DEVINFO_INT_COUNT:               info->i = 2; break;
512      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
526513
527514      /* --- the following bits of info are returned as pointers to data or functions --- */
528      case MESS_DEVINFO_PTR_LOAD:                  info->load = DEVICE_IMAGE_LOAD_NAME(pyldin_floppy); break;
515      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_pyldin; break;
529516
530      /* --- the following bits of info are returned as NULL-terminated strings --- */
531      case MESS_DEVINFO_STR_FILE_EXTENSIONS:         strcpy(info->s = device_temp_str(), "img"); break;
532
533      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
517      default:                              floppy_device_getinfo(devclass, state, info); break;
534518   }
535519}
520
536521static SYSTEM_CONFIG_START(pyl601)
537522   CONFIG_RAM_DEFAULT((64 +512) * 1024)
538523   CONFIG_DEVICE( pyldin_floppy_getinfo )
src/mess/drivers/a310.c
r5609r5610
3131
3232#include "driver.h"
3333#include "machine/wd17xx.h"
34#include "devices/basicdsk.h"
3534#include "cpu/arm/arm.h"
3635#include "sound/dac.h"
3736#include "includes/archimds.h"
src/mess/drivers/pk8020.c
r5609r5610
1010#include "driver.h"
1111#include "cpu/i8085/i8085.h"
1212#include "machine/i8255a.h"
13#include "devices/mflopimg.h"
14#include "formats/basicdsk.h"
1315#include "includes/pk8020.h"
1416
1517/* Address maps */
r5609r5610
188190   MDRV_CASSETTE_ADD( "cassette", pk8020_cassette_config )   
189191MACHINE_DRIVER_END
190192
191 static void pk8020_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
193static FLOPPY_OPTIONS_START(pk8020)
194   FLOPPY_OPTION(pk8020, "kdi", "PK8020 disk image", basicdsk_identify_default, basicdsk_construct_default,
195      HEADS([2])
196      TRACKS([80])
197      SECTORS([5])
198      SECTOR_LENGTH([1024])
199      FIRST_SECTOR_ID([1]))
200FLOPPY_OPTIONS_END
201
202static void pk8020_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
192203{
193204   /* floppy */
194205   switch(state)
r5609r5610
197208      case MESS_DEVINFO_INT_COUNT:                     info->i = 4; break;
198209
199210      /* --- the following bits of info are returned as pointers to data or functions --- */
200      case MESS_DEVINFO_PTR_LOAD:                     info->load = device_load_pk8020_floppy; break;
211      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_pk8020; break;
201212
202      /* --- the following bits of info are returned as NULL-terminated strings --- */
203      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "kdi"); break;
204
205      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
206   }   
213      default:                              floppy_device_getinfo(devclass, state, info); break;
214   }
207215}
208216
209217/* ROM definition */
src/mess/drivers/bbc.c
r5609r5610
1717#include "includes/bbc.h"
1818#include "machine/upd7002.h"
1919#include "machine/ctronics.h"
20#include "devices/basicdsk.h"
20#include "devices/mflopimg.h"
21#include "formats/basicdsk.h"
2122#include "devices/cartslot.h"
2223#include "devices/cassette.h"
2324#include "formats/uef_cas.h"
r5609r5610
915916   MDRV_IMPORT_FROM(bbc_cartslot)
916917MACHINE_DRIVER_END
917918
919static FLOPPY_OPTIONS_START(bbc)
920   FLOPPY_OPTION(bbc, "ssd,bbc,img", "BBC disk image", basicdsk_identify_default, basicdsk_construct_default,
921      HEADS([1])
922      TRACKS([80])
923      SECTORS([10])
924      SECTOR_LENGTH([256])
925      FIRST_SECTOR_ID([0]))
926FLOPPY_OPTIONS_END
927
918928static void bbc_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
919929{
920930   /* floppy */
r5609r5610
924934      case MESS_DEVINFO_INT_COUNT:                     info->i = 2; break;
925935
926936      /* --- the following bits of info are returned as pointers to data or functions --- */
927      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(bbc_floppy); break;
937      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_bbc; break;
928938
929      /* --- the following bits of info are returned as NULL-terminated strings --- */
930      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "ssd,bbc,img"); break;
931
932      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
939      default:                              floppy_device_getinfo(devclass, state, info); break;
933940   }
934941}
935942
936
937943static SYSTEM_CONFIG_START(bbc)
938944   CONFIG_DEVICE(bbc_floppy_getinfo)
939945SYSTEM_CONFIG_END
940946
941
942
943947/*     YEAR  NAME      PARENT    COMPAT MACHINE   INPUT  INIT      CONFIG   COMPANY  FULLNAME */
944948COMP ( 1981, bbca,      0,       0,      bbca,     bbca,   bbc,     0,      "Acorn","BBC Micro Model A" , 0)
945949COMP ( 1981, bbcb,     bbca,    0,      bbcb,     bbca,   bbc,      bbc,      "Acorn","BBC Micro Model B" , 0)
src/mess/drivers/kc.c
r5609r5610
2727
2828/* Devices */
2929#include "devices/cassette.h"
30#include "devices/basicdsk.h"
30#include "devices/mflopimg.h"
31#include "formats/basicdsk.h"
3132
32
3333static READ8_HANDLER(kc85_4_port_r)
3434{
3535   int port;
r5609r5610
483483   CONFIG_RAM_DEFAULT      (64 * 1024)
484484SYSTEM_CONFIG_END
485485
486static FLOPPY_OPTIONS_START(kc85)
487   FLOPPY_OPTION(kc85, "img", "KC85 disk image", basicdsk_identify_default, basicdsk_construct_default,
488      HEADS([2])
489      TRACKS([80])
490      SECTORS([9])
491      SECTOR_LENGTH([512])
492      FIRST_SECTOR_ID([1]))
493FLOPPY_OPTIONS_END
494
486495static void kc85d_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
487496{
488497   /* floppy */
r5609r5610
492501      case MESS_DEVINFO_INT_COUNT:                     info->i = 4; break;
493502
494503      /* --- the following bits of info are returned as pointers to data or functions --- */
495      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(kc85_floppy); break;
504      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:            info->p = (void *) floppyoptions_kc85; break;
496505
497      /* --- the following bits of info are returned as NULL-terminated strings --- */
498      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "dsk"); break;
499
500      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
506      default:                              floppy_device_getinfo(devclass, state, info); break;
501507   }
502508}
503509

Previous 15994 Revisions Next


© 1998-2018 The MESS Team