APU.java

1
package com.rox.apu;
2
3
import com.rox.clock.ClockWatcher;
4
import com.rox.mem.MemoryBus;
5
6
7
/**
8
 * NES Audio Processing Unit, mapped into $4000-$4017. Owns the frame counter and all five channels
9
 * (both pulse, triangle, noise, DMC), including $4015 enable/status and the combined IRQ line
10
 * ({@link #isIrqAsserted()}) that a caller wires into the CPU.
11
 */
12
public class APU implements ClockWatcher, MemoryBus {
13
    public static final int STATUS_REGISTER_ADDRESS = 0x4015;
14
    public static final int FRAME_COUNTER_ADDRESS = 0x4017;
15
16
    private static final int PULSE1_CONTROL_ADDRESS = 0x4000;
17
    private static final int PULSE1_SWEEP_ADDRESS = 0x4001;
18
    private static final int PULSE1_TIMER_LOW_ADDRESS = 0x4002;
19
    private static final int PULSE1_TIMER_HIGH_ADDRESS = 0x4003;
20
21
    private static final int PULSE2_CONTROL_ADDRESS = 0x4004;
22
    private static final int PULSE2_SWEEP_ADDRESS = 0x4005;
23
    private static final int PULSE2_TIMER_LOW_ADDRESS = 0x4006;
24
    private static final int PULSE2_TIMER_HIGH_ADDRESS = 0x4007;
25
26
    private static final int TRIANGLE_LINEAR_COUNTER_ADDRESS = 0x4008;
27
    private static final int TRIANGLE_TIMER_LOW_ADDRESS = 0x400A;
28
    private static final int TRIANGLE_TIMER_HIGH_ADDRESS = 0x400B;
29
30
    private static final int NOISE_CONTROL_ADDRESS = 0x400C;
31
    private static final int NOISE_MODE_AND_PERIOD_ADDRESS = 0x400E;
32
    private static final int NOISE_LENGTH_LOAD_ADDRESS = 0x400F;
33
34
    private static final int DMC_CONTROL_ADDRESS = 0x4010;
35
    private static final int DMC_DIRECT_LOAD_ADDRESS = 0x4011;
36
    private static final int DMC_SAMPLE_ADDRESS_ADDRESS = 0x4012;
37
    private static final int DMC_SAMPLE_LENGTH_ADDRESS = 0x4013;
38
39
    private static final int PULSE1_ENABLE_BIT = 0x01;
40
    private static final int PULSE2_ENABLE_BIT = 0x02;
41
    private static final int TRIANGLE_ENABLE_BIT = 0x04;
42
    private static final int NOISE_ENABLE_BIT = 0x08;
43
    private static final int DMC_ENABLE_BIT = 0x10;
44
45
    private static final int PULSE1_STATUS_BIT = 0x01;
46
    private static final int PULSE2_STATUS_BIT = 0x02;
47
    private static final int TRIANGLE_STATUS_BIT = 0x04;
48
    private static final int NOISE_STATUS_BIT = 0x08;
49
    private static final int DMC_ACTIVE_BIT = 0x10;
50
    private static final int FRAME_IRQ_FLAG = 0x40;
51
    private static final int DMC_IRQ_FLAG = 0x80;
52
53
    private final FrameSequencer frameSequencer;
54
    private final PulseChannel pulse1;
55
    private final PulseChannel pulse2;
56
    private final TriangleChannel triangle;
57
    private final NoiseChannel noise;
58
    private final DMCChannel dmc;
59
60
    public APU(final MemoryBus memoryBus){
61
        this(new FrameSequencer(),
62
                new PulseChannel(true),
63
                new PulseChannel(false),
64
                new TriangleChannel(),
65
                new NoiseChannel(),
66
                new DMCChannel(memoryBus)
67
        );
68
    }
69
70
    APU(final FrameSequencer frameSequencer, final PulseChannel pulse1, final PulseChannel pulse2,
71
        final TriangleChannel triangle, final NoiseChannel noise, final DMCChannel dmc){
72
        this.frameSequencer = frameSequencer;
73
        this.pulse1 = pulse1;
74
        this.pulse2 = pulse2;
75
        this.triangle = triangle;
76
        this.noise = noise;
77
        this.dmc = dmc;
78 1 1. <init> : removed call to com/rox/apu/FrameSequencer::addQuarterFrameWatcher → KILLED
        frameSequencer.addQuarterFrameWatcher(pulse1::quarterFrameTick);
79 1 1. <init> : removed call to com/rox/apu/FrameSequencer::addQuarterFrameWatcher → KILLED
        frameSequencer.addQuarterFrameWatcher(pulse2::quarterFrameTick);
80 1 1. <init> : removed call to com/rox/apu/FrameSequencer::addQuarterFrameWatcher → KILLED
        frameSequencer.addQuarterFrameWatcher(triangle::quarterFrameTick);
81 1 1. <init> : removed call to com/rox/apu/FrameSequencer::addQuarterFrameWatcher → KILLED
        frameSequencer.addQuarterFrameWatcher(noise::quarterFrameTick);
82 1 1. <init> : removed call to com/rox/apu/FrameSequencer::addHalfFrameWatcher → KILLED
        frameSequencer.addHalfFrameWatcher(pulse1::halfFrameTick);
83 1 1. <init> : removed call to com/rox/apu/FrameSequencer::addHalfFrameWatcher → KILLED
        frameSequencer.addHalfFrameWatcher(pulse2::halfFrameTick);
84 1 1. <init> : removed call to com/rox/apu/FrameSequencer::addHalfFrameWatcher → KILLED
        frameSequencer.addHalfFrameWatcher(triangle::halfFrameTick);
85 1 1. <init> : removed call to com/rox/apu/FrameSequencer::addHalfFrameWatcher → KILLED
        frameSequencer.addHalfFrameWatcher(noise::halfFrameTick);
86
    }
87
88
    @Override
89
    public void tick() {
90
        //direct calls, not a loop over the six: this runs every CPU cycle, and a list of mixed types would
91
        //both allocate and stop the JIT inlining any of them
92 1 1. tick : removed call to com/rox/apu/FrameSequencer::tick → KILLED
        frameSequencer.tick();
93 1 1. tick : removed call to com/rox/apu/PulseChannel::tick → KILLED
        pulse1.tick();
94 1 1. tick : removed call to com/rox/apu/PulseChannel::tick → KILLED
        pulse2.tick();
95 1 1. tick : removed call to com/rox/apu/TriangleChannel::tick → KILLED
        triangle.tick();
96 1 1. tick : removed call to com/rox/apu/NoiseChannel::tick → KILLED
        noise.tick();
97 1 1. tick : removed call to com/rox/apu/DMCChannel::tick → KILLED
        dmc.tick();
98
    }
99
100
    @Override
101
    public int read(final int address) {
102 1 1. read : negated conditional → KILLED
        if (address == STATUS_REGISTER_ADDRESS){
103 1 1. read : replaced int return with 0 for com/rox/apu/APU::read → KILLED
            return readStatusRegister();
104
        }
105
        return 0;
106
    }
107
108
    @Override
109
    public void write(final int address, final int value) {
110
        switch (address){
111 1 1. write : removed call to com/rox/apu/APU::writeStatusRegister → KILLED
            case STATUS_REGISTER_ADDRESS -> writeStatusRegister(value);
112 1 1. write : removed call to com/rox/apu/FrameSequencer::writeControlRegister → KILLED
            case FRAME_COUNTER_ADDRESS -> frameSequencer.writeControlRegister(value);
113
114 1 1. write : removed call to com/rox/apu/PulseChannel::writeControlRegister → KILLED
            case PULSE1_CONTROL_ADDRESS -> pulse1.writeControlRegister(value);
115 1 1. write : removed call to com/rox/apu/PulseChannel::writeSweepRegister → KILLED
            case PULSE1_SWEEP_ADDRESS -> pulse1.writeSweepRegister(value);
116 1 1. write : removed call to com/rox/apu/PulseChannel::writeTimerLow → KILLED
            case PULSE1_TIMER_LOW_ADDRESS -> pulse1.writeTimerLow(value);
117 1 1. write : removed call to com/rox/apu/PulseChannel::writeTimerHighAndLengthLoad → KILLED
            case PULSE1_TIMER_HIGH_ADDRESS -> pulse1.writeTimerHighAndLengthLoad(value);
118
119 1 1. write : removed call to com/rox/apu/PulseChannel::writeControlRegister → KILLED
            case PULSE2_CONTROL_ADDRESS -> pulse2.writeControlRegister(value);
120 1 1. write : removed call to com/rox/apu/PulseChannel::writeSweepRegister → KILLED
            case PULSE2_SWEEP_ADDRESS -> pulse2.writeSweepRegister(value);
121 1 1. write : removed call to com/rox/apu/PulseChannel::writeTimerLow → KILLED
            case PULSE2_TIMER_LOW_ADDRESS -> pulse2.writeTimerLow(value);
122 1 1. write : removed call to com/rox/apu/PulseChannel::writeTimerHighAndLengthLoad → KILLED
            case PULSE2_TIMER_HIGH_ADDRESS -> pulse2.writeTimerHighAndLengthLoad(value);
123
124 1 1. write : removed call to com/rox/apu/TriangleChannel::writeLinearCounterRegister → KILLED
            case TRIANGLE_LINEAR_COUNTER_ADDRESS -> triangle.writeLinearCounterRegister(value);
125 1 1. write : removed call to com/rox/apu/TriangleChannel::writeTimerLow → KILLED
            case TRIANGLE_TIMER_LOW_ADDRESS -> triangle.writeTimerLow(value);
126 1 1. write : removed call to com/rox/apu/TriangleChannel::writeTimerHighAndLengthLoad → KILLED
            case TRIANGLE_TIMER_HIGH_ADDRESS -> triangle.writeTimerHighAndLengthLoad(value);
127
128 1 1. write : removed call to com/rox/apu/NoiseChannel::writeControlRegister → KILLED
            case NOISE_CONTROL_ADDRESS -> noise.writeControlRegister(value);
129 1 1. write : removed call to com/rox/apu/NoiseChannel::writeModeAndPeriod → KILLED
            case NOISE_MODE_AND_PERIOD_ADDRESS -> noise.writeModeAndPeriod(value);
130 1 1. write : removed call to com/rox/apu/NoiseChannel::writeLengthLoad → KILLED
            case NOISE_LENGTH_LOAD_ADDRESS -> noise.writeLengthLoad(value);
131
132 1 1. write : removed call to com/rox/apu/DMCChannel::writeControlRegister → KILLED
            case DMC_CONTROL_ADDRESS -> dmc.writeControlRegister(value);
133 1 1. write : removed call to com/rox/apu/DMCChannel::writeDirectLoad → KILLED
            case DMC_DIRECT_LOAD_ADDRESS -> dmc.writeDirectLoad(value);
134 1 1. write : removed call to com/rox/apu/DMCChannel::writeSampleAddress → KILLED
            case DMC_SAMPLE_ADDRESS_ADDRESS -> dmc.writeSampleAddress(value);
135 1 1. write : removed call to com/rox/apu/DMCChannel::writeSampleLength → KILLED
            case DMC_SAMPLE_LENGTH_ADDRESS -> dmc.writeSampleLength(value);
136
137
            default -> { }
138
        }
139
    }
140
141
    /**
142
     * Handle a $4015 write: sets each channel's enable state from bits 0-4, then unconditionally
143
     * clears the DMC-IRQ flag (real hardware does this regardless of the value written).
144
     */
145
    private void writeStatusRegister(final int value){
146 3 1. writeStatusRegister : negated conditional → KILLED
2. writeStatusRegister : Replaced bitwise AND with OR → KILLED
3. writeStatusRegister : removed call to com/rox/apu/PulseChannel::setEnabled → KILLED
        pulse1.setEnabled((value & PULSE1_ENABLE_BIT) != 0);
147 3 1. writeStatusRegister : Replaced bitwise AND with OR → KILLED
2. writeStatusRegister : removed call to com/rox/apu/PulseChannel::setEnabled → KILLED
3. writeStatusRegister : negated conditional → KILLED
        pulse2.setEnabled((value & PULSE2_ENABLE_BIT) != 0);
148 3 1. writeStatusRegister : removed call to com/rox/apu/TriangleChannel::setEnabled → KILLED
2. writeStatusRegister : negated conditional → KILLED
3. writeStatusRegister : Replaced bitwise AND with OR → KILLED
        triangle.setEnabled((value & TRIANGLE_ENABLE_BIT) != 0);
149 3 1. writeStatusRegister : negated conditional → KILLED
2. writeStatusRegister : removed call to com/rox/apu/NoiseChannel::setEnabled → KILLED
3. writeStatusRegister : Replaced bitwise AND with OR → KILLED
        noise.setEnabled((value & NOISE_ENABLE_BIT) != 0);
150 3 1. writeStatusRegister : negated conditional → KILLED
2. writeStatusRegister : Replaced bitwise AND with OR → KILLED
3. writeStatusRegister : removed call to com/rox/apu/DMCChannel::setEnabled → KILLED
        dmc.setEnabled((value & DMC_ENABLE_BIT) != 0);
151 1 1. writeStatusRegister : removed call to com/rox/apu/DMCChannel::clearIrq → KILLED
        dmc.clearIrq();
152
    }
153
154
    /** The {@link Mixer} combined analog output of all five channels */
155
    public double outputSample(){
156 1 1. outputSample : replaced double return with 0.0d for com/rox/apu/APU::outputSample → KILLED
        return Mixer.mix(
157
                pulse1.outputSample(),
158
                pulse2.outputSample(),
159
                triangle.outputSample(),
160
                noise.outputSample(),
161
                dmc.outputSample()
162
        );
163
    }
164
165
    /**
166
     * True whenever either IRQ source within the APU is asserted (frame sequencer or DMC). A pure
167
     * query with no side effects (unlike {@link #readStatusRegister()}, which clears the frame-IRQ
168
     * flag) - callers re-evaluate this every tick to drive a level-sensitive CPU IRQ line.
169
     */
170
    public boolean isIrqAsserted(){
171 3 1. isIrqAsserted : replaced boolean return with true for com/rox/apu/APU::isIrqAsserted → KILLED
2. isIrqAsserted : negated conditional → KILLED
3. isIrqAsserted : negated conditional → KILLED
        return frameSequencer.isFrameIrqPending() || dmc.isIrqPending();
172
    }
173
174
    /**
175
     * Handle a $4015 read.
176
     *
177
     * Register: IF-D NT21
178
     * I (bit 7): DMC-IRQ pending (NOT cleared by this read - only by a $4015 write)
179
     * F (bit 6): frame-IRQ pending (cleared by this read)
180
     * D (bit 4): DMC still has sample bytes to fetch
181
     * N/T/2/1 (bits 0-3): that channel's length counter is nonzero
182
     */
183
    private int readStatusRegister(){
184
        int status = 0;
185 1 1. readStatusRegister : Replaced bitwise OR with AND → KILLED
        status |= bitIf(pulse1.isLengthCounterActive(), PULSE1_STATUS_BIT);
186 1 1. readStatusRegister : Replaced bitwise OR with AND → KILLED
        status |= bitIf(pulse2.isLengthCounterActive(), PULSE2_STATUS_BIT);
187 1 1. readStatusRegister : Replaced bitwise OR with AND → KILLED
        status |= bitIf(triangle.isLengthCounterActive(), TRIANGLE_STATUS_BIT);
188 1 1. readStatusRegister : Replaced bitwise OR with AND → KILLED
        status |= bitIf(noise.isLengthCounterActive(), NOISE_STATUS_BIT);
189 1 1. readStatusRegister : Replaced bitwise OR with AND → KILLED
        status |= bitIf(dmc.isActive(), DMC_ACTIVE_BIT);
190 1 1. readStatusRegister : Replaced bitwise OR with AND → KILLED
        status |= bitIf(dmc.isIrqPending(), DMC_IRQ_FLAG);
191
192 1 1. readStatusRegister : negated conditional → KILLED
        if (frameSequencer.isFrameIrqPending()) {
193 1 1. readStatusRegister : Replaced bitwise OR with AND → KILLED
            status |= FRAME_IRQ_FLAG;
194 1 1. readStatusRegister : removed call to com/rox/apu/FrameSequencer::clearFrameIrq → KILLED
            frameSequencer.clearFrameIrq(); // side effect: reading $4015 clears this on real hardware
195
        }
196
197 1 1. readStatusRegister : replaced int return with 0 for com/rox/apu/APU::readStatusRegister → KILLED
        return status;
198
    }
199
200
    /** Return bit that should be modified if condition is met, otherwise 0 */
201
    private static int bitIf(boolean condition, int bitMask){
202 1 1. bitIf : negated conditional → KILLED
        return condition ? bitMask : 0;
203
    }
204
205
    /** Every channel's and the frame sequencer's complete state - see {@link ApuSnapshot}. */
206
    public ApuSnapshot snapshot(){
207 1 1. snapshot : replaced return value with null for com/rox/apu/APU::snapshot → KILLED
        return new ApuSnapshot(frameSequencer.snapshot(), pulse1.snapshot(), pulse2.snapshot(), triangle.snapshot(),
208
                noise.snapshot(), dmc.snapshot());
209
    }
210
211
    /** Puts every channel and the frame sequencer back exactly as {@code snapshot} captured them. */
212
    public void restore(final ApuSnapshot snapshot){
213 1 1. restore : removed call to com/rox/apu/FrameSequencer::restore → KILLED
        frameSequencer.restore(snapshot.frameSequencer());
214 1 1. restore : removed call to com/rox/apu/PulseChannel::restore → KILLED
        pulse1.restore(snapshot.pulse1());
215 1 1. restore : removed call to com/rox/apu/PulseChannel::restore → KILLED
        pulse2.restore(snapshot.pulse2());
216 1 1. restore : removed call to com/rox/apu/TriangleChannel::restore → KILLED
        triangle.restore(snapshot.triangle());
217 1 1. restore : removed call to com/rox/apu/NoiseChannel::restore → KILLED
        noise.restore(snapshot.noise());
218 1 1. restore : removed call to com/rox/apu/DMCChannel::restore → KILLED
        dmc.restore(snapshot.dmc());
219
    }
220
}

Mutations

78

1.1
Location : <init>
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:constructorRegistersAllFourChannelsAsQuarterAndHalfFrameWatchers()]
removed call to com/rox/apu/FrameSequencer::addQuarterFrameWatcher → KILLED

79

1.1
Location : <init>
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:constructorRegistersAllFourChannelsAsQuarterAndHalfFrameWatchers()]
removed call to com/rox/apu/FrameSequencer::addQuarterFrameWatcher → KILLED

80

1.1
Location : <init>
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:constructorRegistersAllFourChannelsAsQuarterAndHalfFrameWatchers()]
removed call to com/rox/apu/FrameSequencer::addQuarterFrameWatcher → KILLED

81

1.1
Location : <init>
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:constructorRegistersAllFourChannelsAsQuarterAndHalfFrameWatchers()]
removed call to com/rox/apu/FrameSequencer::addQuarterFrameWatcher → KILLED

82

1.1
Location : <init>
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:constructorRegistersAllFourChannelsAsQuarterAndHalfFrameWatchers()]
removed call to com/rox/apu/FrameSequencer::addHalfFrameWatcher → KILLED

83

1.1
Location : <init>
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:constructorRegistersAllFourChannelsAsQuarterAndHalfFrameWatchers()]
removed call to com/rox/apu/FrameSequencer::addHalfFrameWatcher → KILLED

84

1.1
Location : <init>
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:constructorRegistersAllFourChannelsAsQuarterAndHalfFrameWatchers()]
removed call to com/rox/apu/FrameSequencer::addHalfFrameWatcher → KILLED

85

1.1
Location : <init>
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:constructorRegistersAllFourChannelsAsQuarterAndHalfFrameWatchers()]
removed call to com/rox/apu/FrameSequencer::addHalfFrameWatcher → KILLED

92

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

93

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

94

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

95

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

96

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

97

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

102

1.1
Location : read
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:readingOtherAddressesReturnsZeroWithoutTouchingFrameSequencer()]
negated conditional → KILLED

103

1.1
Location : read
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:readingStatusRegisterReportsDmcIrqPendingWithoutClearingIt()]
replaced int return with 0 for com/rox/apu/APU::read → KILLED

111

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingStatusRegisterAlwaysClearsDmcIrqRegardlessOfValue()]
removed call to com/rox/apu/APU::writeStatusRegister → KILLED

112

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingFrameCounterRegisterDelegatesToFrameSequencer()]
removed call to com/rox/apu/FrameSequencer::writeControlRegister → KILLED

114

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingPulse1RegistersDelegatesToPulse1Only()]
removed call to com/rox/apu/PulseChannel::writeControlRegister → KILLED

115

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingPulse1RegistersDelegatesToPulse1Only()]
removed call to com/rox/apu/PulseChannel::writeSweepRegister → KILLED

116

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingPulse1RegistersDelegatesToPulse1Only()]
removed call to com/rox/apu/PulseChannel::writeTimerLow → KILLED

117

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingPulse1RegistersDelegatesToPulse1Only()]
removed call to com/rox/apu/PulseChannel::writeTimerHighAndLengthLoad → KILLED

119

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingPulse2RegistersDelegatesToPulse2Only()]
removed call to com/rox/apu/PulseChannel::writeControlRegister → KILLED

120

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingPulse2RegistersDelegatesToPulse2Only()]
removed call to com/rox/apu/PulseChannel::writeSweepRegister → KILLED

121

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingPulse2RegistersDelegatesToPulse2Only()]
removed call to com/rox/apu/PulseChannel::writeTimerLow → KILLED

122

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingPulse2RegistersDelegatesToPulse2Only()]
removed call to com/rox/apu/PulseChannel::writeTimerHighAndLengthLoad → KILLED

124

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingTriangleRegistersDelegatesToTriangleOnly()]
removed call to com/rox/apu/TriangleChannel::writeLinearCounterRegister → KILLED

125

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingTriangleRegistersDelegatesToTriangleOnly()]
removed call to com/rox/apu/TriangleChannel::writeTimerLow → KILLED

126

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingTriangleRegistersDelegatesToTriangleOnly()]
removed call to com/rox/apu/TriangleChannel::writeTimerHighAndLengthLoad → KILLED

128

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingNoiseRegistersDelegatesToNoiseOnly()]
removed call to com/rox/apu/NoiseChannel::writeControlRegister → KILLED

129

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingNoiseRegistersDelegatesToNoiseOnly()]
removed call to com/rox/apu/NoiseChannel::writeModeAndPeriod → KILLED

130

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingNoiseRegistersDelegatesToNoiseOnly()]
removed call to com/rox/apu/NoiseChannel::writeLengthLoad → KILLED

132

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingDmcRegistersDelegatesToDmcOnly()]
removed call to com/rox/apu/DMCChannel::writeControlRegister → KILLED

133

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingDmcRegistersDelegatesToDmcOnly()]
removed call to com/rox/apu/DMCChannel::writeDirectLoad → KILLED

134

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingDmcRegistersDelegatesToDmcOnly()]
removed call to com/rox/apu/DMCChannel::writeSampleAddress → KILLED

135

1.1
Location : write
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingDmcRegistersDelegatesToDmcOnly()]
removed call to com/rox/apu/DMCChannel::writeSampleLength → KILLED

146

1.1
Location : writeStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[test-template:writingStatusRegisterSetsEachChannelsEnabledBitFromTheWrittenValue(int, boolean, boolean, boolean, boolean, boolean)]/[test-template-invocation:#3]
negated conditional → KILLED

2.2
Location : writeStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[test-template:writingStatusRegisterSetsEachChannelsEnabledBitFromTheWrittenValue(int, boolean, boolean, boolean, boolean, boolean)]/[test-template-invocation:#3]
Replaced bitwise AND with OR → KILLED

3.3
Location : writeStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[test-template:writingStatusRegisterSetsEachChannelsEnabledBitFromTheWrittenValue(int, boolean, boolean, boolean, boolean, boolean)]/[test-template-invocation:#3]
removed call to com/rox/apu/PulseChannel::setEnabled → KILLED

147

1.1
Location : writeStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[test-template:writingStatusRegisterSetsEachChannelsEnabledBitFromTheWrittenValue(int, boolean, boolean, boolean, boolean, boolean)]/[test-template-invocation:#4]
Replaced bitwise AND with OR → KILLED

2.2
Location : writeStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[test-template:writingStatusRegisterSetsEachChannelsEnabledBitFromTheWrittenValue(int, boolean, boolean, boolean, boolean, boolean)]/[test-template-invocation:#3]
removed call to com/rox/apu/PulseChannel::setEnabled → KILLED

3.3
Location : writeStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[test-template:writingStatusRegisterSetsEachChannelsEnabledBitFromTheWrittenValue(int, boolean, boolean, boolean, boolean, boolean)]/[test-template-invocation:#3]
negated conditional → KILLED

148

1.1
Location : writeStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[test-template:writingStatusRegisterSetsEachChannelsEnabledBitFromTheWrittenValue(int, boolean, boolean, boolean, boolean, boolean)]/[test-template-invocation:#3]
removed call to com/rox/apu/TriangleChannel::setEnabled → KILLED

2.2
Location : writeStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[test-template:writingStatusRegisterSetsEachChannelsEnabledBitFromTheWrittenValue(int, boolean, boolean, boolean, boolean, boolean)]/[test-template-invocation:#3]
negated conditional → KILLED

3.3
Location : writeStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[test-template:writingStatusRegisterSetsEachChannelsEnabledBitFromTheWrittenValue(int, boolean, boolean, boolean, boolean, boolean)]/[test-template-invocation:#3]
Replaced bitwise AND with OR → KILLED

149

1.1
Location : writeStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[test-template:writingStatusRegisterSetsEachChannelsEnabledBitFromTheWrittenValue(int, boolean, boolean, boolean, boolean, boolean)]/[test-template-invocation:#3]
negated conditional → KILLED

2.2
Location : writeStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[test-template:writingStatusRegisterSetsEachChannelsEnabledBitFromTheWrittenValue(int, boolean, boolean, boolean, boolean, boolean)]/[test-template-invocation:#3]
removed call to com/rox/apu/NoiseChannel::setEnabled → KILLED

3.3
Location : writeStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[test-template:writingStatusRegisterSetsEachChannelsEnabledBitFromTheWrittenValue(int, boolean, boolean, boolean, boolean, boolean)]/[test-template-invocation:#3]
Replaced bitwise AND with OR → KILLED

150

1.1
Location : writeStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[test-template:writingStatusRegisterSetsEachChannelsEnabledBitFromTheWrittenValue(int, boolean, boolean, boolean, boolean, boolean)]/[test-template-invocation:#3]
negated conditional → KILLED

2.2
Location : writeStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[test-template:writingStatusRegisterSetsEachChannelsEnabledBitFromTheWrittenValue(int, boolean, boolean, boolean, boolean, boolean)]/[test-template-invocation:#3]
Replaced bitwise AND with OR → KILLED

3.3
Location : writeStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[test-template:writingStatusRegisterSetsEachChannelsEnabledBitFromTheWrittenValue(int, boolean, boolean, boolean, boolean, boolean)]/[test-template-invocation:#3]
removed call to com/rox/apu/DMCChannel::setEnabled → KILLED

151

1.1
Location : writeStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:writingStatusRegisterAlwaysClearsDmcIrqRegardlessOfValue()]
removed call to com/rox/apu/DMCChannel::clearIrq → KILLED

156

1.1
Location : outputSample
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:outputSampleMixesAllFiveChannelOutputs()]
replaced double return with 0.0d for com/rox/apu/APU::outputSample → KILLED

171

1.1
Location : isIrqAsserted
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:isIrqAssertedFalseWhenNeitherSourceIsPending()]
replaced boolean return with true for com/rox/apu/APU::isIrqAsserted → KILLED

2.2
Location : isIrqAsserted
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:isIrqAssertedFalseWhenNeitherSourceIsPending()]
negated conditional → KILLED

3.3
Location : isIrqAsserted
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:isIrqAssertedTrueWhenOnlyDmcIrqPending()]
negated conditional → KILLED

185

1.1
Location : readStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:readingStatusRegisterReportsEachChannelsLengthCounterAndDmcActivity()]
Replaced bitwise OR with AND → KILLED

186

1.1
Location : readStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:readingStatusRegisterReportsTheComplementaryChannelsToo()]
Replaced bitwise OR with AND → KILLED

187

1.1
Location : readStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:readingStatusRegisterReportsTheComplementaryChannelsToo()]
Replaced bitwise OR with AND → KILLED

188

1.1
Location : readStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:readingStatusRegisterReportsTheComplementaryChannelsToo()]
Replaced bitwise OR with AND → KILLED

189

1.1
Location : readStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:readingStatusRegisterReportsTheComplementaryChannelsToo()]
Replaced bitwise OR with AND → KILLED

190

1.1
Location : readStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:readingStatusRegisterReportsDmcIrqPendingWithoutClearingIt()]
Replaced bitwise OR with AND → KILLED

192

1.1
Location : readStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:readingStatusRegisterReportsDmcIrqPendingWithoutClearingIt()]
negated conditional → KILLED

193

1.1
Location : readStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:readingStatusRegisterReturnsFrameIrqBitAndClearsItWhenPending()]
Replaced bitwise OR with AND → KILLED

194

1.1
Location : readStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:readingStatusRegisterReturnsFrameIrqBitAndClearsItWhenPending()]
removed call to com/rox/apu/FrameSequencer::clearFrameIrq → KILLED

197

1.1
Location : readStatusRegister
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:readingStatusRegisterReportsDmcIrqPendingWithoutClearingIt()]
replaced int return with 0 for com/rox/apu/APU::readStatusRegister → KILLED

202

1.1
Location : bitIf
Killed by : com.rox.apu.APUTest.[engine:junit-jupiter]/[class:com.rox.apu.APUTest]/[method:readingStatusRegisterReportsDmcIrqPendingWithoutClearingIt()]
negated conditional → KILLED

207

1.1
Location : snapshot
Killed by : com.rox.save.SaveFileFormatTest.[engine:junit-jupiter]/[class:com.rox.save.SaveFileFormatTest]/[method:readLiveSnapshotIsEmptyForASnapshotPayloadInAFileTaggedAsAnotherSaveType(java.nio.file.Path)]
replaced return value with null for com/rox/apu/APU::snapshot → KILLED

213

1.1
Location : restore
Killed by : com.rox.apu.ApuSnapshotTest.[engine:junit-jupiter]/[class:com.rox.apu.ApuSnapshotTest]/[method:restoredMidSampleRunsInLockstep()]
removed call to com/rox/apu/FrameSequencer::restore → KILLED

214

1.1
Location : restore
Killed by : com.rox.apu.ApuSnapshotTest.[engine:junit-jupiter]/[class:com.rox.apu.ApuSnapshotTest]/[method:restoredMidSampleRunsInLockstep()]
removed call to com/rox/apu/PulseChannel::restore → KILLED

215

1.1
Location : restore
Killed by : com.rox.apu.ApuSnapshotTest.[engine:junit-jupiter]/[class:com.rox.apu.ApuSnapshotTest]/[method:restoredMidSampleRunsInLockstep()]
removed call to com/rox/apu/PulseChannel::restore → KILLED

216

1.1
Location : restore
Killed by : com.rox.apu.ApuSnapshotTest.[engine:junit-jupiter]/[class:com.rox.apu.ApuSnapshotTest]/[method:restoredMidSampleRunsInLockstep()]
removed call to com/rox/apu/TriangleChannel::restore → KILLED

217

1.1
Location : restore
Killed by : com.rox.apu.ApuSnapshotTest.[engine:junit-jupiter]/[class:com.rox.apu.ApuSnapshotTest]/[method:restoredMidSampleRunsInLockstep()]
removed call to com/rox/apu/NoiseChannel::restore → KILLED

218

1.1
Location : restore
Killed by : com.rox.apu.ApuSnapshotTest.[engine:junit-jupiter]/[class:com.rox.apu.ApuSnapshotTest]/[method:restoredMidSampleRunsInLockstep()]
removed call to com/rox/apu/DMCChannel::restore → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1