Jump to content
IGNORED

cc65/AtariXL program won't compile!


Recommended Posts

Got it to compile ok, took a while, the program crashes probably because of this :-

    aux_memcpyto (0, &s1, strlen (s1));  <<---- this function, the first parameter is the address of the destination i.e. page 0, address 0 also, you need to cast the address, your supplying an int
    aux_print (0);
    aux_memcpyin (0x4000, 0, strlen (s1)); <<<<---- this does the same in reverse, but shouldn't crash it, but 0 as the source is wrong
    aux_print (0x4000);;
    aux_memcpyfrom (&s2, 0x4000, strlen (s1));
    puts (s2);

 

This is my compile batch file.

cl65 -t atari -Oi -T -Wl "-D__RESERVED_MEMORY__=0x3000" --static-locals -o test.xex b1_memcmp.s b1_memset.s writeb1.s b1memcpy.s PRINT.s readB1.s test.c 

 

Don't worry about the RESERVED_MEMORY, just used an existing batch file.

 

Also in your calls, e.g. 

aux_memcpyto (0, &s1, strlen (s1)); <<<---- you pass &s1, this is not necessary as s1 is a string, so s1 is a pointer to the string.

 

I modified the code to this:-

    aux_memcpyto ((char *)0x5000, s1, strlen (s1));
    aux_print ((char *)0x5000);
    aux_memcpyin ((char *)0x4000, (char *)0x5000, strlen (s1));
    aux_print ((char *)0x4000);;
    aux_memcpyfrom (s2, (char *)0x4000, strlen (s1));
    puts (s2);

 

It still crashes, but that could be down to one of the .s files.

Edited by TGB1718
Some changes to code made and tested
Link to comment
Share on other sites

24 minutes ago, Harry Potter said:

You compiled it for an Atari.  I want to compile it for the Atari XL.  Also, the aux_*() functions access the XL's extra memory, so the 0 means the first byte in the extra memory

But at least I got it to compile :) , so if you do similar for your XL, it should work for you.

Link to comment
Share on other sites

1 hour ago, Harry Potter said:

You compiled it for an Atari.  I want to compile it for the Atari XL.  Also, the aux_*() functions access the XL's extra memory, so the 0 means the first byte in the extra memory.

XL 'extra' memory? If you mean bank switched memory, do you mean an upgraded XL? As far as I know, only the XE's come stock with extended memory.

Link to comment
Share on other sites

1 hour ago, Harry Potter said:

Okay.   Thank you for the information.  :)  I got it to almost compile.  I included both atari.lib and atarixl.lib.  Now, I only get __RESERVED_MEMORY__ and __SYSCHK_LOAD__ undefined.   I attached the new .cfg file.   How do I define these?

atarixl_memx01.cfg 4.6 kB · 2 downloads

 

What do you want to do with this MEMXM memory area?

Link to comment
Share on other sites

I don't like cc65's EMD drivers.  They require a lot of extra work and have limited functionality.  I created Hidden64 for the C64 and MemBank128 for the C128.   I am doing the same for the Atari.  My works allow cc65 programmers to access extended memory almost as if it were the regular memory.

 

sanny: I know this, and I have code to handle the conversion from a linear pointer to a bank pointer and Freddy configuration.

Link to comment
Share on other sites

3 hours ago, Harry Potter said:

Okay.   Thank you for the information.  :)  I got it to almost compile.  I included both atari.lib and atarixl.lib.  Now, I only get __RESERVED_MEMORY__ and __SYSCHK_LOAD__ undefined.   I attached the new .cfg file.   How do I define these?

atarixl_memx01.cfg 4.6 kB · 5 downloads

You can define them in the same way you do any segment, but I think those should be already taken care of for you if you are using the standard ( as in, not your own) crt0.s and you have used the correct .cfg file as a starting point for defining your own.  

 

You don't need to link in atari.lib or atarixl.lib at all, just use the correct -t argument, but linking them both in is definitely not correct. I wrote something very similar to what you are doing about 5 years ago, and I basically used everything stock from cc65, meaning -t atari and did not mess with the crt0.s. I defined 4 16k bank segments and a lowmem bank with page control, memory page copies, and address abstraction, just as you are probably doing.

 

I'd say try starting with the CC65 native crt0.s and the standard atari.cfg file, then adding your segments into that. Seems like you got some kind of mismatch going on.

Link to comment
Share on other sites

#Extra memory
    MEMXM:       file = "memx", define=yes, start=0, size=$ffff;
}
 

This is what Sanny was talking about. You are defining a flat 64K here of 'extra' memory. 

I don't know where you got that .cfg file, it has all kinds of extra stuff in it that don't seem related to your stated objective, but ok.

 

As mentioned above, I'd say try starting with the CC65 native crt0.s and the standard atari.cfg file, then adding your segments into that. Seems like you got some kind of mismatch going on.

 

Good luck!

Edited by danwinslow
Link to comment
Share on other sites

__RESERVED_MEMORY__ is not used in the atarixl target. One reserves memory there by using a higher start address.

 

__SYSCHK_LOAD__ should be defined. You have

    SYSCHK:      load = SYSCHKCHNK,                    type = rw,  define = yes, optional = yes;

in your config file.

 

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...