Previous 15994 Revisions Next

r7621 Monday 22nd March, 2010 at 16:50:50 UTC by Curt Coder
[WD17XX] Implemented immediate and index pulse interrupts.
[docs]messnew.txt
[src/mess/machine]wd17xx.c

src/mess/machine/wd17xx.c
r7620r7621
119119
120120      This should probably be considdered a minor hack but it does seem to work !
121121
122    2009-02-04 Phill Harvey-Smith
122    2010-02-04 Phill Harvey-Smith
123123    - Added multiple sector write as the RM Nimbus needs it.
124124
125   2010-March-22 Curt Coder:
126   - Implemented immediate and index pulse interrupts.
127
125128    TODO:
126129        - Multiple record write
127130        - What happens if a track is read that doesn't have any id's on it?
r7620r7621
140143    CONSTANTS
141144***************************************************************************/
142145
143#define VERBOSE         1   /* General logging */
146#define VERBOSE         0   /* General logging */
144147#define VERBOSE_DATA   0   /* Logging of each byte during read and write */
145148
146149#define DELAY_ERROR      3
r7620r7621
296299   UINT8 sector;
297300   UINT8 command;
298301   UINT8 status;
302   UINT8 interrupt;
299303
300304   int stepping_rate[4];  /* track stepping rate in ms */
301305
r7620r7621
822826
823827   w->idx = state;
824828
829   if (!state && w->idx && BIT(w->interrupt, 2))
830      wd17xx_set_intrq(controller);
831
825832   if (w->hld_count)
826833      w->hld_count--;
827834}
r7620r7621
12311238{
12321239   wd1770_state *w = get_safe_token(device);
12331240   w->idx = state;
1241
1242   if (!state && w->idx && BIT(w->interrupt, 2))
1243      wd17xx_set_intrq(device);
12341244}
12351245
12361246/* write protect status */
r7620r7621
12741284   wd1770_state *w = get_safe_token(device);
12751285   int result;
12761286
1277   wd17xx_clear_intrq(device);
1287   if (!BIT(w->interrupt, 3))
1288   {
1289      wd17xx_clear_intrq(device);
1290   }
12781291
12791292   /* bit 7, 'not ready' or 'motor on' */
12801293   if (device->type == WD1770 || device->type == WD1772)
r7620r7621
14381451
14391452   floppy_drive_set_ready_state(w->drive, 1,0);
14401453
1441   /* also cleared by writing command */
1442   wd17xx_clear_intrq(device);
1454   if (!BIT(w->interrupt, 3))
1455   {
1456      wd17xx_clear_intrq(device);
1457   }
14431458
14441459   /* clear write protected. On read sector, read track and read dam, write protected bit is clear */
14451460   w->status &= ~((1<<6) | (1<<5) | (1<<4));
r7620r7621
14561471
14571472      wd17xx_clear_drq(device);
14581473
1459      if (data & 0x0f)
1474      if (!BIT(w->interrupt, 3) && BIT(data, 3))
14601475      {
1476         /* set immediate interrupt */
1477         wd17xx_set_intrq(device);
1478      }
14611479
1462
1463
1480      if (BIT(w->interrupt, 3))
1481      {
1482         if (data == FDC_FORCE_INT)
1483         {
1484            /* clear immediate interrupt */
1485            w->interrupt = data & 0x0f;
1486         }
1487         else
1488         {
1489            /* keep immediate interrupt */
1490            w->interrupt = 0x08 | (data & 0x07);
1491         }
14641492      }
1493      else
1494      {
1495         w->interrupt = data & 0x0f;
1496      }
14651497
1498      /* terminate command */
1499      wd17xx_complete_command(device, DELAY_ERROR);
14661500
14671501//      w->status_ipl = STA_1_IPL;
14681502/*      w->status_ipl = 0; */
docs/messnew.txt
r7620r7621
7474 
7575- Added 1541 FLASH! BIOS to SX1541. [Guru, Curt Coder]
7676
77- Changes to the wd17xx implementation:
78  - Added support for immediate/index pulse interrupts. [Curt Coder]
79
7780- Implemented Commodore DOS errors 21, 22, and 23 in D64 images.
7881  "Microsoft Multiplan" now loads on C64. (bug #1932) [Curt Coder]
7982 

Previous 15994 Revisions Next


© 1998-2018 The MESS Team