GBS 8200/8220 CFW Project

The place for all discussion on gaming hardware
User avatar
AndehX
Posts: 790
Joined: Sun Oct 18, 2015 11:37 pm

Re: GBS 8200/8220 CFW Project

Post by AndehX »

I certainly hope the VGA to HDMI encoder on that thing is alot better than those cheap converters you can buy on ebay. I tried a few different ones a while back and they all had the same issue, turning the image a disgusting shade of green.
nightuser
Posts: 3
Joined: Thu Nov 02, 2017 1:12 pm

Re: GBS 8200/8220 CFW Project

Post by nightuser »

Hi,

I recently started messing with this thing in my spare time. Unfortunately, I didn't get good results with dooklink's startup and resolution register settings (for some reason the output is very noisy). It's hard to figure out the effects that registers have, especially without logic analyzer (I want to dump the initial settings from the IC, because sequential dumps via I2C produce different outputs).

So, I'm interested in trying out rama's firmware (but I don't have a VGA capture solution).
Last edited by nightuser on Fri Nov 03, 2017 11:14 pm, edited 1 time in total.
rockofclay
Posts: 4
Joined: Fri Nov 03, 2017 6:11 am

Re: GBS 8200/8220 CFW Project

Post by rockofclay »

Edit: Whoops double post!
Last edited by rockofclay on Sat Nov 04, 2017 3:19 am, edited 1 time in total.
rockofclay
Posts: 4
Joined: Fri Nov 03, 2017 6:11 am

Re: GBS 8200/8220 CFW Project

Post by rockofclay »

Looks great. I'm trying to get some scanline goodness happening with my PAL SNES. I've ordered a SCART cable, a LM1881 and a female plug to wire it in. Should I get the HDMI version or stick to the 8200?
nightuser
Posts: 3
Joined: Thu Nov 02, 2017 1:12 pm

Re: GBS 8200/8220 CFW Project

Post by nightuser »

Hi,

For some reason my previous post seems to be lost.

I have recently started messing with GBS8200. I'm trying to make it work better with my PS1. dooklink's startup and settings arrays didn't help me: the output is very noisy (much worse than on original firmware).

rama: I'm interested in your firmware, as it may shed light on the purpose (and consequences) of some registers I currently don't understand. Unfortunately, I don't have any VGA capture devices.

UPD: It seems that due to pre-moderation both of my posts are posted, sorry for that.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

You'll find that creating register dumps with 'd' is reliable now.
I made it so that the output can be copy pasted easily into existing presets.
Also, I try to conserve space by ignoring unused register space.
File size for a full preset went from 1.5kB to .5kB. It all sits in Arduino program memory / flash and we usually have 32kB of that.

'g' - get register: g0g40 will return segment 0, register 0x40
's' - set register: s0s40s7f will set segment 0, register 0x40 to 0x7f
't' - toggle bit: t0t40t7 will toggle the most significant bit in segment 0, register 0x40

The multi-character command parsing is ..bad. After a while, it tends to drop some bytes. It wasn't simple to get the hex writing working ><
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

rockofclay wrote:Looks great. I'm trying to get some scanline goodness happening with my PAL SNES. I've ordered a SCART cable, a LM1881 and a female plug to wire it in. Should I get the HDMI version or stick to the 8200?
You could take a gamble with the HDMI version. I'm 99% convinced it is a regular GBS8200 with tacked on VGA > HDMI transcoder.
The Trueview 5725 is actually capable of digital output but from the board layout, it looks like they just transcode the VGA.
So if that is the case, you can use custom software on it and as long as the HDMI receiving device likes the timings, it will work.

If you're just starting out, get the regular board though. Or get a couple of each, seeing how much these cost :)
rockofclay
Posts: 4
Joined: Fri Nov 03, 2017 6:11 am

Re: GBS 8200/8220 CFW Project

Post by rockofclay »

rama wrote:
rockofclay wrote:Looks great. I'm trying to get some scanline goodness happening with my PAL SNES. I've ordered a SCART cable, a LM1881 and a female plug to wire it in. Should I get the HDMI version or stick to the 8200?
You could take a gamble with the HDMI version. I'm 99% convinced it is a regular GBS8200 with tacked on VGA > HDMI transcoder.
The Trueview 5725 is actually capable of digital output but from the board layout, it looks like they just transcode the VGA.
So if that is the case, you can use custom software on it and as long as the HDMI receiving device likes the timings, it will work.

If you're just starting out, get the regular board though. Or get a couple of each, seeing how much these cost :)

Sounds good. May try the HDMI version out later, but for now I've got the standard board and the parts for a diy scanline generator on their way. Would it be better to do the scanlines before or after the 8200?
nightuser
Posts: 3
Joined: Thu Nov 02, 2017 1:12 pm

Re: GBS 8200/8220 CFW Project

Post by nightuser »

You should use scanline generator only after the image was upscaled. In other case you would just lost half of the lines (and you only have 240/288 of them).
rockofclay
Posts: 4
Joined: Fri Nov 03, 2017 6:11 am

Re: GBS 8200/8220 CFW Project

Post by rockofclay »

nightuser wrote:You should use scanline generator only after the image was upscaled. In other case you would just lost half of the lines (and you only have 240/288 of them).
Ah cool I thought that may be the case but I wasn't sure. Does the 8200 have much lag? I've tried to have a look but I couldn't work it out.
User avatar
Blair
Posts: 681
Joined: Mon May 11, 2015 5:59 am
Location: America

Re: GBS 8200/8220 CFW Project

Post by Blair »

rama wrote:that will transform your GBS into something quite remarkable :)
That sounds very exciting rama, what exactly have you managed to do by customizing the firmware on the GBS board? does it actually line double 240p instead of de-interlacing the signal? and how does it handle 480i and 480p sources? has the latency changed?

I have a friend that really wants to build a custom kit with a GBS board, since he uses a really nice Mitsubishi CRT VGA monitor for all of his mame needs, but he's been really interested in connecting his original 16-bit and 32-bit hardware up to his cab. would you be able to put together a GBS moding guide/video of some type? (I know you seem to be in the middle of beta testing though).
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

@Blair
It still uses the original dooklink hack for 240p progressive.
The deinterlacing unit can be configured to treat the input as progressive.
I've disabled all the extra processing that was still enabled in the original presets, which fixed a few odd glitches.
The output of the deinterlacer is now a single buffer, progressive picture with no artefacts.
It can be scaled to any size (it's not a line doubler, it's a scaler).

Lag is very low still, mainly because I work with a single buffer. It should be about 16ms + whatever your display requires.
It is low enough that I get '0ms' lag on the 240p test suite manual lag tester.

The price for using a single buffer is a noticeable tearing artefact, depending on the source frame rate.
This can be eliminated by slightly de/increasing the total horizontal pixels, so that the in and output rates match up.
I have something in my control program that does this automatically but I'm not too happy with it yet.
Maybe it'll have to be manual presets for each console, not sure yet.

So what does it all add up to?
Basically a cleanly upscaled image from retro consoles with very little lag.
It looks nice and works well.
And if the stars align right (sampling phase and PLL divider are just perfect), then the image is fantastic!
It can do razor sharp pixels with no scrolling shimmering then.

And it costs $30 all in all :)
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Input options:
The hardware is built to accept either Component Video or RGB with combined sync.
Theoretically, it also supports RGBHV (say, from a Dreamcast VGA out), but I find that the vertical input is very picky.
It's better to combine H/V on the board, than trying to use the separate inputs directly.
Due to the deinterlacer unit not being bypassed, we get the extra benefit of almost seamless 480i / 240p switching.
480i is currently not being handled. That means, it looks like 480i looks on a regular old CRT TV. Flickery but acceptable.

Output options:
In version 1, VGA only. I optimized the 1280*1024 preset the most, but other resolutions up to 1080p are possible.
Later on, I plan to have a Component Video output as well, to support more generic TVs that don't have a VGA input.
Of course, one can always use a cheap VGA to HDMI transcoder. The one I tried failed though, as it only outputs in limited RGB range.
User avatar
dwards
Posts: 35
Joined: Tue Nov 19, 2013 4:17 pm

Re: GBS 8200/8220 CFW Project

Post by dwards »

rama,

What platform will you release the code on, or is it already out there? rPi zero W? I'm interested in a browser based control of this firmware, that sounds really cool. I used the original dooklink firmware which worked great for me. The one issue I had was it did not accept component due to using that input to display the menu. Component input sounds interesting for sure (PS2 up-scaling PS1 games). I hope this feature sticks. I'll try it out when you release.

dwards
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Once I hear back from the testers and finalize the main preset, I'll prepare a general release.
In keeping with the overall theme of cheap and diy, it runs on Arduino!

Anything that can talk I2C and has a little storage space will work though. For example, I already ported it to NodeMCU / ESP8266.
This still uses the Arduino IDE and most of the logic and preset loading, but adds WiFi for that web browser control idea :)
Maybe that insane 160Mhz clock speed option can be useful as well. It might be enough to sample the ADC clock of the 5725 for automatic phase control?

Component input works fine, from what I can tell. The initial version already supports it :)
User avatar
dwards
Posts: 35
Joined: Tue Nov 19, 2013 4:17 pm

Re: GBS 8200/8220 CFW Project

Post by dwards »

That's all great news! I think I may just stick to a Raspberry Pi Zero W and send the commands via SSH. One thing I still have trouble with is the color. I can never really get the colors to look right. Maybe the analog pots on my board are a little wiggy. What do you think of the idea of de-soldering them and putting straight resistors on there? Can the colors just be controlled digitally? That would make it easier to reproduce the same results everytime.

Rama, will your code have any color control?
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

dwards wrote:Maybe the analog pots on my board are a little wiggy. What do you think of the idea of de-soldering them and putting straight resistors on there?
Image
This is what I think of those trimpots :)

They're not just wiggly, they are a real problem when fine tuning the colors.
The problem with the pots is that they're imprecise and can't be set to 0 Ohm (more like ~ 2.1 Ohm minimum)
I already decided to recommend people remove them and replace them with a wire link as shown.

The board has standard 75 Ohm termination resistors already installed.
Since these pots not only add series resistance, but also resistance to ground, the actual pulldown with them in place is about 68 Ohm.
And worst of all: For some reason this affects one channel (green) more than the others.

I guess these pots are a way to get the advertised 'Arcade Converter' functionality.
I hear arcade boards use stronger RGB signals.
Well, we mostly require common TV appliance standards and for that, 0 Ohm is the correct series resistance.

By the way, there is an additional 200 Ohm in series on each channel.
I'm not 100% sure yet what they're supposed to be doing.
It might be be something with the impedance into the AC coupling capacitor after the 200 Ohm.
If not, then it's just additional input protection and should probably be removed as well.
dwards wrote:Rama, will your code have any color control
The chip offers full control over the ADC offset and gain per channel. I have code in place that automatically adjusts them.
It uses an Arduino ADC input that measures one channel constantly.
Over time (after a few screens where the game shows some white), it finds the correct ADC gain value.
Works better than I just described it ;)

Later on, there's a huge set of digital "enhancement" controls that can be used to implement gamma correction, etc.

Hope that helps? :)
Last edited by rama on Fri Nov 10, 2017 7:07 pm, edited 1 time in total.
User avatar
SCARTicus
Posts: 189
Joined: Wed Apr 05, 2017 4:51 pm
Location: TX

Re: GBS 8200/8220 CFW Project

Post by SCARTicus »

Rama, I just wanted to let you know that I am very excited about this. I am sure that many others are as well. This will be a true game-changer in our hobby. Thank you for your work. Also thanks to Dooklink.

I can solder, but I have zero experience with microcontrollers. I am, however, confident that I can get this working if I just had a written guide.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

SCARTicus wrote:Thank you for your work. Also thanks to Dooklink.
Yep, I'm using Dooklinks great foundation and additional work from mybook4 with the I2C bit banger.
They got this started :)
SCARTicus wrote:I can solder, but I have zero experience with microcontrollers. I am, however, confident that I can get this working if I just had a written guide.
Perfect!
To get this going, all people will have to do themselves is solder on the microcontroller and maybe build / buy an adapter cable.
(The VGA input can be used with an adapter dongle. This gets SCART into the device nicely. Otherwise, the supplied pin header cable can be combined with a SCART socket.)

Well, and a sync stripper or CSync cable.. I always forget that :p
With help from other developers, this requirement might get dropped later on.
The device can use even Composite Video for sync but I can't get it fully stable over different consoles.
User avatar
dwards
Posts: 35
Joined: Tue Nov 19, 2013 4:17 pm

Re: GBS 8200/8220 CFW Project

Post by dwards »

Rama,

Will there be a GUI or management panel? Any screenshots / captures of control or gameplay?

I was thinking of using an rPi Zero W, but i should probably just use the exact Arduino you're using to avoid needing to port the code! It's one thing to send a command or two in order to get initial settings going and its another to manage "digital "enhancement" controls" which is a dynamic function!

Looking forward to the instructions and code!

dwards
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

If you want to prepare, get an (either original or clone, original is nicer) Arduino Uno and an Arduino Pro Mini.
The Uno will be for controlling the initial version. Every control option is done via the Uno plugged into a PC USB port, using the serial monitor.
Spoiler
Image
Just a Mini would also be fine, if you have a way to send / receive commands. I use a serial to USB bridge board.

Later on, it would be nice to have a more convenient way to control it.
I thought of a web browser based "GUI" that uses an ESP8266 board (NodeMCU).
The hardware port is already done, it's just missing the web server.

Buttons and displays would also work.

But even the initial version will work fine without any control commands.
It'll just be more limited then. You get the preset and the controller tries to manage stuff itself.
You can use your Pro Mini for that. Just place / glue it on top of the original MCU and wire it up (5 short wires or so).

Video captures would be great, I agree.
I just don't have anything available right now. Still waiting on an order ;)

Here's a crappy mobile phone shot instead!
Spoiler
Image
dwards wrote:manage "digital "enhancement" controls"
Note, I don't use them yet, except for the required internal YUV to RGB conversion.
But they're available in the IC and can be used for all kinds of neat tricks.
The most plausible one right now seems gamma correction but who knows.
They offer 'blue stretch' or 'skin color correction', all with countless parameters :p
User avatar
dwards
Posts: 35
Joined: Tue Nov 19, 2013 4:17 pm

Re: GBS 8200/8220 CFW Project

Post by dwards »

Very nice! Colors look better than what I got and better than https://www.youtube.com/watch?v=ahdV0ZswucU

I noticed you're using Super Nintendo and thought I would share:

https://retro-access.com/collections/su ... dio-output

This works pretty well for me. The seller claimed she also put a resistor on the sync line as well.

dwards
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

This is a very convenient cable for NTSC SNES / Famicoms. I like it :)

Colors are better, yea. The dooklink presets didn't change whatever the original firmware had set there.
Black and white level extension are still enabled in them, and extension means just 'crush' with actual RGB consoles.
Also, all the VDS (output DAC) color enhancements are enabled and set to nonsensical values.
It is that way in the original firmware already. To quote another nerd: What were they thinking! ;p
User avatar
AndehX
Posts: 790
Joined: Sun Oct 18, 2015 11:37 pm

Re: GBS 8200/8220 CFW Project

Post by AndehX »

looks pretty damn awesome! Still seeing a bit of jailbars in the blue, do you know whats causing that?
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Still seeing a bit of jailbars in the blue, do you know whats causing that?
My phone camera locking on to the TFT matrix ;)

The GBS8200 added jailbars you know are gone now.
It wasn't a specific setting but the combination of PLL settings, filters, ADC sensitivity (too bad the chip only goes down to 40Mhz. 10Mhz would be awesome.) and definitely the memory controller.
Turns out you've got to program memory access delays according to the use pattern you need from the chip!

Currently tuning output timings for best compatibility.
Best to get that correct, so people's HDMI converter solutions have a better chance of working.
Image
User avatar
AndehX
Posts: 790
Joined: Sun Oct 18, 2015 11:37 pm

Re: GBS 8200/8220 CFW Project

Post by AndehX »

good stuff. Definitely looks light years better than when I used to have mine :P
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

I'm writing the hardware guide at the moment and I need a little help.

I want to recommend installing an LM1881 sync stripper on the GBS board, to make sure most people have some form of CSYNC going into the scaler.
Those sync strippers need a power source and the only regulated source that's the same on all GBS boards is the regulated 3.3V.
While the LM1881 seems to work at that low voltage, it is marginal. It seems to not work reliably when the signal input level is too high.

There is another cheap / general solution:
Require people use a 5V power supply and take those 5V from the input protection diode (now ~4.3V, still good).

The tricky part is this:
The buck converter is feeding off those ~4.3V and its switching noise is present there.
If we use this for the LM1881 unfiltered, the switching noise will be present on the sync output and make its way to the analog section of the scaler.
I tried a simple 75 Ohm resistor in series between protection diode output and LM1881 input and this appears to work just fine.
Voltage on the LM1881 is now ~4.2V, still fine, and the switching noise is almost totally gone. (The LM1881 has a 100uF bypass capacitor.)
I don't know if that is safe to recommend though.
Any input would be appreciated! :)


Edit:
There are a few ready made solutions people can just buy and be happy with, for example:
https://www.videogameperfection.com/201 ... le-review/
The point of this scaler solution is price and availability though, so I hope we can find something less niche :)
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

I solved the LM1881 power issue.
The 75 Ohm to LM1881 Vin have been reduced to 2 Ohm (or anything up to 10 Ohm).
The chip isn't drawing much power but there's some variation, depending on the sync output configuration.
This small input resistance still blocks the buck converter switching noise, but doesn't lead to a significant voltage drop anymore.
What's important is that extra 100uF capacitor for energy storage.

Some people will be using cables that carry the console 5V. This can also be used, of course.
I just don't know what people most commonly have, so I'm designing this for my use case (and cost efficiency :) ).
User avatar
dwards
Posts: 35
Joined: Tue Nov 19, 2013 4:17 pm

Re: GBS 8200/8220 CFW Project

Post by dwards »

Rama,

I think its a good thing to consider. There are great solutions out there but some drive up the cost a lot. I prefer to use the provided CSYNC from the consoles. I know not all consoles have it but it seems like all NTSC consoles have CSYNC built in except maybe the PS2, which we could just use component.

If your console provided CSYNC SCART cable uses the properly attenuated CSYNC line, a simple straight trough female SCART to DB15 adapter would work fine.

I do totally understand the idea to include the sync separator to make this work for any RGB SCART cable, but it does add complexity.

Obviously this is all optional, but given the options you provided i think its best to take the power from the console instead of the GBS in this example.

Dwards
User avatar
SCARTicus
Posts: 189
Joined: Wed Apr 05, 2017 4:51 pm
Location: TX

Re: GBS 8200/8220 CFW Project

Post by SCARTicus »

I use a SyncStrike for this. It is made specifically to allow you to plug a SCART cable into the GBS board with sync separation.
Post Reply