shithub: cstory

Download patch

ref: 078dc440c760d375ad361264dd87c404f89534be
parent: fc9270ec8ca5840b3493f89d2d163ebc8b6fec22
author: Clownacy <Clownacy@users.noreply.github.com>
date: Thu Jun 20 16:33:47 EDT 2019

Made TextScr.cpp ASM-accurate

Yes! Finally!

Working towards #74

--- a/src/Game.cpp
+++ b/src/Game.cpp
@@ -468,7 +468,7 @@
 	InitFlags();
 	InitBossLife();
 
-	if ((bContinue && LoadProfile(NULL)) || InitializeGame())
+	if ((bContinue && LoadProfile(NULL)) || InitializeGame(ghWnd))
 	{
 		while (1)
 		{
--- a/src/Profile.cpp
+++ b/src/Profile.cpp
@@ -241,8 +241,10 @@
 	return TRUE;
 }
 
-BOOL InitializeGame()
+BOOL InitializeGame(HWND hWnd)
 {
+	(void)hWnd;
+
 	InitMyChar();
 	gSelectedArms = 0;
 	gSelectedItem = 0;
--- a/src/Profile.h
+++ b/src/Profile.h
@@ -33,4 +33,4 @@
 BOOL IsProfile();
 BOOL SaveProfile(const char *name);
 BOOL LoadProfile(const char *name);
-BOOL InitializeGame();
+BOOL InitializeGame(HWND hWnd);
--- a/src/TextScr.cpp
+++ b/src/TextScr.cpp
@@ -558,6 +558,7 @@
 	char c[3];
 	int w, x, y, z;
 	int i;
+	char str[72];
 
 	RECT rcSymbol = {64, 48, 72, 56};
 
@@ -1164,7 +1165,7 @@
 					}
 					else if (IS_COMMAND('I','N','I'))
 					{
-						InitializeGame();
+						InitializeGame(ghWnd);
 						gTS.p_read += 4;
 					}
 					else if (IS_COMMAND('S','V','P'))
@@ -1175,7 +1176,7 @@
 					else if (IS_COMMAND('L','D','P'))
 					{
 						if (!LoadProfile(NULL))
-							InitializeGame();
+							InitializeGame(ghWnd);
 					}
 					else if (IS_COMMAND('F','A','C'))
 					{
@@ -1251,7 +1252,7 @@
 						char str_0[0x40];
 						#ifdef NONPORTABLE
 						sprintf(str_0, "�s���̃R�[�h:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]);
-						MessageBoxA(ghWnd, str_0, "�G���[", 0);
+						MessageBoxA(0, str_0, "�G���[", 0);
 						#else
 							#ifdef JAPANESE
 							sprintf(str_0, "�s���̃R�[�h:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]);
@@ -1282,7 +1283,6 @@
 					else if (gTS.flags & 0x10)
 					{
 						//SAT/CAT/TUR printing
-						char str[72];
 						x = gTS.p_read;
 						//Break if reaches command, or new-line
 						while (gTS.data[x] != '<' && gTS.data[x] != '\r')