Coffeehouse Thread

46 posts

My Silverlight SNES Emulator

Back to Forum: Coffeehouse
  • User profile image
    Cream​Filling512

    If anyone's interested, I ported my SNES emulator, SuperSharp, to a Silverlight app.  

     

    Here are some screenshots:

    Screen 1

    Screen 2

    Screen 3

    Screen 4

     

    You can play around with the emulator here.  You need to provide your own ROM files (SMC files), you can try some public domain ones. But you may want to mute sound, it's pretty glitchy.  Also it needs a fast machine, and compatibility isn't very good compared to other emulators.

     

    If anyone has Silverlight 3 installed on a Mac, would be interested to hear how it goes.

  • User profile image
    Maddus Mattus

    W00T!

     

    Just an idea:

     

    Create a media-center add-in so that you can use your X-Box 360 controllers to play SNES games on your home TV!

     

    Server is a bit sluggish,.. or is it me?

  • User profile image
    W3bbo

    Maddus Mattus said:

    W00T!

     

    Just an idea:

     

    Create a media-center add-in so that you can use your X-Box 360 controllers to play SNES games on your home TV!

     

    Server is a bit sluggish,.. or is it me?

    Nothing new. One guy ported a SNES emulator to ActiveX so it would be hosted within the IE shell within MCE2005. I don't know if anyone's done it for the new MCE in Vista/7 which has a 'native' extension system but I'd like to see it.

  • User profile image
    Maddus Mattus

    W3bbo said:
    Maddus Mattus said:
    *snip*

    Nothing new. One guy ported a SNES emulator to ActiveX so it would be hosted within the IE shell within MCE2005. I don't know if anyone's done it for the new MCE in Vista/7 which has a 'native' extension system but I'd like to see it.

    I did not know that.

     

    But still,.. it's a small step from Silverlight to MCE,..

     

    Both are pretty much WPF.

     

    Edit:

     

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1)
    Timestamp: Tue, 13 Apr 2010 11:26:59 UTC


    Message: Unhandled Error in Silverlight Application Error 0x2093.  Debugging resource strings are unavailable. See http://go.microsoft.com/fwlink/?linkid=106663&Version=3.0.50106.0&File=mscorrc.dll&Key=0x2093   at SuperSharp.Cartridge.LoadSram()
       at SuperSharp.Cartridge..ctor(FileInfo fileInfo, Snes snes)
       at SuperSharpLight.MainPage.ButtonLoadRom_Click(Object sender, RoutedEventArgs e)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
    Line: 1
    Char: 1
    Code: 0
    URI: http://unlimitedgilgamesh.com/supersharplight.html


    Message: Unhandled Error in Silverlight Application Error 0x2093.  Debugging resource strings are unavailable. See http://go.microsoft.com/fwlink/?linkid=106663&Version=3.0.50106.0&File=mscorrc.dll&Key=0x2093   at SuperSharp.Cartridge.LoadSram()
       at SuperSharp.Cartridge..ctor(FileInfo fileInfo, Snes snes)
       at SuperSharpLight.MainPage.ButtonLoadRom_Click(Object sender, RoutedEventArgs e)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
    Line: 1
    Char: 1
    Code: 0
    URI: http://unlimitedgilgamesh.com/supersharplight.html

     

  • User profile image
    W3bbo

    Maddus Mattus said:
    W3bbo said:
    *snip*

    I did not know that.

     

    But still,.. it's a small step from Silverlight to MCE,..

     

    Both are pretty much WPF.

     

    Edit:

     

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1)
    Timestamp: Tue, 13 Apr 2010 11:26:59 UTC


    Message: Unhandled Error in Silverlight Application Error 0x2093.  Debugging resource strings are unavailable. See http://go.microsoft.com/fwlink/?linkid=106663&Version=3.0.50106.0&File=mscorrc.dll&Key=0x2093   at SuperSharp.Cartridge.LoadSram()
       at SuperSharp.Cartridge..ctor(FileInfo fileInfo, Snes snes)
       at SuperSharpLight.MainPage.ButtonLoadRom_Click(Object sender, RoutedEventArgs e)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
    Line: 1
    Char: 1
    Code: 0
    URI: http://unlimitedgilgamesh.com/supersharplight.html


    Message: Unhandled Error in Silverlight Application Error 0x2093.  Debugging resource strings are unavailable. See http://go.microsoft.com/fwlink/?linkid=106663&Version=3.0.50106.0&File=mscorrc.dll&Key=0x2093   at SuperSharp.Cartridge.LoadSram()
       at SuperSharp.Cartridge..ctor(FileInfo fileInfo, Snes snes)
       at SuperSharpLight.MainPage.ButtonLoadRom_Click(Object sender, RoutedEventArgs e)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
    Line: 1
    Char: 1
    Code: 0
    URI: http://unlimitedgilgamesh.com/supersharplight.html

     

    MCE uses IRIS, not WPF. They're totally different UI technologies.

     

    EDIT: Oh, I see that MCE can host WPF applications. I'd still personally prefer to write to IRIS directly though, because that way you get the native L&F. WPF doesn't expose these.

  • User profile image
    Bas

    W3bbo said:
    Maddus Mattus said:
    *snip*

    MCE uses IRIS, not WPF. They're totally different UI technologies.

     

    EDIT: Oh, I see that MCE can host WPF applications. I'd still personally prefer to write to IRIS directly though, because that way you get the native L&F. WPF doesn't expose these.

    Last time I tried, neither did IRIS. They wanted application to have their own 'identity' by providing their own look & feel, or something.

     

    Edit: Not sure if this is still the case with Windows 7 Media Center.

  • User profile image
    magicalclick

    Does this mean, you will support WinPh7 down the road? It would be really cool to play SNES games on WinPh.

    Leaving WM on 5/2018 if no apps, no dedicated billboards where I drive, no Store name.
    Last modified
  • User profile image
    W3bbo

    magicalclick said:

    Does this mean, you will support WinPh7 down the road? It would be really cool to play SNES games on WinPh.

    Let's see if WinPho7 restricts programs that run other programs a la Apple.

  • User profile image
    Kolin1

    W3bbo said:
    Maddus Mattus said:
    *snip*

    Nothing new. One guy ported a SNES emulator to ActiveX so it would be hosted within the IE shell within MCE2005. I don't know if anyone's done it for the new MCE in Vista/7 which has a 'native' extension system but I'd like to see it.

    I beleive its also been done in javascript.

  • User profile image
    Dovella

    CONGRAT!!!!!!!!!!

  • User profile image
    Minh

    That's very cool. Writing your own emulator (to any console) is no small task.

     

    Sound seems to be the bane of emulators. The C-64 emulator got the sound kinda close, too... but no cigar.

  • User profile image
    Cream​Filling512

    Minh said:

    That's very cool. Writing your own emulator (to any console) is no small task.

     

    Sound seems to be the bane of emulators. The C-64 emulator got the sound kinda close, too... but no cigar.

    I have pretty complete sound emulation, the SNES is almost all digital sound so the output is well defined compared to systems with analog synths but it's still fairly complex. But, the glitchy sound is actually from outputting it with the Silverlight media APIs, it's hard to get the latency low and not have glitches.  I just hacked the Silverlight port together in a couple hours, I'll try to fix the sound later.  When I wrote the emulator back in college it was just WinForms and Managed DirectX.

  • User profile image
    Cream​Filling512

    Maddus Mattus said:
    W3bbo said:
    *snip*

    I did not know that.

     

    But still,.. it's a small step from Silverlight to MCE,..

     

    Both are pretty much WPF.

     

    Edit:

     

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1)
    Timestamp: Tue, 13 Apr 2010 11:26:59 UTC


    Message: Unhandled Error in Silverlight Application Error 0x2093.  Debugging resource strings are unavailable. See http://go.microsoft.com/fwlink/?linkid=106663&Version=3.0.50106.0&File=mscorrc.dll&Key=0x2093   at SuperSharp.Cartridge.LoadSram()
       at SuperSharp.Cartridge..ctor(FileInfo fileInfo, Snes snes)
       at SuperSharpLight.MainPage.ButtonLoadRom_Click(Object sender, RoutedEventArgs e)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
    Line: 1
    Char: 1
    Code: 0
    URI: http://unlimitedgilgamesh.com/supersharplight.html


    Message: Unhandled Error in Silverlight Application Error 0x2093.  Debugging resource strings are unavailable. See http://go.microsoft.com/fwlink/?linkid=106663&Version=3.0.50106.0&File=mscorrc.dll&Key=0x2093   at SuperSharp.Cartridge.LoadSram()
       at SuperSharp.Cartridge..ctor(FileInfo fileInfo, Snes snes)
       at SuperSharpLight.MainPage.ButtonLoadRom_Click(Object sender, RoutedEventArgs e)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
    Line: 1
    Char: 1
    Code: 0
    URI: http://unlimitedgilgamesh.com/supersharplight.html

     

    I haven't seen this happen but I think I fixed it (updated Silverlight package on site) with the following change:  Tongue Out

    #if !SILVERLIGHT

                LoadSram();

    #endif

     

     

    Basically this method loaded battery-backed up save data for the game from disk.  This fails on Silverlight because you can't read/write arbitrary files (don't know why it doesn't fail for me though).  The right way to do this is with Silverlight isolated storage, which I'll hopefully do after I fix the audio output.

  • User profile image
    Cream​Filling512

    magicalclick said:

    Does this mean, you will support WinPh7 down the road? It would be really cool to play SNES games on WinPh.

    Yeah I want to give it a try, XNA is probably more appropriate though.  I did do a quick XNA port before, also for the Xbox360.  It works but performance is very slow on the .NET Compact Framework.  I believe WP7 uses the same framework and hopefully they've got it running faster than the Xbox port.

     

    The other problem with Windows Phone is it doesn't have any buttons.  Tongue Out

  • User profile image
    Cannot​Resolve​Symbol

    Firefox on OSX pukes when trying to throw the error Maddus Mattus reported above:

     

    Error: unterminated string literal
    Source File: http://unlimitedgilgamesh.com/supersharplight.html
    Line: 0, Column: 16
    Source Code:
    throw new Error("Unhandled Error in Silverlight Application Error 0x2093.  Debugging resource strings are unavailable. See http://go.microsoft.com/fwlink/?linkid=106663&Version=3.0.50106.0&File=mscorrc.dll&Key=0x2093   at SuperSharp.Cartridge.LoadSram()

     

  • User profile image
    Cream​Filling512

    CannotResolveSymbol said:

    Firefox on OSX pukes when trying to throw the error Maddus Mattus reported above:

     

    Error: unterminated string literal
    Source File: http://unlimitedgilgamesh.com/supersharplight.html
    Line: 0, Column: 16
    Source Code:
    throw new Error("Unhandled Error in Silverlight Application Error 0x2093.  Debugging resource strings are unavailable. See http://go.microsoft.com/fwlink/?linkid=106663&Version=3.0.50106.0&File=mscorrc.dll&Key=0x2093   at SuperSharp.Cartridge.LoadSram()

     

    I'll make a debug build later but I don't see how that method is being called anymore, I just removed it.

  • User profile image
    Bass

    I know you probably don't care, but I tested on Ubuntu Linux via Moonlight and it suffers from a similar crashing problem.

  • User profile image
    Cream​Filling512

    Bass said:

    I know you probably don't care, but I tested on Ubuntu Linux via Moonlight and it suffers from a similar crashing problem.

    That's good I could probably repro that, I can't get a Mac to debug on.  Wondering if Moonlight can be installed on Windows.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.