Commit Graph

104 Commits

Author SHA1 Message Date
Luke Street a99c8096d5 Merge branch 'refs/heads/main' into depth-bias-poc-hack 2026-05-28 22:41:45 -06:00
Pieter-Jan Briers 5d68762590 Add a *ton* of const and constexpr around the codebase. (#1864)
* Add a *ton* of const and constexpr around the codebase.

This makes the codebase compile without strings being cast to non-const char*. I also went through and added constexpr where appropriate for tons of static data.

* Make process definitions const too

Might as well
2026-05-27 23:12:16 -06:00
MelonSpeedruns a71bd56058 Merge branch 'tphd' into depth-bias-poc-hack 2026-05-25 14:43:25 -04:00
MelonSpeedruns 6304866b38 Merge remote-tracking branch 'origin/main' into tphd
# Conflicts:
#	extern/aurora
2026-05-25 14:37:26 -04:00
Pieter-Jan Briers a6376368ee String safety (#1548)
* Array size UB fixes

* Fix ShieldD

* Remove (almost) all unsafe strcpy calls

Bunch of macros. C arrays are easy enough and just need a different call. For various cases where a char* is passed around bare, I've made a TEXT_SPAN macro that can store a length too for bounds checking.

* Move crash handling in safe string operations to separate TU

* strcat safe version

* sprintf made safe too

* Fix compile
2026-05-24 10:43:00 -06:00
Olivia!! edc4aa0be4 Fixes linux credits crash (#1780)
alpha comparison mID is u16, but indexes into a 256-item table.
this causes MAT3 materials with an alpha comparison index of 0xFF crashes on linux

closes #1073
closes #1531
2026-05-23 21:31:19 -06:00
SuperDude88 8ae35dc9ea Add Missing BE
- Checking the values in the debugger reminded me that these need to be swapped
2026-05-21 00:21:34 -04:00
SuperDude88 9abb6bafd1 MAT4 Loading
- Properly load all MAT4 data

New fields/inlines/structs are based on what HD does. Still looking for ways to clean things up, particularly getMatInitData.
2026-05-20 23:47:24 -04:00
MelonSpeedruns 81c0c6f4d3 Merge remote-tracking branch 'origin/main' into tphd
# Conflicts:
#	extern/aurora
2026-05-19 15:49:56 -04:00
TakaRikka ec281a475f Merge pull request #1573 from TwilitRealm/j2dindtexmtx-be
Endian-swap indirect texture matrix in J2D data
2026-05-17 18:23:15 -07:00
doop 2be2615e61 Endian-swap indirect texture matrix in J2D data
Fixes copy/delete effects on the file screen.
2026-05-18 00:46:45 +00:00
PJB3005 629cd2f9d3 Missed these in JASHeapCtrl.h 2026-05-18 02:16:43 +02:00
PJB3005 05edbec827 Tag operator new overloads with noexcept
According to the C++ standard, regular operator new must always return a valid pointer, and allocation failure should throw an exception.

The original game did not use exceptions, and instead had its operator new return null on alloc failure.

Clang and GCC seem to be enforcing the standard here, and this is causing crashes on non-Windows platforms like https://sentry.twilitrealm.dev/organizations/twilitrealm/issues/952/, where a JAISe allocation failure (custom pooled operator new overload) crashes the game when it should be handled gracefully. MSVC seems to not make use of this opportunity, meaning the code works as intended.

Tagging the operators with noexcept seems to satisfy GCC, but I admit cppreference is very light on details here.
2026-05-18 02:06:38 +02:00
Lurs aa23ae244f Lurs' squashed commits
* first tphd wip

* fix CMakeLists.txt after rebase

* fix mipmapping (I hope) thanks to decaf-emu. Skipped a few textures in favor of GC assets and added new HD asset file formats

* added third hook into dusk for second JKRMemArchive constructor (e.g. for sign textures). skip texture load for textures with imageoffset = 0 to get STG.arc loaded instead. And small refactorings/rebasings. added a few parameters in logging
2026-05-08 19:43:48 -04:00
qwertyquerty 39d43a8d8f Keyboard mouse binding controls (#682)
* kbm controls

* submodule

* files.cmake

* a

* Fixes

* include <cstring> in J3DStruct.h

---------

Co-authored-by: Luke Street <luke@street.dev>
2026-05-06 22:07:28 -06:00
Jasper St. Pierre 1ee0f862e1 map highlight fix 2026-05-02 11:45:01 -07:00
TakaRikka 1c5686f71b Merge pull request #616 from TwilitRealm/HRTF
Emulate Surround option
2026-05-01 22:51:25 -07:00
madeline 93c8bcc210 hrtf 2026-05-01 13:04:08 -07:00
Jasper St. Pierre 3d860ad454 jpa interp start 2026-05-01 00:12:26 -07:00
madeline 06e6b0d47e fix safety bit on interp fixes #507 2026-04-23 03:58:35 -07:00
Jasper St. Pierre 53c005c4f1 jutfader doc 2026-04-19 12:48:50 -07:00
Jasper St. Pierre bb9a88d7dc frame interp camera cleanups 2026-04-19 02:25:00 -07:00
Jasper St. Pierre 8d3cb51157 frame interp simplify 2026-04-18 23:26:28 -07:00
Jasper St. Pierre b3f8fecfe4 water interpolation fix 2026-04-18 22:17:35 -07:00
Luke Street 2ec6f65572 Merge remote-tracking branch 'refs/remotes/origin/main' into unhackify-widescreen
# Conflicts:
#	src/m_Do/m_Do_main.cpp
2026-04-17 23:12:58 -06:00
Luke Street 5c20f527ac Widescreen rework & IR scaling 2026-04-17 23:11:43 -06:00
Irastris 59d2014fb9 Frame Interp: UI Pacing Simplification 2026-04-17 23:24:47 -04:00
CraftyBoss ec091ac3af change ANDROID define to TARGET_ANDROID 2026-04-14 03:18:21 -07:00
CraftyBoss 35650784c3 Merge branch 'main' into android-building 2026-04-14 03:17:07 -07:00
CraftyBoss 86c1e21ac1 fix compilation error
GlyphTextures no longer exists
2026-04-14 03:07:47 -07:00
CraftyBoss a2f8fffc8d Merge branch 'main' into android-building 2026-04-14 02:48:24 -07:00
PJB3005 143aa51eb3 Make JUTResFont load all texture data into one texture
Together with the previous change, this enables entire blocks of text to be rendered in one draw call.
2026-04-13 19:09:16 +02:00
PJB3005 18995f3d7c Enable some draw call merging in text rendering
Don't set state between characters if possible.

Next step is page merging so it can do full lines of text at once.
2026-04-13 13:27:21 +02:00
CraftyBoss 5e6d240d0f Merge remote-tracking branch 'origin/main' into android-building 2026-04-13 01:05:16 -07:00
Jasper St. Pierre 9f22f27909 fixes and cleanups for j3d material 2026-04-12 20:14:24 -07:00
CraftyBoss 8cd8d1b90c Merge remote-tracking branch 'origin/main' into android-building 2026-04-12 20:02:23 -07:00
Lurs 6b3728c5ab Let's replace the hack through a hack? Should fix the double swapping of #208 (and maybe more) 2026-04-12 22:39:05 +02:00
Irastris d481a23c49 Frame interp: Refactor JUTFader
Now works regardless of interpolation being on/off
2026-04-12 13:56:00 -04:00
CraftyBoss 75a4fe4429 Merge remote-tracking branch 'origin/main' into android-building 2026-04-12 02:53:05 -07:00
Luke Street 3c281cc988 BE swap J3DMaterialFactory::newIndTexMtx/newFog 2026-04-11 20:13:39 -06:00
Irastris fb9178cac9 Implement unlocked framerates via interpolation (#315)
* Disable waitForTick and waitBlanking

* Initial frame interpolation implementation

* Initial batch of speed fixes

* Fix Iron Boots

* Strip dead code once used for debugging

* Interpolate shadows

* Revert overzealous/redundant lookups

* Fix JUTFader

* Fix field map cursor

* Fix various particle effects

* Fix Midna when riding Wolf Link

* Fix title logo

* Title Logo 2: Electric Boogaloo

* Fixed grass and flowers

* "Unlock Framerate" config option (WIP)

* Wrap more things in TARGET_PC

* Finish wrapping things in TARGET_PC

* Missed one

* Disable dComIfGd_drawXluListInvisible when interpolating

---------

Co-authored-by: Luke Street <luke@street.dev>
2026-04-11 01:06:25 -06:00
CraftyBoss 627cf559c9 building for android impl
currently builds a "Metaforce" apk, will need to change name of course. Running the apk using Android Studio's emulator can get in game, however running on a samsung phone does not seem to work.
2026-04-10 03:53:57 -07:00
PJB3005 74942f3c76 Fix JUTResFont performance
Just store the GXTexObjs in a separately allocated hashmap, so they can be persisted cross-frame. Easy.

Fixes #227
2026-04-07 21:43:38 +02:00
PJB3005 63ade15e2c Cleanly shut down JKRDecomp thread
Properly join the thread to ensure it's shut down before we try to exit.

Fixes #268
2026-04-07 20:06:52 +02:00
Max Roncace 479d444066 Fix a couple more BE issues in J3DMaterialFactory_v21 2026-04-04 01:36:16 -04:00
madeline c869320471 Merge branch 'main' of https://github.com/TakaRikka/dusk 2026-04-03 22:33:41 -07:00
madeline 350e99e8ab fix getDopplerPower fixes #213 2026-04-03 22:33:38 -07:00
Max Roncace 5bb36dfb20 Fix crashes when entering Henna's shop 2026-04-04 01:30:24 -04:00
Luke Street 7642d72a52 Allow threads to gracefully shutdown 2026-04-01 18:30:12 -06:00
PJB3005 9e298f9228 Expand heap debug ImGui
Now allows seeing all blocks in ExpHeaps and running heap integrity checks.
2026-03-31 21:18:25 +02:00