Harry Potter Posted June 1, 2021 Share Posted June 1, 2021 I am working on an Atari XL memory extension for cc65 and am having problems compiling the test code. I get eight unresolved references errors. The code is attached. I am using cc65 V2.16. bank1.zip Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted June 2, 2021 Share Posted June 2, 2021 (edited) 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 June 2, 2021 by TGB1718 Some changes to code made and tested Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted June 2, 2021 Author Share Posted June 2, 2021 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. Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted June 2, 2021 Share Posted June 2, 2021 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. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted June 2, 2021 Author Share Posted June 2, 2021 Okay. I'll try that. Quote Link to comment Share on other sites More sharing options...
danwinslow Posted June 2, 2021 Share Posted June 2, 2021 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. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted June 2, 2021 Author Share Posted June 2, 2021 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 Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted June 2, 2021 Share Posted June 2, 2021 21 minutes ago, Harry Potter said: I included both atari.lib and atarixl.lib Why do you think that is a solution? Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted June 2, 2021 Author Share Posted June 2, 2021 Because it seemed to work. Quote Link to comment Share on other sites More sharing options...
sanny Posted June 2, 2021 Share Posted June 2, 2021 you shouldn't need atari.lib if you compile -t atarixl Quote Link to comment Share on other sites More sharing options...
sanny Posted June 2, 2021 Share Posted June 2, 2021 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? Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted June 2, 2021 Author Share Posted June 2, 2021 Its contents are going into the XE's expanded memory. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted June 2, 2021 Share Posted June 2, 2021 Have you tried cc65's EM driver? Quote Link to comment Share on other sites More sharing options...
sanny Posted June 2, 2021 Share Posted June 2, 2021 1 hour ago, Harry Potter said: Its contents are going into the XE's expanded memory. The XE's expanded memory is not linear 64K, but 4 (or more if expanded) banks of 16K at 0x4000. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted June 2, 2021 Author Share Posted June 2, 2021 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. Quote Link to comment Share on other sites More sharing options...
danwinslow Posted June 2, 2021 Share Posted June 2, 2021 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. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted June 2, 2021 Author Share Posted June 2, 2021 I was not talking about segments but the unresolved externals I mentioned. Quote Link to comment Share on other sites More sharing options...
danwinslow Posted June 2, 2021 Share Posted June 2, 2021 (edited) #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 June 2, 2021 by danwinslow Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted June 2, 2021 Author Share Posted June 2, 2021 I got the file from cc65's sources and added the entries for my memory expansions, but the issue seems unrelated to the expansion RAM. I just need to know why __SYSCHK_LOAD__ is undefined and how to define __RESERVED_MEMORY__. That's all. Quote Link to comment Share on other sites More sharing options...
sanny Posted June 2, 2021 Share Posted June 2, 2021 __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. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted June 2, 2021 Author Share Posted June 2, 2021 Well, ld65 reports them as undefined. BTW, if I just include atarixl.lib, I get eight unresolved references. If I include both atari.lib and atarixl.lib, I get two unresolved references. Quote Link to comment Share on other sites More sharing options...
sanny Posted June 2, 2021 Share Posted June 2, 2021 you are doing something wrong (tm) and one should never ever link with both atari.lib and atarixl.lib maybe we can help if you give the whole project Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted June 2, 2021 Author Share Posted June 2, 2021 The program in question is just designed to test my MemXAtari routines. The program and the library code are attached. bank1.zip Quote Link to comment Share on other sites More sharing options...
sanny Posted June 2, 2021 Share Posted June 2, 2021 lib_cfg/auxmematarilib is missing Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted June 2, 2021 Author Share Posted June 2, 2021 Simply create the folder and run the home.bat program. It will create the library. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.