SIO Command $D8 Copy File - FujiNetWIFI/fujinet-firmware GitHub Wiki

This is a command for Device $70 - The FujiNet Device itself (see SIO-Commands-for-Device-ID-$70).

Copy File ($D8)

Description

Causes the FujiNet to copy a file from the source host slot to the destination host slot, given the filenames specified in the copyspec, which consists of two paths separated by a vertical bar |. Because this command can take a while, maximum timeout of $FE is highly insisted.

Parameters

DCB Value
DDEVIC $70
DUNIT $01
DCOMND $D8
DSTATS $80
DBUF NULL
DTIMLO $FE
DBYT 256
DAUX1 source host slot (NOTE: $01 through $08)
DAUX2 destination host slot (NOTE: $01 through $08)

Examples

CC65


const char copySpec[]="/folder1/foo.atr|/games/foo.atr";

/**
 * Ask fujinet to copy file from source slot to dest slot
 */
void fuji_sio_copy(unsigned char source_slot, unsigned char dest_slot, const char *copySpec)
{
  OS.dcb.ddevic=0x70;
  OS.dcb.dunit=1;
  OS.dcb.dcomnd=0xD8;
  OS.dcb.dstats=0x80;
  OS.dcb.dbuf=copySpec;
  OS.dcb.dtimlo=0xFE; // Max timeout
  OS.dcb.dbyt=256;
  OS.dcb.daux1=source_slot;
  OS.dcb.daux2=dest_slot;
  siov();
}