From 406ff1890954a97738f9522e88c0c51ab8cb8a01 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Fri, 13 Mar 2020 21:35:51 +0000 Subject: [PATCH 01/10] Add CMakeLists.txt and Visual Studio 6 support The CMake file allows you to compile the accurate branch with whatever version of Visual Studio you have lying around, without having to clumbsily convert the VS2003 project. I've tested this with VS2019, VS2003, and VS6. VS6 is goofy - it's missing a few types and constants, and it's not smart enough to realise that ints and longs are the same in ILP32 data models. I've added a few small hacks to address this. Might undo them. Who knows. For now, I want to support VS6 because Mint compiled CSE2 with it before, and because VS6 uses `msvcrt.dll` as its C runtime, which apparently comes pre-installed in Windows, as opposed to all those other annoying runtime versions that require they be installed separately (which is why MinGW targets it specifically). Also, VS6 *should* give us Win95-compatible builds. The internet says MSVC2003 is Win95-compatible too, but Mint claims the vanilla EXE doesn't run on there. I imagine it has something to do with its static runtime library (VS2003 links the static one by default for some reason). --- CMakeLists.txt | 216 ++++++++++++++++++++++++++++++++++++++++++++++++ src/Main.cpp | 25 +++++- src/Organya.cpp | 5 ++ 3 files changed, 242 insertions(+), 4 deletions(-) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..1d358f39 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,216 @@ +cmake_minimum_required(VERSION 3.12) + +set(ASSETS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/assets") + +option(JAPANESE "Enable the Japanese-language build" OFF) +option(FIX_BUGS "Fix various bugs in the game" ON) +option(DEBUG_SAVE "Re-enable the ability to drag-and-drop save files onto the window" OFF) + +project(CSE2 LANGUAGES C CXX) + +#if(MSVC) + # Statically-link the CRT (vcpkg static libs do this) +# foreach(flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) +# if(${flag_var} MATCHES "/MD") +# string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") +# endif() +# endforeach() +#endif() + +## +# CSE2 +## + +add_executable(CSE2 + "src/ArmsItem.cpp" + "src/ArmsItem.h" + "src/Back.cpp" + "src/Back.h" + "src/Boss.cpp" + "src/Boss.h" + "src/BossAlmo1.cpp" + "src/BossAlmo1.h" + "src/BossAlmo2.cpp" + "src/BossAlmo2.h" + "src/BossBallos.cpp" + "src/BossBallos.h" + "src/BossFrog.cpp" + "src/BossFrog.h" + "src/BossIronH.cpp" + "src/BossIronH.h" + "src/BossLife.cpp" + "src/BossLife.h" + "src/BossOhm.cpp" + "src/BossOhm.h" + "src/BossPress.cpp" + "src/BossPress.h" + "src/BossTwinD.cpp" + "src/BossTwinD.h" + "src/BossX.cpp" + "src/BossX.h" + "src/BulHit.cpp" + "src/BulHit.h" + "src/Bullet.cpp" + "src/Bullet.h" + "src/Caret.cpp" + "src/Caret.h" + "src/CommonDefines.h" + "src/Config.cpp" + "src/Config.h" + "src/Dialog.cpp" + "src/Dialog.h" + "src/Draw.cpp" + "src/Draw.h" + "src/Ending.cpp" + "src/Ending.h" + "src/Escape.cpp" + "src/Escape.h" + "src/Fade.cpp" + "src/Fade.h" + "src/Flags.cpp" + "src/Flags.h" + "src/Flash.cpp" + "src/Flash.h" + "src/Frame.cpp" + "src/Frame.h" + "src/Game.cpp" + "src/Game.h" + "src/Generic.cpp" + "src/Generic.h" + "src/GenericLoad.cpp" + "src/GenericLoad.h" + "src/Input.cpp" + "src/Input.h" + "src/KeyControl.cpp" + "src/KeyControl.h" + "src/Main.cpp" + "src/Main.h" + "src/Map.cpp" + "src/Map.h" + "src/MapName.cpp" + "src/MapName.h" + "src/MiniMap.cpp" + "src/MiniMap.h" + "src/MyChar.cpp" + "src/MyChar.h" + "src/MycHit.cpp" + "src/MycHit.h" + "src/MycParam.cpp" + "src/MycParam.h" + "src/NpcAct.h" + "src/NpcAct000.cpp" + "src/NpcAct020.cpp" + "src/NpcAct040.cpp" + "src/NpcAct060.cpp" + "src/NpcAct080.cpp" + "src/NpcAct100.cpp" + "src/NpcAct120.cpp" + "src/NpcAct140.cpp" + "src/NpcAct160.cpp" + "src/NpcAct180.cpp" + "src/NpcAct200.cpp" + "src/NpcAct220.cpp" + "src/NpcAct240.cpp" + "src/NpcAct260.cpp" + "src/NpcAct280.cpp" + "src/NpcAct300.cpp" + "src/NpcAct320.cpp" + "src/NpcAct340.cpp" + "src/NpChar.cpp" + "src/NpChar.h" + "src/NpcHit.cpp" + "src/NpcHit.h" + "src/NpcTbl.cpp" + "src/NpcTbl.h" + "src/Organya.cpp" + "src/Organya.h" + "src/PixTone.cpp" + "src/PixTone.h" + "src/Profile.cpp" + "src/Profile.h" + "src/SelStage.cpp" + "src/SelStage.h" + "src/Shoot.cpp" + "src/Shoot.h" + "src/Sound.cpp" + "src/Sound.h" + "src/Stage.cpp" + "src/Stage.h" + "src/Star.cpp" + "src/Star.h" + "src/TextScr.cpp" + "src/TextScr.h" + "src/Triangle.cpp" + "src/Triangle.h" + "src/ValueView.cpp" + "src/ValueView.h" + "src/WindowsWrapper.h" +) + +# Handle options +if(JAPANESE) + set(BUILD_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/game_japanese") + target_compile_definitions(CSE2 PRIVATE JAPANESE) +else() + set(BUILD_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/game_english") +endif() + +if(FIX_BUGS) + target_compile_definitions(CSE2 PRIVATE FIX_BUGS) +endif() + +if(DEBUG_SAVE) + target_compile_definitions(CSE2 PRIVATE DEBUG_SAVE) +endif() + +# Make some tweaks if we're targetting Windows +#if(WIN32) + target_sources(CSE2 PRIVATE "${ASSETS_DIRECTORY}/resources/CSE2.rc") + set_target_properties(CSE2 PROPERTIES WIN32_EXECUTABLE YES) # Disable the console window +#endif() + +# Make some tweaks if we're using MSVC +if(MSVC) + target_compile_definitions(CSE2 PRIVATE _CRT_SECURE_NO_WARNINGS) # Disable warnings that normally fire up on MSVC when using "unsafe" functions instead of using MSVC's "safe" _s functions +endif() + +# Make it so source files are recognized as UTF-8 by MSVC +if(MSVC) + target_compile_options(CSE2 PRIVATE "/utf-8") +endif() + +# Force strict C90 +set_target_properties(CSE2 PROPERTIES + C_STANDARD 90 + C_STANDARD_REQUIRED ON + C_EXTENSIONS OFF +) + +# Force strict C++98 +set_target_properties(CSE2 PROPERTIES + CXX_STANDARD 98 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF +) + +# Name debug builds "CSE2_debug", to distinguish them +set_target_properties(CSE2 PROPERTIES DEBUG_OUTPUT_NAME "CSE2_debug") + +# Send executable to the build_en/build_jp directory +set_target_properties(CSE2 PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${BUILD_DIRECTORY} + RUNTIME_OUTPUT_DIRECTORY_RELEASE ${BUILD_DIRECTORY} + RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${BUILD_DIRECTORY} + RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${BUILD_DIRECTORY} + RUNTIME_OUTPUT_DIRECTORY_DEBUG ${BUILD_DIRECTORY} +) + +# Link libraries +target_link_libraries(CSE2 PRIVATE ddraw.lib dsound.lib Version.lib ShLwApi.Lib Imm32.lib WinMM.lib dxguid.lib) + +# Newer MSVC is missing `dinput.lib` +if(MSVC AND MSVC_VERSION GREATER_EQUAL 1500) + target_link_libraries(CSE2 PRIVATE dinput8.lib) +else() + target_link_libraries(CSE2 PRIVATE dinput.lib) +endif() diff --git a/src/Main.cpp b/src/Main.cpp index e3995642..b68eeff0 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -22,6 +22,23 @@ #include "Sound.h" #include "Triangle.h" +// Visual Studio 6 is missing these, so define them here just in case +#ifndef VK_OEM_PLUS +#define VK_OEM_PLUS 0xBB +#endif + +#ifndef VK_OEM_COMMA +#define VK_OEM_COMMA 0xBC +#endif + +#ifndef VK_OEM_PERIOD +#define VK_OEM_PERIOD 0xBE +#endif + +#ifndef VK_OEM_2 +#define VK_OEM_2 0xBF +#endif + LRESULT __stdcall WindowProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); char gModulePath[MAX_PATH]; @@ -676,12 +693,12 @@ LRESULT __stdcall WindowProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPa switch (LOWORD(wParam)) { case 40001: - if (DialogBoxParamA(ghInstance, "DLG_YESNO", hWnd, QuitDialog, (LPARAM)"Quit?") == 1) + if (DialogBoxParamA(ghInstance, "DLG_YESNO", hWnd, (DLGPROC)QuitDialog, (LPARAM)"Quit?") == 1) PostMessageA(hWnd, WM_CLOSE, 0, 0); break; case 40002: - DialogBoxParamA(ghInstance, "DLG_ABOUT", hWnd, VersionDialog, 0); + DialogBoxParamA(ghInstance, "DLG_ABOUT", hWnd, (DLGPROC)VersionDialog, 0); break; case 40004: @@ -690,11 +707,11 @@ LRESULT __stdcall WindowProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPa break; case 40005: - DialogBoxParamA(ghInstance, "DLG_SAVE", hWnd, DebugSaveDialog, 0); + DialogBoxParamA(ghInstance, "DLG_SAVE", hWnd, (DLGPROC)DebugSaveDialog, 0); break; case 40007: - DialogBoxParamA(ghInstance, "DLG_MUTE", hWnd, DebugMuteDialog, 0); + DialogBoxParamA(ghInstance, "DLG_MUTE", hWnd, (DLGPROC)DebugMuteDialog, 0); break; } diff --git a/src/Organya.cpp b/src/Organya.cpp index 51070b16..341c039c 100644 --- a/src/Organya.cpp +++ b/src/Organya.cpp @@ -22,6 +22,11 @@ #include "Sound.h" +// Visual Studio 6 is missing this +#ifndef DWORD_PTR +#define DWORD_PTR DWORD +#endif + #define PANDUMMY 0xFF #define VOLDUMMY 0xFF #define KEYDUMMY 0xFF From 05fb5cf106ad47df77e56ae3660ac4275810d54c Mon Sep 17 00:00:00 2001 From: Clownacy Date: Fri, 13 Mar 2020 22:01:02 +0000 Subject: [PATCH 02/10] Fix build error with MinGW --- src/Organya.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Organya.cpp b/src/Organya.cpp index 341c039c..bbcc52a2 100644 --- a/src/Organya.cpp +++ b/src/Organya.cpp @@ -23,9 +23,11 @@ #include "Sound.h" // Visual Studio 6 is missing this +#ifdef _MSC_VER #ifndef DWORD_PTR #define DWORD_PTR DWORD #endif +#endif #define PANDUMMY 0xFF #define VOLDUMMY 0xFF From 4e0a168533df5f36a9e255a0702ae204d69a3bc7 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sat, 14 Mar 2020 12:55:22 +0000 Subject: [PATCH 03/10] Move the MSVC6 hacks to WindowsWrapper.h Now the wrapper has a purpose again, and it keeps things neat. --- src/Main.cpp | 17 ----------------- src/Organya.cpp | 7 ------- src/WindowsWrapper.h | 23 +++++++++++++++++++++++ 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/Main.cpp b/src/Main.cpp index b68eeff0..3717de99 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -22,23 +22,6 @@ #include "Sound.h" #include "Triangle.h" -// Visual Studio 6 is missing these, so define them here just in case -#ifndef VK_OEM_PLUS -#define VK_OEM_PLUS 0xBB -#endif - -#ifndef VK_OEM_COMMA -#define VK_OEM_COMMA 0xBC -#endif - -#ifndef VK_OEM_PERIOD -#define VK_OEM_PERIOD 0xBE -#endif - -#ifndef VK_OEM_2 -#define VK_OEM_2 0xBF -#endif - LRESULT __stdcall WindowProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); char gModulePath[MAX_PATH]; diff --git a/src/Organya.cpp b/src/Organya.cpp index bbcc52a2..51070b16 100644 --- a/src/Organya.cpp +++ b/src/Organya.cpp @@ -22,13 +22,6 @@ #include "Sound.h" -// Visual Studio 6 is missing this -#ifdef _MSC_VER -#ifndef DWORD_PTR -#define DWORD_PTR DWORD -#endif -#endif - #define PANDUMMY 0xFF #define VOLDUMMY 0xFF #define KEYDUMMY 0xFF diff --git a/src/WindowsWrapper.h b/src/WindowsWrapper.h index 40235a3d..920ca2cd 100644 --- a/src/WindowsWrapper.h +++ b/src/WindowsWrapper.h @@ -1,3 +1,26 @@ #pragma once +// Visual Studio 6 is missing these, so define them here +#ifdef _MSC_VER + #ifndef VK_OEM_PLUS + #define VK_OEM_PLUS 0xBB + #endif + + #ifndef VK_OEM_COMMA + #define VK_OEM_COMMA 0xBC + #endif + + #ifndef VK_OEM_PERIOD + #define VK_OEM_PERIOD 0xBE + #endif + + #ifndef VK_OEM_2 + #define VK_OEM_2 0xBF + #endif + + #ifndef DWORD_PTR + #define DWORD_PTR DWORD + #endif +#endif + #include From 8a3b5c1f7a70c74f2c7f0f0a8ff58d6ae3bda971 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sat, 14 Mar 2020 13:22:36 +0000 Subject: [PATCH 04/10] Use macros instead of __stdcall Wow Microsoft's documentation sucks: it constantly omits these, making you think they're just plain `__cdecl`. --- src/Dialog.cpp | 8 ++++---- src/Dialog.h | 8 ++++---- src/Input.cpp | 4 ++-- src/Main.cpp | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Dialog.cpp b/src/Dialog.cpp index ab33b6ca..9a104089 100644 --- a/src/Dialog.cpp +++ b/src/Dialog.cpp @@ -17,7 +17,7 @@ static const char *version_string = ; // TODO - Inaccurate stack frame -INT_PTR __stdcall VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { char string_buffer[104]; @@ -58,7 +58,7 @@ INT_PTR __stdcall VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPara return FALSE; } -INT_PTR __stdcall DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { (void)lParam; @@ -102,7 +102,7 @@ INT_PTR __stdcall DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPa return FALSE; } -INT_PTR __stdcall DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { char string[100]; @@ -135,7 +135,7 @@ INT_PTR __stdcall DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPa return FALSE; } -INT_PTR __stdcall QuitDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK QuitDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { switch (Msg) { diff --git a/src/Dialog.h b/src/Dialog.h index 6ff69e82..628d59e7 100644 --- a/src/Dialog.h +++ b/src/Dialog.h @@ -2,7 +2,7 @@ #include "WindowsWrapper.h" -INT_PTR __stdcall VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -INT_PTR __stdcall DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -INT_PTR __stdcall DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -INT_PTR __stdcall QuitDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK QuitDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); diff --git a/src/Input.cpp b/src/Input.cpp index 65eb2e6e..4eff1bff 100644 --- a/src/Input.cpp +++ b/src/Input.cpp @@ -59,7 +59,7 @@ BOOL SetDeviceAquire(BOOL aquire) // It looks like Pixel declared his functions early, so he could forward-reference BOOL FindAndOpenDirectInputDevice(HWND hWnd); -BOOL __stdcall EnumDevices_Callback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef); +BOOL CALLBACK EnumDevices_Callback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef); BOOL InitDirectInput(HINSTANCE hinst, HWND hWnd) { @@ -116,7 +116,7 @@ BOOL FindAndOpenDirectInputDevice(HWND hWnd) } // The original names for this function and its variables are unknown -BOOL __stdcall EnumDevices_Callback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef) +BOOL CALLBACK EnumDevices_Callback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef) { static int already_ran; static DirectInputPair *directinput_objects; diff --git a/src/Main.cpp b/src/Main.cpp index 3717de99..806607ed 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -22,7 +22,7 @@ #include "Sound.h" #include "Triangle.h" -LRESULT __stdcall WindowProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); +LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); char gModulePath[MAX_PATH]; char gDataPath[MAX_PATH]; @@ -97,7 +97,7 @@ unsigned long GetFramePerSecound(void) } // TODO - Inaccurate stack frame -int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { (void)hPrevInstance; (void)lpCmdLine; @@ -441,7 +441,7 @@ BOOL DragAndDropHandler(HWND hWnd, WPARAM wParam) } // TODO - Inaccurate stack frame -LRESULT __stdcall WindowProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { BOOL window_focus; HMENU hMenu; From c6b77fb01555a5879af4c5cfe7d12af0be2a2ec6 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sat, 14 Mar 2020 13:25:25 +0000 Subject: [PATCH 05/10] Move the windows.h include to the right place --- src/WindowsWrapper.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WindowsWrapper.h b/src/WindowsWrapper.h index 920ca2cd..22321292 100644 --- a/src/WindowsWrapper.h +++ b/src/WindowsWrapper.h @@ -1,5 +1,7 @@ #pragma once +#include + // Visual Studio 6 is missing these, so define them here #ifdef _MSC_VER #ifndef VK_OEM_PLUS @@ -22,5 +24,3 @@ #define DWORD_PTR DWORD #endif #endif - -#include From 76e4fb5e8a2faa1aa6211950286c84ddc02053ea Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sat, 14 Mar 2020 14:08:25 +0000 Subject: [PATCH 06/10] Improve MSVC6 hacks --- src/Dialog.cpp | 8 ++++---- src/Dialog.h | 8 ++++---- src/Main.cpp | 8 ++++---- src/WindowsWrapper.h | 7 ++++++- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/Dialog.cpp b/src/Dialog.cpp index 9a104089..999f8742 100644 --- a/src/Dialog.cpp +++ b/src/Dialog.cpp @@ -17,7 +17,7 @@ static const char *version_string = ; // TODO - Inaccurate stack frame -INT_PTR CALLBACK VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +DLGPROC_RET CALLBACK VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { char string_buffer[104]; @@ -58,7 +58,7 @@ INT_PTR CALLBACK VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam return FALSE; } -INT_PTR CALLBACK DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +DLGPROC_RET CALLBACK DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { (void)lParam; @@ -102,7 +102,7 @@ INT_PTR CALLBACK DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPar return FALSE; } -INT_PTR CALLBACK DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +DLGPROC_RET CALLBACK DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { char string[100]; @@ -135,7 +135,7 @@ INT_PTR CALLBACK DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPar return FALSE; } -INT_PTR CALLBACK QuitDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +DLGPROC_RET CALLBACK QuitDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { switch (Msg) { diff --git a/src/Dialog.h b/src/Dialog.h index 628d59e7..1c5b6914 100644 --- a/src/Dialog.h +++ b/src/Dialog.h @@ -2,7 +2,7 @@ #include "WindowsWrapper.h" -INT_PTR CALLBACK VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK QuitDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); +DLGPROC_RET CALLBACK VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); +DLGPROC_RET CALLBACK DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); +DLGPROC_RET CALLBACK DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); +DLGPROC_RET CALLBACK QuitDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); diff --git a/src/Main.cpp b/src/Main.cpp index 806607ed..1d5bcd89 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -676,12 +676,12 @@ LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPar switch (LOWORD(wParam)) { case 40001: - if (DialogBoxParamA(ghInstance, "DLG_YESNO", hWnd, (DLGPROC)QuitDialog, (LPARAM)"Quit?") == 1) + if (DialogBoxParamA(ghInstance, "DLG_YESNO", hWnd, QuitDialog, (LPARAM)"Quit?") == 1) PostMessageA(hWnd, WM_CLOSE, 0, 0); break; case 40002: - DialogBoxParamA(ghInstance, "DLG_ABOUT", hWnd, (DLGPROC)VersionDialog, 0); + DialogBoxParamA(ghInstance, "DLG_ABOUT", hWnd, VersionDialog, 0); break; case 40004: @@ -690,11 +690,11 @@ LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPar break; case 40005: - DialogBoxParamA(ghInstance, "DLG_SAVE", hWnd, (DLGPROC)DebugSaveDialog, 0); + DialogBoxParamA(ghInstance, "DLG_SAVE", hWnd, DebugSaveDialog, 0); break; case 40007: - DialogBoxParamA(ghInstance, "DLG_MUTE", hWnd, (DLGPROC)DebugMuteDialog, 0); + DialogBoxParamA(ghInstance, "DLG_MUTE", hWnd, DebugMuteDialog, 0); break; } diff --git a/src/WindowsWrapper.h b/src/WindowsWrapper.h index 22321292..b182e51b 100644 --- a/src/WindowsWrapper.h +++ b/src/WindowsWrapper.h @@ -3,7 +3,7 @@ #include // Visual Studio 6 is missing these, so define them here -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSC_VER <= 1200 #ifndef VK_OEM_PLUS #define VK_OEM_PLUS 0xBB #endif @@ -23,4 +23,9 @@ #ifndef DWORD_PTR #define DWORD_PTR DWORD #endif + + // DLGPROC went from returning BOOL to INT_PTR in later versions, and VC6 doesn't like that + #define DLGPROC_RET BOOL +#else + #define DLGPROC_RET INT_PTR #endif From 169a755ec3cd9c833de3731edc0a03a8e2f18b77 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sat, 14 Mar 2020 14:12:53 +0000 Subject: [PATCH 07/10] Wrap UTF-8 strings in C89-style comments This should prevent compilation errors when compilers don't read the source files as UTF-8. MSVC in certain codepages previously misread some UTF-8 comments as containing newlines, causing it to try to process the rest of the comment as code. This was fixed by forcing MSVC to read the files as UTF-8 using the `/utf-8` flag, but this doesn't seem to be supported in older versions. Since the issue was caused by newlines being added where they didn't belong, using C89-style comments instead should avoid the problem altogether. I'll still keep the utf-8 flag around for supported compilers - just in case. --- src/Game.cpp | 4 +- src/Profile.cpp | 2 +- src/Stage.cpp | 174 ++++++++++++++++++++++++------------------------ src/TextScr.cpp | 6 +- 4 files changed, 93 insertions(+), 93 deletions(-) diff --git a/src/Game.cpp b/src/Game.cpp index c7357235..91701041 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -688,7 +688,7 @@ BOOL Game(HWND hWnd) if (!LoadGenericData()) { - 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); // '汎用ファイルが読めない' and 'エラー' ('Couldn't read general purpose files' and 'Error') in Shift-JIS + 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); /* '汎用ファイルが読めない' and 'エラー' ('Couldn't read general purpose files' and 'Error') in Shift-JIS */ return FALSE; } @@ -699,7 +699,7 @@ BOOL Game(HWND hWnd) if (!LoadNpcTable(path)) { - 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); // 'NPCテーブルが読めない' and 'エラー' ('Couldn't read the NPC table' and 'Error') in Shift-JIS + 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); /* 'NPCテーブルが読めない' and 'エラー' ('Couldn't read the NPC table' and 'Error') in Shift-JIS */ return FALSE; } diff --git a/src/Profile.cpp b/src/Profile.cpp index 4c5035f9..08a2eb8e 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -180,7 +180,7 @@ BOOL InitializeGame(HWND hWnd) InitFlags(); if (!TransferStage(13, 200, 10, 8)) { - 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); // 'ステージの読み込みに失敗' and 'エラー' ('Failed to load stage' and 'Error') in Shift-JIS + 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); /* 'ステージの読み込みに失敗' and 'エラー' ('Failed to load stage' and 'Error') in Shift-JIS */ return FALSE; } diff --git a/src/Stage.cpp b/src/Stage.cpp index 42733d0c..967dd9de 100644 --- a/src/Stage.cpp +++ b/src/Stage.cpp @@ -34,101 +34,101 @@ MusicID gOldNo; // Note: Pixel made numerous capitalisation errors when making this table. // This isn't a problem for Windows, because of its case-insensitive filesystem. const STAGE_TABLE gTMT[95] = { - STAGE_ENTRY("0", "0", 4, "bk0", "Guest", "0", 0, "Null", "\x96\xB3"), // 無 - STAGE_ENTRY("Pens", "Pens1", 1, "BkBlue", "Guest", "0", 0, "Arthur's House", "\x83\x41\x81\x5B\x83\x54\x81\x5B\x82\xCC\x89\xC6"), // アーサーの家 - STAGE_ENTRY("Eggs", "Eggs", 1, "BkGreen", "Eggs1", "Ravil", 0, "Egg Corridor", "\x83\x5E\x83\x7D\x83\x53\x89\xF1\x98\x4C"), // タマゴ回廊 - STAGE_ENTRY("EggX", "EggX", 4, "bk0", "Eggs1", "0", 0, "Egg No. 00", "\x83\x5E\x83\x7D\x83\x53\x20\x4E\x6F\x2E\x30\x30"), // タマゴ No.00 - STAGE_ENTRY("EggIn", "Egg6", 4, "bk0", "Eggs1", "0", 0, "Egg No. 06", "\x83\x5E\x83\x7D\x83\x53\x20\x4E\x6F\x2E\x30\x36"), // タマゴ No.06 - STAGE_ENTRY("Store", "EggR", 4, "bk0", "Eggs1", "0", 0, "Egg Observation Room", "\x83\x5E\x83\x7D\x83\x53\x8A\xC4\x8E\x8B\x8E\xBA"), // タマゴ監視室 - STAGE_ENTRY("Weed", "Weed", 1, "BkBlue", "Weed", "0", 0, "Grasstown", "\x83\x4E\x83\x54\x83\x80\x83\x89"), // クサムラ - STAGE_ENTRY("Barr", "Santa", 4, "bk0", "Weed", "0", 0, "Santa's House", "\x83\x54\x83\x93\x83\x5E\x82\xCC\x89\xC6"), // サンタの家 - STAGE_ENTRY("Barr", "Chako", 1, "BkBlue", "Guest", "0", 0, "Chaco's House", "\x83\x60\x83\x83\x83\x52\x82\xCC\x89\xC6"), // チャコの家 - STAGE_ENTRY("Maze", "MazeI", 4, "bk0", "Maze", "0", 0, "Labyrinth I", "\x96\xC0\x8B\x7B\x82\x68"), // 迷宮I - STAGE_ENTRY("Sand", "Sand", 1, "BkGreen", "Sand", "Omg", 1, "Sand Zone", "\x8D\xBB\x8B\xE6"), // 砂区 - STAGE_ENTRY("Mimi", "Mimi", 1, "BkBlue", "Guest", "0", 0, "Mimiga Village", "\x83\x7E\x83\x7E\x83\x4B\x81\x5B\x82\xCC\x91\xBA"), // ミミガーの村 - STAGE_ENTRY("Cave", "Cave", 4, "bk0", "Cemet", "0", 0, "First Cave", "\x8D\xC5\x8F\x89\x82\xCC\x93\xB4\x8C\x41"), // 最初の洞窟 - STAGE_ENTRY("Cave", "Start", 4, "bk0", "Cemet", "0", 0, "Start Point", "\x83\x58\x83\x5E\x81\x5B\x83\x67\x92\x6E\x93\x5F"), // スタート地点 - STAGE_ENTRY("Mimi", "Barr", 4, "bk0", "Cemet", "Bllg", 0, "Shack", "\x83\x6F\x83\x89\x83\x62\x83\x4E\x8F\xAC\x89\xAE"), // バラック小屋 - STAGE_ENTRY("Mimi", "Pool", 1, "BkBlue", "Guest", "0", 0, "Reservoir", "\x92\x99\x90\x85\x92\x72"), // 貯水池 - STAGE_ENTRY("Mimi", "Cemet", 4, "bk0", "Cemet", "0", 0, "Graveyard", "\x82\xCD\x82\xA9\x82\xCE"), // はかば - STAGE_ENTRY("Mimi", "Plant", 1, "BkGreen", "Plant", "0", 0, "Yamashita Farm", "\x8E\x52\x89\xBA\x94\x5F\x89\x80"), // 山下農園 - STAGE_ENTRY("Store", "Shelt", 4, "bk0", "Eggs1", "0", 0, "Shelter", "\x83\x56\x83\x46\x83\x8B\x83\x5E\x81\x5B"), // シェルター - STAGE_ENTRY("Pens", "Comu", 1, "BkBlue", "Guest", "0", 0, "Assembly Hall", "\x8F\x57\x89\xEF\x8F\xEA"), // 集会場 - STAGE_ENTRY("Mimi", "MiBox", 4, "bk0", "0", "0", 0, "Save Point", "\x83\x5A\x81\x5B\x83\x75\x83\x7C\x83\x43\x83\x93\x83\x67"), // セーブポイント - STAGE_ENTRY("Store", "EgEnd1", 4, "bk0", "0", "0", 0, "Side Room", "\x83\x5E\x83\x7D\x83\x53\x89\xF1\x98\x4C\x82\xCC\x8C\xC2\x8E\xBA"), // タマゴ回廊の個室 - STAGE_ENTRY("Store", "Cthu", 4, "bk0", "0", "0", 0, "Cthulhu's Abode", "\x83\x4E\x83\x67\x83\x44\x83\x8B\x81\x5B\x82\xCC\x8F\x5A\x8F\x88"), // クトゥルーの住処 - STAGE_ENTRY("EggIn", "Egg1", 4, "bk0", "Eggs1", "0", 0, "Egg No. 01", "\x83\x5E\x83\x7D\x83\x53\x20\x4E\x6F\x2E\x30\x31"), // タマゴ No.01 - STAGE_ENTRY("Pens", "Pens2", 1, "BkBlue", "Guest", "0", 0, "Arthur's House", "\x83\x41\x81\x5B\x83\x54\x81\x5B\x82\xCC\x89\xC6"), // アーサーの家 - STAGE_ENTRY("Barr", "Malco", 1, "BkBlue", "Weed", "Bllg", 0, "Power Room", "\x93\x64\x8C\xB9\x8E\xBA"), // 電源室 - STAGE_ENTRY("Barr", "WeedS", 1, "BkBlue", "0", "0", 0, "Save Point", "\x83\x5A\x81\x5B\x83\x75\x83\x7C\x83\x43\x83\x93\x83\x67"), // セーブポイント - STAGE_ENTRY("Store", "WeedD", 1, "BkBlue", "0", "0", 0, "Execution Chamber", "\x8F\x88\x8C\x59\x8E\xBA"), // 処刑室 - STAGE_ENTRY("Weed", "Frog", 2, "BkGreen", "Weed", "Frog", 2, "Gum", "\x83\x4B\x83\x80"), // ガム - STAGE_ENTRY("Sand", "Curly", 4, "bk0", "Sand", "Curly", 0, "Sand Zone Residence", "\x8D\xBB\x8B\xE6\x92\x93\x8D\xDD\x8F\x8A"), // 砂区駐在所 - STAGE_ENTRY("Pens", "WeedB", 1, "BkBlue", "Ravil", "0", 0, "Grasstown Hut", "\x83\x4E\x83\x54\x83\x80\x83\x89\x82\xCC\x8F\xAC\x89\xAE"), // クサムラの小屋 - STAGE_ENTRY("River", "Stream", 5, "BkBlue", "Stream", "IronH", 5, "Main Artery", "\x91\xE5\x93\xAE\x96\xAC"), // 大動脈 - STAGE_ENTRY("Pens", "CurlyS", 4, "bk0", "Sand", "Curly", 0, "Small Room", "\x8F\xAC\x95\x94\x89\xAE"), // 小部屋 - STAGE_ENTRY("Barr", "Jenka1", 4, "bk0", "Sand", "Bllg", 0, "Jenka's House", "\x83\x57\x83\x46\x83\x93\x83\x4A\x82\xCC\x89\xC6"), // ジェンカの家 - STAGE_ENTRY("Sand", "Dark", 1, "bkBlack", "Sand", "0", 0, "Deserted House", "\x94\x70\x89\xAE"), // 廃屋 - STAGE_ENTRY("Gard", "Gard", 1, "BkGard", "Toro", "Bllg", 0, "Sand Zone Storehouse", "\x8D\xBB\x8B\xE6\x91\x71\x8C\xC9"), // 砂区倉庫 - STAGE_ENTRY("Barr", "Jenka2", 4, "bk0", "Sand", "Bllg", 0, "Jenka's House", "\x83\x57\x83\x46\x83\x93\x83\x4A\x82\xCC\x89\xC6"), // ジェンカの家 - STAGE_ENTRY("Sand", "SandE", 1, "BkGreen", "Sand", "Bllg", 0, "Sand Zone", "\x8D\xBB\x8B\xE6"), // 砂区 - STAGE_ENTRY("Maze", "MazeH", 4, "bk0", "Maze", "0", 0, "Labyrinth H", "\x96\xC0\x8B\x7B\x82\x67"), // 迷宮H - STAGE_ENTRY("Maze", "MazeW", 1, "BkMaze", "Maze", "X", 3, "Labyrinth W", "\x96\xC0\x8B\x7B\x82\x76"), // 迷宮W - STAGE_ENTRY("Maze", "MazeO", 4, "bk0", "Guest", "0", 0, "Camp", "\x83\x4C\x83\x83\x83\x93\x83\x76"), // キャンプ - STAGE_ENTRY("Maze", "MazeD", 4, "bk0", "Guest", "Dark", 0, "Clinic Ruins", "\x90\x66\x97\xC3\x8F\x8A\x90\xD5"), // 診療所跡 - STAGE_ENTRY("Store", "MazeA", 4, "bk0", "Maze", "0", 0, "Labyrinth Shop", "\x96\xC0\x8B\x7B\x82\xCC\x93\x58"), // 迷宮の店 - STAGE_ENTRY("Maze", "MazeB", 1, "BkBlue", "Maze", "0", 0, "Labyrinth B", "\x96\xC0\x8B\x7B\x82\x61"), // 迷宮B - STAGE_ENTRY("Maze", "MazeS", 2, "BkGray", "Maze", "Bllg", 0, "Boulder Chamber", "\x91\xE5\x90\xCE\x82\xCC\x8D\xC7\x82\xAE\x8F\x8A"), // 大石の塞ぐ所 - STAGE_ENTRY("Maze", "MazeM", 1, "BkRed", "Maze", "0", 0, "Labyrinth M", "\x96\xC0\x8B\x7B\x82\x6C"), // 迷宮M - STAGE_ENTRY("Cave", "Drain", 3, "BkWater", "Cemet", "0", 0, "Dark Place", "\x88\xC3\x82\xA2\x8F\x8A"), // 暗い所 - STAGE_ENTRY("Almond", "Almond", 3, "BkWater", "Cemet", "Almo1", 4, "Core", "\x83\x52\x83\x41"), // コア - STAGE_ENTRY("River", "River", 2, "bkGreen", "Weed", "0", 0, "Waterway", "\x90\x85\x98\x48"), // 水路 - STAGE_ENTRY("Eggs", "Eggs2", 1, "BkGreen", "Eggs2", "0", 0, "Egg Corridor?", "\x83\x5E\x83\x7D\x83\x53\x89\xF1\x98\x4C\x81\x48"), // タマゴ回廊? - STAGE_ENTRY("Store", "Cthu2", 4, "bk0", "Eggs1", "0", 0, "Cthulhu's Abode?", "\x83\x4E\x83\x67\x83\x44\x83\x8B\x81\x5B\x82\xCC\x8F\x5A\x8F\x88\x81\x48"), // クトゥルーの住処? - STAGE_ENTRY("Store", "EggR2", 4, "bk0", "Eggs1", "TwinD", 6, "Egg Observation Room?", "\x83\x5E\x83\x7D\x83\x53\x8A\xC4\x8E\x8B\x8E\xBA\x81\x48"), // タマゴ監視室? - STAGE_ENTRY("EggX", "EggX2", 4, "bk0", "Eggs1", "0", 0, "Egg No. 00", "\x83\x5E\x83\x7D\x83\x53\x20\x4E\x6F\x2E\x30\x30"), // タマゴ No.00 - STAGE_ENTRY("Oside", "Oside", 6, "BkMoon", "Moon", "0", 0, "Outer Wall", "\x8A\x4F\x95\xC7"), // 外壁 - STAGE_ENTRY("Store", "EgEnd2", 4, "bk0", "Eggs1", "0", 0, "Side Room", "\x83\x5E\x83\x7D\x83\x53\x89\xF1\x98\x4C\x82\xCC\x8C\xC2\x8E\xBA"), // タマゴ回廊の個室 - STAGE_ENTRY("Store", "Itoh", 2, "bkBlue", "Guest", "0", 0, "Storehouse", "\x91\x71\x8C\xC9"), // 倉庫 - STAGE_ENTRY("Cent", "Cent", 1, "bkGreen", "Guest", "Cent", 0, "Plantation", "\x91\xE5\x94\x5F\x89\x80"), // 大農園 - STAGE_ENTRY("Jail", "Jail1", 4, "bk0", "Guest", "Cent", 0, "Jail No. 1", "\x91\xE6\x82\x50\x98\x53"), // 第1牢 - STAGE_ENTRY("Jail", "Momo", 4, "bk0", "Guest", "0", 0, "Hideout", "\x83\x4A\x83\x4E\x83\x8C\x83\x4B"), // カクレガ - STAGE_ENTRY("Jail", "lounge", 4, "bk0", "Guest", "0", 0, "Rest Area", "\x8B\x78\x8C\x65\x8F\x8A"), // 休憩所 - STAGE_ENTRY("Store", "CentW", 4, "bk0", "Guest", "Cent", 0, "Teleporter", "\x93\x5D\x91\x97\x8E\xBA"), // 転送室 - STAGE_ENTRY("Store", "Jail2", 4, "bk0", "Guest", "Cent", 0, "Jail No. 2", "\x91\xE6\x82\x51\x98\x53"), // 第2牢 - STAGE_ENTRY("White", "Blcny1", 7, "BkFog", "Ravil", "Heri", 0, "Balcony", "\x83\x6F\x83\x8B\x83\x52\x83\x6A\x81\x5B"), // バルコニー - STAGE_ENTRY("Jail", "Priso1", 4, "BkGray", "Red", "0", 0, "Final Cave", "\x8D\xC5\x8C\xE3\x82\xCC\x93\xB4\x8C\x41"), // 最後の洞窟 - STAGE_ENTRY("White", "Ring1", 7, "BkFog", "Guest", "Miza", 0, "Throne Room", "\x89\xA4\x82\xCC\x8B\xCA\x8D\xC0"), // 王の玉座 - STAGE_ENTRY("White", "Ring2", 7, "BkFog", "Guest", "Dr", 0, "The King's Table", "\x89\xA4\x82\xCC\x90\x48\x91\xEC"), // 王の食卓 - STAGE_ENTRY("Pens", "Prefa1", 4, "Bk0", "0", "0", 0, "Prefab Building", "\x83\x76\x83\x8C\x83\x6E\x83\x75"), // プレハブ - STAGE_ENTRY("Jail", "Priso2", 4, "BkGray", "Red", "0", 0, "Last Cave (Hidden)", "\x8D\xC5\x8C\xE3\x82\xCC\x93\xB4\x8C\x41\x81\x45\x97\xA0"), // 最後の洞窟・裏 - STAGE_ENTRY("White", "Ring3", 4, "Bk0", "Miza", "Almo2", 7, "Black Space", "\x8D\x95\x82\xA2\x8D\x4C\x8A\xD4"), // 黒い広間 - STAGE_ENTRY("Pens", "Little", 2, "BkBlue", "Guest", "0", 0, "Little House", "\x83\x8A\x83\x67\x83\x8B\x89\xC6"), // リトル家 - STAGE_ENTRY("White", "Blcny2", 7, "BkFog", "Ravil", "Heri", 0, "Balcony", "\x83\x6F\x83\x8B\x83\x52\x83\x6A\x81\x5B"), // バルコニー - STAGE_ENTRY("Fall", "Fall", 1, "BkFall", "Guest", "Heri", 0, "Fall", "\x97\x8E\x89\xBA"), // 落下 - STAGE_ENTRY("White", "Kings", 4, "Bk0", "Kings", "0", 0, "u", "\x75"), // u - STAGE_ENTRY("Pens", "Pixel", 1, "BkBlue", "Guest", "0", 0, "Waterway Cabin", "\x90\x85\x98\x48\x82\xCC\x8F\xAC\x95\x94\x89\xAE"), // 水路の小部屋 + STAGE_ENTRY("0", "0", 4, "bk0", "Guest", "0", 0, "Null", "\x96\xB3"), /* 無 */ + STAGE_ENTRY("Pens", "Pens1", 1, "BkBlue", "Guest", "0", 0, "Arthur's House", "\x83\x41\x81\x5B\x83\x54\x81\x5B\x82\xCC\x89\xC6"), /* アーサーの家 */ + STAGE_ENTRY("Eggs", "Eggs", 1, "BkGreen", "Eggs1", "Ravil", 0, "Egg Corridor", "\x83\x5E\x83\x7D\x83\x53\x89\xF1\x98\x4C"), /* タマゴ回廊 */ + STAGE_ENTRY("EggX", "EggX", 4, "bk0", "Eggs1", "0", 0, "Egg No. 00", "\x83\x5E\x83\x7D\x83\x53\x20\x4E\x6F\x2E\x30\x30"), /* タマゴ No.00 */ + STAGE_ENTRY("EggIn", "Egg6", 4, "bk0", "Eggs1", "0", 0, "Egg No. 06", "\x83\x5E\x83\x7D\x83\x53\x20\x4E\x6F\x2E\x30\x36"), /* タマゴ No.06 */ + STAGE_ENTRY("Store", "EggR", 4, "bk0", "Eggs1", "0", 0, "Egg Observation Room", "\x83\x5E\x83\x7D\x83\x53\x8A\xC4\x8E\x8B\x8E\xBA"), /* タマゴ監視室 */ + STAGE_ENTRY("Weed", "Weed", 1, "BkBlue", "Weed", "0", 0, "Grasstown", "\x83\x4E\x83\x54\x83\x80\x83\x89"), /* クサムラ */ + STAGE_ENTRY("Barr", "Santa", 4, "bk0", "Weed", "0", 0, "Santa's House", "\x83\x54\x83\x93\x83\x5E\x82\xCC\x89\xC6"), /* サンタの家 */ + STAGE_ENTRY("Barr", "Chako", 1, "BkBlue", "Guest", "0", 0, "Chaco's House", "\x83\x60\x83\x83\x83\x52\x82\xCC\x89\xC6"), /* チャコの家 */ + STAGE_ENTRY("Maze", "MazeI", 4, "bk0", "Maze", "0", 0, "Labyrinth I", "\x96\xC0\x8B\x7B\x82\x68"), /* 迷宮I */ + STAGE_ENTRY("Sand", "Sand", 1, "BkGreen", "Sand", "Omg", 1, "Sand Zone", "\x8D\xBB\x8B\xE6"), /* 砂区 */ + STAGE_ENTRY("Mimi", "Mimi", 1, "BkBlue", "Guest", "0", 0, "Mimiga Village", "\x83\x7E\x83\x7E\x83\x4B\x81\x5B\x82\xCC\x91\xBA"), /* ミミガーの村 */ + STAGE_ENTRY("Cave", "Cave", 4, "bk0", "Cemet", "0", 0, "First Cave", "\x8D\xC5\x8F\x89\x82\xCC\x93\xB4\x8C\x41"), /* 最初の洞窟 */ + STAGE_ENTRY("Cave", "Start", 4, "bk0", "Cemet", "0", 0, "Start Point", "\x83\x58\x83\x5E\x81\x5B\x83\x67\x92\x6E\x93\x5F"), /* スタート地点 */ + STAGE_ENTRY("Mimi", "Barr", 4, "bk0", "Cemet", "Bllg", 0, "Shack", "\x83\x6F\x83\x89\x83\x62\x83\x4E\x8F\xAC\x89\xAE"), /* バラック小屋 */ + STAGE_ENTRY("Mimi", "Pool", 1, "BkBlue", "Guest", "0", 0, "Reservoir", "\x92\x99\x90\x85\x92\x72"), /* 貯水池 */ + STAGE_ENTRY("Mimi", "Cemet", 4, "bk0", "Cemet", "0", 0, "Graveyard", "\x82\xCD\x82\xA9\x82\xCE"), /* はかば */ + STAGE_ENTRY("Mimi", "Plant", 1, "BkGreen", "Plant", "0", 0, "Yamashita Farm", "\x8E\x52\x89\xBA\x94\x5F\x89\x80"), /* 山下農園 */ + STAGE_ENTRY("Store", "Shelt", 4, "bk0", "Eggs1", "0", 0, "Shelter", "\x83\x56\x83\x46\x83\x8B\x83\x5E\x81\x5B"), /* シェルター */ + STAGE_ENTRY("Pens", "Comu", 1, "BkBlue", "Guest", "0", 0, "Assembly Hall", "\x8F\x57\x89\xEF\x8F\xEA"), /* 集会場 */ + STAGE_ENTRY("Mimi", "MiBox", 4, "bk0", "0", "0", 0, "Save Point", "\x83\x5A\x81\x5B\x83\x75\x83\x7C\x83\x43\x83\x93\x83\x67"), /* セーブポイント */ + STAGE_ENTRY("Store", "EgEnd1", 4, "bk0", "0", "0", 0, "Side Room", "\x83\x5E\x83\x7D\x83\x53\x89\xF1\x98\x4C\x82\xCC\x8C\xC2\x8E\xBA"), /* タマゴ回廊の個室 */ + STAGE_ENTRY("Store", "Cthu", 4, "bk0", "0", "0", 0, "Cthulhu's Abode", "\x83\x4E\x83\x67\x83\x44\x83\x8B\x81\x5B\x82\xCC\x8F\x5A\x8F\x88"), /* クトゥルーの住処 */ + STAGE_ENTRY("EggIn", "Egg1", 4, "bk0", "Eggs1", "0", 0, "Egg No. 01", "\x83\x5E\x83\x7D\x83\x53\x20\x4E\x6F\x2E\x30\x31"), /* タマゴ No.01 */ + STAGE_ENTRY("Pens", "Pens2", 1, "BkBlue", "Guest", "0", 0, "Arthur's House", "\x83\x41\x81\x5B\x83\x54\x81\x5B\x82\xCC\x89\xC6"), /* アーサーの家 */ + STAGE_ENTRY("Barr", "Malco", 1, "BkBlue", "Weed", "Bllg", 0, "Power Room", "\x93\x64\x8C\xB9\x8E\xBA"), /* 電源室 */ + STAGE_ENTRY("Barr", "WeedS", 1, "BkBlue", "0", "0", 0, "Save Point", "\x83\x5A\x81\x5B\x83\x75\x83\x7C\x83\x43\x83\x93\x83\x67"), /* セーブポイント */ + STAGE_ENTRY("Store", "WeedD", 1, "BkBlue", "0", "0", 0, "Execution Chamber", "\x8F\x88\x8C\x59\x8E\xBA"), /* 処刑室 */ + STAGE_ENTRY("Weed", "Frog", 2, "BkGreen", "Weed", "Frog", 2, "Gum", "\x83\x4B\x83\x80"), /* ガム */ + STAGE_ENTRY("Sand", "Curly", 4, "bk0", "Sand", "Curly", 0, "Sand Zone Residence", "\x8D\xBB\x8B\xE6\x92\x93\x8D\xDD\x8F\x8A"), /* 砂区駐在所 */ + STAGE_ENTRY("Pens", "WeedB", 1, "BkBlue", "Ravil", "0", 0, "Grasstown Hut", "\x83\x4E\x83\x54\x83\x80\x83\x89\x82\xCC\x8F\xAC\x89\xAE"), /* クサムラの小屋 */ + STAGE_ENTRY("River", "Stream", 5, "BkBlue", "Stream", "IronH", 5, "Main Artery", "\x91\xE5\x93\xAE\x96\xAC"), /* 大動脈 */ + STAGE_ENTRY("Pens", "CurlyS", 4, "bk0", "Sand", "Curly", 0, "Small Room", "\x8F\xAC\x95\x94\x89\xAE"), /* 小部屋 */ + STAGE_ENTRY("Barr", "Jenka1", 4, "bk0", "Sand", "Bllg", 0, "Jenka's House", "\x83\x57\x83\x46\x83\x93\x83\x4A\x82\xCC\x89\xC6"), /* ジェンカの家 */ + STAGE_ENTRY("Sand", "Dark", 1, "bkBlack", "Sand", "0", 0, "Deserted House", "\x94\x70\x89\xAE"), /* 廃屋 */ + STAGE_ENTRY("Gard", "Gard", 1, "BkGard", "Toro", "Bllg", 0, "Sand Zone Storehouse", "\x8D\xBB\x8B\xE6\x91\x71\x8C\xC9"), /* 砂区倉庫 */ + STAGE_ENTRY("Barr", "Jenka2", 4, "bk0", "Sand", "Bllg", 0, "Jenka's House", "\x83\x57\x83\x46\x83\x93\x83\x4A\x82\xCC\x89\xC6"), /* ジェンカの家 */ + STAGE_ENTRY("Sand", "SandE", 1, "BkGreen", "Sand", "Bllg", 0, "Sand Zone", "\x8D\xBB\x8B\xE6"), /* 砂区 */ + STAGE_ENTRY("Maze", "MazeH", 4, "bk0", "Maze", "0", 0, "Labyrinth H", "\x96\xC0\x8B\x7B\x82\x67"), /* 迷宮H */ + STAGE_ENTRY("Maze", "MazeW", 1, "BkMaze", "Maze", "X", 3, "Labyrinth W", "\x96\xC0\x8B\x7B\x82\x76"), /* 迷宮W */ + STAGE_ENTRY("Maze", "MazeO", 4, "bk0", "Guest", "0", 0, "Camp", "\x83\x4C\x83\x83\x83\x93\x83\x76"), /* キャンプ */ + STAGE_ENTRY("Maze", "MazeD", 4, "bk0", "Guest", "Dark", 0, "Clinic Ruins", "\x90\x66\x97\xC3\x8F\x8A\x90\xD5"), /* 診療所跡 */ + STAGE_ENTRY("Store", "MazeA", 4, "bk0", "Maze", "0", 0, "Labyrinth Shop", "\x96\xC0\x8B\x7B\x82\xCC\x93\x58"), /* 迷宮の店 */ + STAGE_ENTRY("Maze", "MazeB", 1, "BkBlue", "Maze", "0", 0, "Labyrinth B", "\x96\xC0\x8B\x7B\x82\x61"), /* 迷宮B */ + STAGE_ENTRY("Maze", "MazeS", 2, "BkGray", "Maze", "Bllg", 0, "Boulder Chamber", "\x91\xE5\x90\xCE\x82\xCC\x8D\xC7\x82\xAE\x8F\x8A"), /* 大石の塞ぐ所 */ + STAGE_ENTRY("Maze", "MazeM", 1, "BkRed", "Maze", "0", 0, "Labyrinth M", "\x96\xC0\x8B\x7B\x82\x6C"), /* 迷宮M */ + STAGE_ENTRY("Cave", "Drain", 3, "BkWater", "Cemet", "0", 0, "Dark Place", "\x88\xC3\x82\xA2\x8F\x8A"), /* 暗い所 */ + STAGE_ENTRY("Almond", "Almond", 3, "BkWater", "Cemet", "Almo1", 4, "Core", "\x83\x52\x83\x41"), /* コア */ + STAGE_ENTRY("River", "River", 2, "bkGreen", "Weed", "0", 0, "Waterway", "\x90\x85\x98\x48"), /* 水路 */ + STAGE_ENTRY("Eggs", "Eggs2", 1, "BkGreen", "Eggs2", "0", 0, "Egg Corridor?", "\x83\x5E\x83\x7D\x83\x53\x89\xF1\x98\x4C\x81\x48"), /* タマゴ回廊? */ + STAGE_ENTRY("Store", "Cthu2", 4, "bk0", "Eggs1", "0", 0, "Cthulhu's Abode?", "\x83\x4E\x83\x67\x83\x44\x83\x8B\x81\x5B\x82\xCC\x8F\x5A\x8F\x88\x81\x48"), /* クトゥルーの住処? */ + STAGE_ENTRY("Store", "EggR2", 4, "bk0", "Eggs1", "TwinD", 6, "Egg Observation Room?", "\x83\x5E\x83\x7D\x83\x53\x8A\xC4\x8E\x8B\x8E\xBA\x81\x48"), /* タマゴ監視室? */ + STAGE_ENTRY("EggX", "EggX2", 4, "bk0", "Eggs1", "0", 0, "Egg No. 00", "\x83\x5E\x83\x7D\x83\x53\x20\x4E\x6F\x2E\x30\x30"), /* タマゴ No.00 */ + STAGE_ENTRY("Oside", "Oside", 6, "BkMoon", "Moon", "0", 0, "Outer Wall", "\x8A\x4F\x95\xC7"), /* 外壁 */ + STAGE_ENTRY("Store", "EgEnd2", 4, "bk0", "Eggs1", "0", 0, "Side Room", "\x83\x5E\x83\x7D\x83\x53\x89\xF1\x98\x4C\x82\xCC\x8C\xC2\x8E\xBA"), /* タマゴ回廊の個室 */ + STAGE_ENTRY("Store", "Itoh", 2, "bkBlue", "Guest", "0", 0, "Storehouse", "\x91\x71\x8C\xC9"), /* 倉庫 */ + STAGE_ENTRY("Cent", "Cent", 1, "bkGreen", "Guest", "Cent", 0, "Plantation", "\x91\xE5\x94\x5F\x89\x80"), /* 大農園 */ + STAGE_ENTRY("Jail", "Jail1", 4, "bk0", "Guest", "Cent", 0, "Jail No. 1", "\x91\xE6\x82\x50\x98\x53"), /* 第1牢 */ + STAGE_ENTRY("Jail", "Momo", 4, "bk0", "Guest", "0", 0, "Hideout", "\x83\x4A\x83\x4E\x83\x8C\x83\x4B"), /* カクレガ */ + STAGE_ENTRY("Jail", "lounge", 4, "bk0", "Guest", "0", 0, "Rest Area", "\x8B\x78\x8C\x65\x8F\x8A"), /* 休憩所 */ + STAGE_ENTRY("Store", "CentW", 4, "bk0", "Guest", "Cent", 0, "Teleporter", "\x93\x5D\x91\x97\x8E\xBA"), /* 転送室 */ + STAGE_ENTRY("Store", "Jail2", 4, "bk0", "Guest", "Cent", 0, "Jail No. 2", "\x91\xE6\x82\x51\x98\x53"), /* 第2牢 */ + STAGE_ENTRY("White", "Blcny1", 7, "BkFog", "Ravil", "Heri", 0, "Balcony", "\x83\x6F\x83\x8B\x83\x52\x83\x6A\x81\x5B"), /* バルコニー */ + STAGE_ENTRY("Jail", "Priso1", 4, "BkGray", "Red", "0", 0, "Final Cave", "\x8D\xC5\x8C\xE3\x82\xCC\x93\xB4\x8C\x41"), /* 最後の洞窟 */ + STAGE_ENTRY("White", "Ring1", 7, "BkFog", "Guest", "Miza", 0, "Throne Room", "\x89\xA4\x82\xCC\x8B\xCA\x8D\xC0"), /* 王の玉座 */ + STAGE_ENTRY("White", "Ring2", 7, "BkFog", "Guest", "Dr", 0, "The King's Table", "\x89\xA4\x82\xCC\x90\x48\x91\xEC"), /* 王の食卓 */ + STAGE_ENTRY("Pens", "Prefa1", 4, "Bk0", "0", "0", 0, "Prefab Building", "\x83\x76\x83\x8C\x83\x6E\x83\x75"), /* プレハブ */ + STAGE_ENTRY("Jail", "Priso2", 4, "BkGray", "Red", "0", 0, "Last Cave (Hidden)", "\x8D\xC5\x8C\xE3\x82\xCC\x93\xB4\x8C\x41\x81\x45\x97\xA0"), /* 最後の洞窟・裏 */ + STAGE_ENTRY("White", "Ring3", 4, "Bk0", "Miza", "Almo2", 7, "Black Space", "\x8D\x95\x82\xA2\x8D\x4C\x8A\xD4"), /* 黒い広間 */ + STAGE_ENTRY("Pens", "Little", 2, "BkBlue", "Guest", "0", 0, "Little House", "\x83\x8A\x83\x67\x83\x8B\x89\xC6"), /* リトル家 */ + STAGE_ENTRY("White", "Blcny2", 7, "BkFog", "Ravil", "Heri", 0, "Balcony", "\x83\x6F\x83\x8B\x83\x52\x83\x6A\x81\x5B"), /* バルコニー */ + STAGE_ENTRY("Fall", "Fall", 1, "BkFall", "Guest", "Heri", 0, "Fall", "\x97\x8E\x89\xBA"), /* 落下 */ + STAGE_ENTRY("White", "Kings", 4, "Bk0", "Kings", "0", 0, "u", "\x75"), /* u */ + STAGE_ENTRY("Pens", "Pixel", 1, "BkBlue", "Guest", "0", 0, "Waterway Cabin", "\x90\x85\x98\x48\x82\xCC\x8F\xAC\x95\x94\x89\xAE"), /* 水路の小部屋 */ STAGE_ENTRY("Maze", "e_Maze", 1, "BkMaze", "Guest", "Maze", 3, "", ""), STAGE_ENTRY("Barr", "e_Jenk", 4, "bk0", "Sand", "Bllg", 0, "", ""), STAGE_ENTRY("Barr", "e_Malc", 1, "BkBlue", "Weed", "Bllg", 0, "", ""), STAGE_ENTRY("Mimi", "e_Ceme", 4, "bk0", "Plant", "0", 0, "", ""), STAGE_ENTRY("Fall", "e_Sky", 1, "BkFall", "Guest", "Heri", 0, "", ""), - STAGE_ENTRY("Pens", "Prefa2", 4, "Bk0", "0", "0", 0, "Prefab House", "\x83\x76\x83\x8C\x83\x6E\x83\x75"), // プレハブ - STAGE_ENTRY("Hell", "Hell1", 2, "bkRed", "Hell", "0", 0, "Sacred Ground - B1", "\x90\xB9\x88\xE6\x92\x6E\x89\xBA\x82\x50\x8A\x4B"), // 聖域地下1階 - STAGE_ENTRY("Hell", "Hell2", 2, "bkRed", "Hell", "0", 0, "Sacred Ground - B2", "\x90\xB9\x88\xE6\x92\x6E\x89\xBA\x82\x51\x8A\x4B"), // 聖域地下2階 - STAGE_ENTRY("Hell", "Hell3", 1, "bkRed", "Hell", "Press", 8, "Sacred Ground - B3", "\x90\xB9\x88\xE6\x92\x6E\x89\xBA\x82\x52\x8A\x4B"), // 聖域地下3階 - STAGE_ENTRY("Cave", "Mapi", 2, "bk0", "Cemet", "0", 0, "Storage", "\x95\xA8\x92\x75"), // 物置 - STAGE_ENTRY("Hell", "Hell4", 4, "bk0", "Hell", "0", 0, "Passage?", "\x92\xCA\x98\x48\x81\x48"), // 通路? - STAGE_ENTRY("Hell", "Hell42", 4, "bk0", "Hell", "Press", 8, "Passage?", "\x92\xCA\x98\x48\x81\x48"), // 通路? - STAGE_ENTRY("Hell", "Statue", 1, "bkBlue", "0", "Cent", 0, "Statue Chamber", "\x90\xCE\x91\x9C\x82\xCC\x8A\xD4"), // 石像の間 - STAGE_ENTRY("Hell", "Ballo1", 2, "bkBlue", "Priest", "Ballos", 9, "Seal Chamber", "\x95\x95\x88\xF3\x82\xCC\x8A\xD4"), // 封印の間 - STAGE_ENTRY("White", "Ostep", 7, "BkFog", "0", "0", 0, "Corridor", "\x82\xED\x82\xBD\x82\xE8\x98\x4C\x89\xBA"), // わたり廊下 + STAGE_ENTRY("Pens", "Prefa2", 4, "Bk0", "0", "0", 0, "Prefab House", "\x83\x76\x83\x8C\x83\x6E\x83\x75"), /* プレハブ */ + STAGE_ENTRY("Hell", "Hell1", 2, "bkRed", "Hell", "0", 0, "Sacred Ground - B1", "\x90\xB9\x88\xE6\x92\x6E\x89\xBA\x82\x50\x8A\x4B"), /* 聖域地下1階 */ + STAGE_ENTRY("Hell", "Hell2", 2, "bkRed", "Hell", "0", 0, "Sacred Ground - B2", "\x90\xB9\x88\xE6\x92\x6E\x89\xBA\x82\x51\x8A\x4B"), /* 聖域地下2階 */ + STAGE_ENTRY("Hell", "Hell3", 1, "bkRed", "Hell", "Press", 8, "Sacred Ground - B3", "\x90\xB9\x88\xE6\x92\x6E\x89\xBA\x82\x52\x8A\x4B"), /* 聖域地下3階 */ + STAGE_ENTRY("Cave", "Mapi", 2, "bk0", "Cemet", "0", 0, "Storage", "\x95\xA8\x92\x75"), /* 物置 */ + STAGE_ENTRY("Hell", "Hell4", 4, "bk0", "Hell", "0", 0, "Passage?", "\x92\xCA\x98\x48\x81\x48"), /* 通路? */ + STAGE_ENTRY("Hell", "Hell42", 4, "bk0", "Hell", "Press", 8, "Passage?", "\x92\xCA\x98\x48\x81\x48"), /* 通路? */ + STAGE_ENTRY("Hell", "Statue", 1, "bkBlue", "0", "Cent", 0, "Statue Chamber", "\x90\xCE\x91\x9C\x82\xCC\x8A\xD4"), /* 石像の間 */ + STAGE_ENTRY("Hell", "Ballo1", 2, "bkBlue", "Priest", "Ballos", 9, "Seal Chamber", "\x95\x95\x88\xF3\x82\xCC\x8A\xD4"), /* 封印の間 */ + STAGE_ENTRY("White", "Ostep", 7, "BkFog", "0", "0", 0, "Corridor", "\x82\xED\x82\xBD\x82\xE8\x98\x4C\x89\xBA"), /* わたり廊下 */ STAGE_ENTRY("Labo", "e_Labo", 4, "bk0", "Guest", "0", 0, "", ""), - STAGE_ENTRY("Cave", "Pole", 4, "bk0", "Guest", "0", 0, "Hermit Gunsmith", "\x82\xCD\x82\xAE\x82\xEA\x8F\x65\x92\x62\x96\xE8"), // はぐれ銃鍛冶 + STAGE_ENTRY("Cave", "Pole", 4, "bk0", "Guest", "0", 0, "Hermit Gunsmith", "\x82\xCD\x82\xAE\x82\xEA\x8F\x65\x92\x62\x96\xE8"), /* はぐれ銃鍛冶 */ STAGE_ENTRY("0", "Island", 4, "bk0", "Island", "0", 0, "", ""), - STAGE_ENTRY("Hell", "Ballo2", 2, "bkBlue", "Priest", "Bllg", 9, "Seal Chamber", "\x95\x95\x88\xF3\x82\xCC\x8A\xD4"), // 封印の間 + STAGE_ENTRY("Hell", "Ballo2", 2, "bkBlue", "Priest", "Bllg", 9, "Seal Chamber", "\x95\x95\x88\xF3\x82\xCC\x8A\xD4"), /* 封印の間 */ STAGE_ENTRY("White", "e_Blcn", 7, "BkFog", "Miza", "0", 9, "", ""), - STAGE_ENTRY("Oside", "Clock", 6, "BkMoon", "Moon", "0", 0, "Clock Room", "\x8E\x9E\x8C\x76\x89\xAE"), // 時計屋 + STAGE_ENTRY("Oside", "Clock", 6, "BkMoon", "Moon", "0", 0, "Clock Room", "\x8E\x9E\x8C\x76\x89\xAE"), /* 時計屋 */ }; BOOL TransferStage(int no, int w, int x, int y) diff --git a/src/TextScr.cpp b/src/TextScr.cpp index eb89bd64..809ec0e5 100644 --- a/src/TextScr.cpp +++ b/src/TextScr.cpp @@ -724,7 +724,7 @@ int TextScriptProc(void) if (!TransferStage(z, w, x, y)) { - 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); // 'ステージの読み込みに失敗' and 'エラー' ('Failed to load stage' and 'Error') in Shift-JIS + 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); /* 'ステージの読み込みに失敗' and 'エラー' ('Failed to load stage' and 'Error') in Shift-JIS */ return enum_ESCRETURN_exit; } } @@ -1275,8 +1275,8 @@ int TextScriptProc(void) else { char str_0[0x40]; - 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]); // '不明のコード:<%c%c%c' (Unknown code:<%c%c%c) in Shift-JIS - MessageBoxA(NULL, str_0, "\x83\x47\x83\x89\x81\x5B", MB_OK); // 'エラー' (Error) in Shift-JIS + 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]); /* '不明のコード:<%c%c%c' (Unknown code:<%c%c%c) in Shift-JIS */ + MessageBoxA(NULL, str_0, "\x83\x47\x83\x89\x81\x5B", MB_OK); /* 'エラー' (Error) in Shift-JIS */ return enum_ESCRETURN_exit; } } From 140c67a5cb2632cff3db59e7a217323cb10b5ff6 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sat, 14 Mar 2020 19:09:32 +0000 Subject: [PATCH 08/10] Make CMake file match the portable branch one --- CMakeLists.txt | 138 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 127 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d358f39..cb2b9feb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,16 +6,49 @@ option(JAPANESE "Enable the Japanese-language build" OFF) option(FIX_BUGS "Fix various bugs in the game" ON) option(DEBUG_SAVE "Re-enable the ability to drag-and-drop save files onto the window" OFF) +option(LTO "Enable link-time optimisation" OFF) +option(NATIVE_OPTIMIZATIONS "Enable processor-specific optimisations (executable might not work on other architectures) (GCC-compatible compilers only)" OFF) + +option(WARNINGS "Enable common compiler warnings (for GCC-compatible compilers and MSVC only)" OFF) +option(WARNINGS_ALL "Enable ALL compiler warnings (for Clang and MSVC only)" OFF) +option(WARNINGS_FATAL "Stop compilation on any compiler warning (for GCC-compatible compilers and MSVC only)" OFF) + project(CSE2 LANGUAGES C CXX) -#if(MSVC) +message(STATUS "Compiler ID : ${CMAKE_CXX_COMPILER_ID}") + +# Has to be placed after "project()" +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + # Using Clang (this is a match so that we also get "AppleClang" which is the Apple-provided Clang + set(COMPILER_IS_CLANG true) + message(STATUS "Compiling with Clang") +endif() + +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # Using GCC + set(COMPILER_IS_GCC true) + message(STATUS "Compiling with GCC") +endif() + +if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + # Using Intel C++ + set(COMPILER_IS_ICC true) + message(STATUS "Compiling with ICC") +endif() + +if(COMPILER_IS_CLANG OR COMPILER_IS_GCC OR COMPILER_IS_ICC) + set(COMPILER_IS_GCC_COMPATIBLE true) + message(STATUS "Compiling with a GCC-compatible compiler") +endif() + +if(MSVC) # Statically-link the CRT (vcpkg static libs do this) -# foreach(flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) -# if(${flag_var} MATCHES "/MD") -# string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") -# endif() -# endforeach() -#endif() + foreach(flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + if(${flag_var} MATCHES "/MD") + string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + endif() + endforeach() +endif() ## # CSE2 @@ -163,6 +196,60 @@ if(DEBUG_SAVE) target_compile_definitions(CSE2 PRIVATE DEBUG_SAVE) endif() +if(WARNINGS) + # HACK : Replace this with CMake provided stuff when possible (when CMake makes avoiding this possible (it isn't currently)) + + if(MSVC) + # Force to always compile with /W4 on MSVC + + # Can't do this with target_compile_options + # if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") + # string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + # else() + # target_compile_options(CSE2 PRIVATE /W4) + # endif() + + target_compile_options(CSE2 PRIVATE /W4) + elseif(COMPILER_IS_GCC_COMPATIBLE) + target_compile_options(CSE2 PRIVATE -Wall -Wextra -pedantic) + else() + message(WARNING "Could not activate warnings ! (Unsupported compiler)") + endif() +endif() + +if (WARNINGS_ALL) + # HACK : Replace this with CMake provided stuff when possible (when CMake makes avoiding this possible (it isn't currently)) + + if (MSVC) + # Force to always compile with /Wall on MSVC + + # Can't do this with target_compile_options + # if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") + # string(REGEX REPLACE "/W[0-4]" "/Wall" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + # else() + # target_compile_options(CSE2 PRIVATE /Wall) + # endif() + + target_compile_options(CSE2 PRIVATE /Wall) + elseif(COMPILER_IS_CLANG) + target_compile_options(CSE2 PRIVATE -Weverything) + else() + message(WARNING "Could not activate all warnings ! (Unsupported compiler)") + endif() +endif() + +if(WARNINGS_FATAL) + # HACK : Replace this with CMake provided stuff when possible (when CMake makes avoiding this possible (it isn't currently)) + + if(MSVC) + target_compile_options(CSE2 PRIVATE /WX) + elseif(COMPILER_IS_GCC_COMPATIBLE) + target_compile_options(CSE2 PRIVATE -Werror) + else() + message(WARNING "Could not activate fatal warnings ! (Unsupported compiler)") + endif() +endif() + # Make some tweaks if we're targetting Windows #if(WIN32) target_sources(CSE2 PRIVATE "${ASSETS_DIRECTORY}/resources/CSE2.rc") @@ -171,11 +258,10 @@ endif() # Make some tweaks if we're using MSVC if(MSVC) - target_compile_definitions(CSE2 PRIVATE _CRT_SECURE_NO_WARNINGS) # Disable warnings that normally fire up on MSVC when using "unsafe" functions instead of using MSVC's "safe" _s functions -endif() + # Disable warnings that normally fire up on MSVC when using "unsafe" functions instead of using MSVC's "safe" _s functions + target_compile_definitions(CSE2 PRIVATE _CRT_SECURE_NO_WARNINGS) -# Make it so source files are recognized as UTF-8 by MSVC -if(MSVC) + # Make it so source files are recognized as UTF-8 by MSVC target_compile_options(CSE2 PRIVATE "/utf-8") endif() @@ -205,6 +291,36 @@ set_target_properties(CSE2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${BUILD_DIRECTORY} ) +# Enable link-time optimisation if available +if(LTO) + if((${CMAKE_VERSION} VERSION_EQUAL 3.9) OR (${CMAKE_VERSION} VERSION_GREATER 3.9)) + include(CheckIPOSupported) + check_ipo_supported(RESULT result) + if(result) + set_target_properties(CSE2 PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) + endif() + endif() +endif() + +# Enable -march=native if available +if(NATIVE_OPTIMIZATIONS) + include(CheckCXXCompilerFlag) + CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE) # GCC flag + if(COMPILER_SUPPORTS_MARCH_NATIVE) + target_compile_options(CSE2 PRIVATE -march=native) + else() + CHECK_CXX_COMPILER_FLAG("-xHost" COMPILER_SUPPORTS_XHOST) # ICC (Linux) flag + CHECK_CXX_COMPILER_FLAG("/QxHost" COMPILER_SUPPORTS_QXHOST) # ICC (Windows) flag + if(COMPILER_SUPPORTS_XHOST) + target_compile_options(CSE2 PRIVATE -xHost) + elseif(COMPILER_SUPPORTS_QXHOST) + target_compile_options(CSE2 PRIVATE /QxHost) + else() + message(WARNING "Couldn't activate native optimizations ! (Unsupported compiler)") + endif() + endif() +endif() + # Link libraries target_link_libraries(CSE2 PRIVATE ddraw.lib dsound.lib Version.lib ShLwApi.Lib Imm32.lib WinMM.lib dxguid.lib) From 3de557807c97f73132f14043dc05457d96ba35cf Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sat, 14 Mar 2020 19:10:31 +0000 Subject: [PATCH 09/10] This option shouldn't be on by default --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb2b9feb..36566609 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.12) set(ASSETS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/assets") option(JAPANESE "Enable the Japanese-language build" OFF) -option(FIX_BUGS "Fix various bugs in the game" ON) +option(FIX_BUGS "Fix various bugs in the game" OFF) option(DEBUG_SAVE "Re-enable the ability to drag-and-drop save files onto the window" OFF) option(LTO "Enable link-time optimisation" OFF) From de1740b61c62afbf30500200a550512e4bcb9b97 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sat, 14 Mar 2020 19:15:41 +0000 Subject: [PATCH 10/10] Match the portable branch's CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36566609..a2fe5095 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12) set(ASSETS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/assets") -option(JAPANESE "Enable the Japanese-language build" OFF) +option(JAPANESE "Enable the Japanese-language build (instead of the unofficial Aeon Genesis English translation)" OFF) option(FIX_BUGS "Fix various bugs in the game" OFF) option(DEBUG_SAVE "Re-enable the ability to drag-and-drop save files onto the window" OFF)