Copying something to the zero/direct page, use it a couple times, and then storing it back.
I keep seeing this being done in SNES games and it makes me wonder, did developers actually think they were optimizing code by doing this? It makes sense if something was kept in the direct page, or used in the direct page for a long enough time, but I typically see it in places where the cycles taken to move something back and forth outnumber the cycles saved from direct page addressing.
I wonder if there's some sort of feedback loop, where the programmer does this type of "optimization" first, then it lags, then he "optimizes" it even more, and it lags even more, and so on, without realizing it was his "optimizations" all along that caused it.
I keep seeing this being done in SNES games and it makes me wonder, did developers actually think they were optimizing code by doing this? It makes sense if something was kept in the direct page, or used in the direct page for a long enough time, but I typically see it in places where the cycles taken to move something back and forth outnumber the cycles saved from direct page addressing.
I wonder if there's some sort of feedback loop, where the programmer does this type of "optimization" first, then it lags, then he "optimizes" it even more, and it lags even more, and so on, without realizing it was his "optimizations" all along that caused it.