Harry Potter Posted September 28, 2021 Author Share Posted September 28, 2021 The program in question is a memory extension for cc65. This is just a file to test the library as I have it now. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 28, 2021 Share Posted September 28, 2021 ? Then in that case your new program doesn't need to worry about memory under the OS as presumably it not going to be 'just that' it is more targeted at the banked memory at $4000-$7FFF and you wouldn't mix the two. So CC65 users already have the 'hidden' memory catered for by using the xl target, so again, don't worry about this. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 28, 2021 Author Share Posted September 28, 2021 Wrathchild, I thank you for your input. The library is to make available unused sections of "low" memory as well as aux memory. That's why I was using the MEMSAVM section. Again, I got the program to run a little better. I disabled a Low memory stub. Now, the problem seems to be in the call to the loadauxmem() function. BTW, I still want the extra memory. I'm currently building a program called AdvSkel. It is a program for cc65 that provides the basic code to build a text adventure. So far, it is being built for CBM models, but I want it to be available for other cc6 targets as well. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 28, 2021 Author Share Posted September 28, 2021 Wrathchild, how do I put data in the hidden RAM? Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 28, 2021 Share Posted September 28, 2021 Good grief, what is the minimum mem for running your app? If > 47K then I'd forget about hidden memory as you'll be using banked memory. Your question asks about data and not code, so presumably that is data not needed in regard to I/O, e.g. saving? Go and read about PORTB and simply you disable the OS write/read memory in those areas ($C000->$CFFF, $D800->$FFFF) and then enable the OS again. Your cfg has the three memory areas HIDDEN_RAM, HIDDEN_RAM2 & CHARGEN and so if you associate segments with them then you can use the associated defines in your code. BUT, you can't load direct to them from the binary executable, you'll need to load it fist to lower area and then call some code to relocate it (making the load area free for other things). Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 28, 2021 Author Share Posted September 28, 2021 I'd rather just put the information in a separate file and load it into memory. This will save memory in the main program section. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 28, 2021 Share Posted September 28, 2021 As said, to do that you need a transitioning buffer area below $C000 to which you'll load the data and then move it under the OS, so seems counter-productive?! The typical use for the hidden area is either code or static data needed by the app. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 28, 2021 Author Share Posted September 28, 2021 So hidden RAM isn't worth it. In the config file, are the extra memory areas usable for code and data? Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 28, 2021 Share Posted September 28, 2021 (edited) Not utilised it myself as I tend to work with the ROM/Cartridge images and their banking areas. So for someone else to chip in. Edited September 28, 2021 by Wrathchild Quote Link to comment Share on other sites More sharing options...
sanny Posted September 28, 2021 Share Posted September 28, 2021 3 hours ago, Harry Potter said: MEMSAVM is my own invention. It is a supposedly unused section of memory, and I'm using it as extra memory. Why do you think it's "supposedly unused"? Depending on the DOS version it _is_ used. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 28, 2021 Author Share Posted September 28, 2021 Are the other two memory areas mentioned in the .cfg file usable? Quote Link to comment Share on other sites More sharing options...
sanny Posted September 28, 2021 Share Posted September 28, 2021 2 hours ago, Wrathchild said: As said, to do that you need a transitioning buffer area below $C000 to which you'll load the data and then move it under the OS, so seems counter-productive?! The typical use for the hidden area is either code or static data needed by the app. Loading into "high memory"/"hidden memory" is already handled by the "atarixl" cc65 runtime lib. In case you are using the "atarixl" target I don't recommend to fiddle with PORTB unless you really know what you are doing! Quote Link to comment Share on other sites More sharing options...
sanny Posted September 28, 2021 Share Posted September 28, 2021 In the "atarixl" target, while the program is running, the ROM is banked out, so memory above $C000 is directly accessible. Just for interrupts, CIO calls, and SIO calls, the ROM is temporarily enabled. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 28, 2021 Author Share Posted September 28, 2021 Thank you, sanny. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 28, 2021 Author Share Posted September 28, 2021 (edited) I have the e-book Mapping the Atari, which identifies certain Low RAM positions as used for special features that might not be used by most cc65 programs. That's where I got my information. Again, are the config memory areas mentioned actually usable? Edited September 28, 2021 by Harry Potter Forgot the e- in e-book. Quote Link to comment Share on other sites More sharing options...
sanny Posted September 28, 2021 Share Posted September 28, 2021 37 minutes ago, Harry Potter said: Are the other two memory areas mentioned in the .cfg file usable? I think so (TAPEBUF_ and XBUF_). But why don't you combine them into one? They are adjacent. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 28, 2021 Author Share Posted September 28, 2021 I didn't know that. Thank you! Quote Link to comment Share on other sites More sharing options...
sanny Posted September 28, 2021 Share Posted September 28, 2021 $3FD + $83 = $480 Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 29, 2021 Author Share Posted September 29, 2021 I still have a problem with the test program. I had to disable the low memory to get it to work, and now, it appears that there is an error while writing to aux memory. I attached the relevant files. readb1.s writeb1.s readauxfile.c Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 29, 2021 Share Posted September 29, 2021 Can you change the ld65 command in your home.bat file to: ld65 -C atarixl_memx.cfg -Ln autorun.lbl -m autorun.map -o autorun.sys crt0.o test.o m.lib atarixl.lib and attach the the lbl, map, and autorun.sys files Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 29, 2021 Author Share Posted September 29, 2021 Here are the files.... autorun.map autorun.lbl autorun.sys Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 29, 2021 Share Posted September 29, 2021 (edited) 1 hour ago, Harry Potter said: it appears that there is an error while writing to aux memory. What makes you think that? Your test code is presumably reading the aux1.bin file and taking the first byte and writing that to aux-memory? From what I see there is a store to $4000 and so maybe set a breakpoint in Altirra of 'ba w $4000'. The bin file in the distro uploaded earlier had no content (zero length). Edited September 29, 2021 by Wrathchild Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 29, 2021 Author Share Posted September 29, 2021 I added the line "putchar ('.');" to the beginning of the loop in the readauxfile() function, and it ran only once, then the system stops. I disabled the fread() call and get same result. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 29, 2021 Share Posted September 29, 2021 Happening for me Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 29, 2021 Author Share Posted September 29, 2021 I get the same result, but later on, when loading the data into aux memory, the program stops. I'm posting the test.c file now. test.c 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.