aboutsummaryrefslogtreecommitdiff
path: root/src/SPU.h
Commit message (Collapse)AuthorAge
* Add Gaussian (SNES) audio interpolationNadia Holmquist Pedersen2024-03-08
| | | | | | Probably not a good choice for most DS games unless you really want a very soft sound, but it could be fun if you wanted to run lolSnes in melonDS :p
* Sprinkle `const` around where appropriate (#1909)Jesse Talavera2023-12-12
| | | | | | | | | * Sprinkle `const` around where appropriate - This will make it easier to use `NDS` objects in `const` contexts (e.g. `const` parameters or methods) * Remove the `const` qualifier on `DSi_DSP::DSPRead16` - MMIO reads can be non-pure, so this may not be `const` in the future
* Remove the last `ConfigEntry` state (#1902)Jesse Talavera2023-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Get rid of `ConfigEntry::ExternalBIOSEnable` - Now the BIOS files themselves are checked - The frontend's `Config::ExternalBIOSEnable` is not affected * Add `JITArgs` * Pass the JIT status to the `ARM` constructors * Encapsulate `NDS::EnableJIT` * Pass `JITArgs` to `ARMJIT`'s constructor * Remove the `JIT_*` `ConfigEntry`s in favor of members - Allow all the JIT args to be set with `NDS::SetJITArgs` - Encapsulate the JIT-related parameters in `ARMJIT` so they can reset the block cache if changed - Update the active (or newly-created) console in the frontend with adjusted JIT args * Make audio bit depth and interpolation configurable in `NDSArgs` - Define enums for both - Give those settings default values in `NDSArgs` - Remove `ConfigEntry::AudioBitDepth` - Initialize these settings in the relevant SPU constructors * Move the last DSi-specific logic in `Reset` to its own subclass * Remove `ConfigEntry::DSi_FullBIOSBoot` - Add members to `DSi` instead for getting and setting this - Update the frontend to accommodate these changes * Oops, missed a spot * Remove `ConfigEntry::Firm_MAC` and `Platform::GetConfigArray` - Also move the MAC parsing code to `ROMManager` * Remove the last `ConfigEntry` state - Make GDB support configurable via members * Add some `#ifdef`s that I'd almost forgotten
* Slight cleanup to SPU (#1900)Jesse Talavera2023-12-04
| | | | | | | | | | | | | | | * Move `SPUChannel` and `SPUCaptureUnit` to be stored inside `array`s instead of allocated separately * Default-initialize most of `SPU`'s fields * Generate the interpolation tables at compile-time with `constexpr` - Now it's faster and thread-safe * Slight cleanup in SPU - Iniitialize most fields in the class declaration * Mark `SPU` as `explicit`
* Refactor `NDS` and `DSi` to be objects (#1893)Jesse Talavera-Greenberg2023-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * First crack at refactoring NDS and DSi into objects - Remove all global/`static` variables in `NDS` and related classes - Rely more on virtual dispatch when we need to pick methods at runtime - Pass `NDS&` or `DSi&` to its constituent components where necessary - Introduce some headers or move some definitions to break `#include` cycles * Refactor the frontend to accommodate the core's changes * Move up `SchedList`'s declaration - Move it to before the components are initialized so the `map`s inside are initialized - Fields in C++ are initialized in the order they're declared * Fix a crash when allocating memory * Fix JIT-free builds * Fix GDB-free builds * Fix Linux builds - Explicitly qualify some member types in NDS, since they share the same name as their classes * Remove an unnecessary template argument - This was causing the build to fail on macOS * Fix ARM and Android builds * Rename `Constants.h` to `MemConstants.h` * Add `NDS::IsRunning()` * Use an `#include` guard instead of `#pragma once`
* Move all core types into namespaces (#1886)Jesse Talavera-Greenberg2023-11-25
| | | | | | | | * Reorganize namespaces - Most types are now moved into the `melonDS` namespace - Only good chance to do this for a while, since a big refactor is next * Fix the build
* convert SPU to OOPArisotura2023-11-04
|
* update copyright yearsArisotura2023-11-04
|
* merge local_wifi (#1516)Arisotura2022-09-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * attempt at betterer wifi * add preliminary sync mechanism * fix gaps in wifi implementation * move local-MP comm to its own module instead of cramping Platform.cpp * remove some stupid cruft * as you wish, Sorer (starting work on shared-memory system) * shared-memory IPC that actually works (albeit Windows-only for now) * shut up logging from NULL writes on ARM7 (ffs Nintendo learn to code) * get this somewhat good * leave client sync mode when host deauths. makes download play actually work. * start implementing MP-comm error handling * * add MP-reply error counters * feeble attempt at fixing slowdown/desync/etc problems * somewhat better exchange/sync method * * when entering power-saving mode, be sure to finish transferring the current frame first * fix misc bug due to old cruft leftover makes for a more stable connection * remove a bunch of cruft * set wifi time interval to 34 cycles instead of 33. games seem sensitive to the general timing of wifi vs the rest of the system, and this seems to make things run better, atleast until I rewrite this to use a proper scheduler. * more graceful handling of disconnects * deal with FIFO overflow more gracefully * BAHAHAHAHAHAHAHAHHHH THE SNEAKY BASTARDS so, when the DS receives a beacon with the right BSSID that beacon's timestamp is copied to USCOUNTER * attempt at making the connection process smoother for weird games * * begin adding POWCNT2, only applies to wifi for now * begin work on wifi scheduler * implement the shitty timers * add the RF wakeup thing * begin work on receiving frames. for now it can just receive melonAP beacons, but hey, it's a start. * add enough TX functionality that online wifi is a possibility again. * there are problems with this scheduler thing. committing it anyway * kind of a rollback... we're gonna work out a compromise on this, I guess * don't transmit shit if RXCNT.bit15 isn't set * move RX-finish to its own function. more accurate filtering. implement RXFILTER. * remove some cruft * fix some of the shittiness when trying to connect more than two players * fix some more shittiness * fix more wifi shittiness (mainly don't try to receive shit while sending a frame) * run wifi every 8µs. improves performance. * fix IRQ14/IRQ15 * make this work under Linux * Make it work on macOS, for now using a custom sem_timedwait implementation. If anyone knows anything about mach ports and have an idea for how to make this work using mach IPC, please do let me know. * 25ms seems like a good timeout * begin work on proper multiplayer UI shito. for now, determine a global instance ID, and derivate the system MAC from it. remove 'randomize MAC' option. * finish removing RandomizeMAC * lay groundwork for instance-unique config * work some on the UI... make it not labelled Fart * more UI work: make it explicit that some things are instance-unique * separate firmware files for multiplayer instances * make instances save to different save files, too * more UI work, make things somewhat less shitty * lay base for the multiplayer settings dialog * actually hook up most of that dialog * actually implement the fun audio settings * ensure all the wifi shit is properly savestated and reset. properly update timings for the wifi region when wifi is disabled. * add more fun labels * * ignore WEP frames if WEP is off * implement RX_LEN_CROP * fake enough of WEP processing to make Inazuma Eleven work * * do not copy more ROM banner data than actually needed * avoid trying to read out of bounds if the banner offset is bad * Fix oversight with the preferences action causing the build to fail on macOS Co-authored-by: Nadia Holmquist Pedersen <nadia@nhp.sh>
* update copyright headersArisotura2022-01-09
|
* SPU: Emulate SOUNDBIAS and 10-bit degradeNadia Holmquist Pedersen2021-08-17
|
* Audio interpolation (#1176)Arisotura2021-08-08
| | | add audio interpolation (emulation improvement)
* Fix some compiler warningsWaluigiWare642021-05-03
|
* update copyright year and add missing GPL headersRSDuck2021-03-12
|
* make audio output thread safe(r?)RSDuck2020-11-15
|
* SPU: work with scalars instead of arraysRSDuck2020-10-31
|
* SPU: delay channel start until whenever it can actually start. fixes maxmod ↵Arisotura2020-07-23
| | | | interpolated mode.
* make it able to switch between DS and DSi modesArisotura2020-06-01
|
* update copyright yearsArisotura2020-02-14
|
* see, Arisotura, was it that hard?Arisotura2019-09-04
|
* more fixes to audio outputArisotura2019-09-01
| | | | maybe by 2034 we'll finally get that shit going
* * new FPS limiterArisotura2019-08-29
| | | | | | * new audio output/sync method about fucking time
* my bad.Arisotura2019-08-18
|
* also, update copyright nameArisotura2019-01-22
|
* SPU:StapleButter2018-12-14
| | | | | * support channel repeat mode 3, behaves same as mode 1 (loops) * always clear channel buffers, so if channels 0-7 use format 3, they don't output old data over and over again (fixes #281)
* SPU doneStapleButter2018-10-18
|
* fixor copyright years.StapleButter2018-09-15
|
* audio: change output rate to 47340Hz, add resampler with small margin to ↵StapleButter2017-12-11
| | | | | | elimiate pops/clicks due to output rate fluctuation output rate is picked such that 1024 samples at that rate equal exactly 710 samples at the SPU's output rate
* (finally) fix soundStapleButter2017-11-11
| | | | | | * reset capture position when starting capture * reorder channel/capture handling * implement FIFO for channel and capture
* add support for SPI shutdown, btwStapleButter2017-09-21
|
* add support for 16bit IE reads/writes (fixes #66)StapleButter2017-06-24
|
* * sound capture from left/right mixersStapleButter2017-04-08
| | | | * support for appropriate output modes
* * stub more wifi crapStapleButter2017-04-07
| | | | | * louder sound * misc fixes
* * PCM8, PCM16, ADPCM, white noiseStapleButter2017-04-07
| | | | * volume, volume div, panning, master volume
* preliminary audio. only supports PSG (and handles all channels as such). ↵StapleButter2017-04-06
| | | | drops out every once in a while.
* start SPU workStapleButter2017-04-06
|
* * bump version numberStapleButter2017-04-04
* feed system time into RTC * start laying base for sound