Skip to content

Commit 75614f8

Browse files
committed
screenshots
1 parent 221c29f commit 75614f8

File tree

5 files changed

+25
-9
lines changed

5 files changed

+25
-9
lines changed

screenshots/screenshot0.png

92.6 KB
Loading

screenshots/screenshot1.png

100 KB
Loading

screenshots/screenshot2.png

97.4 KB
Loading

src/EaterEmulator.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//Original Code by Dylan Speiser
2+
//https://github.com/DylanSpeiser
3+
14
import java.awt.*;
25
import java.awt.event.ActionEvent;
36
import java.awt.event.ActionListener;
@@ -66,6 +69,7 @@ public void actionPerformed(ActionEvent e) {
6669
rom.setROMArray(ROMLoader.readROM(fc.getSelectedFile()));
6770
}
6871
GraphicsPanel.requestFocus();
72+
cpu.reset();
6973
} else if (e.getSource().equals(RAMopenButton)) {
7074
fc.setSelectedFile(new File(""));
7175
int returnVal = fc.showOpenDialog(this);
@@ -74,6 +78,7 @@ public void actionPerformed(ActionEvent e) {
7478
ram.setRAMArray(ROMLoader.readROM(fc.getSelectedFile()));
7579
}
7680
GraphicsPanel.requestFocus();
81+
cpu.reset();
7782
} else if (e.getSource().equals(clock)) {
7883
if (!haltFlag)
7984
cpu.clock();

src/LCD.java

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public class LCD extends JFrame implements ActionListener {
1919

2020
boolean graphicalCursorBlinkFlag = false;
2121

22+
boolean debug = false;
23+
2224
//Internal flags
2325
int cursorPos = 0;
2426
boolean increment = true;
@@ -106,7 +108,8 @@ public void write(boolean regSel, byte data) {
106108
} else {
107109
fourBitMode = true;
108110
}
109-
System.out.println("Function: Four Bit Mode: "+fourBitMode);
111+
if (debug)
112+
System.out.println("Function: Four Bit Mode: "+fourBitMode);
110113
} else if ((data & 0b00010000) == 0b00010000) {
111114
//SHIFT
112115
boolean rightleft = false;
@@ -121,21 +124,24 @@ public void write(boolean regSel, byte data) {
121124
//SCREEN
122125
char[] newCharArray = new char[40];
123126
Arrays.fill(newCharArray, ' ');
124-
System.out.println("Shifted screen to the "+(rightleft ? "right." : "left."));
127+
if (debug)
128+
System.out.println("Shifted screen to the "+(rightleft ? "right." : "left."));
125129
} else {
126130
//CURSOR
127131
cursorPos += (rightleft ? 1 : -1);
128132
if (cursorPos < 0)
129133
cursorPos = 0;
130-
System.out.println("Shifted cursor to the "+(rightleft ? "right." : "left."));
134+
if (debug)
135+
System.out.println("Shifted cursor to the "+(rightleft ? "right." : "left."));
131136
}
132137
} else if ((data & 0b00001000) == 0b00001000) {
133138
//DISPLAY CONTROL
134139
if ((data & 0b00000100) == 0b00000100) {
135140
displayPower = true;
136141
} else {
137142
displayPower = false;
138-
System.out.println("Turned the Display off! | "+Integer.toBinaryString(Byte.toUnsignedInt(data)));
143+
if (debug)
144+
System.out.println("Turned the Display off! | "+Integer.toBinaryString(Byte.toUnsignedInt(data)));
139145
}
140146
if ((data & 0b00000010) == 0b00000010) {
141147
cursor = true;
@@ -147,34 +153,39 @@ public void write(boolean regSel, byte data) {
147153
} else {
148154
cursorBlink = false;
149155
}
150-
System.out.println("Display Control: Power: "+displayPower+" Cursor: "+cursor+" Blink: "+cursorBlink);
156+
if (debug)
157+
System.out.println("Display Control: Power: "+displayPower+" Cursor: "+cursor+" Blink: "+cursorBlink);
151158
} else if ((data & 0b00000100) == 0b00000100) {
152159
//ENTRY MODE SET
153160
if ((data & 0b00000010) == 0b00000010) {
154161
increment = true;
155162
} else {
156163
increment = false;
157164
}
158-
System.out.println("Set Entry Mode: Increment: "+increment);
165+
if (debug)
166+
System.out.println("Set Entry Mode: Increment: "+increment);
159167
} else if ((data & 0b00000010) == 0b00000010) {
160168
//RETURN HOME
161169
cursorPos = 0;
162-
System.out.println("Return Home");
170+
if (debug)
171+
System.out.println("Return Home");
163172
} else if (data == 0b00000001) {
164173
//CLEAR
165174
cursorPos = 0;
166175
text = new char[0x50];
167176
for (int i = 0; i < 0x50; i++) {
168177
text[i] = ' ';
169178
}
170-
System.out.println("Cleared!");
179+
if (debug)
180+
System.out.println("Cleared!");
171181
}
172182
} else {
173183
//DATA
174184
text[cursorPos] = (char)data;
175185
int prevCursorPos = cursorPos;
176186
cursorPos += increment ? 1 : -1;
177-
System.out.println("Data: Wrote "+(char)data+" at "+prevCursorPos);
187+
if (debug)
188+
System.out.println("Data: Wrote "+(char)data+" at "+prevCursorPos);
178189
}
179190
}
180191

0 commit comments

Comments
 (0)