summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSonic Dreamcaster <alejandro.asenjo88@gmail.com>2025-05-24 18:28:43 -0300
committerSonic Dreamcaster <alejandro.asenjo88@gmail.com>2025-05-24 18:28:43 -0300
commit99288aaf57d7779f3bc66e6be03575847e8825da (patch)
treebbd538fff17437d5344058ac83823b0b4a081fe1
parenta61e0dd9e9ee7d998c019f3d3110b44c7de648e2 (diff)
better fix for the ending
-rw-r--r--src/overlays/ovl_ending/fox_end1.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/overlays/ovl_ending/fox_end1.c b/src/overlays/ovl_ending/fox_end1.c
index 5c3fbcdb..efdf3076 100644
--- a/src/overlays/ovl_ending/fox_end1.c
+++ b/src/overlays/ovl_ending/fox_end1.c
@@ -48,6 +48,25 @@ bool D_ending_80198584;
s32 D_ending_80198588;
s32 D_ending_8019858C;
+void Ending_Port_InitOverlay(void) {
+ D_ending_80192E70 = 0; // ending sequence frame counter
+ D_ending_80196D04 = 0; // ending text frame counter
+ memset(D_ending_80196D08, 0, sizeof(D_ending_80196D08));
+ D_ending_80196F88 = 0;
+ D_ending_80196F8C = 0;
+ D_ending_80196F90 = 0;
+ D_ending_80196F94 = 0;
+ D_ending_80196F98 = 0;
+ D_ending_80196F9C = 0.0f;
+ memset(D_ending_80196FA0, 0, sizeof(D_ending_80196FA0));
+ memset(D_ending_80197900, 0, sizeof(D_ending_80197900));
+ memset(D_ending_80198260, 0, sizeof(D_ending_80198260));
+ D_ending_80198580 = 0.0f;
+ D_ending_80198584 = false;
+ D_ending_80198588 = 0;
+ D_ending_8019858C = 0;
+}
+
const char str1[] = "fogR= %d, fogG= %d, fogB= %d\n";
const char str2[] = "ligR= %d, ligG= %d, ligB= %d\n";
const char str3[] = "kanR= %d, kanG= %d, kanB= %d\n";
@@ -1038,10 +1057,10 @@ void Ending_Main(void) {
D_ending_80196D00 = 1;
// @port Bugfix:
- // In the original game, this variable is set zero when the overlay is reloaded.
- // Since we don't use overlays, the absence of this counter reset causes the ending not to play
- // after a the first playthrough.
- D_ending_80192E70 = 0;
+ // In the original game, these variables are set to zero when the overlay is reloaded.
+ // Since we don't use overlays, the absence of this initializer causes the ending not to play
+ // as it should after a the first playthrough.
+ Ending_Port_InitOverlay();
break;
case 1: