Skip to content

Commit 9d2ea24

Browse files
committed
Initial Commit
1 parent 3768d10 commit 9d2ea24

12 files changed

+1734
-0
lines changed

5x8_lcd_hd44780u_a02.ttf

72.6 KB
Binary file not shown.

src/Bus.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
public class Bus {
2+
public static byte read(short address) {
3+
if (Short.toUnsignedInt(address) >= 32768) {
4+
return EaterEmulator.rom.read((short)(address-0x8000));
5+
} else if (Short.toUnsignedInt(address) <= 24592 && Short.toUnsignedInt(address) >= 24576) {
6+
return EaterEmulator.via.read(address);
7+
} else {
8+
return EaterEmulator.ram.read(address);
9+
}
10+
}
11+
12+
public static void write(short address, byte data) {
13+
if (Short.toUnsignedInt(address) >= 32768) {
14+
System.out.println("Can't write to ROM!");
15+
} else if (Short.toUnsignedInt(address) <= 24592 && Short.toUnsignedInt(address) >= 24576) {
16+
EaterEmulator.via.write(address, data);
17+
} else {
18+
EaterEmulator.ram.write(address, data);
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)