From 0a3fcb3cdfc1d9b834f88efc2e1bb00be724e4d5 Mon Sep 17 00:00:00 2001 From: Mow <32942550+taxicat1@users.noreply.github.com> Date: Sat, 23 May 2026 04:22:15 -0400 Subject: [PATCH] Add race condition patch for Houkago Shounen (Japan) (#178) --- CHANGELOG.md | 1 + data/patchlist.json | 24 ++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d255adc..a4bc2f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - DMA card read support for the DSTT platform - by @lifehackerhansol - DMA card read support for the M3DS platform - by @lifehackerhansol - AP patches for NRL Mascot Mania and AFL Mascot Manor - by @taxicat1 +- Houkago Shounen race condition patch - by @taxicat1 ### Fixed - DMA card read offsets for Pokemon Ranger (EU) - by @taxicat1 diff --git a/data/patchlist.json b/data/patchlist.json index ff9588d..1debdbf 100644 --- a/data/patchlist.json +++ b/data/patchlist.json @@ -323,7 +323,7 @@ { "type": "replace", "address": "0205653C", - "data": "20 B5 05 00 68 6F 01 38 07 D0 05 DF 68 6F 01 38 03 D0 90 21 68 58 40 00 01 38 20 BD", + "data": "20 B5 05 00 68 6F 01 38 07 D0 05 DF 68 6F 01 38 03 D0 90 21 68 58 40 00 01 38 20 BD" } ] }, @@ -334,7 +334,27 @@ { "type": "replace", "address": "0205653C", - "data": "20 B5 05 00 68 6F 01 38 07 D0 05 DF 68 6F 01 38 03 D0 90 21 68 58 40 00 01 38 20 BD", + "data": "20 B5 05 00 68 6F 01 38 07 D0 05 DF 68 6F 01 38 03 D0 90 21 68 58 40 00 01 38 20 BD" + } + ] + }, + + // YHGJ - Houkago Shounen (Japan) + // + // This game has a save speed race condition leading to a softlock. The game will draw a face in the notebook during the + // card async wait, and once the face is finished, set a flag to advance the menu state. But if saving finishes too quickly, + // it will exit the async wait, stop calling the face-drawing function, never finish it, never set the flag, and become stuck. + // To fix this, part of the saving function is rewritten to include a check for if the async wait idle callback function is the one + // that draws the face, and if this is the final block of save data to be written (saving happens in four blocks). + // If both of these are true, then it will loop calling the save idle callback until the menu advance flag is set. + { + "gameCode": "YHGJ", // Houkago Shounen (Japan) + "gameVersion": 0, + "patches": [ + { + "type": "replace", + "address": "02027EB4", + "data": "FF FF FF FA 08 4D A8 42 0C D1 3F 0C 0A D2 76 09 08 D2 06 4E F6 68 A8 47 30 78 05 28 FB D1 30 79 1C 28 F8 D3 00 F0 52 E8 50 C1 09 02 CC 87 0C 02" } ] },