Page 2 of 2

Re: How did f-1 Race work?

Posted: Fri Apr 28, 2017 2:05 pm
by zeroone
thefox wrote:allocates the tiles dynamically (i.e., only the tiles that have non-empty CHR data will have non-zero nametable entries), and uses palette switching to get double buffering.
I don't understand. :/

Re: How did f-1 Race work?

Posted: Fri Apr 28, 2017 2:27 pm
by tepples
Palette switching means that in even frames, bitplane 0 (consisting of bytes $00-$07 of each tile) gets displayed while bitplane 1 (consisting of bytes $08-$0F of each tile) gets filled, and vice versa in odd frames. To display only bitplane 0, set the palette to black, white, black, white, so that bitplane 1 is ignored. To display only bitplane 1, set the palette to black, black, white, white, so that bitplane 0 is ignored.

Dynamic allocation means it stores a partial nametable in main RAM, filled with solid black tiles. When trying to draw pixels into a tile whose current tile number is the solid black tile, it allocates a new tile number for that tile. When trying to draw pixels into a tile that is not the solid black tile, it uses the same tile number that was already there.