Gameboy VGA Adapter
*Update* Added full screen support. Video below.
Well I decided to see if I could output the Gameboy’s display on a VGA monitor a few weeks ago and finally got around to doing it. The only real hard part I came across was the fact that I could not find pinout information for the Gameboy Pocket’s CPU or LCD. Luckily there is info for the original DMG Gameboy out on the internet. Using the known pins for VSYNC, HSYNC, CLK, DATA0 and DATA1 I was able to get the frequency for the pins.
VSYNC: 59.7275Hz pin 13
HSYNC: 9.259kHz pin 4
CLK: 4.167MHz pin 7
DATA: 1.911kHz (with screen suck with no cartridge in) DATA0 pin 5, DATA1 pin 6
*pins are on the LCD connector
Using this information I was able to probe the signals with a oscilloscope. A display frame starts with a vertical sync pulse. While the VSYNC line is still high one horizontal sync pulse goes off. Yellow is VSYNC, Blue is HSYNC.
When the horizontal pulse goes off the clock line starts with one pulse while the horizontal line remains high. Yellow is HSYNC, Blue is CLK.
The trick here was in the verilog code when to get the pointer in the video ram buffer to go back to 0. Since there is one horizontal pulse while VSYNC is high and one clock pulse while HSYNC is high you are able to get a set of conditions that are only true when it is at the start of the frame. So always at the negative edge of the clock have it check to see if both VSYNC and HSYNC are high, if they are then reset the pointer back to 0.
Now the data lines on the LCD are 2 bits for the 4 shades on the screen. The data lines look to be sampled on the negative edge of a clock pulse.
For each vertical pulse there are 144 horizontal pulses and for each horizontal pulse there are 160 clock pules in each horizontal pulse. Doing this makes up the Gameboys 160×144 screen resolution.
Below is a video of the working prototype. I am using a Terasic DE1 development board that has a Altera Cyclone II FPGA. There is a voltage divider between the Gameboy and FPGA to drop the 5v lines down to 3.3v for the FPGA.
[stream provider=youtube flv=http%3A//www.youtube.com/watch%3Fv%3DNUIWsUHntf8 img=x:/img.youtube.com/vi/NUIWsUHntf8/0.jpg embed=false share=true width=480 height=360 dock=true controlbar=bottom skin=imeo.swf bandwidth=high autostart=false /]
http://www.youtube.com/watch?v=NUIWsUHntf8
Added full screen support
[stream provider=youtube flv=http%3A//www.youtube.com/watch%3Fv%3DM-bC5rG-CRk img=x:/img.youtube.com/vi/M-bC5rG-CRk/0.jpg embed=false share=true width=480 height=360 dock=true controlbar=bottom skin=imeo.swf bandwidth=high autostart=false /]
Greetings, i am very interested in this project of yours. if you can come up with a project kit that is easy to install, I’d like to make it available to chiptunes musicians who use modded gameboys to make music. it would be very cool to have an external monitor and may do away with the need to backlight gameboys. please keep me posted of your progress and if you need any dev money to get things done quicker/easier.