11 #include "d64copy_int.h"
16 static unsigned char drive = 0;
19 static int read_block(
unsigned char tr,
unsigned char se,
unsigned char *block)
24 sprintf(cmd,
"U1:2 0 %d %d", tr, se);
29 if(
cbm_talk(fd_cbm, drive, 2) == 0) {
30 SETSTATEDEBUG(DebugByteCount=0);
31 rv =
cbm_raw_read(fd_cbm, block, BLOCKSIZE) != BLOCKSIZE;
32 SETSTATEDEBUG(DebugByteCount=-1);
41 static int write_block(
unsigned char tr,
unsigned char se,
const unsigned char *blk,
int size,
int read_status)
50 SETSTATEDEBUG(DebugByteCount=0);
52 SETSTATEDEBUG(DebugByteCount=-1);
56 sprintf(cmd ,
"U2:2 0 %d %d", tr, se);
66 const void *arg,
int for_writing,
67 turbo_start start, d64copy_message_cb message_cb)
72 if(settings->end_track > STD_TRACKS && !settings->two_sided)
75 "standard transfer doesn't handle extended track images");
79 drive = (
unsigned char)(ULONG_PTR)arg;
88 message_cb(0,
"drive %02d: %s", drive, buf);
93 static void close_disk(
void)
98 DECLARE_TRANSFER_FUNCS(std_transfer, 1, 0);
int CBMAPIDECL cbm_talk(CBM_FILE HandleDevice, unsigned char DeviceAddress, unsigned char SecondaryAddress)
Send a TALK on the IEC serial bus.
int CBMAPIDECL cbm_listen(CBM_FILE HandleDevice, unsigned char DeviceAddress, unsigned char SecondaryAddress)
Send a LISTEN on the IEC serial bus.
int CBMAPIDECL cbm_device_status(CBM_FILE HandleDevice, unsigned char DeviceAddress, void *Buffer, size_t BufferLength)
Read the drive status from a floppy.
int CBMAPIDECL cbm_close(CBM_FILE HandleDevice, unsigned char DeviceAddress, unsigned char SecondaryAddress)
Close a file on the IEC serial bus.
int CBMAPIDECL cbm_raw_write(CBM_FILE HandleDevice, const void *Buffer, size_t Count)
Write data to the IEC serial bus.
int CBMAPIDECL cbm_unlisten(CBM_FILE HandleDevice)
Send an UNLISTEN on the IEC serial bus.
int CBMAPIDECL cbm_open(CBM_FILE HandleDevice, unsigned char DeviceAddress, unsigned char SecondaryAddress, const void *Filename, size_t FilenameLength)
Open a file on the IEC serial bus.
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.
DLL interface for accessing the driver.
int CBMAPIDECL cbm_untalk(CBM_FILE HandleDevice)
Send an UNTALK on the IEC serial bus.