Commit Graph

157 Commits

Author SHA1 Message Date
Irastris 8487a4151d Add Aurora config options for enabling texture replacement and dumping (#222) 2026-04-10 19:14:15 -06:00
Luke Street ce727b71fb Avoid re-initializing game_main 2026-04-10 16:46:25 -06:00
Luke Street 6deee934b5 --dvd param skips prelaunch 2026-04-10 16:46:24 -06:00
Luke Street 7e77577097 Big imgui overhaul 2026-04-09 23:11:10 -06:00
CraftyBoss 300ed931e3 implement pre-launch ui for configuring iso directory (#301)
UI will automatically open on boot and will not launch the game if there is no valid iso path specified in the config. Can optionally be disabled on future game launches.
2026-04-09 23:06:37 -06:00
Pieter-Jan Briers ccb912785b Set default PAD mapping to fix Z (#297)
* Set default PAD mapping to fix Z

Requires https://github.com/encounter/aurora/pull/111

* Update to new API
2026-04-09 19:24:25 -06:00
qwertyquerty 3366c22e99 CI/CD, CMake improvements, more targets, fix gcc (#258)
* CI attempt

* syntax

* fix cmake for linux

* fix include directories and merge main

* fix PDB fighting

* fix gcc compiling

* fix SSCACHE for windows

* try and fix gcc

* more CI presets

* remove the android target for now

* bump cmake minimum to fix debug information format

* yet another attempt at fixing gcc

* yet another attempt at fixing gcc

* better CI matrixing

* yet another attempt at fixing GCC

* fix arm

* fix CI

* placeholder icons

* compile dawn from source for windows arm64

* fix icons and linker warnings

* fix cmake

* fetch libjpegturbo

---------

Co-authored-by: Luke Street <luke@street.dev>
2026-04-09 19:22:53 -06:00
PJB3005 3bcd46dc30 Add Tracy stuff 2026-04-09 18:47:34 +02:00
madeline 85bebac4ec frame usage debug info 2026-04-07 22:11:50 -07:00
MelonSpeedruns 7eddc36e23 Merge remote-tracking branch 'origin/main' into 26-04-05-locked-aspect-ratio
# Conflicts:
#	include/dusk/settings.h
#	src/dusk/settings.cpp
#	src/m_Do/m_Do_main.cpp
2026-04-07 18:20:45 -04:00
PJB3005 8f77ca72b1 Fix Aurora draw call display in performance overlay
It was getting reset at the start of the frame... Just cache the values.
2026-04-07 22:17:48 +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
Luke Street 12af5b212f Add vsync toggle & honor fullscreen setting 2026-04-06 23:07:48 -06:00
MelonSpeedruns c0024b28b1 Merge remote-tracking branch 'origin/main' into feature/dynamic-aspect-ratio 2026-04-06 13:16:38 -04:00
Max Roncace b098577ab9 Reapply settings changes on top of #209 2026-04-05 23:49:31 +02:00
bdamja 1430f690e0 button to restore default window size and position (#234) 2026-04-05 17:04:40 -04:00
PJB3005 4311f91c37 Add "lock aspect ratio" setting
Uses new Aurora functionality: https://github.com/encounter/aurora/pull/97

Fixes #138
2026-04-05 22:46:38 +02:00
PJB3005 49412fae51 appname.hpp -> app_info.hpp 2026-04-05 19:20:10 +02:00
PJB3005 f732eccf6c Set Aurora config path 2026-04-05 19:03:26 +02:00
PJB3005 0bb9ff5ef3 Merge remote-tracking branch 'origin/main' into 26-04-04-config 2026-04-05 00:12:17 +02:00
PJB3005 824263fa6e Config system v1
Roughly inspired by what I've learned from my work on Space Station 14, without some of the unnecessary cruft and complexity.

Implementation is relatively simple once I figured out all the template order shenanigans.
2026-04-04 22:47:48 +02:00
Irastris c94976cd41 Remove AuroraConfig configPath 2026-04-04 01:52:48 -04:00
Luke Street 5f0f3628ce Rescale imgui on display scale change 2026-04-03 17:09:29 -06:00
Luke Street b8f53c55a5 Copy more imgui stuff from Metaforce 2026-04-03 17:04:22 -06:00
Luke Street 7642d72a52 Allow threads to gracefully shutdown 2026-04-01 18:30:12 -06:00
PJB3005 81d0312f2b Merge branch 'main' into pjb-audio 2026-03-27 17:18:11 +01:00
PJB3005 2240c04cec Fix shutdown crash 2026-03-26 15:03:48 +01:00
madeline a1f78609d8 turn on background input 2026-03-23 23:17:26 -07:00
Max Roncace 49080f6119 Move aurora_begin_frame/aurora_end_frame calls to main loop
This fixes an issue when using SDL's X11 backend due to Dusk
attempting to render ImGui menus without an active frame.
2026-03-18 16:33:03 -04:00
Max Roncace 4fd2ddd67a Fix some Clang compile warnings 2026-03-14 18:37:18 -04:00
qwertyquerty 767ba3bb14 Ongoing gameplay dev (#49)
* launch.json cwd

* bodge to load gci for testing

* stub card stat

* gameplay bodges

* viewport, ub fixes

* add release with debug info cmake variant

* be fixes, sound stub

* viewport h

* d_msg_flow BE

* be fopAcM_createItemFromEnemyID

* update launch configuration to use iso

* more audio stubs

* Attempt to set viewport and get messages for brightness check

* skip opening scene again, fixed JMessage::TResourceContainer::TCResource::Do_destroy

* add guards for viewport changes

* moar endian swapping to get Link sitting in PROC_OPENING_SCENE and for dialogues

* BE d_msg_class i_data

* stub bgm start

* fix div by 0 error (for now)

* TEMP_BROKEN in d_menu_ring

* REQUIRES_GX_LINES

* properly stub renderingAmap::draw with REQUIRES_GX_LINES

* better stubbing outside of stubs

* fix event data getting swapped multiple times

* evil draw vp fix

* Stub log imgui

This redirects all spammy logs to an imgui window that is cleared per frame.

This fixes the serious performance dip of the logging, and makes the regular log readable.

* Oops move those optimization changes I accidentally committed behind a flag

DUSK_SELECTED_OPT

* gx_line macro in map

* fix audio stubbing

* switch to CARD API aurora impl

* remove kabufuda from link libs

* refactor imgui stuff and add input viewer

* merge stub log with refactor

* accidentally committed a metaforce header shh

* basic map loader

* ImGuiConsole: Add missing <thread> include

* you may now play as luigi (you may now load stages with bridges)

* bloom fix

* bloom leak fix

* cloud shadow fix

* add soft reset button to imgui menu

* if it broke dont not fix it

* i swear i committed this

* BE swap indMtx in JPAResource::setPTev

* wnark ct fix

* frsqrte implementation from kinoko

* Fix Clang compile error in JAISeq::prepare_getSeqData_

* Add endian conversions to dMsgFlow_c::getInitNodeIndex

This fixes a freeze when Fado tries to stop you from leaving the
starting area.

* Add RAII GXTexObj wrapper; fix almost all leaks

* Update aurora for indirect texturing

* Update aurora for CARD fix

* Fix Clang build

* More d_msg_flow endian fixes

Fixes softlock when trying to talk to Fado and possibly other NPCs.

* no frame limiter

* get pause menu working

* proper frame limiting

* particle pointer size fix

* improve map loader a bit

---------

Co-authored-by: Jasper St. Pierre <jstpierre@mecheye.net>
Co-authored-by: TakaRikka <takarikka@outlook.com>
Co-authored-by: CraftyBoss <talibabdulmaalik@gmail.com>
Co-authored-by: Luke Street <luke@street.dev>
Co-authored-by: Lurs <2795933+Lurs@users.noreply.github.com>
Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
Co-authored-by: tgsm <doodrabbit@hotmail.com>
Co-authored-by: Max Roncace <me@caseif.net>
Co-authored-by: Phillip Stephens <antidote.crk@gmail.com>
2026-03-12 04:01:03 -07:00
Pieter-Jan Briers 15732e241c Pjb dev 3 (#48)
* Undo array allocation changes from #43

Doesn't work

* Expand dmeter heap sizes, give names

* Fix manual operator delete call in resource.cpp

* Disable map rendering for now

Aurora can't handle lines

* Re-enable assert heap on DVD thread

Should be fine?

* Some basic debug groups with the new Aurora API

* Allow Aurora backend to be set via CLI

* Give materials debug groups

* More debug groups

* JKRHeap separation: array edition

Pain
2026-03-11 13:40:21 -07:00
Luke Street 746d01e44c Aurora DVD support (#43)
* Aurora DVD support

* Remove commented code

* Restore STUB_LOG
2026-03-09 00:33:04 -07:00
Pieter-Jan Briers b289dece80 26 02 27 pjb dev 2 (#41)
* fix kankyo UB

* Fix TEV Stage DL writing

BE issue

* BE Fixes in materials/shapes

* Move to Aurora GD impl

* JUTDataFileHeader

* j3d: load vertex and texture not through GD

* Endian swap vertex data (mostly)

* Just exit(0) when closing the game

Fix crashes :godo:

* fix fopAcM_ct_placement and remove memcpy

* J3D: track vertex arrays correctly, swap work

* fix visibility, turn off overridden new/delete when we call into aurora

* event: cut name be

* Default window improvements

Double size, allow OS to decide position

* survive TParse::parseHeader_next

* color swap fix

* swap endian/fixes oob function pointer

* Remove GXGetViewportv stub

Aurora has it now

* Set array pointers via GD again

Relies on https://github.com/encounter/aurora/pull/35

* Let Aurora decide graphics backend

* disable procbar drawing

* Fix TColor endianness conversion issues

Fixes the wrong color for the flashing logo

* cam param swap

* simplify vtx loading, mat/amb color fix

* endian swap stb/fvb data

* aurora stat changes

* fix storage buffer crash

dont unnecessarily reassign vertex buffers in a way that forces aurora to recache things

* set bgobj spec fix

* add camera debug, endian swap more stb data, d_a_bg_obj::spec_data_c swapped

* JKRExpHeap: fix bad allocator slowdown

* solid tex

* texture caching

* log level

* fix window aspect ratio, disable bloom, endian swap camera type data

camera is now actually playing opening cutscene!!!!

* add GXDestroyTexObj to a couple stack init'd GXTexObjs, remove some diag printfs

* endian swap joint weight envelope data

* move to dusk config

* verbose arg errors

* better stub logging (for now)

* less logging, more BE

* more stubbing, move logging stuff around

* move all logging to aurora logging

* fix STUB_LOG, __FUNCTION__ isn't a string literal, wasn't building as it
was.

* update aurora

* fix heap alignment mismatch and always head align for now

* prevent them from fucking up my shit

* forward jut warning to DuskLog

* remove report logging

* maybe and i must emphasize maybe fix JMessage parsing

* this was a dumb idea

* preserve negative alignment for JKRHeap

* use normal free on macos and linux

* ^

* fix JMAHermiteInterpolation c impl

* endian swap J2DScreen mColor (oops)

* swap more J3D anim data, remove weird pointer addr check in J3DMaterial getMaterialAnm

* typo fix

* Fix aligned_alloc() size issues on POSIX

aligned_alloc() requires its input size to be a multiple of alignment. This wasn't being upheld so there were allocation failures in init code that made the game fail to start outside Windows.

Also just cleaned up some of this code a bit and removed fallback cases that *shouldn't* get hit.

* _Exit instead of exit()

Seriously I don't want destructors to run. Let the OS reclaim that shit.

* Reapply "Isolate JKRHeap operator overloads" (#39)

This reverts commit 3623b27f37.

* Fix some oopsies

* Fix hardcoded pointer size in JUTCacheFont::allocArray

* More operator overload fixes

Add void template specialization for jkrDelete

Add new[] placement overload. Apparently.

* Fix delete macros on nullptr

TIL C++ allows that.

* fix delete[]

* fix new(std::nothrow) overload

* fix avoid ub

* swap remaining anim data needed for title logo

* get rid of op 7

* move aurora_end_frame to correct spot

* juttexture destroy tex

* j2d animation be

* shutdown crash

* link warp material fix

* mDoExt_3DlineMat1_c fix

* hacky keyboard controls

* endian swap J2DResReference, add kb_pad to files.cmake

* fix some missing endian swaps in J2D, remove addr alignment check

* Remove heap unsetting in aurora calls

Never worked properly and not the right solution even if it did

* Don't print in DC stubs

They're fine to never implement

* Fix alignment stuff again

* Compile GF from dolphin lib

Doesn't seem to break anything and shuts up some stub warnings

* j3dtexture tlut obj fix

* addTexMtxIndexInDL fix

* don't recreate null tex data every frame

* the actual fix i wanted to push

* its kinda fakematch city over here

* insert hte efb copy

* limited window size / viewport support

* IsDelete FIX

---------

Co-authored-by: madeline <qwertytrogi@gmail.com>
Co-authored-by: Jasper St. Pierre <jstpierre@mecheye.net>
Co-authored-by: Jeffrey Crowell <jeff@crowell.biz>
Co-authored-by: TakaRikka <takarikka@outlook.com>
Co-authored-by: CraftyBoss <talibabdulmaalik@gmail.com>
Co-authored-by: Lurs <2795933+Lurs@users.noreply.github.com>
2026-03-08 15:27:15 -07:00
TakaRikka 820e2e3df6 some readme improvements 2026-03-07 01:57:10 -08:00
PJB3005 abee1bfc17 Move ARAM code to Aurora 2026-03-02 14:51:56 +01:00
PJB3005 b397c886e7 Move some OS functionality to rely on Aurora 2026-03-02 14:27:20 +01:00
PJB3005 d83267098e Add heap imgui 2026-03-01 22:23:59 +01:00
PJB3005 3776bd624b Fix Aurora event processing (fix exit) 2026-03-01 17:29:19 +01:00
PJB3005 3750e7cfee Merge remote-tracking branch 'origin/main' into 26-02-27-pjb-dev-2 2026-03-01 15:08:52 +01:00
Luke Street 3385468314 Merge decomp/main into dusk 2026-02-28 14:49:57 -07:00
Luke Street 38b7156a8e Another round of GCC fixes (#3115)
* Fix remaining <string> -> <cstring> for GCC compilation (#3114 follow-up)

MWerks' <string> header transitively includes C string functions
(memcpy, strlen, strcmp, etc.), but GCC/Clang's <string> is the C++
std::string header. These files all use C string functions and should
include <cstring> instead.

* Use std::isnan instead of isnan for GCC compilation

GCC's <cmath> places isnan in the std namespace. Using the unqualified
isnan fails to compile with GCC/Clang.

* Fix cCcD_Src types: s32 -> u32 for bitmask fields

cCcD_SrcObjCommonBase::mSPrm, cCcD_SrcObjTg::mType, and
cCcD_SrcObjAt::mType are used as bitmasks (SetType/SetSPrm take u32,
MskType/MskSPrm use u32, values like 0xFFFFFFFF are common in
aggregate inits). Change from s32 to u32 to match usage.

Also fix AT_TYPE_WOLF_ATTACK/AT_TYPE_UNK to use unsigned literals,
and remove now-unnecessary (s32) casts on hex literals in collision
source data.

* Mark dummy() functions as static to avoid multiple definition errors

These decomp artifact functions have the same name and signature across
TUs, causing linker errors when building as a single binary.
2026-02-28 13:35:07 -08:00
Luke Street b7961b7739 Fix compilation errors after decomp/main merge
- Fix <string> -> <cstring> across all source files (upstream fix)
- Add <cstring> to JASGadget.h, <cstdarg> to JUTDbPrint.cpp
- Fix <string> -> <cstring> in JUTFont.h, d_save.h, f_ap_game.h
- Fix std::isnan usage in c_cc_d.cpp
- Fix cCcD_Src types: s32 -> u32 for bitmask fields (upstream fix)
- Fix AT_TYPE_WOLF_ATTACK/AT_TYPE_UNK unsigned literals (upstream fix)
- Remove (s32) casts on hex literals in collision data (upstream fix)
- Fix 0xFFFFFFFF literal in d_a_obj_wood_statue.cpp (upstream fix)
- Add braces to case 0 in d_a_e_gb.cpp to fix jump-over-init
- Fix Z2AudioCS.h include path (Z2AudioLib -> Z2AudioCS)
- Forward-declare Z2AudioCS in stubs.cpp to avoid revolution conflicts
- Guard JASGlobalInstance specializations with __MWERKS__ in m_Do_main
- Remove duplicate inline functions from d_com_inf_game.h
- Mark dummy() functions as static (upstream fix)
- Add JAUSectionHeap.h include to m_Do_main.cpp
2026-02-28 14:29:46 -07:00
Luke Street 3b8300d0d2 Merge decomp/main into dusk
Merges 44 upstream commits from zeldaret/tp decomp/main.

Conflict resolutions:
- .github/workflows/build.yml: keep deleted (not needed for PC port)
- README.md: keep PC port README
- J3DAnimation.h: keep OFFSET_PTR macro + add upstream forward decl
- J3DModelLoader.h: keep BE(u32) mBlockNum + add field_0x1c
- d_com_inf_game.h: keep PC port inlines + add upstream declarations
- global.h: keep MULTI_CHAR macro + add FABSF macro
- JUTConsole.cpp: keep uintptr_t cast for 64-bit
- JUTDbPrint.cpp: keep PC enter_() helper + add cstring include
- JUTResFont.cpp: take upstream loop/struct improvements with BE types
- JUTCacheFont.cpp: take upstream decomp fix
- float.h: use upstream !PLATFORM_GCN guard
- d_a_npc_bouS/theB.cpp: keep MULTI_CHAR() for PC portability
- d_a_npc_henna.cpp: keep uintptr_t + use upstream var name
- d_demo.cpp: keep near_/far_ field renames for PC
- d_resorce.cpp: keep uintptr_t + fix var name to res
- d_s_room.cpp, m_Do_graphic.cpp: keep dusk includes + add cstring
- m_Do_main.cpp: keep JHIComPortManager + use JAS_GLOBAL_INSTANCE_INIT
- angle_utils.h: remove redundant types.h include
2026-02-28 13:33:16 -07:00
PJB3005 43e156913b Get imgui running 2026-02-28 14:43:47 +01:00
PJB3005 288cd84a64 Disable the audio engine for now 2026-02-27 23:54:50 +01:00
PJB3005 8b4bb290d8 Increase audio heap sizes on PC
prevent allocation failures from larger 64-bit pointers
2026-02-26 18:46:47 +01:00
PJB3005 b36aee6da7 Make the audio engine initialize again
Removes spurious mDoAud_zelAudio_c::onInitFlag call in m_do_main that was added in the port, it breaks audio engine init.

Re-introduced g_mDoAud_audioHeap initialization.
2026-02-26 18:45:57 +01:00
Lurs 2b78bb3375 Changed loading for already static loaded .rel files. Added gamepad init 2026-02-24 20:42:45 +01:00
PJB3005 e5cfe0e6b4 Use calloc instead of malloc followed by memset
Avoids forcing pages to be allocated until actually needed.
2026-02-24 15:17:47 +01:00