Next Generation Emulation banner
1 - 4 of 4 Posts

·
Registered
Joined
·
5 Posts
Discussion Starter · #1 ·
Hi.
I'm writing a Chip-8 emulator and I'm about to make a start on the DRW Vx, Vy instruction.
I understand that the sprites are XORed onto the screen and that if a sprite gets erased the VF flag is set. What I don't get is why the sprites are XORed onto the screen. How is this useful for a programmer writing Chip-8 games?
Cheers.
 

·
Level 9998
Joined
·
9,384 Posts
Hi.
I'm writing a Chip-8 emulator and I'm about to make a start on the DRW Vx, Vy instruction.
I understand that the sprites are XORed onto the screen and that if a sprite gets erased the VF flag is set. What I don't get is why the sprites are XORed onto the screen. How is this useful for a programmer writing Chip-8 games?
Cheers.
Since the sprites are XORed, you can use its own sprite data to erase just the instance of the sprite rather than having to clear the entire screen then redraw everything.

That should also mean that you can erase parts of the screen without having to redraw everything. Since it takes less time doing so.

And like Shendo said, collision detection.
 
1 - 4 of 4 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top