26 #define DBG_PROGNAME "OPENCBM.DLL"
68 const char **CbmDeviceString)
73 char command[] = {
'M',
'-',
'R', (char) 0x40, (
char) 0xff, (char) 0x02 };
74 static char unknownDevice[] =
"*unknown*, footprint=<....>";
75 char *deviceString = unknownDevice;
81 if (
cbm_exec_command(HandleDevice, DeviceAddress, command,
sizeof(command)) == 0
82 &&
cbm_talk(HandleDevice, DeviceAddress, 15) == 0)
86 magic = buf[0] | (buf[1] << 8);
91 command[3] = (char) 0xFE;
92 if (
cbm_exec_command(HandleDevice, DeviceAddress, command,
sizeof(command)) == 0
93 &&
cbm_talk(HandleDevice, DeviceAddress, 15) == 0)
96 && ( buf[0] != 0x67 || buf[1] != 0xFE ) )
98 magic = buf[0] | (buf[1] << 8);
106 unknownDevice[22] = ((magic >> 12 & 0x0F) | 0x40);
107 unknownDevice[24] = ((magic >> 4 & 0x0F) | 0x40);
110 unknownDevice[23] = magic >> 8;
111 unknownDevice[25] = (char)magic;
116 deviceString =
"1540 or 1541";
121 deviceString =
"1541-II";
126 deviceString =
"1541C";
131 deviceString =
"DolphinDOS 1541";
136 deviceString =
"SpeedDOS 1541";
141 deviceString =
"ProfessionalDOS 1541";
146 deviceString =
"JiffyDOS 1541";
151 deviceString =
"64'er DOS 1541";
156 deviceString =
"1570";
161 deviceString =
"1571";
166 deviceString =
"1581";
171 deviceString =
"3040";
177 deviceString =
"4040";
182 deviceString =
"8050 dos2.5";
188 deviceString =
"8250 dos2.7";
198 *CbmDeviceType = deviceType;
203 *CbmDeviceString = deviceString;
int CBMAPIDECL cbm_talk(CBM_FILE HandleDevice, unsigned char DeviceAddress, unsigned char SecondaryAddress)
Send a TALK on the IEC serial bus.
#define FUNC_LEAVE_INT(_xxx)
Define makros for debugging purposes.
int CBMAPIDECL cbm_raw_read(CBM_FILE HandleDevice, void *Buffer, size_t Count)
Read data from the IEC serial bus.
int CBMAPIDECL cbm_exec_command(CBM_FILE HandleDevice, unsigned char DeviceAddress, const void *Command, size_t Size)
Executes a command in the floppy drive.
int CBMAPIDECL cbm_identify(CBM_FILE HandleDevice, unsigned char DeviceAddress, enum cbm_device_type_e *CbmDeviceType, const char **CbmDeviceString)
Identify the connected floppy drive.
DLL interface for accessing the driver.
int CBMAPIDECL cbm_untalk(CBM_FILE HandleDevice)
Send an UNTALK on the IEC serial bus.