| 1 | package com.rox; | |
| 2 | ||
| 3 | import com.rox.debug.memory.MemoryDebugSource; | |
| 4 | ||
| 5 | import java.util.function.IntUnaryOperator; | |
| 6 | ||
| 7 | /** {@link MemoryDebugSource} over a live {@link NES}, via {@link DebugCapture}'s side-effect-free peek. */ | |
| 8 | final class NesMemoryDebugSource implements MemoryDebugSource { | |
| 9 | private final NES nes; | |
| 10 | ||
| 11 | NesMemoryDebugSource(final NES nes){ | |
| 12 | this.nes = nes; | |
| 13 | } | |
| 14 | ||
| 15 | /** Over a copy of RAM taken now - one copy per call, not per byte read. */ | |
| 16 | @Override | |
| 17 | public IntUnaryOperator peek(){ | |
| 18 |
1
1. peek : replaced return value with null for com/rox/NesMemoryDebugSource::peek → KILLED |
return DebugCapture.sideEffectFreePeek(nes.ram().snapshot(), nes.cartridge()); |
| 19 | } | |
| 20 | } | |
Mutations | ||
| 18 |
1.1 |