Jump to content

Two system-specific bugs w/ AdvSkelVic65

Recommended Posts

Hi!  I'm currently working on updating AdvSkelVic65 and AdvSkel65 and am having problems with the former: the Atari8 cartridge version is moving the screen slightly then displaying a blank screen, and the PET version, when I type a noun, displays garbage on the top-left corner of the screen.  I think the former is due to my AtaSimpleIO library and the latter when the ScanWord() routine is called.  The following is the code that handles identifying the noun:


static unsigned char __fastcall__ ScanWord (char* Dest)
#ifdef __DOFE3__
    unsigned char j, c;
    for (j=0;
        (c=bankgetbyte((unsigned) Dest+j)) && c == (s[j])/*Sour[j]*/;
    // return c==0;
    __asm__ (
        "@a03:\n", c, s, c
    return c==0;


//Searches for user-inputted item #.
//Returns 0xFF if not found.
unsigned char __fastcall__ FindItem (void)
#ifdef __DOFE3__
    //char* s;
    /*  Search for item in Input */
    for (CurItem=0; CurItem < NumItems; ++CurItem)
#ifdef __DOFE3__
//printh (bankgetword(&Item[CurItem].Name)); printcr ();
        if (ScanWord(bankgetword(&Item[CurItem].Name))) {
            return CurItem;
        if (ScanWord((ItemPtr=&Item[CurItem])->Name)) {
            return CurItem;
/*  Search item aliases */
    // for (CurItem=0; CurItem < NumItemAliases; ++CurItem)
    // {
        // //if (ScanWord((char*)&ItemAlias[CurItem].Name, Input)) {
        // if (find2(ItemAlias[CurItem].Name))) {
            // return ItemAlias[CurItem].Num;
        // }
    // }
/*  Search directions  */
//printc ('a');
    for (CurItem = 0; CurItem < 4; ++CurItem)
        if (ScanWord((char*)&RoomDir[CurItem])) {
            return CurItem | 160;
    return -1;
[/code]BTW, __DOFE3__ is for large cartridges and not applicable here.

Link to comment
Share on other sites

I solved the bug: in a __fastcall__ function, I popped the stack early and exited using a C return command, and, apparently, this caused stack corruption.  Now it works.  :)  I believe there's a similar bug in AdvSkel65, though.  The symptom is, on the 128k Plus4 version, when I type in certain instructions, I get the monitor.  :( This doesn't happen in the 64k version or most other versions.  The 128k Plus4 version uses MemBankP4.  I attached the crt0.s file I'm using and some functions responsible for parsing user input.

plus4a_crt0_bank1.s advskel65 verbs_nouns.txt

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.

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.


  • Recently Browsing   0 members

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