'stealing' Hexxeh's hw acceleration stuff :)