From c368734a5c88b4606cb3a28ba6991e0d76232416 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Mon, 9 Sep 2019 23:43:48 +0100 Subject: [PATCH 1/8] Fix the resource file in MinGW-w64 I hate all these headers --- assets/resources/afxres.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/resources/afxres.h b/assets/resources/afxres.h index 285bef97..4c082f7e 100644 --- a/assets/resources/afxres.h +++ b/assets/resources/afxres.h @@ -1,3 +1,3 @@ // Quick-and-dirty shim to make CSE2.rc work in newer versions of Visual Studio -#include "winres.h" +#include "windows.h" From f8c2e176554ff94ce0ee233d2269477cf6aca51e Mon Sep 17 00:00:00 2001 From: Clownacy Date: Mon, 9 Sep 2019 23:46:35 +0100 Subject: [PATCH 2/8] Clean up Map.cpp --- src/Map.cpp | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/Map.cpp b/src/Map.cpp index ebcf8394..06ce24b0 100644 --- a/src/Map.cpp +++ b/src/Map.cpp @@ -112,26 +112,26 @@ unsigned char GetAttribute(int x, int y) if (x < 0 || y < 0 || x >= gMap.width || y >= gMap.length) return 0; - const size_t a = *(gMap.data + x + gMap.width * y); + const size_t a = *(gMap.data + x + (y * gMap.width)); // Yes, the original code really does do this return gMap.atrb[a]; } void DeleteMapParts(int x, int y) { - *(gMap.data + x + gMap.width * y) = 0; + *(gMap.data + x + (y * gMap.width)) = 0; } void ShiftMapParts(int x, int y) { - *(gMap.data + x + gMap.width * y) -= 1; + *(gMap.data + x + (y * gMap.width)) -= 1; } BOOL ChangeMapParts(int x, int y, unsigned char no) { - if (*(gMap.data + x + gMap.width * y) == no) + if (*(gMap.data + x + (y * gMap.width)) == no) return FALSE; - *(gMap.data + x + gMap.width * y) = no; + *(gMap.data + x + (y * gMap.width)) = no; for (int i = 0; i < 3; i++) SetNpChar(4, x * 0x200 * 0x10, y * 0x200 * 0x10, 0, 0, 0, 0, 0); @@ -152,10 +152,10 @@ void PutStage_Back(int fx, int fy) int num_x; // Get range to draw - num_x = ((WINDOW_WIDTH + 0xF) / 0x10) + 1; - num_y = ((WINDOW_HEIGHT + 0xF) / 0x10) + 1; - put_x = (fx / 0x200 + 8) / 0x10; - put_y = (fy / 0x200 + 8) / 0x10; + num_x = ((WINDOW_WIDTH + (16 - 1)) / 16) + 1; + num_y = ((WINDOW_HEIGHT + (16 - 1)) / 16) + 1; + put_x = (fx / 0x200 + 8) / 16; + put_y = (fy / 0x200 + 8) / 16; for (j = put_y; j < put_y + num_y; j++) { @@ -169,12 +169,12 @@ void PutStage_Back(int fx, int fy) continue; // Draw tile - rect.left = 16 * (gMap.data[offset] % 0x10); - rect.top = 16 * (gMap.data[offset] / 0x10); + rect.left = 16 * (gMap.data[offset] % 16); + rect.top = 16 * (gMap.data[offset] / 16); rect.right = rect.left + 16; rect.bottom = rect.top + 16; - PutBitmap3(&grcGame, 0x10 * i - 8 - fx / 0x200, 0x10 * j - 8 - fy / 0x200, &rect, SURFACE_ID_LEVEL_TILESET); + PutBitmap3(&grcGame, (i * 16 - 8) - (fx / 0x200), (j * 16 - 8) - (fy / 0x200), &rect, SURFACE_ID_LEVEL_TILESET); } } } @@ -193,8 +193,8 @@ void PutStage_Front(int fx, int fy) int num_x; // Get range to draw - num_x = ((WINDOW_WIDTH + 0xF) >> 4) + 1; - num_y = ((WINDOW_HEIGHT + 0xF) >> 4) + 1; + num_x = ((WINDOW_WIDTH + (16 - 1)) / 16) + 1; + num_y = ((WINDOW_HEIGHT + (16 - 1)) / 16) + 1; put_x = (fx / 0x200 + 8) / 16; put_y = (fy / 0x200 + 8) / 16; @@ -210,15 +210,15 @@ void PutStage_Front(int fx, int fy) continue; // Draw tile - rect.left = 16 * (gMap.data[offset] % 0x10); - rect.top = 16 * (gMap.data[offset] / 0x10); + rect.left = 16 * (gMap.data[offset] % 16); + rect.top = 16 * (gMap.data[offset] / 16); rect.right = rect.left + 16; rect.bottom = rect.top + 16; - PutBitmap3(&grcGame, 16 * i - 8 - fx / 0x200, 16 * j - 8 - fy / 0x200, &rect, SURFACE_ID_LEVEL_TILESET); + PutBitmap3(&grcGame, (i * 16 - 8) - (fx / 0x200), (j * 16 - 8) - (fy / 0x200), &rect, SURFACE_ID_LEVEL_TILESET); if (atrb == 0x43) - PutBitmap3(&grcGame, 16 * i - 8 - fx / 0x200, 16 * j - 8 - fy / 0x200, &rcSnack, SURFACE_ID_NPC_SYM); + PutBitmap3(&grcGame, (i * 16 - 8) - (fx / 0x200), (j * 16 - 8) - (fy / 0x200), &rcSnack, SURFACE_ID_NPC_SYM); } } } @@ -240,8 +240,8 @@ void PutMapDataVector(int fx, int fy) count += 2; // Get range to draw - num_x = ((WINDOW_WIDTH + 0xF) >> 4) + 1; - num_y = ((WINDOW_HEIGHT + 0xF) >> 4) + 1; + num_x = ((WINDOW_WIDTH + (16 - 1)) / 16) + 1; + num_y = ((WINDOW_HEIGHT + (16 - 1)) / 16) + 1; put_x = (fx / 0x200 + 8) / 16; put_y = (fy / 0x200 + 8) / 16; @@ -267,7 +267,7 @@ void PutMapDataVector(int fx, int fy) { case 128: case 160: - rect.left = 224 + (count % 0x10); + rect.left = 224 + (count % 16); rect.right = rect.left + 16; rect.top = 48; rect.bottom = rect.top + 16; @@ -276,12 +276,12 @@ void PutMapDataVector(int fx, int fy) case 161: rect.left = 224; rect.right = rect.left + 16; - rect.top = 48 + (count % 0x10); + rect.top = 48 + (count % 16); rect.bottom = rect.top + 16; break; case 130: case 162: - rect.left = 240 - (count % 0x10); + rect.left = 240 - (count % 16); rect.right = rect.left + 16; rect.top = 48; rect.bottom = rect.top + 16; @@ -290,12 +290,12 @@ void PutMapDataVector(int fx, int fy) case 163: rect.left = 224; rect.right = rect.left + 16; - rect.top = 64 - (count % 0x10); + rect.top = 64 - (count % 16); rect.bottom = rect.top + 16; break; } - PutBitmap3(&grcGame, 16 * i - 8 - fx / 0x200, 16 * j - 8 - fy / 0x200, &rect, SURFACE_ID_CARET); + PutBitmap3(&grcGame, (i * 16 - 8) - (fx / 0x200), (j * 16 - 8) - (fy / 0x200), &rect, SURFACE_ID_CARET); } } } From a81fe10fc7f2c390430a18db2f8820be4bcd7ead Mon Sep 17 00:00:00 2001 From: Clownacy Date: Tue, 10 Sep 2019 00:26:49 +0100 Subject: [PATCH 3/8] Move Visual Studio 2003 files to their own folder We don't want these conflicting with the upcoming Visual Studio 2017 files. --- .gitignore | 12 +- README.md | 2 +- CSE2.sln => vs2003/CSE2.sln | 0 CSE2.vcproj => vs2003/CSE2.vcproj | 386 +++++++++++++++--------------- 4 files changed, 200 insertions(+), 200 deletions(-) rename CSE2.sln => vs2003/CSE2.sln (100%) rename CSE2.vcproj => vs2003/CSE2.vcproj (57%) diff --git a/.gitignore b/.gitignore index 4ae5742c..24a6882d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,13 +9,13 @@ devilution/orig.asm devilution/compare.asm # Exclude MSVC IntelliSense database -CSE2.ncb +vs2003/CSE2.ncb # Exclude MSVC Solution User Options file -CSE2.suo +vs2003/CSE2.suo # Exclude MSVC build folders -Debug -Release -Debug (Japanese) -Release (Japanese) +vs2003/Debug +vs2003/Release +vs2003/Debug (Japanese) +vs2003/Release (Japanese) diff --git a/README.md b/README.md index 189b1c70..d4a0735a 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Many months of copypasting and experimenting later, this is the result. ### Visual Studio .NET 2003 -Of course, project files for Visual Studio .NET 2003 are available. +Of course, project files for Visual Studio .NET 2003 are available, and can be found in the 'vs2003' folder. Visual Studio .NET 2003 was used by Pixel to create the original `Doukutsu.exe`, so these project files allow us to check the accuracy of the decompilation by comparing the generated assembly code to that of the original executable. The tool for this can be found in the 'devilution' folder. diff --git a/CSE2.sln b/vs2003/CSE2.sln similarity index 100% rename from CSE2.sln rename to vs2003/CSE2.sln diff --git a/CSE2.vcproj b/vs2003/CSE2.vcproj similarity index 57% rename from CSE2.vcproj rename to vs2003/CSE2.vcproj index a74ae0d0..27e0f055 100644 --- a/CSE2.vcproj +++ b/vs2003/CSE2.vcproj @@ -224,218 +224,218 @@ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> + RelativePath="..\src\ArmsItem.cpp"> + RelativePath="..\src\Back.cpp"> + RelativePath="..\src\BulHit.cpp"> + RelativePath="..\src\Bullet.cpp"> + RelativePath="..\src\Caret.cpp"> + RelativePath="..\src\Config.cpp"> + RelativePath="..\src\Dialog.cpp"> + RelativePath="..\src\Draw.cpp"> + RelativePath="..\src\Ending.cpp"> + RelativePath="..\src\Escape.cpp"> + RelativePath="..\src\Fade.cpp"> + RelativePath="..\src\Flags.cpp"> + RelativePath="..\src\Flash.cpp"> + RelativePath="..\src\Frame.cpp"> + RelativePath="..\src\Game.cpp"> + RelativePath="..\src\Generic.cpp"> + RelativePath="..\src\GenericLoad.cpp"> + RelativePath="..\src\Input.cpp"> + RelativePath="..\src\KeyControl.cpp"> + RelativePath="..\src\Main.cpp"> + RelativePath="..\src\Map.cpp"> + RelativePath="..\src\MapName.cpp"> + RelativePath="..\src\MiniMap.cpp"> + RelativePath="..\src\MyChar.cpp"> + RelativePath="..\src\MycHit.cpp"> + RelativePath="..\src\MycParam.cpp"> + RelativePath="..\src\Organya.cpp"> + RelativePath="..\src\PixTone.cpp"> + RelativePath="..\src\Profile.cpp"> + RelativePath="..\src\SelStage.cpp"> + RelativePath="..\src\Shoot.cpp"> + RelativePath="..\src\Sound.cpp"> + RelativePath="..\src\Stage.cpp"> + RelativePath="..\src\Star.cpp"> + RelativePath="..\src\TextScr.cpp"> + RelativePath="..\src\Triangle.cpp"> + RelativePath="..\src\ValueView.cpp"> + RelativePath="..\src\NpcAct000.cpp"> + RelativePath="..\src\NpcAct020.cpp"> + RelativePath="..\src\NpcAct040.cpp"> + RelativePath="..\src\NpcAct060.cpp"> + RelativePath="..\src\NpcAct080.cpp"> + RelativePath="..\src\NpcAct100.cpp"> + RelativePath="..\src\NpcAct120.cpp"> + RelativePath="..\src\NpcAct140.cpp"> + RelativePath="..\src\NpcAct160.cpp"> + RelativePath="..\src\NpcAct180.cpp"> + RelativePath="..\src\NpcAct200.cpp"> + RelativePath="..\src\NpcAct220.cpp"> + RelativePath="..\src\NpcAct240.cpp"> + RelativePath="..\src\NpcAct260.cpp"> + RelativePath="..\src\NpcAct280.cpp"> + RelativePath="..\src\NpcAct300.cpp"> + RelativePath="..\src\NpcAct320.cpp"> + RelativePath="..\src\NpcAct340.cpp"> + RelativePath="..\src\NpChar.cpp"> + RelativePath="..\src\NpcHit.cpp"> + RelativePath="..\src\NpcTbl.cpp"> + RelativePath="..\src\Boss.cpp"> + RelativePath="..\src\BossAlmo1.cpp"> + RelativePath="..\src\BossAlmo2.cpp"> + RelativePath="..\src\BossBallos.cpp"> + RelativePath="..\src\BossFrog.cpp"> + RelativePath="..\src\BossIronH.cpp"> + RelativePath="..\src\BossLife.cpp"> + RelativePath="..\src\BossOhm.cpp"> + RelativePath="..\src\BossPress.cpp"> + RelativePath="..\src\BossTwinD.cpp"> + RelativePath="..\src\BossX.cpp"> @@ -444,172 +444,172 @@ Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> + RelativePath="..\src\ArmsItem.h"> + RelativePath="..\src\Back.h"> + RelativePath="..\src\Boss.h"> + RelativePath="..\src\BossAlmo1.h"> + RelativePath="..\src\BossAlmo2.h"> + RelativePath="..\src\BossBallos.h"> + RelativePath="..\src\BossFrog.h"> + RelativePath="..\src\BossIronH.h"> + RelativePath="..\src\BossLife.h"> + RelativePath="..\src\BossOhm.h"> + RelativePath="..\src\BossPress.h"> + RelativePath="..\src\BossTwinD.h"> + RelativePath="..\src\BossX.h"> + RelativePath="..\src\BulHit.h"> + RelativePath="..\src\Bullet.h"> + RelativePath="..\src\Caret.h"> + RelativePath="..\src\CommonDefines.h"> + RelativePath="..\src\Config.h"> + RelativePath="..\src\Dialog.h"> + RelativePath="..\src\Draw.h"> + RelativePath="..\src\Ending.h"> + RelativePath="..\src\Escape.h"> + RelativePath="..\src\Fade.h"> + RelativePath="..\src\Flags.h"> + RelativePath="..\src\Flash.h"> + RelativePath="..\src\Frame.h"> + RelativePath="..\src\Game.h"> + RelativePath="..\src\Generic.h"> + RelativePath="..\src\GenericLoad.h"> + RelativePath="..\src\Input.h"> + RelativePath="..\src\KeyControl.h"> + RelativePath="..\src\Main.h"> + RelativePath="..\src\Map.h"> + RelativePath="..\src\MapName.h"> + RelativePath="..\src\MiniMap.h"> + RelativePath="..\src\MyChar.h"> + RelativePath="..\src\MycHit.h"> + RelativePath="..\src\MycParam.h"> + RelativePath="..\src\NpcAct.h"> + RelativePath="..\src\NpChar.h"> + RelativePath="..\src\NpcHit.h"> + RelativePath="..\src\NpcTbl.h"> + RelativePath="..\src\Organya.h"> + RelativePath="..\src\PixTone.h"> + RelativePath="..\src\Profile.h"> + RelativePath="..\src\SelStage.h"> + RelativePath="..\src\Shoot.h"> + RelativePath="..\src\Sound.h"> + RelativePath="..\src\Stage.h"> + RelativePath="..\src\Star.h"> + RelativePath="..\src\Tags.h"> + RelativePath="..\src\TextScr.h"> + RelativePath="..\src\Triangle.h"> + RelativePath="..\src\Types.h"> + RelativePath="..\src\ValueView.h"> + RelativePath="..\src\WindowsWrapper.h"> + RelativePath=".\..\assets\resources\afxres.h"> + RelativePath="..\assets\resources\CSE2.rc"> + RelativePath="..\assets\resources\resource1.h"> + RelativePath="..\assets\resources\Bitmap\Credit01.bmp"> + RelativePath="..\assets\resources\Bitmap\Credit02.bmp"> + RelativePath="..\assets\resources\Bitmap\Credit03.bmp"> + RelativePath="..\assets\resources\Bitmap\Credit04.bmp"> + RelativePath="..\assets\resources\Bitmap\Credit05.bmp"> + RelativePath="..\assets\resources\Bitmap\Credit06.bmp"> + RelativePath="..\assets\resources\Bitmap\Credit07.bmp"> + RelativePath="..\assets\resources\Bitmap\Credit08.bmp"> + RelativePath="..\assets\resources\Bitmap\Credit09.bmp"> + RelativePath="..\assets\resources\Bitmap\Credit10.bmp"> + RelativePath="..\assets\resources\Bitmap\Credit11.bmp"> + RelativePath="..\assets\resources\Bitmap\Credit12.bmp"> + RelativePath="..\assets\resources\Bitmap\Credit14.bmp"> + RelativePath="..\assets\resources\Bitmap\Credit15.bmp"> + RelativePath="..\assets\resources\Bitmap\Credit16.bmp"> + RelativePath="..\assets\resources\Bitmap\Credit17.bmp"> + RelativePath="..\assets\resources\Bitmap\Credit18.bmp"> + RelativePath="..\assets\resources\Bitmap\pixel.bmp"> + RelativePath=".\..\assets\resources\Cursor\CURSOR_IKA.cur"> + RelativePath=".\..\assets\resources\Cursor\CURSOR_NORMAL.cur"> + RelativePath=".\..\assets\resources\Icon\0.ico"> + RelativePath=".\..\assets\resources\Icon\ICON_MINI.ico"> + RelativePath="..\assets\resources\Org\Access.org"> + RelativePath="..\assets\resources\Org\Anzen.org"> + RelativePath="..\assets\resources\Org\Balcony.org"> + RelativePath="..\assets\resources\Org\Ballos.org"> + RelativePath="..\assets\resources\Org\BreakDown.org"> + RelativePath="..\assets\resources\Org\Cemetery.org"> + RelativePath="..\assets\resources\Org\Curly.org"> + RelativePath="..\assets\resources\Org\Dr.org"> + RelativePath="..\assets\resources\Org\Ending.org"> + RelativePath="..\assets\resources\Org\Escape.org"> + RelativePath="..\assets\resources\Org\Fanfale1.org"> + RelativePath="..\assets\resources\Org\Fanfale2.org"> + RelativePath="..\assets\resources\Org\Fanfale3.org"> + RelativePath="..\assets\resources\Org\FireEye.org"> + RelativePath="..\assets\resources\Org\Gameover.org"> + RelativePath="..\assets\resources\Org\Ginsuke.org"> + RelativePath="..\assets\resources\Org\Grand.org"> + RelativePath="..\assets\resources\Org\Gravity.org"> + RelativePath="..\assets\resources\Org\Hell.org"> + RelativePath="..\assets\resources\Org\ironH.org"> + RelativePath="..\assets\resources\Org\Jenka.org"> + RelativePath="..\assets\resources\Org\Jenka2.org"> + RelativePath="..\assets\resources\Org\Kodou.org"> + RelativePath="..\assets\resources\Org\LastBtl.org"> + RelativePath="..\assets\resources\Org\LastBtl3.org"> + RelativePath="..\assets\resources\Org\LastCave.org"> + RelativePath="..\assets\resources\Org\Marine.org"> + RelativePath="..\assets\resources\Org\Maze.org"> + RelativePath="..\assets\resources\Org\MDown2.org"> + RelativePath="..\assets\resources\Org\Mura.org"> + RelativePath="..\assets\resources\Org\Oside.org"> + RelativePath="..\assets\resources\Org\Plant.org"> + RelativePath="..\assets\resources\Org\quiet.org"> + RelativePath="..\assets\resources\Org\Requiem.org"> + RelativePath="..\assets\resources\Org\Toroko.org"> + RelativePath="..\assets\resources\Org\Vivi.org"> + RelativePath="..\assets\resources\Org\Wanpak2.org"> + RelativePath="..\assets\resources\Org\Wanpaku.org"> + RelativePath="..\assets\resources\Wave\Wave.dat"> + RelativePath="..\assets\resources\Org\Weed.org"> + RelativePath="..\assets\resources\Org\White.org"> + RelativePath="..\assets\resources\Org\XXXX.org"> + RelativePath="..\assets\resources\Org\Zonbie.org"> From 9ca503a96e401d34ff41693aaf15ec5522e9f554 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Tue, 10 Sep 2019 00:43:23 +0100 Subject: [PATCH 4/8] Add Visual Studio 2017 project files This required hacking-in DirectInput8 support since Visual Studio hasn't supported DirectInput7 and earlier since 2007. --- .gitignore | 8 + README.md | 4 + src/Input.cpp | 8 + vs2017/CSE2.sln | 30 ++ vs2017/CSE2.vcxproj | 380 ++++++++++++++++++++++ vs2017/CSE2.vcxproj.filters | 624 ++++++++++++++++++++++++++++++++++++ 6 files changed, 1054 insertions(+) create mode 100644 vs2017/CSE2.sln create mode 100644 vs2017/CSE2.vcxproj create mode 100644 vs2017/CSE2.vcxproj.filters diff --git a/.gitignore b/.gitignore index 24a6882d..da71e968 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,11 @@ vs2003/Debug vs2003/Release vs2003/Debug (Japanese) vs2003/Release (Japanese) + +# Exclude Visual Studio 2017 files +vs2017/Debug +vs2017/Release +vs2017/Debug (Japanese) +vs2017/Release (Japanese) +vs2017/x64 +vs2017/.vs diff --git a/README.md b/README.md index d4a0735a..0deadb9f 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,10 @@ Of course, project files for Visual Studio .NET 2003 are available, and can be f Visual Studio .NET 2003 was used by Pixel to create the original `Doukutsu.exe`, so these project files allow us to check the accuracy of the decompilation by comparing the generated assembly code to that of the original executable. The tool for this can be found in the 'devilution' folder. +### Visual Studio 2017 (and later) + +Project files for Visual Studio 2017 can be found in the 'vs2017' folder. + ### Makefile (MinGW-w64) Run 'make' in this folder, preferably with some of the following settings: diff --git a/src/Input.cpp b/src/Input.cpp index c229c58b..bcbff426 100644 --- a/src/Input.cpp +++ b/src/Input.cpp @@ -4,7 +4,11 @@ #include #include +#if defined(_MSC_VER) && _MSC_VER >= 1500 // Newer versions of Visual Studio don't support anything earlier than DirectInput8 +#define DIRECTINPUT_VERSION 0x800 +#else #define DIRECTINPUT_VERSION 0x500 +#endif #include #include "WindowsWrapper.h" @@ -58,7 +62,11 @@ BOOL __stdcall EnumDevices_Callback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef); BOOL InitDirectInput(HINSTANCE hinst, HWND hWnd) { +#if defined(_MSC_VER) && _MSC_VER >= 1500 + if (DirectInput8Create(hinst, DIRECTINPUT_VERSION, IID_IDirectInput8A, (LPVOID*)&lpDI, NULL) != DI_OK) +#else if (DirectInputCreateA(hinst, DIRECTINPUT_VERSION, &lpDI, NULL) != DI_OK) +#endif return FALSE; if (!HookAllDirectInputDevices(hWnd)) diff --git a/vs2017/CSE2.sln b/vs2017/CSE2.sln new file mode 100644 index 00000000..c9903498 --- /dev/null +++ b/vs2017/CSE2.sln @@ -0,0 +1,30 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.779 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cave Story Engine 2", "CSE2.vcxproj", "{6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug (Japanese)|x86 = Debug (Japanese)|x86 + Debug|x86 = Debug|x86 + Release (Japanese)|x86 = Release (Japanese)|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Debug (Japanese)|x86.ActiveCfg = Debug (Japanese)|Win32 + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Debug (Japanese)|x86.Build.0 = Debug (Japanese)|Win32 + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Debug|x86.ActiveCfg = Debug|Win32 + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Debug|x86.Build.0 = Debug|Win32 + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Release (Japanese)|x86.ActiveCfg = Release (Japanese)|Win32 + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Release (Japanese)|x86.Build.0 = Release (Japanese)|Win32 + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Release|x86.ActiveCfg = Release|Win32 + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5B768CDF-DE61-4270-8E55-EE32983245CD} + EndGlobalSection +EndGlobal diff --git a/vs2017/CSE2.vcxproj b/vs2017/CSE2.vcxproj new file mode 100644 index 00000000..17f5b6b0 --- /dev/null +++ b/vs2017/CSE2.vcxproj @@ -0,0 +1,380 @@ + + + + + Debug (Japanese) + Win32 + + + Debug + Win32 + + + Release (Japanese) + Win32 + + + Release + Win32 + + + + Cave Story Engine 2 + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4} + CSE2 + ManagedCProj + + + + Application + v141 + MultiByte + false + + + Application + v141 + MultiByte + false + + + Application + v141 + MultiByte + false + + + Application + v141 + MultiByte + false + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>15.0.28307.799 + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + + + + Disabled + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebug + + Level3 + ProgramDatabase + + + ddraw.lib;dinput8.lib;dsound.lib;Version.lib;ShLwApi.Lib;Imm32.lib;WinMM.lib;dxguid.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).exe + LIBC;%(IgnoreSpecificDefaultLibraries) + true + true + Windows + + + + + Disabled + WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions) + true + MultiThreaded + + Level3 + ProgramDatabase + + + ddraw.lib;dinput8.lib;dsound.lib;Version.lib;ShLwApi.Lib;Imm32.lib;WinMM.lib;dxguid.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).exe + false + LIBC;%(IgnoreSpecificDefaultLibraries) + true + Windows + + + + + Disabled + WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;JAPANESE;%(PreprocessorDefinitions) + true + MultiThreaded + + Level3 + ProgramDatabase + + + ddraw.lib;dinput8.lib;dsound.lib;Version.lib;ShLwApi.Lib;Imm32.lib;WinMM.lib;dxguid.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).exe + false + LIBC;%(IgnoreSpecificDefaultLibraries) + true + Windows + + + + + Disabled + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;JAPANESE;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebug + + Level3 + ProgramDatabase + + + ddraw.lib;dinput8.lib;dsound.lib;Version.lib;ShLwApi.Lib;Imm32.lib;WinMM.lib;dxguid.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).exe + LIBC;%(IgnoreSpecificDefaultLibraries) + true + true + Windows + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0x0411 + 0x0411 + 0x0411 + 0x0411 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vs2017/CSE2.vcxproj.filters b/vs2017/CSE2.vcxproj.filters new file mode 100644 index 00000000..cf3a56ba --- /dev/null +++ b/vs2017/CSE2.vcxproj.filters @@ -0,0 +1,624 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {e3ddc3b2-53c8-437b-9bbd-2cf890dce515} + + + {e59cab1f-6e61-4e3c-9b62-66e2139ee067} + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx + + + {d3050ffa-0164-47af-ad15-595b6259cebc} + + + {4f28c353-f3e2-4895-8941-90ade1525853} + + + {32f06e34-3c82-435a-9c83-468da6521995} + + + {5caa2b1b-5219-4227-822a-56f2cf394a12} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\NPC + + + Source Files\Boss + + + Source Files\Boss + + + Source Files\Boss + + + Source Files\Boss + + + Source Files\Boss + + + Source Files\Boss + + + Source Files\Boss + + + Source Files\Boss + + + Source Files\Boss + + + Source Files\Boss + + + Source Files\Boss + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Resource Files + + + Resource Files + + + + + Resource Files + + + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Bitmap + + + Resource Files\Icon + + + Resource Files\Icon + + + + + Resource Files\Cursor + + + Resource Files\Cursor + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + Resource Files\Organya + + + \ No newline at end of file From 385d7e58440da91834ba886a9d7ba68194442d09 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Tue, 10 Sep 2019 01:04:09 +0100 Subject: [PATCH 5/8] Clean up Back.cpp a little --- src/Back.cpp | 58 ++-------------------------------------------------- 1 file changed, 2 insertions(+), 56 deletions(-) diff --git a/src/Back.cpp b/src/Back.cpp index 5fd0e760..017afcd4 100644 --- a/src/Back.cpp +++ b/src/Back.cpp @@ -160,9 +160,6 @@ void PutBack(int fx, int fy) PutBitmap4(&grcGame, 320 - 4 * gBack.fx % 320, 176, &rect, SURFACE_ID_LEVEL_BACKGROUND); break; - - default: - return; } } @@ -183,7 +180,7 @@ void PutFront(int fx, int fy) { case 3: x_1 = fx / 0x4000; - x_2 = x_1 + (((WINDOW_WIDTH + 31) >> 5) + 1); + x_2 = x_1 + (((WINDOW_WIDTH + (32 - 1)) / 32) + 1); y_1 = 0; y_2 = y_1 + 32; @@ -201,61 +198,10 @@ void PutFront(int fx, int fy) { xpos = (x * 0x20 * 0x200) / 0x200 - fx / 0x200; PutBitmap3(&grcGame, xpos, ypos, &rcWater[1], SURFACE_ID_LEVEL_BACKGROUND); - if (!y) + if (y == 0) PutBitmap3(&grcGame, xpos, ypos, &rcWater[0], SURFACE_ID_LEVEL_BACKGROUND); } } } -/* - // Draw black bars - if (!(g_GameFlags & 8)) // Detect if credits are running - { - const BOOL fromFocus = (gStageNo == 31); // Get if we should only draw around a 320x240 area of the focus point - - // Get focus rect - int focusX = gFrame.x + (WINDOW_WIDTH << 8) - (320 << 8); - int focusY = gFrame.y + (WINDOW_HEIGHT << 8) - (240 << 8); - int focusR = focusX + (320 << 9); - int focusB = focusY + (240 << 9); - - // Get borders - const int barLeft = fromFocus ? focusX : -0x1000; - const int barTop = fromFocus ? focusY : -0x1000; - - const int barRight = fromFocus ? focusR : (gMap.width << 13) - 0x1000; - const int barBottom = fromFocus ? focusB : (gMap.length << 13) - 0x1000; - - // Draw bars - RECT barRect; - - // Left - barRect.left = 0; - barRect.top = 0; - barRect.right = (barLeft - gFrame.x) >> 9; - barRect.bottom = WINDOW_HEIGHT; - CortBox(&barRect, 0x000000); - - // Top - barRect.left = 0; - barRect.top = 0; - barRect.right = WINDOW_WIDTH; - barRect.bottom = (barTop - gFrame.y) >> 9; - CortBox(&barRect, 0x000000); - - // Right - barRect.left = (barRight - gFrame.x) >> 9; - barRect.top = 0; - barRect.right = WINDOW_WIDTH; - barRect.bottom = WINDOW_HEIGHT; - CortBox(&barRect, 0x000000); - - // Bottom - barRect.left = 0; - barRect.top = (barBottom - gFrame.y) >> 9; - barRect.right = WINDOW_WIDTH; - barRect.bottom = WINDOW_HEIGHT; - CortBox(&barRect, 0x000000); - } - */ } From 271f86e009deb1e4a84bc49f8e05417d41efd992 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Tue, 10 Sep 2019 01:25:47 +0100 Subject: [PATCH 6/8] Add 64-bit targets to VS2017 project --- vs2017/CSE2.sln | 12 ++++ vs2017/CSE2.vcxproj | 146 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+) diff --git a/vs2017/CSE2.sln b/vs2017/CSE2.sln index c9903498..d1b2619d 100644 --- a/vs2017/CSE2.sln +++ b/vs2017/CSE2.sln @@ -6,18 +6,30 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cave Story Engine 2", "CSE2 EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug (Japanese)|x64 = Debug (Japanese)|x64 Debug (Japanese)|x86 = Debug (Japanese)|x86 + Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 + Release (Japanese)|x64 = Release (Japanese)|x64 Release (Japanese)|x86 = Release (Japanese)|x86 + Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Debug (Japanese)|x64.ActiveCfg = Debug (Japanese)|x64 + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Debug (Japanese)|x64.Build.0 = Debug (Japanese)|x64 {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Debug (Japanese)|x86.ActiveCfg = Debug (Japanese)|Win32 {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Debug (Japanese)|x86.Build.0 = Debug (Japanese)|Win32 + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Debug|x64.ActiveCfg = Debug|x64 + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Debug|x64.Build.0 = Debug|x64 {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Debug|x86.ActiveCfg = Debug|Win32 {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Debug|x86.Build.0 = Debug|Win32 + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Release (Japanese)|x64.ActiveCfg = Release (Japanese)|x64 + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Release (Japanese)|x64.Build.0 = Release (Japanese)|x64 {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Release (Japanese)|x86.ActiveCfg = Release (Japanese)|Win32 {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Release (Japanese)|x86.Build.0 = Release (Japanese)|Win32 + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Release|x64.ActiveCfg = Release|x64 + {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Release|x64.Build.0 = Release|x64 {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Release|x86.ActiveCfg = Release|Win32 {6B8CC57F-5656-4C4B-8FCB-B0C326FCB4D4}.Release|x86.Build.0 = Release|Win32 EndGlobalSection diff --git a/vs2017/CSE2.vcxproj b/vs2017/CSE2.vcxproj index 17f5b6b0..5a665443 100644 --- a/vs2017/CSE2.vcxproj +++ b/vs2017/CSE2.vcxproj @@ -5,18 +5,34 @@ Debug (Japanese) Win32 + + Debug (Japanese) + x64 + Debug Win32 + + Debug + x64 + Release (Japanese) Win32 + + Release (Japanese) + x64 + Release Win32 + + Release + x64 + Cave Story Engine 2 @@ -31,39 +47,75 @@ MultiByte false + + Application + v141 + MultiByte + false + Application v141 MultiByte false + + Application + v141 + MultiByte + false + Application v141 MultiByte false + + Application + v141 + MultiByte + false + Application v141 MultiByte false + + Application + v141 + MultiByte + false + + + + + + + + + + + + + <_ProjectFileVersion>15.0.28307.799 @@ -73,21 +125,33 @@ $(Configuration)\ true + + true + $(SolutionDir)$(Configuration)\ $(Configuration)\ false + + false + $(SolutionDir)$(Configuration)\ $(Configuration)\ false + + false + $(SolutionDir)$(Configuration)\ $(Configuration)\ true + + true + Disabled @@ -108,6 +172,26 @@ Windows + + + Disabled + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions) + Default + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ddraw.lib;dinput8.lib;dsound.lib;Version.lib;ShLwApi.Lib;Imm32.lib;WinMM.lib;dxguid.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).exe + LIBC;%(IgnoreSpecificDefaultLibraries) + true + true + Windows + + Disabled @@ -127,6 +211,25 @@ Windows + + + Disabled + WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + ddraw.lib;dinput8.lib;dsound.lib;Version.lib;ShLwApi.Lib;Imm32.lib;WinMM.lib;dxguid.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).exe + false + LIBC;%(IgnoreSpecificDefaultLibraries) + true + Windows + + Disabled @@ -146,6 +249,25 @@ Windows + + + Disabled + WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;JAPANESE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + ddraw.lib;dinput8.lib;dsound.lib;Version.lib;ShLwApi.Lib;Imm32.lib;WinMM.lib;dxguid.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).exe + false + LIBC;%(IgnoreSpecificDefaultLibraries) + true + Windows + + Disabled @@ -166,6 +288,26 @@ Windows + + + Disabled + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;JAPANESE;%(PreprocessorDefinitions) + Default + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ddraw.lib;dinput8.lib;dsound.lib;Version.lib;ShLwApi.Lib;Imm32.lib;WinMM.lib;dxguid.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).exe + LIBC;%(IgnoreSpecificDefaultLibraries) + true + true + Windows + + @@ -300,9 +442,13 @@ 0x0411 + 0x0411 0x0411 + 0x0411 0x0411 + 0x0411 0x0411 + 0x0411 From 751daaf42f11452d47f4ad4477a04e9ac803c8a8 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Tue, 10 Sep 2019 01:27:12 +0100 Subject: [PATCH 7/8] Ignore another VS2017 file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index da71e968..9593c03e 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ vs2017/Debug (Japanese) vs2017/Release (Japanese) vs2017/x64 vs2017/.vs +vs2017/CSE2.vcxproj.user From 2cb7bfbd3d32106a2c6aaa60b226591b38f0c72f Mon Sep 17 00:00:00 2001 From: Clownacy Date: Tue, 10 Sep 2019 01:59:26 +0000 Subject: [PATCH 8/8] Tiny cleanup --- src/Back.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Back.cpp b/src/Back.cpp index 017afcd4..de71fc60 100644 --- a/src/Back.cpp +++ b/src/Back.cpp @@ -186,7 +186,7 @@ void PutFront(int fx, int fy) for (y = y_1; y < y_2; y++) { - ypos = (y * 0x20 * 0x200) / 0x200 - fy / 0x200 + gWaterY / 0x200; + ypos = (y * 32 * 0x200) / 0x200 - fy / 0x200 + gWaterY / 0x200; if (ypos < -32) continue; @@ -196,7 +196,7 @@ void PutFront(int fx, int fy) for (x = x_1; x < x_2; x++) { - xpos = (x * 0x20 * 0x200) / 0x200 - fx / 0x200; + xpos = (x * 32 * 0x200) / 0x200 - fx / 0x200; PutBitmap3(&grcGame, xpos, ypos, &rcWater[1], SURFACE_ID_LEVEL_BACKGROUND); if (y == 0) PutBitmap3(&grcGame, xpos, ypos, &rcWater[0], SURFACE_ID_LEVEL_BACKGROUND);