// 74xx266 emulation component for the LogicSimulator // Copyright (C) 2022 Sascha Nitsch // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see . // eslint-disable-next-line @typescript-eslint/no-unused-vars function IC74xx266Init() { class IC74xx266 extends DILBase { constructor(simulator: Simulator, id: string, param: BaseComponentParam) { super(simulator, id, 14, param); } setup(canvas: SVGElement) { if (this.simulator.getType() === 'physical') { super.DILBASEsetup('ic14', canvas, '74xx266'); } else { super.DILBASEsetup('ic74xx08', canvas, ''); } } update(): boolean { if (this.startdelay) { --this.startdelay; return false; } if (this.getStateWire('p14') !== WireState.high || this.getStateWire('p7') !== WireState.low) return false; // no power let mod = false; let oldstate; let state; oldstate = this.binary(this.getStateWire('p3'), true); state = this.binary(this.getStateWire('p1'), true) !== this.binary(this.getStateWire('p2'), true); this.getPin('p3').setBool(state); mod ||= state !== oldstate; oldstate = this.binary(this.getStateWire('p4'), true); state = this.binary(this.getStateWire('p5'), true) !== this.binary(this.getStateWire('p6'), true); this.getPin('p4').setBool(state); mod ||= state !== oldstate; oldstate = this.binary(this.getStateWire('p10'), true); state = this.binary(this.getStateWire('p8'), true) !== this.binary(this.getStateWire('p9'), true); this.getPin('p10').setBool(state); mod ||= state !== oldstate; oldstate = this.binary(this.getStateWire('p11'), true); this.binary(this.getStateWire('p12'), true) !== this.binary(this.getStateWire('p13'), true); this.getPin('p11').setBool(state); mod ||= state !== oldstate; return mod; } } window.IC74xx266 = IC74xx266; } // eslint-disable-next-line @typescript-eslint/no-unused-vars function IC74xx266Depends() { return 'dilbase'; }