broken-neees
Version:
A really broken NEEES emulator that introduces glitches and random bugs on purpose!
29 lines (28 loc) • 766 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _LengthCounter = _interopRequireDefault(require("./LengthCounter"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
class LinearLengthCounter extends _LengthCounter.default {
constructor() {
super();
this.reload = 0;
this.reloadFlag = false;
}
fullReset() {
this.reset();
this.reload = 0;
this.reloadFlag = false;
}
clock(isEnabled, isHalted) {
if (!isEnabled) {
this.reset();
return;
}
if (this.reloadFlag) this.counter = this.reload;else super.clock(isEnabled, false);
if (!isHalted) this.reloadFlag = false;
}
}
exports.default = LinearLengthCounter;
;