trekawek/coffee-gb

Pokemon Blue crashes since latest updates

Closed this issue · 1 comments

Since the latest updates, Pokemon Blue/Red crashes when loading the game world:

gif

Stacktrace:

Exception in thread "Thread-1" java.lang.IndexOutOfBoundsException: Address: 40960
        at eu.rekawek.coffeegb.memory.Ram.getByte(Ram.java:43)
        at eu.rekawek.coffeegb.gpu.Fetcher.tick(Fetcher.java:133)
        at eu.rekawek.coffeegb.gpu.phase.PixelTransfer.tick(PixelTransfer.java:69)
        at eu.rekawek.coffeegb.gpu.Gpu.tick(Gpu.java:177)
        at eu.rekawek.coffeegb.Gameboy.tick(Gameboy.java:173)
        at eu.rekawek.coffeegb.Gameboy.run(Gameboy.java:132)
        at java.base/java.lang.Thread.run(Thread.java:833)

It still worked fine with commit: 9f2ea20
But is now crashing, commit: 660ce4b

So something in between those commits likely introduced a bug.

Thanks! The new Window Internal Line Counter should be reset when the LCD is disabled. Fixed in 821b7f6.