Re: Not quite understanding this code

From: smf <smf_at_null.net>
Date: Mon, 2 Nov 2020 21:07:15 +0000
Message-ID: <fdc5c6c6-ce2a-d52e-88a7-baf43146bbed_at_null.net>
What offset? The index?

BUFFER-POINTER    B-P channel index    Set r/w pointer within buffer

It's 0, so the start of the buffer. I think you can just set the index
anywhere and write a single byte if you want.

The 7 at the end is the length of the command

On 02/11/2020 19:55, vtgearhead wrote:
> 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.
>
Received on 2020-11-02 23:00:03

Archive generated by hypermail 2.3.0.