[cc65] Why does this work in 128 mode but not 64 mode?

From: Payton Byrd <plbyrd1gmail.com>
Date: 2010-04-29 19:15:11
I've got some simple drive code that works fine in 128 mode, but does not
work correctly in 64 mode.  What happens is that when in 64 mode, the first
time it enounters a drive number without a device it locks up.  In 128 mode
it gracefully encounters an error and moves on to the next drive number.

int getDriveStatus(
unsigned char* buffer,
unsigned char drive)
{
int result;
int size;

result = cbm_open(15, drive, 15, "");

if(result == 0)
{
cbm_write(15, "uj", 2);
 size = cbm_read(15, buffer, 39);
cbm_close(15);
buffer[size] = '\0';

return size;
}

return result;
}

-- 
Payton Byrd
<http://www.paytonbyrd.com>
<http://it.toolbox.com/blogs/paytonbyrd>

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Apr 29 19:15:39 2010

This archive was generated by hypermail 2.1.8 : 2010-04-29 19:15:42 CEST