MemoryRegion.java

1
package com.rox.debug.memory;
2
3
/**
4
 * The CPU address ranges worth browsing in a memory viewer, matching how {@code NESMemoryBus} actually
5
 * routes them. Deliberately no {@code $2000-$4017}: reading those registers has side effects (clearing
6
 * vblank, advancing {@code $2007}'s buffer, shifting controller bits), so a passive view can't show them.
7
 */
8
public enum MemoryRegion {
9
    CPU_RAM("CPU RAM", 0x0000, 0x07FF),
10
    ZERO_PAGE("Zero page", 0x0000, 0x00FF),
11
    STACK("Stack", 0x0100, 0x01FF),
12
    PRG_RAM("PRG-RAM", 0x6000, 0x7FFF),
13
    PRG_ROM("PRG-ROM (as currently banked)", 0x8000, 0xFFFF);
14
15
    private final String label;
16
    private final int start;
17
    private final int end;
18
19
    MemoryRegion(final String label, final int start, final int end){
20
        this.label = label;
21
        this.start = start;
22
        this.end = end;
23
    }
24
25
    public int start(){
26 1 1. start : replaced int return with 0 for com/rox/debug/memory/MemoryRegion::start → KILLED
        return start;
27
    }
28
29
    /** Inclusive. */
30
    public int end(){
31 1 1. end : replaced int return with 0 for com/rox/debug/memory/MemoryRegion::end → KILLED
        return end;
32
    }
33
34
    /** e.g. {@code Stack ($0100-$01FF)} - what a region picker shows. */
35
    @Override
36
    public String toString(){
37 1 1. toString : replaced return value with "" for com/rox/debug/memory/MemoryRegion::toString → KILLED
        return String.format("%s ($%04X-$%04X)", label, start, end);
38
    }
39
}

Mutations

26

1.1
Location : start
Killed by : com.rox.debug.memory.MemoryRegionTest.[engine:junit-jupiter]/[class:com.rox.debug.memory.MemoryRegionTest]/[test-template:noRegionTouchesTheRegisterRange(com.rox.debug.memory.MemoryRegion)]/[test-template-invocation:#4]
replaced int return with 0 for com/rox/debug/memory/MemoryRegion::start → KILLED

31

1.1
Location : end
Killed by : com.rox.debug.memory.MemoryRegionTest.[engine:junit-jupiter]/[class:com.rox.debug.memory.MemoryRegionTest]/[method:rangesMatchTheBusMap()]
replaced int return with 0 for com/rox/debug/memory/MemoryRegion::end → KILLED

37

1.1
Location : toString
Killed by : com.rox.debug.memory.MemoryRegionTest.[engine:junit-jupiter]/[class:com.rox.debug.memory.MemoryRegionTest]/[method:labelsIncludeTheRange()]
replaced return value with "" for com/rox/debug/memory/MemoryRegion::toString → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1