UNPKG

nes-emu

Version:

A NES emulator

35 lines (31 loc) 904 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _registers = require("../../registers"); /** * PPU Address Register (>> write twice, upper byte first) * * Write the PPU address you want to access here, then write in `PPUData`. * Connected to `LoopyRegister`. */ class PPUAddr extends _registers.WriteOnlyInMemoryRegister { /** Alternately writes the MSB and the LSB of the address, and updates scrolling metadata. */ writeAt(__, byte) { this.context.ppu.loopy.onPPUAddrWrite(byte); } /** Returns the address. */ get address() { return this.context.ppu.loopy.vAddress.to14BitNumber(); } /** Sets the address. */ set address(value) { this.context.ppu.loopy.vAddress.update(value); } /** Returns the write latch. */ get latch() { return this.context.ppu.loopy.latch; } } exports.default = PPUAddr;