Well, it's not fast, but it shifts and combines perfectly, and it uses a single section of code for all four directions. I believe that using simpler graphics or xLIBC would speed it up a bit more, as these sprites would require 1/4 the data with half-res xLIBC. I love Celtic II CSE being used, though, so perhaps we can stick with the two versions we had planned? I'll email you back the source, which now has TokenIDE/SC3 comments scattered throughout.
Edit: Actually, I take that back, the speed (if not fast) is actually bearable. I noticed two bugs, and I came up with one idea.
A) Bug 1: An existing tile can be combined with a new tiles creating from the combination of two other existing tiles, in the same move. The original does not allow this. My code's design allows a simple one-line fix for this.
B) Bug 2: The game will give you another tile if you press a direction that does not change anything. Fixing this is as easy as tracking whether anything was changed during the sliding/combining code.
C) Thought: game-over code: If there is any blank space, ie, prod([A]) == 0, then the game is definitely not over. If there are no blank spaces, ie, prod([A]) != 0, then check left and down from each tile in rows 1-3 and columns 1-3. If any tiles match, the game is not over. If none match, the game is over.
Edit #2: Implemented fixes for those two bugs. Good night.