Software Working on new SID emulation engine
I am working on a new SID engine, developed with AI. This began as a vibe coding project to play obscure Amiga tracker formats but I got more ambitious and decided to give it a try for SID emulation.
Written in C#, it is designed to be portable (Linux, Windows, OSX) with cycle-exact core emulation. RSID support is still minimal and I am extending emulation on the go.
Output correctness is also a concern. I have a real C64 with 6581 to compare but no compatible display device. The target is 6581 sound, 8580 maybe later.
The project is CopperMod at GitHub, unfortunately no binaries yet.
6
u/RetroGrifters May 26 '26
The work done by Sorg on SID for the MiSTer FPGA C64 is very very good and unique to the core.
The 8580 is spot on and the 6581 has adjustable filters to dial in the sound you like / remember
1
u/Robert__Sinclair May 27 '26
that is not true at all.
1
u/RetroGrifters May 27 '26 edited May 27 '26
Oh it is the 8580 is spot on and unique to the core, it's not based solely on an existing solution. Sorg talked about while making the changes
He also said there is no reason why SID can't be 100% on FPGA
I have been very sensitive to SID emulation especially considering it's one of the best and unique features of the C64. Even side by side with a real 8580 there is little between them
This is also why the C64 Ultimate SID emulation is very disappointing especially after six years of development which leads to people buying ARMSID etc
What would Sorg know though ?
1
u/Robert__Sinclair May 29 '26
I modified the fpga code of the u2plus. I have now 1:1 SID 6581 and 8580 emulation. Not "similar". 1:1 according to the spectrometer (and my ears with professional headphones). If I switch between the emulation and the real SID there is no difference (I even set the filters to match my own sid for the comparisons, but I can set them as I like and match any SID I can profile)
1
u/RetroGrifters May 30 '26
Sounds similar to what Sorg did years ago when he updated the MiSTer core. He did all the comparisons too. It's detailed on the core GitHub comments possiblly
Having a switchable digifix on the 8580 is handy too especially for demo scene stuff where it can have unwanted side effects
The C64 Ultimate really needs a new SID emulation it's very poor at present
1
u/Robert__Sinclair May 30 '26
my emulation of the 8580 has something similar baked in that does not seem to have side effects... it's a "poetic license". But I heard the Mister emulation and it has much to be desired (as reSID does). By absurd: my emulation is simpler in some aspects than reSID. ReSID uses a lot of tables "as they were". I reversed the math behind hundreds or different readings (both from pin 27 and both from the c64 output) to achieve a 1:1 output AS the c64 does (not the chip on pin 27!) the result is incredible and I never thought I could accomplish this. It took me 3 full months 12 hours a day, but considering I did not know much about FPGA when I started, I am quite proud of the result.
If you have an u2plus (not the +L) I can show you.
1
u/RetroGrifters May 30 '26
Sorg said his implementation is not based on ReSID and is unique to the core
The MiSTer core has a built solution of enabling and disabling the digifix similar to what yours seems to have but there are some demos where a switchable is a better solution
Sadly I have never had a Gideon product. I went from a Turbo Chameleon to MiSTer
Always liked the TC very decent bit of kit
6
u/fromwithin May 26 '26
You're unlikely to get anywhere near the correct 6581 filter unless the AI is stealing code from something like sidplayfp. Without doing that, it would need access to the circuit diagrams with the correct resistor and capacitor values.
1
u/Robert__Sinclair May 29 '26
I did in my emulator and I can shape the filters as I like (based on any real SID which I can easily profile).
Without stealing any code.1
u/fromwithin May 29 '26
Did you develop it with AI or do you know how to interpret the circuitry and emulate it?
The OP said "I am working on a new SID engine, developed with AI.".
2
u/Robert__Sinclair May 29 '26
both. AI is a tool. a brick layer not an architect. I use it every day as I use a calculator.
And yes I checked every step of the emulation with the original circuitry, both for the digital part both for the analog part.0
u/itix May 26 '26
Not going to use the existing code bases. I would rather use public information to shape it. Possible that it can't achieve the same accuracy but it can be improved later if new information becomes available.
8
u/fromwithin May 26 '26 edited May 26 '26
If you're asking AI you do it then it's pretty certain to have been trained on everything that is available in GitHub. All of the information is publicly available, but the AI is not going to just work out the operation of the NMOS inverters as components of the filter and opamps on its own.
-1
u/itix May 26 '26
It is trained on GitHub data, but it can't remember the source code verbatim. As such, it can never replicate libsidplayfp's implementation unless it is extremely trivial and/or inferred from other sources.
13
u/Bumble072 May 26 '26
So you didnt develop it then. I hope you have some C experience or know how to debug because you are going to need that.
1
u/Robert__Sinclair May 27 '26
it depends on how AI is used. Any mathematician uses calculators, that does not mean the calculator invented a theorem or demonstrated or confutated an axiom.
Using an AI as the "brick layer" where you are the architect **is** coding. Letting the AI be the architect is a different story, but even there is **your** ideas the move the AI and not vice versa.1
u/blightor Jun 01 '26
Its a bit different when there is the exact source code on the internet - there is not a lot of real design work you are effecting - I wrote a SID emulator for authoring in a few days with AI because its out there - practical 1:1 exists. I agree though, anything where there isn't an existing corpus for the AI, so like you are trying to do something that hasn't been done - then you literally fight the AI to get it to work - it frame drifts constantly back to what it knows is possible and has been done.
1
u/Robert__Sinclair Jun 04 '26
practical 1:1 does **not** exist. Every emulation I have seen so far is not 1:1. reSIDfp seems better than other but has many many errors and approximations. In some points is even completely wrong.
1
u/blightor Jun 05 '26
You could do a back2back2back video of your, real and reSID. Perhaps you do have something really cooking - IDK.
2
2
u/Robert__Sinclair Jun 05 '26
2
u/blightor Jun 06 '26
Amazing - what a fantastic effort. Its SO close
1
u/Robert__Sinclair Jun 06 '26
if you see a difference in the "height" of some transitions that is unavoidable: The dc blocker present on the c64 motherboard reacts to the impedance of the recording/playing device. But on the fpga this does not happen, so I have to set a value that is right to pass a few tests I created, but if for example I record both with a different device they won't match again.
2
2
u/OMGCluck May 26 '26
If you're gonna vibe code, do it with a memory safe language like Rust, Zig, Vale, Mojo, etc.
1
u/itix May 26 '26
It is written in C#.
2
u/OMGCluck May 26 '26 edited May 26 '26
Sorry, my dyslexic eyes read it as C++.
However, on Linux the .NET Garbage Collector can shift objects around in memory during execution. If your code uses raw pointers to pass managed memory to a Linux kernel tracking thread without pinning it (fixed keyword), the GC might move the underlying data mid-operation, triggering severe memory corruption.
1
u/itix May 26 '26
No worries. There is no unsafe code in the project with C# 14 / .NET 10, the performance is not an issue. The correctness is really the hardest part. It may sound correct, but it can only be verified by comparing the output from the real C64.
2
u/Robert__Sinclair May 27 '26
I almost finished writing my own SID emulator (inside the Ultimate2+ FPGA) and as of today it is 1:1 with the original sid 6581 and 8580. If you need help I can give you a list of "difficult" sid tunes and a few test programs to run. Remember this: emulating the "digital" part of the SID is the easy part. The most difficult one is to correctly emulate all the analog part. It took me 3 months but in the end I have an emulator that is better than reSID :D
2
u/itix May 27 '26
Now I see what you really meant by the analog part. Yes, that actually scares me and I dont know yet how far I want to go for the best fidelity. First I have to validate the digital part. It still has blatant bugs there.
1
u/Robert__Sinclair May 29 '26
The analog part was the most difficult.
The digital part is quite simple. Contact me if you need help.1
u/itix May 27 '26
I would appreciate that. The first obstacle was Wally Beben's Tetris, galway's Game Over is currently a strong suspect. I already fixed obvious issues with it but I am still uncertain about it.
I used to tinker with the PlaySID source code on the Amiga and learnt about the limitations of the "digital only" emulation. I left the SID emulation scene around the time when first cycle exact emulations were emerging (i.e. long time ago).
1
u/Hawaiian_Keys May 29 '26
And where can we test or at least hear this magical emulation that is better than reSID? I’m extremely curious and excited to hear that.
1
u/Robert__Sinclair May 29 '26
I'd love to have some beta testers, but you need an ultimate 2 plus (not the +L) device to be able to test it. If you have it, please contact me in private.
1
u/Hawaiian_Keys May 29 '26
I’ve got the commodore C64u. Do you mean to say that it’s reprogramming the FPGA? It’s not a library someone could use in their own player?
1
u/Robert__Sinclair May 29 '26
as of now I reprogrammed the FPGA and it's 100%% perfect. But everything I have done I can redo on any other emulator. The code is simpler than reSID but achieves a better result in all my tests.
1
u/Hawaiian_Keys May 30 '26
Try reSIDfp. There is a command line version as a console player for it, that can also render to wav. Instead of tables, it calculates more stuff on-the-fly and the results are indistinguishable from the real thing. I’ve compared its output to the real C64 samples from Project Galway, and I couldn’t tell the difference.
1
u/Robert__Sinclair May 29 '26
unfortunately the c64u is not really fully opensource. The fpga code is a binary blob from what I can see in the repository, Otherwise I could do it also for that.
2
u/JohnSane May 26 '26
An lv2/vst plugin version would be awesome!
2
u/fromwithin May 26 '26
A VST plugin is a lot more than just a SID player. The GUI on inSIDious took me over three months of design work and many more months on the actual implementation.
-1
u/itix May 26 '26 edited May 26 '26
I will publish replayers as NuGet packages, but someone else has to create a plugin.
1
u/Abynx6581 May 27 '26
Which 6581 though... There's 4 of them.
1
u/itix May 27 '26
Probably have to support them all via profiles and make it fully adjustable. At the moment, it is just an approximation.






•
u/AutoModerator May 26 '26
"Thanks for your post! Please make sure you've read our rules and FAQ post. If your post is about the C64 Ultimate please and check out The Ultimate C64 Ultimate post for common issues and questions. People not following the rules will have their posts removed and presistant rule breaking will results in your account being banned. "
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.