broken-neees
Version:
A really broken NEEES emulator that introduces glitches and random bugs on purpose!
21 lines (20 loc) • 412 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
class LengthCounter {
constructor() {
this.reset();
}
reset() {
this.counter = 0;
}
clock(isEnabled, isHalted) {
if (!isEnabled) this.reset();else if (this.counter > 0 && !isHalted) this.counter--;
}
isActive() {
return this.counter > 0;
}
}
exports.default = LengthCounter;
;