[Coco] Programming help needed
Dave Philipsen
dave at davebiz.com
Sun Dec 2 00:25:15 EST 2018
I’m certainly not a big fan of DECB disk programming due to its limitations nor am I an expert on it. But, my first guess would be that instead of using a string you should write the data to the disk file using numeric expressions instead of string expressions.
I *think* WRITE #1, A will write the 8-bit value of A to the file. It seems like that would be a way to get around the limitations of using a string to represent raw binary data.
Dave
> On Dec 1, 2018, at 6:59 PM, Paul Shoemaker <paulfe3 at swbell.net> wrote:
>
> Need some advice. I am trying to store to a disk file a 48x40 section from a PMODE 4 screen.
> The method I am attempting to use is to peek the byte values using a nested loop and save them as a string. For example, A$ = A$ + CHR$ (PEEK(&HE00+X+(Y*32))). Note I am storing the byte value as a CHR$ because doing so makes the completed string length only 240 bytes long. Creating the string is working fine; I have validated that.
> Saving the string to a disk file is not working, however. When I execute a WRITE #1,A$ followed by a PUT #1,<record #>, Disk BASIC is not saving entire contents of A$. I believe it is parsing the string as it goes or something, as it seems to be ignoring or even stopping on some "special" CHR$ codes.. like CHR$(0).
> Is there a way around this?
> Thanks!
> -Paul
>
>
More information about the Coco
mailing list