Re: A92: Does the TI-OS sort the file entries?


[Prev][Next][Index][Thread]

Re: A92: Does the TI-OS sort the file entries?




At 02:40 AM 3/22/98 +0100, Niklas (EFD) wrote:
<< I've come across a minor problem in TINX2: how to save which teams are
selected for play when you exit the game and then Fargo... basically, I
need a way to save which team files to use the next time you start the game.

So, does the TI-OS sort or otherwise re-organize the file table entries?
More specifically, when a file has been given a handle, does that handle
ever change? If not, one solution would be to save the handles in a table
somewhere. >>

Handles never change. That's the whole point of using them.

However, it would not be possible, at this point, to cleanly do what you
are suggesting. Sure, you could keep a table of handles, but if the user
deleted TINX2 from his or her calc using the TI-92's built-in interface,
the saved files would stay there.

One solution would be to save the information in one or more TI-OS symbols
(variables in a folder). However, it won't be safe to do that until I
implement static-mem overlay support in Fargo; and when I do that, I will
also add the TI-OS symbol-management functions to the tios pseudolibrary.
(Symbol management = creating and deleting variables and folders, renaming
them, searching through them, etc.)

You see, although it is safe to allocate memory in a Fargo program,
creating a variable isn't merely a matter of allocating memory. It also
involves adding an entry to the apropriate folder table, which potentially
can resize the memory block associated with that table, which would move
around other blocks in memory; and it would be quite likely that one of
those blocks would be the Fargo program that is currently running, so
moving it would cause a crash.

As a stop-gap, I'd suggest that you reserve space in the actual TINX2
program file for any information you need to save.

---
David Ellsworth
davidell@earthling.net
IRC: eXocomp
ICQ: 2300673


Follow-Ups: References: