Re: A83: Linus... TI83 Catalog?


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

Re: A83: Linus... TI83 Catalog?




On 09-Oct-98, Jkhum98@aol.com wrote:

>Hey, this is more for Linus, cuz I know he understands the internals of the
83
>and the z80 a lot, but if anyone else knows (like Pat, even though he rarely
>answers mails), I'd like you to inform me about How the TI83's Catalog
feature
>works?  Like everything about it... Where in the ROM does it find a list of
>all these functions, and especially _How_ if you could explain... =P  Also,
>when it knows where to look for these, what is used that allows the user to
>Scroll up & down a list of them... Along with this, what would be the best
way
>to implement a scrolling list-type thing?  I want to make some kind of
address
>book program that recalls the names that the user has typed in, and scroll
>those. Would I need to just redraw (place) which strings go in which spots on
>the screen every time...? Anyway, back to the Catalog... How does it also
work
>with the feature of Typing the first letter of the function you want, and
then
>going to that spot on the list?  Ok, get really technical here, if you may,
>but I was just wondering...  Thanks in advance... =)
>--Jason K.
>

Every command/token or whatever you would like to call it (like "abs(",
"and", "angle(") has a two-byte Key Value and a two-byte Token corresponding
to it. If the two-byte token starts with a zero, it is only stored as one
byte in programs and equations, but internally it is always referred to as
being two bytes long. Anyway, if you have the token OR the key value, there
are routines to display the correct string. (Those strings are stored in big
tables in rompage 1.)

In the depths of rompage 7 there is a table with key values, one for each
line in the catalog. This is where the catalog routines get to know what to
display, and what keypress to emulate when enter is pressed. The catalog
routines also keep an internal pointer at 819bh, pointing to the current
entry in that table.

Some of the catalog code is shared with the menu routines. The catalog is
menu number 35h (refer to one of my earlier messages), but it is always
treated in odd ways using conditional jumps, so that the normal menu
structures aren't used.

Doing the actual displaying is pretty straight-forward. One variable for the
top line, one variable for the current line, doing some boundary checking
against these when necessary. I haven't found that particular part yet, but I
assume that the trick with typing the first letter of a function relies on
hardcoded offsets into that table. At least I wouldn't be surprised if I
found a table of 27 offsets, the first one being a zero...

The conclusion is that it would be harder to do with dynamic lists, like in
an address book, but not at all impossible.

Linus


References: