> > So the MameDevs changed Mame to implement code from others' work (the hard part of > > the project) rather than create the code from scratch. > > Wow. That is so not the takeaway I was trying to convey. Bryan got it - read his > reply and you might start to understand. > > Caveman version for people with no significant life experience as professional > programmers: MAME easier to read, to write, to bugfix, and to share with other > emulators. All of those are good things, not just one. Zug zug.
Well said. The project should have been C++ a long time ago. This was starting to show its ugly head way back in the .3x era. Wholesale copying of code between drivers and cpu cores. Where the only difference between the two sets of code was some small revision in some call. Like a cpu instruction missing in one core but not another but a game relying on the behavior of the missing instruction. So many things ended up with switchs and jump tables. For something that would be a simple derivation in C++. It got better with sharing. But I still see blog posts where 'merged code and used newer implementation xyz number of bugs fixed'. That is just one symptom of the problem of sticking to C dogmatically. Another one was having to retrofit savestates into all of the drivers. Where it could in theory be inherited into everything.
I have had a couple of projects where I was constrained to C only. After awhile it is 'if only I had C++ this is would be much easier to do'. Its not then you write 30-60 lines for something C++ does naturally.
Also it is C++ and does everything C does... So you can in theory still do it the 'C way'. But why do it? Why limit yourself?
If done properly you could even see how different devices/boards/etc were 'born' from other ones and provide better documentation.