Not quite understanding this code

From: vtgearhead <snhirsch_at_gmail.com>
Date: Mon, 2 Nov 2020 13:55:26 -0600 (CST)
Message-ID: <1604346926884-0.post_at_n4.nabble.com>
The CBM Commander program has a mode to copy a D64 image back to floppy. 
There are two outer loops that iterate over track and sector (with lookup
table to account for differing sector counts) and this logic inside (i =
track, j = sector):

cbm_read(2,fileBuffer,256);

cbm_write(DST_CMDSTAT,"b-p 3 0", 7); // ????
cbm_write(3,fileBuffer,256);
cbm_write(DST_CMDSTAT,buffer, sprintf(buffer, "u2 3 0 %u %u", i+1, j));

File #2 is open on the source, #3 on target disk ('#') and DST_CMDSTAT is
channel 15 on the target drive.  It all makes perfect sense except for the
'b-p' command.  I cannot understand why that offset is required when writing
data into the target buffer.  This may be basic platform knowledge, but I
cannot find any discussion of it.  I'm looking hard at this code because the
target diskette ends up with a small chunk of data that's mismatched with
the source file.



--
Sent from: http://cbm-hackers.2304266.n4.nabble.com/
Received on 2020-11-02 21:00:04

Archive generated by hypermail 2.3.0.