Author Topic: Ever corrupt your archive?  (Read 6929 times)

0 Members and 1 Guest are viewing this topic.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Ever corrupt your archive?
« Reply #15 on: August 14, 2011, 05:27:49 pm »
Cool :D. I've never had issues, but I think I'll keep this topic in mind.
So, the TI-OS will claim another sector from the user sometimes? Interesting.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Ever corrupt your archive?
« Reply #16 on: August 14, 2011, 05:59:01 pm »
What is this wizardry?!
How does it work?

I'll explain the process.
1. Find the first page starting at the end of the archive that is not an app, AND it with $FC and store that.
2. Find a suitable swap sector.
    a. First scan the archive for a sector that starts with $FE (swap) or $FF (blank)
    b. If that didn't work, look for a sector that doesn't have any valid programs in it
    c. If that didn't work, screw it and use page 8.
3. Starting on page 8, and ending at the page found in step 1, begin copying everything to the swap sector.
    a. First, search the page for a program that has a valid header (valid meaning not erased, good type, good length, and 0 < (name length) < 9)
    b. Copy that program to the swap sector making sure to set the new address and page to where you are copying it
    c. When the end of a sector is reached, erase it and continue on to the next one
    d. If the swap sector runs out of space, just find a new one. (By this time, page $0C is guarenteed to be open.)
4. Find one last swap sector and copy sector 8 there (program by program because of the valid page thing)
5. Mark sector 8 as the swap sector and clear ram (to rebuild vat)

That's about it. I didn't include any code to try to optimize how the variables are stored in the archive, but, as you make new variables, they'll take up the little spots at the end. This was mostly done to increase speed, and because it would just be annoying to add.

Cool :D. I've never had issues, but I think I'll keep this topic in mind.
So, the TI-OS will claim another sector from the user sometimes? Interesting.

Ti-OS won't claim another sector, but some program might accidentally. If you write 00 to the first address of any sector, the OS will just stop using it. If it sees that the sector is invalid, rather than deleting it, it just ignores it.

Edit:
   Source attached for your enjoyment.
« Last Edit: August 14, 2011, 05:59:56 pm by thepenguin77 »
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Ever corrupt your archive?
« Reply #17 on: August 20, 2011, 09:49:25 pm »
So I ran this, and now whenever I try to send an app (however many pages, archive completely free) TiLP throws "Msg: Out of Memory"
:|


Nvm, some weird bug with TiLP.
« Last Edit: August 20, 2011, 11:34:00 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Ever corrupt your archive?
« Reply #18 on: August 20, 2011, 11:59:25 pm »
By the way, corrupting 84+ archive on the nspire is very easy to avoid if you know how. Normally, you think crashes are the end of the world, but i can turn invalidated certs into a simple ram clear with my method :)