First Commit of my working state
[simh.git] / AltairZ80 / wd179x.h
1 /*************************************************************************
2 * *
3 * $Id: wd179x.h 1907 2008-05-21 07:04:17Z hharte $ *
4 * *
5 * Copyright (c) 2007-2008 Howard M. Harte. *
6 * http://www.hartetec.com *
7 * *
8 * Permission is hereby granted, free of charge, to any person obtaining *
9 * a copy of this software and associated documentation files (the *
10 * "Software"), to deal in the Software without restriction, including *
11 * without limitation the rights to use, copy, modify, merge, publish, *
12 * distribute, sublicense, and/or sell copies of the Software, and to *
13 * permit persons to whom the Software is furnished to do so, subject to *
14 * the following conditions: *
15 * *
16 * The above copyright notice and this permission notice shall be *
17 * included in all copies or substantial portions of the Software. *
18 * *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
22 * NONINFRINGEMENT. IN NO EVENT SHALL HOWARD M. HARTE BE LIABLE FOR ANY *
23 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, *
24 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE *
25 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
26 * *
27 * Except as contained in this notice, the name of Howard M. Harte shall *
28 * not be used in advertising or otherwise to promote the sale, use or *
29 * other dealings in this Software without prior written authorization *
30 * Howard M. Harte. *
31 * *
32 * SIMH Interface based on altairz80_hdsk.c, by Peter Schorn. *
33 * *
34 * Module Description: *
35 * Generic Intel 8272 Disk Controller module for SIMH. *
36 * *
37 * Environment: *
38 * User mode only *
39 * *
40 *************************************************************************/
41
42 extern t_stat wd179x_attach(UNIT *uptr, char *cptr);
43 extern t_stat wd179x_detach(UNIT *uptr);
44 extern uint8 WD179X_Set_DMA(const uint32 dma_addr);
45 extern uint8 WD179X_Read(const uint32 Addr);
46 extern uint8 WD179X_Write(const uint32 Addr, uint8 cData);
47
48 extern void wd179x_external_restore(void);
49
50 #define WD179X_FDC_MSR 0 /* R=FDC Main Status Register, W=Drive Select Register */
51 #define WD179X_FDC_DATA 1 /* R/W FDC Data Register */
52
53 #define WD179X_STATUS 0
54 #define WD179X_TRACK 1
55 #define WD179X_SECTOR 2
56 #define WD179X_DATA 3
57
58 typedef struct {
59 PNP_INFO pnp; /* Plug-n-Play Information */
60 uint8 intrq; /* WD179X Interrupt Request Output (EOJ) */
61 uint8 hld; /* WD179X Head Load Output */
62 uint8 drq; /* WD179X DMA Request Output */
63 uint8 ddens; /* WD179X Double-Density Input */
64 uint8 fdc_head; /* H Head Number */
65 uint8 sel_drive; /* Currently selected drive */
66 uint8 drivetype; /* 8 or 5 depending on disk type. */
67 } WD179X_INFO_PUB;