From c93d564548667ea3cdcadc488d5ef946e4807751 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Tue, 15 Aug 2023 19:16:33 +0300 Subject: [PATCH 01/10] Update readme.md --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index beb880eb..783c8066 100644 --- a/readme.md +++ b/readme.md @@ -92,6 +92,7 @@ Panda3DS also supports controller input using the SDL2 GameController API. - [MelonDS](https://github.com/melonDS-emu/melonDS): "DS emulator, sorta" - Arisotura - [Kaizen](https://github.com/SimoneN64/Kaizen): Experimental work-in-progress low-level N64 emulator - [ChonkyStation](https://github.com/liuk7071/ChonkyStation): Work-in-progress PlayStation emulator +- [shadPS4](https://github.com/georgemoralis/shadPS4): Work-in-progress PS4 emulator by the creator of PCSX, PCSX2 and more # Support If you find this project exciting and want to support the founder, check out [his Patreon page](https://www.patreon.com/wheremyfoodat) From 6e165ccaa2f397b8d0e126e791fa539cc36dabe0 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Tue, 15 Aug 2023 19:22:17 +0300 Subject: [PATCH 02/10] Rewording in readme --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 783c8066..acc481a8 100644 --- a/readme.md +++ b/readme.md @@ -92,7 +92,7 @@ Panda3DS also supports controller input using the SDL2 GameController API. - [MelonDS](https://github.com/melonDS-emu/melonDS): "DS emulator, sorta" - Arisotura - [Kaizen](https://github.com/SimoneN64/Kaizen): Experimental work-in-progress low-level N64 emulator - [ChonkyStation](https://github.com/liuk7071/ChonkyStation): Work-in-progress PlayStation emulator -- [shadPS4](https://github.com/georgemoralis/shadPS4): Work-in-progress PS4 emulator by the creator of PCSX, PCSX2 and more +- [shadPS4](https://github.com/georgemoralis/shadPS4): Work-in-progress PS4 emulator by the founder of PCSX, PCSX2 and more # Support If you find this project exciting and want to support the founder, check out [his Patreon page](https://www.patreon.com/wheremyfoodat) From 7426fff00889e856dd9faf66417c46f062307fed Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Thu, 17 Aug 2023 17:33:42 +0300 Subject: [PATCH 03/10] =?UTF-8?q?Turn=20paris=20into=20an=20=CE=91=CE=B4?= =?UTF-8?q?=CE=B5=CF=81=CF=86=CE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index acc481a8..ea9e17bf 100644 --- a/readme.md +++ b/readme.md @@ -93,6 +93,7 @@ Panda3DS also supports controller input using the SDL2 GameController API. - [Kaizen](https://github.com/SimoneN64/Kaizen): Experimental work-in-progress low-level N64 emulator - [ChonkyStation](https://github.com/liuk7071/ChonkyStation): Work-in-progress PlayStation emulator - [shadPS4](https://github.com/georgemoralis/shadPS4): Work-in-progress PS4 emulator by the founder of PCSX, PCSX2 and more +- [Hydra](https://github.com/hydra-emu/hydra): Cross-platform GameBoy, NES, N64 and Chip-8 emulator # Support If you find this project exciting and want to support the founder, check out [his Patreon page](https://www.patreon.com/wheremyfoodat) From 9c6296066e4540428c5f01bd5f3b9b59651b3d0f Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Fri, 18 Aug 2023 18:28:13 +0300 Subject: [PATCH 04/10] Thank you profi for helping me shut up --- src/core/memory.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 39c8520d..7346feec 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -154,6 +154,7 @@ u32 Memory::read32(u32 vaddr) { if (vaddr >= VirtualAddrs::VramStart && vaddr < VirtualAddrs::VramStart + VirtualAddrs::VramSize) { static int shutUpCounter = 0; if (shutUpCounter < 5) { // Stop spamming about VRAM reads after the first 5 + shutUpCounter++; Helpers::warn("VRAM read!\n"); } From 80b7ffc9d4167429f87e525f0d0682f9ac66516c Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sat, 19 Aug 2023 18:24:05 +0300 Subject: [PATCH 05/10] Update readme.md --- readme.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 6be15a08..9e74f55e 100644 --- a/readme.md +++ b/readme.md @@ -20,7 +20,7 @@ You can download stable builds from the Releases tab, or you can download the la |Linux build|[![Linux Build](https://github.com/wheremyfoodat/Panda3DS/actions/workflows/Linux_Build.yml/badge.svg?branch=master)](https://github.com/wheremyfoodat/Panda3DS/actions/workflows/Linux_Build.yml)|[Linux Executable](https://nightly.link/wheremyfoodat/Panda3DS/workflows/Linux_Build/master/Linux%20executable.zip)| # Compatibility -Panda3DS is still in the early stages of development. Many games boot, many don't. Most games have at least some hilariously broken graphics, audio is not supported, performance leaves a bit to be desired mainly thanks to lack of shader acceleration, and most QoL features (including a GUI) are missing. +Panda3DS is still in the early stages of development. Many games boot, many don't. Most games have at least some hilariously broken graphics, audio is not supported, and some QoL features (including a GUI) are missing. In addition, some games don't quiiite work with the upstream code. A lot of them might need some panics in the source code to be commented out before they work, etc. However, just the fact things can work as well as they do now is promising in itself. @@ -80,6 +80,9 @@ Keyboard & Mouse - Select button Backspace - Touch Screen Left click - Gyroscope Hold right click and swipe your mouse left and right (support is kind of shaky atm, but games that require gyro here and there like Kirby should work) +- Pause F4 +- Reload F5 + Panda3DS also supports controller input using the SDL2 GameController API. From bb1553505780e5b9a8404876eb5698cd935bf734 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sat, 19 Aug 2023 18:24:29 +0300 Subject: [PATCH 06/10] Update readme.md --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 9e74f55e..a820dc3a 100644 --- a/readme.md +++ b/readme.md @@ -80,8 +80,8 @@ Keyboard & Mouse - Select button Backspace - Touch Screen Left click - Gyroscope Hold right click and swipe your mouse left and right (support is kind of shaky atm, but games that require gyro here and there like Kirby should work) -- Pause F4 -- Reload F5 +- Pause/Resume F4 +- Reload F5 Panda3DS also supports controller input using the SDL2 GameController API. From 14784403c4b2cd038e7726c35944fc637bb16be1 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sat, 19 Aug 2023 19:35:04 +0300 Subject: [PATCH 07/10] Disable Discord RPC on Android --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 447f19da..906e8d7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,7 +55,7 @@ add_compile_definitions(NOMINMAX) # Make windows.h not define min/ma add_compile_definitions(WIN32_LEAN_AND_MEAN) # Make windows.h not include literally everything add_compile_definitions(SDL_MAIN_HANDLED) -if(ENABLE_DISCORD_RPC) +if(ENABLE_DISCORD_RPC AND NOT ANDROID) add_subdirectory(third_party/discord-rpc) include_directories(third_party/discord-rpc/include) endif() @@ -277,7 +277,7 @@ endif() target_link_libraries(Alber PRIVATE dynarmic SDL2-static cryptopp glad) -if(ENABLE_DISCORD_RPC) +if(ENABLE_DISCORD_RPC AND NOT ANDROID) target_compile_definitions(Alber PUBLIC "PANDA3DS_ENABLE_DISCORD_RPC=1") target_link_libraries(Alber PRIVATE discord-rpc) endif() From 2e5dc5da07b9955c7860c6e5025742c9a03f4ac1 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sat, 19 Aug 2023 20:41:23 +0300 Subject: [PATCH 08/10] Set MacOS deployment target & vendor discord-rpc --- .gitmodules | 2 +- CMakeLists.txt | 1 + third_party/discord-rpc | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 1fb0fcca..af704c7d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -33,4 +33,4 @@ url = https://github.com/g-truc/glm [submodule "third_party/discord-rpc"] path = third_party/discord-rpc - url = https://github.com/discord/discord-rpc + url = https://github.com/Panda3DS-emu/discord-rpc diff --git a/CMakeLists.txt b/CMakeLists.txt index 906e8d7b..14262e65 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ # We need to be able to use enable_language(OBJC) on Mac, so we need CMake 3.16 vs the 3.10 we use otherwise. Blame Apple. if (APPLE) + set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum OS X deployment version") cmake_minimum_required(VERSION 3.16) else() cmake_minimum_required(VERSION 3.10) diff --git a/third_party/discord-rpc b/third_party/discord-rpc index 963aa9f3..e1caa618 160000 --- a/third_party/discord-rpc +++ b/third_party/discord-rpc @@ -1 +1 @@ -Subproject commit 963aa9f3e5ce81a4682c6ca3d136cddda614db33 +Subproject commit e1caa6186a374758692fb764b811155483742a56 From 574fe95bcaa3cb56d916760df3adb4bad389e272 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sun, 20 Aug 2023 02:21:05 +0300 Subject: [PATCH 09/10] Add missing log --- src/core/kernel/threads.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/kernel/threads.cpp b/src/core/kernel/threads.cpp index 2f6a27b9..1c375dcd 100644 --- a/src/core/kernel/threads.cpp +++ b/src/core/kernel/threads.cpp @@ -473,6 +473,7 @@ void Kernel::setThreadPriority() { } void Kernel::getCurrentProcessorNumber() { + logSVC("GetCurrentProcessorNumber()\n"); const ProcessorID id = threads[currentThreadIndex].processorID; s32 ret; @@ -649,4 +650,4 @@ bool Kernel::shouldWaitOnObject(KernelObject* object) { Helpers::panic("Not sure whether to wait on object (type: %s)", object->getTypeName()); return true; } -} \ No newline at end of file +} From 8aa35d209907e9bc0e476d1bdad182953a216928 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sun, 20 Aug 2023 14:18:30 +0300 Subject: [PATCH 10/10] Implement HID::GetSoundVolume --- include/services/hid.hpp | 1 + src/core/services/hid.cpp | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/services/hid.hpp b/include/services/hid.hpp index e10f78f0..28ba4bd6 100644 --- a/include/services/hid.hpp +++ b/include/services/hid.hpp @@ -71,6 +71,7 @@ class HIDService { void getGyroscopeLowCalibrateParam(u32 messagePointer); void getGyroscopeCoefficient(u32 messagePointer); void getIPCHandles(u32 messagePointer); + void getSoundVolume(u32 messagePointer); // Don't call these prior to initializing shared mem pls template diff --git a/src/core/services/hid.cpp b/src/core/services/hid.cpp index 0c83487c..ef6cbb41 100644 --- a/src/core/services/hid.cpp +++ b/src/core/services/hid.cpp @@ -11,7 +11,8 @@ namespace HIDCommands { EnableGyroscopeLow = 0x00130000, DisableGyroscopeLow = 0x00140000, GetGyroscopeLowRawToDpsCoefficient = 0x00150000, - GetGyroscopeLowCalibrateParam = 0x00160000 + GetGyroscopeLowCalibrateParam = 0x00160000, + GetSoundVolume = 0x00170000, }; } @@ -46,6 +47,7 @@ void HIDService::handleSyncRequest(u32 messagePointer) { case HIDCommands::GetGyroscopeLowCalibrateParam: getGyroscopeLowCalibrateParam(messagePointer); break; case HIDCommands::GetGyroscopeLowRawToDpsCoefficient: getGyroscopeCoefficient(messagePointer); break; case HIDCommands::GetIPCHandles: getIPCHandles(messagePointer); break; + case HIDCommands::GetSoundVolume: getSoundVolume(messagePointer); break; default: Helpers::panic("HID service requested. Command: %08X\n", command); } } @@ -107,6 +109,18 @@ void HIDService::getGyroscopeCoefficient(u32 messagePointer) { mem.write32(messagePointer + 8, Helpers::bit_cast(gyroscopeCoeff)); } +// The volume here is in the range [0, 0x3F] +// It is read directly from I2C Device 3 register 0x09 +// Since we currently do not have audio, set the volume a bit below max (0x30) +void HIDService::getSoundVolume(u32 messagePointer) { + log("HID::GetSoundVolume\n"); + constexpr u8 volume = 0x30; + + mem.write32(messagePointer, IPC::responseHeader(0x17, 2, 0)); + mem.write32(messagePointer + 4, Result::Success); + mem.write8(messagePointer + 8, volume); +} + void HIDService::getIPCHandles(u32 messagePointer) { log("HID::GetIPCHandles\n");