Skip to content

Commit

Permalink
#8 Set Value in MemoryReadEventArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
hagronnestad committed Sep 27, 2019
1 parent 570ca06 commit 130399f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Hardware/Memory/MemoryBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ public TValue this[int address] {


public virtual TValue Read(int address) {
var value = _memory[address];

var ea = new MemoryReadEventArgs<TValue>() {
Address = address
Address = address,
Value = value
};
OnRead?.Invoke(this, ea);

return _memory[address];
return value;
}

public virtual void Write(int address, TValue value) {
Expand Down

0 comments on commit 130399f

Please sign in to comment.