Quote
Wasn't there something in the MZXencyclopedia about storing 15 pieces of data in one counter or something? I didn't bother looking it up, because at the time, it wasn't necissary.
Yeah, I can vaguely remember that, and tried using it once... I guess I'll try explaining it, though this is difficult to put into words. *ahem*
Each of the 15 items within the counter has a different number, starting from 1 and multiplying by 2 until finally reaching 16384. (i.e. 1, 2, 4, 8, 16, etc.) These are added into the counter at the same time; for instance, let's say you had items 1, 5, and 14 in that counter. Their numbers would be 1, 16, and 8192 respectively. These amounts add up to 8209. If you had all 15 items, the amount would be the maximum of 32767.
To get the values returned... I only vaguely remember how to do this. Let's call the counter "foobar". To get item 5 (number 16) returned, you would do something like the following...
set "loopcount" to "foobar" //to keep the counter.
divide "loopcount" by 16 //if the item is there, this returns an odd value.
modulo "loopcount" by 2 //should return a value of 1.
if "loopcount" = 1 "dostuff" //if the value is 1, the item is in the counter, therefore it, like, does stuff.
So there you have it. Hope I got it right...