summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/vgm_visualizer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Cleaned up bitmap API. Vas Crabb2020-09-271-34/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made const-qualified pixel accessors (pix, pixt, raw_pixptr) return const-qualified references/pointers to pixesl, and added non-const versions. This makes bitmap more like standard library containers where const protects the content as well as the dimensions. Made the templated pixt accessor protected - having it public makes it too easy to inadvertently get a pointer to the wrong location. Removed the pix(8|16|32|64) accessors from the specific bitmaps. You could only use the "correct" one anyway, and having the "incorrect" ones available prevented explicit instantiations of the class template because the static assertions would fail. You can still see the pixel type in the bitmap class names, and you can't assign the result of &pix(y, x) to the wrong kind of pointer without a cast. Added fill member functions to the specific bitmap template, and added a explicit instantiations. This allows the bitmap size check to be skipped on most bitmap fills, although the clipping check is still there. Also fixed a couple of places that were trying to fill an indexed 16-bit bitmap with rgb_t::black() exposed by this (replaced with zero to get the same net effect). The explicit template instantiations in the .cpp file mean the compiler can inline the function if necessary, but don't need to generate a local out-of-line body if it chooses not to. Extended the size of the fill value parameter in the base bitmap class to 64 bits so it works correctly for 64-bit bitmaps. Fixed places where IE15 and VGM visualiser weren't accounting for row bytes potentially being larger than width. Fixed an off-by-one in an HP-DIO card where it was treating the Topcat cursor right edge as exclusive. Updated everything to work with the API changes, reduced the scope of many variables, added more const, and replaced a few fill/copy loops with stuff from <algorithm>.
* Revert "sound: Improved view interfaces to match usage patterns" Aaron Giles2020-09-171-2/+2
| | | | This reverts commit dc0ede3c90717ed25de0695c555b861f06344f18.
* sound: Improved view interfaces to match usage patterns Aaron Giles2020-09-171-2/+2
| | | | | | | | | | * read/write_stream_views now have an internal index * get/put/add/fill/copy now implicitly use and advance this index * new method reset() can (re)set the internal index * new method done() checks if index is past the end * new method remaining() indicates how many samples remain * get_indexed/put_indexed/etc available for random access * updated all consumers to new interfaces
* Significant internal changes to sound streams (#7169) Aaron Giles2020-09-131-22/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Significant internal changes to sound streams: Abstracted buffers of sound data into an internal stream_buffer class, with helper classes read_stream_view and write_stream_view which offer readable/writable "views" into the buffers Internal sound calculations are all done using stream_buffer::sample_t, which is a 32-bit float; existing callbacks are supported through an adapter that converts to/from signed 32-bit integers Improved behavior of dynamic stream sample rate changes to resample a short runway of data to preserve continuity across transitions Created a new stream update callback which passes a std::vector of read_stream_views for inputs, and a std::vector of write_stream_views for outputs Updated core mixer and speaker devices to the new stream update callback Updated the following sound cores to the new stream update callback: ay8910, dac, k054539, msm5205, namco, netlist, okim6295, pokey, samples, sn76496, sp0250, tms5220, tms57002, upd7759, vgm_visualizer, volt_reg Changed existing stream update callback to make inputs explicitly const and the output pointers const as well, since they are re-used across calls; fixed several engines that violated this rule Sound_manager::stream_alloc can no longer automatically connect to a device's sound_stream_update callback; instead, the stream_alloc() on the sound_device_interface should be called; updated many violators of this rule Streams can be created with SAMPLE_RATE_OUTPUT_ADAPTIVE, which dynamically tracks the sample rate of its first downstream output, or with SAMPLE_RATE_INPUT_ADAPTIVE, which tracks the sample rate of its first input Changed resampling to be a separate sound_stream that is invoked as needed, opening the path for selectable resampling implementations Added a flags parameter to the new stream allocation method that allows you to specify a that input streams should not be resampled Exposed stream_input and stream_output classes directly, simplifying access to user gains and stream names Added a simple dynamic compressor to sound_manager to provide nicer results when overdriven sound happens; compression does not affect speaker_report results Improved verbose speaker_report to print a graph of peaks over time More aggressive debugging enabled for now even in release builds (should be disabled prior to next release) via SOUND_DEBUG define in sound.h; report any assertions for fixing
* srcclean and manual cleanup (nw) Vas Crabb2020-04-261-6/+6
|
* -vgm_visualizer: Added more spectrogram visualization modes. [Ryan Holtz] Ryan Holtz2020-04-081-60/+178
|
* vgm_visualizer.cpp: C++14's non-inline constexpr variables are problematic, ↵ AJR2020-03-301-0/+2
| | | | part 2020 (nw)
* -vgmplay: Fixed DC offset issue, and added more visualization modes. [Ryan ↵ mooglyguy2020-03-301-53/+182
| | | | Holtz]
* -vgmplay: Added multiple spectrogram visualization modes. [Ryan Holtz] mooglyguy2020-03-281-5/+48
|
* (nw) It helps if you're using the same data types in both places (VGM Vas Crabb2020-03-071-31/+31
| | | | | | | | | | visualiser device and WDL FFT libarary). I changed the VGM visualiser to use single-precision float which is the default for WDL FFT. GCC's loop vectoriser can make better use of SSE with single-precision maths, and the extra precision shouldn't be needed for the visualisation. If this is a problem, let me know and I'll revert this and flip the WDL FFT library over the other way.
* Maintenance: Vas Crabb2020-03-041-2/+4
| | | | | | | * Removed empty nl_examples from dist.mak * Added copyright acknowledgements and full text of licenses to binary distribution * Fixed up the list of third-party libraries * Moved WDL fft.c to 3rdparty
* vgm_visualizer: Build fixes (nw) AJR2020-03-011-1/+1
|
* -vgmplay: Added a visualizer. [Ryan Holtz, Justin Frankel] MooglyGuy2020-03-011-0/+483