It is currently Sat Dec 16, 2017 7:40 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 104 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next
Author Message
PostPosted: Mon Aug 17, 2015 3:41 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19353
Location: NE Indiana, USA (NTSC)
mikejmoffitt wrote:
I am assuming the refresh rate of the Game Boy would be locked to the updating of the CHR data the NES is displaying so there isn't tearing / lag.

When I was programming the Game Boy Advance, the number 280896 cycles per frame was drilled into me, and the best guess for its crystal was 2^24 Hz = 16.7772 MHz. The Game Boy runs at one-fourth the clock speed (4.1943 MHz) but has one-fourth the cycles per frame: 70224. This means the frame rate is 4194304/70224 = 59.7275 Hz for both systems.

The NTSC NES and Super NES run slightly faster, based on a 945/44 = 21.4773 MHz master clock. (This is six times 315/88 = 3.57955 MHz, the NTSC color burst frequency.) The frame is 1364*262-2 = 357366 master clocks long for a 60.0988 Hz frame rate.

Super Game Boy clocks the Game Boy hardware at 1/5 of the Super NES master clock rate, or 189/44 = 4.29545 MHz, which is 2.42% faster than the standard Game Boy clock. The video circuit ends up producing 61.1679 frames per second, causing the SGB to skip frames. This is also why the original Super Game Boy lacks a a link port, as the speed difference from a standard Game Boy is enough to cause games to desync. The rare SGB 2, released to support Pocket Monsters, has its own crystal to produce a more accurate clock signal.

The only external clock signal on the Famicom cart edge is M2, which is master divided by 12. The NES additionally provides master, but 72 to 60 pin adapters don't. It's possible to use a PLL to multiply M2 by some factor to produce a clock signal for the FPGA. But then we run into a problem: do we want correct game speed, audio pitch, and link cable speed, or do we want to align NES vblank to Game Boy vblank without skipping or repeating frames? The speed factor differs for the two approaches.

EDIT: correction to Game Boy mono calculation


Top
 Profile  
 
PostPosted: Tue Aug 18, 2015 10:21 am 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1312
tepples wrote:
mikejmoffitt wrote:
I am assuming the refresh rate of the Game Boy would be locked to the updating of the CHR data the NES is displaying so there isn't tearing / lag.

When I was programming the Game Boy Advance, the number 280896 cycles per frame was drilled into me, and the best guess for its crystal was 2^24 Hz = 16.7772 MHz. The Game Boy runs at one-fourth the clock speed (4.1943 MHz) but has one-fourth the dots per frame: 70224. This means the frame rate is 4194304/70224 = 59.7275 Hz for both systems.


I believe you mean one-fourth the cycles per frame here.

tepples wrote:
The only external clock signal on the Famicom cart edge is M2, which is master divided by 12. The NES additionally provides master, but 72 to 60 pin adapters don't. It's possible to use a PLL to multiply M2 by some factor to produce a clock signal for the FPGA. But then we run into a problem: do we want correct game speed, audio pitch, and link cable speed, or do we want to align NES vblank to Game Boy vblank without skipping or repeating frames? The speed factor differs for the two approaches.


The ideal approach for me would be as follows:
Using a PLL on M2 as you've mentioned, run the FPGA-GB at a speed that has the GB Vsync and the NES Vsync in lockstep - genlock them. The game might be *slightly* too fast or too slow, but people did not get upset with this in the Super Game Boy. Frameskips and tearing are very interruptive to the already limited graphical experience, and since the appeal here is looking at a Game Boy on the television, the graphical presentation is a high priority. We can do better than the SGB by having optional sound pitch correction, since this gives us control over the audio generation hardware. For those who are concerned with the link port speed matching other devices, an option to de-sync the systems might be an okay idea.


Last edited by mikejmoffitt on Tue Aug 18, 2015 11:34 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Tue Aug 18, 2015 11:31 am 
Offline

Joined: Tue Aug 18, 2015 11:09 am
Posts: 6
I would be interested. And will follow this thread


Top
 Profile  
 
PostPosted: Tue Aug 18, 2015 11:41 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6535
Location: Seattle
mikejmoffitt wrote:
Using a PLL on M2 as you've mentioned, run the FPGA-GB at a speed that has the GB Vsync and the NES Vsync in lockstep - genlock them.
Unfortunately, the PLL ratio needed there is the fairly obnoxious 140448 ÷ 59561, or approximately 2.358

(Showing my work: 3 (pixels/M2 cycle) ÷ (178683÷2 pixels/source frame) × 70224 (pixels/target frame))


Top
 Profile  
 
PostPosted: Tue Aug 18, 2015 11:54 am 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1312
lidnariq wrote:
mikejmoffitt wrote:
Using a PLL on M2 as you've mentioned, run the FPGA-GB at a speed that has the GB Vsync and the NES Vsync in lockstep - genlock them.
Unfortunately, the PLL ratio needed there is the fairly obnoxious 140448 ÷ 59561, or approximately 2.358

(Showing my work: 3 (pixels/M2 cycle) ÷ (178683÷2 pixels/source frame) × 70224 (pixels/target frame))

Hm, that's pretty bad. Perhaps a clock on the cart can target the solved speed, and can either correct itself to match, or just have to skip the occasional frame. I would prefer a consistent occasional frameskip over tearing, though.


Top
 Profile  
 
PostPosted: Tue Aug 18, 2015 12:12 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19353
Location: NE Indiana, USA (NTSC)
It's also something that a PLL multiplier followed by a DDA clock divider can probably handle.


Top
 Profile  
 
PostPosted: Wed Aug 19, 2015 10:03 am 
Offline

Joined: Fri Feb 15, 2013 12:00 am
Posts: 27
I would buy this cart. Would a game manuals viewer in the menu be possible?


Top
 Profile  
 
PostPosted: Wed Aug 19, 2015 11:55 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19353
Location: NE Indiana, USA (NTSC)
A game manual viewer might not even be needed if enough people bribe me to make an e-book reader for NES, as then you'd just have e.g. "Dr. Mario.nes" and "Dr. Mario manual.nes".


Top
 Profile  
 
PostPosted: Wed Aug 19, 2015 8:19 pm 
Offline

Joined: Tue Nov 23, 2004 9:35 pm
Posts: 634
tepples wrote:
A game manual viewer might not even be needed if enough people bribe me to make an e-book reader for NES, as then you'd just have e.g. "Dr. Mario.nes" and "Dr. Mario manual.nes".


What about a Playchoice-10 instructions viewer program? Wouldn't cover all the games, but it should be sufficient for the 52 that did find their way to a PCB.

_________________
Nerdly Pleasures - My Vintage Video Game & Computing Blog


Top
 Profile  
 
PostPosted: Thu Aug 20, 2015 8:45 pm 
Offline
User avatar

Joined: Sat Oct 29, 2005 2:09 am
Posts: 502
Location: Indianapolis
re: how to get systems to run at the proper speed, I have the PLLs on the FPGA and my own oscillator. If I wish to frame-lock I can also do a more complex method with a phase accumulator to generate the system clock and dial in any clock speed desired.

I will not use the NES' clock to time anything.

_________________
/* this is a comment */


Top
 Profile  
 
PostPosted: Fri Aug 21, 2015 12:56 am 
Offline
User avatar

Joined: Thu Aug 20, 2015 2:43 pm
Posts: 3
Even though I have a N8, I would definitely get one of your carts. GB support and better compability would be awesome.


Top
 Profile  
 
PostPosted: Fri Aug 21, 2015 10:34 am 
Offline
User avatar

Joined: Sat Jul 12, 2014 3:04 pm
Posts: 950
kevtris wrote:
Mappers would not be user-updateable

That's a feature I would want in a devcart.


Top
 Profile  
 
PostPosted: Tue Aug 25, 2015 1:37 pm 
Offline
User avatar

Joined: Mon Mar 30, 2009 4:40 pm
Posts: 306
I will buy one for sure.


Last edited by nintendo2600 on Thu Aug 27, 2015 6:06 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Tue Aug 25, 2015 6:24 pm 
Offline

Joined: Wed Aug 06, 2014 3:45 pm
Posts: 18
What about the pirate mappers for the pokemon games and the ff7 demake? Will those be supported as well?


Top
 Profile  
 
PostPosted: Tue Aug 25, 2015 9:01 pm 
Offline

Joined: Sun Jan 06, 2013 9:56 pm
Posts: 41
I'd definitely order one, and a Famicom version as well if you were to make one.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 104 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 guests


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