diff --git a/src/apple2.dd.c b/src/apple2.dd.c index baa129f..c71745f 100644 --- a/src/apple2.dd.c +++ b/src/apple2.dd.c @@ -92,6 +92,11 @@ apple2_dd_insert(apple2dd *drive, FILE *stream, int type) return OK; } +/* + * Encode the drive image segment into the drive data segment using + * 6-and-2 encoding, if necessary. (It is not necessary if the + * image_type is DD_NIBBLE.) + */ void apple2_dd_encode(apple2dd *drive) { @@ -111,6 +116,10 @@ apple2_dd_encode(apple2dd *drive) } } +/* + * Save the contents of the drive back to the file system (given as the + * stream field in the drive struct). + */ void apple2_dd_save(apple2dd *drive) { @@ -124,6 +133,11 @@ apple2_dd_save(apple2dd *drive) } } +/* + * Decode the drive data segment into the drive image segment, reversing + * the 6-and-2 encoding (if need be -- see note on DD_NIBBLE for the + * encode function). + */ void apple2_dd_decode(apple2dd *drive) { diff --git a/src/vm_segment.c b/src/vm_segment.c index 19557de..01bd0cc 100644 --- a/src/vm_segment.c +++ b/src/vm_segment.c @@ -286,6 +286,11 @@ vm_segment_fread(vm_segment *segment, FILE *stream, size_t offset, size_t len) return OK; } +/* + * Write the contents of a segment into a given file stream, using an + * offset and a length for the contents to write. If this operation + * works out, we return OK. + */ int vm_segment_fwrite(vm_segment *seg, FILE *stream, size_t off, size_t len) {