We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 377742d commit 1ac2fe0Copy full SHA for 1ac2fe0
core/src/main/java/eu/rekawek/coffeegb/core/gpu/StatRegister.java
@@ -160,6 +160,16 @@ public boolean accepts(int address) {
160
@Override
161
public void setByte(int address, int value) {
162
stat = (stat & 0b10000111) | (value & 0b01111000);
163
+
164
+ // Stats interrupt bug
165
+ // see https://gbdev.io/pandocs/STAT.html#spurious-stat-interrupts
166
+ if (!states.isEmpty() && !gpu.isGbc()) {
167
+ var state = states.getLast();
168
+ var mode = state.mode();
169
+ if (mode == VBlank) {
170
+ interruptManager.requestInterrupt(InterruptType.LCDC);
171
+ }
172
173
}
174
175
0 commit comments