Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Digital Archaeology » Computer Arcana » Commodore » Commodore 8-bit » 31,syntax error,00,00 reading file on .d64 disk image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
31,syntax error,00,00 reading file on .d64 disk image [message #336172] Sat, 21 January 2017 18:36 Go to next message
Harry Potter is currently offline  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 #336173 is a reply to message #336172] Sat, 21 January 2017 18:40 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
I almost forgot: filenum is a #define as 8.
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 Go to previous messageGo to next message
Andreas Kohlbach is currently offline  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 Go to previous messageGo to next message
Harry Potter is currently offline  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 Go to previous messageGo to next message
Anonymous
Karma:
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 Go to previous messageGo to next message
Anonymous
Karma:
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 #336570 is a reply to message #336240] Tue, 31 January 2017 18:52 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
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.
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 Go to previous messageGo to next message
Harry Potter is currently offline  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 Go to previous message
Harry Potter is currently offline  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.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Official FAQ comp.binaries.cbm (semimonthly posting)
Next Topic: Looking for COAST Module
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Apr 19 22:31:28 EDT 2024

Total time taken to generate the page: 0.03094 seconds