6 Commits

Author SHA1 Message Date
patchzyy 8d5d93f02d version update 2026-08-24 13:40:44 +02:00
patchzyy c75b482224 Merge pull request #17 from patchzyy/decompress-overlow
Fix szs memory corruption
2026-08-24 12:03:50 +02:00
patchzyy e5ae29b27e Create egg_decomp.cpp 2026-08-24 11:30:11 +02:00
patchzyy 384623a4c7 version update 2026-08-23 23:12:34 +02:00
patchzyy 6c2712307e Update vi.cpp 2026-08-23 23:04:32 +02:00
patchzyy c5a53ce0b3 Update InstallerEngine.cs 2026-08-23 22:57:28 +02:00
6 changed files with 94 additions and 21 deletions
+1 -1
View File
@@ -253,7 +253,7 @@ foreach ($required in @('ToolkitFingerprint','TranslationFingerprint','NativeToo
$manifest = [ordered]@{
SchemaVersion = 2
ProductVersion = '0.2.20'
ProductVersion = '0.2.22'
ExpectedGameId = $pins.GameId
ExpectedDolSha256 = $pins.DolSha256
ExpectedRelSha256 = $pins.RelSha256
+17 -17
View File
@@ -305,27 +305,27 @@ internal sealed class InstallerEngine
RuntimeConfiguration.SetRetroRewindRoot(configPath, canonicalRetroRoot);
transaction.Commit();
// A portable installation is owned by the folder it lives in, not by this machine. Adding a
// machine-wide uninstall entry for it would outlive the folder and, worse, would overwrite
// the entry of a normal installation on the same account.
if (PortableRoot.TryFind(installDirectory) is not null)
try
{
_reporter.Diagnostic(
"Portable installation: no Windows uninstall entry was registered. Remove the folder, " +
"or run the copied setup with --uninstall, to uninstall it.");
}
else
{
try
// A portable installation is owned by the folder it lives in, not by this machine. Adding
// a machine-wide uninstall entry for it would outlive the folder and, worse, would
// overwrite the entry of a normal installation on the same account.
if (PortableRoot.TryFind(installDirectory) is not null)
{
_reporter.Diagnostic(
"Portable installation: no Windows uninstall entry was registered. Remove the folder, " +
"or run the copied setup with --uninstall, to uninstall it.");
}
else
{
ShellIntegration.RegisterUninstaller(installDirectory, state.RetroRewindInstalled);
ShellIntegration.CreateShortcuts(installDirectory);
}
catch (Exception ex)
{
_reporter.Diagnostic("The installation succeeded, but Windows shell integration failed: " +
ex.Message);
}
ShellIntegration.CreateShortcuts(installDirectory);
}
catch (Exception ex)
{
_reporter.Diagnostic("The installation succeeded, but Windows shell integration failed: " +
ex.Message);
}
_reporter.Progress(InstallStages.Publish, "Installation complete.", completionPercent);
+1 -1
View File
@@ -121,7 +121,7 @@ internal static class PlatformChecks
internal static class ProductInfo
{
public const string Name = "WiiCompiled";
public const string Version = "0.2.20";
public const string Version = "0.2.22";
/// <summary>
/// The setup executable is copied into the installation under this name. It is the launcher and
@@ -7,7 +7,7 @@
<AssemblyName>WiiCompiled.Setup</AssemblyName>
<RootNamespace>WiiCompiled.Setup</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Version>0.2.20</Version>
<Version>0.2.22</Version>
<Authors>patchzy</Authors>
<Product>WiiCompiled</Product>
<Description>Command-line installer and launcher for WiiCompiled</Description>
+61
View File
@@ -0,0 +1,61 @@
#include "hle_stubs.h"
#include <cstdint>
#include "memory.h"
#include "runtime_log.h"
// Native because a crafted Yaz0 run writes past the caller's buffer
// (github.com/vabold/szsHaxx)
// https://github.com/vabold/Kinoko/blob/main/source/egg/core/Decomp.cc
extern "C" uint32_t EGG_Decomp_decodeSZS_80218c2c(uint32_t src, uint32_t dst)
{
const uint32_t expandSize = (static_cast<uint32_t>(MemoryInline::FlatRead8(src + 4)) << 24) |
(static_cast<uint32_t>(MemoryInline::FlatRead8(src + 5)) << 16) |
(static_cast<uint32_t>(MemoryInline::FlatRead8(src + 6)) << 8) |
static_cast<uint32_t>(MemoryInline::FlatRead8(src + 7));
uint32_t srcIdx = 16;
uint32_t dstIdx = 0;
uint32_t mask = 0;
uint32_t flags = 0;
while (static_cast<int32_t>(dstIdx) < static_cast<int32_t>(expandSize)) {
if (mask == 0) {
flags = MemoryInline::FlatRead8(src + srcIdx++);
mask = 0x80;
}
if ((flags & mask) != 0) {
MemoryInline::FlatWrite8(dst + dstIdx++, MemoryInline::FlatRead8(src + srcIdx++));
} else {
const uint32_t high = MemoryInline::FlatRead8(src + srcIdx);
const uint32_t low = MemoryInline::FlatRead8(src + srcIdx + 1);
srcIdx += 2;
const uint32_t rep = (high << 8) | low;
uint32_t copyIdx = dstIdx - (rep & 0xFFF) - 1;
uint32_t count = rep >> 12;
count = count != 0
? count + 2
: static_cast<uint32_t>(MemoryInline::FlatRead8(src + srcIdx++)) + 18;
for (uint32_t i = 0; i < count; ++i) {
if (dstIdx >= expandSize) {
RT_LOG(RT_TAG_HLE) << "decodeSZS: malformed stream from 0x" << std::hex << src
<< std::dec << ", stopped after " << dstIdx << " of "
<< expandSize << " bytes" << std::endl;
return expandSize;
}
MemoryInline::FlatWrite8(dst + dstIdx++, MemoryInline::FlatRead8(dst + copyIdx++));
}
}
mask >>= 1;
}
return expandSize;
}
PPC_NATIVE_OVERRIDE(80218C2C, EGG_Decomp_decodeSZS_80218c2c, uint32_t,
(uint32_t src, uint32_t dst), (src, dst));
+13 -1
View File
@@ -259,6 +259,12 @@ uint32_t ExtractTvFormat(uint32_t tvMode) {
// Re-entry guard to prevent AdvanceRetrace calling itself via OSWakeupThread -> SelectThread
static std::atomic<bool> s_inAdvanceRetrace{false};
// Set while VI_HLE_PresentFrame runs its seal/pace/pre-warm sequence. Guest callbacks
// serviced during that window (pace-loop alarms, GX timing polls) still see the stale
// hasValidXfb/g_auroraFrameActive flags; a retrace-context present fired from them would
// end the freshly pre-warmed empty frame and show it as a black frame group.
static std::atomic<bool> s_presentSequenceActive{false};
void AdvanceRetrace(CpuContext* ctx, Clock::time_point retraceStamp, bool serviceAurora) {
// Prevent re-entry - this can happen if OSWakeupThread triggers SelectThread
// which goes idle and calls ProcessTimerEvents again
@@ -347,7 +353,7 @@ void AdvanceRetrace(CpuContext* ctx, Clock::time_point retraceStamp, bool servic
// VISetBlack(TRUE) keeps frame submission running but shows only the clear color: GX render work is
// skipped and Aurora's end_frame() clears to black, matching the hardware manual's "signal continues,
// pixels go black" behavior. When not black, submission waits for hasXfbReady (GXCopyDisp done).
if (serviceAurora) {
if (serviceAurora && !s_presentSequenceActive.load(std::memory_order_acquire)) {
const bool frameActive = g_auroraFrameActive.load(std::memory_order_acquire);
const bool xfbMatches = (readyXfb != 0 && readyXfb == currentFb);
const bool shouldPresentXfb = hasXfbReady && !isBlack && xfbMatches;
@@ -512,6 +518,12 @@ void PaceToRetraceBoundary(Clock::time_point deadline) {
// producer to the VI retrace boundary, and pre-warms the next frame. Paced from GXCopyDisp; unpaced for
// the retrace-context black/boot present path in AdvanceRetrace.
void VI_HLE_PresentFrame(bool presentedXfb, bool paceToRetrace) {
if (s_presentSequenceActive.exchange(true, std::memory_order_acq_rel)) {
return;
}
struct SequenceGuard {
~SequenceGuard() { s_presentSequenceActive.store(false, std::memory_order_release); }
} sequenceGuard;
Clock::time_point paceDeadline{};
bool paceThisFrame = false;
if (paceToRetrace) {