Skip to content

Commit

Permalink
v0.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
mherda64 committed Jan 13, 2023
1 parent 902314f commit b248b73
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.mherda</groupId>
<artifactId>espressogb</artifactId>
<version>0.2</version>
<version>0.3</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
Expand Down
9 changes: 3 additions & 6 deletions src/main/java/cpu/CPU.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

public class CPU {

private Registers registers;
private AddressSpace memory;

private long cycleCounter;
Expand All @@ -28,8 +27,7 @@ public class CPU {
private static final int TILESET_SCALE = 1;
private static final int BGMAP_SCALE = 1;

public CPU(Registers registers, MMU mmu, int freq) {
this.registers = registers;
public CPU(MMU mmu, int freq) {
this.memory = mmu;
this.freq = freq;
}
Expand Down Expand Up @@ -76,7 +74,7 @@ public static void main(String[] args) throws IOException, InterruptedException
var registers = new Registers();
var memory = new MMU(inputManager, sprites, tiles, filePath, biosPath);
var gpuRegsManager = new GPURegsManager(memory);
var cpu = new CPU(registers, memory, freq);
var cpu = new CPU(memory, freq);
var timers = new Timers(memory, cpu.getCycles());
var interruptManager = new InterruptManager(cpu, registers, memory);
inputManager.setAddressSpace(memory);
Expand All @@ -88,7 +86,6 @@ public static void main(String[] args) throws IOException, InterruptedException

// var tileSetDisplay = new TileDisplay(tiles, gpuRegsManager, TILESET_SCALE);
// tileSetDisplay.setPreferredSize(new Dimension(150 * TILESET_SCALE, 200 * TILESET_SCALE));
////
// var tileSetWindow = new JFrame("tileset");
// tileSetWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// tileSetWindow.setLocation(100, 100);
Expand Down Expand Up @@ -172,7 +169,7 @@ public static void main(String[] args) throws IOException, InterruptedException

if (currentCycles > desiredCycles) {
if (desiredCycles != 0)
Thread.sleep(0, desiredCycles);
Thread.sleep(0, 100);

// mapDisplay.updateMap();
// tileSetDisplay.updateMap();
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/cpu/instruction/InstructionBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public InstructionBuilder store(RegEnum reg) {
public InstructionBuilder storeRegAddressAccumulator(RegEnum reg) {
operations.add((registers, addressSpace, accumulator, context, interruptManager) -> {
addressSpace.set(registers.get(reg), accumulator);
//TODO what to return??
return accumulator;
});
return this;
Expand All @@ -91,7 +90,6 @@ public InstructionBuilder storeAccumulatorAddressReg(RegEnum reg) {
throw new IllegalStateException(String.format("Illegal register size %d", reg.size));
}

//TODO what to return??
return val;
});
return this;
Expand All @@ -114,7 +112,6 @@ public InstructionBuilder add(Integer value) {

public InstructionBuilder incrementReg(RegEnum reg) {
operations.add((registers, addressSpace, accumulator, context, interruptManager) -> {
//TODO: support for reg size
registers.set(reg, registers.get(reg) + 1);
return accumulator;
});
Expand Down
1 change: 0 additions & 1 deletion src/main/java/cpu/interrupt/InterruptManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public void handleInterrupts() {
callInt(0x0060);
}


}
}

Expand Down
10 changes: 0 additions & 10 deletions src/main/java/memory/regions/FixedROM.java

This file was deleted.

0 comments on commit b248b73

Please sign in to comment.