31,syntax error,00,00 reading file on .d64 disk image [message #336172] |
Sat, 21 January 2017 18:36 |
Harry Potter
Messages: 1304 Registered: March 2012
Karma: 0
|
Senior Member |
|
|
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/templ ates1%20dir.png/download . 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? :(
|
|
|
|
Re: 31,syntax error,00,00 reading file on .d64 disk image [message #336190 is a reply to message #336172] |
Sun, 22 January 2017 17:17 |
Andreas Kohlbach
Messages: 1456 Registered: December 2011
Karma: 0
|
Senior Member |
|
|
On Sat, 21 Jan 2017 15:36:18 -0800 (PST), Harry Potter wrote:
>
> 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);
> }
> ------------------------
That looks like C source code to me, not an error message.
Anyway, I seem to recall that some copy protection mechanisms were using a
modified track 18 (different number of sectors than it's supposed to
have). May that causes it.
--
Andreas
You know you are a redneck if
you've ever climbed a water tower with a bucket of paint to defend your
sister's honor.
|
|
|
Re: 31,syntax error,00,00 reading file on .d64 disk image [message #336192 is a reply to message #336190] |
Sun, 22 January 2017 19:10 |
Harry Potter
Messages: 1304 Registered: March 2012
Karma: 0
|
Senior Member |
|
|
On Sunday, January 22, 2017 at 5:17:22 PM UTC-5, Andreas Kohlbach wrote:
> That looks like C source code to me, not an error message.
>
That *is* C code. It's the code that causes the error.
> Anyway, I seem to recall that some copy protection mechanisms were using a
> modified track 18 (different number of sectors than it's supposed to
> have). May that causes it.
That can't be because it's *my* code that causes the error, not somebody else's, and I don't know how to apply copy protection. :(
|
|
|
31,syntax error,00,00 reading file on .d64 disk image [message #336203 is a reply to message #336190] |
Sun, 22 January 2017 03:19 |
|
Originally posted by: nospam.mark.lewis
On 2017 Jan 22 17:17:20, you wrote to Harry Potter:
>> 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:
[trim]
AK> That looks like C source code to me, not an error message.
well, it does say "erroneous code" and not "message" ;)
)\/(ark
Always Mount a Scratch Monkey
Do you manage your own servers? If you are not running an IDS/IPS yer doin' it
wrong...
.... Rated R: Not appropriate for minors or adults with a stick up their ass.
|
|
|
31,syntax error,00,00 reading file on .d64 disk image [message #336240 is a reply to message #336172] |
Mon, 23 January 2017 03:36 |
|
Originally posted by: nospam.mark.lewis
On 2017 Jan 23 16:08:22, you wrote to me:
>> >> 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:
>>
>> [trim]
>>
>> AK> That looks like C source code to me, not an error message.
>>
>> well, it does say "erroneous code" and not "message" ;)
AK> You're right. I think I only read until "the error message", which I
AK> didn't see (is in the subject, which I ignored), and my eyes then jumped
AK> down to "it", which was the C code instead. Sorry.
no need to apologize, friend... it happens to us all at one time or another ;)
)\/(ark
Always Mount a Scratch Monkey
Do you manage your own servers? If you are not running an IDS/IPS yer doin' it
wrong...
.... Of people born in 1839, 100% of carrot eaters are dead.
|
|
|
|
Re: 31,syntax error,00,00 reading file on .d64 disk image [message #337169 is a reply to message #336570] |
Sat, 11 February 2017 12:28 |
Harry Potter
Messages: 1304 Registered: March 2012
Karma: 0
|
Senior Member |
|
|
On Tuesday, January 31, 2017 at 6:52:47 PM UTC-5, Harry Potter wrote:
> Somebody e-mailed me to not use special characters in filenames in my programs. It didn't work. :( What else could be causing the error message?
>
> BTW, when I access the file, WinVice x64's window indicates that the drive switches to Track 18 then 17 before the error message.
When I autoboot the problem disk image, one test file worked fine, and the other was untested. What could cause the problem?
|
|
|
Re: 31,syntax error,00,00 reading file on .d64 disk image [message #338237 is a reply to message #337169] |
Thu, 23 February 2017 18:42 |
Harry Potter
Messages: 1304 Registered: March 2012
Karma: 0
|
Senior Member |
|
|
On Saturday, February 11, 2017 at 12:28:19 PM UTC-5, Harry Potter wrote:
> When I autoboot the problem disk image, one test file worked fine, and the other was untested. What could cause the problem?
I found the bug! :) It was in the error-channel-reading code, *not* the file-reading code. Thank you, everyone, for your help.
|
|
|