Jump to content
IGNORED

cc65 compiler error at "offsetof" on AtariXL target of AdvSkel65 only?


Recommended Posts

Hi!  I am working on my AdvSkel65 program and gained considerable ground with debugging and optimizing.  However, the 64k AtariXL port is giving me an error message on a line containing "offsetof" and is stating that it is an undefined function.  I also get two errors immediately after: one says that I can't mix declarations and code, and the other says that cc65 expects an integer expression.  Following are gthe troublesome function declaration:

-------------------------

//Second part of player init routine.  To be stored in a stub.
void InitPlayer2 (void)
{
    //for (i=8; i;) {--i; Player.Inv[i]=Player.ExitRoom=-1;}
    memset (&Player, 0, sizeof(Player));
    __asm__ (
        "\tlda\t#255\n"
        "\tldx\t#7\n"
        "@a01:\n"
        //"\tinc\t$C00\n"
        "\tsta\t%v+%w,x\n"
        "\tdex\n"
        "\tbpl\t@a01\n",
        Player, offsetof (struct player_, Inv)
        );
#if defined __C128__ || defined __APPLE2ENH__
    printscr("What is your name?  (No more\n"
         "than 15 characters)?");
    GetInput (Player.Name, 15);
#endif
    //Player.ExitRoom=-1;
    //Player.Money    =2000;
#ifdef __USEFARMEM__
#if defined __APPLE2ENH__ || defined __ATARIXL__
    aux_memcpyfrom (&Player.RoomInv, &DefRoomItems, (NumItems<<3));
#elif defined __PLUS4__ || defined __C128__
    bank1_memcpyfrom (&Player.RoomInv, &DefRoomItems, (NumItems<<3));
    //bank1_memcpyfrom (0xC00, &DefRoomItems, (NumItems<<3));
#elif defined __C64__
    hmemcpy (&Player.RoomInv, &DefRoomItems, (NumItems<<3));
#else
    memcpy (&Player.RoomInv, &DefRoomItems, (NumItems<<3));
#endif
#else
    memcpy (&Player.RoomInv, &DefRoomItems, (NumItems<<3));
#endif
    CRoom=0;
//printc ('.');
}
-----------------------

and the line to compile the code:

------------------------------

cl65 --cc-args --all-cdecl -C atarixl_small.cfg -t atarixl -Wl -D__SYSTEM_CHECK__=1 -Cl -Ors -o autorun.sys atari8_crt0.s player.c rooms.c words.c wordsdb.c wordsdb2.c printtok.c printi.s atasimpleio_xl.lib ataricio.lib

Link to comment
Share on other sites

40 minutes ago, Wrathchild said:

would be worth tracing why as if the include is commented out then it should not work for other platforms.

it implies that stddef is being included elsewhere for other platforms but not the Atari

My impression is that @Harry Potter isn't caring why something is working or not. When it is working he is happy 🙂

  • Thanks 1
  • Haha 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...