X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=plugins%2Fnet.mograsim.machine%2Fsrc%2Fnet%2Fmograsim%2Fmachine%2Fmi%2FStandardMicroInstructionMemory.java;h=c8866fdda977b0f7f16ec2b6eb048ee41e7c5d41;hb=96dd446ab936b4db82d0bd94f90e20442a4d86af;hp=94905a5b86108ad2b44ab57e0127ff01948f3428;hpb=a60db0eb036058aa47c928653da0b504452aa595;p=Mograsim.git diff --git a/plugins/net.mograsim.machine/src/net/mograsim/machine/mi/StandardMicroInstructionMemory.java b/plugins/net.mograsim.machine/src/net/mograsim/machine/mi/StandardMicroInstructionMemory.java index 94905a5b..c8866fdd 100644 --- a/plugins/net.mograsim.machine/src/net/mograsim/machine/mi/StandardMicroInstructionMemory.java +++ b/plugins/net.mograsim.machine/src/net/mograsim/machine/mi/StandardMicroInstructionMemory.java @@ -1,7 +1,6 @@ package net.mograsim.machine.mi; import java.util.HashSet; -import java.util.Set; import net.mograsim.machine.standard.memory.MemoryException; @@ -10,8 +9,6 @@ public class StandardMicroInstructionMemory implements MicroInstructionMemory private MicroInstruction[] data; private MicroInstructionMemoryDefinition definition; private HashSet observers = new HashSet<>(); - private Set activeInstructionListeners = new HashSet<>(); - private long activeInstruction = -1; public StandardMicroInstructionMemory(MicroInstructionMemoryDefinition definition) { @@ -55,42 +52,14 @@ public class StandardMicroInstructionMemory implements MicroInstructionMemory observers.remove(ob); } - @Override - public void registerActiveMicroInstructionChangedListener(ActiveMicroInstructionChangedListener ob) - { - activeInstructionListeners.add(ob); - } - - @Override - public void deregisterActiveMicroInstructionChangedListener(ActiveMicroInstructionChangedListener ob) - { - activeInstructionListeners.remove(ob); - } - private void notifyMemoryChanged(long address) { observers.forEach(ob -> ob.update(address)); } - private void notifyActiveInstructionChanged(long address) - { - activeInstructionListeners.forEach(o -> o.activeMicroInstructionChanged(address)); - } - @Override public MicroInstructionMemoryDefinition getDefinition() { return definition; } - - @Override - public void setActiveInstruction(long address) - { - if (address != activeInstruction) - { - activeInstruction = address; - notifyActiveInstructionChanged(address); - } - } - }