GBA SP RGB via Scart mod questions

The place for all discussion on gaming hardware
Post Reply
User avatar
Natrox
Posts: 3
Joined: Sat Mar 11, 2017 11:44 pm

GBA SP RGB via Scart mod questions

Post by Natrox »

Hey there, new user here. Let me start out by saying I am still sort of new to electronics. I am starting to get the hang of it and I have been working on a bunch of projects - with varying degrees of success.

Anyway, I am trying to pull RGB from a AGS-101 GBA SP motherboard (without the use of one of those converter kits). This is my first project that has to do with video/audio. I am wondering if there is anyone here who could assist me in getting it to work, as I haven't been able to find a lot of information on this online. So far, I am not getting anything on screen.

This is what I've done so far:
* I've connected the 5-bit RED channel pins to a (fast 30mhz max) DAC chip. This seems to work so far, as I am getting the output I expect (I think? See image 1 below).
* I've sourced a pixel clock/hsync, although I am not sure if it is correct. It was around 14khz and seems to line up with the 'vsync'.
* I've found a vsync pin, I believe. Sporadically, I am able to determine it's frequency, which is around the screen's 59.72hz clock. It's the blue wave in image 1 below.
* I hooked both my hsync and vsync up to an XOR gate, to create a composite sync. At least, that's how I believe it is done, but I am not sure.
* I've only connected the following SCART pins: ground (21), sync (1v max, pin 20), composite ground (18), ~3v on pin 16, red (0.7v max, pin 15), red ground (13), ~9.6v on pin 8.

Thing I am unsure about:
* Did I get the correct vsync/hsync-pixelclk?
* Why the heck is my waveform so noisy?
* Do I need to connect all the scart input/ground pins to even be able to expect a picture image?
* Will the oddball GBA resolution of 240x160 play nice over RGB?

Picture of the red channel waveform (analog) and the 'vsync' signal. I think it's correct as it seems to follow the pattern of the gameboy logo that flies into the screen:
Image

Currently connected pins:
Image

If anyone has ever done anything like this before, I'd appreciate your pointers! Possibly it's just something really silly.
User avatar
Unseen
Posts: 738
Joined: Sun May 25, 2014 8:12 pm
Contact:

Re: GBA SP RGB via Scart mod questions

Post by Unseen »

Natrox wrote:* Why the heck is my waveform so noisy?
Crosstalk between signals? Noisy supply? Ground bounce?
* Will the oddball GBA resolution of 240x160 play nice over RGB?
Sure, RGB does not care about the resolution. The display or scaler that is supposed to use the signal will care though and I don't think you'll find anything that accepts it.
kamiboy
Posts: 2000
Joined: Sat Sep 04, 2010 4:40 pm
Location: Denmark

Re: GBA SP RGB via Scart mod questions

Post by kamiboy »

Connecting all the gnd pins in a SCART is unnecessary. In most cases you can get away with just connecting gnd to the metal case. Some devices might need the vid gnd, or the audio gnds.

When I build a SCART cable I usually run one gnd to the metal casing and route it to composite video and audio L/R gnds.
User avatar
Natrox
Posts: 3
Joined: Sat Mar 11, 2017 11:44 pm

Re: GBA SP RGB via Scart mod questions

Post by Natrox »

Unseen wrote:
Natrox wrote:* Why the heck is my waveform so noisy?
Crosstalk between signals? Noisy supply? Ground bounce?
I'll try and put a bunch of capacitors in and see if that helps any. I've never heard of ground bounce, I am going to research that - thanks!
Unseen wrote:
* Will the oddball GBA resolution of 240x160 play nice over RGB?
Sure, RGB does not care about the resolution. The display or scaler that is supposed to use the signal will care though and I don't think you'll find anything that accepts it.
That's quite unfortunate. Maybe it's better to re-tool this project into a line-doubler of sorts.
kamiboy wrote:Connecting all the gnd pins in a SCART is unnecessary. In most cases you can get away with just connecting gnd to the metal case. Some devices might need the vid gnd, or the audio gnds.

When I build a SCART cable I usually run one gnd to the metal casing and route it to composite video and audio L/R gnds.
This is good to know at least. I'll connect the audio grounds and give it another shot before I start to re-consider my approach to this.
User avatar
BazookaBen
Posts: 2159
Joined: Thu Apr 17, 2008 8:09 pm
Location: North Carolina

Re: GBA SP RGB via Scart mod questions

Post by BazookaBen »

I just use the ultra-low latency GBI and zoom the picture on my PVM to take up most of the screen. That will be about as good as the best you can hope to achieve with this project.
RGB0b
Posts: 543
Joined: Wed Dec 05, 2012 1:52 pm

Re: GBA SP RGB via Scart mod questions

Post by RGB0b »

Woozle is already working on something similar. Maybe contact him for some tips?: http://shmups.system11.org/viewtopic.php?f=6&t=56870
Woozle
Posts: 232
Joined: Wed Jun 24, 2015 8:27 pm
Location: Florida

Re: GBA SP RGB via Scart mod questions

Post by Woozle »

The GBA has odd video timing and as far as I know a straight digital-to-analog won't work with most displays. Maybe it's possible to buffer only a few lines to create a compatible video output, but I wouldn't know as I haven't tried. For my GBA to tv project I buffered an entire frame in an fpga and used a resistor ladder + video amp to work as the DAC.

If I remember correctly, the GBA hsync is inactive during vblank. That would make creating csync from the stock GBA hsync/vsync tricky. I can check again next week when I'm back by my oscilloscope to confirm. I created a new csync signal from the fpga I used for buffering, I did the normal ~15khz hsync and tried to make vsync as close as possible to GBA vsync frequency to minimize screen tearing.
mvsfan
Posts: 1209
Joined: Sat Oct 06, 2012 12:24 am

Re: GBA SP RGB via Scart mod questions

Post by mvsfan »

What about the gameboy player? I think im missing the point for this project.

Id rather see this project for the DS since theres no way to play it on a tv currently.
User avatar
Guspaz
Posts: 3242
Joined: Tue Oct 06, 2015 7:37 pm
Location: Montréal, Canada

Re: GBA SP RGB via Scart mod questions

Post by Guspaz »

The downside there is that the Gameboy Player requires a GameCube (and assorted modding-related gear to use GBI), although the solution there would be something like BennVenn's consolized GBA. A TV-out mod for the DS (and/or 3DS) is probably more useful though, since no TV-out solution exists for those consoles at all. The only way to get video out of them is via USB mods, which require a computer and add a ton of lag.
User avatar
BazookaBen
Posts: 2159
Joined: Thu Apr 17, 2008 8:09 pm
Location: North Carolina

Re: GBA SP RGB via Scart mod questions

Post by BazookaBen »

mvsfan wrote:What about the gameboy player? I think im missing the point for this project.

Id rather see this project for the DS since theres no way to play it on a tv currently.
Yeah, I've always thought running the top screen to a TV, and the bottom screen to a touchscreen monitor would be pretty cool.
User avatar
Natrox
Posts: 3
Joined: Sat Mar 11, 2017 11:44 pm

Re: GBA SP RGB via Scart mod questions

Post by Natrox »

Woozle wrote:The GBA has odd video timing and as far as I know a straight digital-to-analog won't work with most displays. Maybe it's possible to buffer only a few lines to create a compatible video output, but I wouldn't know as I haven't tried. For my GBA to tv project I buffered an entire frame in an fpga and used a resistor ladder + video amp to work as the DAC.

If I remember correctly, the GBA hsync is inactive during vblank. That would make creating csync from the stock GBA hsync/vsync tricky. I can check again next week when I'm back by my oscilloscope to confirm. I created a new csync signal from the fpga I used for buffering, I did the normal ~15khz hsync and tried to make vsync as close as possible to GBA vsync frequency to minimize screen tearing.
I did see and read your thread :D. I wasn't aware that you also did a non-HDMI version. I suppose that would not actually be a bad way to go about things - perhaps I could use a FPGA/CPLD to convert the signal to 320x240 (by centering the image) and then output to RGB again.

I'd appreciate you looking into it! Perhaps this is going to sound silly, but if I were to roll my own clocks, how do I best sync them up to the GBA one? Are they simply already in sync if powered up at the same time? And how much of a problem would clock precision be?
mvsfan wrote:What about the gameboy player? I think im missing the point for this project.

Id rather see this project for the DS since theres no way to play it on a tv currently.
Two reasons:
1. I am trying to learn a bit more about electronics, specifically working with audio and video.
2. I don't have a Gameboy Player, and I think to get the best quality out of it I'd probably need to purchase a bunch of extra stuff to run GBI.
3. The final goal of this would be to have a consolized GBA, which is something that seems cool to me.


DS TV-out sounds cool. If I get GBA working I suppose I could look into it. Although cool, a seperate touch screen seems very involved. It's probably out of reach for me right now and in the near future, but perhaps you gave someone else here a good idea to work with. :wink:
User avatar
Guspaz
Posts: 3242
Joined: Tue Oct 06, 2015 7:37 pm
Location: Montréal, Canada

Re: GBA SP RGB via Scart mod questions

Post by Guspaz »

Not all DS games require the use of the touch-screen, and in most cases you wouldn't consolize the DS, just be able to mirror one or both screens on the TV, playing on the TV but looking at the touchscreen on the occasions that you need to use the stylus

Example: Castlevania Dawn of Sorrow, one of the most popular Castlevania games. The only time you need to use the touchscreen is to draw seals (hopefully) once per boss fight, while the rest of the time you'd just look at the bottom screen on the TV. This is, in fact, how most people play with their DS/3DS on a big screen right now. The only problem is that the "big screen" is a computer monitor, and the software that you run to display the DS video output is not necessarily vsynced and has lag.
User avatar
Shoryukev
Posts: 651
Joined: Thu Dec 10, 2015 7:18 pm
Location: Cleveland, OH

Re: GBA SP RGB via Scart mod questions

Post by Shoryukev »

Doesn't the Wii U have DS games on it's virtual console service now? I'd be interested to see how good it works
User avatar
mikejmoffitt
Posts: 629
Joined: Fri Jan 08, 2016 7:26 am
Location: Tokyo, Japan

Re: GBA SP RGB via Scart mod questions

Post by mikejmoffitt »

The DS and DS Lite's video timings are more or less already NTSC, so that'd be the simplest way to play GBA on a TV without any compromises.
Image
User avatar
Guspaz
Posts: 3242
Joined: Tue Oct 06, 2015 7:37 pm
Location: Montréal, Canada

Re: GBA SP RGB via Scart mod questions

Post by Guspaz »

Shoryukev wrote:Doesn't the Wii U have DS games on it's virtual console service now? I'd be interested to see how good it works
Yes, since last year IIRC. It's limited by the fact that so few Wii U devices were sold (the DS outsold it by 11 to 1), and the limited number of games available. And probably no more than that since the Wii U is basically unsupported at this point.

If we're lucky, we'll see virtual console support for DS and 3DS on the Switch. It still has a touchscreen, even if it's not stylus-based.
mvsfan
Posts: 1209
Joined: Sat Oct 06, 2012 12:24 am

Re: GBA SP RGB via Scart mod questions

Post by mvsfan »

Id think it would have to go something like this.

a 20" PVM for the top screen and a Touch screen arcade monitor for the bottom screen. like something out of a Merit game.

it would need 2 video outputs, and

some kind of interface would have to be made for it, something similar to the Ipac, but for touchscreens, to interface with the DS.
User avatar
Guspaz
Posts: 3242
Joined: Tue Oct 06, 2015 7:37 pm
Location: Montréal, Canada

Re: GBA SP RGB via Scart mod questions

Post by Guspaz »

The problem is that many games use the bottom screen as the primary. See: all Castlevania games. Dual video outputs requires a complex setup when what most people want is something more like the Wii U approach: a few different options for how to display both screens on the HDTV, and to use the original touchscreen when such a thing is needed.
Woozle
Posts: 232
Joined: Wed Jun 24, 2015 8:27 pm
Location: Florida

Re: GBA SP RGB via Scart mod questions

Post by Woozle »

I actually have a DS motherboard sitting on my desk. I've been meaning to poke around with my oscilloscope to try to understand it better, but I can't get the damn thing to boot up without the screens and peripherals attached.

Does anyone know how to get a DS motherboard to boot with just a game cart and battery connected?
Natrox wrote: I did see and read your thread :D. I wasn't aware that you also did a non-HDMI version. I suppose that would not actually be a bad way to go about things - perhaps I could use a FPGA/CPLD to convert the signal to 320x240 (by centering the image) and then output to RGB again.
It actually started as a 480p/240p mod, here's an old video from when I had the project all hooked up https://www.youtube.com/watch?v=GKq6risSOb8

Currently I have a small pcb with an FPGA that does all the GBA to HDMI stuff in addition to fixing a lot of "bugs" from older builds. I have designs for boards to do analog+digital video out from a GBA, I just haven't gotten around to populating them as I'm focusing on a digital output board first. This is the most recent capture from my digital output board https://youtu.be/_GhDhSY9xWw
Natrox wrote: if I were to roll my own clocks, how do I best sync them up to the GBA one? Are they simply already in sync if powered up at the same time? And how much of a problem would clock precision be?
For basic video output, you don't have to have all your FPGA clocks "synced" to the GBA clock. All you need vsync to tell you when a new frame has started (or at least it helps).

To be synced at a more fine grain level, usually you would feed a clock (the GBA clock) to a PLL inside the FPGA and from there you can generate the clock frequencies you need and they would be "in sync". The problem I ran into, is that the GBA crystal frequency (~4.167Mhz) is below the minimum operating frequency of the FPGA PLL. To get around that, I just removed the GBA crystal and clocked the GBA from an FPGA.
RGB0b
Posts: 543
Joined: Wed Dec 05, 2012 1:52 pm

Re: GBA SP RGB via Scart mod questions

Post by RGB0b »

Shoryukev wrote:Doesn't the Wii U have DS games on it's virtual console service now? I'd be interested to see how good it works
I played through NSMB and the lag was unbearable. I ended up connecting my Wii U to my RGB monitor and playing it that way.
Woozle wrote:Does anyone know how to get a DS motherboard to boot with just a game cart and battery connected?
If I remember correctly, you don't even need a game plugged in - If you turn it on, it'll boot to its menu.


The Nitro DS boxes play DS on a TV. I haven't clocked many hours yet, but it seems to work perfect. It's a big, EXPENSIVE, cumbersome box though! Maybe someone could reverse engineer that?
mvsfan
Posts: 1209
Joined: Sat Oct 06, 2012 12:24 am

Re: GBA SP RGB via Scart mod questions

Post by mvsfan »

I saw a webpage on how to do a bypass on the top screen but i forget where i saw it. they soldered a few wires between some of the test pads, and got it to boot without the top screen.
User avatar
Guspaz
Posts: 3242
Joined: Tue Oct 06, 2015 7:37 pm
Location: Montréal, Canada

Re: GBA SP RGB via Scart mod questions

Post by Guspaz »

IIRC they put a resistor in there to trick it into thinking the screen is attached?

In the case of the Nitro, I would think that the box itself *is* the DS, and that the thing tethered to it that looks like a DS is probably just the input/output devices (screens, buttons) in a DS chassis tethered to the box. I'm speculating though. So it's probably not really comparable: it's all custom hardware.
User avatar
mikejmoffitt
Posts: 629
Joined: Fri Jan 08, 2016 7:26 am
Location: Tokyo, Japan

Re: GBA SP RGB via Scart mod questions

Post by mikejmoffitt »

IIRC it needs to detect a load on the backlight. Some resistor (or an actual backlight) should be enough to trick it. I don't know if you can trick it to work without the wireless business plugged in.
Image
Post Reply