Previous 15994 Revisions Next

r6719 Tuesday 22nd December, 2009 at 09:46:22 UTC by Dirk Best
[WD17XX] Removed wd17xx_type_t in favor of the device type
[src/mess/machine]wd17xx.c wd17xx.h

src/mess/machine/wd17xx.c
r6718r6719
202202/* Type IV commands */
203203#define FDC_FORCE_INT   0xd0   /* force interrupt */
204204
205/* enumeration to specify the type of FDC; there are subtle differences */
206typedef enum
207{
208   WD_TYPE_1770,
209   WD_TYPE_1771,
210   WD_TYPE_1772,
211   WD_TYPE_1773,
212   WD_TYPE_179X,
213   WD_TYPE_1793,
214   WD_TYPE_2793,
215
216   /* duplicate constants */
217   WD_TYPE_177X = WD_TYPE_1770,
218   WD_TYPE_MB8877 = WD_TYPE_179X
219} wd17xx_type_t;
220
221205/* structure describing a double density track */
222206#define TRKSIZE_DD      6144
223207#if 0
r6718r6719
307291
308292
309293   DENSITY   density;            /* FM/MFM, single / double density */
310   wd17xx_type_t type;
294
311295   UINT8   track_reg;            /* value of track register */
312296   UINT8   command_type;         /* last command type */
313297   UINT8   head;               /* current head # */
r6718r6719
422406
423407static int wd17xx_has_side_select(const device_config *device)
424408{
425   wd1770_state *w = get_safe_token(device);
426   return (w->type == WD_TYPE_1773) || (w->type == WD_TYPE_1793) || (w->type == WD_TYPE_2793);
409   return (device->type == WD1773 || device->type == WD1793 || device->type == WD2793);
427410}
428411
429412static int wd17xx_get_datarate_in_us(DENSITY density)
r6718r6719
588571   }
589572#endif
590573
591   if (w->type == WD_TYPE_1771)
574   if (device->type == WD1771)
592575      w->data_count = TRKSIZE_SD;
593576   else
594577      w->data_count = (w->density) ? TRKSIZE_DD : TRKSIZE_SD;
r6718r6719
726709   }
727710#endif
728711
729   if (w->type == WD_TYPE_1771)
712   if (device->type == WD1771)
730713      w->data_count = TRKSIZE_SD;
731714   else
732715      w->data_count = (w->density) ? TRKSIZE_DD : TRKSIZE_SD;
r6718r6719
15701553            {
15711554            w->command = data & ~FDC_MASK_TYPE_III;
15721555            w->data_offset = 0;
1573            if (w->type == WD_TYPE_1771)
1556            if (device->type == WD1771)
15741557               w->data_count = TRKSIZE_SD;
15751558            else
15761559               w->data_count = (w->density) ? TRKSIZE_DD : TRKSIZE_SD;
r6718r6719
18671850   devcb_resolve_write_line(&w->out_intrq_func, &w->intf->out_intrq_func, device);
18681851   devcb_resolve_write_line(&w->out_drq_func, &w->intf->out_drq_func, device);
18691852
1870   /* model specific values */
1871   w->type = WD_TYPE_1770;
1872
18731853   /* stepping rate depends on the clock */
18741854   w->stepping_rate[0] = 6;
18751855   w->stepping_rate[1] = 12;
r6718r6719
18771857   w->stepping_rate[3] = 30;
18781858}
18791859
1880static DEVICE_START( wd1771 )
1881{
1882   wd1770_state *w = get_safe_token(device);
1883
1884   DEVICE_START_CALL(wd1770);
1885
1886   w->type = WD_TYPE_1771;
1887}
1888
18891860static DEVICE_START( wd1772 )
18901861{
18911862   wd1770_state *w = get_safe_token(device);
18921863
18931864   DEVICE_START_CALL(wd1770);
18941865
1895   w->type = WD_TYPE_1772;
1896
18971866   /* the 1772 has faster track stepping rates */
18981867   w->stepping_rate[0] = 6;
18991868   w->stepping_rate[1] = 12;
r6718r6719
19011870   w->stepping_rate[3] = 3;
19021871}
19031872
1904static DEVICE_START( wd1773 )
1905{
1906   wd1770_state *w = get_safe_token(device);
1907
1908   DEVICE_START_CALL(wd1770);
1909
1910   w->type = WD_TYPE_1773;
1911}
1912
1913static DEVICE_START( wd179x )
1914{
1915   wd1770_state *w = get_safe_token(device);
1916
1917   DEVICE_START_CALL(wd1770);
1918
1919   w->type = WD_TYPE_179X;
1920}
1921
1922static DEVICE_START( wd1793 )
1923{
1924   wd1770_state *w = get_safe_token(device);
1925
1926   DEVICE_START_CALL(wd1770);
1927
1928   w->type = WD_TYPE_1793;
1929}
1930
1931static DEVICE_START( wd2793 )
1932{
1933   wd1770_state *w = get_safe_token(device);
1934
1935   DEVICE_START_CALL(wd1770);
1936
1937   w->type = WD_TYPE_2793;
1938}
1939
1940static DEVICE_START( wd177x )
1941{
1942   wd1770_state *w = get_safe_token(device);
1943
1944   DEVICE_START_CALL(wd1770);
1945
1946   w->type = WD_TYPE_177X;
1947}
1948
1949static DEVICE_START( mb8877 )
1950{
1951   wd1770_state *w = get_safe_token(device);
1952
1953   DEVICE_START_CALL(wd1770);
1954
1955   w->type = WD_TYPE_MB8877;
1956}
1957
19581873static DEVICE_RESET( wd1770 )
19591874{
19601875   wd1770_state *w = get_safe_token(device);
r6718r6719
20121927#include "devtempl.h"
20131928
20141929#define DEVTEMPLATE_DERIVED_ID(p,s)      p##wd1771##s
2015#define DEVTEMPLATE_DERIVED_FEATURES   DT_HAS_START
1930#define DEVTEMPLATE_DERIVED_FEATURES   0
20161931#define DEVTEMPLATE_DERIVED_NAME      "WD1771"
20171932#include "devtempl.h"
20181933
r6718r6719
20221937#include "devtempl.h"
20231938
20241939#define DEVTEMPLATE_DERIVED_ID(p,s)      p##wd1773##s
2025#define DEVTEMPLATE_DERIVED_FEATURES   DT_HAS_START
1940#define DEVTEMPLATE_DERIVED_FEATURES   0
20261941#define DEVTEMPLATE_DERIVED_NAME      "WD1773"
20271942#include "devtempl.h"
20281943
20291944#define DEVTEMPLATE_DERIVED_ID(p,s)      p##wd179x##s
2030#define DEVTEMPLATE_DERIVED_FEATURES   DT_HAS_START
1945#define DEVTEMPLATE_DERIVED_FEATURES   0
20311946#define DEVTEMPLATE_DERIVED_NAME      "WD179x"
20321947#include "devtempl.h"
20331948
20341949#define DEVTEMPLATE_DERIVED_ID(p,s)      p##wd1793##s
2035#define DEVTEMPLATE_DERIVED_FEATURES   DT_HAS_START
1950#define DEVTEMPLATE_DERIVED_FEATURES   0
20361951#define DEVTEMPLATE_DERIVED_NAME      "WD1793"
20371952#include "devtempl.h"
20381953
20391954#define DEVTEMPLATE_DERIVED_ID(p,s)      p##wd2793##s
2040#define DEVTEMPLATE_DERIVED_FEATURES   DT_HAS_START
1955#define DEVTEMPLATE_DERIVED_FEATURES   0
20411956#define DEVTEMPLATE_DERIVED_NAME      "WD2793"
20421957#include "devtempl.h"
20431958
20441959#define DEVTEMPLATE_DERIVED_ID(p,s)      p##wd177x##s
2045#define DEVTEMPLATE_DERIVED_FEATURES   DT_HAS_START
1960#define DEVTEMPLATE_DERIVED_FEATURES   0
20461961#define DEVTEMPLATE_DERIVED_NAME      "WD179x"
20471962#include "devtempl.h"
20481963
20491964#define DEVTEMPLATE_DERIVED_ID(p,s)      p##mb8877##s
2050#define DEVTEMPLATE_DERIVED_FEATURES   DT_HAS_START
1965#define DEVTEMPLATE_DERIVED_FEATURES   0
20511966#define DEVTEMPLATE_DERIVED_NAME      "MB8877"
20521967#include "devtempl.h"
src/mess/machine/wd17xx.h
r6718r6719
22
33    wd17xx.h
44
5    Implementations of the Western Digital 17xx and 19xx families of
5    Implementations of the Western Digital 17xx and 27xx families of
66    floppy disk controllers
77
88*********************************************************************/

Previous 15994 Revisions Next


© 1998-2018 The MESS Team