Added comments to cbm.h.

load/save returns oserror code.
Added open/close and read (which is not tested yet).


git-svn-id: svn://svn.cc65.org/cc65/trunk@637 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
mrintsch
2001-03-20 21:06:04 +00:00
parent 83f8ce6f39
commit fb76e97575
16 changed files with 157 additions and 70 deletions

24
libsrc/cbm/cbm_read.c Normal file
View File

@@ -0,0 +1,24 @@
#include <cbm.h>
extern unsigned char _oserror;
int cbm_read(unsigned char lfn, void* buffer, unsigned int size)
{
static unsigned int bytesread;
static unsigned char tmp;
if (_oserror = cbm_k_chkin(lfn)) return -1;
bytesread = 0;
while (bytesread<size) {
tmp = cbm_k_basin();
if (cbm_k_readst()) break;
((unsigned char*)buffer)[bytesread++] = tmp;
}
cbm_k_clrch();
return bytesread;
}