shithub: cstory

Download patch

ref: 4e50046d4b4c57f2b4d7bcf20dedcb913c266020
parent: 44f3b15348b7794d28e59b258d8b59d0fbbb09fc
author: Clownacy <Clownacy@users.noreply.github.com>
date: Tue Sep 3 22:11:21 EDT 2019

Remove WINDOWS and NONPORTABLE

Now that the portable stuff gets its own branch, these are unneeded

--- a/Makefile
+++ b/Makefile
@@ -41,7 +41,7 @@
 	CXXFLAGS += -DDEBUG_SAVE
 endif
 
-CXXFLAGS += -std=c++98 -MMD -MP -MF $@.d -DWINDOWS -DNONPORTABLE
+CXXFLAGS += -std=c++98 -MMD -MP -MF $@.d
 LIBS += -lkernel32 -lgdi32 -lddraw -ldinput -ldsound -lversion -lshlwapi -limm32 -lwinmm -ldxguid
 
 ifeq ($(STATIC), 1)
--- a/msvc2003/CSE2.vcproj
+++ b/msvc2003/CSE2.vcproj
@@ -22,7 +22,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories=""
-				PreprocessorDefinitions="WIN32;_DEBUG;WINDOWS;NONPORTABLE"
+				PreprocessorDefinitions="WIN32;_DEBUG"
 				MinimalRebuild="TRUE"
 				BasicRuntimeChecks="0"
 				RuntimeLibrary="1"
@@ -74,7 +74,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories=""
-				PreprocessorDefinitions="WIN32;NDEBUG;WINDOWS;NONPORTABLE"
+				PreprocessorDefinitions="WIN32;NDEBUG"
 				MinimalRebuild="TRUE"
 				RuntimeLibrary="0"
 				AssemblerOutput="4"
@@ -124,7 +124,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories=""
-				PreprocessorDefinitions="WIN32;NDEBUG;WINDOWS;NONPORTABLE;JAPANESE"
+				PreprocessorDefinitions="WIN32;NDEBUG;JAPANESE"
 				MinimalRebuild="TRUE"
 				RuntimeLibrary="0"
 				AssemblerOutput="4"
@@ -174,7 +174,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories=""
-				PreprocessorDefinitions="WIN32;_DEBUG;WINDOWS;NONPORTABLE;JAPANESE"
+				PreprocessorDefinitions="WIN32;_DEBUG;JAPANESE"
 				MinimalRebuild="TRUE"
 				BasicRuntimeChecks="0"
 				RuntimeLibrary="1"
--- a/src/Back.cpp
+++ b/src/Back.cpp
@@ -31,7 +31,6 @@
 	if (fp == NULL)
 		return FALSE;
 
-#ifdef NONPORTABLE
 	// This is ridiculously platform-dependant:
 	// It should break on big-endian CPUs, and platforms where short isn't 16-bit and long isn't 32-bit.
 	unsigned short bmp_header_buffer[7];	// These names aren't the original. This ruins the stack frame layout.
@@ -54,19 +53,6 @@
 
 	gBack.partsW = bmp_header_buffer2[1];
 	gBack.partsH = bmp_header_buffer2[2];
-#else
-	if (fgetc(fp) != 'B' || fgetc(fp) != 'M')
-	{
-		fclose(fp);
-		return FALSE;
-	}
-
-	fseek(fp, 18, SEEK_SET);
-
-	gBack.partsW = File_ReadLE32(fp);
-	gBack.partsH = File_ReadLE32(fp);
-	fclose(fp);
-#endif
 
 	// Set background stuff and load texture
 	gBack.flag = 1;
--- a/src/Config.cpp
+++ b/src/Config.cpp
@@ -25,36 +25,13 @@
 		return FALSE;
 
 	// Read data
-#ifdef NONPORTABLE
 	size_t fread_result = fread(conf, sizeof(CONFIG), 1, fp); // Not the original name
-#else
-	// Read the version id and font name
-	fread(conf->proof, sizeof(conf->proof), 1, fp);
-	fread(conf->font_name, sizeof(conf->font_name), 1, fp);
 
-	// Read control settings
-	conf->move_button_mode = File_ReadLE32(fp);
-	conf->attack_button_mode = File_ReadLE32(fp);
-	conf->ok_button_mode = File_ReadLE32(fp);
-
-	// Read display mode (320x240, 640x480, 24-bit fullscreen, 32-bit fullscreen) TODO: add more things?
-	conf->display_mode = File_ReadLE32(fp);
-
-	// Read joystick configuration (if enabled, and mappings)
-	conf->bJoystick = File_ReadLE32(fp);
-	for (int button = 0; button < 8; button++)
-		conf->joystick_button[button] = File_ReadLE32(fp);
-#endif
-
 	// Close file
 	fclose(fp);
 
 	// Check if version is not correct, and return if it failed
-#ifdef NONPORTABLE
 	if (fread_result != 1 || strcmp(conf->proof, config_magic))
-#else
-	if (strcmp(conf->proof, config_magic))
-#endif
 	{
 		memset(conf, 0, sizeof(CONFIG));
 		return FALSE;
--- a/src/Game.cpp
+++ b/src/Game.cpp
@@ -682,20 +682,7 @@
 
 	if (!LoadGenericData())
 	{
-		#if defined(NONPORTABLE) && defined(WINDOWS)
-			#ifdef JAPANESE
-			MessageBoxA(hWnd, "\x94\xC4\x97\x70\x83\x74\x83\x40\x83\x43\x83\x8B\x82\xAA\x93\xC7\x82\xDF\x82\xC8\x82\xA2", "\x83\x47\x83\x89\x81\x5B", MB_OK);
-			#else
-			MessageBoxA(hWnd, "Couldn't read general purpose files", "Error", MB_OK);
-			#endif
-		#else
-			#ifdef JAPANESE
-			SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "エラー", "汎用ファイルが読めない", NULL);
-			#else
-			SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", "Couldn't read general purpose files", NULL);
-			#endif
-		#endif
-
+		MessageBoxA(hWnd, "\x94\xC4\x97\x70\x83\x74\x83\x40\x83\x43\x83\x8B\x82\xAA\x93\xC7\x82\xDF\x82\xC8\x82\xA2", "\x83\x47\x83\x89\x81\x5B", MB_OK);
 		return FALSE;
 	}
 
@@ -706,20 +693,7 @@
 
 	if (!LoadNpcTable(path))
 	{
-		#if defined(NONPORTABLE) && defined(WINDOWS)
-			#ifdef JAPANESE
-			MessageBoxA(hWnd, "\x4E\x50\x43\x83\x65\x81\x5B\x83\x75\x83\x8B\x82\xAA\x93\xC7\x82\xDF\x82\xC8\x82\xA2", "\x83\x47\x83\x89\x81\x5B", MB_OK);
-			#else
-			MessageBoxA(hWnd, "Couldn't read the NPC table", "Error", MB_OK);
-			#endif
-		#else
-			#ifdef JAPANESE
-			SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "エラー", "NPCテーブルが読めない", NULL);
-			#else
-			SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", "Couldn't read the NPC table", NULL);
-			#endif
-		#endif
-
+		MessageBoxA(hWnd, "\x4E\x50\x43\x83\x65\x81\x5B\x83\x75\x83\x8B\x82\xAA\x93\xC7\x82\xDF\x82\xC8\x82\xA2", "\x83\x47\x83\x89\x81\x5B", MB_OK);
 		return FALSE;
 	}
 
--- a/src/Generic.cpp
+++ b/src/Generic.cpp
@@ -36,7 +36,6 @@
 	*month = i;
 }
 
-#ifdef WINDOWS
 // TODO - Inaccurate stack frame
 BOOL GetCompileVersion(int *v1, int *v2, int *v3, int *v4)
 {
@@ -95,18 +94,7 @@
 
 	return bResult;
 }
-#else
-BOOL GetCompileVersion(int *v1, int *v2, int *v3, int *v4)
-{
-	*v1 = 1;
-	*v2 = 0;
-	*v3 = 0;
-	*v4 = 6;
-	return TRUE;
-}
-#endif
 
-#ifdef WINDOWS
 // This seems to be broken in recent Windows (Sndvol32.exe was renamed 'SndVol.exe')
 // TODO - Inaccurate stack frame
 BOOL OpenVolumeConfiguration(HWND hWnd)
@@ -170,9 +158,7 @@
 		return TRUE;
 #endif
 }
-#endif
 
-#ifdef WINDOWS
 void DeleteDebugLog(void)
 {
 	char path[MAX_PATH];
@@ -196,9 +182,7 @@
 	fclose(fp);
 	return TRUE;
 }
-#endif
 
-#ifdef WINDOWS
 /*
 This function is a mystery. It seems to check if the system time is within
 a certain range, specified by the two parameters. Nothing in the original game
@@ -227,17 +211,12 @@
 	else
 		return 0;
 }
-#endif
 
 BOOL CheckFileExists(const char *name)
 {
 	char path[MAX_PATH];
 
-#ifdef NONPORTABLE
 	sprintf(path, "%s\\%s", gModulePath, name);
-#else
-	sprintf(path, "%s/%s", gModulePath, name);
-#endif
 
 	FILE *file = fopen(path, "rb");
 
@@ -250,7 +229,6 @@
 
 long GetFileSizeLong(const char *path)
 {
-#ifdef NONPORTABLE
 	DWORD len;
 	HANDLE hFile;
 
@@ -263,24 +241,8 @@
 	len = GetFileSize(hFile, NULL);
 	CloseHandle(hFile);
 	return len;
-#else
-	long len;
-	FILE *fp;
-
-	len = 0;
-
-	fp = fopen(path, "rb");
-	if (fp == NULL)
-		return -1;
-
-	fseek(fp, 0, SEEK_END);
-	len = ftell(fp);
-	fclose(fp);
-	return len;
-#endif
 }
 
-#ifdef WINDOWS
 BOOL PrintBitmapError(const char *string, int value)
 {
 	char path[MAX_PATH];
@@ -299,7 +261,6 @@
 	fclose(fp);
 	return TRUE;
 }
-#endif
 
 BOOL IsShiftJIS(unsigned char c)
 {
--- a/src/Generic.h
+++ b/src/Generic.h
@@ -4,17 +4,13 @@
 
 void GetCompileDate(int *year, int *month, int *day);
 BOOL GetCompileVersion(int *v1, int *v2, int *v3, int *v4);
-#ifdef WINDOWS
 BOOL OpenVolumeConfiguration(HWND hWnd);
 void DeleteDebugLog(void);
 BOOL PrintDebugLog(const char *string, int value1, int value2, int value3);
 int CheckTime(SYSTEMTIME *system_time_low, SYSTEMTIME *system_time_high);
-#endif
 BOOL CheckFileExists(const char *name);
 long GetFileSizeLong(const char *path);
-#ifdef WINDOWS
 BOOL PrintBitmapError(const char *string, int value);
-#endif
 BOOL IsShiftJIS(unsigned char c);
 BOOL CenterWindow(HWND hWnd);
 BOOL LoadWindowRect(HWND hWnd, const char *filename, BOOL unknown);
--- a/src/Map.cpp
+++ b/src/Map.cpp
@@ -50,14 +50,9 @@
 	{
 		fread(&dum, 1, 1, fp);
 		// Get width and height
-#ifdef NONPORTABLE
 		// This fails on big-endian hardware, and platforms where short is not two bytes long.
 		fread(&gMap.width, 2, 1, fp);
 		fread(&gMap.length, 2, 1, fp);
-#else
-		gMap.width = File_ReadLE16(fp);
-		gMap.length = File_ReadLE16(fp);
-#endif
 
 		if (gMap.data == NULL)
 		{
--- a/src/MycParam.cpp
+++ b/src/MycParam.cpp
@@ -449,32 +449,14 @@
 	if (fp)
 	{
 		// Read data
-#ifdef NONPORTABLE
 		fread(&rec, sizeof(REC), 1, fp);
-#else
-		rec.counter[0] = File_ReadLE32(fp);
-		rec.counter[1] = File_ReadLE32(fp);
-		rec.counter[2] = File_ReadLE32(fp);
-		rec.counter[3] = File_ReadLE32(fp);
-		rec.random[0] = fgetc(fp);
-		rec.random[1] = fgetc(fp);
-		rec.random[2] = fgetc(fp);
-		rec.random[3] = fgetc(fp);
-#endif
 		fclose(fp);
 
 		p = (unsigned char*)&rec.counter[0];
-#ifdef NONPORTABLE
 		p[0] -= rec.random[0];
 		p[1] -= rec.random[0];
 		p[2] -= rec.random[0];
 		p[3] -= rec.random[0] / 2;
-#else
-		p[0] -= (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? (rec.random[0]) : (rec.random[0] / 2);
-		p[1] -= rec.random[0];
-		p[2] -= rec.random[0];
-		p[3] -= (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? (rec.random[0] / 2) : (rec.random[0]);
-#endif
 		// If this is faster than our new time, quit
 		if (rec.counter[0] < time_count)
 			return TRUE;
@@ -487,17 +469,10 @@
 		rec.random[i] = Random(0, 250) + i;
 
 		p = (unsigned char*)&rec.counter[i];
-#ifdef NONPORTABLE
 		p[0] += rec.random[i];
 		p[1] += rec.random[i];
 		p[2] += rec.random[i];
 		p[3] += rec.random[i] / 2;
-#else
-		p[0] += (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? (rec.random[i]) : (rec.random[i] / 2);
-		p[1] += rec.random[i];
-		p[2] += rec.random[i];
-		p[3] += (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? (rec.random[i] / 2) : (rec.random[i]);
-#endif
 	}
 
 	fp = fopen(path, "wb");
@@ -504,18 +479,7 @@
 	if (fp == NULL)
 		return FALSE;
 
-#ifdef NONPORTABLE
 	fwrite(&rec, sizeof(REC), 1, fp);
-#else
-	File_WriteLE32(rec.counter[0], fp);
-	File_WriteLE32(rec.counter[1], fp);
-	File_WriteLE32(rec.counter[2], fp);
-	File_WriteLE32(rec.counter[3], fp);
-	fputc(rec.random[0], fp);
-	fputc(rec.random[1], fp);
-	fputc(rec.random[2], fp);
-	fputc(rec.random[3], fp);
-#endif
 
 	fclose(fp);
 	return TRUE;
@@ -537,18 +501,7 @@
 	REC rec;
 
 	// Read data
-#ifdef NONPORTABLE
 	fread(&rec, sizeof(REC), 1, fp);
-#else
-	rec.counter[0] = File_ReadLE32(fp);
-	rec.counter[1] = File_ReadLE32(fp);
-	rec.counter[2] = File_ReadLE32(fp);
-	rec.counter[3] = File_ReadLE32(fp);
-	rec.random[0] = fgetc(fp);
-	rec.random[1] = fgetc(fp);
-	rec.random[2] = fgetc(fp);
-	rec.random[3] = fgetc(fp);
-#endif
 	fclose(fp);
 
 	// Decode from checksum
@@ -555,17 +508,10 @@
 	for (i = 0; i < 4; i++)
 	{
 		p = (unsigned char*)&rec.counter[i];
-#ifdef NONPORTABLE
 		p[0] -= rec.random[i];
 		p[1] -= rec.random[i];
 		p[2] -= rec.random[i];
 		p[3] -= rec.random[i] / 2;
-#else
-		p[0] -= (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? (rec.random[i]) : (rec.random[i] / 2);
-		p[1] -= rec.random[i];
-		p[2] -= rec.random[i];
-		p[3] -= (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? (rec.random[i] / 2) : (rec.random[i]);
-#endif
 	}
 
 	// Verify checksum's result
--- a/src/NpChar.cpp
+++ b/src/NpChar.cpp
@@ -78,11 +78,7 @@
 	}
 
 	// Get amount of NPCs
-#ifdef NONPORTABLE
 	fread(&count, 4, 1, fp);
-#else
-	count = File_ReadLE32(fp);
-#endif
 
 	// Load NPCs
 	memset(gNPC, 0, sizeof(gNPC));
@@ -91,16 +87,7 @@
 	for (i = 0; i < count; i++)
 	{
 		// Get data from file
-#ifdef NONPORTABLE
 		fread(&eve, sizeof(EVENT), 1, fp);
-#else
-		eve.x = File_ReadLE16(fp);
-		eve.y = File_ReadLE16(fp);
-		eve.code_flag = File_ReadLE16(fp);
-		eve.code_event = File_ReadLE16(fp);
-		eve.code_char = File_ReadLE16(fp);
-		eve.bits = File_ReadLE16(fp);
-#endif
 
 		// Set NPC parameters
 		gNPC[n].direct = (eve.bits & NPC_SPAWN_IN_OTHER_DIRECTION) ? 2 : 0;
--- a/src/NpcTbl.cpp
+++ b/src/NpcTbl.cpp
@@ -36,7 +36,6 @@
 		return FALSE;
 	}
 
-#ifdef NONPORTABLE
 	for (n = 0; n < num; n++) // bits
 		fread(&gNpcTable[n].bits, 2, 1, fp);
 	for (n = 0; n < num; n++) // life
@@ -57,28 +56,6 @@
 		fread(&gNpcTable[n].hit, 4, 1, fp);
 	for (n = 0; n < num; n++) // view
 		fread(&gNpcTable[n].view, 4, 1, fp);
-#else
-	for (n = 0; n < num; n++) // bits
-		gNpcTable[n].bits = File_ReadLE16(fp);
-	for (n = 0; n < num; n++) // life
-		gNpcTable[n].life = File_ReadLE16(fp);
-	for (n = 0; n < num; n++) // surf
-		fread(&gNpcTable[n].surf, 1, 1, fp);
-	for (n = 0; n < num; n++) // destroy_voice
-		fread(&gNpcTable[n].destroy_voice, 1, 1, fp);
-	for (n = 0; n < num; n++) // hit_voice
-		fread(&gNpcTable[n].hit_voice, 1, 1, fp);
-	for (n = 0; n < num; n++) // size
-		fread(&gNpcTable[n].size, 1, 1, fp);
-	for (n = 0; n < num; n++) // exp
-		gNpcTable[n].exp = File_ReadLE32(fp);
-	for (n = 0; n < num; n++) // damage
-		gNpcTable[n].damage = File_ReadLE32(fp);
-	for (n = 0; n < num; n++) // hit
-		fread(&gNpcTable[n].hit, 4, 1, fp);
-	for (n = 0; n < num; n++) // view
-		fread(&gNpcTable[n].view, 4, 1, fp);
-#endif
 
 	fclose(fp);
 	return TRUE;
--- a/src/Profile.cpp
+++ b/src/Profile.cpp
@@ -79,43 +79,7 @@
 	memcpy(profile.flags, gFlagNPC, sizeof(profile.flags));
 
 	// Write to file
-#ifdef NONPORTABLE
 	fwrite(&profile, sizeof(PROFILE), 1, fp);
-#else
-	fwrite(profile.code, 8, 1, fp);
-	File_WriteLE32(profile.stage, fp);
-	File_WriteLE32(profile.music, fp);
-	File_WriteLE32(profile.x, fp);
-	File_WriteLE32(profile.y, fp);
-	File_WriteLE32(profile.direct, fp);
-	File_WriteLE16(profile.max_life, fp);
-	File_WriteLE16(profile.star, fp);
-	File_WriteLE16(profile.life, fp);
-	File_WriteLE16(profile.a, fp);
-	File_WriteLE32(profile.select_arms, fp);
-	File_WriteLE32(profile.select_item, fp);
-	File_WriteLE32(profile.equip, fp);
-	File_WriteLE32(profile.unit, fp);
-	File_WriteLE32(profile.counter, fp);
-	for (int arm = 0; arm < 8; arm++)
-	{
-		File_WriteLE32(profile.arms[arm].code, fp);
-		File_WriteLE32(profile.arms[arm].level, fp);
-		File_WriteLE32(profile.arms[arm].exp, fp);
-		File_WriteLE32(profile.arms[arm].max_num, fp);
-		File_WriteLE32(profile.arms[arm].num, fp);
-	}
-	for (int item = 0; item < 32; item++)
-		File_WriteLE32(profile.items[item].code, fp);
-	for (int stage = 0; stage < 8; stage++)
-	{
-		File_WriteLE32(profile.permitstage[stage].index, fp);
-		File_WriteLE32(profile.permitstage[stage].event, fp);
-	}
-	fwrite(profile.permit_mapping, 0x80, 1, fp);
-	fwrite(FLAG, 4, 1, fp);
-	fwrite(profile.flags, 1000, 1, fp);
-#endif
 
 	fclose(fp);
 	return TRUE;
@@ -151,43 +115,7 @@
 	// Read data
 	fseek(fp, 0, SEEK_SET);
 	memset(&profile, 0, sizeof(PROFILE));
-#ifdef NONPORTABLE
 	fread(&profile, sizeof(PROFILE), 1, fp);
-#else
-	fread(profile.code, 8, 1, fp);
-	profile.stage = File_ReadLE32(fp);
-	profile.music = (MusicID)File_ReadLE32(fp);
-	profile.x = File_ReadLE32(fp);
-	profile.y = File_ReadLE32(fp);
-	profile.direct = File_ReadLE32(fp);
-	profile.max_life = File_ReadLE16(fp);
-	profile.star = File_ReadLE16(fp);
-	profile.life = File_ReadLE16(fp);
-	profile.a = File_ReadLE16(fp);
-	profile.select_arms = File_ReadLE32(fp);
-	profile.select_item = File_ReadLE32(fp);
-	profile.equip = File_ReadLE32(fp);
-	profile.unit = File_ReadLE32(fp);
-	profile.counter = File_ReadLE32(fp);
-	for (int arm = 0; arm < 8; arm++)
-	{
-		profile.arms[arm].code = File_ReadLE32(fp);
-		profile.arms[arm].level = File_ReadLE32(fp);
-		profile.arms[arm].exp = File_ReadLE32(fp);
-		profile.arms[arm].max_num = File_ReadLE32(fp);
-		profile.arms[arm].num = File_ReadLE32(fp);
-	}
-	for (int item = 0; item < 32; item++)
-		profile.items[item].code = File_ReadLE32(fp);
-	for (int stage = 0; stage < 8; stage++)
-	{
-		profile.permitstage[stage].index = File_ReadLE32(fp);
-		profile.permitstage[stage].event = File_ReadLE32(fp);
-	}
-	fread(profile.permit_mapping, 0x80, 1, fp);
-	fread(profile.FLAG, 4, 1, fp);
-	fread(profile.flags, 1000, 1, fp);
-#endif
 	fclose(fp);
 
 	// Set things
@@ -250,22 +178,7 @@
 	InitFlags();
 	if (!TransferStage(13, 200, 10, 8))
 	{
-		#if defined(NONPORTABLE) && defined(WINDOWS)
-			#ifdef JAPANESE
-			MessageBoxA(hWnd, "\x83\x58\x83\x65\x81\x5B\x83\x57\x82\xCC\x93\xC7\x82\xDD\x8D\x9E\x82\xDD\x82\xC9\x8E\xB8\x94\x73", "\x83\x47\x83\x89\x81\x5B", MB_OK);
-			#else
-			MessageBoxA(hWnd, "Failed to load stage", "Error", MB_OK);
-			#endif
-		#else
-			(void)hWnd;
-
-			#ifdef JAPANESE
-			SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "エラー", "ステージの読み込みに失敗", NULL);
-			#else
-			SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", "Failed to load stage", NULL);
-			#endif
-		#endif
-
+		MessageBoxA(hWnd, "\x83\x58\x83\x65\x81\x5B\x83\x57\x82\xCC\x93\xC7\x82\xDD\x8D\x9E\x82\xDD\x82\xC9\x8E\xB8\x94\x73", "\x83\x47\x83\x89\x81\x5B", MB_OK);
 		return FALSE;
 	}
 
--- a/src/Stage.cpp
+++ b/src/Stage.cpp
@@ -224,11 +224,7 @@
 	"ACCESS",
 	"IRONH",
 	"GRAND",
-#ifdef NONPORTABLE
-	"Curly",	// The vanilla game used the original filename instead of the internal 8.3 one
-#else
-	"CURLY",
-#endif
+	"Curly",	// Uses the original filename instead of the internal 8.3 one
 	"OSIDE",
 	"REQUIEM",
 	"WANPAK2",
--- a/src/TextScr.cpp
+++ b/src/TextScr.cpp
@@ -705,20 +705,7 @@
 						y = GetTextScriptNo(gTS.p_read + 19);
 						if (!TransferStage(z, w, x, y))
 						{
-							#if defined(NONPORTABLE) && defined(WINDOWS)
-								#ifdef JAPANESE
-								MessageBoxA(ghWnd, "\x83\x58\x83\x65\x81\x5B\x83\x57\x82\xCC\x93\xC7\x82\xDD\x8D\x9E\x82\xDD\x82\xC9\x8E\xB8\x94\x73", "\x83\x47\x83\x89\x81\x5B", MB_OK);
-								#else
-								MessageBoxA(ghWnd, "Failed to load stage", "Error", MB_OK);
-								#endif
-							#else
-								#ifdef JAPANESE
-								SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "エラー", "ステージの読み込みに失敗", NULL);
-								#else
-								SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", "Failed to load stage", NULL);
-								#endif
-							#endif
-
+							MessageBoxA(ghWnd, "\x83\x58\x83\x65\x81\x5B\x83\x57\x82\xCC\x93\xC7\x82\xDD\x8D\x9E\x82\xDD\x82\xC9\x8E\xB8\x94\x73", "\x83\x47\x83\x89\x81\x5B", MB_OK);
 							return 0;
 						}
 					}
@@ -1270,23 +1257,8 @@
 					else
 					{
 						char str_0[0x40];
-						#ifdef JAPANESE
-							#if defined(NONPORTABLE) && defined(WINDOWS)
-								sprintf(str_0, "\x95\x73\x96\xBE\x82\xCC\x83\x52\x81\x5B\x83\x68:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]);
-								MessageBoxA(NULL, str_0, "\x83\x47\x83\x89\x81\x5B", MB_OK);
-							#else
-								sprintf(str_0, "不明のコード:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]);
-								SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "エラー", str_0, NULL);
-							#endif
-						#else
-							sprintf(str_0, "Unknown code:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]);
-							#if defined(NONPORTABLE) && defined(WINDOWS)
-								MessageBoxA(NULL, str_0, "Error", MB_OK);
-							#else
-								SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", str_0, NULL);
-							#endif
-						#endif
-
+						sprintf(str_0, "\x95\x73\x96\xBE\x82\xCC\x83\x52\x81\x5B\x83\x68:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]);
+						MessageBoxA(NULL, str_0, "\x83\x47\x83\x89\x81\x5B", MB_OK);
 						return 0;
 					}
 				}
--- a/src/WindowsWrapper.h
+++ b/src/WindowsWrapper.h
@@ -1,44 +1,15 @@
 #pragma once
 
-#ifdef WINDOWS
 #include <windows.h>
 // Avoid name collisions
 #undef DrawText
 #undef FindResource
 #undef CreateWindow
-#else
 
-#include <stdio.h>
-
-typedef int HWND;
-
-typedef int BOOL;
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-struct RECT
-{
-	long left;
-	long top;
-	long right;
-	long bottom;
-};
-#endif
-
 #define SET_RECT(rect, l, t, r, b) \
 	rect.left = l; \
 	rect.top = t; \
 	rect.right = r; \
 	rect.bottom = b;
-
-#ifndef MAX_PATH
-#define MAX_PATH FILENAME_MAX
-#endif
 
 BOOL SystemTask();