Previous 199869 Revisions Next

r17900 Saturday 15th September, 2012 at 12:25:18 UTC by Phil Bennett
idetrl.c - Support IDE command 0x31 (IDE_COMMAND_WRITE_MULTIPLE_NORETRY) [Phil Bennett]
[src/emu/machine]idectrl.c

trunk/src/emu/machine/idectrl.c
r17899r17900
2626    CONSTANTS
2727***************************************************************************/
2828
29#define MINIMUM_COMMAND_TIME         (attotime::from_usec(10))
29#define MINIMUM_COMMAND_TIME            (attotime::from_usec(10))
3030
31#define TIME_PER_SECTOR               (attotime::from_usec(100))
32#define TIME_PER_ROTATION            (attotime::from_hz(5400/60))
33#define TIME_SECURITY_ERROR            (attotime::from_msec(1000))
31#define TIME_PER_SECTOR                  (attotime::from_usec(100))
32#define TIME_PER_ROTATION               (attotime::from_hz(5400/60))
33#define TIME_SECURITY_ERROR               (attotime::from_msec(1000))
3434
35#define TIME_SEEK_MULTISECTOR         (attotime::from_msec(13))
36#define TIME_NO_SEEK_MULTISECTOR      (attotime::from_nsec(16300))
35#define TIME_SEEK_MULTISECTOR            (attotime::from_msec(13))
36#define TIME_NO_SEEK_MULTISECTOR         (attotime::from_nsec(16300))
3737
38#define IDE_STATUS_ERROR            0x01
39#define IDE_STATUS_HIT_INDEX         0x02
40#define IDE_STATUS_BUFFER_READY         0x08
41#define IDE_STATUS_SEEK_COMPLETE      0x10
42#define IDE_STATUS_DRIVE_READY         0x40
43#define IDE_STATUS_BUSY               0x80
38#define IDE_STATUS_ERROR               0x01
39#define IDE_STATUS_HIT_INDEX            0x02
40#define IDE_STATUS_BUFFER_READY            0x08
41#define IDE_STATUS_SEEK_COMPLETE         0x10
42#define IDE_STATUS_DRIVE_READY            0x40
43#define IDE_STATUS_BUSY                  0x80
4444
45#define IDE_CONFIG_REGISTERS         0x10
45#define IDE_CONFIG_REGISTERS            0x10
4646
4747#define BANK(b, v) (((v) << 4) | (b))
4848
49#define IDE_BANK0_DATA               BANK(0, 0)
50#define IDE_BANK0_ERROR               BANK(0, 1)
51#define IDE_BANK0_SECTOR_COUNT         BANK(0, 2)
52#define IDE_BANK0_SECTOR_NUMBER         BANK(0, 3)
53#define IDE_BANK0_CYLINDER_LSB         BANK(0, 4)
54#define IDE_BANK0_CYLINDER_MSB         BANK(0, 5)
55#define IDE_BANK0_HEAD_NUMBER         BANK(0, 6)
56#define IDE_BANK0_STATUS_COMMAND      BANK(0, 7)
49#define IDE_BANK0_DATA                  BANK(0, 0)
50#define IDE_BANK0_ERROR                  BANK(0, 1)
51#define IDE_BANK0_SECTOR_COUNT            BANK(0, 2)
52#define IDE_BANK0_SECTOR_NUMBER            BANK(0, 3)
53#define IDE_BANK0_CYLINDER_LSB            BANK(0, 4)
54#define IDE_BANK0_CYLINDER_MSB            BANK(0, 5)
55#define IDE_BANK0_HEAD_NUMBER            BANK(0, 6)
56#define IDE_BANK0_STATUS_COMMAND         BANK(0, 7)
5757
58#define IDE_BANK1_STATUS_CONTROL      BANK(1, 6)
58#define IDE_BANK1_STATUS_CONTROL         BANK(1, 6)
5959
60#define IDE_BANK2_CONFIG_UNK         BANK(2, 4)
61#define IDE_BANK2_CONFIG_REGISTER      BANK(2, 8)
62#define IDE_BANK2_CONFIG_DATA         BANK(2, 0xc)
60#define IDE_BANK2_CONFIG_UNK            BANK(2, 4)
61#define IDE_BANK2_CONFIG_REGISTER         BANK(2, 8)
62#define IDE_BANK2_CONFIG_DATA            BANK(2, 0xc)
6363
64#define IDE_COMMAND_READ_MULTIPLE      0x20
65#define IDE_COMMAND_READ_MULTIPLE_ONCE   0x21
66#define IDE_COMMAND_WRITE_MULTIPLE      0x30
67#define IDE_COMMAND_DIAGNOSTIC         0x90
68#define IDE_COMMAND_SET_CONFIG         0x91
69#define IDE_COMMAND_READ_MULTIPLE_BLOCK   0xc4
70#define IDE_COMMAND_WRITE_MULTIPLE_BLOCK 0xc5
71#define IDE_COMMAND_SET_BLOCK_COUNT      0xc6
72#define IDE_COMMAND_READ_DMA         0xc8
73#define IDE_COMMAND_WRITE_DMA         0xca
74#define IDE_COMMAND_GET_INFO         0xec
75#define IDE_COMMAND_SET_FEATURES      0xef
76#define IDE_COMMAND_SECURITY_UNLOCK      0xf2
77#define IDE_COMMAND_UNKNOWN_F9         0xf9
78#define IDE_COMMAND_VERIFY_MULTIPLE      0x40
79#define IDE_COMMAND_VERIFY_NORETRY      0x41
80#define IDE_COMMAND_ATAPI_IDENTIFY      0xa1
81#define IDE_COMMAND_RECALIBRATE         0x10
82#define IDE_COMMAND_SEEK            0x70
83#define IDE_COMMAND_IDLE_IMMEDIATE      0xe1
84#define IDE_COMMAND_IDLE            0xe3
85#define IDE_COMMAND_TAITO_GNET_UNLOCK_1 0xfe
86#define IDE_COMMAND_TAITO_GNET_UNLOCK_2 0xfc
87#define IDE_COMMAND_TAITO_GNET_UNLOCK_3 0x0f
64#define IDE_COMMAND_READ_MULTIPLE         0x20
65#define IDE_COMMAND_READ_MULTIPLE_NORETRY   0x21
66#define IDE_COMMAND_WRITE_MULTIPLE         0x30
67#define IDE_COMMAND_WRITE_MULTIPLE_NORETRY   0x31
68#define IDE_COMMAND_DIAGNOSTIC            0x90
69#define IDE_COMMAND_SET_CONFIG            0x91
70#define IDE_COMMAND_READ_MULTIPLE_BLOCK      0xc4
71#define IDE_COMMAND_WRITE_MULTIPLE_BLOCK   0xc5
72#define IDE_COMMAND_SET_BLOCK_COUNT         0xc6
73#define IDE_COMMAND_READ_DMA            0xc8
74#define IDE_COMMAND_WRITE_DMA            0xca
75#define IDE_COMMAND_GET_INFO            0xec
76#define IDE_COMMAND_SET_FEATURES         0xef
77#define IDE_COMMAND_SECURITY_UNLOCK         0xf2
78#define IDE_COMMAND_UNKNOWN_F9            0xf9
79#define IDE_COMMAND_VERIFY_MULTIPLE         0x40
80#define IDE_COMMAND_VERIFY_NORETRY         0x41
81#define IDE_COMMAND_ATAPI_IDENTIFY         0xa1
82#define IDE_COMMAND_RECALIBRATE            0x10
83#define IDE_COMMAND_SEEK               0x70
84#define IDE_COMMAND_IDLE_IMMEDIATE         0xe1
85#define IDE_COMMAND_IDLE               0xe3
86#define IDE_COMMAND_TAITO_GNET_UNLOCK_1      0xfe
87#define IDE_COMMAND_TAITO_GNET_UNLOCK_2      0xfc
88#define IDE_COMMAND_TAITO_GNET_UNLOCK_3      0x0f
8889
89#define IDE_ERROR_NONE               0x00
90#define IDE_ERROR_DEFAULT            0x01
91#define IDE_ERROR_TRACK0_NOT_FOUND      0x02
92#define IDE_ERROR_UNKNOWN_COMMAND      0x04
93#define IDE_ERROR_BAD_LOCATION         0x10
94#define IDE_ERROR_BAD_SECTOR         0x80
90#define IDE_ERROR_NONE                  0x00
91#define IDE_ERROR_DEFAULT               0x01
92#define IDE_ERROR_TRACK0_NOT_FOUND         0x02
93#define IDE_ERROR_UNKNOWN_COMMAND         0x04
94#define IDE_ERROR_BAD_LOCATION            0x10
95#define IDE_ERROR_BAD_SECTOR            0x80
9596
96#define IDE_BUSMASTER_STATUS_ACTIVE      0x01
97#define IDE_BUSMASTER_STATUS_ERROR      0x02
98#define IDE_BUSMASTER_STATUS_IRQ      0x04
97#define IDE_BUSMASTER_STATUS_ACTIVE         0x01
98#define IDE_BUSMASTER_STATUS_ERROR         0x02
99#define IDE_BUSMASTER_STATUS_IRQ         0x04
99100
100101
101102
r17899r17900
10031004   switch (command)
10041005   {
10051006      case IDE_COMMAND_READ_MULTIPLE:
1006      case IDE_COMMAND_READ_MULTIPLE_ONCE:
1007      case IDE_COMMAND_READ_MULTIPLE_NORETRY:
10071008         LOGPRINT(("IDE Read multiple: C=%d H=%d S=%d LBA=%d count=%d\n",
10081009            ide->drive[ide->cur_drive].cur_cylinder, ide->drive[ide->cur_drive].cur_head, ide->drive[ide->cur_drive].cur_sector, lba_address(ide), ide->sector_count));
10091010
r17899r17900
10621063         break;
10631064
10641065      case IDE_COMMAND_WRITE_MULTIPLE:
1066      case IDE_COMMAND_WRITE_MULTIPLE_NORETRY:
10651067         LOGPRINT(("IDE Write multiple: C=%d H=%d S=%d LBA=%d count=%d\n",
10661068            ide->drive[ide->cur_drive].cur_cylinder, ide->drive[ide->cur_drive].cur_head, ide->drive[ide->cur_drive].cur_sector, lba_address(ide), ide->sector_count));
10671069

Previous 199869 Revisions Next


© 1997-2024 The MAME Team