mirror of
https://github.com/ARMSX2/ARMSX2.git
synced 2026-08-24 16:50:16 -07:00
Revert the palette fallback and the purge notice
Both existed to work around the wrong diagnosis. The Persona 3 FES mods were not failing in the texture cache at all -- a PNACH mod was switched off by the enable-list purge, and because PNACH mods patch game DATA the texture pack keyed to the patched font stopped matching as a side effect. The palette fallback substituted a different colour variant of a glyph when the exact palette was missing. It raised the hit count but could not be right: the palette IS the colour, so substituted art carries the wrong shade, and it never addressed why the hashes moved. Gone; the replacement path behaves exactly as it always did. The one-time notice goes too, per jpolo1224: the purge no longer takes deliberate lists, so nothing needs announcing going forward. Kept: the diagnostics that actually found this -- files scanned versus indexed versus shadowed, hit and miss counts, and the per-miss detail naming what the pack holds for that texture. Those are what turned "mods do not apply" into a measurement, and they cost nothing when nothing is wrong.
This commit is contained in:
@@ -529,7 +529,6 @@ static u64 s_lookup_hits = 0;
|
||||
static u64 s_lookup_misses = 0;
|
||||
static u64 s_lookup_clut_only_misses = 0;
|
||||
static u64 s_lookup_next_report = 0;
|
||||
static u64 s_palette_reports = 0;
|
||||
|
||||
void GSTextureReplacements::ReloadReplacementMap()
|
||||
{
|
||||
@@ -541,7 +540,6 @@ void GSTextureReplacements::ReloadReplacementMap()
|
||||
s_lookup_misses = 0;
|
||||
s_lookup_clut_only_misses = 0;
|
||||
s_lookup_next_report = 0;
|
||||
s_palette_reports = 0;
|
||||
|
||||
// clear out the caches
|
||||
{
|
||||
@@ -825,44 +823,6 @@ GSTexture* GSTextureReplacements::LookupReplacementTexture(const GSTextureCache:
|
||||
//
|
||||
// What is left is the diagnostic. List what the pack DOES hold for this TEX0, so a log says
|
||||
// whether the pack is missing the texture entirely or merely missing this colour of it.
|
||||
// ★ Palette fallback: use another colour of the same glyph when the exact one is absent.
|
||||
//
|
||||
// A paletted replacement is keyed on TEX0 hash AND palette hash, so a pack only applies while
|
||||
// the game asks for a palette its packer happened to dump. Persona 3 FES lands exactly there:
|
||||
// the pack holds several palette variants of each glyph and the game asks for one that is not
|
||||
// among them, so every glyph misses while the unpaletted art around it replaces fine.
|
||||
//
|
||||
// Lowest palette hash, deliberately. It is arbitrary, but it is STABLE -- the same glyph
|
||||
// resolves to the same file on every draw and every run, so text renders in one consistent
|
||||
// colour. Choosing by file mtime instead was tried and was worse in a way worth recording:
|
||||
// different glyphs won different variants and the text came out multicoloured.
|
||||
//
|
||||
// The colour can still be wrong, because the replacement image has the packer's palette baked
|
||||
// into it and there is no way to recolour it. That is the trade: a mod that applies in the
|
||||
// wrong shade beats a mod that does not apply.
|
||||
if (fnit == s_replacement_texture_filenames.end() && name.HasPalette())
|
||||
{
|
||||
const TextureName* best = nullptr;
|
||||
for (const auto& it : s_replacement_texture_filenames)
|
||||
{
|
||||
if (it.first.TEX0Hash != name.TEX0Hash || it.first.bits != name.bits ||
|
||||
it.first.region_width != name.region_width || it.first.region_height != name.region_height)
|
||||
continue;
|
||||
if (!best || it.first.CLUTHash < best->CLUTHash)
|
||||
best = &it.first;
|
||||
}
|
||||
if (best)
|
||||
{
|
||||
if (s_palette_reports < 6)
|
||||
{
|
||||
Console.WriteLnFmt("Texture replacements: palette fallback tex0={:016x} wanted clut={:016x}, using clut={:016x}",
|
||||
name.TEX0Hash, name.CLUTHash, best->CLUTHash);
|
||||
s_palette_reports++;
|
||||
}
|
||||
fnit = s_replacement_texture_filenames.find(*best);
|
||||
}
|
||||
}
|
||||
|
||||
if (fnit == s_replacement_texture_filenames.end())
|
||||
{
|
||||
// ★ The second half of the "my pack does nothing" diagnosis, and the half that was
|
||||
|
||||
@@ -394,7 +394,6 @@ private val BASE_EN: Map<String, String> = mapOf(
|
||||
"action.ok" to "OK",
|
||||
"action.save" to "Save",
|
||||
"action.edit" to "Edit",
|
||||
"patch.purgeNotice" to "Heads up: an earlier update reset the list of enabled patches and cheats. If you used any — including PNACH game mods — re-enable them in Patches & Cheats.",
|
||||
"patches.editor.new" to "New patch file",
|
||||
"patches.editor.paste" to "Paste",
|
||||
"patches.editor.placeholder" to "patch=1,EE,00000000,extended,00000000",
|
||||
|
||||
@@ -1889,21 +1889,6 @@ open class MainActivityRuntime : ComponentActivity() {
|
||||
if (!prefs.getBoolean("patchEnableListsPurged.v2", false)) {
|
||||
runCatching { NativeApp.purgeGlobalPatchEnableLists() }
|
||||
.onSuccess { prefs.edit { putBoolean("patchEnableListsPurged.v2", true) } }
|
||||
} else if (!prefs.getBoolean("patchPurgeNoticeShown", false)) {
|
||||
// ★ Tell the people the v1/v2 purge already hit.
|
||||
//
|
||||
// Those runs deleted every [Patches]/[Cheats] Enable entry, not just the
|
||||
// self-armed ones, so anyone who had deliberately turned a patch or cheat on lost
|
||||
// it silently on update. It surfaces in the worst possible way: a PNACH mod that
|
||||
// patches game data stops applying, the texture pack keyed to the patched data
|
||||
// stops matching with it, and the whole thing reads as "my texture mods broke"
|
||||
// (JustVibin247, Persona 3 FES). The purge itself now discriminates -- see
|
||||
// purgeGlobalPatchEnableLists -- but that cannot give anyone back what v2 removed.
|
||||
// Saying so once is the only repair available.
|
||||
prefs.edit { putBoolean("patchPurgeNoticeShown", true) }
|
||||
runCatching {
|
||||
com.armsx2.ui.WelcomeBanner.show(com.armsx2.i18n.I18n.get("patch.purgeNotice"))
|
||||
}
|
||||
}
|
||||
|
||||
// Pin Filenames/BIOS to the file the setup wizard copied —
|
||||
|
||||
Reference in New Issue
Block a user