[cc65] Another fix/workaround for cbm_dir.c

From: Thomas Giesel <skoe1directbox.com>
Date: 2009-10-02 22:10:21
Hi all,

some people tested my program which was compiled with the updated
version of cbm_dir.c.

There's an issue with the 1541U in SD-mode. This drive sends a
different start address than CBM drives.

cbm_opendir checks if the start address of a directory has the "right"
value and refuses to continue otherwise. Is this check really useful?
When the check is removed as shown below, it works. IMHO this change
makes the code more compatible and smaller without any risk. 

What do you think?

unsigned char __fastcall__ cbm_opendir (unsigned char lfn, unsigned
char device) {
    unsigned char status;
    if ((status = cbm_open (lfn, device, CBM_READ, "$")) == 0) {
        if (cbm_k_chkin (lfn) == 0) {
            /* Ignore start address */
            cbm_k_basin();
            cbm_k_basin();
            if (cbm_k_readst()) {
                cbm_close(lfn);
                cbm_k_clrch();
                return 2;
            }

            cbm_k_clrch();
            return 0;
        }
    }
    return status;
}

Regards,

Thomas

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Oct 2 22:10:30 2009

This archive was generated by hypermail 2.1.8 : 2009-10-02 22:10:31 CEST