In advance, I apologize for the open endedness, and general wishy-washiness of this question, because to be honest my knowledge of the topic is very patchy and I'm finding it hard to even describe my problem. I really didn't want to post, but I'm completely and utterly stuck.
I have started a NES emulator. It's interpreted (so no dynamic recomp).
Atm it can load and map roms (mapper 0 roms) and execute the init code right up to where I have to deal with interrupts and the PPU. That's where I'm stuck.
Here is an example output from my emu atm. Execution begins at 8000, and I hit an infinite loop at 800a where I have no idea how to progress from there.
8002: LDA #$10 ; read immediate value to set PPU control registers
8004: STA $2000 ; store value
8007: LDX #$FF ; load immediate value into X register
8009: TXS ; store X register into stack
800a: LDA $2002 ; read PPU flags into accumulator (set N flag based on bit 7)
800d: BPL ; test N flag, branch to 800a if not positive, (N is set)
800a: LDA $2002
800d: BPL
800a: LDA $2002
800d: BPL
800a: LDA $2002
800d: BPL
etc, etc etc (inf loop)
So my question is, can someone please explain the basics of 1 iteration through a PPU render for me, including things like cycle count, interrupts etc (i.e. draw one whole 240 scanline screen and move onto the next).