Commit Graph

52 Commits

Author SHA1 Message Date
thecozies
ff953bea63 added USE_FRUSTRATIO2 define 2023-09-22 13:16:34 -05:00
Gregory Heskett
a64be21db8 Added config option for previewable blue coins (#507)
* Added config option for previewable blue coins

* Clean up previewable blue coin implementation to only be a couple lines

---------

Co-authored-by: Colin Tong <tongcolin@live.ca>
2023-09-18 18:21:39 -04:00
Lilaa3
44b48ffacd Important Culling Fixes (#666)
* Culling fix

Precison of half fov horizontal being equal to or above 2 leads to many issues. using 1.5 would break rt64 and other emulators with ultra widescreen.
Vertical culling will be disabled by default until 3.0

* Improved emu checks and naming

* Comment changes

* Small typo fix
2023-09-18 09:18:35 -05:00
Gregory Heskett
ab0cebab7a Rotate envmaps to be consistent with vanilla (#636)
* Start work on envmap rotation stuff

* n64graphic envmap rotation working

* Add comment to rotation function

* Fix DLs of non 32x32 env maps, fix envmap rotation

* fix metal flying vanish cap

* fix metal mario's medium poly butt

* new asset version for flipped env maps

* added missing env textures to extract script

* restore asset_needs_update

* Skip asset_needs_update calls if local version matches new version

* removed the goddard textures from envmap rotation

---------

Co-authored-by: mineqwerty <mineqwerty25@gmail.com>
Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>
2023-09-18 09:10:56 -04:00
Gregory Heskett
8a83359ed1 Add functional changes to inertia to support only specific directions specified in the config (#671)
* Add functional changes to inertia to support only specific directions specified in the config (needs cleanup)

* Reduce number of inertia defines

* Update Platform Displacement 2 define description

* comment adjustments
2023-09-18 07:17:31 -05:00
Lilaa3
5e9f8c7ee0 Improved transitions (#642)
* Improved transitions

Code quality improvements.
Shape transitions now all scale down to 0 instead of 16 (mario and bowser).
Ease in was added which leads to far smoother transitions.
HD_TRANSITIONS define added, makes use of the tex edge render mode to deliver smooth transition textures.
lerpf was added to math utils.

* Cleaner textures, rounding only during vertex creation

* Another attempt

* cozies naming suggestion

* Improvements and suggestions

SHARP_TRANSITION_TEXTURES is now off by default (I still think the textures for it could be improved).
lerpf, to_smoothstop, smoothstart, smoothstop and smoothstep have all been added.
make_vertex has been inlined.
make_simple_vertex has been added (colourless vertex).
Transition colors (and canon colors) are now defined using primative colour instead of setting individual vertices color´s.
Transition´s now use smoothstep (ease-in-out) instead of ease out only.
Naming has been improved.

* Proper function inling and removal of GBI_FLOATS variant of make_vertex and make_simple_vertex

* More requested changes

* Accidental final new line removal fixed

* Comment about pop in fix.

* Comment fix

The issue with writing comments for stuff is when you want to change code later on.
2023-08-29 08:57:32 -05: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
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
Lilaa3
16e55ad952 Culling improvements + GRAPH_RENDER_INVISIBLE check change (#590)
* Culling improvements + earlier GRAPH_RENDER_INVISIBLE check

GRAPH_RENDER_INVISIBLE is now checked during geo_process_object before any uncessesary transformation is applied to
the object, translation is still calculated for sound even if the object is invisible.
Half fov is now computed during geo_process_perspective.
Vertical culling has been added (only when bellow the screen to prevent shadow´s being culled).
Emulators have basically infinite culling aspect ratio to prevent early culling with widescreen viewport hacks.
Default culling radius is now a define.
This was written by both me and Kaze Emanuar, he provided the suggestion to use absf and informed me of
integer division being remarkably slow (although it´s only used once during geo_process_perspective).

* Badly placed new line (major fix)

* integer

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

* parenthesis

doesn´t affect order of operation, just for code quality

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

* uncessary whitespace

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

---------

Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>
2023-06-23 10:06:24 -05:00
Reonu
fffebd1065 add death on exit course define (#564)
if the define is enabled, exiting course is the same as dying (warps to failure warp node)
2023-06-16 20:57:33 -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
thecozies
c09103d456 Invert skip room proc obj (#605)
* Invert functionality of obj room proc to be opt-in

* Fixed comment for enabling profiler
2023-03-15 10:49:07 -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
Gregory Heskett
4c67e48456 Add define for wiping save data if existing save data from vanilla or another hack exists (#579) 2023-03-06 20:53:08 -05:00
axollyon
be753ae220 Small improvements to object loading within rooms (#580)
* Small improvements to object loading within rooms
* Only check if Mario is in the same room as the object once
* Implement object render distance within rooms (from thecozies)

* Remove sLevelsWithRooms (also from thecozies)
Honestly surprised this wasn't already in Hacker

* Remove comment for sLevelsWithRooms in config_game

* Make compatible with the painting objects PR
Move room detection to get_room_at_pos (from Arceveti)

* address enum comment
2023-03-06 20:49: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
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
7551748a35 Remove GRAPH_NODE_TYPE_FUNCTIONAL define & restore functionality using an alternative method. (#557)
Fixes Mirror Mario and similar things.
2023-01-20 00:59:18 -05:00
Arceveti
8043823cce Merge master/2.0.8 into 2.1.0 (#551)
* 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)

* HackerSM64 2.0.6 (#539)

* revert random_u16 to be a u16 (#538)

* Added safety gcc math flags (#537)

* removed useless compilation flags that could cause performance loss

Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com>
Co-authored-by: thecozies <collinpferguson@gmail.com>

* Update VERSION.txt

HackerSM64 2.0.6

* Add GCC opt flag to suppress warnings

* v2.0.7

* 2.0.8 (fix more compiler warnings) (#543)

* fix Waddress in mario_step.c

* fix Winfinite-recursion in unused dynlist_proc function

* in fact remove the offending function entirely

* fix warnings in RNC decompress functions

* update version

* fix version in VERSION.txt

premature on my part, will update it to 2.0.10 next time

Co-authored-by: someone2639 <someone2639@gmail.com>

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>
Co-authored-by: thecozies <collinpferguson@gmail.com>
Co-authored-by: Reonu <danileon95@gmail.com>
Co-authored-by: someone2639 <someone2639@users.noreply.github.com>
Co-authored-by: someone2639 <someone2639@gmail.com>
2022-12-12 14:40:55 -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
12b91fe73c Disable DISABLE_ALL (#528)
Because literally who is gonna make a hack without ever using any debug features?
2022-11-03 08:54:04 +01:00
Gregory Heskett
a42bd9bc2e Implemented native Gamecube controller support and corresponding emulator hint in ROM header (#505)
* Implemented native Gamecube controller support and corresponding emulator hint in ROM header

* Added X and Y buttons to VALID_BUTTONS in sm64.h

* Added workaround in controller type detection for mupen bug

* read GC controllers from port 2

* L to Z logic for GC controller uses a threshold

* Changed threshold for L trig to around 33%

Changed threshold based on feedback

* Added gGamecubeControllerPort

* fixed wrong check

* Bugfix: Game crashes when less than 2 controllers are connected

* Suppress compiler warnings

* Bugfix: button swapping still takes place on non-GC controllers

* Wrap port 2 stuff in console check

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

* GC console check

* Funny emulator crash moment

* block comment moment

* Added centering for the gamecube controller, support reset command (#511)

* Added centering for the gamecube controller, support reset command

* Use struct 'ControllerCenters' for 'gGamecubeControllerCenters'

* Store gamecube controller centers per controller

* Clamp GC controller stick values to s8

* the

formatting changes

Co-authored-by: Mr-Wiseguy <mrwiseguyromhacking@gmail.com>
Co-authored-by: Reonu <danileon95@gmail.com>
Co-authored-by: Denis Kopyrin <aglab3@gmail.com>
2022-11-03 08:52:19 +01:00
Reonu
088dbbdd2b Make warp surfaces use the force parameter if set (#525) 2022-11-03 00:25:24 +01:00
Gregory Heskett
d7d0364682 Add define to disable pitch shifting of Mario sound effects (#522)
* Add define to disable pitch shifting of Mario sound effects

* Point new voice sequence macros to existing ones

* Remove pitch shifting sequence macros from peach sounds
2022-11-02 17:24:39 -05:00
Reonu
74730e7852 Simplified lives defines (#439)
* Combined ENABLE_LIVES and DEFAULT_NUM_LIVES, and removed SAVE_NUM_LIVES

* removed commented out lines

* numLives no longer modified by default when lives are disabled

This allows for the variable to be repurposed more easily

* Remove SAVE_NUM_LIVES define

* Remove SAVE_NUM_LIVES and DISABLE_LIVES define (Take 2)

* Apply MAX_NUM_LIVES and MAX_NUM_COINS to update_hud_values()

Co-authored-by: gheskett <gheskett@gmail.com>
2022-09-30 09:52:22 +13:00