MCPcopy
hub / github.com/fogleman/nes / writeControl

Method writeControl

nes/ppu.go:243–254  ·  view source on GitHub ↗

$2000: PPUCTRL

(value byte)

Source from the content-addressed store, hash-verified

241
242// $2000: PPUCTRL
243func (ppu *PPU) writeControl(value byte) {
244 ppu.flagNameTable = (value >> 0) & 3
245 ppu.flagIncrement = (value >> 2) & 1
246 ppu.flagSpriteTable = (value >> 3) & 1
247 ppu.flagBackgroundTable = (value >> 4) & 1
248 ppu.flagSpriteSize = (value >> 5) & 1
249 ppu.flagMasterSlave = (value >> 6) & 1
250 ppu.nmiOutput = (value>>7)&1 == 1
251 ppu.nmiChange()
252 // t: ....BA.. ........ = d: ......BA
253 ppu.t = (ppu.t & 0xF3FF) | ((uint16(value) & 0x03) << 10)
254}
255
256// $2001: PPUMASK
257func (ppu *PPU) writeMask(value byte) {

Callers 2

ResetMethod · 0.95
writeRegisterMethod · 0.95

Calls 1

nmiChangeMethod · 0.95

Tested by

no test coverage detected