This fixes some bugs and also adds the mouse invert option.
open your mouse and flip the y-axis sensors like a marine
Or use it upside down. That has the additional benefit of also inverting the x axis.
You could then fix the inverted x axis by using the mouse on the underside of the table. Works fine with optical mice, but a ball mouse might require fiddling with gravity (or magnets, but that's no fun).
I think most ball mice have the ball sitting tightly enough.