I've been working on an NES emulator and have almost completed the cpu core and so have started thinking about ppu emulation. The problem is that I am at a loss as to where to begin. Any hints on what I should implement first? I'm planning to use SDL.
First implement the PPU's dot clock (3 dots every CPU cycle on NTSC), the horizontal sequence (341 dots = 1 line), and the vertical sequence (240+1+20+1 lines = 1 frame on NTSC). Then expose the vertical sequence through the NMI bit of PPUCTRL ($2000) and the vblank state bit of PPUSTATUS ($2002). That will at least get games to start booting.
Okay, It's been a while, and I now have the various clocks implemented. I decided after some research to use 15/16 Master cycles. I see the nametable being written, but now I'm stuck. What is the best way of actually rendering the screen? I figured that going scanline by scanline would be the best way to go, but I'm also not sure how to actually convert the name table, palette, and other information into each individual pixel.
There's nothing wrong with drawing the screen pixel by pixel. It's slower but modern PCs won't have any trouble with it. When I wrote my NES emulator I started out with a tiled renderer, then went to a scanline renderer, and finally to a pixel by pixel renderer.