Cool! I want it now!
Maybe it makes sense to change the step to make panning smoother?
> /-       tileset_zoom = tileset_zoom / 2;
> /+       tileset_zoom = tileset_zoom - 2;
...
> /-        tileset_zoom = tileset_zoom * 2;
> /+       tileset_zoom = tileset_zoom + 2;