Hi! I am working on a special program for the C64 using cc65 and the WinVice
3.0 x64 emulator, and, sometimes, when I try to read some files, I get the
error message above from the drive. When the program reads the file, the
emulated drive head moves
to track 18, then 17, and then, the error is given. What could be causing the
error? The erroneous code is as follows:
---------------------------
extern char* filetypes[];
static char qfilename[]="0:%s,%c,%c";
static char fi[32];
static unsigned char __fastcall__ openfile (char* s, unsigned char mode,
unsigned char ftype)
{
sprintf (fi, qfilename, s, (char)filetypes[ftype][0], mode==CBM_READ?'r':'w');
gotoxy (0, 0); cputs (fi); putchar ('-'); cgetc();
return cbm_open (filenum, 8, 4, fi);
}
------------------------
I uploaded a screen shot of the directory read-out to
https://sourceforge.net/projects/harryp-cbm/files/test/templates1%20dir.png/dow
nload . Now, the main part of this module calls the openfile() function
passing through s the string "GUESS #," through
mode the CBM_READ constant, and through ftype the entry # in filetypes[]
containing "prg." In other words, the sprintf() function call produces the
string "0:GUESS #,p,r." What could be causing the problem? :(
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|