| 107 | }; |
| 108 | |
| 109 | void cFodder::CopyProtection() { |
| 110 | |
| 111 | // Only DOS CD had copy protection |
| 112 | if (!mVersionCurrent->isCannonFodder1()) |
| 113 | return; |
| 114 | |
| 115 | if (!mVersionCurrent->isRetail()) |
| 116 | return; |
| 117 | |
| 118 | if (!mVersionCurrent->isPC()) |
| 119 | return; |
| 120 | |
| 121 | if (!mParams->mCopyProtection) |
| 122 | return; |
| 123 | |
| 124 | mGraphics->SetActiveSpriteSheet(eGFX_Types::eGFX_RECRUIT); |
| 125 | |
| 126 | // 3 Attempts |
| 127 | for (int16 Attempts = 0; Attempts < 3; ++Attempts) { |
| 128 | |
| 129 | int16 Data0; |
| 130 | do { |
| 131 | Data0 = tool_RandomGet() & 0x0F; |
| 132 | } while (Data0 == 0x0F); |
| 133 | |
| 134 | mSurface->clearBuffer(); |
| 135 | mGraphics->PaletteSet(); |
| 136 | |
| 137 | const sCopyProtection* word_44A1C = &mCopyProtection_Values[Data0]; |
| 138 | |
| 139 | std::string Page = "PAGE " + std::to_string(word_44A1C->mPage); |
| 140 | std::string Paragraph = "PARAGRAPH " + std::to_string(word_44A1C->mParagraph); |
| 141 | std::string Line = "LINE " + std::to_string(word_44A1C->mLine); |
| 142 | std::string Word = "WORD " + std::to_string(word_44A1C->mWord); |
| 143 | |
| 144 | GUI_Render_Text_Centred("ENTER WORD FROM", 0); |
| 145 | GUI_Render_Text_Centred("MANUAL AT", 0x14); |
| 146 | GUI_Render_Text_Centred(Page.c_str(), 0x3C); |
| 147 | GUI_Render_Text_Centred(Paragraph.c_str(), 0x50); |
| 148 | GUI_Render_Text_Centred(Line.c_str(), 0x64); |
| 149 | GUI_Render_Text_Centred(Word.c_str(), 0x78); |
| 150 | |
| 151 | int8 mCursorBlinkTimer = 0; |
| 152 | bool mShow = false; |
| 153 | |
| 154 | mGUI_Temp_X = 5; |
| 155 | mGUI_Temp_Width = 10; |
| 156 | mInput.clear(); |
| 157 | |
| 158 | mSurface->Save(); |
| 159 | mKeyCodeAscii = 0; |
| 160 | |
| 161 | while (mKeyCodeAscii != 0x0D) { |
| 162 | |
| 163 | if (mSurface->isPaletteAdjusting()) |
| 164 | mSurface->palette_FadeTowardNew(); |
| 165 | |
| 166 | String_Input_Print(0xA0); |
nothing calls this directly
no test coverage detected