Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Side note, but can some one explain or link to something that explains xor-based animation? I couldn't find much in a quick Google search.


When the display only has black and white pixels, you can XOR the a "sprite", or image to the screen to draw it, and XOR the same sprite in to the same location again to undraw it. The advantages are that you don't have to redraw the entire screen this way each frame, images can overlap, and you can draw your image on a black background or a white background.

For animation, you pre-XOR the sprites together so that a single XOR both erases the old image, and draws the new one, in a single blit.

http://z80-heaven.wikidot.com/sprite-routines has some sample code and perhaps a better explanation. http://tibasicdev.wikidot.com/68k:sprites has some sample pictures.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: