| 1 | package com.rox; | |
| 2 | ||
| 3 | import com.rox.debug.memory.MemoryDebugSource; | |
| 4 | import com.rox.debug.memory.MemoryEditor; | |
| 5 | ||
| 6 | import java.util.function.IntUnaryOperator; | |
| 7 | ||
| 8 | /** {@link MemoryDebugSource} over a live {@link NES}: {@link DebugCapture}'s side-effect-free peek, and {@link NES#pokeMemory} edits. */ | |
| 9 | final class NesMemoryDebugSource implements MemoryDebugSource { | |
| 10 | private final NES nes; | |
| 11 | ||
| 12 | NesMemoryDebugSource(final NES nes){ | |
| 13 | this.nes = nes; | |
| 14 | } | |
| 15 | ||
| 16 | /** Over a copy of RAM taken now - one copy per call, not per byte read. */ | |
| 17 | @Override | |
| 18 | public IntUnaryOperator peek(){ | |
| 19 |
1
1. peek : replaced return value with null for com/rox/NesMemoryDebugSource::peek → KILLED |
return DebugCapture.sideEffectFreePeek(nes.ram().snapshot(), nes.cartridge()); |
| 20 | } | |
| 21 | ||
| 22 | @Override | |
| 23 | public boolean isEditable(final int address){ | |
| 24 |
2
1. isEditable : replaced boolean return with false for com/rox/NesMemoryDebugSource::isEditable → KILLED 2. isEditable : replaced boolean return with true for com/rox/NesMemoryDebugSource::isEditable → KILLED |
return MemoryEditor.isEditable(address); |
| 25 | } | |
| 26 | ||
| 27 | @Override | |
| 28 | public void poke(final int address, final int value){ | |
| 29 |
1
1. poke : removed call to com/rox/NES::pokeMemory → KILLED |
nes.pokeMemory(address, value); |
| 30 | } | |
| 31 | } | |
Mutations | ||
| 19 |
1.1 |
|
| 24 |
1.1 2.2 |
|
| 29 |
1.1 |