diff --git a/src/ArmsItem.h b/src/ArmsItem.h index 9656a681..f21144e1 100644 --- a/src/ArmsItem.h +++ b/src/ArmsItem.h @@ -4,7 +4,7 @@ // Limits for the amount of weapons and items #define ARMS_MAX 8 -#define ITEM_MAX 0x20 +#define ITEM_MAX 32 // "Arms" is a synonym of "weapon" here // "Code" means "ID" here diff --git a/src/Game.cpp b/src/Game.cpp index 7cab4319..b2564e86 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -689,12 +689,11 @@ BOOL Game(void) if (!LoadGenericData()) { -#ifdef JAPANESE - Backend_ShowMessageBox("エラー", "汎用ファイルが読めない"); -#else + #if !defined(JAPANESE) && defined(FIX_BUGS) // The Aeon Genesis translation didn't translate this Backend_ShowMessageBox("Error", "Couldn't read general purpose files"); -#endif - + #else + Backend_ShowMessageBox("エラー", "汎用ファイルが読めない"); + #endif return FALSE; } @@ -704,12 +703,11 @@ BOOL Game(void) if (!LoadNpcTable(path.c_str())) { -#ifdef JAPANESE - Backend_ShowMessageBox("エラー", "NPCテーブルが読めない"); -#else + #if !defined(JAPANESE) && defined(FIX_BUGS) // The Aeon Genesis translation didn't translate this Backend_ShowMessageBox("Error", "Couldn't read the NPC table"); -#endif - + #else + Backend_ShowMessageBox("エラー", "NPCテーブルが読めない"); + #endif return FALSE; } diff --git a/src/Input.h b/src/Input.h index c8147808..e23b0c7a 100644 --- a/src/Input.h +++ b/src/Input.h @@ -8,7 +8,7 @@ struct DIRECTINPUTSTATUS BOOL bRight; BOOL bUp; BOOL bDown; - BOOL bButton[32]; // The original `Input.cpp` assumed there were 32 buttons (because of DirectInput's `DIJOYSTATE` struct) + BOOL bButton[32]; // 32 is the number of buttons in DirectInput's `DIJOYSTATE` struct }; void ReleaseDirectInput(void); diff --git a/src/Profile.cpp b/src/Profile.cpp index 52aaa35d..0def9a58 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -246,12 +246,11 @@ BOOL InitializeGame(void) InitFlags(); if (!TransferStage(13, 200, 10, 8)) { -#ifdef JAPANESE - Backend_ShowMessageBox("エラー", "ステージの読み込みに失敗"); -#else + #if !defined(JAPANESE) && defined(FIX_BUGS) // The Aeon Genesis translation didn't translate this Backend_ShowMessageBox("Error", "Failed to load stage"); -#endif - + #else + Backend_ShowMessageBox("エラー", "ステージの読み込みに失敗"); + #endif return FALSE; } diff --git a/src/SelStage.cpp b/src/SelStage.cpp index be792e56..43fabd3a 100644 --- a/src/SelStage.cpp +++ b/src/SelStage.cpp @@ -13,7 +13,7 @@ #include "Sound.h" #include "TextScr.h" -PERMIT_STAGE gPermitStage[8]; +PERMIT_STAGE gPermitStage[STAGE_MAX]; int gSelectedStage; int gStageSelectTitleY; @@ -27,7 +27,7 @@ BOOL AddPermitStage(int index, int event) { int i = 0; - while (i < 8) + while (i < STAGE_MAX) { if (gPermitStage[i].index == index) break; @@ -38,7 +38,7 @@ BOOL AddPermitStage(int index, int event) ++i; } - if (i == 8) + if (i == STAGE_MAX) return FALSE; gPermitStage[i].index = index; @@ -51,18 +51,18 @@ BOOL SubPermitStage(int index) { int i; - for (i = 0; i < 8; ++i) + for (i = 0; i < STAGE_MAX; ++i) if (gPermitStage[i].index == index) break; #ifdef FIX_BUGS - if (i == 8) + if (i == STAGE_MAX) #else - if (i == 32) + if (i == 32) // Same value as 'ITEM_MAX' #endif return FALSE; - for (++i; i < 8; ++i) + for (++i; i < STAGE_MAX; ++i) gPermitStage[i - 1] = gPermitStage[i]; gPermitStage[i - 1].index = 0; @@ -140,11 +140,14 @@ void PutStageSelectObject(void) PutBitmap3(&rcView, stage_x + (gSelectedStage * 40), (WINDOW_HEIGHT / 2) - 56, &rcCur[flash / 2 % 2], SURFACE_ID_TEXT_BOX); - for (i = 0; i < 8; ++i) + for (i = 0; i < STAGE_MAX; ++i) { if (gPermitStage[i].index == 0) break; + // Interestingly, there's code for reading multiple rows of icons + // from the 'StageImage.pbm' file when there are more than 8 stages, + // despite only 6 icons ever being used. rcStage.left = (gPermitStage[i].index % 8) * 32; rcStage.right = rcStage.left + 32; rcStage.top = (gPermitStage[i].index / 8) * 16; diff --git a/src/SelStage.h b/src/SelStage.h index f06dc427..ee684438 100644 --- a/src/SelStage.h +++ b/src/SelStage.h @@ -2,13 +2,15 @@ #include "WindowsWrapper.h" +#define STAGE_MAX 8 // Note that Cave Story only has 5 stages + typedef struct PERMIT_STAGE { int index; int event; } PERMIT_STAGE; -extern PERMIT_STAGE gPermitStage[8]; +extern PERMIT_STAGE gPermitStage[STAGE_MAX]; extern int gSelectedStage; extern int gStageSelectTitleY; diff --git a/src/TextScr.cpp b/src/TextScr.cpp index 06339a01..7a642a93 100644 --- a/src/TextScr.cpp +++ b/src/TextScr.cpp @@ -741,12 +741,11 @@ int TextScriptProc(void) if (!TransferStage(z, w, x, y)) { - #ifdef JAPANESE - Backend_ShowMessageBox("エラー", "ステージの読み込みに失敗"); - #else + #if !defined(JAPANESE) && defined(FIX_BUGS) // The Aeon Genesis translation didn't translate this Backend_ShowMessageBox("Error", "Failed to load stage"); - #endif - + #else + Backend_ShowMessageBox("エラー", "ステージの読み込みに失敗"); + #endif return enum_ESCRETURN_exit; } } @@ -1323,14 +1322,13 @@ int TextScriptProc(void) else { char str_0[0x40]; - #ifdef JAPANESE - sprintf(str_0, "不明のコード:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]); - Backend_ShowMessageBox("エラー", str_0); - #else + #if !defined(JAPANESE) && defined(FIX_BUGS) // The Aeon Genesis translation didn't translate this sprintf(str_0, "Unknown code:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]); Backend_ShowMessageBox("Error", str_0); - #endif - + #else + sprintf(str_0, "不明のコード:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]); + Backend_ShowMessageBox("エラー", str_0); + #endif return enum_ESCRETURN_exit; } }