Previous 15994 Revisions Next

r13354 Wednesday 23rd November, 2011 at 10:49:04 UTC by Curt Coder
[UPD765] Fixed sector increment during read/write. [Curt Coder]
[src/mess/machine]upd765.c

src/mess/machine/upd765.c
r13353r13354
7878#define UPD765_FDD_READY 0x040
7979
8080#define UPD765_MF   0x40
81#define UPD765_MT   0x80
8182
8283#define UPD765_RESET 0x080
8384
r13353r13354
12341235
12351236
12361237   /* multi-track? */
1237   if (fdc->upd765_command_bytes[0] & 0x080)
1238   if (fdc->upd765_command_bytes[0] & UPD765_MT)
12381239   {
12391240      /* it appears that in multi-track mode,
12401241        the EOT parameter of the command is ignored!? -
r13353r13354
13631364static void   upd765_increment_sector(device_t *device)
13641365{
13651366   upd765_t *fdc = get_safe_token(device);
1367
13661368   /* multi-track? */
1367   if (fdc->upd765_command_bytes[0] & 0x080)
1369   if (fdc->upd765_command_bytes[0] & UPD765_MT)
13681370   {
13691371      /* reached EOT? */
1370      /* if (fdc->upd765_command_bytes[4]==fdc->upd765_command_bytes[6])*/
1371      if (upd765_just_read_last_sector_on_track(device))
1372      if (fdc->upd765_command_bytes[4] == fdc->upd765_command_bytes[6])
13721373      {
1373         /* reset sector id to 1 */
1374         fdc->upd765_command_bytes[4] = 1;
1375
1376         /* yes */
1377         if(fdc->side == 1) {
1378            fdc->upd765_command_bytes[3] = 0;
1374         if (fdc->side == 1)
1375         {
13791376            fdc->upd765_command_bytes[2]++;
1380            return;
13811377         }
1382
1383         /* reached EOT */
1384         /* change side to 1 */
1385         fdc->side = 1;
1386         /* set head to 1 for get next sector test */
1387         fdc->upd765_command_bytes[3] = 1;
1378         
1379         fdc->upd765_command_bytes[3] ^= 0x01;
1380         fdc->upd765_command_bytes[4] = 1;
1381         fdc->side = fdc->upd765_command_bytes[3] & 0x01;
13881382      }
13891383      else
13901384      {
1391         /* increment */
13921385         fdc->upd765_command_bytes[4]++;
13931386      }
1394
13951387   }
13961388   else
13971389   {
1398      if (upd765_just_read_last_sector_on_track(device))
1390      if (fdc->upd765_command_bytes[4] == fdc->upd765_command_bytes[6])
13991391      {
1400         fdc->upd765_command_bytes[4] = 1;
14011392         fdc->upd765_command_bytes[2]++;
1402         return;
1393         fdc->upd765_command_bytes[4] = 1;
14031394      }
1404
1405      fdc->upd765_command_bytes[4]++;
1395      else
1396      {
1397         fdc->upd765_command_bytes[4]++;
1398      }
14061399   }
14071400}
14081401

Previous 15994 Revisions Next


© 1998-2018 The MESS Team