UNPKG

nes-emu

Version:

A NES emulator

22 lines (20 loc) 701 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _registers = require("../../registers"); /** Controls the linear length counter (value and halt flag) of the Triangle channel. */ class TriangleLinearLCL extends _registers.WriteOnlyInMemoryRegister { constructor() { super(); this.addReadOnlyField("lengthCounterLoad", 0, 7).addReadOnlyField("halt", 7, 1); } /** Updates the linear length counter reload value. */ writeAt(__, byte) { this.setValue(byte); const triangle = this.context.apu.channels.triangle; triangle.linearLengthCounter.reload = this.lengthCounterLoad; } } exports.default = TriangleLinearLCL;