NeoVGA: Lagless, pixel-perfect line doubler for Neo-Geo MVS and AES

bytestorm

Armored Scrum Object
Joined
Oct 7, 2004
Posts
268
Looks awesome man! Wow.. I wish I had your knowledge to do this kinda stuff.. hope they will be availible in a not so distant future ;)

Keep up the good work!
 

NGT

J. M Club, ,
20 Year Member
Joined
Jul 20, 2002
Posts
4,740
If it's only 480p then I'd rather go VGA.

I don't know much about this, but could going vga get me the better picture on a multi res cab monitor, where hdmi isn't available? Or is this mostly meant for hdtv use?
 

mikejmoffitt

Mickey's Coach
Joined
Feb 6, 2014
Posts
578
Bah... I pulled out old Quartus II today and started the rewrite. It's a lot neater and smaller now. Tomorrow I'll actually start testing and debugging this new code.

VGA / 480p component (easily done) will get you the best picture on an ED or HD CRT, or a tri-sync monitor that can take ~30Khz VGA/RGB signals. Or, of course, a CRT PC monitor.

DVI/HDMI/whatever else digital will get you the best picture on a digitally addressable display, like an LCD or Plasma HDTV. However, the other project does output a 480p HDMI signal, so it is still up to the display to do scaling, so there may not be a latency advantage as far as post-processing goes.

Both solutions remove the need for line doubling to convert from 240p/480i to something higher resolution, which is usually the biggest problem point of any modern display that takes analogue video of any form.

EDIT: If any HDL lovers want to look at what I've got so far for the rewrite: https://github.com/Mikejmoffitt/NeoVGA
 
Last edited:

mikejmoffitt

Mickey's Coach
Joined
Feb 6, 2014
Posts
578
Across two nights I totally rewrote the project from scratch. The result is a much better and more stable design.

I have done more of a writeup here: http://mikejmoffitt.com/articles/0034-neovga-rev2.html

kunio.JPG
 

massimiliano

ネオジオ,
20 Year Member
Joined
Feb 27, 2004
Posts
3,224
Great!

Btw, excuse my ignorance, is this project supposed to work also on other consoles? (SNES? PCENgine? of course, outputting in RGB) or is tailored on neo's resolution/timing?

Keep the good work! thanks!
 

MCF 76

Vice's Love Slave
10 Year Member
Joined
Jan 21, 2010
Posts
2,172
Wow I don't know jack about this stuff but that picture looks amazing. Hope you get this thing off the ground.
 

mikejmoffitt

Mickey's Coach
Joined
Feb 6, 2014
Posts
578
Just pushed another commit to the repo. Everything I wanted to do is complete, except Component Video. /SHAD and /DAK are implemented, and I fixed the one remaining bug I could find on here.

In total, you need 20 wires coming from the Neo-Geo (15 bits of color data, 2 bits SHAD and DAK, 1 12MHz clock, 1 Vsync bit, and ground) aside from power connections.

I'd like to design a simple board with a VGA DAC on it that is relatively small so it can be installed in AES or CMVS systems, or easily placed alongside an MVS board. As far as the software development is though, I think this project is mostly complete.
 

marqs

n00b
Joined
Nov 6, 2014
Posts
2
EDIT: If any HDL lovers want to look at what I've got so far for the rewrite: https://github.com/Mikejmoffitt/NeoVGA
Nice! Did you try syncing to hsync signal, or is that even available on Neo-Geo PCB? It could remove the constants from the code, but I guess that's not a problem if all games use the same video mode.

+1 for DE2-115 board and NEC pro LCD monitor (my test setup is very similar). :)

Just pushed another commit to the repo. Everything I wanted to do is complete, except Component Video. /SHAD and /DAK are implemented, and I fixed the one remaining bug I could find on here.
If you are still planning to develop this further, I'd suggest trying out linetriple (720p). That requires playing around with PLLs and would suit better for DVI/HDMI output, so perhaps it's not relevant in this scope. However, if you're interested, you can check how I implemented that in my project.
 

mikejmoffitt

Mickey's Coach
Joined
Feb 6, 2014
Posts
578
Nice! Did you try syncing to hsync signal, or is that even available on Neo-Geo PCB? It could remove the constants from the code, but I guess that's not a problem if all games use the same video mode.

I found Hsync on the board, but I didn't really see an advantage to it. I'd still need to keep track of a lot of constants, as neither the Vsync or Hsync signals from the Neo-Geo are immediately usable. Some clock counting is required to get a usable VGA clock. I got it working by directly piping the Neo's Vsync, but many monitors don't like it being so long and will behave strangely in some circumstances (image curl on many CRTs, weird flashing effect on a sony HDTV).

Finding Vsync on the board took a little bit of poking around, as there are a few signals that are small 60Hz blips (about 8 line's worth is the correct one - 768 * 8 cycles from the 12MHz clock). The same goes for Hsync - lots of 15Khz signals, but a lot of them might be out of phase or have some edge cases where they are different.

+1 for DE2-115 board and NEC pro LCD monitor (my test setup is very similar). :)
I'm using this little thing as I use it for my embedded systems design class at school. I don't actually own it, but as long as I have it I might as well utilize it. The inputs seem 5V tolerant, which is good. I have a CMOD S6 Spartan-6 based kit, which fits into a breadboard like a Teensy MCU, but I need to get level shifters or build voltage dividers before I can use it *and* build a DAC for it.

I am thinking it would be nice to leave in the option to have the project output the Neo-Geo pixel bus, just at the higher rate. That way, less resistors (or no relatively expensive DAC chip) are needed as you can simply replicate the original DAc (complete with 7405). This may be what I do so my breadboard doesn't become a mess for the CMOD.

If you are still planning to develop this further, I'd suggest trying out linetriple (720p). That requires playing around with PLLs and would suit better for DVI/HDMI output, so perhaps it's not relevant in this scope. However, if you're interested, you can check how I implemented that in my project.
Probably I won't be adding that to this project, only because I have to work on my N64 scaler which will be pretty similar. 720p seems like an advantage initially, but as the line width is going to end up being 960 pixels anyway, any HDTV is going to perform some scaling / letterboxing anyway which will result in a framebuffer being used - this removes the potential gain of being close to the native resolution of having the TV not have to scale it. However, if I wanted to add DVI (HDMI has nasty licensing fees) then something like that would not be a bad idea.

I do want to learn how to use a PLL as I'd like to make a general purpose analogue line doubler like the XRGB2. I'd need the PLL to generate a working ~30KHz signal from the input's 15Khz sync signal (after breaking it out from Csync), then it is just a matter of having a high sampling rate per line to have it look decent. However I think pursuing digital data capture will always give much better results that take a lot less processing and energy from the scaler system either way.

Fortunately, I have not yet found a single monitor or TV that takes VGA which refuses to work with the 59.xHz refresh rate of the Neo-Geo. A cheap VGA to HDMI adapter has worked relatively well in situations where it is needed, too. Once I design a board for this I'll have to go test a lot of different TVs as well as Neo-Geo systems. I haven't tested anything but an MV-1FZS yet. The only real challenge is finding the signals on all of the systems, as some are better documented than others.

Someone's going to have to lend me their AES / other MVS models / NeoCD / Neo Print machine / CvS PCB / Taito Puzzle Bobble dedicated PCB...
 

buaku

Hardened Shock Trooper
Joined
Dec 3, 2007
Posts
437
So, since you can do the line-doubling for the Neo-Geo, how hard do you think it would be to do stuff like mirror the output?
As in flip the image about the y-axis. Something like that would be nice for my 6-player x-men board :D
I just wonder how much delay that would add. That would make me want to get an fpga!
 

mikejmoffitt

Mickey's Coach
Joined
Feb 6, 2014
Posts
578
So, since you can do the line-doubling for the Neo-Geo, how hard do you think it would be to do stuff like mirror the output?
As in flip the image about the y-axis. Something like that would be nice for my 6-player x-men board :D
I just wonder how much delay that would add. That would make me want to get an fpga!

Y axis isn't happening with line doubling, X is doable but a little more work.

To flip on Y we need to buffer the whole screen. Introduces a frame of lag as well.
 

fenikso

Slug Flyer Pilot
15 Year Member
Joined
Oct 6, 2004
Posts
3,932
Want me to take a pic of my AES board? I have a low-ish 20k serial number. I'd lend it to you but I haven't used it in a long time and I dimly remember there being video problems with it when I stopped using it. If some pics would help I'd be more than happy to take them.
 

fenikso

Slug Flyer Pilot
15 Year Member
Joined
Oct 6, 2004
Posts
3,932
Just sent Mike my AES. Hopefully we can get this project rolling! The screens he's shown so far have me drooling.
 

mikejmoffitt

Mickey's Coach
Joined
Feb 6, 2014
Posts
578
The prototype EP2C5 boards have arrived in the US. Hopefully not much longer before I can throw together a prototype I can send to people for testing... a little bit of time spetn with Fenikso's AES shows that it works great on there too.
 

fluxcore

Another Striker
Joined
Nov 4, 2013
Posts
324
Thanks a lot for letting me borrow your AES. I did a test compile of the project, and it will fit on one of these EP2C5 dev boards that are so common: http://www.ebay.com/itm/ALTERA-FPGA...349?pt=LH_DefaultDomain_0&hash=item2ec915d32d

That means that even if I don't design my own PCB yet, I can pretty easily whip together a prototype using one of those. I'll order one and see how it turns out!

Wow, that's very affordable! Convenient that it's 5V as well :) Looking forward to what you get out of this, I may end up buying a couple (MVS + AES!)
 

mikejmoffitt

Mickey's Coach
Joined
Feb 6, 2014
Posts
578
Wow, that's very affordable! Convenient that it's 5V as well :) Looking forward to what you get out of this, I may end up buying a couple (MVS + AES!)

Annoyingly, they aren't 5V tolerant. The dev board itself is 5V tolerant, but for the final I'll either use level shifting buffers or resort to a voltage divider with resistors on the PCB. Since this is only going from Neo->FPGA there isn't any need to do any voltage raising so the process is simple regardless.
 

neofreak696

King's Dry Cleaner
Joined
Dec 27, 2000
Posts
383
This looks amazing! Im hoping to get a consolized MVS board in the future. This is exactly what I've been wanting for :D A few questions.. You have a close up shot of kof 99 that looks awfully pixilated. Is that on a lcd using rgb source? I would hope to go svideo from the CMVS to your device to either vga or dvi. Would it look more like the picture of Mai you have on your first post? I want it to have a slight blur so it not just a bunch of pixels with scanlines. Second question, if I hook this up to a 1080p 16:9 monitor will it ooutput in 4:3? I might buy two off of ya once you get it all worked out! :D
 
Last edited:

fenikso

Slug Flyer Pilot
15 Year Member
Joined
Oct 6, 2004
Posts
3,932
This looks amazing! Im hoping to get a consolized MVS board in the future. This is exactly what I've been wanting for :D A few questions.. You have a close up shot of kof 99 that looks awfully pixilated. Is that on a lcd using rgb source? I would hope to go svideo from the CMVS to your device to either vga or dvi. Would it look more like the picture of Mia you have on your first post? I want it to have a slight blur so it not just a bunch of pixels with scanlines. Second question, if I hook this up to a 1080p 16:9 monitor will it ooutput in 4:3? I might buy two off of ya once you get it all worked out! :D

Read the article linked in post #80, it goes into greater depth on scanlines. This isn't a device one hooks up externally to take RGB or S-video and turn it to VGA; rather, this is something soldered to specific points on the mobo to generate a VGA signal natively.

If it helps: Think of it as if the Neo had now been designed to run VGA from the start.
 

neofreak696

King's Dry Cleaner
Joined
Dec 27, 2000
Posts
383
Read the article linked in post #80, it goes into greater depth on scanlines. This isn't a device one hooks up externally to take RGB or S-video and turn it to VGA; rather, this is something soldered to specific points on the mobo to generate a VGA signal natively.

If it helps: Think of it as if the Neo had now been designed to run VGA from the start.


Oh wow. So I guess pre consolized mvs or modded aes systems.
 

fenikso

Slug Flyer Pilot
15 Year Member
Joined
Oct 6, 2004
Posts
3,932
Oh wow. So I guess pre consolized mvs or modded aes systems.

Yes. It's a pretty exciting developement in the neo consolizing/modding scene. This along with the HDMI mod (by someone else that can be read about in a different thread) are game changers for the home modder (imho).

I mean, I thought jroks were cool (and they still are) but this is next level stuff as far as I'm concerned.
 

mikejmoffitt

Mickey's Coach
Joined
Feb 6, 2014
Posts
578
New Feature: 480p AND 240p component video support is included now. With two switches you can go between these four output modes:

-240p RGB (standard, no need to have two ports on the same console)
-240p Component (digital colorspace conversion so no expensive encoder board to include)
-480p VGA
-480p Component (most HDTVs still offer this!)

I think adding Component output will increase accessibility with a lot more televisions. Many new TVs have dropped the VGA port but still take 480p component, so having it available greatly increases the potential userbase size.
 
Top