Commit Graph

154 Commits

Author SHA1 Message Date
Gregory Heskett
5064fcfb69 Merge pull request #757 from HackerN64/master
Merge HackerSM64 2.1.3 release into 2.2.0
2024-01-31 01:23:18 -05:00
Gregory Heskett
1d7a690361 Optimize BETTER_REVERB lightweight by an additional ~20% CPU, while also cutting memory requirements for it by ~30% (#744) 2023-12-30 23:22:05 -05:00
Gregory Heskett
913cda93b8 Audio cleanup checkpoint: Large portion of synthesis.c taken care of + occasional audio optimizations (#710) 2023-12-15 23:57:19 -05:00
Gregory Heskett
78cc957d31 Preserve vanilla reverb downsampling behavior whenever BETTER_REVERB isn't in use (#727) 2023-10-31 18:23:15 -04:00
Gregory Heskett
620b7cdded Fix typo describing BETTER_REVERB parameters (#678) 2023-09-17 14:37:08 -04:00
Gregory Heskett
ca4757639e Bugfix: Selecting headset audio and then disabling stereo headset effects define leads to game crash in sound select (#672)
* Bugfix: Selecting headset audio and then disabling stereo headset effects define leads to game crash in sound select

* More involved modifications
2023-09-11 12:06:37 -04:00
Matt Pharoah
febcb71ea3 Added emulator detection (#651)
* Added emulator detection

* Fixed missing assignments

* Disable interrupts around the count factor test

* Added more comments to emutest

* Changed PJ64 enum values so the versions work as a bitfield

* Updated README

* Fixed comments

* Updated enum values so you can safely AND and OR all emulator version flags together

* Remove redundant gIsConsole, gIsVC, and gCacheEmulated global variables

* Changed console check to be more future proof against Ares

* Use assembly file instead of casting to a function pointer

* Moved round_double_to_float back to its own compilation unit

* Moved the ParallelN64 check before the Ares check for better future-proofing

* Align pj64_get_count_factor_asm with cache lines... not that it actually matters for pj64

* Adjusted some comments

* Made emulator check thread-safe on emulators that emulate PI timings

* Added gIsConsole macro for backwards compatibility

* Added cen64 to INSTANT_INPUT_BLACKLIST

* Updated comment
2023-08-28 18:03:26 -04:00
Gregory Heskett
4dc17a32a2 Slice BETTER_REVERB memory requirements in half (#649)
which also improves performance by almost 10%
2023-06-29 10:09:32 -04:00
Gregory Heskett
37787dffc9 Add SET_ECHO level script command + minor BETTER_REVERB refactoring (#591)
* Add SET_ECHO level script command + minor BETTER_REVERB refactoring

* Add Puppyprint debug page for trying out different BETTER_REVERB presets and configurations

Also fix a missing Puppyprint enum that was causing issues

* Modify Puppyprint BETTER_REVERB page + other minor improvements

* Swap order of RSP commands to allow reverb downsampling to sound more similar to that of without downsampling
2023-06-28 15:15:38 -04:00
Gregory Heskett
8f6fde697f Disable Stereo Headset Effects and stub out all known code references via define (#633)
* Disable stereoheadseteffects and stub out all known code references via define

By effect this also completely removes Headset sound options from the game config, as it serves no purpose whatsoever compared to stereo.
Because it's stubbed out everywhere rather than only the necessary locations to prevent it, this should boost audio runtime slightly for everything, not just the stuff that actively used it.

* Rename DISABLE_HEADSET_STEREO_EFFECTS to ENABLE_HEADSET_STEREO_EFFECTS

* Reorganize and reduce audio Note struct

* Add performance to define description

* Rename ENABLE_HEADSET_STEREO_EFFECTS to ENABLE_STEREO_HEADSET_EFFECTS
2023-06-07 13:58:59 -04:00
Fazana
57f7338e6a Change puppyprint log function calls to defines (#632) 2023-06-07 07:58:22 -04:00
Gregory Heskett
42cf450ba8 Increase size/configurability of volume ramping tables (#623)
Vanilla's ramping table sounds absolutely horrendous, most noticeably when it comes to slow volume fade-ins/outs. By default, precision has been increased by 4x vanilla US, which overall has an insignificant impact on performance. This is still half as precise as EU's volume ramping table, that's about the point where additional memory and performance aspects are impacted more significantly.
2023-06-07 06:46:25 -04:00
Gregory Heskett
50b023ef21 Allow envelopes with delay values of 0 on init (#625)
This allows sounds to start instantly without any fade-in. Using new soundbanks with delay values of 0 will not compile with base decomp, but old decomp-compliant soundbanks will work with this commit.
2023-06-07 06:46:12 -04:00
Gregory Heskett
81c0a8ae61 Improve BETTER_REVERB runtime by about 15-20% overall (#619)
Refactored everything to be more memory efficient and execute fewer function calls than prior

Also accidentally discovered a significant bug with the audio modes always being forced to stereo so this is definitely 2.1 scope lmao
2023-06-05 17:09:03 -05:00
Gregory Heskett
f795173176 Start samples at full velocity when using envelopes that start with a delay of 1 (#576)
* Start samples at full velocity when using envelopes that start with a delay of 1

This can help eliminate sample artifacting that happens during a transition between a sudden fade-in into normal volume. It's not completely eliminated due to some processing weirdness, but it's a massive improvement.

* Fix vanilla issue causing misalignment when samples are initialized and played back with low attack values

NOW the artifacting is actually gone for real

* Improve artifacting bugfix

The first solution would've honestly been satisfactory, but this one seems to be slightly more accurate while actually removing code rather than adding it
2023-05-05 18:10:26 -04:00
Gregory Heskett
851ba192f6 Add lightweight configuration settings to BETTER_REVERB (#602)
* Add light configuration settings to BETTER_REVERB

This can reduce runtime demand down to ~75% of the standard demand, at the cost of the configurability of generally more advanced parameters

* Reformat the BETTER_REVERB preset entries to be easier to look at

* :peterVOID:

* haha lol formatting change definitely related to reverb yes this isn't unwarranted at all lmao hehe hoho
2023-03-15 10:52:05 -04:00
Fazana
17498e081d 2.1.0 Puppyprint Changes (#362)
* Puppyprint text size

* Update puppyprint.c

* Revert broken render_multi_image changes

* revert multi image tweak

parallel momento

* Update puppyprint debug colors to work with new hexadecimal system

* Puppyprint color reversion to currEnv + some bugfixes

* Remove a pointless color array

* Add forgotten comment

* i can type yes definitely

* Fix some puppyprint formatting edge cases

* Missed one last puppyprint edge case

* Additional strLen check

* Variable length fix + command ignoring strlen

* type changes

* Update puppyprint.c

* Box clamping

* Revamped profiling, fixed right alignment

* Update puppycam2.c

* Deferred printing

* Update puppyprint.c

* Fixed negatives being stupid

* Puppyprint Memory view rework

* Update level_script.c

* tweaks

* Fix new line spacing with different scales

also small bit of optimisation

* Spacing fixes

* Lightweight text option

* puppyprint debug now using light text where applicable

* Update puppyprint.c

* Update puppyprint.c

* level select menu

* merge profilers into one WIP

* Fully ascii compliant

* Finishing touches hopefully

* Update puppyprint.c

* new font

* vanilla font

* o

* Update hud.c

* last kerning fixes

* Requested changes

* requested changes

* fix the j

* requested changes

* change ur clothes

* Update surface_collision.c

* requested changes

* Update puppyprint.h

* Update camera.c

* .

* Update puppyprint.c

* Update puppyprint.c

* Update puppyprint.c

* fix J

* font

* font system rework

* ia4 outline font

* pain

* fix deferred printing

* fix format change

* Add audio profiling to Puppyprint Debug

* Optimize audio profiling substantially

* Minor audio optimizations

* requested changes

* oops accidentally commited 6 lmfao

* Update game_init.c

* Update puppyprint.c

* Update puppyprint.c

* Improve Puppyprint deferred prints

This is safer, more readable, and more runtime efficient all in the same package

* change return type

* fix building with profiler only

* Update profiling.c

* fix upscaled texture rectangles from multi image

---------

Co-authored-by: gheskett <gheskett@gmail.com>
2023-03-12 12:29:08 -04:00
Arceveti
337dac828f Update macros.h + allow ALIGN macros to be used anywhere (#574)
* Update macros.h + allow ALIGN macros to be used anywhere

* Fix wrong alignment in synthesis_sh.c

* Revert bitmask in VIRTUAL_TO_PHYSICAL macro
2023-01-31 15:50:19 -05:00
Gregory Heskett
1fadb78632 Prevent UB that can happen when using more than 64 total soundbanks (#575) 2023-01-29 14:29:39 -05:00
Gregory Heskett
7fdb5af8fd Add support for preset options to be used with BETTER_REVERB (#508)
* Bugfix: BETTER_REVERB starts before buffers are ready

* Add support for preset options to be used with BETTER_REVERB

* Some BETTER_REVERB cleanup

* The funny whoops

* Address suggested level script change

* Bugfix: useReverb crashes when disabled

* Allow window size override for vanilla-esque BETTER_REVERB presets

* Remove unnecessary downsampling limit check

* Fix up a few things + some slight reformatting

* Add light documentation to the BETTER_REVERB parameters

* Adjust BETTER_REVERB preset types to make more sense

* Reset BETTER_REVERB data buffer to be unallocated when not in use

* Properly disable BETTER_REVERB when disabling all reverb processing

* Remove an unnecessary BETTER_REVERB ifdef

* Remove D_80332108

* Revise BETTER_REVERB config description
2023-01-24 09:22:49 -05:00
Gregory Heskett
dc71aef024 Vibrato optimizations (#530)
Optimize vibrato to even exceed vanilla's implementation, all without restricting usability from the current implementation. This should save up to about 1ms of audio runtime.
2023-01-20 17:45:53 -05:00
Gregory Heskett
65d29dc337 Increase max number of concurrent layers and channels (#527)
At worst, this eats up a few KB of memory. Runtime difference should be negligible when the extra data is not being used.
2023-01-20 10:31:30 -05:00
Reonu
683ac0b2bf Added (emu-only) RCVI hack. (#425)
* Added emu-only RCVI hack

* newline moment

* Changed the value to *20

hi arthur

* RCVI hack compiler warning

* Revise BETTER_REVERB comments to better reflect RCVI hack's existence

* Fix potentially confusing comment

* More BETTER_REVERB typos :peterVOID:

* Address requested PR changes for RCVI Hack

Co-authored-by: gheskett <gheskett@gmail.com>
2023-01-20 09:36:19 -05:00
Arceveti
1098ea95ea Merge master/2.0.5 into 2.1.0 (#536)
* Imminent fixes for bugs found on master branch (#512)

* The vanilla level checks define for Yoshi is inverted, causing him to require 120 stars when it is off and appear at 0 stars when it's on

*  The downwarp fix results in Mario levitating in midair when grabbing Bowser midair. While downwarps should still be fixed, the change should be reverted immediately until a better fix is made.

*  Some checks of Mario's floor class were using the wrong defines, which can lead to unexpected behavior in the event anyone wants to reorder surface types. By default the SURFACE_CLASS_SLIPPERY and SURFACE_SLIPPERY defines have the same value, which is why this mistake is hard to notice.

*  The firsty frames define was implemented poorly, not allowing for vanilla firsty behavior no matter what the values were set to. This has been reverted, while avoiding the UB in the original vanilla code.

*  Removed the ledge grab changes that fix QSLGs and change the false ledgegrab define since Arceveti wanted to in his PR

* Update version to 2.0.4 (#515)

* HackerSM64 2.0.5 (#517)

* Bugfix: race condition with accessing cleared audio memory pools

* Bugfix: skyboxes access tiles out of range when looking straight down (#518)

* Vscode fixes (#516)

* Revert s32 angles and remove Angle typedef usage (#529)

* Fix some surface shadowing (#531)

* Delete rtc.h

* Remove `wait_for_audio_frames()`

Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>
Co-authored-by: Arceveti <73617174+Arceveti@users.noreply.github.com>
Co-authored-by: JoshDuMan <40190173+JoshDuMan@users.noreply.github.com>

* Update VERSION.txt (#534)

Co-authored-by: arthurtilly <32559225+arthurtilly@users.noreply.github.com>
Co-authored-by: axollyon <20480418+axollyon@users.noreply.github.com>
Co-authored-by: Gregory Heskett <gheskett@gmail.com>
Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>
Co-authored-by: JoshDuMan <40190173+JoshDuMan@users.noreply.github.com>
2022-11-28 15:06:34 -05:00
Gregory Heskett
c0e00beaf7 Sound effect tables now support up to 255 sounds instead of 128 (#465) 2022-09-21 18:51:31 -05:00