why do you say graphicsheight() and graphicswidth() are slow?
Depends on the platform you are running it on. On Linux at least (where I tried his code), taking out repeating calls to those sped things up a lot.
Anyhoo.. was just one of many things that made an immediate difference on my BlitzMax... But I realize there's probably only me using Linux as it is... :-)