Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
I've been looking around and have been unable to find much information on the defragment routine for the TI-83/84+ series. Does anyone know if there is a certain bcall present to run this routine, or any other information? Anything helps! Smile
You're talking about what happens when an app is deleted right ? I didn't do any specific research, but from what I know an app is alone on its flash page(s), so my guess is that what Defragmenting is is just erasing the involved flash pages.
Defragmentation is when you delete an App and the OS compacts the existing Apps. In most modern filesystem, defragmentation is no longer necessary, but for the TI-OS, it makes the most sense to have all the free App pages in one contiguous block. That way you'll be able to load an App as big as your number of free pages. For example, imagine that you had three 48KB Apps in the memory of a TI-83+ (that's 9 out of 10 App pages occupied), and for simplicity, no Archived variables. If you deleted the first and last Apps, you'd have 3 out of 10 App pages occupied, but arranged as 3 pages free, 3 pages used, and 4 pages free. If you wanted to load an 80KB (5-page) App onto the calculator, it wouldn't fit, because you'd have a 3-page slot and a 4-page slot. By defragmenting, the OS moves that existing 3-page App down to lower memory, shifting the 7 free pages together and allowing you to load the 5-page App into the space.

You cannot manually trigger the Defragmenting... routine, not that you'd want to.
I don't know if it is possible to garbage collect from an asm program, but if yes, you can use it to defrag the apps area.
Just bcall _deleteapp first, then garbage collect.
KermMartian wrote:
You cannot manually trigger the Defragmenting... routine, not that you'd want to.

   set   3,(iy + $25) ; this bit is set when an app is deleted
   ld   a,cxErase
   call   _NewContext0
This is a great bit of discovery; thanks, Mateo! Throw in an AppChangeHook and you've got yourself a deal. Wink
Well, oddly enough it returns. It's not until once you get back to the homescreen does it run. You can force it by loading the homescreen app though.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum