Hi there, fellow TI programmers.
I'm currently working on a game and am struggling with a problem. My file sizes have become too large to hold them all in the RAM at the same time.
(As you might already know, RAM is usable memory and is 24Kb, ROM has a lot more free space but items saved there can't be used)
I saw this coming, and I figured I would simply use an UnArchive and Archive command before and after the execution of each subprogram.
For clarification:
//some program
UnArchive prgmSUBPRGM //unarchive whatever is needed, making the program executable
prgmSUBPRGM //execute the program
Archive prgmSUBPRGM //archive again to save space
//rest of program
However, today I found out it isn't possible to archive and unarchive from within a program. This means that I have a lot less memory available than I assumed.
I am now looking for a way to automatically move subprograms from ROM to RAM and vice versa.
As stated on the page of memory management (I can't post links apparently :/ ) it is possible to do this with an assembly library.
I have absolutely no knowledge on this, I would really appreciate it if someone could show me how to install and use it.
I'm sure it can also be done in other ways, every bit of help is appreciated. Don't be afraid to say something, even if it isn't a solution to my problem.
Very simplified example of my problem:
You have two programs, prgmA and prgmB. They are both 20Kb, so they can't fit in your RAM at the same time. However, you are smart enough to know of the existence of archiving, and you moved them both to ROM. Now you want to execute one after another in another program called prgmC. The code would go like this:
UnArchive prgmA //make prgmA executable
prgmA //execute it
Archive prgmA //archive it, so you have the room to...
UnArchive prgmB //unarchive prgmB
prgmB //then execute prgmB
Archive prgmB //and finally archive it again so you can repeat this process later
Thanks a lot for reading this post, any help is appreciated.
(As for my game, yes, it can be optimized, but it won't be enough to fix my problem. Besides, knowing how to archive and unarchive from within a program can be very useful for other programs too.)
Thanks a lot!