What is it?
As of today, I've scoured the internet, and think it is fair to say sharp-64 (#64) is the first Commodore 64 emulator for the .NET platform. I could go as far to say it's the first 'emulator' for the CLR, given various searches on google turned up nothing on the subject of emulation related to .NET / C# / CLR. #64 is written entirely in C#, using SDL.NET as the sound and audio library. By using SDL.NET, I expect to build #64 as a cross platform executable.
I've always had an interest in emulation and software emulators for old 8-bit platforms, such as the Commodore 64 and Atari 800XL (both of which I had as a youngster). I hacked around both machines quite a bit as a kid, learning 6502 assembler and playing with their excellent graphics and sound capabilities (of their time).
I also was interested in seeing how well the CLR handled the demands of an emulator, and how much I could optimize the code to gain every ounce of performance out of it.
I cannot claim to have written the emulator from scratch - the credit goes to the excellent Frodo project. A very well designed and modular emulator written in C++. It is also a cycle exact emulator, meaning all the 'emulated' chips are in sync with each other, to the clock cycle. This allows emulation of practically every hardware hack on a real C64. Given the nature of cycle-exact emulators, they also require a greater demand of the platform it is executed upon, allowing me to further push the CLR.
Where is it at today?
It is a fully functioning C64 emulator, with sound and 1541 emulation via D64 virtual disks and mapping a directory. Sound and graphics use SDL.NET, with an extension to SDL.NET audio support for access to the streaming audio capabilities of SDL.
It has no user interface, besides the C64 itself, and therfore is not user friendly, nor is it recommended for a wide audience. Yet.
I have found a couple games do not work; however, they do fail with the official Frodo emulator, suggesting bugs in the original emulation code. I will try to troubleshoot this when I get some time.
#64 does have a few unsafe blocks, using pointers to access the emulated RAM, however I am planning to create some conditional defines and make these optional, to see how much overhead is incurred by the array bounds checks.
How does it perform?
When speed limiting is turned off, sharp-64 runs at greater than 400% of an original C64 on my 1.83GHz Core Duo Dell notebook.
I have tried various demos, such as those with FLI, FLD, DYCP, open borders, multiplexed sprites, timing dependent decoders, fast loaders etc, and they work great.
This is currently a straight port, so we may even be able to get closer to the C++ native version, which runs about twice the speed after some optimizations.
Can I play?
The full source is currently available via svn on sourceforge.net, https://svn.sourceforge.net/svnroot/sharp-c64. There is no documentation on getting it running, so it's up to you to hack around for now. The place to modify which d64 or directory is used for the 1541 disk drive is in prefs.cs.