This gets rid of the (substantial!) overhead of preparing a list and then iterating over it, in exchange for a bit of bookkeeping to simulate the prior behavior of the for loop, which is much cheaper.
Some of these are pure token optimizations, some spend tokens for performance. Function calls are particularly expensive in Pico-8, so using the table form of `pal` whenever changing multiple colors seems worth it.
Also fixes a bug in palette swapping.
Reviewed-on: pyrex/chameleonic#3
Co-authored-by: Kistaro Windrider <kistaro@gmail.com>
Co-committed-by: Kistaro Windrider <kistaro@gmail.com>