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

Method writeRegister

nes/ppu.go:220–240  ·  view source on GitHub ↗
(address uint16, value byte)

Source from the content-addressed store, hash-verified

218}
219
220func (ppu *PPU) writeRegister(address uint16, value byte) {
221 ppu.register = value
222 switch address {
223 case 0x2000:
224 ppu.writeControl(value)
225 case 0x2001:
226 ppu.writeMask(value)
227 case 0x2003:
228 ppu.writeOAMAddress(value)
229 case 0x2004:
230 ppu.writeOAMData(value)
231 case 0x2005:
232 ppu.writeScroll(value)
233 case 0x2006:
234 ppu.writeAddress(value)
235 case 0x2007:
236 ppu.writeData(value)
237 case 0x4014:
238 ppu.writeDMA(value)
239 }
240}
241
242// $2000: PPUCTRL
243func (ppu *PPU) writeControl(value byte) {

Callers 1

WriteMethod · 0.45

Calls 8

writeControlMethod · 0.95
writeMaskMethod · 0.95
writeOAMAddressMethod · 0.95
writeOAMDataMethod · 0.95
writeScrollMethod · 0.95
writeAddressMethod · 0.95
writeDataMethod · 0.95
writeDMAMethod · 0.95

Tested by

no test coverage detected