You are browsing as a guest. Sign up (or log in) to start making projects!

6h 44m 54s logged

Devlog 12 - Timers, HALT and MBCs

Timers

  • I’ve implemented the timer registers, which increment at a set interval based on the CPU clock. These are used for getting random numbers for Tetris, to pick random Tetriminos, and also used for other things, namely an interrupt is requested when one of the registers overflows and resets. These weren’t too hard to implement, and I based by implementation off of js-GB once again

HALT and some interrupt fixes

  • Previously, HALT, and some of the interrupt handling was basically a placeholder, meaning that it didn’t really run properly at all. I’ve now fixed that, meaning the emulator can now pass test ROM 2.
  • I also implemented the STAT interrupt, although I’m not entirely sure it is accurate, as my PPU implementation still isn’t perfect.

Memory Bank Controllers (MBCs)

  • Finally, I added some basic support for the MBC1 chip that was frequently included on earlier Gameboy games. This allows the games to exceed the memory limit of 32KiB, instead including a mapper chip that allowed the switching of ROM banks. I based my implementation off of this blog of the development of the PlayKid emulator, and also partially off js-GB again. Now, the emulator is able to start bigger games, and I’ve tested Super Mario Land so far. This also allowed me to pass the combined version of all of the CPU instruction tests.

Misc

  • I also fixed a bug with the CPU instruction timing, allowing me to pass blargg’s CPU timing test
0
7

Comments 0

No comments yet. Be the first!