It is currently Mon Dec 11, 2017 5:58 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Mon Oct 23, 2017 8:51 am 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 750
Location: New York, NY
Is a Game Boy LCD rendering diagram available that is analogous to the NES / Famicom PPU Rendering Diagram?

Since an LCD doesn't contain a moving ray like a CRT, I assume the horizontal and vertical blanking times are artificially introduced by the Game Boy video circuitry. And, there are interrupts associated with these events. That being the case, do Game Boy emulators simply generate one full scanline at a time between triggering HBlank interrupts? Or, for accurate raster effects, do Game Boy emulators handle individual pixel timing, like NES / Famicom emulators?

Also, since there is no ray, are the LCD pixels updated at a consistent rate like a CRT? Or, does the Game Boy video circuitry update pixels in bursts?


Top
 Profile  
 
PostPosted: Mon Oct 23, 2017 9:18 am 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1311
The game boy's video output takes a certain number of cycles per line. Depending on whether or not the short pixel buffer going to the display has to be flushed and restarted, the dot clock will be halted until this is complete, which in turn reduces the length of h-blank to compensate. Ultimately the line length is the same, just with gaps in it.

This presentation covers your questions thoroughly I hope: https://www.youtube.com/watch?v=HyzD8pNlpwI


Top
 Profile  
 
PostPosted: Mon Oct 23, 2017 9:31 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19331
Location: NE Indiana, USA (NTSC)
"Nitty Gritty Game Boy Cycle Timing" by Kevin Horton

Yes, the Game Boy's PPU pauses at times when clocking pixels into each scanline. It pauses when loading each sprite's pattern, at the start when skipping pixels for fine scroll, and when switching from the main plane to the window plane.


Top
 Profile  
 
PostPosted: Mon Oct 23, 2017 9:41 am 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 750
Location: New York, NY
@mikejmoffitt Thanks for the YouTube link. I'll watch through that presentation when I get a chance.

@tepples Thanks for the doc.

Do any Game Boy games use exact pixel timing (as opposed to complete scanline timing) to generate graphical effects, as is occasionally seen in NES games? Kevin Horton's doc is marked as preliminary, suggesting that current emulators might not be using all of the rendering details.


Top
 Profile  
 
PostPosted: Mon Oct 23, 2017 10:08 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19331
Location: NE Indiana, USA (NTSC)
The demoscene-inspired title screen of Prehistorik Man uses timed code to lighten or darken the palette, but that's probably it. Otherwise, timed code is not as necessary because the Game Boy PPU has a built-in scanline counter and hblank status register.


Top
 Profile  
 
PostPosted: Mon Oct 23, 2017 10:14 am 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 750
Location: New York, NY
tepples wrote:
The demoscene-inspired title screen of Prehistorik Man uses timed code to lighten or darken the palette, but that's probably it. Otherwise, timed code is not as necessary because the Game Boy PPU has a built-in scanline counter and hblank status register.


That's really impressive for the GB. I wonder if that homebrew will work correctly on the Super Game Boy or Color Game Boy, if there are any pixel timing differences that is.


Top
 Profile  
 
PostPosted: Mon Oct 23, 2017 10:49 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19331
Location: NE Indiana, USA (NTSC)
SGB should be cycle-identical to Game Boy because it works by collecting pixels into a frame buffer that it sends to the Control Deck. GBC I don't know because I don't own a copy of that game.


Top
 Profile  
 
PostPosted: Tue Oct 24, 2017 7:27 am 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 750
Location: New York, NY
I read more about the difficulty in getting games like Prehistorik Man to work. Unfortunately, the emulator authors that understand the functionality of the Game Boy PPU are not documenting and sharing the info, limiting the ability of others to develop highly accurate emulators. We need a site like nesdev for the GB with people interested and able to do the research.


Top
 Profile  
 
PostPosted: Tue Oct 24, 2017 7:47 pm 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 750
Location: New York, NY
@mikejmoffitt That video is brilliant.

@tepples After watching the video, that doc makes much more sense.

I may have to mess this with after all. Thanks guys. Hopefully, someone will combine this info into a great wiki one day.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group