dirkwhoffmann / virtualc64

VirtualC64 is a cycle-accurate C64 emulator for macOS
https://dirkwhoffmann.github.io/virtualc64
Other
351 stars 33 forks source link

Get waveform for each SID separately #732

Closed dirkwhoffmann closed 2 years ago

dirkwhoffmann commented 2 years ago

Requested by @chris70c

TODO:

chris70c commented 2 years ago

Not sure I understand, you can already get a buffer for each sid (sidStream[0..3]) what I was interested in was to get each voice of a sid before they're mixed together to create an oscilloscope view like this: https://www.youtube.com/watch?v=e7kZaHUC74E

dirkwhoffmann commented 2 years ago

https://www.youtube.com/watch?v=e7kZaHUC74E

Ok, I see. I thinks this would be difficult, because I don't know if reSID provides an easy way to access the data for a particular voice.

Anyway, I've added a new function to the Muxer class that draws a waveform directly inside the emulator core:

float draw(u32 *buffer, isize width, isize height, float maxAmp, u32 color, isize sid = -1) const;

It's similar to what vAmiga provides with the exception of the sid parameter. If this variable equals 0,...,3, the samples of a single SID are visualised. Otherwise, the mixed stereo output stream is drawn.