• 31,syntax error,00,00 reading file on .d64 disk image

    From Harry Potter@3:770/3 to All on Sat Jan 21 15:36:18 2017
    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/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? :(

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Harry Potter@3:770/3 to All on Sat Jan 21 15:40:04 2017
    I almost forgot: filenum is a #define as 8.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Andreas Kohlbach@3:770/3 to Harry Potter on Sun Jan 22 17:17:20 2017
    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.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Harry Potter@3:770/3 to Andreas Kohlbach on Sun Jan 22 16:10:28 2017
    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. :(

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From mark lewis@1:3634/12.73 to Andreas Kohlbach on Sun Jan 22 20:19:00 2017

    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]

    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. ---
    * Origin: (1:3634/12.73)
  • From Andreas Kohlbach@3:770/3 to mark lewis on Mon Jan 23 16:08:22 2017
    On Sun, 22 Jan 2017 20:19:00 +1200, mark lewis wrote:

    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]

    That looks like C source code to me, not an error message.

    well, it does say "erroneous code" and not "message" ;)

    You're right. I think I only read until "the error message", which I
    didn't see (is in the subject, which I ignored), and my eyes then jumped
    down to "it", which was the C code instead. Sorry.
    --
    Andreas
    You know you are a redneck if
    you won't stop at a rest area if you have an empty beer can in the car.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From mark lewis@1:3634/12.73 to Andreas Kohlbach on Mon Jan 23 20:36:58 2017

    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]

    That looks like C source code to me, not an error message.

    well, it does say "erroneous code" and not "message" ;)

    You're right. I think I only read until "the error message", which I didn't see (is in the subject, which I ignored), and my eyes then jumped 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.
    ---
    * Origin: (1:3634/12.73)
  • From Harry Potter@3:770/3 to All on Tue Jan 31 15:52:46 2017
    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.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Harry Potter@3:770/3 to Harry Potter on Sat Feb 11 09:28:18 2017
    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?

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Harry Potter@3:770/3 to Harry Potter on Thu Feb 23 15:42:10 2017
    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.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)