diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a46e2758c..bf7a667426 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,6 +90,11 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +# Folder-based instead of target-based organization +# in Visual Studio and Xcode generators +set_property(GLOBAL PROPERTY USE_FOLDERS ON) +set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "_cmake") + if (CMAKE_SYSTEM_NAME STREQUAL Linux) set(DAWN_USE_WAYLAND ON CACHE BOOL "Enable support for Wayland surface" FORCE) endif () @@ -305,7 +310,7 @@ set(DUSK_TP_VERSION ${DUSK_GAME_NAME}${DUSK_GAME_VERSION}) message(STATUS "dusk: Game Version: ${DUSK_TP_VERSION}") -source_group("dolzel" FILES ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${JSYSTEM_FILES} ${JSYSTEM_DEBUG_FILES} ${REL_FILES}) +source_group("dolzel" FILES ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${REL_FILES}) source_group("dusk" FILES ${DUSK_FILES}) set(GAME_COMPILE_DEFS TARGET_PC WIDESCREEN_SUPPORT=1 AVOID_UB=1 VERSION=0 @@ -406,71 +411,89 @@ endif () # game_debug is for game code files that we know work when compiled with DEBUG=1 # Of course, if building a release build, this distinction is irrelevant -add_library(game_debug OBJECT ${JSYSTEM_DEBUG_FILES} ${SSYSTEM_FILES} +set(GAME_DEBUG_FILES + ${SSYSTEM_FILES} src/dusk/audio/DuskAudioSystem.cpp src/dusk/audio/JASCriticalSection.cpp src/dusk/audio/DuskDsp.cpp src/dusk/audio/Adpcm.cpp src/dusk/audio/DspStub.cpp - src/dusk/imgui/ImGuiAudio.cpp) + src/dusk/imgui/ImGuiAudio.cpp +) +set_source_files_properties( + ${GAME_DEBUG_FILES} + PROPERTIES + COMPILE_DEFINITIONS "$<$:DEBUG=1>;$<$:PARTIAL_DEBUG=1>" +) -# game_base is for all other game code files -add_library(game_base OBJECT ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${JSYSTEM_FILES} ${REL_FILES} ${DUSK_FILES} ${DOLPHIN_FILES} - ${miniz_SOURCE_DIR}/miniz.c) +set(GAME_BASE_FILES + ${DOLZEL_FILES} + ${Z2AUDIOLIB_FILES} + ${REL_FILES} + ${DUSK_FILES} + ${DOLPHIN_FILES} +) +set_source_files_properties( + ${GAME_BASE_FILES} + PROPERTIES + COMPILE_DEFINITIONS "NDEBUG=1;NDEBUG_DEFINED=1;DEBUG_DEFINED=0;$<$:PARTIAL_DEBUG=1>" +) -target_compile_definitions(game_debug PRIVATE ${GAME_COMPILE_DEFS} DUSK_BUILDING_GAME=1 $<$:DEBUG=1> $<$:PARTIAL_DEBUG=1>) -target_compile_definitions(game_base PRIVATE ${GAME_COMPILE_DEFS} DUSK_BUILDING_GAME=1 NDEBUG=1 NDEBUG_DEFINED=1 DEBUG_DEFINED=0 $<$:PARTIAL_DEBUG=1>) +foreach(jsystem_lib IN LISTS JSYSTEM_LIBRARIES) + target_compile_definitions(${jsystem_lib} PRIVATE + ${GAME_COMPILE_DEFS} + $<$:DEBUG=1> + $<$:PARTIAL_DEBUG=1> + ) + target_include_directories(${jsystem_lib} PRIVATE ${GAME_INCLUDE_DIRS}) + target_link_libraries(${jsystem_lib} PRIVATE ${GAME_LIBS}) + set_target_properties(${jsystem_lib} PROPERTIES FOLDER "JSystem") +endforeach() -# only apply PCH to game_base since not all headers are necessarily validated with DEBUG=1 -target_precompile_headers(game_base PRIVATE "$<$:${CMAKE_CURRENT_SOURCE_DIR}/include/dusk_pch.hpp>") - -target_include_directories(game_debug PRIVATE ${GAME_INCLUDE_DIRS}) -target_include_directories(game_base PRIVATE ${GAME_INCLUDE_DIRS}) - -# This implicitly pulls in the library include directories even though no -# linking actually takes place for object libraries -target_link_libraries(game_debug PRIVATE ${GAME_LIBS}) -target_link_libraries(game_base PRIVATE ${GAME_LIBS}) +set(JSYSTEM_LINK_LIBRARIES ${JSYSTEM_LIBRARIES}) +if (CMAKE_CXX_LINK_GROUP_USING_RESCAN_SUPPORTED OR CMAKE_LINK_GROUP_USING_RESCAN_SUPPORTED) + # GNU ld resolves static archives in a single left-to-right pass. The split + # JSystem libraries reference each other, so they need a RESCAN group there. + set(JSYSTEM_LINK_LIBRARIES "$") +endif () +set(DUSK_FILES src/dusk/main.cpp ${GAME_BASE_FILES} ${GAME_DEBUG_FILES} ${miniz_SOURCE_DIR}/miniz.c) if(ANDROID) - add_library(dusk SHARED src/dusk/main.cpp) + add_library(dusk SHARED ${DUSK_FILES}) set_target_properties(dusk PROPERTIES OUTPUT_NAME main) set(DUSK_MAIN_TARGET dusk) elseif(WIN32) - # Game DLL: mods link against dusk.lib. TARGET_OBJECTS lets WINDOWS_EXPORT_ALL_SYMBOLS see and export all game symbols - add_library(dusk_game SHARED - src/dusk/main.cpp - $ - $) + add_library(dusk_game SHARED ${DUSK_FILES}) set_target_properties(dusk_game PROPERTIES - WINDOWS_EXPORT_ALL_SYMBOLS ON - OUTPUT_NAME dusk) + WINDOWS_EXPORT_ALL_SYMBOLS ON + OUTPUT_NAME dusk) - # Launcher EXE add_executable(dusk WIN32 src/dusk/launcher_win32.cpp) target_link_libraries(dusk PRIVATE dusk_game) target_include_directories(dusk PRIVATE include) set(DUSK_MAIN_TARGET dusk_game) -else() - add_executable(dusk src/dusk/main.cpp) +else () + add_executable(dusk ${DUSK_FILES}) set(DUSK_MAIN_TARGET dusk) -endif() +endif () + +target_compile_definitions(${DUSK_MAIN_TARGET} PRIVATE ${GAME_COMPILE_DEFS}) +target_include_directories(${DUSK_MAIN_TARGET} PRIVATE ${GAME_INCLUDE_DIRS}) +target_link_libraries(${DUSK_MAIN_TARGET} PRIVATE aurora::main ${GAME_LIBS} ${JSYSTEM_LINK_LIBRARIES}) +target_precompile_headers(${DUSK_MAIN_TARGET} PRIVATE "$<$:${CMAKE_SOURCE_DIR}/include/dusk_pch.hpp>") -target_compile_definitions(${DUSK_MAIN_TARGET} PRIVATE TARGET_PC AVOID_UB=1 VERSION=0) -target_include_directories(${DUSK_MAIN_TARGET} PRIVATE include) -# Windows uses TARGET_OBJECTS directly so link GAME_LIBS instead of the static wrapper. if(WIN32) - target_link_libraries(${DUSK_MAIN_TARGET} PRIVATE ${GAME_LIBS} aurora::main Psapi) -else() - target_link_libraries(${DUSK_MAIN_TARGET} PRIVATE game aurora::main) + target_link_libraries(${DUSK_MAIN_TARGET} PRIVATE Psapi) endif() if(CMAKE_SYSTEM_NAME STREQUAL Linux) target_link_libraries(${DUSK_MAIN_TARGET} PRIVATE dl) endif() -# -rdynamic lets mods call game functions directly -if(UNIX AND NOT ANDROID) +if(APPLE) + target_link_options(${DUSK_MAIN_TARGET} PRIVATE -Wl,-export_dynamic) +elseif(UNIX AND NOT ANDROID) target_link_options(${DUSK_MAIN_TARGET} PRIVATE -rdynamic) endif() + if (TARGET crashpad_handler) add_dependencies(${DUSK_MAIN_TARGET} crashpad_handler) endif () diff --git a/README.md b/README.md index 7322441b74..c2fe53576d 100644 --- a/README.md +++ b/README.md @@ -10,28 +10,19 @@ First make sure your dump of the game is clean and supported by Dusk. You can do this by checking the sha1 hash of your dump against this list of supported versions. | Version | sha1 hash | -| ------------ | ---------------------------------------- | +|--------------| ---------------------------------------- | | GameCube USA | 75edd3ddff41f125d1b4ce1a40378f1b565519e7 | +| GameCube PAL | 2601822a488eeb86fb89db16ca8f29c2c953e1ca | ### 2. Download [Dusk](https://github.com/TwilitRealm/dusk/releases) ### 3. Setup the game -#### Windows - Extract the zip folder -- Place your dump of the game into the same folder where you extracted to -- Launch `dusk.exe` +- Launch Dusk +- Select Options, then set the ISO Path to your supported game dump +- Press Start Game to play! -#### macOS -- TODO - -#### Linux -- TODO - -#### iOS -- TODO - -#### android -- TODO +![DuskOptions](assets/dusk_options.png) # Building If you'd like to build Dusk from source, please read the [build instructions](docs/building.md). diff --git a/assets/dusk_options.png b/assets/dusk_options.png new file mode 100644 index 0000000000..4ed4ad7563 Binary files /dev/null and b/assets/dusk_options.png differ diff --git a/extern/aurora b/extern/aurora index 63550a8375..be1395c134 160000 --- a/extern/aurora +++ b/extern/aurora @@ -1 +1 @@ -Subproject commit 63550a83759974dd18bc13cd420888188be9caf9 +Subproject commit be1395c1343a5587cceea25754daa5cacce34f76 diff --git a/files.cmake b/files.cmake index 02bb5a547f..5d6850cfca 100644 --- a/files.cmake +++ b/files.cmake @@ -314,7 +314,7 @@ set(SSYSTEM_FILES src/SSystem/SStandard/s_basic.cpp ) -set(JSYSTEM_DEBUG_FILES +add_library(JSystem_JParticle STATIC libs/JSystem/src/JParticle/JPAResourceManager.cpp libs/JSystem/src/JParticle/JPAResource.cpp libs/JSystem/src/JParticle/JPABaseShape.cpp @@ -330,10 +330,19 @@ set(JSYSTEM_DEBUG_FILES libs/JSystem/src/JParticle/JPAEmitter.cpp libs/JSystem/src/JParticle/JPAParticle.cpp libs/JSystem/src/JParticle/JPAMath.cpp +) + +add_library(JSystem_JFramework STATIC libs/JSystem/src/JFramework/JFWSystem.cpp libs/JSystem/src/JFramework/JFWDisplay.cpp +) + +add_library(JSystem_J3DU STATIC libs/JSystem/src/J3DU/J3DUClipper.cpp libs/JSystem/src/J3DU/J3DUDL.cpp +) + +add_library(JSystem_JKernel STATIC libs/JSystem/src/JKernel/JKRHeap.cpp libs/JSystem/src/JKernel/JKRExpHeap.cpp libs/JSystem/src/JKernel/JKRSolidHeap.cpp @@ -359,14 +368,23 @@ set(JSYSTEM_DEBUG_FILES libs/JSystem/src/JKernel/JKRDvdRipper.cpp libs/JSystem/src/JKernel/JKRDvdAramRipper.cpp libs/JSystem/src/JKernel/JKRDecomp.cpp +) + +add_library(JSystem_JMath STATIC libs/JSystem/src/JMath/JMath.cpp libs/JSystem/src/JMath/random.cpp libs/JSystem/src/JMath/JMATrigonometric.cpp +) + +add_library(JSystem_JSupport STATIC libs/JSystem/src/JSupport/JSUList.cpp libs/JSystem/src/JSupport/JSUInputStream.cpp libs/JSystem/src/JSupport/JSUOutputStream.cpp libs/JSystem/src/JSupport/JSUMemoryStream.cpp libs/JSystem/src/JSupport/JSUFileStream.cpp +) + +add_library(JSystem_JUtility STATIC libs/JSystem/src/JUtility/JUTCacheFont.cpp libs/JSystem/src/JUtility/JUTResource.cpp libs/JSystem/src/JUtility/JUTTexture.cpp @@ -387,6 +405,9 @@ set(JSYSTEM_DEBUG_FILES libs/JSystem/src/JUtility/JUTConsole.cpp libs/JSystem/src/JUtility/JUTDirectFile.cpp libs/JSystem/src/JUtility/JUTFontData_Ascfont_fix12.cpp +) + +add_library(JSystem_JStage STATIC libs/JSystem/src/JStage/JSGActor.cpp libs/JSystem/src/JStage/JSGAmbientLight.cpp libs/JSystem/src/JStage/JSGCamera.cpp @@ -394,6 +415,9 @@ set(JSYSTEM_DEBUG_FILES libs/JSystem/src/JStage/JSGLight.cpp libs/JSystem/src/JStage/JSGObject.cpp libs/JSystem/src/JStage/JSGSystem.cpp +) + +add_library(JSystem_J2DGraph STATIC libs/JSystem/src/J2DGraph/J2DGrafContext.cpp libs/JSystem/src/J2DGraph/J2DOrthoGraph.cpp libs/JSystem/src/J2DGraph/J2DTevs.cpp @@ -412,6 +436,9 @@ set(JSYSTEM_DEBUG_FILES libs/JSystem/src/J2DGraph/J2DAnmLoader.cpp libs/JSystem/src/J2DGraph/J2DAnimation.cpp libs/JSystem/src/J2DGraph/J2DManage.cpp +) + +add_library(JSystem_J3DGraphBase STATIC libs/JSystem/src/J3DGraphBase/J3DGD.cpp libs/JSystem/src/J3DGraphBase/J3DSys.cpp libs/JSystem/src/J3DGraphBase/J3DVertex.cpp @@ -426,6 +453,9 @@ set(JSYSTEM_DEBUG_FILES libs/JSystem/src/J3DGraphBase/J3DTevs.cpp libs/JSystem/src/J3DGraphBase/J3DDrawBuffer.cpp libs/JSystem/src/J3DGraphBase/J3DStruct.cpp +) + +add_library(JSystem_J3DGraphAnimator STATIC libs/JSystem/src/J3DGraphAnimator/J3DShapeTable.cpp libs/JSystem/src/J3DGraphAnimator/J3DJointTree.cpp libs/JSystem/src/J3DGraphAnimator/J3DModelData.cpp @@ -437,6 +467,9 @@ set(JSYSTEM_DEBUG_FILES libs/JSystem/src/J3DGraphAnimator/J3DCluster.cpp libs/JSystem/src/J3DGraphAnimator/J3DJoint.cpp libs/JSystem/src/J3DGraphAnimator/J3DMaterialAttach.cpp +) + +add_library(JSystem_J3DGraphLoader STATIC libs/JSystem/src/J3DGraphLoader/J3DMaterialFactory.cpp libs/JSystem/src/J3DGraphLoader/J3DMaterialFactory_v21.cpp libs/JSystem/src/J3DGraphLoader/J3DClusterLoader.cpp @@ -445,6 +478,9 @@ set(JSYSTEM_DEBUG_FILES libs/JSystem/src/J3DGraphLoader/J3DJointFactory.cpp libs/JSystem/src/J3DGraphLoader/J3DShapeFactory.cpp libs/JSystem/src/J3DGraphLoader/J3DAnmLoader.cpp +) + +add_library(JSystem_JStudio STATIC libs/JSystem/src/JStudio/JStudio/ctb.cpp libs/JSystem/src/JStudio/JStudio/ctb-data.cpp libs/JSystem/src/JStudio/JStudio/functionvalue.cpp @@ -459,6 +495,9 @@ set(JSYSTEM_DEBUG_FILES libs/JSystem/src/JStudio/JStudio/stb.cpp libs/JSystem/src/JStudio/JStudio/stb-data-parse.cpp libs/JSystem/src/JStudio/JStudio/stb-data.cpp +) + +add_library(JSystem_JStudio_JStage STATIC libs/JSystem/src/JStudio/JStudio_JStage/control.cpp libs/JSystem/src/JStudio/JStudio_JStage/object.cpp libs/JSystem/src/JStudio/JStudio_JStage/object-actor.cpp @@ -466,10 +505,19 @@ set(JSYSTEM_DEBUG_FILES libs/JSystem/src/JStudio/JStudio_JStage/object-camera.cpp libs/JSystem/src/JStudio/JStudio_JStage/object-fog.cpp libs/JSystem/src/JStudio/JStudio_JStage/object-light.cpp +) + +add_library(JSystem_JStudio_JAudio2 STATIC libs/JSystem/src/JStudio/JStudio_JAudio2/control.cpp libs/JSystem/src/JStudio/JStudio_JAudio2/object-sound.cpp +) + +add_library(JSystem_JStudio_JParticle STATIC libs/JSystem/src/JStudio/JStudio_JParticle/control.cpp libs/JSystem/src/JStudio/JStudio_JParticle/object-particle.cpp +) + +add_library(JSystem_JAudio2 STATIC libs/JSystem/src/JAudio2/JASCalc.cpp libs/JSystem/src/JAudio2/JASTaskThread.cpp libs/JSystem/src/JAudio2/JASDvdThread.cpp @@ -534,22 +582,34 @@ set(JSYSTEM_DEBUG_FILES libs/JSystem/src/JAudio2/JAUSoundAnimator.cpp libs/JSystem/src/JAudio2/JAUSoundTable.cpp libs/JSystem/src/JAudio2/JAUStreamFileTable.cpp +) + +add_library(JSystem_JMessage STATIC libs/JSystem/src/JMessage/control.cpp libs/JSystem/src/JMessage/data.cpp libs/JSystem/src/JMessage/processor.cpp libs/JSystem/src/JMessage/resource.cpp libs/JSystem/src/JMessage/locale.cpp +) + +add_library(JSystem_JGadget STATIC libs/JSystem/src/JGadget/binary.cpp libs/JSystem/src/JGadget/define.cpp libs/JSystem/src/JGadget/linklist.cpp libs/JSystem/src/JGadget/search.cpp libs/JSystem/src/JGadget/std-vector.cpp +) + +add_library(JSystem_JAHostIO STATIC libs/JSystem/src/JAHostIO/JAHFrameNode.cpp libs/JSystem/src/JAHostIO/JAHioMessage.cpp libs/JSystem/src/JAHostIO/JAHioMgr.cpp libs/JSystem/src/JAHostIO/JAHioNode.cpp libs/JSystem/src/JAHostIO/JAHioUtil.cpp libs/JSystem/src/JAHostIO/JAHVirtualNode.cpp +) + +add_library(JSystem_JHostIO STATIC libs/JSystem/src/JHostIO/JORFile.cpp libs/JSystem/src/JHostIO/JORHostInfo.cpp libs/JSystem/src/JHostIO/JORMessageBox.cpp @@ -559,7 +619,28 @@ set(JSYSTEM_DEBUG_FILES libs/JSystem/src/JHostIO/JHIMccBuf.cpp ) -set(JSYSTEM_FILES +set(JSYSTEM_LIBRARIES + JSystem_JParticle + JSystem_JFramework + JSystem_J3DU + JSystem_JKernel + JSystem_JMath + JSystem_JSupport + JSystem_JUtility + JSystem_JStage + JSystem_J2DGraph + JSystem_J3DGraphBase + JSystem_J3DGraphAnimator + JSystem_J3DGraphLoader + JSystem_JStudio + JSystem_JStudio_JStage + JSystem_JStudio_JAudio2 + JSystem_JStudio_JParticle + JSystem_JAudio2 + JSystem_JMessage + JSystem_JGadget + JSystem_JAHostIO + JSystem_JHostIO ) set(REL_FILES @@ -1341,13 +1422,13 @@ set(DUSK_FILES src/dusk/crash_reporting.cpp src/dusk/endian.cpp src/dusk/extras.c - src/dusk/extras.cpp src/dusk/file_select.cpp src/dusk/file_select.hpp src/dusk/frame_interpolation.cpp src/dusk/game_clock.cpp src/dusk/globals.cpp src/dusk/gyro.cpp + src/dusk/gamepad_color.cpp src/dusk/io.cpp src/dusk/layout.cpp src/dusk/logging.cpp diff --git a/include/d/d_menu_ring.h b/include/d/d_menu_ring.h index 39d29a35e8..74624eac80 100644 --- a/include/d/d_menu_ring.h +++ b/include/d/d_menu_ring.h @@ -206,6 +206,15 @@ private: /* 0x6D3 */ u8 field_0x6d3; #if TARGET_PC f32 mSelectItemSlideElapsed[4]; + f32 mCursorInterpPrevX; + f32 mCursorInterpPrevY; + f32 mCursorInterpCurrX; + f32 mCursorInterpCurrY; + s16 mCursorInterpPrevAngle; + s16 mCursorInterpCurrAngle; + bool mCursorInterpPrevAngular; + bool mCursorInterpCurrAngular; + bool mCursorInterpInit; #endif }; diff --git a/include/d/d_select_cursor.h b/include/d/d_select_cursor.h index 1bd5991d16..1ca226611b 100644 --- a/include/d/d_select_cursor.h +++ b/include/d/d_select_cursor.h @@ -48,6 +48,9 @@ public: } #ifdef TARGET_PC + f32 getPositionX() const { return mPositionX; } + f32 getPositionY() const { return mPositionY; } + void refreshAspectScale(); #endif diff --git a/include/dusk/gamepad_color.h b/include/dusk/gamepad_color.h new file mode 100644 index 0000000000..c7cfc1e716 --- /dev/null +++ b/include/dusk/gamepad_color.h @@ -0,0 +1,8 @@ +#pragma once + +#ifndef GAMEPAD_COLOR_H +#define GAMEPAD_COLOR_H + +void handleGamepadColor(); + +#endif \ No newline at end of file diff --git a/include/dusk/settings.h b/include/dusk/settings.h index 145212b0a9..039e51af7d 100644 --- a/include/dusk/settings.h +++ b/include/dusk/settings.h @@ -69,6 +69,8 @@ struct UserSettings { ConfigVar invertCameraXAxis; ConfigVar disableMainHUD; ConfigVar pauseOnFocusLost; + ConfigVar enableLinkDollRotation; + // Graphics ConfigVar bloomMode; @@ -125,6 +127,7 @@ struct UserSettings { ConfigVar wasPresetChosen; ConfigVar enableCrashReporting; ConfigVar duskMenuOpen; + ConfigVar cardFileType; } backend; }; diff --git a/include/global.h b/include/global.h index c1a06c49b1..8cc1b55743 100644 --- a/include/global.h +++ b/include/global.h @@ -73,6 +73,9 @@ #endif #ifndef __MWERKS__ +#ifdef __cplusplus +extern "C" { +#endif // Silence clangd errors about MWCC PPC intrinsics by declaring them here. extern int __cntlzw(unsigned int); extern int __rlwimi(int, int, int, int, int); @@ -80,7 +83,14 @@ extern void __dcbf(void*, int); extern void __dcbz(void*, int); extern void __sync(); extern int __abs(int); -void* __memcpy(void*, const void*, int); +#if defined(__has_builtin) && __has_builtin(__builtin_memcpy) +#define __memcpy __builtin_memcpy +#else +#define __memcpy memcpy +#endif +#ifdef __cplusplus +} +#endif #endif #ifndef M_PI diff --git a/libs/JSystem/include/JSystem/JUtility/JUTGamePad.h b/libs/JSystem/include/JSystem/JUtility/JUTGamePad.h index 30bf685700..45e7227fe3 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTGamePad.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTGamePad.h @@ -263,6 +263,9 @@ public: /* 0x9C */ u8 field_0x9c[4]; /* 0xA0 */ OSTime mResetHoldStartTime; /* 0xA8 */ u8 field_0xa8; +#if TARGET_PC + u32 mResetHoldFrameCount; +#endif }; /** diff --git a/libs/JSystem/src/JUtility/JUTGamePad.cpp b/libs/JSystem/src/JUtility/JUTGamePad.cpp index 091cc382d1..2ddf4397dc 100644 --- a/libs/JSystem/src/JUtility/JUTGamePad.cpp +++ b/libs/JSystem/src/JUtility/JUTGamePad.cpp @@ -64,6 +64,9 @@ BOOL JUTGamePad::init() { void JUTGamePad::clear() { mButtonReset.mReset = false; field_0xa8 = 1; +#if TARGET_PC + mResetHoldFrameCount = 0; +#endif } PADStatus JUTGamePad::mPadStatus[4]; @@ -219,11 +222,19 @@ void JUTGamePad::update() { mButtonReset.mReset = false; } else if (!JUTGamePad::C3ButtonReset::sResetOccurred) { if (mButtonReset.mReset == true) { +#if TARGET_PC + checkResetCallback(++mResetHoldFrameCount * (OS_TIMER_CLOCK / 30)); +#else OSTime hold_time = OSGetTime() - mResetHoldStartTime; checkResetCallback(hold_time); +#endif } else { mButtonReset.mReset = true; +#if TARGET_PC + mResetHoldFrameCount = 0; +#else mResetHoldStartTime = OSGetTime(); +#endif } } diff --git a/src/d/actor/d_a_alink_dusk.cpp b/src/d/actor/d_a_alink_dusk.cpp index 0f442aff94..d53476aa91 100644 --- a/src/d/actor/d_a_alink_dusk.cpp +++ b/src/d/actor/d_a_alink_dusk.cpp @@ -41,7 +41,7 @@ void daAlink_c::handleWolfHowl() { return; } - bool canTransform = false; + bool canHowl = false; if (mLinkAcch.ChkGroundHit() && !checkModeFlg(MODE_PLAYER_FLY) && !checkMagneBootsOn()) { if (!checkForestOldCentury()) { @@ -52,12 +52,17 @@ void daAlink_c::handleWolfHowl() { (checkEventRun() || getMidnaActor()->checkMetamorphoseEnable()) && (checkModeFlg(4) || dComIfGp_checkPlayerStatus0(0, 0x10)))) { - canTransform = true; + canHowl = true; } } } } + if (!canHowl) { + Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + return; + } + getWolfHowlMgrP()->setCorrectCurve(9); procWolfHowlDemoInit(); } diff --git a/src/d/actor/d_a_alink_wolf.inc b/src/d/actor/d_a_alink_wolf.inc index 0a6da841c5..b2e60aea01 100644 --- a/src/d/actor/d_a_alink_wolf.inc +++ b/src/d/actor/d_a_alink_wolf.inc @@ -149,6 +149,23 @@ void daAlink_c::changeWolf() { mpLinkModel = initModel(static_cast(dComIfG_getObjectRes(l_wArcName, 14)), 0x20200); +#ifdef TARGET_PC + // Update Wolf Link's eye maxLOD to prevent the eyes from disappearing + { + J3DTexture* tex = mpLinkModel->getModelData()->getTexture(); + JUTNameTab* nametable = mpLinkModel->getModelData()->getTextureName(); + if (tex != nullptr && nametable != nullptr) { + for (u16 i = 0; i < tex->getNum(); i++) { + const char* tex_name = nametable->getName(i); + if (tex_name != NULL && strcmp(tex_name, "wl_eyeball") == 0) { + ResTIMG* timg = tex->getResTIMG(i); + timg->maxLOD = 0; + } + } + } + } +#endif + J3DModelData* chainModelData = static_cast(dComIfG_getObjectRes(l_wArcName, 15)); for (u16 i = 0; i < 4; i++) { mpWlChainModels[i] = initModel(chainModelData, 0); @@ -162,6 +179,23 @@ void daAlink_c::changeWolf() { mpWlMidnaHairModel = initModelEnv(static_cast(dComIfG_getObjectRes(l_wArcName, 11)), 0x1000000); +#ifdef TARGET_PC + // Update Midna's eye maxLOD to prevent the eyes from disappearing + { + J3DTexture* tex = mpWlMidnaModel->getModelData()->getTexture(); + JUTNameTab* nametable = mpWlMidnaModel->getModelData()->getTextureName(); + if (tex != nullptr && nametable != nullptr) { + for (u16 i = 0; i < tex->getNum(); i++) { + const char* tex_name = nametable->getName(i); + if (tex_name != NULL && strcmp(tex_name, "midona_eyeball") == 0) { + ResTIMG* timg = tex->getResTIMG(i); + timg->maxLOD = 0; + } + } + } + } +#endif + mpDMidnaBrk = static_cast(dComIfG_getObjectRes(l_wArcName, 18)); mpDMidnaBrk->searchUpdateMaterialID(mpWlMidnaModel->getModelData()); mpWlMidnaModel->getModelData()->entryTevRegAnimator(mpDMidnaBrk); @@ -342,6 +376,26 @@ void daAlink_c::changeLink(int param_0) { initModel(static_cast(dComIfG_getObjectRes(mArcName, "zl_face.bmd")), 0x20200); } +#ifdef TARGET_PC + // Update Adult Link's eye maxLOD to prevent the eyes from disappearing + { + J3DTexture* tex = mpLinkFaceModel->getModelData()->getTexture(); + JUTNameTab* nametable = mpLinkFaceModel->getModelData()->getTextureName(); + if (tex != nullptr && nametable != nullptr) { + for (u16 i = 0; i < tex->getNum(); i++) { + const char* tex_name = nametable->getName(i); + if (tex_name != nullptr && + (strcmp(tex_name, "al_eyeball") == 0 || strcmp(tex_name, "highlight02") == 0 || + strcmp(tex_name, "eye_kage01") == 0)) + { + ResTIMG* timg = tex->getResTIMG(i); + timg->maxLOD = 0; + } + } + } + } +#endif + modelData = static_cast(dComIfG_getObjectRes(mArcName, "al_bootsH.bmd")); u16 i; for (i = 0; i < 2; i++) { diff --git a/src/d/d_map_path.cpp b/src/d/d_map_path.cpp index 916bd2c223..8288a2ef9f 100644 --- a/src/d/d_map_path.cpp +++ b/src/d/d_map_path.cpp @@ -237,6 +237,13 @@ void dDrawPath_c::rendering(dDrawPath_c::line_class const* p_line) { if (isDrawType(p_line->field_0x0)) { int width = getLineWidth(p_line->field_0x1); + #if TARGET_PC + f32 height = JUTVideo::getManager()->getRenderHeight() / 448.0f; + if (height > 1.0f) { + width /= 2; + } + #endif + if (width > 0 && p_line->mDataNum >= 2) { GXSetLineWidth(width, GX_TO_ZERO); GXSetTevColor(GX_TEVREG0, *getLineColor(p_line->field_0x0 & 0x3F, p_line->field_0x1)); diff --git a/src/d/d_menu_collect.cpp b/src/d/d_menu_collect.cpp index 46c9c1a9d9..612806d372 100644 --- a/src/d/d_menu_collect.cpp +++ b/src/d/d_menu_collect.cpp @@ -2399,6 +2399,13 @@ void dMenu_Collect3D_c::_move(u8 param_0, u8 param_1) { posZ = 550.0f; } toItem3Dpos(linkPos.x, posY, posZ, &itemPos); + +#if TARGET_PC + if (dusk::getSettings().game.enableLinkDollRotation) { + const f32 angle = mDoCPd_c::getSubStickX3D(PAD_1) * 2048; + ANGLE_ADD(mLinkAngle, angle); + } else +#endif if (param_0 == 0 && param_1 == 0) { f32 temp = 450.0f; ANGLE_ADD(mLinkAngle, temp); diff --git a/src/d/d_menu_ring.cpp b/src/d/d_menu_ring.cpp index 529597248a..ba2b86b760 100644 --- a/src/d/d_menu_ring.cpp +++ b/src/d/d_menu_ring.cpp @@ -185,6 +185,17 @@ dMenu_Ring_c::dMenu_Ring_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i field_0x682 = 0xc000; break; } +#if TARGET_PC + mCursorInterpPrevX = 0.0f; + mCursorInterpPrevY = 0.0f; + mCursorInterpCurrX = 0.0f; + mCursorInterpCurrY = 0.0f; + mCursorInterpPrevAngle = 0; + mCursorInterpCurrAngle = 0; + mCursorInterpPrevAngular = false; + mCursorInterpCurrAngular = false; + mCursorInterpInit = false; +#endif for (int i = 0; i < 4; i++) { field_0x674[i] = 0; #if TARGET_PC @@ -631,7 +642,71 @@ void dMenu_Ring_c::_draw() { } else { drawSelectItem(); drawItem2(); +#if TARGET_PC + f32 simX = 0.0f; + f32 simY = 0.0f; + bool restoreSimPos = false; + if (dusk::frame_interp::is_enabled() && mAlphaRate >= 1.0f) { + simX = mpDrawCursor->getPositionX(); + simY = mpDrawCursor->getPositionY(); + + const bool isAngular = (mStatus == STATUS_MOVE) && !mDirectSelectActive; + + if (dusk::frame_interp::get_ui_tick_pending()) { + mCursorInterpPrevX = mCursorInterpCurrX; + mCursorInterpPrevY = mCursorInterpCurrY; + mCursorInterpPrevAngle = mCursorInterpCurrAngle; + mCursorInterpPrevAngular = mCursorInterpCurrAngular; + + mCursorInterpCurrX = simX; + mCursorInterpCurrY = simY; + mCursorInterpCurrAngle = field_0x66e; + mCursorInterpCurrAngular = isAngular; + + // reset prev = curr for first render pass or + // when angle modes prev/curr differ + // to prevent arrival jitter + if (!mCursorInterpInit || + mCursorInterpPrevAngular != mCursorInterpCurrAngular) { + mCursorInterpPrevX = mCursorInterpCurrX; + mCursorInterpPrevY = mCursorInterpCurrY; + mCursorInterpPrevAngle = mCursorInterpCurrAngle; + mCursorInterpPrevAngular = mCursorInterpCurrAngular; + mCursorInterpInit = true; + } + } + if (mCursorInterpInit) { + const f32 step = dusk::frame_interp::get_interpolation_step(); + if (mCursorInterpPrevAngular && mCursorInterpCurrAngular) { + const s16 delta = mCursorInterpCurrAngle - mCursorInterpPrevAngle; + const s16 lerpedAngle = mCursorInterpPrevAngle + (s16)(delta * step); + + // yoinked from stick_move_proc() + const f32 x = g_ringHIO.mItemRingPosX + FB_WIDTH_BASE / 2 + + mRingRadiusH * cM_ssin(lerpedAngle); + const f32 y = g_ringHIO.mItemRingPosY + FB_HEIGHT_BASE / 2 + + mRingRadiusV * cM_scos(lerpedAngle); + mpDrawCursor->setPos(x, y); + } else { + mpDrawCursor->setPos( + mCursorInterpPrevX + (mCursorInterpCurrX - mCursorInterpPrevX) * step, + mCursorInterpPrevY + (mCursorInterpCurrY - mCursorInterpPrevY) * step + ); + } + restoreSimPos = true; + } + } else { + mCursorInterpInit = false; + } +#endif mpDrawCursor->draw(); +#if TARGET_PC + // prevents offsetting at destination on the next frame + // since stick_wait_proc doesn't call setPos and we clobbered mPositionX/Y + if (restoreSimPos) { + mpDrawCursor->setPos(simX, simY); + } +#endif mpItemExplain->trans(mCenterPosX, mCenterPosY); mpItemExplain->draw((J2DOrthoGraph*)grafPort); drawFlag0(); diff --git a/src/d/d_msg_class.cpp b/src/d/d_msg_class.cpp index 37085a6bb9..7af18f0732 100644 --- a/src/d/d_msg_class.cpp +++ b/src/d/d_msg_class.cpp @@ -1987,6 +1987,13 @@ bool jmessage_tSequenceProcessor::do_isReady() { } #endif +#if TARGET_PC + if (dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) { + field_0xb2 = 1; + pReference->setSendTimer(0); + } +#endif + if (dComIfGp_checkMesgBgm()) { bool isItemMusicPlaying = true; if (mDoAud_checkPlayingSubBgmFlag() != Z2BGM_ITEM_GET && diff --git a/src/dusk/extras.c b/src/dusk/extras.c index e693985479..a1fb26e998 100644 --- a/src/dusk/extras.c +++ b/src/dusk/extras.c @@ -3,6 +3,27 @@ #include #include +#ifdef _MSC_VER +#include +#endif + +void __dcbz(void* addr, int offset) { + // Gekko cache lines are 32 bytes. + // dcbz usually requires addr to be 32-byte aligned. + memset((char*)addr + offset, 0, 32); +} + +int __cntlzw(unsigned int val) { + if (val == 0) return 32; // PowerPC returns 32 if the input is 0 +#ifdef _MSC_VER + unsigned long idx; + _BitScanReverse(&idx, val); + return 31 - (int)idx; +#else + return __builtin_clz(val); +#endif +} + #ifndef _MSC_VER int stricmp(const char* str1, const char* str2) { char a_var; @@ -48,11 +69,6 @@ int strnicmp(const char* str1, const char* str2, int n) { } #endif - -void *_memcpy(void* dest, void const* src, int n) { - return memcpy(dest, src, n); -} - void DCZeroRange(void* addr, uint32_t nBytes) { #if defined(_MSC_VER) || TARGET_ANDROID memset(addr, 0, nBytes); diff --git a/src/dusk/extras.cpp b/src/dusk/extras.cpp deleted file mode 100644 index de402f028b..0000000000 --- a/src/dusk/extras.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// C++ Mangled version of extras.c -#include -#include -#ifdef _MSC_VER -#include -#endif - -void *__memcpy(void* dest, void const* src, int n) { - return memcpy(dest, src, n); -} - -void __dcbz(void* addr, int offset) { - // Gekko cache lines are 32 bytes. - // dcbz usually requires addr to be 32-byte aligned. - memset((char*)addr + offset, 0, 32); -} - -int __cntlzw(unsigned int val) { - if (val == 0) return 32; // PowerPC returns 32 if the input is 0 -#ifdef _MSC_VER - unsigned long idx; - _BitScanReverse(&idx, val); - return 31 - (int)idx; -#else - return __builtin_clz(val); -#endif -} diff --git a/src/dusk/gamepad_color.cpp b/src/dusk/gamepad_color.cpp new file mode 100644 index 0000000000..cba32da632 --- /dev/null +++ b/src/dusk/gamepad_color.cpp @@ -0,0 +1,106 @@ +#include +#include +#include +#include +#include +#include + +cXyz currentGamepadColor = {0, 0, 0}; +cXyz finalGamepadColor = {0, 0, 0}; +cXyz additionalGamepadColor = {0, 0, 0}; + +float lerpSpeed = 0.0f; + +const cXyz duskColor = {50, 50, -50}; +const cXyz noColor = {0, 0, 0}; + +cXyz LerpColor(cXyz a, cXyz b, float t) { + return {std::lerp(a.x, b.x, t), std::lerp(a.y, b.y, t), std::lerp(a.z, b.z, t)}; +} + +void FadeLED(cXyz newColor, float speed) { + finalGamepadColor = newColor; + lerpSpeed = speed / 30.0f; +} + +void SetLED(cXyz newColor) { + currentGamepadColor = newColor; + finalGamepadColor = newColor; +} + +void SetGamepadAdditionalColor(cXyz addColor) { + additionalGamepadColor.x = addColor.x; + additionalGamepadColor.y = addColor.y; + additionalGamepadColor.z = addColor.z; +} + +void handleGamepadColor() { + bool setColor = false; + + fopAc_ac_c* zhint = dComIfGp_att_getZHint(); + if (zhint != NULL) { + FadeLED({50, 50, 175}, 2.0f); + setColor = true; + } + + daPy_py_c* player = daPy_getPlayerActorClass(); + daAlink_c* link = daAlink_getAlinkActorClass(); + + if (link != nullptr && !setColor) { + if (link->checkWolf()) { + FadeLED({115, 115, 75}, 5.0f); + setColor = true; + } else { + switch (dComIfGs_getSelectEquipClothes()) { + case dItemNo_WEAR_KOKIRI_e: + FadeLED({0, 100, 0}, 5.0f); + setColor = true; + break; + case dItemNo_WEAR_ZORA_e: + FadeLED({0, 0, 100}, 5.0f); + setColor = true; + break; + case dItemNo_ARMOR_e: + if (link->checkMagicArmorHeavy()) { + FadeLED({5, 100, 100}, 5.0f); + } else { + FadeLED({100, 0, 5}, 5.0f); + } + setColor = true; + break; + case dItemNo_WEAR_CASUAL_e: + FadeLED({235, 230, 115}, 5.0f); + setColor = true; + break; + } + } + } + + if (dKy_darkworld_check()) { + SetGamepadAdditionalColor(duskColor); + } else { + SetGamepadAdditionalColor(noColor); + } + + f32 finalRed = finalGamepadColor.x + additionalGamepadColor.x; + f32 finalGreen = finalGamepadColor.y + additionalGamepadColor.y; + f32 finalBlue = finalGamepadColor.z + additionalGamepadColor.z; + + if (finalRed > 255) + finalRed = 255; + if (finalRed < 0) + finalRed = 0; + + if (finalGreen > 255) + finalGreen = 255; + if (finalGreen < 0) + finalGreen = 0; + + if (finalBlue > 255) + finalBlue = 255; + if (finalBlue < 0) + finalBlue = 0; + + currentGamepadColor = LerpColor(currentGamepadColor, cXyz{finalRed, finalGreen, finalBlue}, lerpSpeed); + PADSetColor(PAD_CHAN0, (u8)currentGamepadColor.x, (u8)currentGamepadColor.y, (u8)currentGamepadColor.z); +} \ No newline at end of file diff --git a/src/dusk/imgui/ImGuiMenuGame.cpp b/src/dusk/imgui/ImGuiMenuGame.cpp index c55836c68d..7e54f2ffa3 100644 --- a/src/dusk/imgui/ImGuiMenuGame.cpp +++ b/src/dusk/imgui/ImGuiMenuGame.cpp @@ -191,6 +191,11 @@ namespace dusk { ImGui::SetTooltip("Restores patched glitches from Wii USA 1.0,\n" "the first released version."); } + + config::ImGuiCheckbox("Enable Rotating Link Doll", getSettings().game.enableLinkDollRotation); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Enables rotating Link in the collection menu with the C-Stick"); + } ImGui::SeparatorText("Difficulty"); diff --git a/src/dusk/imgui/ImGuiPreLaunchWindow.cpp b/src/dusk/imgui/ImGuiPreLaunchWindow.cpp index ecbd41e158..2727e78718 100644 --- a/src/dusk/imgui/ImGuiPreLaunchWindow.cpp +++ b/src/dusk/imgui/ImGuiPreLaunchWindow.cpp @@ -46,6 +46,17 @@ static std::string ShowIsoInvalidError(const iso::ValidationError code) { } } +static std::string_view card_type_name(CARDFileType type) { + switch (type) { + case CARD_GCIFOLDER: + return "GCI Folder"sv; + case CARD_RAWIMAGE: + return "Card Image"sv; + default: + return ""sv; + } +} + void fileDialogCallback(void* userdata, const char* path, const char* error) { auto* self = static_cast(userdata); if (error != nullptr) { @@ -216,6 +227,23 @@ void ImGuiPreLaunchWindow::drawOptions() { if (configuredBackendId != m_initialGraphicsBackend) { ImGui::TextDisabled("Restart Required"); } + auto curFileType = (CARDFileType)getSettings().backend.cardFileType.getValue(); + + if (ImGui::BeginCombo("Save File Type", card_type_name(curFileType).data())) { + + if (ImGui::Selectable("GCI Folder", curFileType == CARD_GCIFOLDER)) { + getSettings().backend.cardFileType.setValue(CARD_GCIFOLDER); + config::Save(); + } + + if (ImGui::Selectable("Card Image", curFileType == CARD_RAWIMAGE)) { + getSettings().backend.cardFileType.setValue(CARD_RAWIMAGE); + config::Save(); + } + + ImGui::EndCombo(); + } + ImGui::EndChild(); } diff --git a/src/dusk/imgui/ImGuiSaveEditor.cpp b/src/dusk/imgui/ImGuiSaveEditor.cpp index 5802c07b47..eced44c7f7 100644 --- a/src/dusk/imgui/ImGuiSaveEditor.cpp +++ b/src/dusk/imgui/ImGuiSaveEditor.cpp @@ -10,6 +10,7 @@ #include "d/d_item_data.h" #include "d/d_meter2_info.h" #include "d/d_save.h" +#include "d/actor/d_a_player.h" #include @@ -579,20 +580,21 @@ namespace dusk { if (ImGui::BeginCombo("Clothes", itemMap.find(statusA.mSelectEquip[0])->second.m_name.c_str())) { - if (ImGui::Selectable("None")) { - statusA.mSelectEquip[0] = dItemNo_NONE_e; - } if (ImGui::Selectable("Ordon Clothes")) { - statusA.mSelectEquip[0] = dItemNo_WEAR_CASUAL_e; + dMeter2Info_setCloth(dItemNo_WEAR_CASUAL_e, false); + daPy_getPlayerActorClass()->setClothesChange(0); } if (ImGui::Selectable("Hero's Clothes")) { - statusA.mSelectEquip[0] = dItemNo_WEAR_KOKIRI_e; + dMeter2Info_setCloth(dItemNo_WEAR_KOKIRI_e, false); + daPy_getPlayerActorClass()->setClothesChange(0); } if (ImGui::Selectable("Zora Armor")) { - statusA.mSelectEquip[0] = dItemNo_WEAR_ZORA_e; + dMeter2Info_setCloth(dItemNo_WEAR_ZORA_e, false); + daPy_getPlayerActorClass()->setClothesChange(0); } if (ImGui::Selectable("Magic Armor")) { - statusA.mSelectEquip[0] = dItemNo_ARMOR_e; + dMeter2Info_setCloth(dItemNo_ARMOR_e, false); + daPy_getPlayerActorClass()->setClothesChange(0); } ImGui::EndCombo(); } @@ -1489,11 +1491,11 @@ namespace dusk { } ImGui::TableNextColumn(); - ImGui::Text(e.flagName.c_str()); + ImGuiStringViewText(e.flagName); ImGui::TableNextColumn(); - ImGui::Text(e.location.c_str()); + ImGuiStringViewText(e.location); ImGui::TableNextColumn(); - ImGui::Text(e.description.c_str()); + ImGuiStringViewText(e.description); } ImGui::EndTable(); } diff --git a/src/dusk/settings.cpp b/src/dusk/settings.cpp index 28397f80f2..3e6ee733fe 100644 --- a/src/dusk/settings.cpp +++ b/src/dusk/settings.cpp @@ -43,6 +43,7 @@ UserSettings g_userSettings = { .invertCameraXAxis {"game.invertCameraXAxis", false}, .disableMainHUD {"game.disableMainHUD", false}, .pauseOnFocusLost {"game.pauseOnFocusLost", false}, + .enableLinkDollRotation = {"game.enableLinkDollRotation", false }, // Graphics .bloomMode {"game.bloomMode", BloomMode::Classic}, @@ -98,7 +99,8 @@ UserSettings g_userSettings = { .showPipelineCompilation {"backend.showPipelineCompilation", false}, .wasPresetChosen {"backend.wasPresetChosen", false}, .enableCrashReporting {"backend.enableCrashReporting", true}, - .duskMenuOpen {"backend.duskMenuOpen", false} + .duskMenuOpen {"backend.duskMenuOpen", false}, + .cardFileType {"backend.cardFileType", static_cast(CARD_GCIFOLDER)} } }; @@ -150,6 +152,7 @@ void registerSettings() { Register(g_userSettings.game.canTransformAnywhere); Register(g_userSettings.game.freeMagicArmor); Register(g_userSettings.game.restoreWiiGlitches); + Register(g_userSettings.game.enableLinkDollRotation); Register(g_userSettings.game.noMissClimbing); Register(g_userSettings.game.noLowHpSound); Register(g_userSettings.game.midnasLamentNonStop); @@ -183,6 +186,7 @@ void registerSettings() { Register(g_userSettings.backend.wasPresetChosen); Register(g_userSettings.backend.enableCrashReporting); Register(g_userSettings.backend.duskMenuOpen); + Register(g_userSettings.backend.cardFileType); } // Transient settings diff --git a/src/f_ap/f_ap_game.cpp b/src/f_ap/f_ap_game.cpp index 6d9c5a22bd..0c02ad4df3 100644 --- a/src/f_ap/f_ap_game.cpp +++ b/src/f_ap/f_ap_game.cpp @@ -24,6 +24,7 @@ #include "m_Do/m_Do_graphic.h" #include "m_Do/m_Do_main.h" #include "tracy/Tracy.hpp" +#include fapGm_HIO_c::fapGm_HIO_c() { mUsingHostIO = true; @@ -735,6 +736,8 @@ static void fapGm_AfterRecord() { } static void duskExecute() { + handleGamepadColor(); + if (mDoCPd_c::getHoldR(PAD_1) && mDoCPd_c::getTrigX(PAD_1)) { if (const auto link = g_dComIfG_gameInfo.play.getPlayer(0)) { dynamic_cast(link)->handleWolfHowl(); diff --git a/src/m_Do/m_Do_MemCard.cpp b/src/m_Do/m_Do_MemCard.cpp index a0c0302b09..5cb612f128 100644 --- a/src/m_Do/m_Do_MemCard.cpp +++ b/src/m_Do/m_Do_MemCard.cpp @@ -77,6 +77,8 @@ static OSThread MemCardThread; void mDoMemCd_Ctrl_c::ThdInit() { #if !PLATFORM_SHIELD + CARDSetLoadType((CARDFileType)dusk::getSettings().backend.cardFileType.getValue()); + CARDInit(DUSK_GAME_NAME, DUSK_GAME_VERSION); #endif diff --git a/src/m_Do/m_Do_graphic.cpp b/src/m_Do/m_Do_graphic.cpp index 4dc505ac03..425d1e25fe 100644 --- a/src/m_Do/m_Do_graphic.cpp +++ b/src/m_Do/m_Do_graphic.cpp @@ -1029,15 +1029,8 @@ static void drawDepth2(view_class* param_0, view_port_class* param_1, int param_ GX_FALSE, 0); } - #if TARGET_PC - // use full size for pc for higher quality background elements - u16 halfWidth = width; - u16 halfHeight = height; - #else u16 halfWidth = width >> 1; u16 halfHeight = height >> 1; - #endif - GXRenderModeObj* sp24 = JUTGetVideoManager()->getRenderMode(); GXSetCopyFilter(GX_FALSE, NULL, GX_TRUE, sp24->vfilter); GXSetTexCopySrc(x_orig, y_orig_pos, width, height);