Nintendo64 RGB DAC

Started by viletim, January 15, 2007, 10:28:52 PM

Previous topic - Next topic

viletim

I've been playing around with CPLDs (programmable logic ICs) recently and though I'd have a go at making an RGB DAC for the N64 out of one... Continuing on from the work of Aidan in this thread.

Aidan had it pretty much spot on - there are four 7-bit bytes of data sent from the RCP to the DAC. The first byte contains timing signals, second byte - red video, third - green video, and fourth - blue video. 7 bits * 3 colours = 21 bit RGB.

My CPLD counts the clock pulses from the RCP and stores the the RGB data in some flipflops. The timing signals (csync, hsync, clamp and vsync) are also available. The digital data is converted to an analogue video signal with binary weighted resistor DAC. I just used the closest values I had so it's not really optimal. I'll draw up a 74 logic equivalent of what's inside the CPLD in a little while...

Here's a screenshot screen shot from my RGB monitor.

NFG

That's bloody awesome, good work.

blackevilweredragon

21-bit color?  I thought nintendo said the console could do 24-bit color..

(confused)

kendrick

Tim, that is excellent work. I imagine this brings us one step closer to a homebrew Component and/or VGA cable for the Gamecube, given the theoretical similarities.

Dragon, as I understand it, commonly the bit-depth of data is often overstated by one digit in order to get a nice round number divisible by eight. The argument is, that extra bit is there but it's always zero. One more reason to completely distrust any kind of media hype or technical specs.

-KKC, being paid for making up numbers.

blackevilweredragon

oh, ok, so it's like how my LCD is supposed to be 24-bit color, but tech tests show it was only 20-bit, with massive "dot interlacing" to simulate the higher color...

Endymion

I want to be viletim when I grow up.

radorn

whoa.

I didn't visit here in months, then I remembered that new rgb mod from Aidan that seemed to be dead from inactivity and thought to myself "Why don't go see if someone said anything new about this in all this time??"
I have to say this is my lucky day HAHA... maybe if I had come earlier...

Thanks, viletim!

Sorry if this is considered littering as I'm not adding anything useful to the thread, but I just had to say it.

viletim!

Well...there are definately only 21 bits there. However there is some kind of hardware dithering going on.  If you connect a single bit up to a monitor you'll notice that some of pixels that are on the edges of some picture flicker a lot. I'll admit it confused me for a while...I thought there was something wrong with my flip-flop latches. Once all the bits of a colour are connected  through the DAC flickering edges dissapear.

If anyone's interested you can do a simple test to see what I mean: Connect a 1k resistor to one of the data bits  (the high order bits show it more clearly...the low order bits are a total pixel flickerfest) and another 1k resistor to the compostite sync output on the DAC. Connect other ends of the resistors together and connect that signal to the composite video of a TV.

Maybe Nintendo thought this kind of dithering effect was so shit hot that the upgraded their specs. :)

RARusk

"I want to be viletim when I grow up."

Doesn't everyone?

Anyway it appears that you have a nice bright picture coming out of the N64. Does this thing work on all N64s or just the more recent ones? And do you have to program that chip first before using it?
Console hacking is like sex. For best results you got to know where to poke.....

blackevilweredragon

QuoteWell...there are definately only 21 bits there. However there is some kind of hardware dithering going on.  If you connect a single bit up to a monitor you'll notice that some of pixels that are on the edges of some picture flicker a lot. I'll admit it confused me for a while...I thought there was something wrong with my flip-flop latches. Once all the bits of a colour are connected  through the DAC flickering edges dissapear.

If anyone's interested you can do a simple test to see what I mean: Connect a 1k resistor to one of the data bits  (the high order bits show it more clearly...the low order bits are a total pixel flickerfest) and another 1k resistor to the compostite sync output on the DAC. Connect other ends of the resistors together and connect that signal to the composite video of a TV.

Maybe Nintendo thought this kind of dithering effect was so shit hot that the upgraded their specs. :)
just tried..

that's EXACTLY what my LCD monitor does!

Dr.Wily

@+

       Dr.Wily

Simm's Club - French LAN Gaming (PC & Consoles) : http://www.asso-sc.com


viletim!

I've been playing around with some different designs for the resistor ladder... I think i'll just go with a more accurate binary weighted design - two resistors for most bits.

RARusk,
So far I can only guarentee that it works on my N64 but I beleive that it will work on any model/region N64. The CPLD does need to be programmed.

If all goes well then I'll make up some small PCBs and sell the programmed CPLD, resistors and board as a kit or something. Unfortunately it seems Futurlec (the only (semi)local supplier of CPLDs) may have recently stopped stocking the part I'm using (XC5936XL) - it's no longer listed on their website.  

viletim!

I've put up a page with a circuit and programming files HERE. The DAC circuit I settled on is an R2R type with no output buffer - it's directly driven by the CPLD. There are a lot of resistors there but fortunately they are all the same value.

For anyone who wants to attempt to build this thing I can supply preprogrammed chips for AU$9 and resistors, wire, etc for an extra AU$6. International ppd. Email: eviltim.optusnet@com@au

I don't know if the pinouts of the left side (pins 1-12) of the VDP and MAV DACs found in NTSC N64s match those of the DENC. It would be good if someone could check this.

Moosmann

#13
Great work :)

Double You in Germany offer this mod 9 years ago. However, the quality from the Double You Mod is much badder, compare to the old VDC-NUS RGB mod, because you have some colorglitches. I hope your mod works better



Here`s the connection from the Double You mod on a newer N64.



Bye Markus

viletim!

The quality is excelent. Take a look at some photos of goldeneye.

I was wondering what the double you mod looked like... It's interesting that it's powered from 5 volts (that poor little regulator must get hot) instead of 3.3 volts.

Moosmann

I want to buy 4 N64 Chips (without resistors). I habe a Board with an "AVDC-NUS" IC here.

Bye Markus  

sebi1000

Hey Moosmann, please contact me.
I�m from Germany, if we order the chips together we can save money.
sebi1000@web.de
Thanks!

viletim!

Moosmann,
No problem. I'll order some chips at the end of the week and i'll let you know when I have them (it usualy takes a couple of weeks for them to arrive). Could you take a photo of the AVDC-NUS DAC? I'd like to add it to my pinouts collection.

Guest

@viletim!:
I have a question: It is possible to programm the Chip that I don`t need the resistors ? :)

What is the reason, that you use so many 560 Ohm resistors instead seven resistors each color e.g. 1K, 2K, 4K, 8K and so on.. like the 3DO RGB Mod ?

Bye Markus

RARusk

Here's an interesting question: Can you use the DAC inside the GameCube Component Video Cable in place of what you have there? Or do the digital signals not match up?
Console hacking is like sex. For best results you got to know where to poke.....

viletim!

Moosmann,
The resistors are in an R2R configuation (as opposed to binary weighted) to get better accuracy. A binary weighted DAC would use fewer resistors but they would all be funny values (so you'd have to use two in parallel) and be less accurate (using 1% resistors) compared to an R2R. The optimal values for 7 bits binary weighted go something like: 700, 1400, 2800, etc

And yes, you need some resistors unless you you're happy with 3-bit RGB video :)

RARusk,
I don't have any Gamecube stuff so I can't really say. From a distance it does appear that both DACs operate similarly, with the Gamecube one having an extra bit or two. The GC DAC can output RGB and YUV but does anyone know which is the native format?

Moosmann

Thanks for your information. Is this the reason that the Double You mod don`t work correctly ? I think I will make some experiments with the resistors  when I received your Chips and compare with the old rgb mod from a japanese N64

BTW: The RGB Chip with the resistors looks like an animal :)

Bye Markus

Moosmann

QuoteHere's an interesting question: Can you use the DAC inside the GameCube Component Video Cable in place of what you have there? Or do the digital signals not match up?

@RARusk:

I just tried something, D0-D7 and D8-D1 or double soldering D7 & D8 (because the N64 have only 7 data lines) but it doesn`t work at the moment.







Bye Markus

RARusk

Pretty funky looking. I am assuming that you have RGB modified your GameCube cable, yes? I am going to guess that because there is an extra line of data that using the GameCube DAC chip may not work on the N64 after all. But keep plugging away. It could still work if the proper wiring can be figured out.

As for Viletim!, you really should get a GameCube and figure out it's digital signals. You might be the best person here to sort out if you can use another DAC with the GC instead of paying exorbant prices on Ebay for the GC Component Video cables. I consider myself very lucky to own two of the cables including the one I have modified for RGB use. It would be sweet to have an alternative chip to use. And perhaps another one to use on the N64 as well.
Console hacking is like sex. For best results you got to know where to poke.....

viletim!

Moosmann,
Interesting... Did you try to switch the DAC between RGB and YUV?

I'll see if I can find a cheap Gamecube to experement on...

radorn

Moosmann

As RARusk and viletim! asked, did you RGB-mod that cable?
I don't see the resistor that I've seen on the mods arround the net, it goes in a pin on the DAC that falls exactly on the upper left part as seen on the picture.
Maybe you implemented it differently, so I'm just guessing.

Still, I'm not so sure it would make a big difference.
I mean. It should'nt matter the format the dac is outputting, right? If the input is right, the output, whether RGB or YPbPr, given it is connected to the right equipment, should look correct, right?

Im not as experienced as any of you so don't mind much what I say. I was just especulating.

Anyway, viletim, I would be interested in your invention.
I live in Spain. How much would you need for each? I don't know yet how many I would get because a couple of friends of might be interested too.
it would be 4-5 as much. I pay upfront, of course, so there're no trust issues  

NFG

You certainly don't need a resistor, I've never used one in all my VGA/RGB cable mods.  It is only there for a little extra security against frying stuff - but that's a pretty dubious as well.

radorn

#27
QuoteYou certainly don't need a resistor, I've never used one in all my VGA/RGB cable mods.  It is only there for a little extra security against frying stuff - but that's a pretty dubious as well.
oh, I didn't know that.
I don't want to switch focus of the thread to gamecube stuff but, appart from security, is there any difference using it or not?

Some people says the GC VGA mod has quality issues, like bleeding red or something (can't quite remember what it was). Maybe a slighty weak signal.
Could that have to do with using or not a resistor? Just wondering.

Moosmann

Yes, I use the resistor (2 wires, isolation with an black heat shrink sleeve) for RGB.

Bye Markus

RARusk

"Some people says the GC VGA mod has quality issues, like bleeding red or something (can't quite remember what it was). Maybe a slighty weak signal. Could that have to do with using or not a resistor? Just wondering."

I've never had any issues with the GameCube RGB mod. It looks great in 15Khz (interlaced) and 31Khz (progressive) scan modes.
Console hacking is like sex. For best results you got to know where to poke.....

radorn

Hi.

Now that the digital video format of the n64 is "decoded", would it be possible to make a DVI/HDMI interface? I guess it would be.
Of course I'm not talking about feasibility, or cost (wich would be pretty high I'm afraid), and I'm aware that interest might not be enough; as much as I love my n64 I come to recognize it's graphics aren't that clean and crisp due to not so well used smoothing techiques, so maybe there wouldn't be too much of a benefit from mantaining video in digital form for, say, a pixel based display such as LCD or LED, without any analog transition, mainly because of the horizontal lines being converted from digital to analog and sampled back to digital, with probable misalignement respect of the original pixels as analog video doesn't really have pixels.

Never mind, I'm just daydreaming. I have yet to install this mod as I received it from viletim yesterday. I'll comment on it once I have it running, but that won't be for a while as I found myself really busy suddenly.

Moosmann

I installed a DAC from viletim! into an first PAL-N64 with "DENC" PPU. The quality is great. I haven`t compared the quality at the same time with the old NTSC VDC-Mod, but I think the quality is the same or a little better.

To get the best result, I use the S-Video Y-Signal instead composite video.

Greetings Markus

davidleeroth

Took a while to get started but I completed the mod yesterday and got it working right off the bat. (A rare occasion in my case)
I'll give it a try using SMD resistors next time though, my hands didn't like the twisting part that much.  :P

I mounted it on a PAL-DENC and the quality is great, there seems to be a little less noise when compared to the old NTSC mod. The difference is minimal though and I had to get really close to see it, surely not something you'd notice when playing.

Ur da man viletim!  

Moosmann

Quotequality is great, there seems to be a little less noise when compared to the old NTSC mod.

You`re right. But the problem is not from the rgb dac.

Check the RGB Cable whether it have a 75-Ohm resistor from Video (scart Pin 20) to ground. Or take the Y-Signal from S-Video as Sync instead composite Video.

The best way is to use an original Super Famicom RGB Cable with 75-Ohm resistor to ground.

You can also use 280 Ohm resistors instead the 2 parallel wired 560 Ohm resistors.

Greetings Markus

davidleeroth

I used the luma for sync, I think the noise has more to do with my "craftmanship" on the old mod. But as said, I can't tell the difference unless I pull my nose against the monitor.

On a not-so-related note, does anyone know how the region lockout chip works? I had region modded the console before and as I was working with the RGB mod one of the wires from the chip came off. I tried it just for fun and all the games booted to the title screen but froze in-game...

radorn

QuoteOn a not-so-related note, does anyone know how the region lockout chip works? I had region modded the console before and as I was working with the RGB mod one of the wires from the chip came off. I tried it just for fun and all the games booted to the title screen but froze in-game...
The PIF-NUS is not only a lockout chip but it also takes care of the controllers and stuff like that (PIF stands for Peripheral InterFace, I read somewhere). So actually the CIC chips seem to be considered peripherals on N64's architecture. That may have something to do with what you are experiencing, but then again, I'm sure there are a lot people that can tell you better about this.

Dr.Wily

If you try to get a n64 devkit you will be surprised to note this model has built in RGB suport. I don't know how is wired, but it is probably interesting to open this kind of unit.
@+

       Dr.Wily

Simm's Club - French LAN Gaming (PC & Consoles) : http://www.asso-sc.com


Barkuti

Hi guys, just googleing a bit for N64 stuff cos I recently cleaned a bit of the dust over it and... L@@k at this!

I'll be asking viletim for a kit asap!
How are you doing with this mod? One of the most annoying things about 4-player gaming was the tremendous blurriness over composite video in split screen... Did anyone tested a hi-res shooter like PD this way? The improvement here should be HUGE, isn't it?

Cheers
(first post btw!) :)

Barkuti

Hello again people,

Last friday 20th I received Tim's kit, although I've not managed to to install it yet due to time constraints and other little issues.
First, Tim sent me 56 out of the 60 resistors used by the circuit, maybe the cat ate those 4 missing ones :lol: ; 58 would have been enough, as R20 may be left common for all RGB resistor DACs, but alas...
Yesterday I had to make a quick trip to the city so I dropped by an electronics hardware store and purchased a couple dozens of standard 5% resistors (precision ones not available); after sorting out the pack with a multimeter and picking the cherry the problem is solved. I also purchased a socket for the sake of it.
Ok, enough talk. :P

The problem for me now is trying to remove the N64's heatsink. Those screws are soooo  tight it's like a nightmare made real. Maybe I'm not using a big enough Philips head (I hate Philips heads), but God those screws are so tight... I've already broken a cheap flathead tip and 4 or 5 of those screwheads are damaged... Only removed one screw so far (first one and wasn't hard :huh: ).
I've sprayed some multi-purpose oil around the screws, waiting for it to settle overnight...
I'll see what can I do tomorrow.
Tips are welcome.

Cheers

NFG

Go get a proper screwdriver.  With a proper tool those screws come out with no effort at all.