Two small, powerful utilities for TI-Z80 Basic programs
Posted by Xavier on 28 June 2018, 09:03 GMT
Despite being one of the most productive authors in our archives, with an eclectic output (games, utilities, math, and even programming languages) near-exclusively targeting the monochrome TI-Z80 series, Zeda "Xeda / Thunderbolt" Thomas received very few features... so far. Let's fix that a bit, shall we ? First of all, with a couple utilities.
Note that we requested - and received - help triaging her program from Zeda herself.
CopyProg 2: an expanded version of CopyProg. CopyProg makes it possible to copy the contents of a variable, whether located in RAM or in archive, into another variable, without hassle. This can copy Pic variables into Appvars, archived programs into temp programs, strings into appvars, and a variety of other combinations. Copying from Flash to RAM can help save your Flash memory chip, and slightly speed up reads, while reducing the dreaded Garbage Collection.
CopyProg is a tiny 143-byte single-purpose utility, and CopyProg 2 greatly extends the abilities of CopyProg: you can also get the names and sizes of existing variables, read lines from programs (or any other variable type), delete lines, and archive/unarchive variables. On its own, CopyProg 2 can be used to make a BASIC shell. It remains lightweight, being smaller than a monochrome TI-Z80 picture variable: 753 bytes.
LblRW makes it easier to store game info internally, inside TI-Basic programs (!), by allowing a program to modify its own code, in reference to a label. For example, you can read the contents of the second line after 'Lbl MD' or overwrite its contents. It helps reduce the number of variable and the RAM consumption; therefore, it's great for large programs like RPGs, for instance.
LblRW was only recently uploaded to ticalc.org, and saw limited use elsewhere earlier - but it's a shame, as it's a nice solution for storing game / user data.
Happy programming! :)