Open Source FPGA based GDROM Emulator

Discussion in 'Sega Dreamcast Development and Research' started by madsheep, Aug 11, 2016.

  1. minnieman

    minnieman Member

    Joined:
    Oct 2, 2016
    Messages:
    17
    Likes Received:
    2
    Thank you so much! I'm heading in now and will give it a shot.

    The speed of the loading is not surprising... I was reading somewhere that an sd card in SPI mode transfers data at around 25kbps :S

    Licensing aside, would there be anyway to enable 4 bit mode on this FPGA? This device would definitely be able to compete with GDEMU if that were the case!
     
  2. minnieman

    minnieman Member

    Joined:
    Oct 2, 2016
    Messages:
    17
    Likes Received:
    2
    Same behavior... 4 LEDS and not recognizing SD. ERGH!
     
  3. TriMesh

    TriMesh Site Supporter 2013-2017

    Joined:
    Jul 3, 2008
    Messages:
    2,118
    Likes Received:
    620
    IMO, the biggest non-legal problem with that would simply be getting it to fit inside the FPGA. It's not an especially big FPGA anyway and a lot of it is occupied by the AVR soft core. My personal feeling is that a better approach would be to remove the soft core and put a real CPU on the board - say one that has a built-in 4-wire SD interface in the silicon.
     
    diekatzchen likes this.
  4. minnieman

    minnieman Member

    Joined:
    Oct 2, 2016
    Messages:
    17
    Likes Received:
    2
    Wouldn't having a CPU on board drive up the price a bit? The cost of my build all said and done was about $70USD, add a CPU to the equation and you might as well just get a GD-EMU! :D

    Could my problem be that I am flashing via iceprog for windows? Maybe I should try flashing on linux?
     
  5. TriMesh

    TriMesh Site Supporter 2013-2017

    Joined:
    Jul 3, 2008
    Messages:
    2,118
    Likes Received:
    620
    Yeah, it would increase the price a bit - but you don't need an especially powerful CPU for this application. Something that's a lot more capable than the soft core that's currently in use would probably cost something like $5 at single unit pricing.

    The other thing that's worth considering is that currently the CPU is taking up about half the FPGA - and that's a $12 chip (also single unit) - so basically it's using $6 worth of resources to get a level of performance quite a bit less than a $5 CPU. If you used an external CPU, then it might also be possible to use a smaller and cheaper FPGA (and possibly one that's in a much more end-user friendly package than BGA).

    You could also consider using a different FPGA family - I suspect the main reason that Marcus chose that one was simply that it had an open-source toolchain - something that's very unusual for programmable logic.

    Of course, if you made all those changes you would end up with a completely different product...

    I have no experience of using the Windows version of iceprog - I will see if I can download it and see if I can successfully flash that evaluation board.

    Edit:

    This might be a stupid question, but do you have the jumpers on the evaluation board in the correct positions?

    It needs to be set up so that the FTDI programs the serial flash rather than configuring the FPGA - J7 should have a jumper installed and J6 should have jumpers across pins 1-3 and 2-4 (I.E. 3 jumpers installed, all in the same direction between the ICE and the FTDI chip).
     
    Last edited: Jan 16, 2018
  6. Bad_Ad84

    Bad_Ad84 The Tick

    Joined:
    May 26, 2011
    Messages:
    8,326
    Likes Received:
    1,103
  7. olig442

    olig442 Member

    Joined:
    Feb 12, 2018
    Messages:
    8
    Likes Received:
    2
    hi guys, I managed to build 2 of these but cant get em to work.
    I know when i remove the sd card it cycles threw the led lights. But cant get any game to load.
    I wonder is there a special type of sd card needed. Format to fat32?. Also used the program to convert the image to GIO. Tried a few different disks makes no difference.
    Any ideas.
     
  8. thepingas

    thepingas Member

    Joined:
    May 15, 2014
    Messages:
    5
    Likes Received:
    10
    I was working on my own drive replacement years back and got sidetracked after I hit a couple of stumbling blocks and the forum got nuked.

    Now, it might be the time to actually try this again, since it looks like Marcus tackled most of the hard work. One of the things I did manage to finish was a basic 4-bit read-only SD card core.

    Right now, I am working on a hardware design which will replace the ICE40 with an Cyclone 10LP so I can put some on board debug hardware on it. Board design is not really my forte, but I'll be giving it a go regardless.

    If anyone wants to collaborate on a performance-oriented variant of Marcus' design, let me know. As an aside, I think in the long term, there should be an open-source alternative to GDEMU that is at least as performant as the original GD-ROM drive. Preferably one that can be built by people without really expensive equipment and flexible enough to be ported to future FPGA families.
     
  9. megavolt85

    megavolt85 Robust Member

    Joined:
    Jan 8, 2015
    Messages:
    240
    Likes Received:
    313
    @thepingas lifehack, you can made ATAPI CD-ROM emulator and debug on your PC, after replaced ATAPI command set to SPI
     
  10. thepingas

    thepingas Member

    Joined:
    May 15, 2014
    Messages:
    5
    Likes Received:
    10
    I spent most of the last month digging up my old GD-ROM documentation and have downloaded Marcus' Verilog code.

    Unfortunately, there were some architectural decisions that prevent me from porting the code easily (use of I/O latch primitives for example) as well as some issues that will probably lead to metastability problems that could propagate into the device and lead to problematic behavior (gltiches, crashes, etc).

    There are also issues with the codebase that have nothing to do with Marcus' work. The AVR core code is messy and uses reserved words so Quartus threw a fit when I imported the source. After I ironed out enough issues for the AVR core to synthesize, it turns out it takes up something like 2500 LUT, which is a rather lot considering the poor performance of the AVR. There are some modern alternatives which will work better, like C.Wolf's picorv32.

    The good news is that Marcus basically solved all of the hard reverse engineering problems and his project will serve as a good reference design.

    Unfortunately, I think the proliferation of cheap counterfeit GDEMU devices have kind of sapped a lot of the enthusiasm out of the community.
     
    fry76 likes this.
  11. thepingas

    thepingas Member

    Joined:
    May 15, 2014
    Messages:
    5
    Likes Received:
    10
    PCB came back last week and I managed to solder it together. I screwed up the regulator footprint (as is tradition) and had some other foibles, but it seems to not have any issues so bad as to make the thing unusable.

    Now I actually have to start developing the code for it.

    ode_mk_1.png
     
    Last edited: Oct 11, 2018
    fafadou, Durandal, Arcadia and 2 others like this.
  12. fafadou

    fafadou Peppy Member

    Joined:
    Aug 3, 2016
    Messages:
    382
    Likes Received:
    133
    Impressive
     

Share This Page