UNPKG

nes-emu

Version:

A NES emulator

24 lines (22 loc) 603 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _registers = require("../../registers"); /** Controls the output sample of the DMC channel directly. */ class DMCLoad extends _registers.WriteOnlyInMemoryRegister { constructor() { super(); this.addReadOnlyField("directLoad", 0, 7); } /** Writes the DMC Direct Load sample if the channel is active. */ writeAt(__, byte) { this.setValue(byte); const { apu } = this.context; apu.channels.dmc.outputSample = this.directLoad; } } exports.default = DMCLoad;