GBS 8200/8220 CFW Project

The place for all discussion on gaming hardware
User avatar
AtariBits
Posts: 24
Joined: Sat Aug 31, 2019 11:52 pm
Location: North America, California
Contact:

Re: GBS 8200/8220 CFW Project

Post by AtariBits »

rama wrote: The device has programmable ADC gain for all 3 channels, plus a few bits to optimize the SOG input.
Since you're using an LM1881, the SOG stuff just has to be somewhat in range. The current values should do that well.
The ADC gain regs are at s5r09, s5r0a, s5r0b and their values are 0x00 (largest gain) to 0xff (lowest gain).
I think the range is good for 0.5Vpp to 1.0Vpp...
Looks to be good with ADC gain set to 50 for a 0.75v input. I just altered what was in the preset tables, which was originally a value of 127.

These turned out to be the only required manual presets following the Preset Table load. Because what got preloaded by the tables looks good on it's own.

Code: Select all


  ;Activate !!!
  GoSub WriteByte (0, 0x46, 0x00)   ;Soft Reset
  GoSub WriteByte (0, 0x46, 0xFF)
  GoSub WriteByte (0, 0x47, 0x00)   ;Soft Reset
  GoSub WriteByte (0, 0x47, 0xFF)
  GoSub WriteByte (5, 0x11, 0x12)   ;Latching PLLAD for Pixel Clock
  GoSub WriteByte (5, 0x11, 0x92)

Just one last thing, which registers will change vertical height/position? When I do an automatic adjust on my monitor the image tends to sit high, and the vertical looks slightly squished, so more like picture box mode on my 4:3 aspect ratio monitor. Be nice to fill the screen more. Here's a short Video Demo of what this currently looks like. Notice that what should be a square grid, is more rectangular in shape. Due to using an Amazon Fire tablet to record the video, the actual real life quality is much better than this demo shows.
Michael from AtariBits
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Scaling is on s3r16, s3r17, s3r18.
These are vertical and horizontal 12 bit values, split on r17. You'll figure it out :p

The vertical position can be set in various ways, some more correct than others.
I recommend using the input formatter vblank position that has a start and an end position.
Start is on s1r1c (+s1r1d), end on s1r1e(+s1r1f).
You should leave at least 2 steps between start and end, and start needs to go before end.
So this would be okay: s1r1c = 0x02, s1r1d = 0x00, s1r1e = 0x04, s1r1f = 0x00.

You can even move the position across the entire range of input lines.
For a PAL signal, the IF should see about 625 lines. You need to wrap and take care on the 0 boarder.

And I need to warn you. :p
Your setup doesn't know about the input or output parameters.
You'll run into boarders, green bars, artefacts and such, once you try to adjust image parameters too much.
To do it properly, you need to learn a lot about video and how scalers works exactly.
If you want to do that, my source code is the fastest method to do it :)

8bitForLife:
On the web ui? Is javascript enabled? Do the buttons on the initial page "light up"?
User avatar
AtariBits
Posts: 24
Joined: Sat Aug 31, 2019 11:52 pm
Location: North America, California
Contact:

Re: GBS 8200/8220 CFW Project

Post by AtariBits »

rama wrote:Scaling is on s3r16, s3r17, s3r18.
These are vertical and horizontal 12 bit values, split on r17. You'll figure it out :p
I got it scaled to my liking by changing one of the 3 registers you suggested (s3r18). And by getting it scaled properly, it also took care of the positional problem at the same time. Win-Win :D

Original values
s3r16 = 152
s3r17 = 194
s3r18 = 35

New values
s3r16 = 152
s3r17 = 194
s3r18 = 32
rama wrote:And I need to warn you. :p
Your setup doesn't know about the input or output parameters.
You'll run into boarders, green bars, artefacts and such, once you try to adjust image parameters too much.
To do it properly, you need to learn a lot about video and how scalers works exactly.
If you want to do that, my source code is the fastest method to do it :)
Yep initially when I started adjusting things, boy was it ever screwed up. At one point I had scaled both the vertical and horizontal to the point where I had HUGE text and overlapping graphics, and I did see some green and blue border bars as well. But it didn't take long to figure out what I needed to concentrate on, and get it looking nice.
Michael from AtariBits
User avatar
AtariBits
Posts: 24
Joined: Sat Aug 31, 2019 11:52 pm
Location: North America, California
Contact:

Re: GBS 8200/8220 CFW Project

Post by AtariBits »

I've now got this ported over to the smaller PIC12F1572 8-pin DIP packaged device, added a bicolor led and a switch to switch from PAL to NTSC, give an indication of the currently selected mode, and switch in the alternate presets. This leaves me with one unused input pin on the PIC, so I started thinking that perhaps this could be used to switch from RGBS over to a composite video input. Is this possible?

I read this on another forum that seems to suggest it is...
Feed in composite PAL video signal to Y of YPbPR input, is the image stable?
Yes. Colourburst affects picture as expected, sparklies on screen. It has issues with black level clamping, most likely due to the colourburst reference.
Michael from AtariBits
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Well, there's no decoder on the board, so all you can get is a black and white picture with lots of artefacting.
All the drawbacks of CVBS video with none of the color :p
But yeah, it can work.

It'll require more patching, of course.
The input selector on s5r02 bit 6 needs to be toggled to switch to the 3 RCA input channel.
Not sure whether the color convert matrix should be invoked. If so, that's s5r1f bit 2.
User avatar
AtariBits
Posts: 24
Joined: Sat Aug 31, 2019 11:52 pm
Location: North America, California
Contact:

Re: GBS 8200/8220 CFW Project

Post by AtariBits »

rama wrote:Well, there's no decoder on the board, so all you can get is a black and white picture with lots of artefacting.
All the drawbacks of CVBS video with none of the color :p
But yeah, it can work.

It'll require more patching, of course.
The input selector on s5r02 bit 6 needs to be toggled to switch to the 3 RCA input channel.
Not sure whether the color convert matrix should be invoked. If so, that's s5r1f bit 2.
So not really worth doing. I didn't realize what the limitations were in this regard, but I do now. Thanks for indulging my curiosity.
Michael from AtariBits
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

A CVBS decoder is quite tricky tech, much more involved than simply sampling RGB.

I'm looking for solutions that fit gbscontrol but everything modern outputs a digital stream only.
Old TV jungle chips may do the job, but they're hard to get by.

Edit:
Oh, but the CVBS into the green RCA trick is still good for something:
It allows for quick testing of equipment, without needing special cables :p
strayan
Posts: 671
Joined: Sun Mar 19, 2017 8:33 pm

Re: GBS 8200/8220 CFW Project

Post by strayan »

Can anyone post any screencaps that demonstrates how GBScontrol handles 576p to 768p upscaling? Seems like it could be good for a lot of PAL content on native 1360x768 displays.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Sorry, no screencaps :p

I can tell you however that gbscontrol doesn't do that right now.
PAL is being scaled to 1280x1024 by default, leaving out the lines that 99% of sources don't use.
The line doubling and scaling factors are chosen so that pixels map linearly to it and vertical scrolling is smooth.

All in all, PAL stuff looks great on it, but your display has to work with 50Hz!
strayan
Posts: 671
Joined: Sun Mar 19, 2017 8:33 pm

Re: GBS 8200/8220 CFW Project

Post by strayan »

rama wrote:Sorry, no screencaps :p

I can tell you however that gbscontrol doesn't do that right now.
PAL is being scaled to 1280x1024 by default, leaving out the lines that 99% of sources don't use.
The line doubling and scaling factors are chosen so that pixels map linearly to it and vertical scrolling is smooth.

All in all, PAL stuff looks great on it, but your display has to work with 50Hz!
Wouldn't 960x768 work too?
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

The output resolutions on offer are shown in the Wiki here:
https://github.com/ramapcsx2/gbs-control/wiki/Web-GUI

I don't know what your motivation is for using a 1360x768 display, but generally, running in native panel resolution isn't critical for picture quality.
This is especially so when you feed in a higher resolution, that then gets downscaled.

But still, why would 576p look good on that target resolution?
It would require some odd vertical scaling factor, I think.
strayan
Posts: 671
Joined: Sun Mar 19, 2017 8:33 pm

Re: GBS 8200/8220 CFW Project

Post by strayan »

rama wrote:The output resolutions on offer are shown in the Wiki here:
https://github.com/ramapcsx2/gbs-control/wiki/Web-GUI

I don't know what your motivation is for using a 1360x768 display, but generally, running in native panel resolution isn't critical for picture quality.
This is especially so when you feed in a higher resolution, that then gets downscaled.

But still, why would 576p look good on that target resolution?
It would require some odd vertical scaling factor, I think.
Hmm... you’re right. I somehow miscalculated the scaling factor.

I think it would be great to have more output resolutions added though. I have a 852x480 and 1365x768 plasma and running native resolution always looks better in my experience.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

I mentioned this before, but the problem with more presets is that they add continuous maintenance effort.

I'm slowly getting towards the ability to calculate all the variables that go into a preset.
At that point, all kinds of resolutions will be possible, calculated on the fly.
Iraito
Posts: 122
Joined: Sat Aug 24, 2019 8:59 am

Re: GBS 8200/8220 CFW Project

Post by Iraito »

I just posted an issue on the github: https://github.com/ramapcsx2/gbs-control/issues/82

Has anybody an idea of the kind of problem i'm having ?

P.S: After some research it seems that the sync signal of the SS could be too weak for the GBS, hence the shaking picture or plain black screen. I just checked with a multimeter the difference between the sync voltage of the ps1 and SS, the SS on the BIOS stays fixed at 0.145v while the ps1 on the BIOS stays at 1.2v, i will try an amp circuit and see if i can get some results; i still get the noise problem with the ps2\dreamcast.
tbender
Posts: 5
Joined: Wed Feb 06, 2019 1:45 am

Re: GBS 8200/8220 CFW Project

Post by tbender »

I have similar noise with my PS2 which I've been playing quite a lot these days on the GBS.

I don't notice it on my monitor, which doesn't have the best VGA quality as it is, but I can definitely see it on my capture card.

I have just about the same picture quality between SCART and Retrovision component cables. I'll take some screen caps tonight to help compare.

Also I concur, PS1 on the other hand looks perfect as far as I can see.
User avatar
AtariBits
Posts: 24
Joined: Sat Aug 31, 2019 11:52 pm
Location: North America, California
Contact:

Re: GBS 8200/8220 CFW Project

Post by AtariBits »

If your sync is weak I would suggest using an LM1881 with the recommended minimal components shown in the datasheet. Since you probably don't need the vsync output the Rset R/C components can probably be left out. Because the LM1881 was designed to see the sync in a composite video source, it's very good at locking into weak sync pulses. However the 5v csync output of the LM1881 is too strong for the GBS so you'll want a series 680 ohm resistor.

I use the LM1881 to buffer a 3v csync signal as well as render a vsync output from an Atari 8-bit computer system. With a 680 ohm resistor going to my GBS, I see rock solid results. But as I mentioned, it should also work good for locking into even a weak sync pulse which is typical in a composite video source.
Michael from AtariBits
Iraito
Posts: 122
Joined: Sat Aug 24, 2019 8:59 am

Re: GBS 8200/8220 CFW Project

Post by Iraito »

tbender wrote:I have similar noise with my PS2 which I've been playing quite a lot these days on the GBS.

I don't notice it on my monitor, which doesn't have the best VGA quality as it is, but I can definitely see it on my capture card.

I have just about the same picture quality between SCART and Retrovision component cables. I'll take some screen caps tonight to help compare.

Also I concur, PS1 on the other hand looks perfect as far as I can see.

On the dreamcast the noise is borderline invisible and i get the same quality on scart that i get with the VGA box, only the ps2 gives me this noticeable issue, which kinda pisses me off since the quality is otherwise excellent, is it a problem with the GBS itself ? is this going to be solved ?

AtariBits wrote:If your sync is weak I would suggest using an LM1881 with the recommended minimal components shown in the datasheet. Since you probably don't need the vsync output the Rset R/C components can probably be left out. Because the LM1881 was designed to see the sync in a composite video source, it's very good at locking into weak sync pulses. However the 5v csync output of the LM1881 is too strong for the GBS so you'll want a series 680 ohm resistor.

I use the LM1881 to buffer a 3v csync signal as well as render a vsync output from an Atari 8-bit computer system. With a 680 ohm resistor going to my GBS, I see rock solid results. But as I mentioned, it should also work good for locking into even a weak sync pulse which is typical in a composite video source.
Sorry i'm a little confused (i have a very basic knowledge of electronics) but i'm already using a sync stripper https://imgur.com/a/iBnAaO6 <---- this one to be precise but without the vsync cable (it wouldn't work at all with it), do i need to change something to this design to make the signal stronger ?
benryves
Posts: 31
Joined: Sun Jan 27, 2019 12:32 am

Re: GBS 8200/8220 CFW Project

Post by benryves »

Thanks again rama for all your work on this. I finally got around to moving my previous lash-up into a project box. Much less of a trip hazard than the mess of cables I had before and good to have everything running off one power supply too!

The insides look like this. I've got the SCART connector wired directly to the scaler input with a 100Ω resistor from composite input to ground. I'm using a Mini VGA2HDMI inside (based on the MS9282 VGA to HDMI chip) as my TV doesn't like 50Hz VGA signals and I'm in a PAL region. All in all I'm very happy with the picture quality. So far I've tested with the following consoles, all working well: Mega Drive, Mega Drive II, Saturn, Dreamcast, PlayStation, PlayStation 2, Xbox, GameCube. My Master System is a bit temperamental, losing sync occasionally on very dark or very bright images, though when I previously had this connected via an LM1881 sync stripper circuit it didn't work at all so I think there might be something amiss with the Master System itself (I'll need to check the capacitors near the video circuit at some point).

The one issue I really have is with my capture box, which can't see the signal at all. It's one of these generic "HD Video Capture" boxes which normally works fine with the Mini VGA2HDMI's output (when the VGA source is my Dreamcast, Xbox 360, or a PC). I've tried a range of different output resolutions and modes from the scaler and though these all work flawlessly with my TV they will not pass through the capture box.

One technique I've used in the past to resolve issues with HDMI signals is to send the signal through one of these HDMI/SCART scalers which outputs a consistent 720p/1080p signal that the capture box will always handle (even if the input HDMI signal is changing resolution or in a resolution the capture box handles badly). If I do this here the HDMI output is heavily degraded, with speckly pixels flashing through the image, something I've not see in other configurations.

Do you have any idea why the output from this setup might not work through this capture box? I've tried resetting all settings to default, trying different resolutions, changing frame locking options, anything that looks like it might have an impact on output signal support, all to no avail.

Edit: In case it's of any use, I unplugged the jumper and microcontroller to revert to the stock firmware and can get a picture through my capture box, just with all the problems that the gbs-control firmware fixes. I've tried a number of different screen modes within the gbs-control firmware that I know my capture box handles fine (e.g. 1280x720 and 1920x1080, at both 50Hz and 60Hz) and they all show up fine when directly connected to my TV but when the capture box is in the middle it can't see the signal, either to record or pass on to its HDMI output port.
Iraito
Posts: 122
Joined: Sat Aug 24, 2019 8:59 am

Re: GBS 8200/8220 CFW Project

Post by Iraito »

Just one hour ago i found a component cable for my ps2, so i thought "why not try this and see if i get noise" well i definitely eliminated most of the noise but i still get some slight white sparkle, the problem is present even if i connected the ps2 directly to the TV so i guess the ps2\dreamcast related noise is unrelated to GBS control.

The saturn is still the only console not working with GBS control.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Iraito and tbender:
I can't make out what kind of visual problem the PS2 has in the screenshots.
Maybe it's something with the deinterlacer and the memory clock.
Can you try cycling the SDRAM clock and see if it helps?
The option is on the development tab in the web ui.

The problems with the Saturn do sound like weak sync. It may be something with this particular console / cable, as mine works just fine (CVBS sync).
An LM1881 will fix it, as AtariBits recommended.
(It might be a bad coupling capacitor in the console. This would also produce a darker than normal CVBS picture.)

One more suggestion:
Try a different power supply for the GBS. 5V / 2A (or more) is ideal.
Issues like these are sometimes really just a bad PSU.

benryves:
Nice box :)
I don't have a lot of experience with HDMI and can't tell why the capture box doesn't like the signals.
One thing that comes to mind is the slight deviation from 60Hz vertical frequency that all game consoles produce.
It's possible to force 60Hz but it'll be hard to dial in. The web ui "HTotal++" button should decrease the vertical frequency a little each time.
If you use a SNES (that starts out at 60.08Hz), it may get recognized at some point.
Iraito
Posts: 122
Joined: Sat Aug 24, 2019 8:59 am

Re: GBS 8200/8220 CFW Project

Post by Iraito »

rama wrote:Iraito and tbender:
I can't make out what kind of visual problem the PS2 has in the screenshots.
Maybe it's something with the deinterlacer and the memory clock.
Can you try cycling the SDRAM clock and see if it helps?
The option is on the development tab in the web ui.

The problems with the Saturn do sound like weak sync. It may be something with this particular console / cable, as mine works just fine (CVBS sync).
An LM1881 will fix it, as AtariBits recommended.
(It might be a bad coupling capacitor in the console. This would also produce a darker than normal CVBS picture.)

One more suggestion:
Try a different power supply for the GBS. 5V / 2A (or more) is ideal.
Issues like these are sometimes really just a bad PSU.

benryves:
Nice box :)
I don't have a lot of experience with HDMI and can't tell why the capture box doesn't like the signals.
One thing that comes to mind is the slight deviation from 60Hz vertical frequency that all game consoles produce.
It's possible to force 60Hz but it'll be hard to dial in. The web ui "HTotal++" button should decrease the vertical frequency a little each time.
If you use a SNES (that starts out at 60.08Hz), it may get recognized at some point.
Regarding the ps2, the problem is 100% unrelated to GBS, i get the noise with composite\scart\component directly connected to any monitor\TV. for the SS can you tell me exactly what i should do ? if you could edit the sync stripper circuit board i posted earlier with the required modifications i can try them. I already tried multiple power supply, i ended up using a 12V 2A switching one that resolved all the issues i had with a previous one, so it can't be the PSU in this case.

The saturn problem in question: https://streamable.com/jq7k4

P.S:The scart for the saturn i'm using has no resistors and the csync travels on pin 20, PAL console, i get no issues connecting the console directly into the scart port of my LCD TV.
User avatar
AndehX
Posts: 790
Joined: Sun Oct 18, 2015 11:37 pm

Re: GBS 8200/8220 CFW Project

Post by AndehX »

I got those interference issues with my Dreamcast, and it turned out to be a bad quality PSU (Using a PicoPSU and a laptop PSU) Swapped to a different power supply and the issue was gone.
Iraito
Posts: 122
Joined: Sat Aug 24, 2019 8:59 am

Re: GBS 8200/8220 CFW Project

Post by Iraito »

AndehX wrote:I got those interference issues with my Dreamcast, and it turned out to be a bad quality PSU (Using a PicoPSU and a laptop PSU) Swapped to a different power supply and the issue was gone.

This is the third time i spell this out.

The noise is present WITHOUT the involvement of the GBS, if the ps2 or dreamcast are connected to the TV DIRECTLY i get the same identical noise with all 3 cables, the noise almost vanish with component cables and worsen with composite.

I had a PSU problem before, i had noise with ps1, psp etc. by swapping the PSU with the current one, the noise vanished.
Last edited by Iraito on Mon Oct 07, 2019 12:20 pm, edited 1 time in total.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Iraito:
12V is quite a lot for the GBS 3.3V converter.
It will work, but I recommend you switch to something between 5V and 9V soon.

For the Saturn, do you have a Composite cable around?
If so, please try connecting the yellow plug into the green RCA input on the GBS.
If that produces a stable black and white picture, we know that the problem is the CSync signal conditioning.
(PAL consoles don't normally put out CSync, so your unit is modded, and maybe something is missing.)

If the picture has the same issues, it's a logic VSync separation issue. Something that I'll have to fix in a software update.
Iraito
Posts: 122
Joined: Sat Aug 24, 2019 8:59 am

Re: GBS 8200/8220 CFW Project

Post by Iraito »

rama wrote:Iraito:
12V is quite a lot for the GBS 3.3V converter.
It will work, but I recommend you switch to something between 5V and 9V soon.

For the Saturn, do you have a Composite cable around?
If so, please try connecting the yellow plug into the green RCA input on the GBS.
If that produces a stable black and white picture, we know that the problem is the CSync signal conditioning.
(PAL consoles don't normally put out CSync, so your unit is modded, and maybe something is missing.)

If the picture has the same issues, it's a logic VSync separation issue. Something that I'll have to fix in a software update.

I will use another PSU, i don't want to slowly fry the unit, in relation to the composite cable i don't have it sadly for the SS, i only have a scart RGB.

Would a logic VSync separation issue also make it really difficult for the GBS to latch into the signal at all ? i mostly get a black screen and only sometimes the picture shows up but always jumpy, the only mod i did on the saturn was a 60Hz switch but nothing else.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Both, logic and signal condition, can cause these issues.
If it starts working (somewhat) after a while, that indicates a weak signal or bad impedance matching.
Is the 100 Ohm resistor installed?
Is there any more information on how it happened that CSync is available on this PAL Saturn? :)
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Never mind. It's an issue on my end.
I just hooked up my Saturn and it doesn't pass initial activity checks.
The issue seems to be a too low SOG slicer value, something I've done explicitly to avoid these kind of issues.
Shows that nothing beats field testing ><

I'll have an update out soon!
Iraito
Posts: 122
Joined: Sat Aug 24, 2019 8:59 am

Re: GBS 8200/8220 CFW Project

Post by Iraito »

rama wrote:Both, logic and signal condition, can cause these issues.
If it starts working (somewhat) after a while, that indicates a weak signal or bad impedance matching.
Is the 100 Ohm resistor installed?
Is there any more information on how it happened that CSync is available on this PAL Saturn? :)

After i wrote the reply i just went and isolated the csync (PIN20 it's like this for all my consoles) and connected it to green just like you told me, the picture is still unstable and jumpy but it comes up immediately instead of giving me mostly a black screen.

EDIT: Holy crap this damn issue made me go almost insane these two days, thankfully we found the issue.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Update is out. It should immediately detect now, though it could still be unstable in operation.
Please tell me your results.
Iraito
Posts: 122
Joined: Sat Aug 24, 2019 8:59 am

Re: GBS 8200/8220 CFW Project

Post by Iraito »

rama wrote:Update is out. It should immediately detect now, though it could still be unstable in operation.
Please tell me your results.
I will try it as soon as i can.
Post Reply