I asked Shonumi about this a while back, he gave me a ton of great information:
http://imrannazar.com/Programming
http://marc.rawer.de/Gameboy/Docs/GBCPUman.pdf
http://www.multigesture.net/articles/how-to-write-an-emulator-chip-8-interpreter/
Tips from Shonumi:
"Now for some pro-tips, i.e. how to avoid major PITA moments:
When doing input, you should never return zero when reading from P1 (0xFF00). This can cause a variety of graphical glitches. You should instead return 0xFF, which means no input is being entered on the P1 register.
The LCD renders per-scanline, so on each HBlank, you'll need to determine which line needs to be draw using which pixels
Opcodes 0x07, 0x0F, 0x17, and 0x1F require you to set Bit 7 of the Flag Register, unlike the extended opcodes (0xCB07, 0xCB0F, etc) with the same mnemonic name.
The GB compares two registers (LY and LYC) to determine if a STAT interrupt should occur. You should compare LY and LYC after you update LY. LY represents the current scanline, so when you enter into an HBlank, update LY by one first, then compare LY and LYC to see if you should raise a STAT interrupt."
http://imrannazar.com/Programming
http://marc.rawer.de/Gameboy/Docs/GBCPUman.pdf
http://www.multigesture.net/articles/how-to-write-an-emulator-chip-8-interpreter/
Tips from Shonumi:
"Now for some pro-tips, i.e. how to avoid major PITA moments:
When doing input, you should never return zero when reading from P1 (0xFF00). This can cause a variety of graphical glitches. You should instead return 0xFF, which means no input is being entered on the P1 register.
The LCD renders per-scanline, so on each HBlank, you'll need to determine which line needs to be draw using which pixels
Opcodes 0x07, 0x0F, 0x17, and 0x1F require you to set Bit 7 of the Flag Register, unlike the extended opcodes (0xCB07, 0xCB0F, etc) with the same mnemonic name.
The GB compares two registers (LY and LYC) to determine if a STAT interrupt should occur. You should compare LY and LYC after you update LY. LY represents the current scanline, so when you enter into an HBlank, update LY by one first, then compare LY and LYC to see if you should raise a STAT interrupt."
Gaming Rig
Spoiler: (Show Spoiler)
