Almost all DMG and CGB games drive game progress by waiting for a V-blank interrupt which happens once per frame after all the visible scanlines have

fwsGonzo / gamebro

submited by
Style Pass
2021-07-17 18:30:04

Almost all DMG and CGB games drive game progress by waiting for a V-blank interrupt which happens once per frame after all the visible scanlines have been rendered. Specifically when LY turns 144, which is the first scanline outside of the screen. At that point you can only have MODE=1, which is V-blank.

When writing to the lower bits of MBC1 ROM bank selection range, keep in mind that if ROM/RAM mode select is in RAM mode then writing to the lower ROM bank bits should reset the upper bits. This is not the case for RAM banks.

When RAM bank mode is selected in MBC1, when writing the upper 2 bits, you also must set the ROM bank as well. In short both get modified. If RAM bank mode is not selected, ROM bank is modified as expected.

POP AF - The lower nibble of the FLAGS register is NOT writable. Since the lower nibble is always zero, you can mask off this value with flags &= 0xF0.

KEY1 - Many games need the bit at 0x80 to represent double speed mode. Make sure to not clobber it and set it only after enabling double speed.

Leave a Comment
Related Posts