Re: [cc65] C64 drive direct access question

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2005-10-11 09:29:25
Good morning!

On Mon, Oct 10, 2005 at 03:03:59PM -0400, Raj Wurttemberg wrote:
> How to I do the chr$(x) with cbm_write? Is this correct?
>
> cbm_write(15, "m-w\x06\x00\x02\x18\x00", 8);

I haven't tested it, but it looks ok. Two things:

  * Using a string literal will append an additional (and invisible) zero byte
    to the string. I would suggest using


        const char cmWr[] = { 'm', '-', 'w', 6, 0, 2, 0x18, 0 };
        ...
        cbm_write (15, cmWr, sizeof (cmWr));

    which for one doesn't append the zero terminator, and second it will
    allow you to use sizeof() to determine the length.

  * Character translation may be a problem. Does the floppy need "m-w" or
    "M-W"? Above string is translated to $4D,$2D,$57,...

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Oct 11 09:29:32 2005

This archive was generated by hypermail 2.1.8 : 2005-10-11 09:29:35 CEST