mirror of
https://github.com/izzy2lost/WeeU.git
synced 2026-07-06 00:19:59 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0aaf631c4 | ||
|
|
9ebbfb3ae2 | ||
|
|
3869b47c35 | ||
|
|
d303a7f502 | ||
|
|
2461464ba7 | ||
|
|
76c75f767b | ||
|
|
88f63ca373 | ||
|
|
643ac57a30 | ||
|
|
4561a6929c |
+1
-1
@@ -21,7 +21,7 @@ if (ENABLE_VCPKG)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
project(Cemu VERSION 2.0)
|
||||
project(Cemu VERSION 2.0.0)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@ Name=Cemu
|
||||
Type=Application
|
||||
Terminal=false
|
||||
Icon=info.cemu.Cemu
|
||||
Exec=cemu
|
||||
Exec=Cemu
|
||||
GenericName=Wii U Emulator
|
||||
GenericName[fi]=Wii U -emulaattori
|
||||
GenericName[el]=Πρόγραμμα προσομοίωσης Wii U
|
||||
|
||||
@@ -75,6 +75,13 @@ if (MACOS_BUNDLE)
|
||||
set(RESOURCE_FILES "${CMAKE_SOURCE_DIR}/src/resource/cemu.icns")
|
||||
target_sources(CemuBin PRIVATE "${RESOURCE_FILES}")
|
||||
|
||||
set(MACOSX_BUNDLE_ICON_FILE "cemu.icns")
|
||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER "info.cemu.Cemu")
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME "Cemu")
|
||||
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${CMAKE_PROJECT_VERSION})
|
||||
set(MACOSX_BUNDLE_BUNDLE_VERSION ${CMAKE_PROJECT_VERSION})
|
||||
set(MACOSX_BUNDLE_COPYRIGHT "Copyright © 2022 Cemu Project")
|
||||
|
||||
set(MACOSX_BUNDLE_CATEGORY "public.app-category.games")
|
||||
|
||||
set_target_properties(CemuBin PROPERTIES
|
||||
|
||||
@@ -441,7 +441,7 @@ bool fsc_nextDir(FSCVirtualFile* fscFile, FSCDirEntry* dirEntry)
|
||||
/*
|
||||
* Create directory
|
||||
*/
|
||||
bool fsc_createDir(char* path, sint32* fscStatus)
|
||||
bool fsc_createDir(const char* path, sint32* fscStatus)
|
||||
{
|
||||
fscDeviceC* fscDevice = NULL;
|
||||
*fscStatus = FSC_STATUS_UNDEFINED;
|
||||
@@ -461,7 +461,7 @@ bool fsc_createDir(char* path, sint32* fscStatus)
|
||||
/*
|
||||
* Rename file or directory
|
||||
*/
|
||||
bool fsc_rename(char* srcPath, char* dstPath, sint32* fscStatus)
|
||||
bool fsc_rename(const char* srcPath, const char* dstPath, sint32* fscStatus)
|
||||
{
|
||||
std::string srcDevicePath;
|
||||
std::string dstDevicePath;
|
||||
@@ -481,7 +481,7 @@ bool fsc_rename(char* srcPath, char* dstPath, sint32* fscStatus)
|
||||
/*
|
||||
* Delete file or subdirectory
|
||||
*/
|
||||
bool fsc_remove(char* path, sint32* fscStatus)
|
||||
bool fsc_remove(const char* path, sint32* fscStatus)
|
||||
{
|
||||
std::string devicePath;
|
||||
fscDeviceC* fscDevice = NULL;
|
||||
|
||||
@@ -167,9 +167,9 @@ void fsc_unmountAll();
|
||||
|
||||
FSCVirtualFile* fsc_open(const char* path, FSC_ACCESS_FLAG accessFlags, sint32* fscStatus, sint32 maxPriority=FSC_PRIORITY_MAX);
|
||||
FSCVirtualFile* fsc_openDirIterator(const char* path, sint32* fscStatus);
|
||||
bool fsc_createDir(char* path, sint32* fscStatus);
|
||||
bool fsc_rename(char* srcPath, char* dstPath, sint32* fscStatus);
|
||||
bool fsc_remove(char* path, sint32* fscStatus);
|
||||
bool fsc_createDir(const char* path, sint32* fscStatus);
|
||||
bool fsc_rename(const char* srcPath, const char* dstPath, sint32* fscStatus);
|
||||
bool fsc_remove(const char* path, sint32* fscStatus);
|
||||
bool fsc_nextDir(FSCVirtualFile* fscFile, FSCDirEntry* dirEntry);
|
||||
void fsc_close(FSCVirtualFile* fscFile);
|
||||
uint32 fsc_getFileSize(FSCVirtualFile* fscFile);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "util/IniParser/IniParser.h"
|
||||
#include "util/helpers/StringHelpers.h"
|
||||
#include "Cafe/CafeSystem.h"
|
||||
#include <cinttypes>
|
||||
|
||||
std::vector<GraphicPackPtr> GraphicPack2::s_graphic_packs;
|
||||
std::vector<GraphicPackPtr> GraphicPack2::s_active_graphic_packs;
|
||||
@@ -660,7 +661,7 @@ void GraphicPack2::LoadShaders()
|
||||
uint64 shader_base_hash = 0;
|
||||
uint64 shader_aux_hash = 0;
|
||||
wchar_t shader_type[256]{};
|
||||
if (filename.size() < 256 && swscanf(filename.c_str(), L"%I64x_%I64x_%ls", &shader_base_hash, &shader_aux_hash, shader_type) == 3)
|
||||
if (filename.size() < 256 && swscanf(filename.c_str(), L"%" SCNx64 "_%" SCNx64 "_%ls", &shader_base_hash, &shader_aux_hash, shader_type) == 3)
|
||||
{
|
||||
if (shader_type[0] == 'p' && shader_type[1] == 's')
|
||||
m_custom_shaders.emplace_back(LoadShader(p, shader_base_hash, shader_aux_hash, GP_SHADER_TYPE::PIXEL));
|
||||
|
||||
@@ -64,8 +64,8 @@ struct LatteGPUState_t
|
||||
{
|
||||
bool isEnabled;
|
||||
MPTR physPtr;
|
||||
volatile uint32 flipRequestCount;
|
||||
volatile uint32 flipExecuteCount;
|
||||
std::atomic<uint32> flipRequestCount;
|
||||
std::atomic<uint32> flipExecuteCount;
|
||||
}screen[2];
|
||||
}osScreen;
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "util/Zir/EmitterGLSL/ZpIREmitGLSL.h"
|
||||
#include "util/Zir/Core/ZpIRDebug.h"
|
||||
#include "util/containers/flat_hash_map.hpp"
|
||||
#include <cinttypes>
|
||||
|
||||
struct _ShaderHashCache
|
||||
{
|
||||
@@ -294,7 +295,7 @@ void LatteShader_CreateRendererShader(LatteDecompilerShader* shader, bool compil
|
||||
{
|
||||
if (shader->hasError )
|
||||
{
|
||||
forceLog_printf("Unable to compile shader %I64x", shader->baseHash);
|
||||
forceLog_printf("Unable to compile shader %" PRIx64, shader->baseHash);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ bool LatteHandleOSScreen_TV()
|
||||
LatteRenderTarget_copyToBackbuffer(osScreenTVTex[bufferIndexTV]->baseTexture->baseView, false);
|
||||
|
||||
if (LatteGPUState.osScreen.screen[0].flipExecuteCount != LatteGPUState.osScreen.screen[0].flipRequestCount)
|
||||
LatteGPUState.osScreen.screen[0].flipExecuteCount = LatteGPUState.osScreen.screen[0].flipRequestCount;
|
||||
LatteGPUState.osScreen.screen[0].flipExecuteCount.store(LatteGPUState.osScreen.screen[0].flipRequestCount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ bool LatteHandleOSScreen_DRC()
|
||||
LatteRenderTarget_copyToBackbuffer(osScreenDRCTex[bufferIndexDRC]->baseTexture->baseView, true);
|
||||
|
||||
if (LatteGPUState.osScreen.screen[1].flipExecuteCount != LatteGPUState.osScreen.screen[1].flipRequestCount)
|
||||
LatteGPUState.osScreen.screen[1].flipExecuteCount = LatteGPUState.osScreen.screen[1].flipRequestCount;
|
||||
LatteGPUState.osScreen.screen[1].flipExecuteCount.store(LatteGPUState.osScreen.screen[1].flipRequestCount);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -548,6 +548,9 @@ void OpenGLRenderer::DrawBackbufferQuad(LatteTextureView* texView, RendererOutpu
|
||||
renderstate_resetDepthControl();
|
||||
attributeStream_reset();
|
||||
|
||||
// bind back buffer
|
||||
rendertarget_bindFramebufferObject(nullptr);
|
||||
|
||||
if (clearBackground)
|
||||
{
|
||||
int windowWidth, windowHeight;
|
||||
@@ -559,9 +562,6 @@ void OpenGLRenderer::DrawBackbufferQuad(LatteTextureView* texView, RendererOutpu
|
||||
g_renderer->ClearColorbuffer(padView);
|
||||
}
|
||||
|
||||
// bind back buffer
|
||||
rendertarget_bindFramebufferObject(nullptr);
|
||||
|
||||
// calculate effective size
|
||||
sint32 effectiveWidth;
|
||||
sint32 effectiveHeight;
|
||||
|
||||
@@ -55,7 +55,7 @@ uint64 VulkanRenderer::draw_calculateGraphicsPipelineHash(const LatteFetchShader
|
||||
// An alternative would be to use VK_EXT_vertex_input_dynamic_state but it comes with minor overhead
|
||||
// Regardless, the extension is not well supported as of writing this (July 2021, only 10% of GPUs support it on Windows. Nvidia only)
|
||||
|
||||
cemu_assert_debug(fetchShader->key == fetchShader->key); // fetch shaders must be layout compatible, but may have different offsets
|
||||
cemu_assert_debug(vertexShader->compatibleFetchShader->key == fetchShader->key); // fetch shaders must be layout compatible, but may have different offsets
|
||||
|
||||
uint64 stateHash;
|
||||
stateHash = draw_calculateMinimalGraphicsPipelineHash(fetchShader, lcr);
|
||||
|
||||
@@ -328,26 +328,26 @@ namespace iosu
|
||||
|
||||
FSStatus FSAProcessCmd_remove(FSAClient* client, FSAIpcCommand* cmd)
|
||||
{
|
||||
char* path = (char*)cmd->cmdRemove.path;
|
||||
std::string path = __FSATranslatePath(client, (char*)cmd->cmdRemove.path);
|
||||
sint32 fscStatus = FSC_STATUS_FILE_NOT_FOUND;
|
||||
fsc_remove(path, &fscStatus);
|
||||
fsc_remove(path.c_str(), &fscStatus);
|
||||
return FSA_convertFSCtoFSStatus(fscStatus);
|
||||
}
|
||||
|
||||
FSStatus FSAProcessCmd_makeDir(FSAClient* client, FSAIpcCommand* cmd)
|
||||
{
|
||||
char* path = (char*)cmd->cmdMakeDir.path;
|
||||
std::string path = __FSATranslatePath(client, (char*)cmd->cmdMakeDir.path);
|
||||
sint32 fscStatus = FSC_STATUS_FILE_NOT_FOUND;
|
||||
fsc_createDir(path, &fscStatus);
|
||||
fsc_createDir(path.c_str(), &fscStatus);
|
||||
return FSA_convertFSCtoFSStatus(fscStatus);
|
||||
}
|
||||
|
||||
FSStatus FSAProcessCmd_rename(FSAClient* client, FSAIpcCommand* cmd)
|
||||
{
|
||||
char* srcPath = (char*)cmd->cmdRename.srcPath;
|
||||
char* dstPath = (char*)cmd->cmdRename.dstPath;
|
||||
std::string srcPath = __FSATranslatePath(client, (char*)cmd->cmdRename.srcPath);
|
||||
std::string dstPath = __FSATranslatePath(client, (char*)cmd->cmdRename.dstPath);
|
||||
sint32 fscStatus = FSC_STATUS_FILE_NOT_FOUND;
|
||||
fsc_rename(srcPath, dstPath, &fscStatus);
|
||||
fsc_rename(srcPath.c_str(), dstPath.c_str(), &fscStatus);
|
||||
return FSA_convertFSCtoFSStatus(fscStatus);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,11 @@ namespace coreinit
|
||||
osLib_returnFromFunction64(hCPU, coreinit_getTimerTick());
|
||||
}
|
||||
|
||||
void export_OSGetSystemTick(PPCInterpreter_t* hCPU)
|
||||
{
|
||||
osLib_returnFromFunction(hCPU, (uint32)coreinit_getTimerTick());
|
||||
}
|
||||
|
||||
uint32 getLeapDaysUntilYear(uint32 year)
|
||||
{
|
||||
if (year == 0)
|
||||
@@ -368,6 +373,7 @@ namespace coreinit
|
||||
osLib_addFunction("coreinit", "OSGetTime", export_OSGetTime);
|
||||
osLib_addFunction("coreinit", "OSGetSystemTime", export_OSGetSystemTimeDummy);
|
||||
osLib_addFunction("coreinit", "OSGetTick", export_OSGetTick);
|
||||
osLib_addFunction("coreinit", "OSGetSystemTick", export_OSGetSystemTick);
|
||||
|
||||
cafeExportRegister("coreinit", OSTicksToCalendarTime, LogType::Placeholder);
|
||||
cafeExportRegister("coreinit", OSCalendarTimeToTicks, LogType::Placeholder);
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#include "GX2_Surface_Copy.h"
|
||||
#include "GX2_Texture.h"
|
||||
|
||||
#include <cinttypes>
|
||||
|
||||
#define GX2_TV_RENDER_NONE 0
|
||||
#define GX2_TV_RENDER_480 1
|
||||
#define GX2_TV_RENDER_480_WIDE 2
|
||||
@@ -343,7 +345,7 @@ void _GX2SubmitToTCL()
|
||||
// update last submitted CB timestamp
|
||||
uint64 commandBufferTimestamp = Latte_GetTime();
|
||||
LatteGPUState.lastSubmittedCommandBufferTimestamp.store(commandBufferTimestamp);
|
||||
gx2Log_printf("Submitting GX2 command buffer with timestamp %016I64x", commandBufferTimestamp);
|
||||
gx2Log_printf("Submitting GX2 command buffer with timestamp %016" PRIx64, commandBufferTimestamp);
|
||||
// submit HLE packet to write retirement timestamp
|
||||
gx2WriteGather_submitU32AsBE(pm4HeaderType3(IT_HLE_SET_CB_RETIREMENT_TIMESTAMP, 2));
|
||||
gx2WriteGather_submitU32AsBE((uint32)(commandBufferTimestamp>>32ULL));
|
||||
|
||||
@@ -75,7 +75,7 @@ CubebAPI::CubebAPI(cubeb_devid devid, uint32 samplerate, uint32 channels, uint32
|
||||
output_params.layout = CUBEB_LAYOUT_3F4_LFE;
|
||||
break;
|
||||
case 6:
|
||||
output_params.layout = CUBEB_LAYOUT_QUAD_LFE | CHANNEL_FRONT_CENTER;
|
||||
output_params.layout = CUBEB_LAYOUT_3F2_LFE_BACK;
|
||||
break;
|
||||
case 4:
|
||||
output_params.layout = CUBEB_LAYOUT_QUAD;
|
||||
|
||||
@@ -509,7 +509,7 @@ void CemuUpdateWindow::WorkerThread()
|
||||
forceLog_printf("applying update error: %s", sys.what());
|
||||
}
|
||||
|
||||
if ((counter++ / 10) * 10 == counter)
|
||||
if ((counter++ % 10) == 0)
|
||||
{
|
||||
auto* event = new wxCommandEvent(wxEVT_PROGRESS);
|
||||
event->SetInt(counter);
|
||||
|
||||
@@ -263,7 +263,7 @@ void DSUControllerProvider::reader_thread()
|
||||
if (ec)
|
||||
{
|
||||
#ifdef DEBUG_DSU_CLIENT
|
||||
printf(" DSUControllerProvider::ReaderThread: exception %s\n", ex.what());
|
||||
printf(" DSUControllerProvider::ReaderThread: exception %s\n", ec.what());
|
||||
#endif
|
||||
|
||||
// there's probably no server listening on the given address:port
|
||||
@@ -406,10 +406,10 @@ void DSUControllerProvider::writer_thread()
|
||||
{
|
||||
m_socket.send_to(boost::asio::buffer(msg.get(), msg->GetSize()), m_receiver_endpoint);
|
||||
}
|
||||
catch (const std::exception&)
|
||||
catch (const std::exception& ec)
|
||||
{
|
||||
#ifdef DEBUG_DSU_CLIENT
|
||||
printf(" DSUControllerProvider::WriterThread: exception %s\n", ex.what());
|
||||
printf(" DSUControllerProvider::WriterThread: exception %s\n", ec.what());
|
||||
#endif
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(250));
|
||||
}
|
||||
|
||||
@@ -16,7 +16,14 @@ void MessageHeader::Finalize(size_t size)
|
||||
|
||||
uint32_t MessageHeader::CRC32(size_t size) const
|
||||
{
|
||||
return crc32_calc(this, size);
|
||||
uint32_t tmp, tmp2;
|
||||
|
||||
tmp = m_crc32;
|
||||
m_crc32 = 0;
|
||||
tmp2 = crc32_calc(this, size);
|
||||
m_crc32 = tmp;
|
||||
|
||||
return tmp2;
|
||||
}
|
||||
|
||||
bool MessageHeader::IsClientMessage() const { return m_magic == kMagicClient; }
|
||||
|
||||
@@ -6,16 +6,12 @@
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleLongVersionString</key>
|
||||
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#include "Cemu/FileCache/FileCache.h"
|
||||
#include "Cafe/HW/Latte/Core/LatteShaderCache.h"
|
||||
#include <regex>
|
||||
#include <cinttypes>
|
||||
|
||||
void MergeShaderCacheFile(std::string fileName)
|
||||
{
|
||||
// parse titleId from fileName
|
||||
uint64 titleId = 0;
|
||||
if (sscanf(fileName.c_str(), "%I64x", &titleId) != 1)
|
||||
if (sscanf(fileName.c_str(), "%" SCNx64, &titleId) != 1)
|
||||
return;
|
||||
|
||||
const std::string mainPath = "shaderCache/transferable/" + fileName;
|
||||
@@ -26,7 +27,7 @@ void MergeShaderCacheFile(std::string fileName)
|
||||
return;
|
||||
}
|
||||
// begin merging
|
||||
printf("Merging shaders %I64x...", titleId);
|
||||
printf("Merging shaders %" PRIx64 "...", titleId);
|
||||
uint32 numMergedEntries = 0; // number of files added to the main cache file
|
||||
for (sint32 i = 0; i < sourceCache->GetFileCount(); i++)
|
||||
{
|
||||
@@ -52,7 +53,7 @@ void MergePipelineCacheFile(std::string fileName)
|
||||
{
|
||||
// parse titleId from fileName
|
||||
uint64 titleId = 0;
|
||||
if (sscanf(fileName.c_str(), "%I64x", &titleId) != 1)
|
||||
if (sscanf(fileName.c_str(), "%" SCNx64, &titleId) != 1)
|
||||
return;
|
||||
|
||||
const std::string mainPath = "shaderCache/transferable/" + fileName;
|
||||
@@ -73,7 +74,7 @@ void MergePipelineCacheFile(std::string fileName)
|
||||
return;
|
||||
}
|
||||
// begin merging
|
||||
printf("Merging pipelines %I64x...", titleId);
|
||||
printf("Merging pipelines %" PRIx64 "...", titleId);
|
||||
uint32 numMergedEntries = 0; // number of files added to the main cache file
|
||||
for (sint32 i = 0; i < sourceCache->GetFileCount(); i++)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user