NES.java

1
package com.rox;
2
3
import com.rox.apu.APU;
4
import com.rox.audio.AudioOutput;
5
import com.rox.audio.Resampler;
6
import com.rox.audio.SpeakerAudioOutput;
7
import com.rox.cartridge.Cartridge;
8
import com.rox.clock.Clock;
9
import com.rox.clock.FPSClock;
10
import com.rox.clock.TickRateMonitor;
11
import com.rox.cpu.mos6502.MOS6502;
12
import com.rox.debug.BeamPosition;
13
import com.rox.debug.breakpoints.BreakHit;
14
import com.rox.debug.breakpoints.Breakpoints;
15
import com.rox.debug.cpu.InstructionTrace;
16
import com.rox.debug.memory.MemoryEditor;
17
import com.rox.input.ControllerConfiguration;
18
import com.rox.mem.*;
19
import com.rox.ppu.PPU;
20
import com.rox.save.SystemSnapshot;
21
import com.rox.time.SystemTimeSource;
22
import com.rox.time.ThreadSleeper;
23
import com.rox.video.VideoOutput;
24
25
import javax.sound.sampled.LineUnavailableException;
26
import java.util.Map;
27
import java.util.Optional;
28
import java.util.concurrent.CountDownLatch;
29
import java.util.zip.CRC32;
30
31
public class NES {
32
    /** Where a {@link #pause(PauseAt)} stops. Either way the CPU is left between instructions. */
33
    public enum PauseAt {
34
        /** As soon as the instruction in progress finishes. */
35
        NEXT_INSTRUCTION,
36
        /** Once the frame being drawn is presented (as {@link #stepFrame()}), so the state matches the picture. */
37
        END_OF_FRAME
38
    }
39
40
    private static final long CPU_HZ = 1_789_773;
41
    /**
42
     * Far beyond any real instruction (7 cycles max, plus a 514-cycle OAM DMA stall and a 7-cycle
43
     * interrupt entry) - only reached if the CPU somehow never finishes, which would otherwise hang the
44
     * UI thread that asked for the step.
45
     */
46
    static final int MAX_CYCLES_PER_STEPPED_INSTRUCTION = 10_000;
47
    /** Over three NTSC frames (29,780.5 CPU cycles each) - only reached if the PPU somehow stops finishing frames. */
48
    static final int MAX_CYCLES_PER_STEPPED_FRAME = 100_000;
49
    /** The NES's 2KB of CPU RAM - NESMemoryBus mirrors it across $0000-$1FFF. */
50
    private static final int CPU_RAM_SIZE = NESMemoryBus.CPU_RAM_MIRROR_MASK + 1;
51
    private static final long AUDIO_SAMPLE_RATE_HZ = 44_100;
52
    /** The slowest and fastest {@link #setSpeed} allows. */
53
    public static final double MIN_SPEED = 0.25;
54
    public static final double MAX_SPEED = 4;
55
    /**
56
     * Gives the JVM's JIT time to compile the emulation's hot per-cycle tick loop, and lets the ring buffer build
57
     * up a cushion, before audio playback (and thus underrun risk) begins. See {@link SpeakerAudioOutput} class doc
58
     * for why draining starts empty otherwise
59
     */
60
    private static final long AUDIO_WARM_UP_MILLIS = 300;
61
62
    private final MOS6502 cpu;
63
    private final APU apu;
64
    private final PPU ppu;
65
    private final Clock clock;
66
    private final LatchedMemoryBus memoryBus;
67
    private final AudioOutput audioOutput;
68
    private final RAM ram;
69
    private final Cartridge cartridge;
70
    private final TickRateMonitor tickRateMonitor;
71
    private final MemoryEditor memoryEditor;
72
    private final InstructionTrace instructionTrace;
73
    private final Breakpoints breakpoints = new Breakpoints();
74
    private final Resampler resampler;
75
    private final VideoOutput videoOutput;
76
    private final ControllerConfiguration controllers;
77
    /** set only once pause() has genuinely parked the clock - the precondition for capturing/restoring state while powered on (see captureSnapshot()) */
78
    private volatile boolean paused;
79
    /** every frame handed to videoOutput - what stepFrame() watches for */
80
    private volatile long framesPresented;
81
    /** set by {@link #powerOff()}, so {@link #powerOn()} skips warm-up and audio once a shutdown is asked for */
82
    private volatile boolean stopRequested;
83
    /** See {@link #setSpeed}. */
84
    private volatile double speed = 1;
85
    /** The speed the audio resampler is set for - clock thread only, caught up with {@link #speed} once a frame. */
86
    private double audioSpeed = 1;
87
    /** guards {@link #powerOn()}'s setup and audio start against {@link #powerOff()} */
88
    private final Object lifecycleLock = new Object();
89
    /** The clock's {@code run()} thread while powered on. */
90
    private volatile Thread clockThread;
91
    /** Whoever is ticking: {@link #clockThread}, or a thread ticking by hand (a step, a pause finishing an instruction). */
92
    private volatile Thread tickingThread;
93
    /** A {@link #pause(PauseAt)} asked for from inside a tick, waiting for its stopping point - ticking thread only. */
94
    private PauseAt pendingPause;
95
    /** A {@link #pendingPause} has stopped the ticks being run by hand - ticking thread only. */
96
    private boolean handTicksPaused;
97
    /** What the last {@link #breakpoints} stop was, until {@link #resume()}. */
98
    private volatile BreakHit lastHit;
99
100
    public NES(final Cartridge cartridge) throws LineUnavailableException {
101
        this(new SpeakerAudioOutput(), VideoOutput.NO_OP, ControllerConfiguration.NONE, cartridge);
102
    }
103
104
    /** Like {@link #NES(Cartridge)}, but presenting frames to {@code videoOutput} as they complete. */
105
    public NES(final VideoOutput videoOutput, final Cartridge cartridge) throws LineUnavailableException {
106
        this(new SpeakerAudioOutput(), videoOutput, ControllerConfiguration.NONE, cartridge);
107
    }
108
109
    /** Like {@link #NES(VideoOutput, Cartridge)}, but driven by {@code controllers} rather than {@link ControllerConfiguration#NONE}. */
110
    public NES(final VideoOutput videoOutput, final ControllerConfiguration controllers, final Cartridge cartridge) throws LineUnavailableException {
111
        this(new SpeakerAudioOutput(), videoOutput, controllers, cartridge);
112
    }
113
114
    NES(final AudioOutput audioOutput, final Cartridge cartridge){
115
        this(audioOutput, VideoOutput.NO_OP, ControllerConfiguration.NONE, cartridge);
116
    }
117
118
    NES(final AudioOutput audioOutput, final VideoOutput videoOutput, final Cartridge cartridge){
119
        this(audioOutput, videoOutput, ControllerConfiguration.NONE, cartridge);
120
    }
121
122
    NES(final AudioOutput audioOutput, final VideoOutput videoOutput, final ControllerConfiguration controllers, final Cartridge cartridge){
123
        this(audioOutput, videoOutput, controllers, cartridge, new FPSClock(CPU_HZ, 60, new SystemTimeSource(), new ThreadSleeper()));
124
    }
125
126
    /** Test-only entry point for injecting a fake {@link Clock} - see {@code NESTest}'s race-reproducing double. */
127
    NES(final AudioOutput audioOutput, final Cartridge cartridge, final Clock clock){
128
        this(audioOutput, VideoOutput.NO_OP, cartridge, clock);
129
    }
130
131
    /** Test-only entry point for injecting both a fake {@link Clock} and a mocked {@link VideoOutput}. */
132
    NES(final AudioOutput audioOutput, final VideoOutput videoOutput, final Cartridge cartridge, final Clock clock){
133
        this(audioOutput, videoOutput, ControllerConfiguration.NONE, cartridge, clock);
134
    }
135
136
    /** Test-only entry point for injecting a fake {@link Clock} alongside a real {@link ControllerConfiguration}. */
137
    NES(final AudioOutput audioOutput, final VideoOutput videoOutput, final ControllerConfiguration controllers,
138
        final Cartridge cartridge, final Clock clock){
139
        this.ram = new RAM(CPU_RAM_SIZE);
140
        this.cartridge = cartridge;
141
        final MemoryBus ramBus = new MemoryBus8Bit(ram);
142
        //DMC's own sample-address generator (see DMCChannel) only ever produces addresses in
143
        //$8000-$FFFF (base $C000+, wrapping no lower than $8000) - always within cartridge range,
144
        //so the cartridge alone is a complete, correct DMA source with no need to route through
145
        //NESMemoryBus (which would need apu itself to construct, a circular dependency)
146
        this.apu = new APU(cartridge);
147
        this.ppu = new PPU(cartridge);
148
        this.memoryBus = new Latched8BitMemoryBus(new WatchedMemoryBus(new NESMemoryBus(ramBus, apu, cartridge, ppu, controllers),
149
                breakpoints::recordAccess));
150 2 1. <init> : removed call to com/rox/debug/breakpoints/Breakpoints::beam → KILLED
2. lambda$new$0 : replaced return value with null for com/rox/NES::lambda$new$0 → KILLED
        breakpoints.beam(() -> new BeamPosition(ppu.scanline(), ppu.dot()));
151
        this.cpu = new MOS6502(memoryBus);
152
        this.tickRateMonitor = new TickRateMonitor(new SystemTimeSource());
153
        this.memoryEditor = new MemoryEditor(ram::write, cartridge::writePrgRamWithoutSaving);
154
        this.instructionTrace = new InstructionTrace(cpu::isAtInstructionBoundary, cpu::programCounter,
155
                DebugCapture.sideEffectFreePeek(ram::read, cartridge), cpu::packedRegisters, cpu::packedFlags,
156
                InstructionTrace.DEFAULT_CAPACITY);
157
        this.clock = clock;
158
        this.audioOutput = audioOutput;
159
160
        this.resampler = new Resampler(CPU_HZ, AUDIO_SAMPLE_RATE_HZ);
161
        this.videoOutput = videoOutput;
162
        this.controllers = controllers;
163
        //one listener doing every component's work in a fixed order (see tick()), rather than one listener
164
        //per component: the clock's dispatch then sees a single type, so the JIT can inline the whole cycle
165 1 1. <init> : removed call to com/rox/clock/Clock::addListener → KILLED
        clock.addListener(this::tick);
166
    }
167
168
    /**
169
     * One CPU cycle of the whole machine, in an order that matters - each step sees the ones before it this
170
     * cycle.
171
     */
172
    private void tick(){
173 1 1. tick : removed call to com/rox/clock/TickRateMonitor::tick → KILLED
        tickRateMonitor.tick();
174 1 1. tick : removed call to com/rox/cpu/mos6502/MOS6502::tick → KILLED
        cpu.tick();
175
        //right after the CPU, so a locked byte is back at its value before anything else sees the tick's state
176 1 1. tick : removed call to com/rox/debug/memory/MemoryEditor::tick → KILLED
        memoryEditor.tick();
177 1 1. tick : removed call to com/rox/apu/APU::tick → KILLED
        apu.tick();
178 1 1. tick : removed call to com/rox/ppu/PPU::tick → KILLED
        ppu.tick();
179 3 1. tick : removed call to com/rox/cpu/mos6502/MOS6502::setIRQLine → KILLED
2. tick : negated conditional → KILLED
3. tick : negated conditional → KILLED
        cpu.setIRQLine(apu.isIrqAsserted() || cartridge.isIrqAsserted());
180 1 1. tick : negated conditional → KILLED
        if (ppu.consumeNmiEdge()){
181 1 1. tick : removed call to com/rox/cpu/mos6502/MOS6502::signalNMI → KILLED
            cpu.signalNMI();
182
        }
183
        final int stallCycles = ppu.consumeOamDmaStallCycles();
184 2 1. tick : changed conditional boundary → SURVIVED
2. tick : negated conditional → KILLED
        if (stallCycles > 0){
185 1 1. tick : removed call to com/rox/cpu/mos6502/MOS6502::stall → KILLED
            cpu.stall(stallCycles);
186
        }
187
        //after the OAM DMA stall above, so a stall starting this tick holds recording back rather than the
188
        //same instruction being recorded twice - see InstructionTrace's class doc
189 1 1. tick : removed call to com/rox/debug/cpu/InstructionTrace::tick → KILLED
        instructionTrace.tick();
190
        final Optional<BreakHit> hit = breakpoints.check(cpu.isAtInstructionBoundary(), cpu.programCounter());
191 1 1. tick : negated conditional → KILLED
        if (hit.isPresent()){
192
            lastHit = hit.get();
193
            pause(PauseAt.NEXT_INSTRUCTION);
194
        }
195 1 1. tick : negated conditional → KILLED
        if (resampler.add(apu.outputSample())){
196 1 1. tick : removed call to com/rox/audio/AudioOutput::write → KILLED
            audioOutput.write(resampler.output());
197
        }
198
        //polling the (possibly real, physical) gamepads is folded into this same frame-ready gate -
199
        //PPU.consumeFrameReady() is a one-shot flag (it resets itself the moment it's read true), so
200
        //checking it a second time would simply never see true
201
        final boolean framePresented = ppu.consumeFrameReady();
202 1 1. tick : negated conditional → KILLED
        if (framePresented){
203 1 1. tick : Replaced long addition with subtraction → KILLED
            framesPresented++;
204 1 1. tick : negated conditional → KILLED
            if (audioSpeed != speed){
205
                //speed x as many CPU cycles a real second, still 44.1kHz out: the sound speeds up and pitches up with
206
                //the game, and the audio buffer fills exactly as fast as it drains
207
                audioSpeed = speed;
208 2 1. tick : Replaced double multiplication with division → KILLED
2. tick : removed call to com/rox/audio/Resampler::setInputRate → KILLED
                resampler.setInputRate(Math.round(audioSpeed * CPU_HZ));
209
            }
210 1 1. tick : removed call to com/rox/video/VideoOutput::present → KILLED
            videoOutput.present(ppu.rgbFramebuffer());
211 1 1. tick : removed call to com/rox/input/Controller::poll → KILLED
            controllers.player1().poll();
212 1 1. tick : removed call to com/rox/input/Controller::poll → KILLED
            controllers.player2().poll();
213 1 1. tick : removed call to com/rox/input/Controller::poll → KILLED
            controllers.player3().poll();
214 1 1. tick : removed call to com/rox/input/Controller::poll → KILLED
            controllers.player4().poll();
215
        }
216
        //last: once the clock is asked to park, nothing here runs again until it's resumed
217 1 1. tick : negated conditional → KILLED
        if (pendingPause != null){
218 1 1. tick : removed call to com/rox/NES::pauseIfStoppingPointReached → KILLED
            pauseIfStoppingPointReached(framePresented);
219
        }
220
    }
221
222
    private void pauseIfStoppingPointReached(final boolean framePresented){
223 2 1. pauseIfStoppingPointReached : negated conditional → KILLED
2. pauseIfStoppingPointReached : negated conditional → KILLED
        if (pendingPause == PauseAt.END_OF_FRAME && framePresented){
224
            pendingPause = PauseAt.NEXT_INSTRUCTION;
225
        }
226 2 1. pauseIfStoppingPointReached : negated conditional → KILLED
2. pauseIfStoppingPointReached : negated conditional → KILLED
        if (pendingPause == PauseAt.NEXT_INSTRUCTION && cpu.isAtInstructionBoundary()){
227
            pendingPause = null;
228 1 1. pauseIfStoppingPointReached : negated conditional → KILLED
            if (Thread.currentThread() == clockThread){
229 1 1. pauseIfStoppingPointReached : removed call to com/rox/clock/Clock::requestPause → KILLED
                clock.requestPause();
230 1 1. pauseIfStoppingPointReached : removed call to com/rox/NES::markPaused → TIMED_OUT
                markPaused();
231
            } else {
232
                handTicksPaused = true;
233
            }
234
        }
235
    }
236
237
    public void powerOn(){
238
        //signalled once the clock thread is executing, so a slow thread start can't eat into the warm-up
239
        final CountDownLatch clockStarted = new CountDownLatch(1);
240
        final Thread clockThread = new Thread(() -> {
241 1 1. lambda$powerOn$0 : removed call to java/util/concurrent/CountDownLatch::countDown → TIMED_OUT
            clockStarted.countDown();
242 1 1. lambda$powerOn$0 : removed call to com/rox/clock/Clock::run → KILLED
            clock.run();
243
        });
244
        synchronized (lifecycleLock){
245 1 1. powerOn : removed call to com/rox/cpu/mos6502/MOS6502::reset → KILLED
            cpu.reset();
246
            stopRequested = false;
247
            pendingPause = null;
248
            this.clockThread = clockThread;
249
            tickingThread = clockThread;
250 1 1. powerOn : removed call to com/rox/clock/Clock::prepareToRun → TIMED_OUT
            clock.prepareToRun(); //a stop() from here on ends the run, even one landing before run() starts
251 1 1. powerOn : removed call to java/lang/Thread::start → TIMED_OUT
            clockThread.start();
252
        }
253
254
        boolean interrupted = false;
255
        try {
256 1 1. powerOn : removed call to java/util/concurrent/CountDownLatch::await → KILLED
            clockStarted.await();
257 1 1. powerOn : negated conditional → KILLED
            if (!stopRequested){
258 1 1. powerOn : removed call to java/lang/Thread::sleep → KILLED
                Thread.sleep(AUDIO_WARM_UP_MILLIS);
259
            }
260
        } catch (InterruptedException e){
261
            interrupted = true;
262
        }
263
        synchronized (lifecycleLock){
264
            //under the lock, so a powerOff() can't land between this check and start() and leave audio on
265 2 1. powerOn : negated conditional → KILLED
2. powerOn : negated conditional → KILLED
            if (!interrupted && !stopRequested){
266 1 1. powerOn : removed call to com/rox/audio/AudioOutput::start → KILLED
                audioOutput.start();
267
            }
268
        }
269
270 1 1. powerOn : negated conditional → TIMED_OUT
        if (interrupted){
271 1 1. powerOn : removed call to com/rox/clock/Clock::stop → TIMED_OUT
            clock.stop();
272
        }
273
        //retry join() until the thread has genuinely terminated - a single interrupted join() would
274
        //otherwise return early without actually waiting, silently leaving the clock thread running
275 1 1. powerOn : negated conditional → TIMED_OUT
        while (clockThread.isAlive()){
276
            try {
277 1 1. powerOn : removed call to java/lang/Thread::join → TIMED_OUT
                clockThread.join();
278
            } catch (InterruptedException e){
279
                //an interrupt caught only here (audio already started) must still stop the clock - nothing else will
280
                interrupted = true;
281 1 1. powerOn : removed call to com/rox/clock/Clock::stop → TIMED_OUT
                clock.stop();
282
            }
283
        }
284
        this.clockThread = null;
285
        tickingThread = null;
286
        //standard practice even though nothing in this method (or its callers) observes the flag
287
        //afterward - powerOn() returns right after this, so this is an accepted, unobservable pitest
288
        //survivor rather than something worth chasing a test for
289 1 1. powerOn : negated conditional → SURVIVED
        if (interrupted){
290 1 1. powerOn : removed call to java/lang/Thread::interrupt → SURVIVED
            Thread.currentThread().interrupt();
291
        }
292
    }
293
294
    /** {@link #pause(PauseAt)} at the {@link PauseAt#NEXT_INSTRUCTION next instruction}. */
295
    public boolean pause(){
296 2 1. pause : replaced boolean return with true for com/rox/NES::pause → KILLED
2. pause : replaced boolean return with false for com/rox/NES::pause → KILLED
        return pause(PauseAt.NEXT_INSTRUCTION);
297
    }
298
299
    /**
300
     * Freezes a running emulation without resetting or tearing anything down, with the CPU between
301
     * instructions - so its state is fully captured for as long as the pause lasts - and audio silenced.
302
     * {@link #resume()} carries on from exactly there.
303
     * <ul>
304
     *     <li><b>from another thread</b>: the clock parks after the tick in progress, then this thread ticks on to
305
     *     {@code where}, returning once paused.</li>
306
     *     <li><b>from inside a tick</b> (e.g. a breakpoint): can't wait for itself, so returns straight away; the
307
     *     ticking stops at {@code where} - the clock parks, or a step ends there.</li>
308
     * </ul>
309
     *
310
     * @return false if there was nothing running to pause
311
     */
312
    public boolean pause(final PauseAt where){
313 1 1. pause : negated conditional → KILLED
        if (Thread.currentThread() == tickingThread){
314
            pendingPause = where;
315 1 1. pause : replaced boolean return with false for com/rox/NES::pause → KILLED
            return true;
316
        }
317 1 1. pause : negated conditional → KILLED
        if (!clock.pause()){
318 1 1. pause : replaced boolean return with true for com/rox/NES::pause → KILLED
            return false;
319
        }
320
        //safe to tick from this thread: a true pause() guarantees the clock thread is parked
321 1 1. pause : removed call to com/rox/NES::tickByHand → KILLED
        tickByHand(() -> {
322 1 1. lambda$pause$0 : negated conditional → KILLED
            if (where == PauseAt.END_OF_FRAME){
323
                tickUntilFramePresented(MAX_CYCLES_PER_STEPPED_FRAME);
324
            }
325 1 1. lambda$pause$0 : removed call to com/rox/NES::finishInFlightInstruction → KILLED
            finishInFlightInstruction();
326
        });
327 1 1. pause : removed call to com/rox/NES::markPaused → KILLED
        markPaused();
328 1 1. pause : replaced boolean return with false for com/rox/NES::pause → KILLED
        return true;
329
    }
330
331
    private void markPaused(){
332 1 1. markPaused : removed call to com/rox/audio/AudioOutput::pause → KILLED
        audioOutput.pause();
333
        paused = true;
334
    }
335
336
    /**
337
     * Runs the emulation {@code multiplier} times faster (or slower) than a real NES - frames paced now, audio
338
     * retuned from the next frame so it pitches with the game.
339
     *
340
     * @throws IllegalArgumentException unless {@code multiplier} is between {@link #MIN_SPEED} and {@link #MAX_SPEED}
341
     */
342
    public void setSpeed(final double multiplier){
343 4 1. setSpeed : changed conditional boundary → KILLED
2. setSpeed : negated conditional → KILLED
3. setSpeed : changed conditional boundary → KILLED
4. setSpeed : negated conditional → KILLED
        if (!(multiplier >= MIN_SPEED && multiplier <= MAX_SPEED)){
344
            throw new IllegalArgumentException("Speed must be " + MIN_SPEED + "-" + MAX_SPEED + "x, got " + multiplier);
345
        }
346 1 1. setSpeed : removed call to com/rox/clock/Clock::setSpeed → KILLED
        clock.setSpeed(multiplier);
347
        speed = multiplier;
348
    }
349
350
    public double speed(){
351 1 1. speed : replaced double return with 0.0d for com/rox/NES::speed → KILLED
        return speed;
352
    }
353
354
    /** True from a successful {@link #pause()} until {@link #resume()}. */
355
    public boolean isPaused(){
356 2 1. isPaused : replaced boolean return with false for com/rox/NES::isPaused → TIMED_OUT
2. isPaused : replaced boolean return with true for com/rox/NES::isPaused → KILLED
        return paused;
357
    }
358
359
    /** Carry on after a {@link #pause()}; does nothing if not paused. */
360
    public void resume(){
361
        lastHit = null;
362
        paused = false;
363 1 1. resume : removed call to com/rox/audio/AudioOutput::resume → KILLED
        audioOutput.resume();
364 1 1. resume : removed call to com/rox/clock/Clock::resume → KILLED
        clock.resume();
365
    }
366
367
    /**
368
     * The whole system's state, for a save state or debug capture. Only while {@link #pause()}d (or
369
     * before/after the clock runs at all) - otherwise the clock thread would be changing it mid-copy.
370
     * A clock that simply stopped (e.g. after {@link #powerOff()}) can leave the CPU part-way through an
371
     * instruction, unlike a pause; that instruction is finished first, so this may advance the system
372
     * by a few cycles.
373
     *
374
     * <p>Not captured: controller shift registers (a pause landing mid-controller-read could misread
375
     * one frame of input after a restore), and the audio resampler's fractional position.
376
     *
377
     * @throws IllegalStateException if the clock is running and not paused
378
     */
379
    public SystemSnapshot captureSnapshot(){
380 1 1. captureSnapshot : removed call to com/rox/NES::requireNothingTicking → KILLED
        requireNothingTicking();
381 1 1. captureSnapshot : removed call to com/rox/NES::tickByHand → KILLED
        tickByHand(this::finishInFlightInstruction);
382 1 1. captureSnapshot : replaced return value with null for com/rox/NES::captureSnapshot → KILLED
        return new SystemSnapshot(romCrc32(cartridge), cpu.snapshot(), ppu.snapshot(), apu.snapshot(), ram.snapshot(),
383
                cartridge.snapshot());
384
    }
385
386
    /**
387
     * Puts the whole system back as {@code snapshot} captured it. Same "paused or not running"
388
     * precondition as {@link #captureSnapshot()}.
389
     *
390
     * @throws IllegalStateException if the clock is running and not paused
391
     * @throws IllegalArgumentException if {@code snapshot} was taken with a different cartridge, or any of
392
     * its parts is the wrong shape - checked up front, so a rejected snapshot changes nothing
393
     */
394
    public void restoreSnapshot(final SystemSnapshot snapshot){
395 1 1. restoreSnapshot : removed call to com/rox/NES::requireNothingTicking → KILLED
        requireNothingTicking();
396 1 1. restoreSnapshot : negated conditional → KILLED
        if (snapshot.romCrc32() != romCrc32(cartridge)){
397
            throw new IllegalArgumentException("Snapshot was taken with a different cartridge");
398
        }
399
        //every component that can reject a malformed snapshot (array sizes, mapper type) is checked before
400
        //any is restored - a CRC-valid save file can still decode to the wrong shapes, and stopping
401
        //part-way would leave a mix of old and restored state. The APU and CPU snapshots are plain
402
        //values with nothing to reject.
403 1 1. restoreSnapshot : removed call to com/rox/cartridge/Cartridge::checkRestorable → SURVIVED
        cartridge.checkRestorable(snapshot.mapper());
404 1 1. restoreSnapshot : removed call to com/rox/mem/RAM::checkRestorable → KILLED
        ram.checkRestorable(snapshot.ram());
405 1 1. restoreSnapshot : removed call to com/rox/ppu/PPU::checkRestorable → KILLED
        ppu.checkRestorable(snapshot.ppu());
406 1 1. restoreSnapshot : removed call to com/rox/cartridge/Cartridge::restore → KILLED
        cartridge.restore(snapshot.mapper());
407 1 1. restoreSnapshot : removed call to com/rox/mem/RAM::restore → KILLED
        ram.restore(snapshot.ram());
408 1 1. restoreSnapshot : removed call to com/rox/ppu/PPU::restore → KILLED
        ppu.restore(snapshot.ppu());
409 1 1. restoreSnapshot : removed call to com/rox/apu/APU::restore → KILLED
        apu.restore(snapshot.apu());
410 1 1. restoreSnapshot : removed call to com/rox/cpu/mos6502/MOS6502::restore → KILLED
        cpu.restore(snapshot.cpu());
411
    }
412
413
    /** Ticks until the CPU is between instructions - callers must already know nothing else is ticking. */
414
    /**
415
     * Runs exactly one instruction - from wherever the CPU is, to the next instruction boundary (so a
416
     * part-finished instruction is just finished). An OAM DMA stall or interrupt entry that follows is
417
     * part of the same step. Only while {@link #pause()}d (or with the clock not running), like
418
     * {@link #captureSnapshot()}.
419
     *
420
     * @throws IllegalStateException if the clock is running and not paused, or the CPU doesn't reach an
421
     * instruction boundary within {@link #MAX_CYCLES_PER_STEPPED_INSTRUCTION} cycles
422
     */
423
    public void stepInstruction(){
424 1 1. stepInstruction : removed call to com/rox/NES::requireNothingTicking → KILLED
        requireNothingTicking();
425 1 1. stepInstruction : removed call to com/rox/NES::tickByHand → KILLED
        tickByHand(() -> {
426
            int cycles = 0;
427
            do {
428 2 1. lambda$stepInstruction$0 : Changed increment from 1 to -1 → KILLED
2. lambda$stepInstruction$0 : negated conditional → KILLED
                if (cycles++ == MAX_CYCLES_PER_STEPPED_INSTRUCTION){
429
                    throw new IllegalStateException("CPU didn't finish an instruction within "
430
                            + MAX_CYCLES_PER_STEPPED_INSTRUCTION + " cycles");
431
                }
432 1 1. lambda$stepInstruction$0 : removed call to com/rox/clock/Clock::tick → KILLED
                clock.tick();
433 1 1. lambda$stepInstruction$0 : negated conditional → KILLED
            } while (!cpu.isAtInstructionBoundary());
434
        });
435
    }
436
437
    /**
438
     * Runs exactly {@code cycles} CPU cycles - which can leave the CPU part-way through an instruction -
439
     * or fewer, if a breakpoint (or any {@link #pause(PauseAt)} from inside a tick) stops it first.
440
     * Same "paused or not running" precondition as {@link #stepInstruction()}.
441
     *
442
     * @throws IllegalArgumentException if {@code cycles} isn't positive
443
     */
444
    public void stepCycles(final int cycles){
445 1 1. stepCycles : removed call to com/rox/NES::requireNothingTicking → KILLED
        requireNothingTicking();
446 2 1. stepCycles : changed conditional boundary → KILLED
2. stepCycles : negated conditional → KILLED
        if (cycles < 1){
447
            throw new IllegalArgumentException("Step at least one cycle, not " + cycles);
448
        }
449 1 1. stepCycles : removed call to com/rox/NES::tickByHand → KILLED
        tickByHand(() -> {
450 3 1. lambda$stepCycles$0 : negated conditional → KILLED
2. lambda$stepCycles$0 : negated conditional → KILLED
3. lambda$stepCycles$0 : changed conditional boundary → KILLED
            for (int i = 0; i < cycles && !handTicksPaused; i++){
451 1 1. lambda$stepCycles$0 : removed call to com/rox/clock/Clock::tick → KILLED
                clock.tick();
452
            }
453
        });
454
    }
455
456
    /**
457
     * Runs until the next frame is finished and presented (the start of vertical blanking), then
458
     * finishes the instruction in progress - so each step shows exactly one new frame and stops at the
459
     * same point in it. A fixed cycle count can't do that: an NTSC frame is 29,780.5 CPU cycles. Stops
460
     * sooner at a breakpoint (or any {@link #pause(PauseAt)} from inside a tick). Same "paused or not running"
461
     * precondition as {@link #stepInstruction()}.
462
     *
463
     * @throws IllegalStateException if the clock is running and not paused, or no frame finishes within
464
     * {@link #MAX_CYCLES_PER_STEPPED_FRAME} cycles
465
     */
466
    public void stepFrame(){
467 1 1. stepFrame : removed call to com/rox/NES::stepFrame → KILLED
        stepFrame(MAX_CYCLES_PER_STEPPED_FRAME);
468
    }
469
470
    /** {@link #stepFrame()} with a given cap - a test seam, since a real PPU always finishes a frame well inside the real one. */
471
    void stepFrame(final int maxCycles){
472 1 1. stepFrame : removed call to com/rox/NES::requireNothingTicking → KILLED
        requireNothingTicking();
473 1 1. stepFrame : removed call to com/rox/NES::tickByHand → KILLED
        tickByHand(() -> {
474 2 1. lambda$stepFrame$0 : negated conditional → KILLED
2. lambda$stepFrame$0 : negated conditional → KILLED
            if (!tickUntilFramePresented(maxCycles) && !handTicksPaused){
475
                throw new IllegalStateException("No frame finished within " + maxCycles + " cycles");
476
            }
477 1 1. lambda$stepFrame$0 : removed call to com/rox/NES::finishInFlightInstruction → KILLED
            finishInFlightInstruction();
478
        });
479
    }
480
481
    /**
482
     * Runs {@code ticks} on this thread, as the {@link #tickingThread} - so a {@link #pause(PauseAt)} from inside
483
     * them stops them rather than waiting on itself.
484
     */
485
    private void tickByHand(final Runnable ticks){
486
        final Thread previous = tickingThread;
487
        tickingThread = Thread.currentThread();
488
        handTicksPaused = false;
489
        try {
490 1 1. tickByHand : removed call to java/lang/Runnable::run → KILLED
            ticks.run();
491
        } finally {
492
            pendingPause = null; //not reached, but the ticking that asked for it has stopped anyway
493
            tickingThread = previous;
494
        }
495
    }
496
497
    /** @return false if no frame was presented within {@code maxCycles}, or a pause stopped the ticks first */
498
    private boolean tickUntilFramePresented(final int maxCycles){
499
        final long startingFrame = framesPresented;
500
        int cycles = 0;
501 2 1. tickUntilFramePresented : changed conditional boundary → KILLED
2. tickUntilFramePresented : negated conditional → KILLED
        while (framesPresented <= startingFrame){
502 3 1. tickUntilFramePresented : negated conditional → KILLED
2. tickUntilFramePresented : Changed increment from 1 to -1 → KILLED
3. tickUntilFramePresented : negated conditional → KILLED
            if (cycles++ == maxCycles || handTicksPaused){
503 1 1. tickUntilFramePresented : replaced boolean return with true for com/rox/NES::tickUntilFramePresented → KILLED
                return false;
504
            }
505 1 1. tickUntilFramePresented : removed call to com/rox/clock/Clock::tick → KILLED
            clock.tick();
506
        }
507 1 1. tickUntilFramePresented : replaced boolean return with false for com/rox/NES::tickUntilFramePresented → KILLED
        return true;
508
    }
509
510
    private void finishInFlightInstruction(){
511 1 1. finishInFlightInstruction : negated conditional → KILLED
        while (!cpu.isAtInstructionBoundary()){
512 1 1. finishInFlightInstruction : removed call to com/rox/clock/Clock::tick → TIMED_OUT
            clock.tick();
513
        }
514
    }
515
516
    /**
517
     * A debugging edit: sets one byte of CPU RAM ({@code $0000-$1FFF}, mirrored) or PRG-RAM
518
     * ({@code $6000-$7FFF}) any time. A PRG-RAM edit doesn't trigger a battery save.
519
     * <ul>
520
     *     <li><b>running?</b>: applied by the clock thread at its next tick, never written from this thread into memory the emulation is using.</li>
521
     *     <li><b>paused/not running?</b>: applied now!</li>
522
     * </ul>
523
     * 
524
     * @throws IllegalArgumentException for any other address, or a value outside 0-255
525
     */
526
    public void pokeMemory(final int address, final int value){
527 1 1. pokeMemory : negated conditional → KILLED
        if (nothingTicking()){
528 1 1. pokeMemory : removed call to com/rox/debug/memory/MemoryEditor::write → KILLED
            memoryEditor.write(address, value);
529
        } else {
530 1 1. pokeMemory : removed call to com/rox/debug/memory/MemoryEditor::queue → KILLED
            memoryEditor.queue(address, value);
531
        }
532
    }
533
534
    /**
535
     * Holds a byte at {@code value} - set now (as {@link #pokeMemory}), then re-applied every tick, so
536
     * whatever the game writes there doesn't stick - until {@link #unlockMemory}.
537
     *
538
     * @throws IllegalArgumentException as {@link #pokeMemory}
539
     */
540
    public void lockMemory(final int address, final int value){
541 1 1. lockMemory : removed call to com/rox/debug/memory/MemoryEditor::lock → KILLED
        memoryEditor.lock(address, value);
542 1 1. lockMemory : removed call to com/rox/NES::pokeMemory → KILLED
        pokeMemory(address, value);
543
    }
544
545
    public void unlockMemory(final int address){
546 1 1. unlockMemory : removed call to com/rox/debug/memory/MemoryEditor::unlock → KILLED
        memoryEditor.unlock(address);
547
    }
548
549
    /** Where the emulation stops, by PC or by memory access - editable any time, from any thread. */
550
    public Breakpoints breakpoints(){
551 1 1. breakpoints : replaced return value with null for com/rox/NES::breakpoints → KILLED
        return breakpoints;
552
    }
553
554
    /** What stopped the emulation - or a step - last, until {@link #resume()}. */
555
    public Optional<BreakHit> lastHit(){
556 1 1. lastHit : replaced return value with Optional.empty for com/rox/NES::lastHit → KILLED
        return Optional.ofNullable(lastHit);
557
    }
558
559
    /** Locked bytes, address to value, in address order (RAM by its real {@code $0000-$07FF} address). */
560
    public Map<Integer, Integer> lockedMemory(){
561 1 1. lockedMemory : replaced return value with Collections.emptyMap for com/rox/NES::lockedMemory → KILLED
        return memoryEditor.locks();
562
    }
563
564
    private boolean nothingTicking(){
565 3 1. nothingTicking : negated conditional → KILLED
2. nothingTicking : replaced boolean return with true for com/rox/NES::nothingTicking → KILLED
3. nothingTicking : negated conditional → KILLED
        return !clock.isRunning() || paused;
566
    }
567
568
    private void requireNothingTicking(){
569 1 1. requireNothingTicking : negated conditional → KILLED
        if (!nothingTicking()){
570
            throw new IllegalStateException("Pause the NES before capturing, restoring or stepping it");
571
        }
572
    }
573
574
    /** Identifies a cartridge's ROM (PRG then CHR) - what {@link SystemSnapshot#romCrc32()} is checked against. */
575
    private static long romCrc32(final Cartridge cartridge){
576
        final CRC32 crc = new CRC32();
577 1 1. romCrc32 : removed call to java/util/zip/CRC32::update → KILLED
        crc.update(cartridge.rom().prgRom());
578 1 1. romCrc32 : removed call to java/util/zip/CRC32::update → KILLED
        crc.update(cartridge.rom().chrRom());
579 1 1. romCrc32 : replaced long return with 0 for com/rox/NES::romCrc32 → KILLED
        return crc.getValue();
580
    }
581
582
    /**
583
     * Stops the emulation for good. Returns only once nothing can tick any more - even when called while
584
     * {@link #powerOn()} is still starting the clock - so {@link #pokeMemory}, {@link #captureSnapshot} or a
585
     * step can then act from this thread safely.
586
     */
587
    public void powerOff(){
588
        synchronized (lifecycleLock){
589
            stopRequested = true;
590 1 1. powerOff : removed call to com/rox/clock/Clock::stopAndWait → TIMED_OUT
            clock.stopAndWait();
591 1 1. powerOff : removed call to com/rox/audio/AudioOutput::stop → KILLED
            audioOutput.stop();
592
        }
593
    }
594
595
    MOS6502 cpu(){
596 1 1. cpu : replaced return value with null for com/rox/NES::cpu → KILLED
        return cpu;
597
    }
598
599
    APU apu(){
600 1 1. apu : replaced return value with null for com/rox/NES::apu → KILLED
        return apu;
601
    }
602
603
    PPU ppu(){
604 1 1. ppu : replaced return value with null for com/rox/NES::ppu → KILLED
        return ppu;
605
    }
606
607
    RAM ram(){
608 1 1. ram : replaced return value with null for com/rox/NES::ram → KILLED
        return ram;
609
    }
610
611
    TickRateMonitor tickRateMonitor(){
612 1 1. tickRateMonitor : replaced return value with null for com/rox/NES::tickRateMonitor → KILLED
        return tickRateMonitor;
613
    }
614
615
    InstructionTrace instructionTrace(){
616 1 1. instructionTrace : replaced return value with null for com/rox/NES::instructionTrace → KILLED
        return instructionTrace;
617
    }
618
619
    /** The CPU clock rate a real NTSC NES runs at - what {@link #tickRateMonitor()}'s measured rate should match. */
620
    static long intendedCpuHz(){
621 1 1. intendedCpuHz : replaced long return with 0 for com/rox/NES::intendedCpuHz → KILLED
        return CPU_HZ;
622
    }
623
624
    Cartridge cartridge(){
625 1 1. cartridge : replaced return value with null for com/rox/NES::cartridge → KILLED
        return cartridge;
626
    }
627
628
    Clock clock(){
629 1 1. clock : replaced return value with null for com/rox/NES::clock → KILLED
        return clock;
630
    }
631
}

Mutations

150

1.1
Location : <init>
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aBreakpointStopsAStepWithThePcOnIt()]
removed call to com/rox/debug/breakpoints/Breakpoints::beam → KILLED

2.2
Location : lambda$new$0
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aBreakpointStopsAStepWithThePcOnIt()]
replaced return value with null for com/rox/NES::lambda$new$0 → KILLED

165

1.1
Location : <init>
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:mapperIrqReachesTheCpusRealIrqLine()]
removed call to com/rox/clock/Clock::addListener → KILLED

173

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepInstructionGivesUpRatherThanHangingOnAnInstructionThatNeverEnds()]
removed call to com/rox/clock/TickRateMonitor::tick → KILLED

174

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepInstructionFromMidInstructionJustFinishesIt()]
removed call to com/rox/cpu/mos6502/MOS6502::tick → KILLED

176

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pokeWhileRunningWaitsForTheClockThreadsNextTick()]
removed call to com/rox/debug/memory/MemoryEditor::tick → KILLED

177

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:dmcSampleFetchesReadFromCartridgePrgRomNotInternalRam()]
removed call to com/rox/apu/APU::tick → KILLED

178

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aWatchedWriteStopsAStepOnceTheWritingInstructionFinishes()]
removed call to com/rox/ppu/PPU::tick → KILLED

179

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:mapperIrqReachesTheCpusRealIrqLine()]
removed call to com/rox/cpu/mos6502/MOS6502::setIRQLine → KILLED

2.2
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:vblankNmiDoesNotFireBeforeTheRealVblankEdge()]
negated conditional → KILLED

3.3
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:mapperIrqReachesTheCpusRealIrqLine()]
negated conditional → KILLED

180

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:vblankNmiDoesNotFireBeforeTheRealVblankEdge()]
negated conditional → KILLED

181

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:vblankNmiReachesTheCpusRealNmiLine()]
removed call to com/rox/cpu/mos6502/MOS6502::signalNMI → KILLED

184

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepInstructionIncludesAnOamDmaStallThatFollows()]
negated conditional → KILLED

2.2
Location : tick
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

185

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepInstructionIncludesAnOamDmaStallThatFollows()]
removed call to com/rox/cpu/mos6502/MOS6502::stall → KILLED

189

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:instructionTraceRecordsEachInstructionOnceEvenAcrossAnOamDmaStall()]
removed call to com/rox/debug/cpu/InstructionTrace::tick → KILLED

191

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:mapperIrqReachesTheCpusRealIrqLine()]
negated conditional → KILLED

195

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:doubleSpeedRetunesAudioSoEachFrameMakesHalfTheSamples()]
negated conditional → KILLED

196

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:powerOnGracefullyHandlesInterruptionDuringTheWarmUpSleepItself()]
removed call to com/rox/audio/AudioOutput::write → KILLED

202

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pauseAtNextInstructionDoesNotRunOnToTheEndOfTheFrame()]
negated conditional → KILLED

203

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pauseAtEndOfFrameRunsOnToTheNextPresentedFrameThenFinishesTheInstruction()]
Replaced long addition with subtraction → KILLED

204

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:doubleSpeedRetunesAudioSoEachFrameMakesHalfTheSamples()]
negated conditional → KILLED

208

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:doubleSpeedRetunesAudioSoEachFrameMakesHalfTheSamples()]
Replaced double multiplication with division → KILLED

2.2
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:doubleSpeedRetunesAudioSoEachFrameMakesHalfTheSamples()]
removed call to com/rox/audio/Resampler::setInputRate → KILLED

210

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pauseAtEndOfFrameRunsOnToTheNextPresentedFrameThenFinishesTheInstruction()]
removed call to com/rox/video/VideoOutput::present → KILLED

211

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:frameReadyPollsAllFourConfiguredControllers()]
removed call to com/rox/input/Controller::poll → KILLED

212

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:frameReadyPollsAllFourConfiguredControllers()]
removed call to com/rox/input/Controller::poll → KILLED

213

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:frameReadyPollsAllFourConfiguredControllers()]
removed call to com/rox/input/Controller::poll → KILLED

214

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:frameReadyPollsAllFourConfiguredControllers()]
removed call to com/rox/input/Controller::poll → KILLED

217

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aPauseFromInsideASteppedTickEndsTheStepAtTheNextInstruction()]
negated conditional → KILLED

218

1.1
Location : tick
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aPauseFromInsideASteppedTickEndsTheStepAtTheNextInstruction()]
removed call to com/rox/NES::pauseIfStoppingPointReached → KILLED

223

1.1
Location : pauseIfStoppingPointReached
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:anEndOfFramePauseFromInsideASteppedTickEndsTheStepJustAfterTheFrame()]
negated conditional → KILLED

2.2
Location : pauseIfStoppingPointReached
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:anEndOfFramePauseFromInsideASteppedTickEndsTheStepJustAfterTheFrame()]
negated conditional → KILLED

226

1.1
Location : pauseIfStoppingPointReached
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aPauseFromInsideASteppedTickEndsTheStepAtTheNextInstruction()]
negated conditional → KILLED

2.2
Location : pauseIfStoppingPointReached
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aPauseFromInsideASteppedTickEndsTheStepAtTheNextInstruction()]
negated conditional → KILLED

228

1.1
Location : pauseIfStoppingPointReached
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aPauseFromInsideASteppedTickEndsTheStepAtTheNextInstruction()]
negated conditional → KILLED

229

1.1
Location : pauseIfStoppingPointReached
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aBreakpointPausesARunningNesAndResumeClearsTheHitAndCarriesOn()]
removed call to com/rox/clock/Clock::requestPause → KILLED

230

1.1
Location : pauseIfStoppingPointReached
Killed by : none
removed call to com/rox/NES::markPaused → TIMED_OUT

241

1.1
Location : lambda$powerOn$0
Killed by : none
removed call to java/util/concurrent/CountDownLatch::countDown → TIMED_OUT

242

1.1
Location : lambda$powerOn$0
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:powerOnGracefullyHandlesInterruptionDuringTheWarmUpSleepItself()]
removed call to com/rox/clock/Clock::run → KILLED

245

1.1
Location : powerOn
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:powerOffCalledImmediatelyAfterPowerOnStillStopsTheClockRatherThanLeakingBothThreads()]
removed call to com/rox/cpu/mos6502/MOS6502::reset → KILLED

250

1.1
Location : powerOn
Killed by : none
removed call to com/rox/clock/Clock::prepareToRun → TIMED_OUT

251

1.1
Location : powerOn
Killed by : none
removed call to java/lang/Thread::start → TIMED_OUT

256

1.1
Location : powerOn
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aBreakpointPausesARunningNesAndResumeClearsTheHitAndCarriesOn()]
removed call to java/util/concurrent/CountDownLatch::await → KILLED

257

1.1
Location : powerOn
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:powerOnGracefullyHandlesInterruptionDuringTheWarmUpSleepItself()]
negated conditional → KILLED

258

1.1
Location : powerOn
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:powerOnGracefullyHandlesInterruptionDuringTheWarmUpSleepItself()]
removed call to java/lang/Thread::sleep → KILLED

265

1.1
Location : powerOn
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:powerOffCalledImmediatelyAfterPowerOnStillStopsTheClockRatherThanLeakingBothThreads()]
negated conditional → KILLED

2.2
Location : powerOn
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:powerOnClosesTheRaceBetweenClockThreadStartingAndClockRunFlippingRunning()]
negated conditional → KILLED

266

1.1
Location : powerOn
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:powerOnGracefullyHandlesInterruptionAfterAudioHasAlreadyStarted()]
removed call to com/rox/audio/AudioOutput::start → KILLED

270

1.1
Location : powerOn
Killed by : none
negated conditional → TIMED_OUT

271

1.1
Location : powerOn
Killed by : none
removed call to com/rox/clock/Clock::stop → TIMED_OUT

275

1.1
Location : powerOn
Killed by : none
negated conditional → TIMED_OUT

277

1.1
Location : powerOn
Killed by : none
removed call to java/lang/Thread::join → TIMED_OUT

281

1.1
Location : powerOn
Killed by : none
removed call to com/rox/clock/Clock::stop → TIMED_OUT

289

1.1
Location : powerOn
Killed by : none
negated conditional → SURVIVED
Covering tests

290

1.1
Location : powerOn
Killed by : none
removed call to java/lang/Thread::interrupt → SURVIVED
Covering tests

296

1.1
Location : pause
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pauseBeforePowerOnHasNothingToPauseAndLeavesAudioAlone()]
replaced boolean return with true for com/rox/NES::pause → KILLED

2.2
Location : pause
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pokeWhilePausedAppliesImmediately()]
replaced boolean return with false for com/rox/NES::pause → KILLED

313

1.1
Location : pause
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pauseBeforePowerOnHasNothingToPauseAndLeavesAudioAlone()]
negated conditional → KILLED

315

1.1
Location : pause
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aPauseFromInsideASteppedTickEndsTheStepAtTheNextInstruction()]
replaced boolean return with false for com/rox/NES::pause → KILLED

317

1.1
Location : pause
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pauseBeforePowerOnHasNothingToPauseAndLeavesAudioAlone()]
negated conditional → KILLED

318

1.1
Location : pause
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pauseBeforePowerOnHasNothingToPauseAndLeavesAudioAlone()]
replaced boolean return with true for com/rox/NES::pause → KILLED

321

1.1
Location : pause
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pauseAtNextInstructionDoesNotRunOnToTheEndOfTheFrame()]
removed call to com/rox/NES::tickByHand → KILLED

322

1.1
Location : lambda$pause$0
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pauseAtNextInstructionDoesNotRunOnToTheEndOfTheFrame()]
negated conditional → KILLED

325

1.1
Location : lambda$pause$0
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pauseAtNextInstructionDoesNotRunOnToTheEndOfTheFrame()]
removed call to com/rox/NES::finishInFlightInstruction → KILLED

327

1.1
Location : pause
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pauseFinishesTheInstructionTheCpuWasPartWayThroughBeforeSilencingAudio()]
removed call to com/rox/NES::markPaused → KILLED

328

1.1
Location : pause
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pokeWhilePausedAppliesImmediately()]
replaced boolean return with false for com/rox/NES::pause → KILLED

332

1.1
Location : markPaused
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pauseFinishesTheInstructionTheCpuWasPartWayThroughBeforeSilencingAudio()]
removed call to com/rox/audio/AudioOutput::pause → KILLED

343

1.1
Location : setSpeed
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:speedIsLimitedToTheSupportedRange()]
changed conditional boundary → KILLED

2.2
Location : setSpeed
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:setSpeedPacesTheClock()]
negated conditional → KILLED

3.3
Location : setSpeed
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:speedIsLimitedToTheSupportedRange()]
changed conditional boundary → KILLED

4.4
Location : setSpeed
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:setSpeedPacesTheClock()]
negated conditional → KILLED

346

1.1
Location : setSpeed
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:setSpeedPacesTheClock()]
removed call to com/rox/clock/Clock::setSpeed → KILLED

351

1.1
Location : speed
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:setSpeedPacesTheClock()]
replaced double return with 0.0d for com/rox/NES::speed → KILLED

356

1.1
Location : isPaused
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aPauseFromInsideASteppedTickEndsTheStepAtTheNextInstruction()]
replaced boolean return with true for com/rox/NES::isPaused → KILLED

2.2
Location : isPaused
Killed by : none
replaced boolean return with false for com/rox/NES::isPaused → TIMED_OUT

363

1.1
Location : resume
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:resumeUnpausesAudioBeforeTheClockStartsFeedingItAgain()]
removed call to com/rox/audio/AudioOutput::resume → KILLED

364

1.1
Location : resume
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:resumeUnpausesAudioBeforeTheClockStartsFeedingItAgain()]
removed call to com/rox/clock/Clock::resume → KILLED

380

1.1
Location : captureSnapshot
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:captureAndRestoreAreRefusedWhileRunningButAllowedOncePaused()]
removed call to com/rox/NES::requireNothingTicking → KILLED

381

1.1
Location : captureSnapshot
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:captureWithTheClockStoppedMidInstructionFinishesThatInstructionFirst()]
removed call to com/rox/NES::tickByHand → KILLED

382

1.1
Location : captureSnapshot
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:restoreRefusesASnapshotFromACartridgeDifferingOnlyInChrRom()]
replaced return value with null for com/rox/NES::captureSnapshot → KILLED

395

1.1
Location : restoreSnapshot
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:captureAndRestoreAreRefusedWhileRunningButAllowedOncePaused()]
removed call to com/rox/NES::requireNothingTicking → KILLED

396

1.1
Location : restoreSnapshot
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:restoreRefusesASnapshotFromACartridgeDifferingOnlyInChrRom()]
negated conditional → KILLED

403

1.1
Location : restoreSnapshot
Killed by : none
removed call to com/rox/cartridge/Cartridge::checkRestorable → SURVIVED
Covering tests

404

1.1
Location : restoreSnapshot
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:restoreRejectingAMalformedPartChangesNothing()]
removed call to com/rox/mem/RAM::checkRestorable → KILLED

405

1.1
Location : restoreSnapshot
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:restoreRejectingAMalformedPartChangesNothing()]
removed call to com/rox/ppu/PPU::checkRestorable → KILLED

406

1.1
Location : restoreSnapshot
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:restoredNesRunsInLockstepWithTheOriginal()]
removed call to com/rox/cartridge/Cartridge::restore → KILLED

407

1.1
Location : restoreSnapshot
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:restoredNesRunsInLockstepWithTheOriginal()]
removed call to com/rox/mem/RAM::restore → KILLED

408

1.1
Location : restoreSnapshot
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:restoredNesRunsInLockstepWithTheOriginal()]
removed call to com/rox/ppu/PPU::restore → KILLED

409

1.1
Location : restoreSnapshot
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:restoredNesRunsInLockstepWithTheOriginal()]
removed call to com/rox/apu/APU::restore → KILLED

410

1.1
Location : restoreSnapshot
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:restoredNesRunsInLockstepWithTheOriginal()]
removed call to com/rox/cpu/mos6502/MOS6502::restore → KILLED

424

1.1
Location : stepInstruction
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:steppingIsRefusedWhileRunningUnpaused()]
removed call to com/rox/NES::requireNothingTicking → KILLED

425

1.1
Location : stepInstruction
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepInstructionGivesUpRatherThanHangingOnAnInstructionThatNeverEnds()]
removed call to com/rox/NES::tickByHand → KILLED

428

1.1
Location : lambda$stepInstruction$0
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepInstructionGivesUpRatherThanHangingOnAnInstructionThatNeverEnds()]
Changed increment from 1 to -1 → KILLED

2.2
Location : lambda$stepInstruction$0
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepInstructionGivesUpRatherThanHangingOnAnInstructionThatNeverEnds()]
negated conditional → KILLED

432

1.1
Location : lambda$stepInstruction$0
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepInstructionGivesUpRatherThanHangingOnAnInstructionThatNeverEnds()]
removed call to com/rox/clock/Clock::tick → KILLED

433

1.1
Location : lambda$stepInstruction$0
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepInstructionGivesUpRatherThanHangingOnAnInstructionThatNeverEnds()]
negated conditional → KILLED

445

1.1
Location : stepCycles
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:steppingIsRefusedWhileRunningUnpaused()]
removed call to com/rox/NES::requireNothingTicking → KILLED

446

1.1
Location : stepCycles
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepCyclesRunsExactlyThatManyCycles()]
changed conditional boundary → KILLED

2.2
Location : stepCycles
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepCyclesRejectsNothingOrLess()]
negated conditional → KILLED

449

1.1
Location : stepCycles
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aPauseFromInsideASteppedTickEndsTheStepAtTheNextInstruction()]
removed call to com/rox/NES::tickByHand → KILLED

450

1.1
Location : lambda$stepCycles$0
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aPauseFromInsideASteppedTickEndsTheStepAtTheNextInstruction()]
negated conditional → KILLED

2.2
Location : lambda$stepCycles$0
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aPauseFromInsideASteppedTickEndsTheStepAtTheNextInstruction()]
negated conditional → KILLED

3.3
Location : lambda$stepCycles$0
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aPauseNotReachedByTheEndOfAStepDoesNotCarryOverIntoTheNext()]
changed conditional boundary → KILLED

451

1.1
Location : lambda$stepCycles$0
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aPauseFromInsideASteppedTickEndsTheStepAtTheNextInstruction()]
removed call to com/rox/clock/Clock::tick → KILLED

467

1.1
Location : stepFrame
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepFrameIsRefusedWhileRunningUnpaused()]
removed call to com/rox/NES::stepFrame → KILLED

472

1.1
Location : stepFrame
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepFrameIsRefusedWhileRunningUnpaused()]
removed call to com/rox/NES::requireNothingTicking → KILLED

473

1.1
Location : stepFrame
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aBreakpointStopsAStepWithThePcOnIt()]
removed call to com/rox/NES::tickByHand → KILLED

474

1.1
Location : lambda$stepFrame$0
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepFrameGivesUpRatherThanHangingIfNoFrameFinishes()]
negated conditional → KILLED

2.2
Location : lambda$stepFrame$0
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aPauseFromInsideASteppedFrameEndsItBeforeTheFrame()]
negated conditional → KILLED

477

1.1
Location : lambda$stepFrame$0
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepFrameRunsToTheNextPresentedFrameThenFinishesTheInstruction()]
removed call to com/rox/NES::finishInFlightInstruction → KILLED

490

1.1
Location : tickByHand
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepInstructionGivesUpRatherThanHangingOnAnInstructionThatNeverEnds()]
removed call to java/lang/Runnable::run → KILLED

501

1.1
Location : tickUntilFramePresented
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aBreakpointStopsAStepWithThePcOnIt()]
changed conditional boundary → KILLED

2.2
Location : tickUntilFramePresented
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aBreakpointStopsAStepWithThePcOnIt()]
negated conditional → KILLED

502

1.1
Location : tickUntilFramePresented
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aPauseFromInsideASteppedFrameEndsItBeforeTheFrame()]
negated conditional → KILLED

2.2
Location : tickUntilFramePresented
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepFrameGivesUpRatherThanHangingIfNoFrameFinishes()]
Changed increment from 1 to -1 → KILLED

3.3
Location : tickUntilFramePresented
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aPauseFromInsideASteppedFrameEndsItBeforeTheFrame()]
negated conditional → KILLED

503

1.1
Location : tickUntilFramePresented
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepFrameGivesUpRatherThanHangingIfNoFrameFinishes()]
replaced boolean return with true for com/rox/NES::tickUntilFramePresented → KILLED

505

1.1
Location : tickUntilFramePresented
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aPauseFromInsideASteppedFrameEndsItBeforeTheFrame()]
removed call to com/rox/clock/Clock::tick → KILLED

507

1.1
Location : tickUntilFramePresented
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:noBreakpointsMeansNoHit()]
replaced boolean return with false for com/rox/NES::tickUntilFramePresented → KILLED

511

1.1
Location : finishInFlightInstruction
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:restoreRefusesASnapshotFromACartridgeDifferingOnlyInChrRom()]
negated conditional → KILLED

512

1.1
Location : finishInFlightInstruction
Killed by : none
removed call to com/rox/clock/Clock::tick → TIMED_OUT

527

1.1
Location : pokeMemory
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:lockingWhileNotRunningSetsTheValueStraightAway()]
negated conditional → KILLED

528

1.1
Location : pokeMemory
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pokeRefusesRegistersAndRomWithoutTouchingAnything()]
removed call to com/rox/debug/memory/MemoryEditor::write → KILLED

530

1.1
Location : pokeMemory
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pokeWhileRunningWaitsForTheClockThreadsNextTick()]
removed call to com/rox/debug/memory/MemoryEditor::queue → KILLED

541

1.1
Location : lockMemory
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aLockHoldsAgainstTheGamesOwnWritesUntilUnlocked()]
removed call to com/rox/debug/memory/MemoryEditor::lock → KILLED

542

1.1
Location : lockMemory
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:lockingWhileNotRunningSetsTheValueStraightAway()]
removed call to com/rox/NES::pokeMemory → KILLED

546

1.1
Location : unlockMemory
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aLockHoldsAgainstTheGamesOwnWritesUntilUnlocked()]
removed call to com/rox/debug/memory/MemoryEditor::unlock → KILLED

551

1.1
Location : breakpoints
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aBreakpointStopsAStepWithThePcOnIt()]
replaced return value with null for com/rox/NES::breakpoints → KILLED

556

1.1
Location : lastHit
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aBreakpointStopsAStepWithThePcOnIt()]
replaced return value with Optional.empty for com/rox/NES::lastHit → KILLED

561

1.1
Location : lockedMemory
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:aLockHoldsAgainstTheGamesOwnWritesUntilUnlocked()]
replaced return value with Collections.emptyMap for com/rox/NES::lockedMemory → KILLED

565

1.1
Location : nothingTicking
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepFrameIsRefusedWhileRunningUnpaused()]
negated conditional → KILLED

2.2
Location : nothingTicking
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepFrameIsRefusedWhileRunningUnpaused()]
replaced boolean return with true for com/rox/NES::nothingTicking → KILLED

3.3
Location : nothingTicking
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepFrameIsRefusedWhileRunningUnpaused()]
negated conditional → KILLED

569

1.1
Location : requireNothingTicking
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepFrameIsRefusedWhileRunningUnpaused()]
negated conditional → KILLED

577

1.1
Location : romCrc32
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:restoreRefusesASnapshotFromADifferentCartridge()]
removed call to java/util/zip/CRC32::update → KILLED

578

1.1
Location : romCrc32
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:restoreRefusesASnapshotFromACartridgeDifferingOnlyInChrRom()]
removed call to java/util/zip/CRC32::update → KILLED

579

1.1
Location : romCrc32
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:restoreRefusesASnapshotFromACartridgeDifferingOnlyInChrRom()]
replaced long return with 0 for com/rox/NES::romCrc32 → KILLED

590

1.1
Location : powerOff
Killed by : none
removed call to com/rox/clock/Clock::stopAndWait → TIMED_OUT

591

1.1
Location : powerOff
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:powerOffWhileTheClockIsStillStartingLeavesNothingTickingAfterwards()]
removed call to com/rox/audio/AudioOutput::stop → KILLED

596

1.1
Location : cpu
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:speedStartsAtRealTime()]
replaced return value with null for com/rox/NES::cpu → KILLED

600

1.1
Location : apu
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:dmcSampleFetchesReadFromCartridgePrgRomNotInternalRam()]
replaced return value with null for com/rox/NES::apu → KILLED

604

1.1
Location : ppu
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:vblankNmiDoesNotFireBeforeTheRealVblankEdge()]
replaced return value with null for com/rox/NES::ppu → KILLED

608

1.1
Location : ram
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:lockingWhileNotRunningSetsTheValueStraightAway()]
replaced return value with null for com/rox/NES::ram → KILLED

612

1.1
Location : tickRateMonitor
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:stepCyclesRejectsNothingOrLess()]
replaced return value with null for com/rox/NES::tickRateMonitor → KILLED

616

1.1
Location : instructionTrace
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:instructionTraceRecordsEachInstructionOnceEvenAcrossAnOamDmaStall()]
replaced return value with null for com/rox/NES::instructionTrace → KILLED

621

1.1
Location : intendedCpuHz
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:intendedCpuHzIsTheNtscCpuClock()]
replaced long return with 0 for com/rox/NES::intendedCpuHz → KILLED

625

1.1
Location : cartridge
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:pokeRefusesRegistersAndRomWithoutTouchingAnything()]
replaced return value with null for com/rox/NES::cartridge → KILLED

629

1.1
Location : clock
Killed by : com.rox.NESTest.[engine:junit-jupiter]/[class:com.rox.NESTest]/[method:setSpeedPacesTheClock()]
replaced return value with null for com/rox/NES::clock → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1