« on: February 23, 2014, 10:41:28 am »
The title says it all.
Please don't tell me something like this:
I just want to know about the normal Gameboy, I need to know after how many CPU-CYCLES a Vblank-interrupt might going to be fired up.
If you're working on emulator related stuff (writing emulation code), this site is probably not the best place for that info.
That said, just look at what you posted. The refresh rate of the screen is ~59.7 times a second. That's ~16.75ms per frame (the total time a frame takes, including vblank). Vblank is listed as last ~1.1ms. That pretty much tells you all that you need to know.
The active display is 144 pixels. 144+vblank = 16.75ms. Vblank is ~1.1ms. Vblank is somewhere between 10 to 11 scanlines in length (which sounds about right, from memory). Vblank is going to happen every ~70,256 master clock cycles or 17,564 cpu cycles (the master clock is 4,194,304hz. Since all cpu cycles are exactly 1/4 the master clock, most emulators and docs list the 'cpu cycles' in the 1/4 format). The start of the display is 0, the end of the display is 144 (start of vblank). So, assuming vblank is 11 scanlines long - the vblank interrupt is fired ~16,317 cpu cycles after the start of every frame.
If you want better precision than that, you'll need to look at some emulator source code or talk to an emulator author that knows the gameboy.
EDIT: The GB/C cribsheet says the vblank time is 10 scanlines. So there you go. I suggest you get that cribsheet (GBCribSheet000129.pdf)
Description Frequency/Time 1x Clocks 2x Clocks
Horizontal Scanline Time 108.7 μs 114 228
V-Blank Period (10 scanlines) 1087 μs 1140 2280
Mode 10 19.31 μs
Mode 11 41.37 μs to 70.69 μs
Mode 0 with 10 sprites per scanline 18.72 μs
Mode 0 with no sprites per scanline 48.64 μs
CPU Clock Speed 4.194/8.838 Mhz 1,048,576/sec 2,209,715/sec
Horizontal Sync Frequency 9198 Hz
Vertical Sync Frequency 59.73 Hz 17555/frame 36995/frame