welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Dreamcast Emulation on the Pi2? Yes, Really!

Fri Feb 13, 2015 9:00 pm

user steev informed me that Reicast now has a Pi2 fork so have been doing some testing. As with most HLE (High Level Emulation) its very dependent on the Title being run, however, those tested so far are perfectly playable and Soul Caliber is TOO FAST! Haven't been able to get sound working yet but will continue experimenting...

Download Link - https://github.com/reicast/reicast-emul ... skmp/rapi2
Last edited by welshy on Sat Feb 14, 2015 7:20 am, edited 2 times in total.
"The list of things I have heard now contains everything!"

mgoulart
Posts: 126
Joined: Mon Feb 10, 2014 8:56 am
Location: Rio de Janeiro - Brazil

Re: Dreamcast Emulation on the Pi2

Fri Feb 13, 2015 9:41 pm

OMG!!!
I need my RPi2!!!

steev
Posts: 87
Joined: Fri Jan 27, 2012 5:08 pm

Re: Dreamcast Emulation on the Pi2

Sat Feb 14, 2015 12:07 am

Nice, Soul Calibur is very playable :)

The file-based shm workaround they used causes little hang-ups with a slow sdcard. I get better performance if I copy the emulator folder into a tmpfs first:

Code: Select all

$ mkdir tmpfs
$ sudo mount -t tmpfs none tmpfs/
$ cp -a * tmpfs/
And then run it from there

Audio seems to be broken in the Linux builds right now

mgoulart
Posts: 126
Joined: Mon Feb 10, 2014 8:56 am
Location: Rio de Janeiro - Brazil

Re: Dreamcast Emulation on the Pi2

Sat Feb 14, 2015 12:37 am

Could you upload a video showing the emulation?

barrybarryk
Posts: 20
Joined: Thu Jul 19, 2012 12:11 pm

Re: Dreamcast Emulation on the Pi2

Sat Feb 14, 2015 1:52 am

Compiling it was easy (and fast on a Pi2!) but you can tell the port is very, very barebones for now.

It hard crashes with an unimplemented opcode error on each of the roms I fed it (SFIII, Sega Rally 2, Ikaruga and Code Veronica) but it did read the bios fine and had no problems grabbing the screen etc so it's functional. It just needs fleshing out a bit and playing with the compatibility settings.

I'd give it a few weeks.

Critanime
Posts: 8
Joined: Fri Feb 13, 2015 9:29 am

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Sat Feb 14, 2015 8:58 am

This will be epic as I am putting a Pi 2 into a Dreamcast case. :D

welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Sat Feb 14, 2015 9:19 am

Update
Have rebuilt from source with some 'tweaks' but as others have found the sound is not implemented as of yet. As is often the case with emulation, forget any Wiki, everything had loaded except for Crazy Taxi (which the Wiki says is perfect) where as some of the Titles tested below are marked as 'Not Working', just try an Iso from another source (See Below). Additionally, although the documentation says that .cdi files can be an issue, all the Titles below were of that format.

Soul Caliber - Excellent
Virtua Fighter 3 Team Battle - Choppy but Playable
Under Defeat 2 - Choppy but playable
Crazy Taxi - Segmentation Fault, didn't work. Update - Sourced another Iso, Excellent.
Power Stone - Excellent

Note: - 'Choppy' indicates Frame Skip is obviously being employed

It seems the .cfg file isn't being read so any changes are not reflected in the running, it would be nice to have a list of command lines to force them on run (as yet I haven't found one). Considering the Pi2 build is less than a day old all in all this looks VERY promising! If any user wishes for me to test a Title leave a post, if I have it will try/report.

Update 2
Daytona USA 2001 - Choppy but playable
Sonic Adventure 2 - Very Choppy when Sonic is moving fast but otherwise fine
Ikaruga - Most accurate tested so far
Marine Fishing - Excellent
Shenmue - Occasionally Choppy

Additionally, Overclocking seems to make little difference on Titles run, seems as though its limited by the Software.

NOTE: Certain Dreamcast Titles used the D-PAD for control (e.g. Virtua Fighter 3 Team Battle). If using an XBox Pad with the XBoxDrivers the --dpad-only Option in the rc.local DOES NOT transfer the controls. However, removing the script AND the Drivers relying on the built-in Kernel ones will rectify the issue and allow most games to control correctly. The LED doesn't lock though and continues flashing but makes no difference, POI - I wonder how many other Emulators now no longer need the specific XBoxDrivers?
Last edited by welshy on Mon Feb 16, 2015 3:47 pm, edited 15 times in total.
"The list of things I have heard now contains everything!"

steev
Posts: 87
Joined: Fri Jan 27, 2012 5:08 pm

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Sat Feb 14, 2015 7:08 pm

OK I got sound to work by copying some OSS code from the Pandora port

Put this somewhere in your Makefile:

Code: Select all

CXXFLAGS += -DUSE_OSS -DTARGET_RPI
Now edit core/linux-dist/main.cpp:

Before main(), insert:

Code: Select all

#ifdef TARGET_RPI

#include <sys/soundcard.h>

static int audio_fd = -1;

void init_sound()
{
    if((audio_fd=open("/dev/dsp",O_WRONLY))<0)
                printf("Couldn't open /dev/dsp.\n");
    else
        {
          printf("sound enabled, dsp openned for write\n");
          int tmp=44100;
          int err_ret;
          err_ret=ioctl(audio_fd,SNDCTL_DSP_SPEED,&tmp);
          printf("set Frequency to %i, return %i (rate=%i)\n", 44100, err_ret, tmp);
          int channels=2;
          err_ret=ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &channels);
          printf("set dsp to stereo (%i => %i)\n", channels, err_ret);
          int format=AFMT_S16_LE;
          err_ret=ioctl(audio_fd, SNDCTL_DSP_SETFMT, &format);
          printf("set dsp to %s audio (%i/%i => %i)\n", "16bits signed" ,AFMT_S16_LE, format, err_ret);
        }
}

void clean_exit(int sig_num) {
        if(audio_fd>=0) close(audio_fd);
}

#endif
Now find this part:

Code: Select all

#ifdef TARGET_PANDORA
        signal(SIGSEGV, clean_exit); 
        signal(SIGKILL, clean_exit); 
         
        init_sound(); 
#endif 
Change it to:

Code: Select all

#if defined TARGET_PANDORA || defined TARGET_RPI 
        signal(SIGSEGV, clean_exit); 
        signal(SIGKILL, clean_exit); 
         
        init_sound(); 
#endif 
And this one:

Code: Select all

#ifdef TARGET_PANDORA
        clean_exit(0);
#endif
Change it to:

Code: Select all

#if defined TARGET_PANDORA || defined TARGET_RPI
        clean_exit(0);
#endif
Lastly find:

Code: Select all

#ifdef TARGET_PANDORA
        write(audio_fd, frame, samples*4);
#endif
And change it to:

Code: Select all

#if defined TARGET_PANDORA || defined TARGET_RPI
        write(audio_fd, frame, samples*4);
#endif
Now recompile and you can get sound using the alsa-oss wrapper.

Code: Select all

$ sudo apt-get install alsa-oss
$ aoss ./reicast.elf <args>
A little stuttery, but it works :)

welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Sat Feb 14, 2015 7:35 pm

steev
Nice One! Will have to try that tomorrow! Now we have more performance data and working sound will add a Link to this Thread in the Emulation Sticky.
"The list of things I have heard now contains everything!"

bobbyyoustra
Posts: 29
Joined: Sun Sep 28, 2014 6:24 pm

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Sun Feb 15, 2015 2:20 am

This is quite humorous considering we have a Sega Dreamcast emulator before we even have a Sega Saturn emulator. :)
AND THE SEGA SATURN IS SUPPOSTED TO BE WEAKER THAN THE DREAMCAST!* :lol:

*Yes I know that the Saturn is multi-processor and is very difficult to program an emulator for.

j0z0r
Posts: 52
Joined: Fri Oct 28, 2011 5:46 pm

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Tue Feb 17, 2015 12:37 am

This is awesome news! If I can play Ikaruga on my Pi, I will be able to get so much practice at those later levels

C-Fu
Posts: 88
Joined: Mon Nov 26, 2012 10:07 am
Location: Malaysia

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Wed Feb 18, 2015 7:29 pm

So can somebody teach a newbie on how to compile and go about running this on his RPi 2?

welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Thu Feb 19, 2015 6:32 am

C-Fu
Requirements: Joypad (there are no Keyboard Controls), Dreamcast Iso’s, Dreamcast Bios
Reicast can be run from XWindows without issue; I would assume that CPU Overhead is minimal on the Pi2 as running from Console seems to have little impact on performance

Download Reicast from the Link above, place it at /home/pi and uncompress the zip (right click and select ‘Extract Here’)
Open a Terminal
CD (change Directory) into the Pi2 build folder
Type: CD /home/pi/reicast-emulator-skmp-rapi2/shell/rapi2
Compile the source
Type: make
It will take approximately 10-15 minutes
In the rapi2 folder you should now see the Binary (reicast.elf) and associated config Files and Folders. Place any Game Titles you have in this folder and if they are not uncompressed, extract them (this makes it easier to run them as the path is the same as the Binary, if placed elsewhere you will have to type the path into the run command; See Below). Rename them for easy typing in the Command Line execution, e.g. if the file is called “Virtua Fighter 3 Team Battle”, rename to something simpler such as vf3 (NB: Don’t use spaces as the command will be interpreted incorrectly!).
make a new folder here (right click, select ‘New folder’) and rename it boot
Place your Dreamcast Bios files in this Folder (dc_boot.bin & dc_flash.bin are the files required)
Run Reicast
Type: ./reicast.elf -config config:image=/path/file.cdi
e.g. ./reicast.elf -config config:image=vf3.cdi
To exit the emulator press Ctrl & c

Hope That Helps! Enjoy!
Last edited by welshy on Fri Feb 20, 2015 12:52 pm, edited 1 time in total.
"The list of things I have heard now contains everything!"

C-Fu
Posts: 88
Joined: Mon Nov 26, 2012 10:07 am
Location: Malaysia

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Fri Feb 20, 2015 11:35 am

Okay, I tried compiling (with make and also make -j 4 to use all 4 cores - less than 5 minutes I think!) and everything seems to be okay, except that there were no folders created (other than the existing obj folder).

So I ran ./reicast.elf -config blah

Result:

Code: Select all

ARM VFP-Run Fast (NFP) enabled !
Linux paging: 00001000 00001000 00000FFF
evdev open: No such file or directory
SDK: Found 'NES30              NES30 Joystick' joystick with 6 axis and 12 buttons
Falling back to file allocation..
MAP 00800000 w/ 25165824
MAP 20000000 w/ 25165824
MAP 04000000 w/ 16777216
MAP 06000000 w/ 16777216
MAP 0C000000 w/ 0
A8
vmem reserve: base: 545D0000, aram: 745d0000, vram: 585D0000, ram: 605D0000
Resetting mem
Mem alloc successful!-config : invalid parameter blah, format is section:key=value
wtf ./reicast.elf is suposed to do ?
-config : invalid number of parameters, format is section:key=value
libwebsockets test server - (C) Copyright 2010-2013 Andy Green <andy@warmcat.com> - licensed under LGPL2.1
Initial logging level 7
Library version: 1.3 c11b847
IPV6 not compiled in
libev support not compiled in

 static allocation: 4452 + (12 x 1024 fds) = 16740 bytes
 canonical_hostname = UltimateCenter-Fu
 per-conn mem: 116 + 1554 headers + protocol rx buf
 Listening on port 5678
Unable to find bios in
./data/
Exiting...
SIGSEGV @ fault_handler+0xFFE74BC0 ... 00000000 -> was not in vram
Fatal error : segfault
 in fault_handler -> ../../core/linux/common.cpp : 78

Trace/breakpoint trap
I noticed these lines:
evdev open: No such file or directory
Mem alloc successful!-config : invalid parameter blah, format is section:key=value
wtf ./reicast.elf is suposed to do ? :lol:
Unable to find bios in
./data/

So I went on and put the two .bin files in a newly-created data folder. And everything works!

Except that my NES30 http://www.nes30.com joypad doesn't register its Start button.

I can confirm that Sonic Adventure 2 works, and Utopia CD loader disc partially works (the body of the reindeer is invisible).
welshy wrote:C-Fu
In the rapi2 folder you should now see the Binary (reicast.elf) and associated config Files and Folders. Place any Game Titles you have in this folder and if they are not uncompressed, extract them (this makes it easier to run them as the path is the same as the Binary, if placed elsewhere you will have to type the path into the run command; See Below). Rename them for easy typing in the Command Line execution, e.g. if the file is called “Virtua Fighter 3 Team Battle”, rename to something simpler such as vf3 (NB: Don’t use spaces as the command will be interpreted incorrectly!).
make a new folder here (right click, select ‘New folder’) and rename it boot
Place your Dreamcast Bios files in this Folder (dc_boot.bin & dc_flash.bin are the files required)
Run Reicast
Type: ./reicast.elf -config config:image=/path/file.cdi
e.g. ./reicast.elf -config config:image=/vf3.cdi
To exit the emulator press Ctrl & c

Hope That Helps! Enjoy!

welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Fri Feb 20, 2015 11:45 am

C-Fu wrote:Okay, I tried compiling (with make and also make -j 4 to use all 4 cores - less than 5 minutes I think!) and everything seems to be okay, except that there were no folders created (other than the existing obj folder).
Odd, maybe they are 'Hidden' folders (I always have mine view able), have you changed the folder properties to 'show hidden'?
"The list of things I have heard now contains everything!"

C-Fu
Posts: 88
Joined: Mon Nov 26, 2012 10:07 am
Location: Malaysia

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Fri Feb 20, 2015 4:11 pm

welshy wrote: Odd, maybe they are 'Hidden' folders (I always have mine view able), have you changed the folder properties to 'show hidden'?
Yeah I did. I'm using WinSCP to view it, no data folder was created. ls -a also didn't show any other folder besides obj. But no biggie, everything sort of works :D Oh, I forgot. I tried it on my TV, and there's no sound.

now have to figure out my joypad, and find some documentation with reicast. Many thanks for your help though :D

welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Fri Feb 20, 2015 5:32 pm

C-Fu wrote:Oh, I forgot. I tried it on my TV, and there's no sound.
Currently the sound isn't working but as this is a first build fork that's not surprising, no doubt it will be enabled given further development. In the mean time steev has developed a 'work round' using some of the Pandora Code and oss-wrapper (see post above).
"The list of things I have heard now contains everything!"

swilson
Posts: 2
Joined: Fri Oct 25, 2013 3:10 am

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Sun Feb 22, 2015 3:38 am

I have this installed, without sound. Seems to work pretty good except for controller issues and not being able to exit the emulator - Ctrl & c doesn't do anything. Does anybody know how to stop it via the command line?

As for the games, here is what I have tried.

Crazy taxi - seems to work well, but I can't play it because no button on my controller seems to correspond to the gas pedal. Controller works fine for moving through the menus.
Demolition racer- same as Crazy Taxi, looks like it would work ok, but can't get the controls working.
Mortal Kombat Gold - Looks good, can punch and kick, but can't move forward or backward
Soul Caliber - works well
Marvel vs. Capcom 2 - works well
Sonic Adventure 2 - was a bit choppy but playable for a few minutes then crashed.
House of the Dead 2 - won't start
Star Wars Racer - won't start

User avatar
Mequa
Posts: 172
Joined: Sun Sep 09, 2012 9:54 pm
Location: England
Contact: Website

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Tue Feb 24, 2015 5:28 am

welshy wrote:Requirements: Joypad (there are no Keyboard Controls)
Is it possible to run some kind of joypad emulator to run this with keyboard controls?

phatsamury
Posts: 1
Joined: Fri Mar 27, 2015 12:30 am

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Fri Mar 27, 2015 12:38 am

Hey guys, looking for a little help. I managed to get reicast installed and I can start a game. I have a gamepad (Saitek P220) plugged in, but I can only use it to navigate through the Dreamcast bios screen, once the game starts (Marvel vs Capcom 2), my gamepad doesn't allow me to press start. It appears some of you guys have had better luck.

Can someone please explain how I can configure my gamepad? I see there's an emu.cfg file, but I don't see where I can configure it.

Thanks in advance for your help!

C-Fu
Posts: 88
Joined: Mon Nov 26, 2012 10:07 am
Location: Malaysia

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Sat Mar 28, 2015 8:04 am

phatsamury wrote: Can someone please explain how I can configure my gamepad? I see there's an emu.cfg file, but I don't see where I can configure it.
You can't. It's a very very early alpha build.

jacobsson
Posts: 9
Joined: Wed Mar 13, 2013 5:37 pm

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Fri Apr 03, 2015 11:54 am

Hi guys! any updates on this subject?
Id love to see a video of a playable game such as powerstone or soul caliber! :)

GizmoTheGreen
Posts: 27
Joined: Mon Jul 16, 2012 12:39 pm

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Sun Apr 05, 2015 10:24 pm

I'd love to see Grandia 2 running, can anyone tell what resolutions it can handle? native only or can it do 720p, 1080p?

Ttdj
Posts: 1
Joined: Tue Apr 07, 2015 4:30 am

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Tue Apr 07, 2015 4:34 am

Edit: Following instructions above it is all working.

Here is some video of Soul Calibur for those interested: https://www.youtube.com/watch?v=l5PJXMrSTDc

I would like to hear if you are getting better / worse performance than me?

jacobsson
Posts: 9
Joined: Wed Mar 13, 2013 5:37 pm

Re: Dreamcast Emulation on the Pi2? Yes, Really!

Sat Apr 11, 2015 10:28 am

Thanks for the vid, really appreciated!
This looks very promising for the future, I wouldn't say it playable at this stage.
Do you overclock your Pi2 atm?

Return to “Gaming”