From 85f06f09b9fb7cf1486063b284925a8cada1bbea Mon Sep 17 00:00:00 2001 From: Rich Stephens Date: Mon, 8 Dec 2025 16:03:29 -0500 Subject: [PATCH] Implement fuji_copy_file for coco --- coco/src/fn_fuji/fuji_copy_file.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/coco/src/fn_fuji/fuji_copy_file.c b/coco/src/fn_fuji/fuji_copy_file.c index 322cad4..06d5031 100644 --- a/coco/src/fn_fuji/fuji_copy_file.c +++ b/coco/src/fn_fuji/fuji_copy_file.c @@ -6,6 +6,24 @@ bool fuji_copy_file(uint8_t src_slot, uint8_t dst_slot, char *copy_spec) { - // TODO: Implement in firmware. - return BUS_ERROR; + struct _cf + { + uint8_t opcode; + uint8_t cmd; + uint8_t src_slot; + uint8_t dst_slot; + char copy_spec[256]; + } cf; + + cf.opcode = OP_FUJI; + cf.cmd = FUJICMD_COPY_FILE; + cf.src_slot = src_slot; + cf.dst_slot = dst_slot; + strcpy(cf.copy_spec, copy_spec); + + bus_ready(); + + dwwrite((uint8_t *)&cf, sizeof(cf)); + + return !fuji_get_error(); }