Deunan
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.
Comments 
8th-Aug-2011 03:12 pm (UTC)
Anonymous
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
Anonymous
There is the same thing on the Nintendo Wii scene called WODE.

http://www.wodejukebox.com/wodestandard.php

And it works for me like a charm almost 1 year ! :-)
9th-Aug-2011 10:58 am (UTC) - GDROM connectors
Anonymous
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:
http://jonr.neovanglist.net/?p=66
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)
Anonymous
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)
Anonymous
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!!!!
Anonymous
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!
Anonymous
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?

http://www.theisozone.com/forum/viewtopic.php?f=26&t=768&p=6917#p6917

http://www.dc-swat.ru/forum/thread-1679.html

http://www.racketboy.com/forum/viewtopic.php?f=1&t=32297

http://www.assemblergames.com/forums/showthread.php?t=34646
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)
Anonymous
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)
Anonymous
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!

FG
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)
Anonymous
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

s8n
10th-Aug-2011 06:36 pm (UTC)
Anonymous
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!
Anonymous
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
Anonymous
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
Anonymous
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)
Anonymous
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...

http://www.haunted360.com/development-alterafpga.html


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)
Anonymous
Well done.Can't wait to buy one of those!
23rd-Aug-2011 08:05 am (UTC) - Where do I download this Makaron?
Anonymous
Where I download Makaron. I see you speak about it but no links anywhere?
25th-Aug-2011 07:27 am (UTC) - Re: Where do I download this Makaron?
Anonymous
You can easily find his emulator on the internet, just search for "Makaron Dreamcast emulator" with Google.
3rd-Sep-2011 08:46 am (UTC) - amazing progress
Anonymous
Hey Deunan I have desired to do the same thing you are doing for a while now but have no real hardware or emulator experience (just software and games).
I was planning on trying as soon as I had a block of time to devote to it but you're doing exactly what I wanted to do (create a piece of hardware which emulates the GD-ROM drive but has an SD-Card (or Compact Flash) interface instead, and allowing the loading of different isos on the card depending on dipswitches on the board (for multi-disc games like Shenmue, Skies of Arcadia, etc)).
Since you are so far along and doing so well, I would really just like to purchase the board you create when you're done but I wanted to ask some questions!
1) How difficult would it be to take the base you've done and convert it to run a Compact Flash interface instead? I thought compact flash would be good because the cards are bigger (and so the art stickers would look better, they feel more substantial, better size ratio to the dreamcast hardware, etc - all personal reasons I guess but still).
2) With the speed doubling compared with the base GD-Rom, what is the bottleneck from running even faster than that? As I understand, the G1 Bus can transfer at almost 10mb/s, the GD-Rom maxing out at 1.6mb/s - 2mb/s.
So if your build with the optimisations you were planning can do ~4mb/s (double the GD-Rom), what's in the way from pushing it further, like to 8mb/s or so? Is it the FGPA? Or the SD-Card reader interface/bus?

Thanks Deunan, and best of luck with the rest of the build!
6th-Sep-2011 01:25 pm (UTC) - Re: amazing progress
CF cards are bigger than SDs, yes, but not really in terms of storage space (keep in mind you only need a 2GB card for any GD image, and a 4GB one can have 3 of those already). CFs would be probably faster except the multi-wire bus is more complicated so it's a tradeoff. You'd need a bigger, more expensive FPGA just for the the I/O pin count.

As for transfer speeds... First: If you think you can just increase it by more than a factor of two and not have issues with some games, boy, you're in for some nasty surprises. Second: In burst, GD DMA can do about 13MB/s, but the drive is nowhere near that fast. That can happen but only when DMA is started after the internal buffer has been filled, and obviously won't last very long. Usually GD drive does some 1.2MB/s and there is little point in going faster than 2MB/s. Sure, loading times will shorten but there are games that are broken or actually timed to realistic values.
5th-Sep-2011 05:27 pm (UTC) - makaron
Anonymous
what are your next release of makaron, dc and naomi?
you pretend to add atomiswave emulation? (due to same techinical specifications of DC)
and hikaru?
6th-Sep-2011 01:11 pm (UTC) - Re: makaron
Right now I'm extremely busy with my job so it's hard to tell when I'll have enough time to work on Makaron. I sure hope it won't be like this until end of the year.

As for new platforms, yes, I'd like to add Atomiswave and NAOMO2 support sometime soon. But as I just mentioned, I don't even have time to work on the current code.
Re: makaron - Anonymous - Expand
Re: makaron - Anonymous - Expand
Re: makaron - Anonymous - Expand
Re: makaron - Anonymous - Expand
17th-Sep-2011 01:55 pm (UTC) - 70/71 Command
Anonymous
Just wondering how you handled the 70/71 command ? Did you just replay the response of a valid GDROM ?
17th-Sep-2011 09:52 pm (UTC) - Re: 70/71 Command
Response is generated by GD-drive firmware, different each time. Once you know how that works you can do the same, though there is a specific byte stream that can be sent instead and it will work as well :)
18th-Sep-2011 04:15 pm (UTC)
Anonymous
what is the optimal configuration of PC (without exaggeration) that I need to run makaron?
19th-Sep-2011 12:10 pm (UTC)
Dual core CPU, about 2.4GHz for Intel and 2.8 for AMD. 1GB of system RAM for XP, bit more for 64-bit Vista or Windows 7. Modern graphics card, DX9 will do though I will slowly phase out XP/DX9 support in favour of DX11 on W7.
Makaron - Anonymous - Expand
Re: Makaron - Anonymous - Expand
Re: Makaron - Anonymous - Expand
Re: Makaron - Anonymous - Expand
Re: Makaron - Anonymous - Expand
Re: Makaron - Anonymous - Expand
19th-Sep-2011 10:33 pm (UTC)
Anonymous
When do you think you will either release the source code or release a product? Is this a fun little project, or do you have intentions to do either? Is there another website where you have more updates? I'm very interested!
20th-Sep-2011 02:14 pm (UTC)
As I said earlier, the idea was to make this into something I could sell. I sure could use the money for all the stuff I want (and that includes a MSVC compiler with proper 64-bit support). Truth be told though it's not decided yet, and I have very little free time to work on anything Dreamcast-related these days. I wouldn't be surprised if someone beat me to it - I heard about 2 others projects like this already...

I can't make any promises right now. All I can say this thing works, and even better now, but it's still just a test.
(no subject) - Anonymous - Expand
17th-Oct-2011 05:44 pm (UTC) - Makaron & button assignments
Anonymous
This is not directly related to the current post but it is a Makaron question:

On Naomi games, did each game's individual software assign the game's actions to the physical buttons or did the operators had to rewire the cabs to match the games' intended button layout?
The reason I ask is because I have a control panel with the standard Capcom fighter six button layout and I'm using Makaron to play the games. Therefore, I'm wondering if I can trust each button to be in the same order and position as the original game.
I've assigned them as follows in the Makaron ini:
1 2 3
4 5 6

Best Regards
18th-Oct-2011 01:58 pm (UTC) - Re: Makaron & button assignments
Many cabinets came with pre-arranged button layout and wiring for a given game. For universal cabinets you'd have to rewire those yourself. Not terribly difficult and you would have the game manual as well.

What's pretty standard is I/O boards that have several digital and analog inputs. What's non-standard is which input does what in the game, and so what button it should be wired to.

Capcom VS SNK is, for example, using inputs 1,2 and 4, but not number 3. And this stuff gets really ugly for analog inputs since the game only sees a value between 0 and max, and what that is in reality, how it's wired, and what's the default position varies from game to game.
18th-Oct-2011 02:18 pm (UTC)
Anonymous
why your emulator use Hardware Transform and Lightning (T&L), if the original Dreamcast hardware doesn't have it?
21st-Oct-2011 11:32 am (UTC)
The same way my emulator uses Win32 and Dreamcast didn't. Or x86 CPU. Or XInput and XAudio2 devices.
21st-Oct-2011 03:37 am (UTC) - When do you expect to have an actual product,?
Anonymous
When do you expect to have an actual product. There is a real need for a optical drive emulator for the dreamcast. If you don't plan on making anything with it, can you bring us up to speed on how you did this, so the dreamcast deving can move forward. I just fear this will be a backburnered project for the next couple years. I just hope this isn't a tease.
21st-Oct-2011 09:36 pm (UTC)
Anonymous
Hello Deunan,

I have been really impressed by your work.
But there is one things I don't get it's your reference to people looking for free games.


Sadly, most people couldn't care less (as long as they get to play "free" games) and/or consider this black magic that is best left to nerds and otherwise smelly people.


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.


I bought a EGRET II cabinet some times ago, did a mame cab.
Had a look at the other "systems" ,owned a dreamcast loong time ago and really like that console.
So i had a look at the emulators, i tryied demul, nulldc, makaron.
I choosed nulldc fot the dreamcast emulators, but found that makaron was really good as a naomi emulator.
I paid more interest to more recend arcade system expecially the naomi and the atomiswave ( I only knew the neo-geo, cps1, cps2, system16, ....).
Then I bought a naomi2 board, a new net city cabinet, and some game.
$I discovered the net boot system, a french website has released some of the rom probably dumped by you and probably without you knowing it or consent.
Powerstone 1 and virtua striker are still missing, so I decided to have a look a the naomi.c driver from the mame source in order to find if i could get this dump.
This is where I am, as I do not know that much about code that's really hard to start for a newbie.
At least I managed to combine the sailor sat patch for the sync issue when i am playing on my cabinet and the one to play at iron clad.

So what is my point ?

To understand your post it requires a lot of knowledge, combining hardware and software.
Probably most of people are looking to play "free games", I do not know what is your "motor" or where do you get your motivation.
You will probably get less attention than geohot for his work on the iphone or ps3, but i am sure that you are as much as talented
Same for Razoola when he worked on cps2.

But I think :
Even if you get only a few people like me trying with no (or limited) knowledge about coding trying to understand that's worth it.
You are not harming any industry (I don't think that sega make any money from Dreamcast or Naomi, only from the license or convertion for XBLA).

If you plan to release a GD ROM emulator, it's the same, I mean I think that the HxC Floppy Drive Emulator do not harm anybody (Don't think that a lot of
game are sold on AMIGA or CPC6128 this days .....).
The wode , or Xkey (dvd emulators for wii / xbox 360) are probably.

Bottomline you should be happy about people looking for free games at least they are paying attention to an old system who did not had enough when it was released (otherwise sega would still doing hardware), and that you probably love.
Maybe some of them will be more curious
4th-Nov-2011 02:43 am (UTC) - free games?
Anonymous
I am not interested in free games, just to merely be able to play backups of the disks I own, and to be able to do it conveniently. This system has already been hacked.If you want free games there is torrents out there where you can download every dc game out there, and get it to run off of utopia/the system itself. My interest is in something where i can run the games I have backed up without having to worry about scratched disks. Pirates are inevitable, but in a system like this that is way past it's prime, I don't think its going to hurt sega, or original programers at all. If everyone worried about pirates there would be hardly any deving at all, on any system.
Page 1 of 2
<<[1] [2] >>
This page was loaded Sep 23rd 2014, 4:18 am GMT.