sdl port by mjau

bugfix edition!
thanks to vegard for save fix =)
