GBS 8200/8220 CFW Project

The place for all discussion on gaming hardware
rigues
Posts: 27
Joined: Thu May 17, 2018 5:05 pm

Re: GBS 8200/8220 CFW Project

Post by rigues »

Hi folks,

New user here, my name is Rafael Rigues, from Brazil. I built my first GBS-Control unit about a month ago (using a GBS-8200 Rev. 4 and an Arduino Uno) and have been amazed at the results ever since. I built it primarily for use with a Model 2 Sega Genesis, which did not work correctly with the stock GBS firmware (wrong image positioning, "wobbly" lines on the bottom of the display) but works PERFECTLY with GBS-Control. I have also built a small sync separator circuit* to use it with a MSX computer (Japanese Panasonic FS-A1), with excellent results. Two friends who saw the result were so impressed that they asked me to mod their GBS board for them. I posted 2 videos (in portuguese) about the mod on my YouTube channel. Link on request ;)

I know the Arduino version offers "basic" funcionality, but looking at the Github repository today I found a mention of scanlines on the code for the ESP8266. The question is: is it possible to enable scanlines on the Arduino? Perhaps using one of the GBS Buttons? (which seem to be inactive in my board). A Wemos D1 board is dirt-cheap even here in Brazil (R$ 30 + Shipping, about US$ 8), but if this is already possible on the Arduino it would save me the purchase.

HUGE thanks to rama for the project.

Sorry if this has been asked before, I could not find the answer using the search tool.

* - To build a Sync separator circuit for MSX-Based computers, use viletim's diagram (https://bit.ly/2L9bcXX), BUT: omit R1 and add a 680K resistor and 100 nF capacitor in parallel to ground on Pin 6 of the LM1881. You can get 5V for the LM1881 from pin 5 of one of the joystick ports on the MSX.

Regards,
User avatar
AndehX
Posts: 790
Joined: Sun Oct 18, 2015 11:37 pm

Re: GBS 8200/8220 CFW Project

Post by AndehX »

If you buy a PEXHDCAP, then you really don't even need to get a GBS8200. The PEXHDCAP can take direct RGB from your consoles in 240p, so just find a way to split the signal from your consoles (I use a gscartsw) and you'll be good.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

keremimo wrote:Rama: The 480i images are kinda flicker-y. I see interlacing induced vertical vibrations. Is this intended or to be fixed with a de-interlacer or something like that?
Turns out this was a bug where I didn't realize what one register does. Should be fixed now :)
keremimo
Posts: 46
Joined: Fri Apr 27, 2018 12:16 pm

Re: GBS 8200/8220 CFW Project

Post by keremimo »

rama wrote:
keremimo wrote:Rama: The 480i images are kinda flicker-y. I see interlacing induced vertical vibrations. Is this intended or to be fixed with a de-interlacer or something like that?
Turns out this was a bug where I didn't realize what one register does. Should be fixed now :)
Hey Rama, good job :)

It is not entirely fixed the way a de-interlacer would fix it though. For example if I shoot a video of it then pause, I see the interlace artifacts. There was a dynamic de-interlacer in dooklink's cfw, maybe he knows where to trigger that for you? I dunno if he'd remember it but maybe worth a shot? I remember him using different presets for 480i consoles.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Ah yeah, I remember that.
His presets didn't change much from the original firmware, so the deinterlacer was still ready to be enabled and his control software did that.
If I wanted to do the same today, it would be much harder. The deinterlacer controls many aspects of the processing chain and almost everything is different now.
I'd really have to reverse the entire functionality of it, including the read / write FIFO stuff, all of which is undocumented :(

With the recent bugfix, the interlace flicker is back to "expected", as in: It would have looked the same on a CRT.
I dunno, I think I can live with the result ;p
keremimo
Posts: 46
Joined: Fri Apr 27, 2018 12:16 pm

Re: GBS 8200/8220 CFW Project

Post by keremimo »

rama wrote:Ah yeah, I remember that.
His presets didn't change much from the original firmware, so the deinterlacer was still ready to be enabled and his control software did that.
If I wanted to do the same today, it would be much harder. The deinterlacer controls many aspects of the processing chain and almost everything is different now.
I'd really have to reverse the entire functionality of it, including the read / write FIFO stuff, all of which is undocumented :(

With the recent bugfix, the interlace flicker is back to "expected", as in: It would have looked the same on a CRT.
I dunno, I think I can live with the result ;p
Fair enough man, you're making everything possible now :) I do not mind the flicker myself either, I livestream gameplay from my consoles using your CFW and it sometimes looked weird but I now found some workarounds thanks to OBS Studio :) de-interlace features of it work well!

I'm gonna keep checking github and here daily for updates and report if I encounter any issues.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Great, cheers :)
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

So I built myself a clock generator.
It's an ESP32 board that uses the PWM peripheral to output a 50% duty cylce (square) wave.
It can go from maybe 1Mhz to 40Mhz, with relatively fine steps in-between.

This thing now drives a SNES, replacing the 21.477Mhz oscillator :D

I can now simulate the video timings of any conceivable machine!
This will let me test whether 52Hz boards work (some arcade boards, I believe?), or go up to maybe 63Hz, I don't know yet.

The best thing of it all is how easy this was to program.
You can literally just take the sample code, hack it up a bit, then tell it to go at like 30Mhz and it will just do it!
(Okay, there's tons of jitter but the SNES accepts it as it is. Otherwise I'd have added a Schmitt Trigger but yeah, no need even :) )

It used to be that specialized clock generator chips were necessary and you had to develop their control program and all that.
Well, not so anymore ;)

Image
It's hard to see but this is the SNES with 52Hz, no issues :)
User avatar
Konsolkongen
Posts: 2309
Joined: Fri May 16, 2008 8:28 pm
Location: Denmark

Re: GBS 8200/8220 CFW Project

Post by Konsolkongen »

That's kewl, though not very pretty :D

What does the jitter look like on that clock signal? :)
keremimo
Posts: 46
Joined: Fri Apr 27, 2018 12:16 pm

Re: GBS 8200/8220 CFW Project

Post by keremimo »

Rama, how can I export the custom presets I build? I want to replace the default PAL preset with an Amiga dimensions-friendly but 60hz preset to finish up (workaround for my 50hz capture problem but easier).
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Konsolkongen wrote:That's kewl, though not very pretty :D

What does the jitter look like on that clock signal? :)
Jitter looks like noise. It happens in all clock signals but usually it's very low and doesn't matter much.
If it gets big enough to show up on a scope, it looks a bit like this:
Image

It depends on the application whether it'll work or not.
The SNES just doesn't care by the way. I've had it run a while at 15Mhz and at 35Mhz, which are huge over / underclocks.
It just chugs along ;p

keremimo:
Clear your Serial Monitor and hit "d". You'll get a full register dump that can be copy-pasted into the preset file you want to change.
Remember to undo / clear this when you update ;)
keremimo
Posts: 46
Joined: Fri Apr 27, 2018 12:16 pm

Re: GBS 8200/8220 CFW Project

Post by keremimo »

Rama: thanks for that, it worked out beautifully :)

An idea: can we have ++ tweak options? Like Vertical Size + ups it by one point, but ++ ups it by 10 points or something like that. It could be handy for tweaking faster, I don't know, probably very easy to implement :D
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Yeah, I'll slip something in sooner or later. Just the other day I did this for vtotal but didn't announce it or anything.
It makes sense vertically, as even the largest presets are just 1000 lines total.
For horizontal, I might go with a staged setup:
Shift 1 pixel if htotal below x, else shift 2, 3 or 4 pixels. Whatever works best.

I do want to keep the amount of options that do a similar thing low though, so I won't add extra buttons for small or big shifts.
User avatar
Konsolkongen
Posts: 2309
Joined: Fri May 16, 2008 8:28 pm
Location: Denmark

Re: GBS 8200/8220 CFW Project

Post by Konsolkongen »

Thanks for the scope shot rama. That’s pretty much what I expected, but always nice to have it confirmed :)
rigues
Posts: 27
Joined: Thu May 17, 2018 5:05 pm

Re: GBS 8200/8220 CFW Project

Post by rigues »

Rama, while looking through the GitHub page I saw an option to enable scanlines when using a Wemos D1 board. Is it possible to enable scanlines using a "standard" Arduino? Maybe using the buttons on-board the GBS-8200, or "hardwiring" some parameter in the code?

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

Re: GBS 8200/8220 CFW Project

Post by rama »

Some really good news from the variable clock SNES:

The GBS and control software accept input frame rates of 49Hz to 65Hz (at least), if the line count is within a reasonable range.
This covers all old consoles and probably all arcarde boards, even those known to have issues with other scalers.
Additionally, I already have 720p support implemented and 1080p is doable as well.
What's left for a real universal converter is the control logic that can format and scale any source to any target, and I think it can be done :)

(This would largely remove the concept of different presets and such. People could just choose an output resolution and the scaler does all the rest.)
keremimo
Posts: 46
Joined: Fri Apr 27, 2018 12:16 pm

Re: GBS 8200/8220 CFW Project

Post by keremimo »

rama wrote:Some really good news from the variable clock SNES:

The GBS and control software accept input frame rates of 49Hz to 65Hz (at least), if the line count is within a reasonable range.
This covers all old consoles and probably all arcarde boards, even those known to have issues with other scalers.
Additionally, I already have 720p support implemented and 1080p is doable as well.
What's left for a real universal converter is the control logic that can format and scale any source to any target, and I think it can be done :)

(This would largely remove the concept of different presets and such. People could just choose an output resolution and the scaler does all the rest.)
That would be real crazy! This is awesome news. Would it be possible to have an option to force 60hz output for tv sets that do not support 50hz when you get rid of the presets?
User avatar
maxtherabbit
Posts: 1763
Joined: Mon Mar 05, 2018 4:03 pm

Re: GBS 8200/8220 CFW Project

Post by maxtherabbit »

has anyone experimented with the current CFW on the HDMI version of the board?
User avatar
AndehX
Posts: 790
Joined: Sun Oct 18, 2015 11:37 pm

Re: GBS 8200/8220 CFW Project

Post by AndehX »

rama wrote:Some really good news from the variable clock SNES:

The GBS and control software accept input frame rates of 49Hz to 65Hz (at least), if the line count is within a reasonable range.
This covers all old consoles and probably all arcarde boards, even those known to have issues with other scalers.
Additionally, I already have 720p support implemented and 1080p is doable as well.
What's left for a real universal converter is the control logic that can format and scale any source to any target, and I think it can be done :)

(This would largely remove the concept of different presets and such. People could just choose an output resolution and the scaler does all the rest.)
Well then, it seems you finally have an end goal, or light at the end of the tunnel!
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

"Just" one rather big issue so far:
The VDS horizontal blank end position is one of the parameters that determines the image position.
It also determines whether a scaled image will fit into the frame, and if not, it creates those artefacts.
This parameter is difficult to programmatically determine. It seems to depend on a formula with many variables, all of which have further ramifications.
I could be conservative and choose each variable so that it works for sure, but then the picture will just suck, and it'd be better to keep relying on presets instead.

But I'm still testing theories and there's always new unique approaches to the issue.
Love that aspect about the project :)

maxtherabbit:
I'll test my HDMI board again this weekend :)
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Update on the HDMI boards: Everything still okay :)
User avatar
maxtherabbit
Posts: 1763
Joined: Mon Mar 05, 2018 4:03 pm

Re: GBS 8200/8220 CFW Project

Post by maxtherabbit »

rama wrote:Update on the HDMI boards: Everything still okay :)
rad, thanks
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

AndehX wrote:
rama wrote:Some really good news from the variable clock SNES:

The GBS and control software accept input frame rates of 49Hz to 65Hz (at least), if the line count is within a reasonable range.
This covers all old consoles and probably all arcarde boards, even those known to have issues with other scalers.
Additionally, I already have 720p support implemented and 1080p is doable as well.
What's left for a real universal converter is the control logic that can format and scale any source to any target, and I think it can be done :)

(This would largely remove the concept of different presets and such. People could just choose an output resolution and the scaler does all the rest.)
Well then, it seems you finally have an end goal, or light at the end of the tunnel!
Well, presets are here to stay :p
I had to learn that there's a reason old TV tech focused so much on getting the active video centering right.
There are so many factors that affect the final image position that it seems impossible to come up with a working general formula.
Going forward, I'll keep tuning presets for output resolutions to standard sources.
There is enough wiggle room to cover all real sources without artefacts, but users will have to manage image centering a little.
User interaction can be made a lot better, so I suppose it is acceptable.

Now that that's out of the way, recent changes added 1080i support and lots of bugfixes regarding format detection and wakeup / idle.

I also got passtrough working. This mode takes the unformatted ADC conversion + input sync and passes it to the output DAC directly.
If the display accepts the sources timing, this makes the GBS some kind of video adapter with little losses.
Of course, I only had a YUV source and there doesn't seem to be an option to convert it to RGB, so the image was all green :p
A PS2 in VGA / EDTV mode (with sync on green) would probably work well though, once the sync is bypassed to one of the SOG inputs.
User avatar
AndehX
Posts: 790
Joined: Sun Oct 18, 2015 11:37 pm

Re: GBS 8200/8220 CFW Project

Post by AndehX »

Sources not being perfectly centered etc. isn't really a problem for me since I use my scaler primarily on a projector, and it looks awesome regardless of the position. As long as the aspect ratio is correct and it fills the majority of the screen space, im happy.
I'd like to try a 720p and 1080p profile though, since my projector is natively 1080p, it should look better (projector itself won't need to do any inherent scaling)
User avatar
Syntax
Posts: 1774
Joined: Wed Aug 09, 2017 12:10 am
Location: Australia

Re: GBS 8200/8220 CFW Project

Post by Syntax »

Sometimes when I start a system the colors are all wrong. Like black is BSOD blue and yellow is turquoise.

What's happening there?
User avatar
dwards
Posts: 35
Joined: Tue Nov 19, 2013 4:17 pm

Re: GBS 8200/8220 CFW Project

Post by dwards »

When you say HDMI boards are working are you referring to these? http://www.hollandcomputers.com/store/p ... RTX3lg.jpg

Is the quality as good as GBS-8200?
User avatar
maxtherabbit
Posts: 1763
Joined: Mon Mar 05, 2018 4:03 pm

Re: GBS 8200/8220 CFW Project

Post by maxtherabbit »

dwards wrote:When you say HDMI boards are working are you referring to these? http://www.hollandcomputers.com/store/p ... RTX3lg.jpg

Is the quality as good as GBS-8200?
that's the one

I'm wondering - now that rama got passthrough working, if the HDMI version of the thing could be used as a cheap, lag free, no-BS ADC for RGB to HDMI. There are lots of VGA to HDMI adapters on the market already, but most of them are trash and/or laggy as hell.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Passthrough isn't fully implemented yet (check out the 'k' command in the sketch) but once it is, it will do exactly that :)
But keep in mind that the quality is mainly hampered by the HDMI transcoder chip. The colors are muted in such a way that I believe it's set to limited color space output.
Fine if the TV can switch to that mode though, or otherwise if the feature can be toggled to full RGB somehow.
User avatar
dwards
Posts: 35
Joined: Tue Nov 19, 2013 4:17 pm

Re: GBS 8200/8220 CFW Project

Post by dwards »

When I click Print Infos, Get Video Timings and Debug View on the web GUI I'm expecting to see a console / terminal like connection of some kind. How do I get access to that? Does that not work over the Wireless connection? Is it Telnet or other?
Stremon
Posts: 20
Joined: Wed May 23, 2018 11:27 am

Re: GBS 8200/8220 CFW Project

Post by Stremon »

Hello guys,

I just discovered this awesome project and planning to do a board for my RGB gaming hardware, but seeing the recent posts I am wondering about something, is it better to buy a GBS8200 variant or buy the new one with HDMI? How does the quality compare?
My TV has both VGA and HDMI, but I can't deny that HDMI would be more convenient.
Also do you have a reference name for the HDMI model?

Thank you :D
Post Reply