Finally decided to stop fighting C++, and just use size_t everywhere an
array is used.
Even though this is a 64-bit value, it seems that C++/STL expects it
when dealing with arrays, so I guess we will too.
Converted many C-style arrays to C++ std::array. In the process, cleaned up a lot of magic constants.
Replaced most C-style memset/memcpy operations with C++ equivalents: std::fill/std::copy.
std::copy in particular fixes a few potential bugs, since it operates on the datatype size,
and not just on raw bytes.
- The cycles counter is now essentially monotonically increasing (ie, we never need to worry about it going backwards and giving a negative difference, simplifying a lot of code
- There are now reset() methods in all places that keep track of system cycles, but they are used for a full reset only; not called each frame like before (which had to be done to prevent overflow).
This has been in patch form for about a year, and I'm finally
getting around to applying it. Basically, we separate the Cart
class into 3 classes:
- Cart: stuff specific to cartridge emulation
- BSTypes: various bankswitch types, both as enum and strings
- CartDetector: actual bankswitch auto-detection code
Also made more use of smart pointers, and added const in a few
more places.
I promise to get back to the phosphor stuff soon. This is just
to clear my head a little.
The Harmony/Melody BUS driver is undergoing a major revision to add support for the new JMP FASTJUMP feature. This update implements the changes, as well as the fast jump feature which isn't yet in the HMdriver. It also implements the load/save state support as well as the BUS debugger widget.
A few minor updates to CDF were also done.
Note that this update breaks compatibility with the previous BUS demos.
- update some code to the '5.0' way of doing things
- allow compilation in Linux
- whitespace/tab fixes to match main codebase
- add some extra comments
- test compile under gcc 6 and clang 5, and fix some warnings
Preliminary support for new Harmony/Melody drivers BUS and CDF. Work remains for the 3-Voice Audio, Digital Sample playback, and some additional revisions to the debugger widgets.