blazer82 / gb.teensy

Gameboy emulator for the Teensy 4.1 microcontroller
GNU General Public License v3.0
119 stars 6 forks source link

Merging in Timer changes #17

Closed grantbreaksthings closed 2 years ago

grantbreaksthings commented 4 years ago

I originally intended on implementing a bunch of obscure Timer behavior, but it proved difficult to implement, slowed down execution, and just didn't expand functionality enough to warrant these trade offs.

This commit moves the Timer into its own class (renamed to GBTimer so it doesn't conflict with the Teensy Timer). The most important timer behavior has been replicated, and there's a clear skeleton for future work if we want to implement any obscure timer behavior.

The following mooneye-gb Timer tests pass with this implementation:

Also made these mooneye-gb tests pass. They're not related to the Timer.

blazer82 commented 4 years ago

Awesome work, thanks a lot! I'll merge this after I had time to give it a spin on my hardware.

Also, I'll see that I can integrate all the passing tests into the build pipeline.

blazer82 commented 4 years ago

So, I tested this on my hardware. First of all, I wasn't able to compile until I changed the #include <Timer.h> into #include "Timer.h". No idea why that is.

Then... although Super Mario Land now looks better on the start screen, there's still not much happening besides that. Not even sound. At least for me. That's okay, of course! Only: given that Tetris is now considerably slower (around 92% speed) I am hesitant to merge this because it basically worsens the Tetris experience while not adding any more benefits. I hope you can see what I mean.

All in all, this is very good progress, just not ready for merging into the master yet.