Compare commits

..

1 Commits

Author SHA1 Message Date
DeaTh-G f90d99320f Implement fix for Skyscraper Scamper Act 1 (Day) building drawing incorrectly 2026-02-28 14:58:58 +01:00
7 changed files with 35 additions and 14 deletions
-2
View File
@@ -351,8 +351,6 @@ if (UNLEASHED_RECOMP_FLATPAK)
"GAME_INSTALL_DIRECTORY=\"/var/data\""
)
endif()
target_compile_definitions(UnleashedRecomp PRIVATE $<$<CONFIG:Debug>:UNLEASHED_RECOMP_DEBUG=1>)
find_package(CURL REQUIRED)
+5 -5
View File
@@ -3145,7 +3145,7 @@ static GuestTexture* CreateTexture(uint32_t width, uint32_t height, uint32_t dep
g_textureDescriptorSet->setTexture(texture->descriptorIndex, texture->texture, RenderTextureLayout::SHADER_READ, texture->textureView.get());
#ifdef UNLEASHED_RECOMP_DEBUG
#ifdef _DEBUG
texture->texture->setName(fmt::format("Texture {:X}", g_memory.MapVirtual(texture)));
#endif
@@ -3162,7 +3162,7 @@ static GuestBuffer* CreateVertexBuffer(uint32_t length)
auto buffer = g_userHeap.AllocPhysical<GuestBuffer>(ResourceType::VertexBuffer);
buffer->buffer = g_device->createBuffer(RenderBufferDesc::VertexBuffer(length, GetBufferHeapType(), RenderBufferFlag::INDEX));
buffer->dataSize = length;
#ifdef UNLEASHED_RECOMP_DEBUG
#ifdef _DEBUG
buffer->buffer->setName(fmt::format("Vertex Buffer {:X}", g_memory.MapVirtual(buffer)));
#endif
return buffer;
@@ -3175,7 +3175,7 @@ static GuestBuffer* CreateIndexBuffer(uint32_t length, uint32_t, uint32_t format
buffer->dataSize = length;
buffer->format = ConvertFormat(format);
buffer->guestFormat = format;
#ifdef UNLEASHED_RECOMP_DEBUG
#ifdef _DEBUG
buffer->buffer->setName(fmt::format("Index Buffer {:X}", g_memory.MapVirtual(buffer)));
#endif
return buffer;
@@ -3213,7 +3213,7 @@ static GuestSurface* CreateSurface(uint32_t width, uint32_t height, uint32_t for
surface->descriptorIndex = g_textureDescriptorAllocator.allocate();
g_textureDescriptorSet->setTexture(surface->descriptorIndex, surface->textureHolder.get(), RenderTextureLayout::SHADER_READ, surface->textureView.get());
#ifdef UNLEASHED_RECOMP_DEBUG
#ifdef _DEBUG
surface->texture->setName(fmt::format("{} {:X}", desc.flags & RenderTextureFlag::RENDER_TARGET ? "Render Target" : "Depth Stencil", g_memory.MapVirtual(surface)));
#endif
@@ -5857,7 +5857,7 @@ static void MakePictureData(GuestPictureData* pictureData, uint8_t* data, uint32
if (LoadTexture(texture, data, dataSize, {}))
{
#ifdef UNLEASHED_RECOMP_DEBUG
#ifdef _DEBUG
texture.texture->setName(reinterpret_cast<char*>(g_memory.Translate(pictureData->name + 2)));
#endif
XXH64_hash_t hash = XXH3_64bits(data, dataSize);
+1 -1
View File
@@ -203,7 +203,7 @@ uint32_t XamShowMessageBoxUI(uint32_t dwUserIndex, be<uint16_t>* wszTitle, be<ui
{
*pResult = cButtons ? cButtons - 1 : 0;
#if UNLEASHED_RECOMP_DEBUG
#if _DEBUG
assert("XamShowMessageBoxUI encountered!" && false);
#elif _WIN32
// This code is Win32-only as it'll most likely crash, misbehave or
+4 -4
View File
@@ -11,7 +11,7 @@
#define LOG_WARNING(str) LOG_IMPL(Warning, __func__, str)
#define LOG_ERROR(str) LOG_IMPL(Error, __func__, str)
#if UNLEASHED_RECOMP_DEBUG
#if _DEBUG
#define LOG_UTILITY(str) LOG_IMPL(Utility, __func__, str)
#else
#define LOG_UTILITY(str)
@@ -21,7 +21,7 @@
#define LOGF_WARNING(str, ...) LOGF_IMPL(Warning, __func__, str, __VA_ARGS__)
#define LOGF_ERROR(str, ...) LOGF_IMPL(Error, __func__, str, __VA_ARGS__)
#if UNLEASHED_RECOMP_DEBUG
#if _DEBUG
#define LOGF_UTILITY(str, ...) LOGF_IMPL(Utility, __func__, str, __VA_ARGS__)
#else
#define LOGF_UTILITY(str, ...)
@@ -33,7 +33,7 @@
#define LOGN_WARNING(str) LOG_IMPL(Warning, "*", str)
#define LOGN_ERROR(str) LOG_IMPL(Error, "*", str)
#if UNLEASHED_RECOMP_DEBUG
#if _DEBUG
#define LOGN_UTILITY(str) LOG_IMPL(Utility, "*", str)
#else
#define LOGN_UTILITY(str)
@@ -43,7 +43,7 @@
#define LOGFN_WARNING(str, ...) LOGF_IMPL(Warning, "*", str, __VA_ARGS__)
#define LOGFN_ERROR(str, ...) LOGF_IMPL(Error, "*", str, __VA_ARGS__)
#if UNLEASHED_RECOMP_DEBUG
#if _DEBUG
#define LOGFN_UTILITY(str, ...) LOGF_IMPL(Utility, "*", str, __VA_ARGS__)
#else
#define LOGFN_UTILITY(str, ...)
+23
View File
@@ -141,3 +141,26 @@ PPC_FUNC(sub_82E38650)
__imp__sub_82E38650(ctx, base);
}
// Part of the building right after exiting the tunnel after the drift turn after the first checkpoint
// is placed on an transparent mesh slot. This somehow works. Except on high-performance Windows machines,
// hinting at the fact that its related to some scheduler issue with the asset loading.
// We can fix it by detecting the asset runtime, and combining the opaque and transparent mesh slots by
// using the name offset field on the mesh group as an additional value in the array and shifting the
// opaque mesh slot's offset back by one and then correcting the offset table for this change.
// Hedgehog::Mirage::CTerrainModelData::Make
PPC_FUNC_IMPL(__imp__sub_82E39618);
PPC_FUNC(sub_82E39618)
{
if (ctx.r5.u32 == 0xA470 && XXH3_64bits(base + ctx.r4.u32, ctx.r5.u32) == 0x8474C14C113626D2)
{
PPC_STORE_U32(ctx.r4.u32 + 0x28, 7);
PPC_STORE_U32(ctx.r4.u32 + 0x2C, 0x38);
PPC_STORE_U32(ctx.r4.u32 + 0x30, 0);
PPC_STORE_U32(ctx.r4.u32 + 0x50, 0x88C4);
PPC_STORE_U32(ctx.r4.u32 + 0xA438, 0x38);
}
__imp__sub_82E39618(ctx, base);
}
+1 -1
View File
@@ -3,7 +3,7 @@
#define UNLEASHED_RECOMP_VERSION_BIN @WIN32_VERSION_BINARY@
#define UNLEASHED_RECOMP_VERSION_STR "@WIN32_VERSION_STRING@"
#ifdef UNLEASHED_RECOMP_DEBUG
#ifdef _DEBUG
#define UNLEASHED_RECOMP_FILE_FLAGS VS_FF_DEBUG
#else
#define UNLEASHED_RECOMP_FILE_FLAGS 0
+1 -1
View File
@@ -817,7 +817,7 @@ void Config::Load()
{
def->ReadValue(toml);
#if UNLEASHED_RECOMP_DEBUG
#if _DEBUG
LOGFN_UTILITY("{} (0x{:X})", def->GetDefinition().c_str(), (intptr_t)def->GetValue());
#endif
}