Log in

No account? Create an account
architecture syn of GDEMU is 
7th-Aug-2011 05:39 pm
And they said imitation diamond wasn't good enough :)

2011-08-07 Dreamcast GD-ROM drive hardware emulator

So, does it work? Sure. It's a very early version though. I've hit some metastability problems so I switched from external ARM7 MCU to NIOS2 running on FPGA to speed up debugging. After I reversed my main clock polarity (yeah, Star Trek style) and it worked better I finally realised that I'm running a synchronous system with asynchronous inputs. Which is basically the same as having two different clock domains since I have no control over setup/hold times... So I've added two-stage synchronizers to /DIOR and /DIOW but that's additional latency and Dreamcast has a bad habit of deasserting /CS signals shortly after rising /DIOx. These things always work so well on paper :)

In the end the hardware side of GD interface is pretty small, should fit in EP2C5 (that's Cyclone II FPGA with 5k logic elements) and that's pretty cheap. The downside is I only have so much internal RAM so the main data buffer is just 8kB. While external SRAM could help here, I'm not yet sure it's worth the trouble. We'll see.

Digital audio is completly not supported yet (but is part of the design, so it will be added eventually) and I just wanted to test it out ASAP so I went with slow, PIO-only SD card access and very inefficient CPU buffering. Also, external MCU needs to be connected to FPGA with some sort of data bus and this becomes a bottleneck for the transfers, as it turns out. For example my ARM7 doesn't have a dedicated external memory interface so I have to do everything myself using a PIO port. With only 30 pins (minus a few for SPI and clock output) all I could manage was 8-bit shared address/data bus. Not very fast, unfortunately.

Because of the slow transfers games exhibit various issues, like missing textures, slowdowns, stuttering sound. This will get better as the project matures. In fact, with proper buffering I'm sure I can get it working as well as original GD drive and perhaps even faster - up to some 2x, which is the limit of what one can do with SD cards in SPI mode. Well, there's always the USB route I suppose.

By the way - I get simply tons of spam in the comments now. I've enabled LJ CAPTCHA but that only cut it in half or so. Worst of all, the spam looks (at the first sight) as proper comments, pretty nice English, capital letters, periods. I might accidentaly delete some actual comments while cleaning so keep that in mind when posting here. And if the situation gets even worse I'll probably disallow anonymous comments completly... though that's the last resort.

EDIT: Okay, a small explanation on what this does.

I started this project long time ago but lost interest after hitting some walls. Recently I had a few good ideas and decided to work on it a bit.

What you see on the photo is Dreamcast with it's cover off and the GD drive assembly removed. I cut some holes and soldered wires directly to the mainboard to avoid messing with the original connector. This way I can always plug the drive back in and use it as before - or even better, I can use FPGA as logic analyzer to watch the traffic.

In this configuration there is no real drive and FPGA runs a soft-core CPU that emulates it. Obviously there's some glue logic in there as well or I wouldn't need an FPGA in the first place :) Data is being pulled from SD card - you can see it inserted just over the flat cables. With this I can run any dumped game, and unlike CD rips I actually emulate a GD media so the Dreamcast can't tell the difference. The USB is used to program the FPGA and I can't disconnect it because I don't have a license for that NIOS2 soft-CPU core, it will stop working after the PC uplink is lost. Other than that I can't use it for data transfers unfortunately.

The idea is to have a much smaller (and cheaper) FPGA here with fast external MCU. Data would be stored on SD media or pulled via USB 2.0 uplink to PC.

So far I've tested a couple of games for EU region, and a few JP ones after I hacked them to be multi-region :) I do have Japanese Dreamcast mainboard (well, two actually) but this is the only one I have modified for the project. Once this goes out of prototype phase I'd like to find a matching connector and just make it a plug-in replacement for the GD drive.

So... Skies of Arcadia works, at least EU version. Hacked US one shows no picture but I can hear it running. It works on Makaron but I'm starting to wonder if there is a problem with this particular dump... Anyway, the GDEMU is good enough to not freeze the intro sequence like the ripped version does. There is about 3 seconds of video/audio desync at the end of the intro due to the transfer speed being a bit too low. Same things happens in Dead or Alive 2 intro, which is also pretty long. But other than that it seems to work. Street Fighter Alpha 3 has some sound issues in the attract mode but not during actual fights. This is all after a few improvements I made today, I still need to run SPI link closer to 25MHz to get better transfers from SD card. Buf for many games, like Soul Reaver 2 this is already enough to play without any problems. MPEG movies work OK as well.
8th-Aug-2011 03:12 pm (UTC)
I have no idea what's going on in that picture, and after reading everything I'm even more confused.

My best guess is some sort of pc-dc hybrid that emulates gd-rom, or am I not even close haha.

Would you mind explaining it a little simpler for dumb people like myself?

But Dr.Fred quote FTW!
9th-Aug-2011 07:50 am (UTC) - Nintendo Wii WODE
There is the same thing on the Nintendo Wii scene called WODE.


And it works for me like a charm almost 1 year ! :-)
9th-Aug-2011 10:58 am (UTC) - GDROM connectors
Hi! This is awesome! I have some similar ideas but you have made more progress :)

If you are wondering about the connectors I have posted parts-numbers here:
9th-Aug-2011 12:35 pm (UTC) - Re: GDROM connectors
Cool! These part numbers will sure come in handy.
Over the months that passed since I first mentioned my project I was contacted by some 3 or so guys interested in the details. So there might be more people trying to do the same thing :)

I was wondering if MCU-only approach would be possible, seems like a tough thing to do. But MCU with PLD should be enough, I went with FPGA since it's what I have but I target a very low cost device. I was kinda thinking of selling a finished product to raise some money.
9th-Aug-2011 11:06 am (UTC)
So does this mean your are trying to emulate gdi game dumps?
9th-Aug-2011 12:42 pm (UTC)
Uh, the way you worded it... I'm not sure how to respond.

What I do here is emulate a hardware GD-ROM drive. I don't need real GD discs anymore, it's enough if I have them dumped. This greatly helps me with testing - I can run titles that Makaron has problems with on hardware.
9th-Aug-2011 11:33 am (UTC)
Puściłem ten tekst przez google translate ale tłumaczenie nie jest za dobre. Mógłbyś krótko opisać co to właściwie jest, do czego służy albo do czego będzie w przyszłości służyć?

Zrozumiałem tylko że wymontowałeś czytnik GD i przylutowałeś urządzenie do Dreamcasta. Udało ci się odpalić kilka gier i to w zasadzie tyle. Bo technicznej gadki w ogóle nie zrozumiałem. Czym to się różni od zestawu czytnik kart SD + Dreamshell oprócz tego że Twoje urządzenie musi być na stałe podłączone do komputera?
9th-Aug-2011 12:51 pm (UTC)
To jest sprzętowy emulator napędu GD-ROM. Jak nazwa wskazuje, jest to kawałek elektroniki i Dreamcast nie widzi różnicy między moim urządzeniem a prawdziwym napędem. Oczywiście moje urządzenie nie wymaga płyt GD, dane trzyma na kartach SD.

Nie musi być na stałe połączone do PCta, ten konkretny prototyp musi być. Po odłączeniu po około godzinie się wyłączy ze względu na brak płatnej licencji.

Czym się różni od Dreamshell? Po pierwsze, nie wymaga przeróbek w BIOSie czy bootowania płyty która podmieni kod BIOSa. Po drugie ma 100% kompatybilność ze wszystkimi grami, oraz programami homebrew. Po trzecie jest dużo szybszy i obsługuje ścieżki audio - tzn. będzie, bo nie ma ku temu przeszkód poza brakami w kodzie.
9th-Aug-2011 10:37 pm (UTC) - Great job!!!!
Hey man, this is awesome!!!

Maybe, if you could use a HD instead of the SD card, the transfer rates could be better :)

Do you pretend to release this? If yes, to the public or commercialy?

And one more question, to emulate the GD-ROM, you prepare the SD card tho have the file system like the GD-ROM or you can use some kind of loader?

Thanks, and continue the great job, if you plan to release this in the market, you can be sure that i would buy it, just like a lot of other Dreamcast lovers!
10th-Aug-2011 12:24 am (UTC) - Re: Great job!!!!
As I already mentioned, I think I could sell these (once the project it mature enough) to raise money for software and hardware I need. This is just a hobby of mine after all.

There is no loader since I'd have to modify the BIOS. It's just a GD drive emulator. It does let you pick which image on SD card is to be "mounted" - this is selected with switches. A loader could be made still, simply create a dummy GD/CD image with the code and boot it as the very first thing from SD card. It could talk back to GDEMU with secret commands to change settings (instead of using switches) and then reboot Dreamcast to load the selected game. I'm not going to write it though, maybe someone else will.
9th-Aug-2011 11:42 pm (UTC) - Bravo!
I am Anthony817 from the isozone. This is making my head explode! You are awesome man, just awesome!

How much would one of these cost to make?

I know you must have time to perfect the technology and get everything improved before we get any kind of plans made.

Anyway, you just got even more respect from the community for this!

I have posted this at about 4 or so sites, so you might want to take a look at them and answer question others might have brought up if you wanted to see what others are saying?




10th-Aug-2011 12:36 am (UTC) - Re: Bravo!
Hard to say how much it will cost since I haven't even decided on the MCU yet. This is a prototype and while it works, it's not finished.

Also, I'd like to point out that (while I expect some other people to be interested in this as well) I made it for my own, persnal use. To aid game testing for Makaron developement. I'm thinking of selling it because I could use the money but it's not really decided yet or anything. If this project gets too much attention from the "free games" crowd then I'm going to change my mind and keep it to myself. Just so we are clear on this.
Re: Bravo! - Anonymous - Expand
Re: Bravo! - Anonymous - Expand
Re: Bravo! - Anonymous - Expand
Re: Bravo! - Anonymous - Expand
10th-Aug-2011 12:18 am (UTC)
Hello, i'd to ask you - do you use any boot utility to load games from sd card or it just run like from GD-Rom ?

P.S. hi Anthony.)
10th-Aug-2011 02:12 am (UTC)
Nice stuff, you rock man!

About the "free stuff" people:
I think that the "collector" people are the persons the most interested in this adapter! Every DC game can already be found on the internet in a relatively good quality. Only those that would like to get to most out of homebrew or to play beta games as if they were on a gd-rom would see a real difference. Especially give the price this might cost!

Looking forward for this!

10th-Aug-2011 09:11 am (UTC)
My stance on copyright and software licensing should be well known by now, after all I've wrote here. And yes, I'm aware that keeping games "for testing" isn't exactly legal, but I don't have much choice if I'm to develop Makaron further.

If there are people out there that would like to use this project for their own, personal needs then I have no objections. There are some perfectly valid reasons for this, the most obvious ones are drive failure and easier access to homebrew software. What I certainly don't want is to turn this place into warez central, with people asking where to download games, how to boot downloaded games, or even posting links to downloads.
(no subject) - Anonymous - Expand
Copywrite stance - Anonymous - Expand
10th-Aug-2011 10:56 am (UTC)
howdy dknute , i think your work in general is phenomenal.........

With whats being said about your GDEMU i think do whats best for you and your interests. I would love to see it manufactured and sold but id rather do whats right and side with the inventors happiness.

hope this helps in your future thoughts with this situation

10th-Aug-2011 06:36 pm (UTC)
i like that gdemu just for the lens life, on other side is just the time, ten years later of the dreamcast dead.
10th-Aug-2011 08:15 pm (UTC) - This could be great!
Hi, I was wondering if you were coding this whole thing in VHDL or Verilog?

I am very interested in this project. I will make sure to follow it!

As a MCU proposition, I would suggest maybe looking into the Parallax Propeller, it's a really fast, really powerful MCU. It is also not too expensive.
10th-Aug-2011 11:14 pm (UTC) - Re: This could be great!
VHDL. It's a strange language, so... overengineered.

Anyway, that Propeller thing looks interesting but 8 cores are overkill. I need just one, and ~20 MIPS will do if I can make the SD transfers fast enough. DMA on ARM7 is pretty nice for that, it's just that my AT91SAM7S lacks external memory interface and that complicates things.
12th-Aug-2011 01:36 am (UTC) - Skies of Arcadia
US Skies of Arcadia doesn't display via RGB SCART, the game runs with sound but no visuals - is that the issue you're finding perhaps?

Looks like a fun project.
12th-Aug-2011 04:13 am (UTC) - Re: Skies of Arcadia
That was my guess too but it does work in emulator. Though perhaps I messed up the cable setting code. Again. Sigh.
While it might seem it's actually better if it works, that's not exactly a sign of a faithful emulator :)
13th-Aug-2011 01:04 pm (UTC) - Awesome
Looks awesome mate, keep it up. I have a working Dreamcast which I seldom play out of fear of it dying, and another for spare parts! The GD reader in the spare is dead so I got it cheap, but it looks like one day it might live once more :)
13th-Aug-2011 01:44 pm (UTC)
This is excellent. Nothing more to say.

I am doing the same thing, except for a different console. If you could share some guides, or links to me, I would really appreciate it.

It is the same dev board as yours. Altera DE1...


Thanks, Haunted360.
13th-Aug-2011 05:30 pm (UTC)
Don't have any links, I do all this stuff myself :) All I can give you is some hints.

First, mind the fact that these FPGAs can handle only up to 3.3V - and even for that you should use protection resistors to somewhat filter out transient over/undershoots. DE1 board has these already installed and while it won't immediately fry if you try to interface it with 5V TTL/CMOS logic, it eventually will. It pays to check the peak-to-peak voltages with a scope first.

Second, once you connect your FPGA to target in a safe manner, run logic analyzer (Signal Tap 2 is pretty good and free), grab as much information about the bus as you can. You might still need LA to debug your own project later so try to leave some resources (like on-chip memory) for that.

And third, you will most likely run a synchronous system with a state machine or even soft CPU core mabe. Take great care interfacing this with buses and signals that are running with different clock (not phase-synced with yours).

Other than that it's just the hard work you need to put into designing your system :)
14th-Aug-2011 12:43 pm (UTC)
Well done.Can't wait to buy one of those!
Page 1 of 3
<<[1] [2] [3] >>
This page was loaded Jun 26th 2019, 1:38 am GMT.