Commit graph

5060 commits

Author SHA1 Message Date
Isaac0-dev
bf56dc415c allow multiple overrides per sequence, cleanup 2026-05-19 19:19:47 +10:00
Isaac0-dev
6067ea4e31 guard against allocation fail in strdup 2026-05-19 17:09:39 +10:00
Isaac0-dev
24e44315cb clean up a long line 2026-05-18 00:51:07 +10:00
Isaac0-dev
8ce886883e rabbit review 2026-05-18 00:47:38 +10:00
Isaac0-dev
082047c605 dynos audio
put the integer settings for the override in the m64 name separated by underscores, for example `seq_8_42_100.m64`.
Sequences are auto reloaded upon selecting the pack.
2026-05-17 23:52:28 +10:00
Sunk
e2035853b9
Change romhack camera options (#1247)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
* Change camera options

* Resolve suggestions
2026-05-16 22:07:51 -04:00
Isaac0-dev
d119881854
make pull requests auto build
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2026-05-16 15:28:28 +10:00
EmeraldLockdown
d750fee179
Resolve issue with windows compilation due to use of strcasestr (#1246)
Fixes issue introduced by bb142d5769 because someone didn't check the C standard to verify it was ok to use (it was me).

`strcasestr` is not apart of the C standard and is a GNU extension. Windows does not play well with this. The solution was to define a quite simple custom function partially based on the glibc implementation. Function should be reviewed.
2026-05-16 15:00:12 +10:00
EmeraldLockdown
bb142d5769
Add searchbox, add it to mod panel and dynos panel (#1129) 2026-05-16 12:14:56 +10:00
Isaac0-dev
8da31e6199
fix audio engine crash from reloading banks that are already loaded (#1232)
* fix audio engine crash from reloading banks that are already loaded

* only promote banks that are "discardable"
2026-05-15 21:14:09 -04:00
Isaac0-dev
967d120505
much further draw distance option (#1240)
The existing draw distance options don't actually increase the draw distance. It only impacts whether or not distant objects are rendered. 

This PR:
- Adds another option to the draw distance setting in the display menu, called "Infinite". It is not truly infinite, but it is significantly larger than what current options allow. Due to it not being truly infinite, we could use the name "Max" instead to be more accurate.
- Exposes a new function to the Lua API `draw_distance_scalar_is_infinite` which returns whether or not the infinite setting is enabled.
- `draw_distance_scalar_is_infinite` is now used in several places in this repo to bypass distance checks for objects if infinite mode is enabled.
- Fixes a bug where you couldn't bypass the distance check in `obj_is_in_view`, meaning you could never disable all object distance culling.
- The infinite setting now forces the far plane to be at least a minimum of `1,000,000`.
2026-05-16 11:13:02 +10:00
Agent X
91208e4e06 Fix OpenGL check
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2026-05-14 21:31:15 -04:00
Agent X
2e9e6644ca Default to DirectX renderer if OpenGL can't be ran 2026-05-14 20:47:35 -04:00
Cooliokid956
e87d118063
Multiline descriptions (#1235)
Some checks failed
Build coop / build-linux (push) Has been cancelled
Build coop / build-steamos (push) Has been cancelled
Build coop / build-windows (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
2026-05-13 16:06:19 -04:00
Isaac0-dev
76e6bf6bce make it compile again
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
(my fault)
2026-05-13 11:49:48 +10:00
Demi-kun
1139c0f67a
Re-Implement Sound Modes (#1226) 2026-05-13 10:48:15 +10:00
EmeraldLockdown
5a3ce71c6a
Fix a blunder by yours truly (#1237) 2026-05-13 09:58:13 +10:00
rPhase
c9154bc60b
Add missing Scale XYZ entry to graphNodeLots (#1236) 2026-05-12 19:31:03 -04:00
Agent X
432b8721d6 Fix no icon on DirectX
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2026-05-11 17:09:57 -04:00
Agent X
63156acf39 Fix mouse input on DirectX 2026-05-11 17:06:15 -04:00
Agent X
07705adc67 Port trilinear filtering to DirectX 2026-05-11 16:52:09 -04:00
Agent X
3f79f261e9 Port lightmap color feature from OpenGL to DirectX 2026-05-11 16:37:57 -04:00
Agent X
19a429dbe5
Add built-in preset screen shader effects configurable through Lua (#1217)
* C++ lighting engine

Runs better using my new system for storing and iterating through lights.

I removed the lighting ctx profiler because after I've realized its very inaccurate and was probably programmed incorrectly from the start. Although I remember it working fine before and not constantly showing 20 ms or higher when I'm in an extremely simple level with extremely simple lights and the FPS is way too high for it to be taking 20 ms.

* Whoops

* Make some optimizations

* Fix small bug with LE inside graphics vertex function

I also brought back the lighting profiler because it's better than nothing.

* Some optimizations

* Cache active lights and 4 lights per vertex limit

Less branching and less iterating with the limit

* Screen shader effects for Lua [OpenGL]

Hue, saturation, brightness, contrast, exposure, dithering, posterization

Global = usually an object in the world
Non global = usually a screen element

Also:
* Changed skyboxes to use environment color instead of vertex color, visually identical
* Changed hud head texture to be non global
* changed power meter to be non global
* changed sparkles to be global
* changed some BBH vertex types to global

OpenGL renderer supported only for now.

* Add default values and better function names

Also fixed sizes in reset function

* Add scanlines effect

* Add global enabled function

* Fix some default values

* Hopefully fix white sparkles

* Whoops

* Address review

* Update function names

* Fix shader crash

* Address reviews
2026-05-11 15:59:48 -04:00
EmeraldLockdown
c7b2b2bb56
Update libs (#1234)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2026-05-11 07:34:35 -04:00
Agent X
000dc5abc9 Auto updater improvements
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2026-05-10 23:48:10 -04:00
EmeraldLockdown
1d71c4e8de
Add an auto updater (#1231)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
* Add builtin updater to macos

* Compile using trimmed build

* Implement windows

* Add coopdx updater binary

* idk what this is

* Dont need that

* Undo temp code, close stdin, stdout, and stderror so we dont print to error

* Add intel

* Linux

* Finalize

Co-authored-by: AgentXLP <44549182+AgentXLP@users.noreply.github.com>

* Update updater executables (cross compiled, need to test)

* Update windows exec

* Update mac libs

* Update windows lib

* Address review

---------

Co-authored-by: AgentXLP <44549182+AgentXLP@users.noreply.github.com>
2026-05-10 22:46:35 -04:00
Agent X
388536b385
Unify renderers into one build, add renderer selectionbox (#1218)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
* Unify renderers into one build, no more segregation

* Fix Linux compilation error

* How does one miss this

* Rename this

* Fix silly naming error that I missed

* Update Russian translation
2026-05-09 19:46:29 -04:00
Agent X
f2c5b4eb13 Implement the HOOK_ON_HUD_RENDER_BEHIND fix ON THE RIGHT BRANCH 2026-05-09 16:45:31 -04:00
Agent X
63f0067f3b Add new built-in mod categories 2026-05-09 15:03:31 -04:00
Agent X
6a099714d3 Set mario health to 1 instead of 8 with anti softlock measure 2026-05-09 14:21:24 -04:00
Agent X
2d65cbfa1a Fix wrong angle direction on first person cam c button turning always 2026-05-09 11:28:54 -04:00
Isaac0-dev
ec28e164db
optimised loading the mod cache (#1222)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
* use hashmaps in mod cache

* use templates, suggested by peachy

an attempt to do what peachy is talking about

* that looks unusual

* change data to key parameter
2026-05-09 11:13:08 -04:00
Isaac0-dev
1e4ede799b
massive performance improvements for add_scroll_target (#1219)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
Loading the scroll targets was probably the slowest parts to loading a romhack.
The reason for this is that many romhacks can have thousands of calls to `add_scroll_target`.
So, for 4,107 calls to `add_scroll_target`, the time went from ~4.5759 seconds to ~0.0173 seconds in total. 
Changes made:
- Previously, simply finding the material data to scroll was rather slow due to using a linear sub string search across all vertices in all levels. To speed this up, I added a cache.
The cache bypasses checking every level by storing the exact string (rather than the substring) in a hashmap, so lookups become a simple case of a string lookup as a key in the map. It falls back to the full lookup if the cache doesn't hit.
- Changed the vertex buffer management in `scroll_targets.c` to behave closer to a modern dynamic array, where buffer size is doubled each time a new vertex buffer is added, to reduce the number of allocations performed.
2026-05-08 20:57:06 +10:00
Emily♥
149cb10153
Fix sync valid packet issues for the server (#1228)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
* Fix erroneous sync valid packets

When the server received a sync valid packet from another player, it would also set the server player's level. This simple fix makes this no longer happen.

* Fix sync valid packets with host

Okay, so it turns out that the host was unable to differentiate between packets meant to validate other players, and packets meant to validate itself (sent when entering a level another player is already in). I changed so that the packet also includes who the sync packet is validating. Requires an additional byte, as well as adding an argument to network_send_sync_valid.

* Don't have server inform itself

Fixes HOOK_ON_SYNC_VALID being called twice
2026-05-07 11:23:57 -04:00
Agent X
3886c1181e Day Night Cycle DX v2.5.2
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2026-05-06 16:02:24 -04:00
PeachyPeach
07c229afdc
Fix rendering issues with held objects (#1221)
Some checks failed
Build coop / build-linux (push) Has been cancelled
Build coop / build-steamos (push) Has been cancelled
Build coop / build-windows-opengl (push) Has been cancelled
Build coop / build-windows-directx (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
Add a way to save and load a gfx state in display lists.
Its primary purpose is to save the gfx state before rendering a held object, then restore it later.
It fixes the issue where Mario had opaque legs with the vanish and metal caps when holding an object.
2026-05-06 07:10:59 +10:00
Agent X
b37b2bf29f Prevent HOOK_ON_HUD_RENDER_BEHIND from being halted
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2026-05-04 23:41:07 -04:00
EmeraldLockdown
82a3afcc0f
Add HOOK_ON_PLAY_MODE_UPDATE and HOOK_BEFORE_PLAY_MODE_UPDATE (#1160)
* Add playmode hooks

* Add hook to docs, fix some crashes semi-related

* Rename that func
2026-05-04 21:01:01 -04:00
Isaac0-dev
ed4a0e12c0
Add Community section with Discord link
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2026-05-05 09:35:01 +10:00
DorfDork
f688416483
Scale bone anim support (#1215)
* Scale bone anim support

Code changes provided by ExcellentGamer. Supports model anims which modify scale.

* Peachy code changes by ExcellentGamer

* Autogen constants

* changed vc3f_set to vec3f_copy
2026-05-05 00:15:00 +02:00
Isaac0-dev
95782f447c dynos_mgr_actor.cpp clean up
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
mostly cosmetic.
2026-05-04 22:33:37 +10:00
jayden
5dabcaa313
Add audio_stream_get/set_volume_channel (#1205)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
Allows modders to play audio streams on channels other than level background music.
4 constants have been added for this purpose:
- `MOD_AUDIO_CHANNEL_MASTER` - sound is only affected by master volume
- `MOD_AUDIO_CHANNEL_MUSIC` - sound is affected by music volume, same as previous behaviour
- `MOD_AUDIO_CHANNEL_SFX` - sound is affected by sfx volume, same as sample behaviour
- `MOD_AUDIO_CHANNEL_ENV` - sound is affected by env volume 
This was done instead of using the existing `SEQ_PLAYER_*` constants to avoid confusion and because there isn't a `NONE`/`MASTER` option.

Additionally, sets the default to `MOD_AUDIO_CHANNEL_MUSIC` as to not break compatibility.

```lua
audio_stream_set_volume_channel(stream, MOD_AUDIO_CHANNEL_SFX) -- wow its just like a sample
audio_stream_get_volume_channel(stream) -- returns MOD_AUDIO_CHANNEL_SFX (its actually 2)
```
2026-05-03 17:59:11 +10:00
Isaac0-dev
de7ad4b0d6
memory.c cleanup and optimisation (#1157)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
## Low hanging fruit optimisations for the memory data structures in `memory.c`
Mostly generic performance improvements:
- Swapping `calloc` calls for `malloc` calls where it's safe
- Combined allocations into one large allocation for `node + buffer`
- Using `realloc` instead of full `calloc` + `memcpy` + `free`.
2026-05-03 07:52:42 +10:00
djoslin0
e88bd178fc
Refactor collision surface systems and add the ability to add/remove/move surfaces (#1143)
- Add `smlua_collision_add_surface`, `_move_surface`, `_delete_surface` Lua APIs
- Add `remove_static_object_collision` to fully free a SOC and its surfaces
- Split surface pools into separate static, SOC, and dynamic pools
- Replace index-based SOC tracking with unique ID counter (`sSOCIdCounter`)
- Invalidate Lua CObjects for recycled surfaces on pool clear
- Expose `SURFACE_POOL_STATIC/DYNAMIC/SOC` constants to Lua
- Add `growing_array_swap_and_pop` and `growing_array_swap_and_pop_index` to memory utils

Co-authored-by: MysterD <myster@d>
2026-05-02 14:58:46 -04:00
PeachyPeachSM64
629b97a789 Hide deprecated fields
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
2026-05-02 13:38:15 +02:00
PeachyPeachSM64
b4ce78e6d6 Run autogen 2026-05-02 12:44:36 +02:00
Cooliokid956
3459e7fa83
Fix ModAudio.file.relativePath virtually (#1214)
Some checks are pending
Build coop / build-linux (push) Waiting to run
Build coop / build-steamos (push) Waiting to run
Build coop / build-windows-opengl (push) Waiting to run
Build coop / build-windows-directx (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run
Applied a compatibility band-aid for `ModAudio.file.relativePath` using unions and properties. The only real thing here is the new hidden `return_self` function I had to make for this to work

unction
2026-05-02 00:35:27 -04:00
EmeraldLockdown
b4b31bdb0c
Multiple dx11 fixes (#1213)
* This is an awful workflow. Probably still need to update dx11 program ver

* Yea, going to despise this workflow

* Whoops

* Weewoo

* Fix comp error

* Bump dx11 ver due to it having an extremely limited number of inputs
2026-05-01 22:46:15 -04:00
EmeraldLockdown
37f4b2e550
Expose gHudDisplay (#1158)
* Expose `gHudDisplay`

* Fix that
2026-05-01 22:25:06 -04:00
Cooliokid956
1d9de02af1
CObject Properties (#1068)
* CObject Properties

- Added property members to CObjects via `PROPERTY` macro
`PROPERTY(name, get, set)`
  - `name`: property name
  - `get`: `fun(self): value`
  - `set`: `fun(self, value)`
- Prettified `LuaObjectField` struct with unions for function/property value types
- Added properties to `struct ModAudio`
  - `position`
  - `looping`
  - `frequency`
  - `volume`
    - NOTE: only work with streams- the audio reform will come later

* Define array size only when necessary

- new `__pairs` metamethod for `CObject`s, cycles through all of an object's fields, in alphabetical order
- stray semicolon!
2026-05-01 22:12:51 -04:00