Skip to content

Commit

Permalink
Add comment about PPU implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
tyfkda committed Mar 8, 2024
1 parent 34e36a8 commit b35d487
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/nes/ppu/hevent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,15 @@ export class HStatus {
}
}

/*
Note
* Status are triple buffered (in HEvents):
1. current (modified according to CPU writes)
2. lastFrame (keep begining state of last frame, to use at rendering)
3. save ()
*/
export class HStatusMgr {
public current = new HStatus()
public lastFrame = new HStatus()
Expand Down
9 changes: 9 additions & 0 deletions src/nes/ppu/ppu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
// PPU scrolling
// https://wiki.nesdev.com/w/index.php/PPU_scrolling

/*
Implementation note:
* Process per scanline, not per PPU cycle
* So not aim to implement accurately
* Register/status changes are put into array with its timing (hcount)
* Replay these events at rendering
*/

import {Const} from '../const'
import {Address, Byte} from '../types'
import {kPaletColors, kStaggered, kFlipXBits} from './const'
Expand Down

0 comments on commit b35d487

Please sign in to comment.