mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-22 09:09:18 +01:00
Remove PUBLIC_RELEASE flag and tie asserts to debug config (#287)
Removes the -DPUBLIC_RELEASE flag. Cemu's debug asserts are now only enabled if the build configuration is Debug. Similarly, on Windows the console is only shown for Debug builds.
This commit is contained in:
parent
b720d17a97
commit
3bceb39966
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
|||||||
if: ${{ inputs.deploymode == 'release' }}
|
if: ${{ inputs.deploymode == 'release' }}
|
||||||
run: |
|
run: |
|
||||||
echo "BUILD_MODE=release" >> $GITHUB_ENV
|
echo "BUILD_MODE=release" >> $GITHUB_ENV
|
||||||
echo "BUILD_FLAGS=-DPUBLIC_RELEASE=ON" >> $GITHUB_ENV
|
echo "BUILD_FLAGS=" >> $GITHUB_ENV
|
||||||
echo "Build mode is release"
|
echo "Build mode is release"
|
||||||
- name: Setup debug mode parameters (for continous build)
|
- name: Setup debug mode parameters (for continous build)
|
||||||
if: ${{ inputs.deploymode != 'release' }}
|
if: ${{ inputs.deploymode != 'release' }}
|
||||||
@ -99,7 +99,7 @@ jobs:
|
|||||||
if: ${{ inputs.deploymode == 'release' }}
|
if: ${{ inputs.deploymode == 'release' }}
|
||||||
run: |
|
run: |
|
||||||
echo "BUILD_MODE=release" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
echo "BUILD_MODE=release" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
echo "BUILD_FLAGS=-DPUBLIC_RELEASE=ON" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
echo "BUILD_FLAGS=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
echo "Build mode is release"
|
echo "Build mode is release"
|
||||||
|
|
||||||
- name: Setup debug mode parameters (for continous build)
|
- name: Setup debug mode parameters (for continous build)
|
||||||
@ -173,7 +173,7 @@ jobs:
|
|||||||
if: ${{ inputs.deploymode == 'release' }}
|
if: ${{ inputs.deploymode == 'release' }}
|
||||||
run: |
|
run: |
|
||||||
echo "BUILD_MODE=release" >> $GITHUB_ENV
|
echo "BUILD_MODE=release" >> $GITHUB_ENV
|
||||||
echo "BUILD_FLAGS=-DPUBLIC_RELEASE=ON" >> $GITHUB_ENV
|
echo "BUILD_FLAGS=" >> $GITHUB_ENV
|
||||||
echo "Build mode is release"
|
echo "Build mode is release"
|
||||||
- name: Setup debug mode parameters (for continous build)
|
- name: Setup debug mode parameters (for continous build)
|
||||||
if: ${{ inputs.deploymode != 'release' }}
|
if: ${{ inputs.deploymode != 'release' }}
|
||||||
|
6
BUILD.md
6
BUILD.md
@ -30,7 +30,7 @@ To compile Cemu, a recent enough compiler and STL with C++20 support is required
|
|||||||
*Additionally, for Ubuntu 22.04 only:*
|
*Additionally, for Ubuntu 22.04 only:*
|
||||||
- `sudo apt install -y clang-12`
|
- `sudo apt install -y clang-12`
|
||||||
- At step 3 while building, use
|
- At step 3 while building, use
|
||||||
`cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DPUBLIC_RELEASE=ON -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja`
|
`cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja`
|
||||||
|
|
||||||
#### For Arch and derivatives:
|
#### For Arch and derivatives:
|
||||||
`sudo pacman -S git cmake clang ninja nasm base-devel linux-headers gtk3 libsecret libgcrypt systemd freeglut zip unzip libpulse`
|
`sudo pacman -S git cmake clang ninja nasm base-devel linux-headers gtk3 libsecret libgcrypt systemd freeglut zip unzip libpulse`
|
||||||
@ -41,14 +41,14 @@ To compile Cemu, a recent enough compiler and STL with C++20 support is required
|
|||||||
### Build Cemu using cmake and clang
|
### Build Cemu using cmake and clang
|
||||||
1. `git clone --recursive https://github.com/cemu-project/Cemu`
|
1. `git clone --recursive https://github.com/cemu-project/Cemu`
|
||||||
2. `cd Cemu`
|
2. `cd Cemu`
|
||||||
3. `cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DPUBLIC_RELEASE=ON -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -G Ninja`
|
3. `cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -G Ninja`
|
||||||
4. `cmake --build build`
|
4. `cmake --build build`
|
||||||
5. You should now have a Cemu executable file in the /bin folder, which you can run using `./bin/Cemu_release`.
|
5. You should now have a Cemu executable file in the /bin folder, which you can run using `./bin/Cemu_release`.
|
||||||
|
|
||||||
#### Using GCC
|
#### Using GCC
|
||||||
While we use and test Cemu using clang, using GCC might work better with your distro (they should be fairly similar performance/issues wise and should only be considered if compilation is the issue).
|
While we use and test Cemu using clang, using GCC might work better with your distro (they should be fairly similar performance/issues wise and should only be considered if compilation is the issue).
|
||||||
You can use it by replacing the step 3 with the following:
|
You can use it by replacing the step 3 with the following:
|
||||||
`cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DPUBLIC_RELEASE=ON -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -G Ninja`
|
`cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -G Ninja`
|
||||||
|
|
||||||
#### Troubleshooting steps
|
#### Troubleshooting steps
|
||||||
- If step 3 gives you an error about not being able to find ninja, try appending `-DCMAKE_MAKE_PROGRAM=/usr/bin/ninja` to the command and running it again.
|
- If step 3 gives you an error about not being able to find ninja, try appending `-DCMAKE_MAKE_PROGRAM=/usr/bin/ninja` to the command and running it again.
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
cmake_minimum_required(VERSION 3.21.1)
|
cmake_minimum_required(VERSION 3.21.1)
|
||||||
|
|
||||||
option(PUBLIC_RELEASE "Compile with debug asserts disabled and no console" OFF)
|
|
||||||
option(ENABLE_VCPKG "Enable the vcpkg package manager" ON)
|
option(ENABLE_VCPKG "Enable the vcpkg package manager" ON)
|
||||||
set(EXPERIMENTAL_VERSION "" CACHE STRING "") # used by CI script to set experimental version
|
set(EXPERIMENTAL_VERSION "" CACHE STRING "") # used by CI script to set experimental version
|
||||||
|
|
||||||
@ -29,13 +28,14 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
if (PUBLIC_RELEASE)
|
add_compile_definitions($<$<CONFIG:Debug>:CEMU_DEBUG_ASSERT>) # if build type is debug, set CEMU_DEBUG_ASSERT
|
||||||
add_compile_definitions(PUBLIC_RELEASE)
|
|
||||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) # enable LTO
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
|
# enable link time optimization for release builds
|
||||||
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
|
||||||
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON)
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT CemuBin)
|
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT CemuBin)
|
||||||
# floating point model: precise, fiber safe optimizations
|
# floating point model: precise, fiber safe optimizations
|
||||||
@ -48,10 +48,9 @@ if (MSVC)
|
|||||||
else()
|
else()
|
||||||
add_compile_options(/GT)
|
add_compile_options(/GT)
|
||||||
endif()
|
endif()
|
||||||
if (PUBLIC_RELEASE)
|
# enable additional optimization flags for release builds
|
||||||
message(STATUS "Using additional optimization flags for MSVC")
|
add_compile_options($<$<CONFIG:Release,RelWithDebInfo>:/Oi>) # enable intrinsic functions
|
||||||
add_compile_options(/Oi /Ot) # enable intrinsic functions, favor speed
|
add_compile_options($<$<CONFIG:Release,RelWithDebInfo>:/Ot>) # favor speed
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "Release",
|
"name": "RelWithDebInfo",
|
||||||
"configurationType": "RelWithDebInfo",
|
"configurationType": "RelWithDebInfo",
|
||||||
"generator": "Ninja",
|
"generator": "Ninja",
|
||||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||||
@ -9,13 +9,12 @@
|
|||||||
"installRoot": "${projectDir}\\out\\install\\${name}"
|
"installRoot": "${projectDir}\\out\\install\\${name}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Public Release",
|
"name": "Release",
|
||||||
"configurationType": "RelWithDebInfo",
|
"configurationType": "Release",
|
||||||
"generator": "Ninja",
|
"generator": "Ninja",
|
||||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||||
"cmakeCommandArgs": "-DPUBLIC_RELEASE=ON"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Debug",
|
"name": "Debug",
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
"C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -B build/ -DPUBLIC_RELEASE=ON
|
"C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -B build/
|
||||||
pause
|
pause
|
@ -54,17 +54,10 @@ add_subdirectory(imgui)
|
|||||||
add_subdirectory(resource)
|
add_subdirectory(resource)
|
||||||
add_subdirectory(asm)
|
add_subdirectory(asm)
|
||||||
|
|
||||||
if(PUBLIC_RELEASE)
|
|
||||||
add_executable(CemuBin WIN32
|
|
||||||
main.cpp
|
|
||||||
mainLLE.cpp
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
add_executable(CemuBin
|
add_executable(CemuBin
|
||||||
main.cpp
|
main.cpp
|
||||||
mainLLE.cpp
|
mainLLE.cpp
|
||||||
)
|
)
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_sources(CemuBin PRIVATE
|
target_sources(CemuBin PRIVATE
|
||||||
@ -73,6 +66,7 @@ if(WIN32)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_property(TARGET CemuBin PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
set_property(TARGET CemuBin PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||||
|
set_property(TARGET CemuBin PROPERTY WIN32_EXECUTABLE $<NOT:$<CONFIG:Debug>>)
|
||||||
|
|
||||||
set_target_properties(CemuBin PROPERTIES
|
set_target_properties(CemuBin PROPERTIES
|
||||||
# multi-configuration generators will add a config subdirectory to RUNTIME_OUTPUT_DIRECTORY if no generator expression is used
|
# multi-configuration generators will add a config subdirectory to RUNTIME_OUTPUT_DIRECTORY if no generator expression is used
|
||||||
|
@ -199,7 +199,7 @@ MPTR hle_locate(uint8* data, uint8* mask, sint32 dataLength)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (mask[0] != 0xFF)
|
if (mask[0] != 0xFF)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
@ -299,7 +299,7 @@ void GamePatch_scan()
|
|||||||
hleAddr = hle_locate(xcx_gpuHangDetection_degradeFramebuffer, NULL, sizeof(xcx_gpuHangDetection_degradeFramebuffer));
|
hleAddr = hle_locate(xcx_gpuHangDetection_degradeFramebuffer, NULL, sizeof(xcx_gpuHangDetection_degradeFramebuffer));
|
||||||
if( hleAddr )
|
if( hleAddr )
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
forceLog_printf("HLE: XCX GPU hang detection");
|
forceLog_printf("HLE: XCX GPU hang detection");
|
||||||
#endif
|
#endif
|
||||||
// remove the ADDI r25, r25, 1 instruction
|
// remove the ADDI r25, r25, 1 instruction
|
||||||
@ -309,7 +309,7 @@ void GamePatch_scan()
|
|||||||
hleAddr = hle_locate(xcx_framebufferReductionSignature, xcx_framebufferReductionMask, sizeof(xcx_framebufferReductionSignature));
|
hleAddr = hle_locate(xcx_framebufferReductionSignature, xcx_framebufferReductionMask, sizeof(xcx_framebufferReductionSignature));
|
||||||
if( hleAddr )
|
if( hleAddr )
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
forceLog_printf("HLE: Prevent XCX rendertarget reduction");
|
forceLog_printf("HLE: Prevent XCX rendertarget reduction");
|
||||||
#endif
|
#endif
|
||||||
uint32 bl = memory_readU32(hleAddr+0x14);
|
uint32 bl = memory_readU32(hleAddr+0x14);
|
||||||
@ -325,7 +325,7 @@ void GamePatch_scan()
|
|||||||
hleAddr = hle_locate(botw_busyLoopSignature, botw_busyLoopMask, sizeof(botw_busyLoopSignature));
|
hleAddr = hle_locate(botw_busyLoopSignature, botw_busyLoopMask, sizeof(botw_busyLoopSignature));
|
||||||
if (hleAddr)
|
if (hleAddr)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
forceLog_printf("HLE: Patch BotW busy loop 1 at 0x%08x", hleAddr);
|
forceLog_printf("HLE: Patch BotW busy loop 1 at 0x%08x", hleAddr);
|
||||||
#endif
|
#endif
|
||||||
sint32 functionIndex = hleIndex_h000000001;
|
sint32 functionIndex = hleIndex_h000000001;
|
||||||
@ -336,7 +336,7 @@ void GamePatch_scan()
|
|||||||
hleAddr = hle_locate(botw_busyLoopSignature2, botw_busyLoopMask2, sizeof(botw_busyLoopSignature2));
|
hleAddr = hle_locate(botw_busyLoopSignature2, botw_busyLoopMask2, sizeof(botw_busyLoopSignature2));
|
||||||
if (hleAddr)
|
if (hleAddr)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
forceLog_printf("HLE: Patch BotW busy loop 2 at 0x%08x", hleAddr);
|
forceLog_printf("HLE: Patch BotW busy loop 2 at 0x%08x", hleAddr);
|
||||||
#endif
|
#endif
|
||||||
sint32 functionIndex = hleIndex_h000000002;
|
sint32 functionIndex = hleIndex_h000000002;
|
||||||
|
@ -384,7 +384,7 @@ static void PPCInterpreter_MULHW_(PPCInterpreter_t* hCPU, uint32 opcode)
|
|||||||
hCPU->gpr[rD] = ((uint64)c) >> 32;
|
hCPU->gpr[rD] = ((uint64)c) >> 32;
|
||||||
if (opcode & PPC_OPC_RC) {
|
if (opcode & PPC_OPC_RC) {
|
||||||
// update cr0 flags
|
// update cr0 flags
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
ppc_update_cr0(hCPU, hCPU->gpr[rD]);
|
ppc_update_cr0(hCPU, hCPU->gpr[rD]);
|
||||||
|
@ -139,7 +139,7 @@ public:
|
|||||||
return vAddr;
|
return vAddr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (hCPU->memoryException)
|
if (hCPU->memoryException)
|
||||||
assert_dbg(); // should not be set anymore
|
assert_dbg(); // should not be set anymore
|
||||||
#endif
|
#endif
|
||||||
@ -456,7 +456,7 @@ public:
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
debug_printf("ZERO[NOP] | 0x%08X\n", (unsigned int)hCPU->instructionPointer);
|
debug_printf("ZERO[NOP] | 0x%08X\n", (unsigned int)hCPU->instructionPointer);
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
while (true) std::this_thread::sleep_for(std::chrono::seconds(1));
|
while (true) std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
#endif
|
#endif
|
||||||
@ -712,7 +712,7 @@ public:
|
|||||||
PPCInterpreter_CMP(hCPU, opcode);
|
PPCInterpreter_CMP(hCPU, opcode);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
debug_printf("TW instruction executed at %08x\n", hCPU->instructionPointer);
|
debug_printf("TW instruction executed at %08x\n", hCPU->instructionPointer);
|
||||||
#endif
|
#endif
|
||||||
PPCInterpreter_TW(hCPU, opcode);
|
PPCInterpreter_TW(hCPU, opcode);
|
||||||
@ -998,7 +998,7 @@ public:
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
debug_printf("Unknown execute %04X as [31] at %08X\n", PPC_getBits(opcode, 30, 10), hCPU->instructionPointer);
|
debug_printf("Unknown execute %04X as [31] at %08X\n", PPC_getBits(opcode, 30, 10), hCPU->instructionPointer);
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
hCPU->instructionPointer += 4;
|
hCPU->instructionPointer += 4;
|
||||||
|
@ -559,7 +559,7 @@ static void PPCSprSupervisor_set(PPCInterpreter_t* hCPU, uint32 spr, uint32 newV
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
debug_printf("[C%d] Set unhandled SPR 0x%x to %08x (supervisor mode)\n", hCPU->spr.UPIR, spr, newValue);
|
debug_printf("[C%d] Set unhandled SPR 0x%x to %08x (supervisor mode)\n", hCPU->spr.UPIR, spr, newValue);
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
@ -598,7 +598,7 @@ static void PPCSpr_set(PPCInterpreter_t* hCPU, uint32 spr, uint32 newValue)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
debug_printf("[C%d] Set unhandled SPR %d to %08x\n", hCPU->spr.UPIR, spr, newValue);
|
debug_printf("[C%d] Set unhandled SPR %d to %08x\n", hCPU->spr.UPIR, spr, newValue);
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
@ -782,7 +782,7 @@ static uint32 PPCSprSupervisor_get(PPCInterpreter_t* hCPU, uint32 spr)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
debug_printf("[C%d] Get unhandled SPR %d\n", hCPU->spr.UPIR, spr);
|
debug_printf("[C%d] Get unhandled SPR %d\n", hCPU->spr.UPIR, spr);
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
@ -840,7 +840,7 @@ static uint32 PPCSpr_get(PPCInterpreter_t* hCPU, uint32 spr)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
debug_printf("[C%d] Get unhandled SPR %d\n", hCPU->spr.UPIR, spr);
|
debug_printf("[C%d] Get unhandled SPR %d\n", hCPU->spr.UPIR, spr);
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -153,7 +153,7 @@ private:
|
|||||||
|
|
||||||
void checkForCollisions()
|
void checkForCollisions()
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
uint32 endOfPrevious = 0;
|
uint32 endOfPrevious = 0;
|
||||||
for (auto itr : map_ranges)
|
for (auto itr : map_ranges)
|
||||||
{
|
{
|
||||||
|
@ -78,7 +78,7 @@ void PPCRecompiler_enter(PPCInterpreter_t* hCPU, PPCREC_JUMP_ENTRY funcPtr)
|
|||||||
PPCRecompiler_enterRecompilerCode((uint64)funcPtr, (uint64)hCPU);
|
PPCRecompiler_enterRecompilerCode((uint64)funcPtr, (uint64)hCPU);
|
||||||
_controlfp(prevState, _MCW_RC);
|
_controlfp(prevState, _MCW_RC);
|
||||||
// debug recompiler exit - useful to find frequently executed functions which couldn't be recompiled
|
// debug recompiler exit - useful to find frequently executed functions which couldn't be recompiled
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (hCPU->remainingCycles > 0 && GetAsyncKeyState(VK_F4))
|
if (hCPU->remainingCycles > 0 && GetAsyncKeyState(VK_F4))
|
||||||
{
|
{
|
||||||
auto t = std::chrono::high_resolution_clock::now();
|
auto t = std::chrono::high_resolution_clock::now();
|
||||||
|
@ -415,7 +415,7 @@ uint32 PPCRecompilerImlGen_loadOverwriteFPRRegister(ppcImlGenContext_t* ppcImlGe
|
|||||||
|
|
||||||
void PPCRecompilerImlGen_TW(ppcImlGenContext_t* ppcImlGenContext, uint32 opcode)
|
void PPCRecompilerImlGen_TW(ppcImlGenContext_t* ppcImlGenContext, uint32 opcode)
|
||||||
{
|
{
|
||||||
//#ifndef PUBLIC_RELEASE
|
//#ifdef CEMU_DEBUG_ASSERT
|
||||||
// PPCRecompilerImlGen_generateNewInstruction_macro(ppcImlGenContext, PPCREC_IML_MACRO_DEBUGBREAK, ppcImlGenContext->ppcAddressOfCurrentInstruction, 0, 0);
|
// PPCRecompilerImlGen_generateNewInstruction_macro(ppcImlGenContext, PPCREC_IML_MACRO_DEBUGBREAK, ppcImlGenContext->ppcAddressOfCurrentInstruction, 0, 0);
|
||||||
//#endif
|
//#endif
|
||||||
PPCRecompilerImlGen_generateNewInstruction_macro(ppcImlGenContext, PPCREC_IML_MACRO_LEAVE, ppcImlGenContext->ppcAddressOfCurrentInstruction, 0, 0);
|
PPCRecompilerImlGen_generateNewInstruction_macro(ppcImlGenContext, PPCREC_IML_MACRO_LEAVE, ppcImlGenContext->ppcAddressOfCurrentInstruction, 0, 0);
|
||||||
@ -2271,7 +2271,7 @@ bool PPCRecompilerImlGen_LSWI(ppcImlGenContext_t* ppcImlGenContext, uint32 opcod
|
|||||||
// if nb == 4 this instruction immitates LWZ
|
// if nb == 4 this instruction immitates LWZ
|
||||||
if( rA == 0 )
|
if( rA == 0 )
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg(); // special form where gpr is ignored and only imm is used
|
assert_dbg(); // special form where gpr is ignored and only imm is used
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
@ -2291,7 +2291,7 @@ bool PPCRecompilerImlGen_LSWI(ppcImlGenContext_t* ppcImlGenContext, uint32 opcod
|
|||||||
// if nb == 2 this instruction immitates a LHZ but the result is shifted left by 16 bits
|
// if nb == 2 this instruction immitates a LHZ but the result is shifted left by 16 bits
|
||||||
if( rA == 0 )
|
if( rA == 0 )
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg(); // special form where gpr is ignored and only imm is used
|
assert_dbg(); // special form where gpr is ignored and only imm is used
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
@ -2313,7 +2313,7 @@ bool PPCRecompilerImlGen_LSWI(ppcImlGenContext_t* ppcImlGenContext, uint32 opcod
|
|||||||
// if nb == 3 this instruction loads a 3-byte big-endian and the result is shifted left by 8 bits
|
// if nb == 3 this instruction loads a 3-byte big-endian and the result is shifted left by 8 bits
|
||||||
if( rA == 0 )
|
if( rA == 0 )
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg(); // special form where gpr is ignored and only imm is used
|
assert_dbg(); // special form where gpr is ignored and only imm is used
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
@ -4560,7 +4560,7 @@ bool PPCRecompiler_generateIntermediateCode(ppcImlGenContext_t& ppcImlGenContext
|
|||||||
if( ppcImlGenContext.imlList[i].type == PPCREC_IML_TYPE_JUMPMARK )
|
if( ppcImlGenContext.imlList[i].type == PPCREC_IML_TYPE_JUMPMARK )
|
||||||
{
|
{
|
||||||
ppcImlGenContext.imlList[i].op_jumpmark.flags |= PPCREC_IML_OP_FLAG_UNUSED;
|
ppcImlGenContext.imlList[i].op_jumpmark.flags |= PPCREC_IML_OP_FLAG_UNUSED;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (map_jumpMarks.find(ppcImlGenContext.imlList[i].op_jumpmark.address) != map_jumpMarks.end())
|
if (map_jumpMarks.find(ppcImlGenContext.imlList[i].op_jumpmark.address) != map_jumpMarks.end())
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
|
@ -2151,7 +2151,7 @@ void _reorderConditionModifyInstructions(PPCRecImlSegment_t* imlSegment)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// move CR setter instruction
|
// move CR setter instruction
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if ((unsafeInstructionIndex + 1) <= crSetterInstructionIndex)
|
if ((unsafeInstructionIndex + 1) <= crSetterInstructionIndex)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
void PPCRecRARange_addLink_perVirtualGPR(raLivenessSubrange_t** root, raLivenessSubrange_t* subrange)
|
void PPCRecRARange_addLink_perVirtualGPR(raLivenessSubrange_t** root, raLivenessSubrange_t* subrange)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if ((*root) && (*root)->range->virtualRegister != subrange->range->virtualRegister)
|
if ((*root) && (*root)->range->virtualRegister != subrange->range->virtualRegister)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
@ -35,7 +35,7 @@ void PPCRecRARange_removeLink_perVirtualGPR(raLivenessSubrange_t** root, raLiven
|
|||||||
(*root) = subrange->link_sameVirtualRegisterGPR.next;
|
(*root) = subrange->link_sameVirtualRegisterGPR.next;
|
||||||
if (subrange->link_sameVirtualRegisterGPR.next)
|
if (subrange->link_sameVirtualRegisterGPR.next)
|
||||||
subrange->link_sameVirtualRegisterGPR.next->link_sameVirtualRegisterGPR.prev = tempPrev;
|
subrange->link_sameVirtualRegisterGPR.next->link_sameVirtualRegisterGPR.prev = tempPrev;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
subrange->link_sameVirtualRegisterGPR.prev = (raLivenessSubrange_t*)1;
|
subrange->link_sameVirtualRegisterGPR.prev = (raLivenessSubrange_t*)1;
|
||||||
subrange->link_sameVirtualRegisterGPR.next = (raLivenessSubrange_t*)1;
|
subrange->link_sameVirtualRegisterGPR.next = (raLivenessSubrange_t*)1;
|
||||||
#endif
|
#endif
|
||||||
@ -50,7 +50,7 @@ void PPCRecRARange_removeLink_allSubrangesGPR(raLivenessSubrange_t** root, raLiv
|
|||||||
(*root) = subrange->link_segmentSubrangesGPR.next;
|
(*root) = subrange->link_segmentSubrangesGPR.next;
|
||||||
if (subrange->link_segmentSubrangesGPR.next)
|
if (subrange->link_segmentSubrangesGPR.next)
|
||||||
subrange->link_segmentSubrangesGPR.next->link_segmentSubrangesGPR.prev = tempPrev;
|
subrange->link_segmentSubrangesGPR.next->link_segmentSubrangesGPR.prev = tempPrev;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
subrange->link_segmentSubrangesGPR.prev = (raLivenessSubrange_t*)1;
|
subrange->link_segmentSubrangesGPR.prev = (raLivenessSubrange_t*)1;
|
||||||
subrange->link_segmentSubrangesGPR.next = (raLivenessSubrange_t*)1;
|
subrange->link_segmentSubrangesGPR.next = (raLivenessSubrange_t*)1;
|
||||||
#endif
|
#endif
|
||||||
@ -162,7 +162,7 @@ void PPCRecRA_mergeRanges(ppcImlGenContext_t* ppcImlGenContext, raLivenessRange_
|
|||||||
|
|
||||||
void PPCRecRA_mergeSubranges(ppcImlGenContext_t* ppcImlGenContext, raLivenessSubrange_t* subrange, raLivenessSubrange_t* absorbedSubrange)
|
void PPCRecRA_mergeSubranges(ppcImlGenContext_t* ppcImlGenContext, raLivenessSubrange_t* subrange, raLivenessSubrange_t* absorbedSubrange)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
PPCRecRA_debugValidateSubrange(subrange);
|
PPCRecRA_debugValidateSubrange(subrange);
|
||||||
PPCRecRA_debugValidateSubrange(absorbedSubrange);
|
PPCRecRA_debugValidateSubrange(absorbedSubrange);
|
||||||
if (subrange->imlSegment != absorbedSubrange->imlSegment)
|
if (subrange->imlSegment != absorbedSubrange->imlSegment)
|
||||||
@ -212,7 +212,7 @@ void PPCRecRA_explodeRange(ppcImlGenContext_t* ppcImlGenContext, raLivenessRange
|
|||||||
PPCRecRA_deleteRange(ppcImlGenContext, range);
|
PPCRecRA_deleteRange(ppcImlGenContext, range);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
void PPCRecRA_debugValidateSubrange(raLivenessSubrange_t* subrange)
|
void PPCRecRA_debugValidateSubrange(raLivenessSubrange_t* subrange)
|
||||||
{
|
{
|
||||||
// validate subrange
|
// validate subrange
|
||||||
@ -236,7 +236,7 @@ void PPCRecRA_debugValidateSubrange(raLivenessSubrange_t* subrange) {}
|
|||||||
raLivenessSubrange_t* PPCRecRA_splitLocalSubrange(ppcImlGenContext_t* ppcImlGenContext, raLivenessSubrange_t* subrange, sint32 splitIndex, bool trimToHole)
|
raLivenessSubrange_t* PPCRecRA_splitLocalSubrange(ppcImlGenContext_t* ppcImlGenContext, raLivenessSubrange_t* subrange, sint32 splitIndex, bool trimToHole)
|
||||||
{
|
{
|
||||||
// validation
|
// validation
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (subrange->end.index == RA_INTER_RANGE_END || subrange->end.index == RA_INTER_RANGE_START)
|
if (subrange->end.index == RA_INTER_RANGE_END || subrange->end.index == RA_INTER_RANGE_START)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
if (subrange->start.index >= splitIndex)
|
if (subrange->start.index >= splitIndex)
|
||||||
@ -364,7 +364,7 @@ sint32 PPCRecRARange_estimateAdditionalCostAfterRangeExplode(raLivenessRange_t*
|
|||||||
sint32 PPCRecRARange_estimateAdditionalCostAfterSplit(raLivenessSubrange_t* subrange, sint32 splitIndex)
|
sint32 PPCRecRARange_estimateAdditionalCostAfterSplit(raLivenessSubrange_t* subrange, sint32 splitIndex)
|
||||||
{
|
{
|
||||||
// validation
|
// validation
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (subrange->end.index == RA_INTER_RANGE_END)
|
if (subrange->end.index == RA_INTER_RANGE_END)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
|
@ -91,7 +91,7 @@ raRegisterState_t* PPCRecRA_getRegisterState(raRegisterState_t* regState, sint32
|
|||||||
{
|
{
|
||||||
if (regState[i].virtualRegister == virtualRegister)
|
if (regState[i].virtualRegister == virtualRegister)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (regState[i].physicalRegister < 0)
|
if (regState[i].physicalRegister < 0)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
@ -300,7 +300,7 @@ void _sortSegmentAllSubrangesLinkedList(PPCRecImlSegment_t* imlSegment)
|
|||||||
subrangeList[i]->link_segmentSubrangesGPR.next = subrangeList[i + 1];
|
subrangeList[i]->link_segmentSubrangesGPR.next = subrangeList[i + 1];
|
||||||
}
|
}
|
||||||
// validate list
|
// validate list
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
sint32 count2 = 0;
|
sint32 count2 = 0;
|
||||||
subrangeItr = imlSegment->raInfo.linkedList_allSubranges;
|
subrangeItr = imlSegment->raInfo.linkedList_allSubranges;
|
||||||
sint32 currentStartIndex = RA_INTER_RANGE_START;
|
sint32 currentStartIndex = RA_INTER_RANGE_START;
|
||||||
@ -342,7 +342,7 @@ bool PPCRecRA_assignSegmentRegisters(ppcImlGenContext_t* ppcImlGenContext, PPCRe
|
|||||||
raLivenessSubrange_t* liverange = liveInfo.liveRangeList[f];
|
raLivenessSubrange_t* liverange = liveInfo.liveRangeList[f];
|
||||||
if (liverange->end.index <= currentIndex && liverange->end.index != RA_INTER_RANGE_END)
|
if (liverange->end.index <= currentIndex && liverange->end.index != RA_INTER_RANGE_END)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (liverange->subrangeBranchTaken || liverange->subrangeBranchNotTaken)
|
if (liverange->subrangeBranchTaken || liverange->subrangeBranchNotTaken)
|
||||||
assert_dbg(); // infinite subranges should not expire
|
assert_dbg(); // infinite subranges should not expire
|
||||||
#endif
|
#endif
|
||||||
@ -356,7 +356,7 @@ bool PPCRecRA_assignSegmentRegisters(ppcImlGenContext_t* ppcImlGenContext, PPCRe
|
|||||||
if (subrangeItr->range->physicalRegister >= 0)
|
if (subrangeItr->range->physicalRegister >= 0)
|
||||||
{
|
{
|
||||||
// verify if register is actually available
|
// verify if register is actually available
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
for (sint32 f = 0; f < liveInfo.liveRangesCount; f++)
|
for (sint32 f = 0; f < liveInfo.liveRangesCount; f++)
|
||||||
{
|
{
|
||||||
raLivenessSubrange_t* liverangeItr = liveInfo.liveRangeList[f];
|
raLivenessSubrange_t* liverangeItr = liveInfo.liveRangeList[f];
|
||||||
@ -778,7 +778,7 @@ void PPCRecRA_generateSegmentInstructions(ppcImlGenContext_t* ppcImlGenContext,
|
|||||||
{
|
{
|
||||||
liveInfo.liveRangeList[liveInfo.liveRangesCount] = subrangeItr;
|
liveInfo.liveRangeList[liveInfo.liveRangesCount] = subrangeItr;
|
||||||
liveInfo.liveRangesCount++;
|
liveInfo.liveRangesCount++;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
// load GPR
|
// load GPR
|
||||||
if (subrangeItr->_noLoad == false)
|
if (subrangeItr->_noLoad == false)
|
||||||
{
|
{
|
||||||
|
@ -105,7 +105,7 @@ void PPCRecRA_createSegmentLivenessRanges(ppcImlGenContext_t* ppcImlGenContext,
|
|||||||
for (sint32 i = 0; i < PPC_REC_MAX_VIRTUAL_GPR; i++)
|
for (sint32 i = 0; i < PPC_REC_MAX_VIRTUAL_GPR; i++)
|
||||||
{
|
{
|
||||||
vGPR2Subrange[i] = imlSegment->raInfo.linkedList_perVirtualGPR[i];
|
vGPR2Subrange[i] = imlSegment->raInfo.linkedList_perVirtualGPR[i];
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (vGPR2Subrange[i] && vGPR2Subrange[i]->link_sameVirtualRegisterGPR.next != nullptr)
|
if (vGPR2Subrange[i] && vGPR2Subrange[i]->link_sameVirtualRegisterGPR.next != nullptr)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
@ -129,7 +129,7 @@ void PPCRecRA_createSegmentLivenessRanges(ppcImlGenContext_t* ppcImlGenContext,
|
|||||||
bool isWrite = (t == 3);
|
bool isWrite = (t == 3);
|
||||||
// add location
|
// add location
|
||||||
PPCRecRA_updateOrAddSubrangeLocation(vGPR2Subrange[virtualRegister], index, isWrite == false, isWrite);
|
PPCRecRA_updateOrAddSubrangeLocation(vGPR2Subrange[virtualRegister], index, isWrite == false, isWrite);
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (index < vGPR2Subrange[virtualRegister]->start.index)
|
if (index < vGPR2Subrange[virtualRegister]->start.index)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
if (index+1 > vGPR2Subrange[virtualRegister]->end.index)
|
if (index+1 > vGPR2Subrange[virtualRegister]->end.index)
|
||||||
@ -172,7 +172,7 @@ void PPCRecRA_extendRangeToBeginningOfSegment(ppcImlGenContext_t* ppcImlGenConte
|
|||||||
|
|
||||||
void _PPCRecRA_connectRanges(ppcImlGenContext_t* ppcImlGenContext, sint32 vGPR, PPCRecImlSegment_t** route, sint32 routeDepth)
|
void _PPCRecRA_connectRanges(ppcImlGenContext_t* ppcImlGenContext, sint32 vGPR, PPCRecImlSegment_t** route, sint32 routeDepth)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (routeDepth < 2)
|
if (routeDepth < 2)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
@ -226,7 +226,7 @@ void _PPCRecRA_checkAndTryExtendRange(ppcImlGenContext_t* ppcImlGenContext, PPCR
|
|||||||
|
|
||||||
void PPCRecRA_checkAndTryExtendRange(ppcImlGenContext_t* ppcImlGenContext, PPCRecImlSegment_t* currentSegment, sint32 vGPR)
|
void PPCRecRA_checkAndTryExtendRange(ppcImlGenContext_t* ppcImlGenContext, PPCRecImlSegment_t* currentSegment, sint32 vGPR)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (currentSegment->raDistances.reg[vGPR].usageEnd < 0)
|
if (currentSegment->raDistances.reg[vGPR].usageEnd < 0)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
@ -239,7 +239,7 @@ void PPCRecRA_checkAndTryExtendRange(ppcImlGenContext_t* ppcImlGenContext, PPCRe
|
|||||||
else
|
else
|
||||||
instructionsUntilEndOfSeg = currentSegment->imlListCount - currentSegment->raDistances.reg[vGPR].usageEnd;
|
instructionsUntilEndOfSeg = currentSegment->imlListCount - currentSegment->raDistances.reg[vGPR].usageEnd;
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (instructionsUntilEndOfSeg < 0)
|
if (instructionsUntilEndOfSeg < 0)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
@ -269,7 +269,7 @@ void PPCRecRA_mergeCloseRangesForSegmentV2(ppcImlGenContext_t* ppcImlGenContext,
|
|||||||
// check and extend if possible
|
// check and extend if possible
|
||||||
PPCRecRA_checkAndTryExtendRange(ppcImlGenContext, imlSegment, i);
|
PPCRecRA_checkAndTryExtendRange(ppcImlGenContext, imlSegment, i);
|
||||||
}
|
}
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (imlSegment->list_prevSegments.empty() == false && imlSegment->isEnterable)
|
if (imlSegment->list_prevSegments.empty() == false && imlSegment->isEnterable)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
if ((imlSegment->nextSegmentBranchNotTaken != nullptr || imlSegment->nextSegmentBranchTaken != nullptr) && imlSegment->nextSegmentIsUncertain)
|
if ((imlSegment->nextSegmentBranchNotTaken != nullptr || imlSegment->nextSegmentBranchTaken != nullptr) && imlSegment->nextSegmentIsUncertain)
|
||||||
|
@ -505,7 +505,7 @@ LatteFetchShader* LatteFetchShader::FindByGPUState()
|
|||||||
lookupInfo->programSize = _getFSProgramSize();
|
lookupInfo->programSize = _getFSProgramSize();
|
||||||
lookupInfo->lastFrameAccessed = LatteGPUState.frameCounter;
|
lookupInfo->lastFrameAccessed = LatteGPUState.frameCounter;
|
||||||
g_fetchShaderLookupCache.store(fsPhysAddr24, lookupInfo);
|
g_fetchShaderLookupCache.store(fsPhysAddr24, lookupInfo);
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
cemu_assert_debug(g_fetchShaderLookupCache.lookup(fsPhysAddr24) == lookupInfo);
|
cemu_assert_debug(g_fetchShaderLookupCache.lookup(fsPhysAddr24) == lookupInfo);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ public:
|
|||||||
return; // do nothing if added range is already covered
|
return; // do nothing if added range is already covered
|
||||||
rangeBegin = (std::min)(rangeBegin, (*itr).first.rangeBegin);
|
rangeBegin = (std::min)(rangeBegin, (*itr).first.rangeBegin);
|
||||||
// DEBUG - make sure this is the start point of the merge process (the first entry that starts below minValue)
|
// DEBUG - make sure this is the start point of the merge process (the first entry that starts below minValue)
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (itr != m_map.cbegin())
|
if (itr != m_map.cbegin())
|
||||||
{
|
{
|
||||||
// check previous result
|
// check previous result
|
||||||
|
@ -136,7 +136,7 @@ uint32 LatteCP_readU32Deprc()
|
|||||||
}
|
}
|
||||||
v = *(uint32*)gxRingBufferReadPtr;
|
v = *(uint32*)gxRingBufferReadPtr;
|
||||||
gxRingBufferReadPtr += 4;
|
gxRingBufferReadPtr += 4;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (v == 0xcdcdcdcd)
|
if (v == 0xcdcdcdcd)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
@ -299,7 +299,7 @@ LatteCMDPtr LatteCP_itSetRegistersGeneric(LatteCMDPtr cmd, uint32 nWords)
|
|||||||
uint32 registerIndex = TRegisterBase + registerOffset;
|
uint32 registerIndex = TRegisterBase + registerOffset;
|
||||||
uint32 registerStartIndex = registerIndex;
|
uint32 registerStartIndex = registerIndex;
|
||||||
uint32 registerEndIndex = registerStartIndex + nWords;
|
uint32 registerEndIndex = registerStartIndex + nWords;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
cemu_assert_debug((registerIndex + nWords) <= LATTE_MAX_REGISTER);
|
cemu_assert_debug((registerIndex + nWords) <= LATTE_MAX_REGISTER);
|
||||||
#endif
|
#endif
|
||||||
uint32* outputReg = (uint32*)(LatteGPUState.contextRegister + registerIndex);
|
uint32* outputReg = (uint32*)(LatteGPUState.contextRegister + registerIndex);
|
||||||
@ -340,7 +340,7 @@ LatteCMDPtr LatteCP_itSetRegistersGeneric(LatteCMDPtr cmd, uint32 nWords, TRegRa
|
|||||||
uint32 registerIndex = TRegisterBase + registerOffset;
|
uint32 registerIndex = TRegisterBase + registerOffset;
|
||||||
uint32 registerStartIndex = registerIndex;
|
uint32 registerStartIndex = registerIndex;
|
||||||
uint32 registerEndIndex = registerStartIndex + nWords;
|
uint32 registerEndIndex = registerStartIndex + nWords;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
cemu_assert_debug((registerIndex + nWords) <= LATTE_MAX_REGISTER);
|
cemu_assert_debug((registerIndex + nWords) <= LATTE_MAX_REGISTER);
|
||||||
#endif
|
#endif
|
||||||
cbRegRange(registerStartIndex, registerEndIndex);
|
cbRegRange(registerStartIndex, registerEndIndex);
|
||||||
@ -1069,7 +1069,7 @@ void LatteCP_processCommandBuffer(uint8* cmdBuffer, sint32 cmdSize, DrawPassCont
|
|||||||
{
|
{
|
||||||
uint32 itCode = (itHeader >> 8) & 0xFF;
|
uint32 itCode = (itHeader >> 8) & 0xFF;
|
||||||
uint32 nWords = ((itHeader >> 16) & 0x3FFF) + 1;
|
uint32 nWords = ((itHeader >> 16) & 0x3FFF) + 1;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
LatteCMDPtr expectedPostCmd = cmd + nWords;
|
LatteCMDPtr expectedPostCmd = cmd + nWords;
|
||||||
#endif
|
#endif
|
||||||
switch (itCode)
|
switch (itCode)
|
||||||
@ -1126,7 +1126,7 @@ void LatteCP_processCommandBuffer(uint8* cmdBuffer, sint32 cmdSize, DrawPassCont
|
|||||||
return;
|
return;
|
||||||
cemu_assert_debug(!drawPassCtx.isWithinDrawPass());
|
cemu_assert_debug(!drawPassCtx.isWithinDrawPass());
|
||||||
}
|
}
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
expectedPostCmd = cmd;
|
expectedPostCmd = cmd;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -1156,7 +1156,7 @@ void LatteCP_processCommandBuffer(uint8* cmdBuffer, sint32 cmdSize, DrawPassCont
|
|||||||
cmd = LatteCP_itDrawIndex2(cmd, nWords, drawPassCtx);
|
cmd = LatteCP_itDrawIndex2(cmd, nWords, drawPassCtx);
|
||||||
cmd = LatteCP_processCommandBuffer_continuousDrawPass(cmd, cmdStart, cmdEnd, drawPassCtx);
|
cmd = LatteCP_processCommandBuffer_continuousDrawPass(cmd, cmdStart, cmdEnd, drawPassCtx);
|
||||||
cemu_assert_debug(cmd == cmdEnd || drawPassCtx.isWithinDrawPass() == false); // draw sequence should have ended if we didn't reach the end of the command buffer
|
cemu_assert_debug(cmd == cmdEnd || drawPassCtx.isWithinDrawPass() == false); // draw sequence should have ended if we didn't reach the end of the command buffer
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
expectedPostCmd = cmd;
|
expectedPostCmd = cmd;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -1167,7 +1167,7 @@ void LatteCP_processCommandBuffer(uint8* cmdBuffer, sint32 cmdSize, DrawPassCont
|
|||||||
cmd = LatteCP_itDrawIndexAuto(cmd, nWords, drawPassCtx);
|
cmd = LatteCP_itDrawIndexAuto(cmd, nWords, drawPassCtx);
|
||||||
cmd = LatteCP_processCommandBuffer_continuousDrawPass(cmd, cmdStart, cmdEnd, drawPassCtx);
|
cmd = LatteCP_processCommandBuffer_continuousDrawPass(cmd, cmdStart, cmdEnd, drawPassCtx);
|
||||||
cemu_assert_debug(cmd == cmdEnd || drawPassCtx.isWithinDrawPass() == false); // draw sequence should have ended if we didn't reach the end of the command buffer
|
cemu_assert_debug(cmd == cmdEnd || drawPassCtx.isWithinDrawPass() == false); // draw sequence should have ended if we didn't reach the end of the command buffer
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
expectedPostCmd = cmd;
|
expectedPostCmd = cmd;
|
||||||
#endif
|
#endif
|
||||||
#ifdef FAST_DRAW_LOGGING
|
#ifdef FAST_DRAW_LOGGING
|
||||||
@ -1313,7 +1313,7 @@ void LatteCP_processCommandBuffer(uint8* cmdBuffer, sint32 cmdSize, DrawPassCont
|
|||||||
cemu_assert_debug(false);
|
cemu_assert_debug(false);
|
||||||
LatteSkipCMD(nWords);
|
LatteSkipCMD(nWords);
|
||||||
}
|
}
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if(cmd != expectedPostCmd)
|
if(cmd != expectedPostCmd)
|
||||||
debug_printf("cmd %016p expectedPostCmd %016p\n", cmd, expectedPostCmd);
|
debug_printf("cmd %016p expectedPostCmd %016p\n", cmd, expectedPostCmd);
|
||||||
cemu_assert_debug(cmd == expectedPostCmd);
|
cemu_assert_debug(cmd == expectedPostCmd);
|
||||||
|
@ -402,7 +402,7 @@ void LatteOverlay_RenderNotifications(ImVec2& position, ImVec2& pivot, sint32 di
|
|||||||
ImRotateEnd(0.001f * ticks.time_since_epoch().count());
|
ImRotateEnd(0.001f * ticks.time_since_epoch().count());
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
uint64 totalTime = g_compiling_pipelines_syncTimeSum / 1000000ull;
|
uint64 totalTime = g_compiling_pipelines_syncTimeSum / 1000000ull;
|
||||||
if (s_pipeline_count_async > 0)
|
if (s_pipeline_count_async > 0)
|
||||||
{
|
{
|
||||||
|
@ -506,7 +506,7 @@ bool LatteMRT::UpdateCurrentFBO()
|
|||||||
}
|
}
|
||||||
else if (rtEffectiveSize->width != effectiveWidth && rtEffectiveSize->height != effectiveHeight)
|
else if (rtEffectiveSize->width != effectiveWidth && rtEffectiveSize->height != effectiveHeight)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
forceLog_printf("Color buffer size mismatch (%dx%d). Effective size: %dx%d Real size: %dx%d Mismatching texture: %08x %dx%d fmt %04x", rtEffectiveSize->width, rtEffectiveSize->height, effectiveWidth, effectiveHeight, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, colorAttachmentView->baseTexture->physAddress, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, (uint32)colorAttachmentView->baseTexture->format);
|
forceLog_printf("Color buffer size mismatch (%dx%d). Effective size: %dx%d Real size: %dx%d Mismatching texture: %08x %dx%d fmt %04x", rtEffectiveSize->width, rtEffectiveSize->height, effectiveWidth, effectiveHeight, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, colorAttachmentView->baseTexture->physAddress, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, (uint32)colorAttachmentView->baseTexture->format);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ LatteRingBuffer_t* LatteRingBuffer_create(uint8* data, uint32 size)
|
|||||||
|
|
||||||
uint8* LatteRingBuffer_allocate(LatteRingBuffer_t* rb, sint32 size, sint32 alignment)
|
uint8* LatteRingBuffer_allocate(LatteRingBuffer_t* rb, sint32 size, sint32 alignment)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
cemu_assert_debug(size < rb->size);
|
cemu_assert_debug(size < rb->size);
|
||||||
#endif
|
#endif
|
||||||
// align
|
// align
|
||||||
|
@ -236,7 +236,7 @@ void LatteShader_UpdatePSInputs(uint32* contextRegisters)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// semantic imports from vertex shader
|
// semantic imports from vertex shader
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
uint8 semanticMask[256 / 8] = { 0 };
|
uint8 semanticMask[256 / 8] = { 0 };
|
||||||
#endif
|
#endif
|
||||||
cemu_assert_debug(numPSInputs <= GPU7_PS_MAX_INPUTS);
|
cemu_assert_debug(numPSInputs <= GPU7_PS_MAX_INPUTS);
|
||||||
@ -273,7 +273,7 @@ void LatteShader_UpdatePSInputs(uint32* contextRegisters)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (semanticMask[psSemanticId >> 3] & (1 << (psSemanticId & 7)))
|
if (semanticMask[psSemanticId >> 3] & (1 << (psSemanticId & 7)))
|
||||||
{
|
{
|
||||||
forceLogDebug_printf("SemanticId already used");
|
forceLogDebug_printf("SemanticId already used");
|
||||||
|
@ -252,7 +252,7 @@ float LatteSoftware_omod(uint32 omod, float f)
|
|||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
#define _clamp(__v) if(destClamp != 0) cemu_assert_unimplemented()
|
#define _clamp(__v) if(destClamp != 0) cemu_assert_unimplemented()
|
||||||
#else
|
#else
|
||||||
#define _clamp(__v) // todo
|
#define _clamp(__v) // todo
|
||||||
|
@ -100,7 +100,7 @@ void LatteStreamout_PrepareDrawcall(uint32 count, uint32 instanceCount)
|
|||||||
uint32 streamoutWriteMask = 0;
|
uint32 streamoutWriteMask = 0;
|
||||||
if (geometryShader)
|
if (geometryShader)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
cemu_assert_debug(vertexShader->streamoutBufferWriteMask2.any() == false);
|
cemu_assert_debug(vertexShader->streamoutBufferWriteMask2.any() == false);
|
||||||
#endif
|
#endif
|
||||||
for (sint32 i = 0; i < LATTE_NUM_STREAMOUT_BUFFER; i++)
|
for (sint32 i = 0; i < LATTE_NUM_STREAMOUT_BUFFER; i++)
|
||||||
|
@ -1089,7 +1089,7 @@ LatteTextureView* LatteTexture_CreateMapping(MPTR physAddr, MPTR physMipAddr, si
|
|||||||
// for accesses to mips/slices using a physAddress offset we manually need to create a new view lookup
|
// for accesses to mips/slices using a physAddress offset we manually need to create a new view lookup
|
||||||
// by default views only create a lookup for the base texture physAddress
|
// by default views only create a lookup for the base texture physAddress
|
||||||
view->CreateLookupForSubTexture(relativeMipIndex, relativeSliceIndex);
|
view->CreateLookupForSubTexture(relativeMipIndex, relativeSliceIndex);
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
LatteTextureView* testView = LatteTextureViewLookupCache::lookup(physAddr, width, height, depth, pitch, firstMip, numMip, firstSlice, numSlice, format, dimView);
|
LatteTextureView* testView = LatteTextureViewLookupCache::lookup(physAddr, width, height, depth, pitch, firstMip, numMip, firstSlice, numSlice, format, dimView);
|
||||||
cemu_assert(testView);
|
cemu_assert(testView);
|
||||||
#endif
|
#endif
|
||||||
|
@ -275,7 +275,7 @@ void LatteTexture_updateTexturesForStage(LatteDecompilerShader* shaderContext, u
|
|||||||
// check for changes
|
// check for changes
|
||||||
if (LatteTC_HasTextureChanged(textureView->baseTexture) || swizzleChanged)
|
if (LatteTC_HasTextureChanged(textureView->baseTexture) || swizzleChanged)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
debug_printf("Reload texture 0x%08x res %dx%d memRange %08x-%08x SwizzleChange: %s\n", textureView->baseTexture->physAddress, textureView->baseTexture->width, textureView->baseTexture->height, textureView->baseTexture->texDataPtrLow, textureView->baseTexture->texDataPtrHigh, swizzleChanged ? "yes" : "no");
|
debug_printf("Reload texture 0x%08x res %dx%d memRange %08x-%08x SwizzleChange: %s\n", textureView->baseTexture->physAddress, textureView->baseTexture->width, textureView->baseTexture->height, textureView->baseTexture->texDataPtrLow, textureView->baseTexture->texDataPtrHigh, swizzleChanged ? "yes" : "no");
|
||||||
#endif
|
#endif
|
||||||
// update swizzle / changed mip address
|
// update swizzle / changed mip address
|
||||||
|
@ -736,7 +736,7 @@ void LatteTextureLoader_writeReadbackTextureToMemory(LatteTextureDefinition* tex
|
|||||||
LatteTextureLoaderCtx textureLoader = { 0 };
|
LatteTextureLoaderCtx textureLoader = { 0 };
|
||||||
LatteTextureLoader_begin(&textureLoader, sliceIndex, mipIndex, textureData->physAddress, textureData->physMipAddress, textureData->format, textureData->dim, textureData->width, textureData->height, textureData->depth, textureData->mipLevels, textureData->pitch, textureData->tileMode, textureData->swizzle);
|
LatteTextureLoader_begin(&textureLoader, sliceIndex, mipIndex, textureData->physAddress, textureData->physMipAddress, textureData->format, textureData->dim, textureData->width, textureData->height, textureData->depth, textureData->mipLevels, textureData->pitch, textureData->tileMode, textureData->swizzle);
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (textureData->depth != 1)
|
if (textureData->depth != 1)
|
||||||
forceLog_printf("_writeReadbackTextureToMemory(): Texture has multiple slices (not supported)");
|
forceLog_printf("_writeReadbackTextureToMemory(): Texture has multiple slices (not supported)");
|
||||||
#endif
|
#endif
|
||||||
|
@ -233,7 +233,7 @@ bool _isIntegerInstruction(const LatteDecompilerALUInstruction& aluInstruction)
|
|||||||
case ALU_OP2_INST_SETNE_DX10:
|
case ALU_OP2_INST_SETNE_DX10:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
debug_printf("_isIntegerInstruction(): OP3=%s opcode=%02x\n", aluInstruction.isOP3 ? "true" : "false", aluInstruction.opcode);
|
debug_printf("_isIntegerInstruction(): OP3=%s opcode=%02x\n", aluInstruction.isOP3 ? "true" : "false", aluInstruction.opcode);
|
||||||
cemu_assert_debug(false);
|
cemu_assert_debug(false);
|
||||||
#endif
|
#endif
|
||||||
@ -259,7 +259,7 @@ bool _isIntegerInstruction(const LatteDecompilerALUInstruction& aluInstruction)
|
|||||||
case ALU_OP3_INST_CMOVGE_INT:
|
case ALU_OP3_INST_CMOVGE_INT:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
debug_printf("_isIntegerInstruction(): OP3=%s opcode=%02x\n", aluInstruction.isOP3?"true":"false", aluInstruction.opcode);
|
debug_printf("_isIntegerInstruction(): OP3=%s opcode=%02x\n", aluInstruction.isOP3?"true":"false", aluInstruction.opcode);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -2643,7 +2643,7 @@ void _emitTEXSampleTextureCode(LatteDecompilerShaderContext* shaderContext, Latt
|
|||||||
src->add(");");
|
src->add(");");
|
||||||
|
|
||||||
// debug
|
// debug
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if(texInstruction->opcode == GPU7_TEX_INST_LD )
|
if(texInstruction->opcode == GPU7_TEX_INST_LD )
|
||||||
src->add(" // TEX_INST_LD");
|
src->add(" // TEX_INST_LD");
|
||||||
else if(texInstruction->opcode == GPU7_TEX_INST_SAMPLE )
|
else if(texInstruction->opcode == GPU7_TEX_INST_SAMPLE )
|
||||||
@ -3460,7 +3460,7 @@ void _emitStreamWriteCode(LatteDecompilerShaderContext* shaderContext, LatteDeco
|
|||||||
StringBuf* src = shaderContext->shaderSource;
|
StringBuf* src = shaderContext->shaderSource;
|
||||||
if (shaderContext->analyzer.hasStreamoutEnable == false)
|
if (shaderContext->analyzer.hasStreamoutEnable == false)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
src->add("// omitted streamout write" _CRLF);
|
src->add("// omitted streamout write" _CRLF);
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
@ -3842,7 +3842,7 @@ void LatteDecompiler_emitGLSLHelperFunctions(LatteDecompilerShaderContext* shade
|
|||||||
|
|
||||||
void _addPixelShaderExtraDebugInfo(LatteDecompilerShaderContext* shaderContext, StringBuf* fCStr_shaderSource)
|
void _addPixelShaderExtraDebugInfo(LatteDecompilerShaderContext* shaderContext, StringBuf* fCStr_shaderSource)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
fCStr_shaderSource->add("// Color buffers:" _CRLF);
|
fCStr_shaderSource->add("// Color buffers:" _CRLF);
|
||||||
for(uint32 i=0; i<8; i++)
|
for(uint32 i=0; i<8; i++)
|
||||||
{
|
{
|
||||||
@ -3958,7 +3958,7 @@ void LatteDecompiler_emitGLSLShader(LatteDecompilerShaderContext* shaderContext,
|
|||||||
|
|
||||||
// debug info
|
// debug info
|
||||||
src->addFmt("// shader %08x%08x" _CRLF, (uint32)(shaderContext->shaderBaseHash >> 32), (uint32)(shaderContext->shaderBaseHash & 0xFFFFFFFF));
|
src->addFmt("// shader %08x%08x" _CRLF, (uint32)(shaderContext->shaderBaseHash >> 32), (uint32)(shaderContext->shaderBaseHash & 0xFFFFFFFF));
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
src->addFmt("// usesIntegerValues: {}" _CRLF, shaderContext->analyzer.usesIntegerValues?"true":"false");
|
src->addFmt("// usesIntegerValues: {}" _CRLF, shaderContext->analyzer.usesIntegerValues?"true":"false");
|
||||||
src->addFmt(_CRLF);
|
src->addFmt(_CRLF);
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ LatteTextureGL::LatteTextureGL(uint32 textureUnit, Latte::E_DIM dim, MPTR physAd
|
|||||||
LatteTextureGL::InitTextureState();
|
LatteTextureGL::InitTextureState();
|
||||||
// set debug name
|
// set debug name
|
||||||
bool useGLDebugNames = false;
|
bool useGLDebugNames = false;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
useGLDebugNames = true;
|
useGLDebugNames = true;
|
||||||
#endif
|
#endif
|
||||||
if (LaunchSettings::NSightModeEnabled())
|
if (LaunchSettings::NSightModeEnabled())
|
||||||
|
@ -97,7 +97,7 @@ void LatteTextureViewGL::InitAliasView()
|
|||||||
|
|
||||||
// set debug name
|
// set debug name
|
||||||
bool useGLDebugNames = false;
|
bool useGLDebugNames = false;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
useGLDebugNames = true;
|
useGLDebugNames = true;
|
||||||
#endif
|
#endif
|
||||||
if (LaunchSettings::NSightModeEnabled())
|
if (LaunchSettings::NSightModeEnabled())
|
||||||
|
@ -21,7 +21,7 @@ public:
|
|||||||
cemu_assert_debug(refCount == 0);
|
cemu_assert_debug(refCount == 0);
|
||||||
|
|
||||||
// remove references
|
// remove references
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
for (auto itr : refs)
|
for (auto itr : refs)
|
||||||
{
|
{
|
||||||
auto& rev = itr->ref->reverseRefs;
|
auto& rev = itr->ref->reverseRefs;
|
||||||
@ -58,7 +58,7 @@ public:
|
|||||||
this->refs.emplace_back(refTarget->selfRef);
|
this->refs.emplace_back(refTarget->selfRef);
|
||||||
refTarget->refCount++;
|
refTarget->refCount++;
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
// add reverse ref
|
// add reverse ref
|
||||||
refTarget->reverseRefs.emplace_back(this->selfRef);
|
refTarget->reverseRefs.emplace_back(this->selfRef);
|
||||||
#endif
|
#endif
|
||||||
@ -80,7 +80,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
VKRMoveableRefCounterRef* selfRef;
|
VKRMoveableRefCounterRef* selfRef;
|
||||||
std::vector<VKRMoveableRefCounterRef*> refs;
|
std::vector<VKRMoveableRefCounterRef*> refs;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
std::vector<VKRMoveableRefCounterRef*> reverseRefs;
|
std::vector<VKRMoveableRefCounterRef*> reverseRefs;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ const std::vector<const char*> kRequiredDeviceExtensions =
|
|||||||
|
|
||||||
VKAPI_ATTR VkBool32 VKAPI_CALL DebugUtilsCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, void* pUserData)
|
VKAPI_ATTR VkBool32 VKAPI_CALL DebugUtilsCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, void* pUserData)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
|
|
||||||
if (strstr(pCallbackData->pMessage, "consumes input location"))
|
if (strstr(pCallbackData->pMessage, "consumes input location"))
|
||||||
return VK_FALSE; // false means we dont care
|
return VK_FALSE; // false means we dont care
|
||||||
@ -636,7 +636,7 @@ VulkanRenderer::~VulkanRenderer()
|
|||||||
|
|
||||||
VulkanRenderer* VulkanRenderer::GetInstance()
|
VulkanRenderer* VulkanRenderer::GetInstance()
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
cemu_assert_debug(g_renderer && dynamic_cast<VulkanRenderer*>(g_renderer.get()));
|
cemu_assert_debug(g_renderer && dynamic_cast<VulkanRenderer*>(g_renderer.get()));
|
||||||
// Use #if here because dynamic_casts dont get optimized away even if the result is not stored as with cemu_assert_debug
|
// Use #if here because dynamic_casts dont get optimized away even if the result is not stored as with cemu_assert_debug
|
||||||
#endif
|
#endif
|
||||||
|
@ -334,7 +334,7 @@ PipelineInfo* VulkanRenderer::draw_getOrCreateGraphicsPipeline(uint32 indexCount
|
|||||||
if (cache_object != nullptr)
|
if (cache_object != nullptr)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
cemu_assert_debug(cache_object->vertexShader == LatteSHRC_GetActiveVertexShader());
|
cemu_assert_debug(cache_object->vertexShader == LatteSHRC_GetActiveVertexShader());
|
||||||
cemu_assert_debug(cache_object->geometryShader == LatteSHRC_GetActiveGeometryShader());
|
cemu_assert_debug(cache_object->geometryShader == LatteSHRC_GetActiveGeometryShader());
|
||||||
cemu_assert_debug(cache_object->pixelShader == LatteSHRC_GetActivePixelShader());
|
cemu_assert_debug(cache_object->pixelShader == LatteSHRC_GetActivePixelShader());
|
||||||
@ -1456,7 +1456,7 @@ void VulkanRenderer::draw_execute(uint32 baseVertex, uint32 baseInstance, uint32
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
pipeline_info = m_state.activePipelineInfo;
|
pipeline_info = m_state.activePipelineInfo;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
auto pipeline_info2 = draw_getOrCreateGraphicsPipeline(count);
|
auto pipeline_info2 = draw_getOrCreateGraphicsPipeline(count);
|
||||||
if (pipeline_info != pipeline_info2)
|
if (pipeline_info != pipeline_info2)
|
||||||
{
|
{
|
||||||
|
@ -606,7 +606,7 @@ namespace iosu
|
|||||||
FSCVirtualFile* fscFile = sFileHandleTable.GetByHandle(fileHandle);
|
FSCVirtualFile* fscFile = sFileHandleTable.GetByHandle(fileHandle);
|
||||||
if (!fscFile)
|
if (!fscFile)
|
||||||
return (FSStatus)FS_RESULT::ERR_PLACEHOLDER;
|
return (FSStatus)FS_RESULT::ERR_PLACEHOLDER;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
cemuLog_force("FSAProcessCmd_appendFile(): size 0x{:08x} count 0x{:08x} (todo)\n", _swapEndianU32(cmd->cmdAppendFile.size), _swapEndianU32(cmd->cmdAppendFile.count));
|
cemuLog_force("FSAProcessCmd_appendFile(): size 0x{:08x} count 0x{:08x} (todo)\n", _swapEndianU32(cmd->cmdAppendFile.size), _swapEndianU32(cmd->cmdAppendFile.count));
|
||||||
#endif
|
#endif
|
||||||
return _swapEndianU32(cmd->cmdAppendFile.size) * _swapEndianU32(cmd->cmdAppendFile.count);
|
return _swapEndianU32(cmd->cmdAppendFile.size) * _swapEndianU32(cmd->cmdAppendFile.count);
|
||||||
|
@ -10,7 +10,7 @@ namespace iosu
|
|||||||
|
|
||||||
static void _assume_lock()
|
static void _assume_lock()
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
cemu_assert_debug(!sInternalMutex.try_lock());
|
cemu_assert_debug(!sInternalMutex.try_lock());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -485,7 +485,7 @@ namespace iosu
|
|||||||
CURL* curl = it->curl.get();
|
CURL* curl = it->curl.get();
|
||||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||||
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 2);
|
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 2);
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||||
char errbuf[CURL_ERROR_SIZE]{};
|
char errbuf[CURL_ERROR_SIZE]{};
|
||||||
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
|
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
|
||||||
@ -579,7 +579,7 @@ namespace iosu
|
|||||||
|
|
||||||
if (curl_result != CURLE_OK)
|
if (curl_result != CURLE_OK)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
forceLogDebug_printf("curl error buff: %s", errbuf);
|
forceLogDebug_printf("curl error buff: %s", errbuf);
|
||||||
#endif
|
#endif
|
||||||
it->turn_state = kError;
|
it->turn_state = kError;
|
||||||
|
@ -1015,7 +1015,7 @@ bool RPLLoader_FixImportSymbols(RPLModule* rplLoaderContext, sint32 symtabSectio
|
|||||||
}
|
}
|
||||||
if (foundExport == false)
|
if (foundExport == false)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (nameOffset > 0)
|
if (nameOffset > 0)
|
||||||
{
|
{
|
||||||
forceLogDebug_printf("export not found - force lookup in function exports");
|
forceLogDebug_printf("export not found - force lookup in function exports");
|
||||||
|
@ -119,7 +119,7 @@ void coreinitExport_OSPanic(PPCInterpreter_t* hCPU)
|
|||||||
debug_printf("File: %s:%d\n", memory_getPointerFromVirtualOffset(hCPU->gpr[3]), hCPU->gpr[4]);
|
debug_printf("File: %s:%d\n", memory_getPointerFromVirtualOffset(hCPU->gpr[3]), hCPU->gpr[4]);
|
||||||
debug_printf("Msg: %s\n", memory_getPointerFromVirtualOffset(hCPU->gpr[5]));
|
debug_printf("Msg: %s\n", memory_getPointerFromVirtualOffset(hCPU->gpr[5]));
|
||||||
DebugLogStackTrace(coreinit::OSGetCurrentThread(), coreinit::OSGetStackPointer());
|
DebugLogStackTrace(coreinit::OSGetCurrentThread(), coreinit::OSGetStackPointer());
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
while (true) std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
while (true) std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||||
#endif
|
#endif
|
||||||
@ -203,7 +203,7 @@ typedef struct
|
|||||||
|
|
||||||
void coreinitExport_OSDriver_Register(PPCInterpreter_t* hCPU)
|
void coreinitExport_OSDriver_Register(PPCInterpreter_t* hCPU)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
forceLog_printf("OSDriver_Register(0x%08x,0x%08x,0x%08x,0x%08x,0x%08x,0x%08x)", hCPU->gpr[3], hCPU->gpr[4], hCPU->gpr[5], hCPU->gpr[6], hCPU->gpr[7], hCPU->gpr[8]);
|
forceLog_printf("OSDriver_Register(0x%08x,0x%08x,0x%08x,0x%08x,0x%08x,0x%08x)", hCPU->gpr[3], hCPU->gpr[4], hCPU->gpr[5], hCPU->gpr[6], hCPU->gpr[7], hCPU->gpr[8]);
|
||||||
#endif
|
#endif
|
||||||
OSDriverCallbacks_t* driverCallbacks = (OSDriverCallbacks_t*)memory_getPointerFromVirtualOffset(hCPU->gpr[5]);
|
OSDriverCallbacks_t* driverCallbacks = (OSDriverCallbacks_t*)memory_getPointerFromVirtualOffset(hCPU->gpr[5]);
|
||||||
|
@ -70,7 +70,7 @@ namespace coreinit
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// debug begin
|
// debug begin
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
uint64 prevTick = 0;
|
uint64 prevTick = 0;
|
||||||
auto itr = g_activeAlarmList.begin();
|
auto itr = g_activeAlarmList.begin();
|
||||||
while (itr != g_activeAlarmList.end())
|
while (itr != g_activeAlarmList.end())
|
||||||
|
@ -349,7 +349,7 @@ namespace coreinit
|
|||||||
}
|
}
|
||||||
if (entryFound == false)
|
if (entryFound == false)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ namespace coreinit
|
|||||||
if (deallocAddr < lcAddr[coreIndex] || deallocAddr >= (lcAddr[coreIndex] + LC_LOCKED_CACHE_SIZE))
|
if (deallocAddr < lcAddr[coreIndex] || deallocAddr >= (lcAddr[coreIndex] + LC_LOCKED_CACHE_SIZE))
|
||||||
{
|
{
|
||||||
// out of bounds
|
// out of bounds
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
forceLog_printf("LCDealloc(): Out of bounds");
|
forceLog_printf("LCDealloc(): Out of bounds");
|
||||||
#endif
|
#endif
|
||||||
osLib_returnFromFunction(hCPU, 0);
|
osLib_returnFromFunction(hCPU, 0);
|
||||||
@ -198,7 +198,7 @@ namespace coreinit
|
|||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
LCIsEnabled[PPCInterpreter_getCoreIndex(hCPU)]--;
|
LCIsEnabled[PPCInterpreter_getCoreIndex(hCPU)]--;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (LCIsEnabled[PPCInterpreter_getCoreIndex(hCPU)] == 0)
|
if (LCIsEnabled[PPCInterpreter_getCoreIndex(hCPU)] == 0)
|
||||||
{
|
{
|
||||||
uint32 coreIndex = PPCInterpreter_getCoreIndex(hCPU);
|
uint32 coreIndex = PPCInterpreter_getCoreIndex(hCPU);
|
||||||
|
@ -462,7 +462,7 @@ namespace coreinit
|
|||||||
if (block != NULL)
|
if (block != NULL)
|
||||||
{
|
{
|
||||||
MPTR blockMPTR = memory_getVirtualOffsetFromPointer(block);
|
MPTR blockMPTR = memory_getVirtualOffsetFromPointer(block);
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (block->isFree != 0)
|
if (block->isFree != 0)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
_blockHeapDebugVerifyLinkOrder(blockHeapHead);
|
_blockHeapDebugVerifyLinkOrder(blockHeapHead);
|
||||||
|
@ -938,7 +938,7 @@ void export_MEMSetGroupIDForExpHeap(PPCInterpreter_t* hCPU)
|
|||||||
ppcDefineParamMEMPTR(heap, MEMHeapBase, 0);
|
ppcDefineParamMEMPTR(heap, MEMHeapBase, 0);
|
||||||
ppcDefineParamU16(groupId, 1);
|
ppcDefineParamU16(groupId, 1);
|
||||||
coreinitMemLog_printf("MEMSetGroupIDForExpHeap(0x%08x, %d)", heap.GetMPTR(), groupId);
|
coreinitMemLog_printf("MEMSetGroupIDForExpHeap(0x%08x, %d)", heap.GetMPTR(), groupId);
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg(); // someone test this and the entire groupId feature
|
assert_dbg(); // someone test this and the entire groupId feature
|
||||||
#endif
|
#endif
|
||||||
uint16 oldGroupId = MEMSetGroupIDForExpHeap(heap.GetPtr(), groupId);
|
uint16 oldGroupId = MEMSetGroupIDForExpHeap(heap.GetPtr(), groupId);
|
||||||
|
@ -149,7 +149,7 @@ namespace coreinit
|
|||||||
|
|
||||||
void _debugCheckChain(OSThread_t* thread, OSThreadLink* threadLink)
|
void _debugCheckChain(OSThread_t* thread, OSThreadLink* threadLink)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
cemu_assert_debug(tail.IsNull() == head.IsNull());
|
cemu_assert_debug(tail.IsNull() == head.IsNull());
|
||||||
size_t linkOffset = getLinkOffset(thread, threadLink);
|
size_t linkOffset = getLinkOffset(thread, threadLink);
|
||||||
// expects thread to be in the chain
|
// expects thread to be in the chain
|
||||||
|
@ -20,7 +20,7 @@ void gx2Export_GX2InitColorBufferRegs(PPCInterpreter_t* hCPU)
|
|||||||
LatteAddrLib::GX2CalculateSurfaceInfo(colorBuffer->surface.format, colorBuffer->surface.width, colorBuffer->surface.height, colorBuffer->surface.depth, colorBuffer->surface.dim, colorBuffer->surface.tileMode, colorBuffer->surface.aa, _swapEndianU32(colorBuffer->viewMip), &surfaceInfo);
|
LatteAddrLib::GX2CalculateSurfaceInfo(colorBuffer->surface.format, colorBuffer->surface.width, colorBuffer->surface.height, colorBuffer->surface.depth, colorBuffer->surface.dim, colorBuffer->surface.tileMode, colorBuffer->surface.aa, _swapEndianU32(colorBuffer->viewMip), &surfaceInfo);
|
||||||
|
|
||||||
uint32 pitchHeight = (surfaceInfo.height * surfaceInfo.pitch) >> 6;
|
uint32 pitchHeight = (surfaceInfo.height * surfaceInfo.pitch) >> 6;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (colorBuffer->viewNumSlices != _swapEndianU32(1))
|
if (colorBuffer->viewNumSlices != _swapEndianU32(1))
|
||||||
forceLogDebug_printf("GX2InitColorBufferRegs(): With unsupported slice count %d", _swapEndianU32(colorBuffer->viewNumSlices));
|
forceLogDebug_printf("GX2InitColorBufferRegs(): With unsupported slice count %d", _swapEndianU32(colorBuffer->viewNumSlices));
|
||||||
if (surfaceInfo.pitch < 7)
|
if (surfaceInfo.pitch < 7)
|
||||||
@ -139,7 +139,7 @@ void gx2Export_GX2SetColorBuffer(PPCInterpreter_t* hCPU)
|
|||||||
|
|
||||||
GX2ColorBuffer* colorBufferBE = (GX2ColorBuffer*)memory_getPointerFromVirtualOffset(hCPU->gpr[3]);
|
GX2ColorBuffer* colorBufferBE = (GX2ColorBuffer*)memory_getPointerFromVirtualOffset(hCPU->gpr[3]);
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
gx2Log_printf("ColorBuffer tileMode %01x PhysAddr %08x fmt %04x res %dx%d Mip %d Slice %d", (uint32)colorBufferBE->surface.tileMode.value(), (uint32)colorBufferBE->surface.imagePtr, (uint32)colorBufferBE->surface.format.value(), (uint32)colorBufferBE->surface.width, (uint32)colorBufferBE->surface.height, _swapEndianU32(colorBufferBE->viewMip), _swapEndianU32(colorBufferBE->viewFirstSlice));
|
gx2Log_printf("ColorBuffer tileMode %01x PhysAddr %08x fmt %04x res %dx%d Mip %d Slice %d", (uint32)colorBufferBE->surface.tileMode.value(), (uint32)colorBufferBE->surface.imagePtr, (uint32)colorBufferBE->surface.format.value(), (uint32)colorBufferBE->surface.width, (uint32)colorBufferBE->surface.height, _swapEndianU32(colorBufferBE->viewMip), _swapEndianU32(colorBufferBE->viewFirstSlice));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -397,7 +397,7 @@ void gx2Export_GX2CopySurfaceEx(PPCInterpreter_t* hCPU)
|
|||||||
forceLogDebug_printf("rect left-top: %d/%d size: %d/%d", _swapEndianU32(rectSrc->left), _swapEndianU32(rectSrc->top), _swapEndianU32(rectSrc->right) - _swapEndianU32(rectSrc->left), _swapEndianU32(rectSrc->bottom) - _swapEndianU32(rectSrc->top));
|
forceLogDebug_printf("rect left-top: %d/%d size: %d/%d", _swapEndianU32(rectSrc->left), _swapEndianU32(rectSrc->top), _swapEndianU32(rectSrc->right) - _swapEndianU32(rectSrc->left), _swapEndianU32(rectSrc->bottom) - _swapEndianU32(rectSrc->top));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if( rectCount != 1 )
|
if( rectCount != 1 )
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
if( srcMip != 0 )
|
if( srcMip != 0 )
|
||||||
@ -440,7 +440,7 @@ void gx2Export_GX2ResolveAAColorBuffer(PPCInterpreter_t* hCPU)
|
|||||||
uint32 srcSlice = _swapEndianU32(srcColorBuffer->viewFirstSlice);
|
uint32 srcSlice = _swapEndianU32(srcColorBuffer->viewFirstSlice);
|
||||||
uint32 dstSlice = hCPU->gpr[6];
|
uint32 dstSlice = hCPU->gpr[6];
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if( _swapEndianU32(srcColorBuffer->viewMip) != 0 || _swapEndianU32(srcColorBuffer->viewFirstSlice) != 0 )
|
if( _swapEndianU32(srcColorBuffer->viewMip) != 0 || _swapEndianU32(srcColorBuffer->viewFirstSlice) != 0 )
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
|
@ -839,7 +839,7 @@ size_t header_callback(char* buffer, size_t size, size_t nitems, void* userdata)
|
|||||||
if (msg.order != QueueOrder_CBDone)
|
if (msg.order != QueueOrder_CBDone)
|
||||||
cemu_assert_suspicious();
|
cemu_assert_suspicious();
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
char debug[500];
|
char debug[500];
|
||||||
cemu_assert_debug((size*nitems) < 500);
|
cemu_assert_debug((size*nitems) < 500);
|
||||||
memcpy(debug, buffer, size*nitems);
|
memcpy(debug, buffer, size*nitems);
|
||||||
|
@ -592,7 +592,7 @@ namespace nn
|
|||||||
ppcDefineParamMPTR(funcMPTR, 1);
|
ppcDefineParamMPTR(funcMPTR, 1);
|
||||||
ppcDefineParamMPTR(customParam, 2);
|
ppcDefineParamMPTR(customParam, 2);
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
fpdPrepareRequest();
|
fpdPrepareRequest();
|
||||||
|
@ -537,7 +537,7 @@ namespace nsyshid
|
|||||||
|
|
||||||
_debugPrintHex("HIDSetReport", data, dataLength);
|
_debugPrintHex("HIDSetReport", data, dataLength);
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (reportRelatedUkn != 2 || reportId != 0)
|
if (reportRelatedUkn != 2 || reportId != 0)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
|
@ -116,7 +116,7 @@ sint32 _translateError(sint32 returnCode, sint32 wsaError, sint32 mode = _ERROR_
|
|||||||
break;
|
break;
|
||||||
case WSAECONNABORTED:
|
case WSAECONNABORTED:
|
||||||
debug_printf("WSAECONNABORTED\n");
|
debug_printf("WSAECONNABORTED\n");
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
@ -652,7 +652,7 @@ void nsysnetExport_inet_pton(PPCInterpreter_t* hCPU)
|
|||||||
invalidIp = true;
|
invalidIp = true;
|
||||||
if (d3 < 0 || d3 > 255)
|
if (d3 < 0 || d3 > 255)
|
||||||
invalidIp = true;
|
invalidIp = true;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (invalidIp)
|
if (invalidIp)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
@ -1245,7 +1245,7 @@ void nsysnetExport_gethostbyaddr(PPCInterpreter_t* hCPU)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (he->h_addrtype != AF_INET)
|
if (he->h_addrtype != AF_INET)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
if (he->h_length != sizeof(in_addr))
|
if (he->h_length != sizeof(in_addr))
|
||||||
|
@ -692,7 +692,7 @@ namespace snd_core
|
|||||||
{
|
{
|
||||||
if (internalShadowCopy->biquad.on == AX_BIQUAD_OFF)
|
if (internalShadowCopy->biquad.on == AX_BIQUAD_OFF)
|
||||||
return;
|
return;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (internalShadowCopy->biquad.on != 0x0200)
|
if (internalShadowCopy->biquad.on != 0x0200)
|
||||||
{
|
{
|
||||||
forceLogDebug_printf("AX_ApplyBiquad() with incorrect biquad.on value 0x%04x", _swapEndianU16(internalShadowCopy->biquad.on));
|
forceLogDebug_printf("AX_ApplyBiquad() with incorrect biquad.on value 0x%04x", _swapEndianU16(internalShadowCopy->biquad.on));
|
||||||
|
@ -702,7 +702,7 @@ namespace snd_core
|
|||||||
{
|
{
|
||||||
AXVPBInternal_t* internal = __AXVPBInternalVoiceArray + (sint32)vpb->index;
|
AXVPBInternal_t* internal = __AXVPBInternalVoiceArray + (sint32)vpb->index;
|
||||||
ratio *= 65536.0f;
|
ratio *= 65536.0f;
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (ratio >= 4294967296.0f)
|
if (ratio >= 4294967296.0f)
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
|
@ -309,13 +309,13 @@ void cbDeserializeArg_MiiMaker(deserializedArg_t* deserializedArg, void* customP
|
|||||||
}
|
}
|
||||||
else if (strcmp(deserializedArg->argument, "slot_id") == 0)
|
else if (strcmp(deserializedArg->argument, "slot_id") == 0)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// printf-style macros that are only active in non-release builds
|
// printf-style macros that are only active in non-release builds
|
||||||
|
|
||||||
#ifdef PUBLIC_RELEASE
|
#ifndef CEMU_DEBUG_ASSERTS
|
||||||
#define debug_printf(...)
|
#define debug_printf(...)
|
||||||
static void debugBreakpoint() { }
|
static void debugBreakpoint() { }
|
||||||
#else
|
#else
|
||||||
|
@ -121,12 +121,8 @@ void cemuLog_writeLineToLog(std::string_view text, bool date, bool new_line)
|
|||||||
const auto temp_time = std::chrono::system_clock::to_time_t(now);
|
const auto temp_time = std::chrono::system_clock::to_time_t(now);
|
||||||
const auto& time = *std::localtime(&temp_time);
|
const auto& time = *std::localtime(&temp_time);
|
||||||
|
|
||||||
#ifdef PUBLIC_RELEASE
|
|
||||||
auto time_str = fmt::format("[{:02d}:{:02d}:{:02d}] ", time.tm_hour, time.tm_min, time.tm_sec);
|
|
||||||
#else
|
|
||||||
auto time_str = fmt::format("[{:02d}:{:02d}:{:02d}.{:03d}] ", time.tm_hour, time.tm_min, time.tm_sec,
|
auto time_str = fmt::format("[{:02d}:{:02d}:{:02d}.{:03d}] ", time.tm_hour, time.tm_min, time.tm_sec,
|
||||||
std::chrono::duration_cast<std::chrono::milliseconds>(now - std::chrono::time_point_cast<std::chrono::seconds>(now)).count());
|
std::chrono::duration_cast<std::chrono::milliseconds>(now - std::chrono::time_point_cast<std::chrono::seconds>(now)).count());
|
||||||
#endif
|
|
||||||
|
|
||||||
LogContext.text_cache.emplace_back(std::move(time_str));
|
LogContext.text_cache.emplace_back(std::move(time_str));
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ bool cemuLog_log(LogType type, const T* format, TArgs&&... args)
|
|||||||
template<typename TFmt, typename ... TArgs>
|
template<typename TFmt, typename ... TArgs>
|
||||||
bool cemuLog_logDebug(LogType type, TFmt format, TArgs&&... args)
|
bool cemuLog_logDebug(LogType type, TFmt format, TArgs&&... args)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
return cemuLog_log(type, format, std::forward<TArgs>(args)...);
|
return cemuLog_log(type, format, std::forward<TArgs>(args)...);
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
@ -164,7 +164,7 @@ void cemuLog_force(TFmt format, TArgs&&... args)
|
|||||||
#define saveLog_printf(...) if( cafeLog_isLoggingFlagEnabled(LOG_TYPE_SAVE) ) cafeLog_log(LOG_TYPE_SAVE, __VA_ARGS__);
|
#define saveLog_printf(...) if( cafeLog_isLoggingFlagEnabled(LOG_TYPE_SAVE) ) cafeLog_log(LOG_TYPE_SAVE, __VA_ARGS__);
|
||||||
#define nfpLog_printf(...) if( cafeLog_isLoggingFlagEnabled(LOG_TYPE_NFP) ) cafeLog_log(LOG_TYPE_NFP, __VA_ARGS__);
|
#define nfpLog_printf(...) if( cafeLog_isLoggingFlagEnabled(LOG_TYPE_NFP) ) cafeLog_log(LOG_TYPE_NFP, __VA_ARGS__);
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
#define forceLogDebug_printf(...) cafeLog_log(LOG_TYPE_FORCE, __VA_ARGS__);
|
#define forceLogDebug_printf(...) cafeLog_log(LOG_TYPE_FORCE, __VA_ARGS__);
|
||||||
#define forceLogDebug_printfW(...) cafeLog_logW(LOG_TYPE_FORCE, __VA_ARGS__);
|
#define forceLogDebug_printfW(...) cafeLog_logW(LOG_TYPE_FORCE, __VA_ARGS__);
|
||||||
|
|
||||||
|
@ -3497,7 +3497,7 @@ void ppcAsmTestDisassembler()
|
|||||||
|
|
||||||
void ppcAsmTest()
|
void ppcAsmTest()
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
ppcAsmTestDisassembler();
|
ppcAsmTestDisassembler();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ sint32 nexService_parseResponse(uint8* data, sint32 length, nexServiceResponse_t
|
|||||||
protocolId &= 0x7F;
|
protocolId &= 0x7F;
|
||||||
if (isRequest)
|
if (isRequest)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg(); // should never reach since we handle requests before this function is called
|
assert_dbg(); // should never reach since we handle requests before this function is called
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -452,7 +452,7 @@ prudpIncomingPacket::prudpIncomingPacket(prudpStreamSettings_t* streamSettings,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
assert_dbg();
|
assert_dbg();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -607,7 +607,7 @@ void prudpClient::sortIncomingDataPacket(prudpIncomingPacket* incomingPacket)
|
|||||||
uint16 seqDif = sequenceIdIncomingPacket - queue_incomingPackets[insertIndex]->sequenceId;
|
uint16 seqDif = sequenceIdIncomingPacket - queue_incomingPackets[insertIndex]->sequenceId;
|
||||||
if (seqDif&0x8000)
|
if (seqDif&0x8000)
|
||||||
break; // negative seqDif -> insert before current element
|
break; // negative seqDif -> insert before current element
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
if (seqDif == 0)
|
if (seqDif == 0)
|
||||||
assert_dbg(); // same sequence id, sort by fragment index?
|
assert_dbg(); // same sequence id, sort by fragment index?
|
||||||
#endif
|
#endif
|
||||||
|
@ -361,7 +361,7 @@ inline void cemu_assert(bool _condition)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PUBLIC_RELEASE
|
#ifndef CEMU_DEBUG_ASSERT
|
||||||
//#define cemu_assert_debug(__cond) -> Forcing __cond not to be evaluated currently has unexpected side-effects
|
//#define cemu_assert_debug(__cond) -> Forcing __cond not to be evaluated currently has unexpected side-effects
|
||||||
|
|
||||||
inline void cemu_assert_debug(bool _condition)
|
inline void cemu_assert_debug(bool _condition)
|
||||||
|
@ -7,10 +7,8 @@
|
|||||||
// the minor version is used for experimental builds to indicate the build index. Set by command line option from CI build script
|
// the minor version is used for experimental builds to indicate the build index. Set by command line option from CI build script
|
||||||
// if zero, the version text will be constructed as LEAD.MAJOR, otherwise as LEAD.MAJOR-MINOR
|
// if zero, the version text will be constructed as LEAD.MAJOR, otherwise as LEAD.MAJOR-MINOR
|
||||||
|
|
||||||
#if !defined(PUBLIC_RELEASE)
|
#if defined(EMULATOR_VERSION_MINOR) && EMULATOR_VERSION_MINOR == 0
|
||||||
#define EMULATOR_VERSION_SUFFIX " (dev)"
|
#define EMULATOR_VERSION_SUFFIX ""
|
||||||
#elif defined(EMULATOR_VERSION_MINOR) && EMULATOR_VERSION_MINOR == 0
|
|
||||||
#define EMULATOR_VERSION_SUFFIX "" // stable
|
|
||||||
#else
|
#else
|
||||||
#define EMULATOR_VERSION_SUFFIX " (experimental)"
|
#define EMULATOR_VERSION_SUFFIX " (experimental)"
|
||||||
#endif
|
#endif
|
||||||
|
@ -1375,11 +1375,7 @@ void MainWindow::OnKeyUp(wxKeyEvent& event)
|
|||||||
SetFullScreen(false);
|
SetFullScreen(false);
|
||||||
else if (code == WXK_RETURN && event.AltDown())
|
else if (code == WXK_RETURN && event.AltDown())
|
||||||
SetFullScreen(!IsFullScreen());
|
SetFullScreen(!IsFullScreen());
|
||||||
#ifdef PUBLIC_RELEASE
|
|
||||||
else if (code == WXK_F12)
|
else if (code == WXK_F12)
|
||||||
#else
|
|
||||||
else if (code == WXK_F11)
|
|
||||||
#endif
|
|
||||||
g_window_info.has_screenshot_request = true; // async screenshot request
|
g_window_info.has_screenshot_request = true; // async screenshot request
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2058,7 +2054,7 @@ void MainWindow::RecreateMenu()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// add 'Stop emulation' menu entry to file menu
|
// add 'Stop emulation' menu entry to file menu
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
m_fileMenu->Append(MAINFRAME_MENU_ID_FILE_END_EMULATION, _("End emulation"));
|
m_fileMenu->Append(MAINFRAME_MENU_ID_FILE_END_EMULATION, _("End emulation"));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -2179,7 +2175,7 @@ void MainWindow::RecreateMenu()
|
|||||||
debugLoggingMenu->AppendSeparator();
|
debugLoggingMenu->AppendSeparator();
|
||||||
debugLoggingMenu->AppendCheckItem(MAINFRAME_MENU_ID_DEBUG_LOGGING0 + LOG_TYPE_OPENGL, _("&OpenGL debug output"), wxEmptyString)->Check(cafeLog_isLoggingFlagEnabled(LOG_TYPE_OPENGL));
|
debugLoggingMenu->AppendCheckItem(MAINFRAME_MENU_ID_DEBUG_LOGGING0 + LOG_TYPE_OPENGL, _("&OpenGL debug output"), wxEmptyString)->Check(cafeLog_isLoggingFlagEnabled(LOG_TYPE_OPENGL));
|
||||||
debugLoggingMenu->AppendCheckItem(MAINFRAME_MENU_ID_DEBUG_LOGGING0 + LOG_TYPE_VULKAN_VALIDATION, _("&Vulkan validation layer (slow)"), wxEmptyString)->Check(cafeLog_isLoggingFlagEnabled(LOG_TYPE_VULKAN_VALIDATION));
|
debugLoggingMenu->AppendCheckItem(MAINFRAME_MENU_ID_DEBUG_LOGGING0 + LOG_TYPE_VULKAN_VALIDATION, _("&Vulkan validation layer (slow)"), wxEmptyString)->Check(cafeLog_isLoggingFlagEnabled(LOG_TYPE_VULKAN_VALIDATION));
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
debugLoggingMenu->AppendCheckItem(MAINFRAME_MENU_ID_DEBUG_ADVANCED_PPC_INFO, _("&Log PPC context for API"), wxEmptyString)->Check(cemuLog_advancedPPCLoggingEnabled());
|
debugLoggingMenu->AppendCheckItem(MAINFRAME_MENU_ID_DEBUG_ADVANCED_PPC_INFO, _("&Log PPC context for API"), wxEmptyString)->Check(cemuLog_advancedPPCLoggingEnabled());
|
||||||
#endif
|
#endif
|
||||||
m_loggingSubmenu = debugLoggingMenu;
|
m_loggingSubmenu = debugLoggingMenu;
|
||||||
@ -2205,12 +2201,12 @@ void MainWindow::RecreateMenu()
|
|||||||
|
|
||||||
debugMenu->AppendSeparator();
|
debugMenu->AppendSeparator();
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
auto audioAuxOnly = debugMenu->AppendCheckItem(MAINFRAME_MENU_ID_DEBUG_AUDIO_AUX_ONLY, _("&Audio AUX only"), wxEmptyString);
|
auto audioAuxOnly = debugMenu->AppendCheckItem(MAINFRAME_MENU_ID_DEBUG_AUDIO_AUX_ONLY, _("&Audio AUX only"), wxEmptyString);
|
||||||
audioAuxOnly->Check(ActiveSettings::AudioOutputOnlyAux());
|
audioAuxOnly->Check(ActiveSettings::AudioOutputOnlyAux());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
debugMenu->Append(MAINFRAME_MENU_ID_DEBUG_VIEW_LOGGING_WINDOW, _("&Open logging window"));
|
debugMenu->Append(MAINFRAME_MENU_ID_DEBUG_VIEW_LOGGING_WINDOW, _("&Open logging window"));
|
||||||
#endif
|
#endif
|
||||||
debugMenu->Append(MAINFRAME_MENU_ID_DEBUG_VIEW_PPC_THREADS, _("&View PPC threads"));
|
debugMenu->Append(MAINFRAME_MENU_ID_DEBUG_VIEW_PPC_THREADS, _("&View PPC threads"));
|
||||||
|
35
src/main.cpp
35
src/main.cpp
@ -246,7 +246,7 @@ int mainEmulatorHLE()
|
|||||||
wxMessageBox("Cemu doesn't have write access to it's own directory.\nPlease move it to a different location or run Cemu as administrator!", "Warning", wxOK|wxICON_ERROR); // todo - different error messages per OS
|
wxMessageBox("Cemu doesn't have write access to it's own directory.\nPlease move it to a different location or run Cemu as administrator!", "Warning", wxOK|wxICON_ERROR); // todo - different error messages per OS
|
||||||
LatteOverlay_init();
|
LatteOverlay_init();
|
||||||
// run a couple of tests if in non-release mode
|
// run a couple of tests if in non-release mode
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
unitTests();
|
unitTests();
|
||||||
#endif
|
#endif
|
||||||
// init common
|
// init common
|
||||||
@ -338,39 +338,30 @@ void ToolShaderCacheMerger();
|
|||||||
|
|
||||||
#if BOOST_OS_WINDOWS
|
#if BOOST_OS_WINDOWS
|
||||||
|
|
||||||
#ifndef PUBLIC_RELEASE
|
// entrypoint for release builds
|
||||||
#include <crtdbg.h>
|
|
||||||
int wmain(int argc, wchar_t* argv[])
|
|
||||||
{
|
|
||||||
SDL_SetMainReady();
|
|
||||||
_CrtSetDbgFlag(_CRTDBG_CHECK_DEFAULT_DF);
|
|
||||||
//ToolShaderCacheMerger();
|
|
||||||
|
|
||||||
if (!LaunchSettings::HandleCommandline(argc, argv))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
ActiveSettings::LoadOnce();
|
|
||||||
|
|
||||||
HandlePostUpdate();
|
|
||||||
return mainEmulatorHLE();
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
int wWinMain( _In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPTSTR lpCmdLine, _In_ int nShowCmd)
|
int wWinMain( _In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPTSTR lpCmdLine, _In_ int nShowCmd)
|
||||||
{
|
{
|
||||||
SDL_SetMainReady();
|
SDL_SetMainReady();
|
||||||
|
|
||||||
if (!LaunchSettings::HandleCommandline(lpCmdLine))
|
if (!LaunchSettings::HandleCommandline(lpCmdLine))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ActiveSettings::LoadOnce();
|
ActiveSettings::LoadOnce();
|
||||||
|
|
||||||
HandlePostUpdate();
|
HandlePostUpdate();
|
||||||
return mainEmulatorHLE();
|
return mainEmulatorHLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
// entrypoint for debug builds with console
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
SDL_SetMainReady();
|
||||||
|
if (!LaunchSettings::HandleCommandline(argc, argv))
|
||||||
|
return 0;
|
||||||
|
ActiveSettings::LoadOnce();
|
||||||
|
HandlePostUpdate();
|
||||||
|
return mainEmulatorHLE();
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#if BOOST_OS_LINUX
|
#if BOOST_OS_LINUX
|
||||||
|
@ -95,7 +95,7 @@ namespace ZirEmitter
|
|||||||
void GLSL::GenerateBasicBlockCode(ZpIR::ZpIRBasicBlock& basicBlock)
|
void GLSL::GenerateBasicBlockCode(ZpIR::ZpIRBasicBlock& basicBlock)
|
||||||
{
|
{
|
||||||
// init context
|
// init context
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifdef CEMU_DEBUG_ASSERT
|
||||||
for (auto& itr : m_blockContext.regInlinedExpression)
|
for (auto& itr : m_blockContext.regInlinedExpression)
|
||||||
{
|
{
|
||||||
cemu_assert_debug(itr == nullptr); // leaked buffer
|
cemu_assert_debug(itr == nullptr); // leaked buffer
|
||||||
|
@ -139,8 +139,6 @@ typedef struct tagTHREADNAME_INFO
|
|||||||
void SetThreadName(const char* name)
|
void SetThreadName(const char* name)
|
||||||
{
|
{
|
||||||
#if BOOST_OS_WINDOWS
|
#if BOOST_OS_WINDOWS
|
||||||
|
|
||||||
#ifndef _PUBLIC_RELEASE
|
|
||||||
THREADNAME_INFO info;
|
THREADNAME_INFO info;
|
||||||
info.dwType = 0x1000;
|
info.dwType = 0x1000;
|
||||||
info.szName = name;
|
info.szName = name;
|
||||||
@ -154,9 +152,6 @@ void SetThreadName(const char* name)
|
|||||||
__except (EXCEPTION_EXECUTE_HANDLER) {
|
__except (EXCEPTION_EXECUTE_HANDLER) {
|
||||||
}
|
}
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#elif BOOST_OS_MACOS
|
#elif BOOST_OS_MACOS
|
||||||
pthread_setname_np(name);
|
pthread_setname_np(name);
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user