[Scummvm-git-logs] scummvm master -> 7e7b236a12d1170b2d8b8bfa7845e8dd1a219343

bluegr noreply at scummvm.org
Tue Apr 29 16:21:35 UTC 2025


This automated email contains information about 6 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
2d3c8792a7 EFH: Rename an input related variable
ed4b977a10 EFH: Remove unimplemented functions. Some cleanup
7d9706c4eb EFH: More work on the keymapper
3466b09280 EFH: Remove more unimplemented functions
8398b7f307 EFH: Get rid of _shouldQuit
7e7b236a12 EFH: Remove getKeyCode()


Commit: 2d3c8792a7c40add2f38fc523b3b4ea1e8e63318
    https://github.com/scummvm/scummvm/commit/2d3c8792a7c40add2f38fc523b3b4ea1e8e63318
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2025-04-29T19:20:59+03:00

Commit Message:
EFH: Rename an input related variable

Changed paths:
    engines/efh/menu.cpp


diff --git a/engines/efh/menu.cpp b/engines/efh/menu.cpp
index 2326ddfbe76..3b8b38c1af0 100644
--- a/engines/efh/menu.cpp
+++ b/engines/efh/menu.cpp
@@ -533,45 +533,45 @@ int16 EfhEngine::handleStatusMenu(int16 gameMode, int16 charId) {
 			windowId = kEfhMenuEquip;
 
 		do {
-			Common::KeyCode var19 = handleAndMapInput(false);
+			Common::KeyCode input = handleAndMapInput(false);
 			if (_menuDepth == 0) {
-				switch (var19) {
+				switch (input) {
 				case Common::KEYCODE_a:
 					windowId = kEfhMenuActive;
-					var19 = Common::KEYCODE_RETURN;
+					input = Common::KEYCODE_RETURN;
 					break;
 				case Common::KEYCODE_d:
 					windowId = kEfhMenuDrop;
-					var19 = Common::KEYCODE_RETURN;
+					input = Common::KEYCODE_RETURN;
 					break;
 				case Common::KEYCODE_e:
 					windowId = kEfhMenuEquip;
-					var19 = Common::KEYCODE_RETURN;
+					input = Common::KEYCODE_RETURN;
 					break;
 				case Common::KEYCODE_g:
 					windowId = kEfhMenuGive;
-					var19 = Common::KEYCODE_RETURN;
+					input = Common::KEYCODE_RETURN;
 					break;
 				case Common::KEYCODE_i:
 					windowId = kEfhMenuInfo;
-					var19 = Common::KEYCODE_RETURN;
+					input = Common::KEYCODE_RETURN;
 					break;
 				case Common::KEYCODE_ESCAPE:
 				case Common::KEYCODE_l:
 					windowId = kEfhMenuLeave;
-					var19 = Common::KEYCODE_RETURN;
+					input = Common::KEYCODE_RETURN;
 					break;
 				case Common::KEYCODE_p:
 					windowId = kEfhMenuPassive;
-					var19 = Common::KEYCODE_RETURN;
+					input = Common::KEYCODE_RETURN;
 					break;
 				case Common::KEYCODE_t:
 					windowId = kEfhMenuTrade;
-					var19 = Common::KEYCODE_RETURN;
+					input = Common::KEYCODE_RETURN;
 					break;
 				case Common::KEYCODE_u:
 					windowId = kEfhMenuUse;
-					var19 = Common::KEYCODE_RETURN;
+					input = Common::KEYCODE_RETURN;
 					break;
 				default:
 					debugC(9, kDebugEngine, "handleStatusMenu - unhandled keys");
@@ -579,16 +579,16 @@ int16 EfhEngine::handleStatusMenu(int16 gameMode, int16 charId) {
 				}
 			} else if (_menuDepth == 1) {
 				// in the sub-menus, only a list of selectable items is displayed
-				if (var19 >= Common::KEYCODE_a && var19 <= Common::KEYCODE_z) {
-					int16 var8 = var19 - Common::KEYCODE_a;
+				if (input >= Common::KEYCODE_a && input <= Common::KEYCODE_z) {
+					int16 var8 = input - Common::KEYCODE_a;
 					if (var8 < _menuItemCounter) {
 						curMenuLine = var8;
-						var19 = Common::KEYCODE_RETURN;
+						input = Common::KEYCODE_RETURN;
 					}
 				}
 			}
 
-			switch (var19) {
+			switch (input) {
 			case Common::KEYCODE_RETURN:
 				// case 0xFA: Joystick button 1
 				if (_menuDepth == 0) {


Commit: ed4b977a10056a986be120bf4f0dc886edde22c8
    https://github.com/scummvm/scummvm/commit/ed4b977a10056a986be120bf4f0dc886edde22c8
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2025-04-29T19:21:00+03:00

Commit Message:
EFH: Remove unimplemented functions. Some cleanup

- Remove the unimplemented functions loadMapArrays(), mapInputCode()
  and setNumLock()
- Move the setting of _imageSetSubFilesIdx into each direction function
- Merge getnputBlocking() and waitForKey(), as they're basically the
  same function
- Remove useless code

Changed paths:
    engines/efh/efh.cpp
    engines/efh/efh.h
    engines/efh/fight.cpp
    engines/efh/files.cpp
    engines/efh/menu.cpp
    engines/efh/utils.cpp


diff --git a/engines/efh/efh.cpp b/engines/efh/efh.cpp
index faf142a5ba8..ef94817b9ea 100644
--- a/engines/efh/efh.cpp
+++ b/engines/efh/efh.cpp
@@ -113,42 +113,34 @@ Common::Error EfhEngine::run() {
 		case Common::KEYCODE_DOWN:
 		case Common::KEYCODE_KP2:
 			goSouth();
-			_imageSetSubFilesIdx = 144;
 			break;
 		case Common::KEYCODE_UP:
 		case Common::KEYCODE_KP8:
 			goNorth();
-			_imageSetSubFilesIdx = 145;
 			break;
 		case Common::KEYCODE_RIGHT:
 		case Common::KEYCODE_KP6:
 			goEast();
-			_imageSetSubFilesIdx = 146;
 			break;
 		case Common::KEYCODE_LEFT:
 		case Common::KEYCODE_KP4:
 			goWest();
-			_imageSetSubFilesIdx = 147;
 			break;
 		case Common::KEYCODE_PAGEUP:
 		case Common::KEYCODE_KP9:
 			goNorthEast();
-			_imageSetSubFilesIdx = 146;
 			break;
 		case Common::KEYCODE_PAGEDOWN:
 		case Common::KEYCODE_KP3:
 			goSouthEast();
-			_imageSetSubFilesIdx = 146;
 			break;
 		case Common::KEYCODE_END:
 		case Common::KEYCODE_KP1:
 			goSouthWest();
-			_imageSetSubFilesIdx = 147;
 			break;
 		case Common::KEYCODE_HOME:
 		case Common::KEYCODE_KP7:
 			goNorthWest();
-			_imageSetSubFilesIdx = 147;
 			break;
 		case Common::KEYCODE_1:
 		case Common::KEYCODE_F1:
@@ -511,10 +503,6 @@ void EfhEngine::initMapMonsters() {
 	}
 }
 
-void EfhEngine::loadMapArrays(int idx) {
-	// No longer required as everything is in memory.
-}
-
 void EfhEngine::saveAnimImageSetId() {
 	debugC(6, kDebugEngine, "saveAnimImageSetId");
 
@@ -573,14 +561,6 @@ uint16 EfhEngine::getEquippedExclusiveType(int16 charId, int16 exclusiveType, bo
 void EfhEngine::drawGameScreenAndTempText(bool flag) {
 	debugC(2, kDebugEngine, "drawGameScreenAndTempText %s", flag ? "True" : "False");
 
-#if 0
-	// This code is present in the original, but looks strictly useless.
-	uint8 mapTileInfo = getMapTileInfo(_mapPosX, _mapPosY);
-	int16 imageSetId = _currentTileBankImageSetId[mapTileInfo / 72];
-
-	int16 mapImageSetId = (imageSetId * 72) + (mapTileInfo % 72);
-#endif
-
 	for (int counter = 0; counter < 2; ++counter) {
 		if (counter == 0 || flag) {
 			displayGameScreen();
@@ -1140,6 +1120,8 @@ bool EfhEngine::isPosOutOfMap(int16 mapPosX, int16 mapPosY) {
 void EfhEngine::goSouth() {
 	debugC(6,kDebugEngine, "goSouth");
 
+	_imageSetSubFilesIdx = 144;
+
 	int16 maxMapBlocks = _largeMapFlag ? 63 : 23;
 
 	if (++_mapPosY > maxMapBlocks)
@@ -1154,6 +1136,8 @@ void EfhEngine::goSouth() {
 void EfhEngine::goNorth() {
 	debugC(6,kDebugEngine, "goNorth");
 
+	_imageSetSubFilesIdx = 145;
+
 	if (--_mapPosY < 0)
 		_mapPosY = 0;
 
@@ -1166,6 +1150,8 @@ void EfhEngine::goNorth() {
 void EfhEngine::goEast() {
 	debugC(6, kDebugEngine, "goEast");
 
+	_imageSetSubFilesIdx = 146;
+
 	int16 maxMapBlocks = _largeMapFlag ? 63 : 23;
 
 	if (++_mapPosX > maxMapBlocks)
@@ -1180,6 +1166,8 @@ void EfhEngine::goEast() {
 void EfhEngine::goWest() {
 	debugC(6, kDebugEngine, "goWest");
 
+	_imageSetSubFilesIdx = 147;
+
 	if (--_mapPosX < 0)
 		_mapPosX = 0;
 
@@ -1192,6 +1180,8 @@ void EfhEngine::goWest() {
 void EfhEngine::goNorthEast() {
 	debugC(6, kDebugEngine, "goNorthEast");
 
+	_imageSetSubFilesIdx = 146;
+
 	if (--_mapPosY < 0)
 		_mapPosY = 0;
 
@@ -1212,6 +1202,8 @@ void EfhEngine::goNorthEast() {
 void EfhEngine::goSouthEast() {
 	debugC(6, kDebugEngine, "goSouthEast");
 
+	_imageSetSubFilesIdx = 146;
+
 	int16 maxMapBlocks = _largeMapFlag ? 63 : 23;
 
 	if (++_mapPosX > maxMapBlocks)
@@ -1229,6 +1221,8 @@ void EfhEngine::goSouthEast() {
 void EfhEngine::goNorthWest() {
 	debugC(6, kDebugEngine,"goNorthWest");
 
+	_imageSetSubFilesIdx = 147;
+
 	if (--_mapPosY < 0)
 		_mapPosY = 0;
 
@@ -1244,6 +1238,8 @@ void EfhEngine::goNorthWest() {
 void EfhEngine::goSouthWest() {
 	debugC(6, kDebugEngine, "goSouthWest");
 
+	_imageSetSubFilesIdx = 147;
+
 	if (--_mapPosX < 0)
 		_mapPosX = 0;
 
@@ -1319,8 +1315,6 @@ void EfhEngine::computeMapAnimation() {
 }
 
 void EfhEngine::handleAnimations() {
-	setNumLock();
-
 	if (_engineInitPending)
 		return;
 
@@ -1912,7 +1906,7 @@ bool EfhEngine::handleTalk(int16 monsterId, int16 arg2, int16 itemId) {
 						displayFctFullScreen();
 				}
 				setTextColorRed();
-				Common::KeyCode input = mapInputCode(waitForKey());
+				Common::KeyCode input = waitForKey();
 				if (input == Common::KEYCODE_y) {
 					removeCharacterFromTeam(charId);
 					displayImp1Text(_npcBuf[npcId].field14_textId);
@@ -2063,7 +2057,7 @@ void EfhEngine::displayImp1Text(int16 textId) {
 								if (counter == 0)
 									displayFctFullScreen();
 							}
-							getInputBlocking();
+							waitForKey();
 						}
 					}
 					if (nextTextId != 0xFF)
@@ -2433,7 +2427,7 @@ bool EfhEngine::checkMonsterCollision() {
 					displayFctFullScreen();
 			}
 
-			Common::KeyCode input = mapInputCode(waitForKey());
+			Common::KeyCode input = waitForKey();
 
 			switch (input) {
 			case Common::KEYCODE_a: // Attack
diff --git a/engines/efh/efh.h b/engines/efh/efh.h
index 0860617ec97..8e40c6fcbc3 100644
--- a/engines/efh/efh.h
+++ b/engines/efh/efh.h
@@ -307,7 +307,6 @@ private:
 	void playIntro();
 	void initEngine();
 	void initMapMonsters();
-	void loadMapArrays(int idx);
 	void saveAnimImageSetId();
 	int16 getEquipmentDefense(int16 charId);
 	uint16 getEquippedExclusiveType(int16 charId, int16 exclusiveType, bool flag);
@@ -519,10 +518,7 @@ private:
 	Common::KeyCode getInput(int16 delay);
 	Common::KeyCode getKeyCode(const Common::Event & event);
 	Common::KeyCode waitForKey();
-	Common::KeyCode mapInputCode(Common::KeyCode input);
 	Common::KeyCode handleAndMapInput(bool animFl);
-	Common::KeyCode getInputBlocking();
-	void setNumLock();
 	bool getValidationFromUser();
 	uint32 ROR(uint32 val, uint8 shiftVal);
 	Common::String getArticle(int pronoun);
diff --git a/engines/efh/fight.cpp b/engines/efh/fight.cpp
index 95f4650a395..e2476db2e34 100644
--- a/engines/efh/fight.cpp
+++ b/engines/efh/fight.cpp
@@ -1122,7 +1122,7 @@ bool EfhEngine::getTeamAttackRoundPlans() {
 			} break;
 			case Common::KEYCODE_t: // Terrain
 				redrawScreenForced();
-				getInputBlocking();
+				waitForKey();
 				drawCombatScreen(_teamChar[charId]._id, false, true);
 				break;
 			default:
diff --git a/engines/efh/files.cpp b/engines/efh/files.cpp
index cd85c7a5b02..9ce0f3bc03e 100644
--- a/engines/efh/files.cpp
+++ b/engines/efh/files.cpp
@@ -207,10 +207,6 @@ void EfhEngine::loadTechMapImp(int16 fileId) {
 	// The original was loading the specific tech.%d and map.%d files.
 	// This is gone in our implementation as we pre-load all the files to save them inside the savegames
 
-	// This is not present in the original.
-	// The purpose is to properly load the misc map data in arrays in order to use them without being a pain afterwards
-	loadMapArrays(_techId);
-
 	loadImageSetToTileBank(0, _mapBitmapRefArr[_techId]._setId1);
 	loadImageSetToTileBank(1, _mapBitmapRefArr[_techId]._setId2);
 
diff --git a/engines/efh/menu.cpp b/engines/efh/menu.cpp
index 3b8b38c1af0..6c8a35fd9e1 100644
--- a/engines/efh/menu.cpp
+++ b/engines/efh/menu.cpp
@@ -344,10 +344,6 @@ void EfhEngine::displayCharacterSummary(int16 curMenuLine, int16 npcId) {
 					setTextPos(286, textPosY);
 					displayStringAtTextPos("Def");
 				}
-				// useless code removed.
-				// else {
-				//	var54 = _items[_npcBuf[npcId]._inventory[_menuStatItemArr[counter]]._ref]._defense;
-				// {
 			} else if (_items[itemId]._uses != 0x7F) {
 				int16 stat1 = _npcBuf[npcId]._inventory[_menuStatItemArr[counter]].getUsesLeft();
 				if (stat1 != 0x7F) {
diff --git a/engines/efh/utils.cpp b/engines/efh/utils.cpp
index 9b1eb3586d3..394c7da55c9 100644
--- a/engines/efh/utils.cpp
+++ b/engines/efh/utils.cpp
@@ -238,16 +238,6 @@ Common::KeyCode EfhEngine::waitForKey() {
 	return retVal;
 }
 
-Common::KeyCode EfhEngine::mapInputCode(Common::KeyCode input) {
-	// Original is doing:
-	// if input < a or > z : return input
-	// else return (input + 0xE0)
-	// ex: 'a' = 0x61 + 0xE0 = 0x0141, but it's a uint8 so it's 0x41 which is 'A'.
-	// So basically the original works with uppercase letters and do not alter the other inputs.
-	// => no implementation needed.
-	return input;
-}
-
 Common::KeyCode EfhEngine::handleAndMapInput(bool animFl) {
 	debugC(1, kDebugUtils, "handleAndMapInput %s", animFl ? "True" : "False");
 	// The original checks for the joystick input
@@ -279,35 +269,6 @@ Common::KeyCode EfhEngine::handleAndMapInput(bool animFl) {
 	return retVal;
 }
 
-Common::KeyCode EfhEngine::getInputBlocking() {
-	debugC(1, kDebugUtils, "getInputBlocking");
-	// The original checks for the joystick input
-	Common::Event event;
-	_system->getEventManager()->pollEvent(event);
-	Common::KeyCode retVal = Common::KEYCODE_INVALID;
-
-	uint32 lastMs = _system->getMillis();
-	while (retVal == Common::KEYCODE_INVALID && !shouldQuitGame()) {
-		_system->getEventManager()->pollEvent(event);
-
-		if (event.type == Common::EVENT_KEYUP)
-			retVal = getKeyCode(event);
-
-		_system->delayMillis(20);
-		uint32 newMs = _system->getMillis();
-
-		if (newMs - lastMs >= 220) {
-			lastMs = newMs;
-			handleAnimations();
-		}
-	}
-	return retVal;
-}
-
-void EfhEngine::setNumLock() {
-	// No implementation in ScummVM
-}
-
 bool EfhEngine::getValidationFromUser() {
 	debugC(1, kDebugUtils, "getValidationFromUser");
 	Common::KeyCode input = handleAndMapInput(true);


Commit: 7d9706c4eb6e941f5548fd70abeeb81857fc9d07
    https://github.com/scummvm/scummvm/commit/7d9706c4eb6e941f5548fd70abeeb81857fc9d07
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2025-04-29T19:21:01+03:00

Commit Message:
EFH: More work on the keymapper

- Added more actions to the keymapper
- Improve handling of custom actions
- Cleanup event handling code

Changed paths:
    engines/efh/efh.cpp
    engines/efh/efh.h
    engines/efh/metaengine.cpp
    engines/efh/utils.cpp


diff --git a/engines/efh/efh.cpp b/engines/efh/efh.cpp
index ef94817b9ea..84f6b95f62e 100644
--- a/engines/efh/efh.cpp
+++ b/engines/efh/efh.cpp
@@ -93,117 +93,7 @@ Common::Error EfhEngine::run() {
 			handleAnimations();
 		}
 
-		Common::Event event;
-		Common::KeyCode retVal = getLastCharAfterAnimCount(4);
-
-		switch (_customAction) {
-		case kActionSave:
-			handleActionSave();
-			break;
-		case kActionLoad:
-			handleActionLoad();
-			break;
-		default:
-			break;
-		}
-
-		_customAction = kActionNone;
-
-		switch (retVal) {
-		case Common::KEYCODE_DOWN:
-		case Common::KEYCODE_KP2:
-			goSouth();
-			break;
-		case Common::KEYCODE_UP:
-		case Common::KEYCODE_KP8:
-			goNorth();
-			break;
-		case Common::KEYCODE_RIGHT:
-		case Common::KEYCODE_KP6:
-			goEast();
-			break;
-		case Common::KEYCODE_LEFT:
-		case Common::KEYCODE_KP4:
-			goWest();
-			break;
-		case Common::KEYCODE_PAGEUP:
-		case Common::KEYCODE_KP9:
-			goNorthEast();
-			break;
-		case Common::KEYCODE_PAGEDOWN:
-		case Common::KEYCODE_KP3:
-			goSouthEast();
-			break;
-		case Common::KEYCODE_END:
-		case Common::KEYCODE_KP1:
-			goSouthWest();
-			break;
-		case Common::KEYCODE_HOME:
-		case Common::KEYCODE_KP7:
-			goNorthWest();
-			break;
-		case Common::KEYCODE_1:
-		case Common::KEYCODE_F1:
-			if (_teamChar[0]._id != -1) {
-				handleStatusMenu(1, _teamChar[0]._id);
-				_tempTextPtr = nullptr;
-				drawGameScreenAndTempText(true);
-				_redrawNeededFl = true;
-			}
-			break;
-		case Common::KEYCODE_2:
-		case Common::KEYCODE_F2:
-			if (_teamChar[1]._id != -1) {
-				handleStatusMenu(1, _teamChar[1]._id);
-				_tempTextPtr = nullptr;
-				drawGameScreenAndTempText(true);
-				_redrawNeededFl = true;
-			}
-			break;
-		case Common::KEYCODE_3:
-		case Common::KEYCODE_F3:
-			if (_teamChar[2]._id != -1) {
-				handleStatusMenu(1, _teamChar[2]._id);
-				_tempTextPtr = nullptr;
-				drawGameScreenAndTempText(true);
-				_redrawNeededFl = true;
-			}
-			break;
-
-		// debug cases to test sound
-		case Common::KEYCODE_4:
-			if (ConfMan.getBool("dump_scripts"))
-				generateSound(13);
-			break;
-		case Common::KEYCODE_5:
-			if (ConfMan.getBool("dump_scripts"))
-				generateSound(14);
-			break;
-		case Common::KEYCODE_6:
-			if (ConfMan.getBool("dump_scripts"))
-				generateSound(15);
-			break;
-		case Common::KEYCODE_7:
-			if (ConfMan.getBool("dump_scripts"))
-				generateSound(5);
-			break;
-		case Common::KEYCODE_8:
-			if (ConfMan.getBool("dump_scripts"))
-				generateSound(10);
-			break;
-		case Common::KEYCODE_9:
-			if (ConfMan.getBool("dump_scripts"))
-				generateSound(9);
-			break;
-		case Common::KEYCODE_0:
-			if (ConfMan.getBool("dump_scripts"))
-				generateSound(16);
-			break;
-		default:
-			if (retVal != Common::KEYCODE_INVALID)
-				warning("Main Loop: Unhandled input %d", retVal);
-			break;
-		}
+		handleEvents();
 
 		if ((_mapPosX != _oldMapPosX || _mapPosY != _oldMapPosY) && !shouldQuitGame()) {
 			bool collisionFl = checkMonsterCollision();
@@ -258,6 +148,83 @@ Common::Error EfhEngine::run() {
 	return Common::kNoError;
 }
 
+void EfhEngine::handleEvents() {
+	Common::KeyCode retVal = getLastCharAfterAnimCount(4);
+
+	switch (_customAction) {
+	case kActionSave:
+		handleActionSave();
+		break;
+	case kActionLoad:
+		handleActionLoad();
+		break;
+	case kActionMoveDown:
+		goSouth();
+		break;
+	case kActionMoveUp:
+		goNorth();
+		break;
+	case kActionMoveRight:
+		goEast();
+		break;
+	case kActionMoveLeft:
+		goWest();
+		break;
+	case kActionMoveUpRight:
+		goNorthEast();
+		break;
+	case kActionMoveDownRight:
+		goSouthEast();
+		break;
+	case kActionMoveDownLeft:
+		goSouthWest();
+		break;
+	case kActionMoveUpLeft:
+		goNorthWest();
+		break;
+	case kActionCharacter1Status:
+		showCharacterStatus(0);
+		break;
+	case kActionCharacter2Status:
+		showCharacterStatus(1);
+		break;
+	case kActionCharacter3Status:
+		showCharacterStatus(2);
+		break;
+	default:
+		break;
+	}
+
+	// debug cases to test sound
+	if (ConfMan.getBool("dump_scripts")) {
+		switch (retVal) {
+		case Common::KEYCODE_4:
+			generateSound(13);
+			break;
+		case Common::KEYCODE_5:
+			generateSound(14);
+			break;
+		case Common::KEYCODE_6:
+			generateSound(15);
+			break;
+		case Common::KEYCODE_7:
+			generateSound(5);
+			break;
+		case Common::KEYCODE_8:
+			generateSound(10);
+			break;
+		case Common::KEYCODE_9:
+			generateSound(9);
+			break;
+		case Common::KEYCODE_0:
+			generateSound(16);
+			break;
+		default:
+			break;
+		}
+	}
+}
+
 void EfhEngine::handleActionSave() {
 	for (uint counter = 0; counter < 2; ++counter) {
 		clearBottomTextZone(0);
@@ -1254,6 +1221,15 @@ void EfhEngine::goSouthWest() {
 	}
 }
 
+void EfhEngine::showCharacterStatus(uint8 character) {
+	if (_teamChar[character]._id != -1) {
+		handleStatusMenu(1, _teamChar[character]._id);
+		_tempTextPtr = nullptr;
+		drawGameScreenAndTempText(true);
+		_redrawNeededFl = true;
+	}
+}
+
 void EfhEngine::handleNewRoundEffects() {
 	debugC(6, kDebugEngine, "handleNewRoundEffects");
 
diff --git a/engines/efh/efh.h b/engines/efh/efh.h
index 8e40c6fcbc3..31969d2cad4 100644
--- a/engines/efh/efh.h
+++ b/engines/efh/efh.h
@@ -261,7 +261,18 @@ enum EFHAction {
 	kActionNone,
 	kActionExit,
 	kActionSave,
-	kActionLoad
+	kActionLoad,
+	kActionMoveUp,
+	kActionMoveDown,
+	kActionMoveLeft,
+	kActionMoveRight,
+	kActionMoveUpLeft,
+	kActionMoveUpRight,
+	kActionMoveDownLeft,
+	kActionMoveDownRight,
+	kActionCharacter1Status,
+	kActionCharacter2Status,
+	kActionCharacter3Status
 };
 
 class EfhEngine : public Engine {
@@ -348,10 +359,12 @@ private:
 	void goSouthEast();
 	void goNorthWest();
 	void goSouthWest();
+	void showCharacterStatus(uint8 character);
 	void handleNewRoundEffects();
 	void resetGame();
 	void computeMapAnimation();
 	void handleAnimations();
+	void handleEvents();
 	int8 checkMonsterMoveCollisionAndTileTexture(int16 monsterId);
 	bool moveMonsterAwayFromTeam(int16 monsterId);
 	bool moveMonsterTowardsTeam(int16 monsterId);
diff --git a/engines/efh/metaengine.cpp b/engines/efh/metaengine.cpp
index ae3cb367040..c1cecf5cd17 100644
--- a/engines/efh/metaengine.cpp
+++ b/engines/efh/metaengine.cpp
@@ -228,6 +228,65 @@ Common::KeymapArray EfhMetaEngine::initKeymaps(const char *target) const {
 	act->addDefaultInputMapping("JOY_RIGHT_SHOULDER");
 	keymap->addAction(act);
 
+	act = new Action("MOVEUP", _("Move up"));
+	act->setCustomEngineActionEvent(kActionMoveUp);
+	act->addDefaultInputMapping("UP");
+	act->addDefaultInputMapping("JOY_UP");
+	keymap->addAction(act);
+
+	act = new Action("MOVEDOWN", _("Move down"));
+	act->setCustomEngineActionEvent(kActionMoveDown);
+	act->addDefaultInputMapping("DOWN");
+	act->addDefaultInputMapping("JOY_DOWN");
+	keymap->addAction(act);
+
+	act = new Action("MOVELEFT", _("Move left"));
+	act->setCustomEngineActionEvent(kActionMoveLeft);
+	act->addDefaultInputMapping("LEFT");
+	act->addDefaultInputMapping("JOY_LEFT");
+	keymap->addAction(act);
+
+	act = new Action("MOVERIGHT", _("Move right"));
+	act->setCustomEngineActionEvent(kActionMoveRight);
+	act->addDefaultInputMapping("RIGHT");
+	act->addDefaultInputMapping("JOY_RIGHT");
+	keymap->addAction(act);
+
+	act = new Action("MOVEUPLEFT", _("Move up left"));
+	act->setCustomEngineActionEvent(kActionMoveUpLeft);
+	act->addDefaultInputMapping("HOME");
+	keymap->addAction(act);
+
+	act = new Action("MOVEUPRIGHT", _("Move up right"));
+	act->setCustomEngineActionEvent(kActionMoveUpRight);
+	act->addDefaultInputMapping("PAGEUP");
+	keymap->addAction(act);
+
+	act = new Action("MOVEDOWNLEFT", _("Move down left"));
+	act->setCustomEngineActionEvent(kActionMoveDownLeft);
+	act->addDefaultInputMapping("END");
+	keymap->addAction(act);
+
+	act = new Action("MOVEDOWNRIGHT", _("Move down right"));
+	act->setCustomEngineActionEvent(kActionMoveDownRight);
+	act->addDefaultInputMapping("PAGEDOWN");
+	keymap->addAction(act);
+
+	act = new Action("CHARACTER1STATUS", _("Character 1 status"));
+	act->setCustomEngineActionEvent(kActionCharacter1Status);
+	act->addDefaultInputMapping("F1");
+	keymap->addAction(act);
+
+	act = new Action("CHARACTER2STATUS", _("Character 2 status"));
+	act->setCustomEngineActionEvent(kActionCharacter2Status);
+	act->addDefaultInputMapping("F2");
+	keymap->addAction(act);
+
+	act = new Action("CHARACTER3STATUS", _("Character 3 status"));
+	act->setCustomEngineActionEvent(kActionCharacter3Status);
+	act->addDefaultInputMapping("F3");
+	keymap->addAction(act);
+
 	return Keymap::arrayOf(keymap);
 }
 
diff --git a/engines/efh/utils.cpp b/engines/efh/utils.cpp
index 394c7da55c9..25d4569f52d 100644
--- a/engines/efh/utils.cpp
+++ b/engines/efh/utils.cpp
@@ -149,9 +149,10 @@ Common::KeyCode EfhEngine::getLastCharAfterAnimCount(int16 delay) {
 		return Common::KEYCODE_INVALID;
 
 	Common::KeyCode lastChar = Common::KEYCODE_INVALID;
+	_customAction = kActionNone;
 
 	uint32 lastMs = _system->getMillis();
-	while (delay > 0 && lastChar == Common::KEYCODE_INVALID && !shouldQuitGame()) {
+	while (delay > 0 && lastChar == Common::KEYCODE_INVALID && _customAction == kActionNone && !shouldQuitGame()) {
 		_system->delayMillis(20);
 		uint32 newMs = _system->getMillis();
 
@@ -244,6 +245,7 @@ Common::KeyCode EfhEngine::handleAndMapInput(bool animFl) {
 	Common::Event event;
 	_system->getEventManager()->pollEvent(event);
 	Common::KeyCode retVal = Common::KEYCODE_INVALID;
+	_customAction = kActionNone;
 
 	uint32 lastMs = _system->getMillis();
 	while (retVal == Common::KEYCODE_INVALID && _customAction == kActionNone && !shouldQuitGame()) {


Commit: 3466b09280f80b7f6f8c95e4d2754d2b5228ce06
    https://github.com/scummvm/scummvm/commit/3466b09280f80b7f6f8c95e4d2754d2b5228ce06
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2025-04-29T19:21:02+03:00

Commit Message:
EFH: Remove more unimplemented functions

Changed paths:
    engines/efh/efh.cpp
    engines/efh/efh.h
    engines/efh/script.cpp
    engines/efh/utils.cpp


diff --git a/engines/efh/efh.cpp b/engines/efh/efh.cpp
index 84f6b95f62e..57fb1508cdc 100644
--- a/engines/efh/efh.cpp
+++ b/engines/efh/efh.cpp
@@ -410,7 +410,6 @@ void EfhEngine::initEngine() {
 	loadImageSet(62, _circleImageBuf, _circleImageSubFileArray, _decompBuf);
 	fileName = "titlsong";
 	readFileToBuffer(fileName, _titleSong);
-	setDefaultNoteDuration();
 	Common::KeyCode lastInput = Common::KEYCODE_INVALID;
 
 	if (_loadSaveSlot == -1)
@@ -2533,12 +2532,6 @@ uint8 EfhEngine::getMapTileInfo(int16 mapPosX, int16 mapPosY) {
 	return _curPlace[mapPosX][mapPosY];
 }
 
-void EfhEngine::writeTechAndMapFiles() {
-	// The original game overwrite game data files when switching map, keeping track of modified data.
-	// In our implementation, we have everything in memory and save it in savegames only.
-	// This function is therefore not useful and is not implemented.
-}
-
 uint16 EfhEngine::getStringWidth(const Common::String &str) const {
 	const char *buffer = str.c_str();
 	debugC(6, kDebugEngine, "getStringWidth %s", buffer);
diff --git a/engines/efh/efh.h b/engines/efh/efh.h
index 31969d2cad4..0c9039280c9 100644
--- a/engines/efh/efh.h
+++ b/engines/efh/efh.h
@@ -328,7 +328,6 @@ private:
 	void loadEfhGame();
 	void copyCurrentPlaceToBuffer(int16 id);
 	uint8 getMapTileInfo(int16 mapPosX, int16 mapPosY);
-	void writeTechAndMapFiles();
 	uint16 getStringWidth(const Common::String &str) const;
 	void setTextPos(int16 textPosX, int16 textPosY);
 	void drawGameScreenAndTempText(bool flag);
@@ -522,7 +521,6 @@ private:
 	void genericGenerateSound(int16 soundType, int16 repeatCount);
 
 	// Utils
-	void setDefaultNoteDuration();
 	void decryptImpFile(bool techMapFl);
 	void loadImageSet(int16 imageSetId, uint8 *buffer, uint8 **subFilesArray, uint8 *destBuffer);
 	uint32 uncompressBuffer(uint8 *compressedBuf, uint8 *destBuf);
diff --git a/engines/efh/script.cpp b/engines/efh/script.cpp
index 2a6699f99e2..09a69174f5e 100644
--- a/engines/efh/script.cpp
+++ b/engines/efh/script.cpp
@@ -150,7 +150,6 @@ int16 EfhEngine::script_parse(Common::String stringBuffer, int16 posX, int16 pos
 			// Change map. { map number, posX, posY }
 			buffer = script_readNumberArray(buffer, 3, scriptNumberArray);
 			if (scriptExecuteFlag) {
-				writeTechAndMapFiles();
 				_oldMapPosX = _mapPosX = scriptNumberArray[1];
 				_oldMapPosY = _mapPosY = scriptNumberArray[2];
 				loadTechMapImp(scriptNumberArray[0]);
diff --git a/engines/efh/utils.cpp b/engines/efh/utils.cpp
index 25d4569f52d..de42271b454 100644
--- a/engines/efh/utils.cpp
+++ b/engines/efh/utils.cpp
@@ -26,15 +26,6 @@
 
 namespace Efh {
 
-void EfhEngine::setDefaultNoteDuration() {
-	// Original implementation is based on the int1C, which is triggered at 18.2065Hz.
-	// Every 4 times, it sets a flag (thus, approx every 220ms)
-	// The function was checking the keyboard in a loop, incrementing a counter and setting the last character read
-	// The "_defaultNoteDuration" was then set to 7 times this counter
-	//
-	// No implementation required in ScummVM
-}
-
 void EfhEngine::decryptImpFile(bool techMapFl) {
 	debugC(1, kDebugUtils, "decryptImpFile %s", techMapFl ? "True" : "False");
 	uint16 counter = 0;


Commit: 8398b7f307356eb1eaacae3a90ddd63282b7190f
    https://github.com/scummvm/scummvm/commit/8398b7f307356eb1eaacae3a90ddd63282b7190f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2025-04-29T19:21:04+03:00

Commit Message:
EFH: Get rid of _shouldQuit

Changed paths:
    engines/efh/efh.cpp
    engines/efh/efh.h
    engines/efh/fight.cpp
    engines/efh/files.cpp
    engines/efh/init.cpp
    engines/efh/menu.cpp
    engines/efh/script.cpp
    engines/efh/sound.cpp
    engines/efh/utils.cpp


diff --git a/engines/efh/efh.cpp b/engines/efh/efh.cpp
index 57fb1508cdc..fe25104214a 100644
--- a/engines/efh/efh.cpp
+++ b/engines/efh/efh.cpp
@@ -84,7 +84,7 @@ Common::Error EfhEngine::run() {
 		return Common::kNoError;
 
 	uint32 lastMs = _system->getMillis();
-	while (!shouldQuitGame()) {
+	while (!shouldQuit()) {
 		_system->delayMillis(20);
 		uint32 newMs = _system->getMillis();
 
@@ -95,7 +95,7 @@ Common::Error EfhEngine::run() {
 
 		handleEvents();
 
-		if ((_mapPosX != _oldMapPosX || _mapPosY != _oldMapPosY) && !shouldQuitGame()) {
+		if ((_mapPosX != _oldMapPosX || _mapPosY != _oldMapPosY) && !shouldQuit()) {
 			bool collisionFl = checkMonsterCollision();
 			if (collisionFl) {
 				_oldMapPosX = _mapPosX;
@@ -116,16 +116,16 @@ Common::Error EfhEngine::run() {
 			}
 		}
 
-		if (!shouldQuitGame()) {
+		if (!shouldQuit()) {
 			handleMapMonsterMoves();
 		}
 
-		if (_redrawNeededFl && !shouldQuitGame()) {
+		if (_redrawNeededFl && !shouldQuit()) {
 			drawScreen();
 			displayLowStatusScreen(true);
 		}
 
-		if (!shouldQuitGame()) {
+		if (!shouldQuit()) {
 			handleNewRoundEffects();
 
 			if (_tempTextDelay > 0) {
@@ -140,7 +140,7 @@ Common::Error EfhEngine::run() {
 
 		if (isTPK()) {
 			if (handleDeathMenu())
-				_shouldQuit = true;
+				quitGame();
 		}
 
 		displayFctFullScreen();
@@ -268,7 +268,6 @@ void EfhEngine::handleActionLoad() {
 void EfhEngine::initialize() {
 	_rnd = new Common::RandomSource("Hell");
 	_rnd->setSeed(g_system->getMillis());   // Kick random number generator
-	_shouldQuit = false;
 }
 
 void EfhEngine::playIntro() {
@@ -829,7 +828,7 @@ void EfhEngine::handleWinSequence() {
 
 	Common::KeyCode input = Common::KEYCODE_INVALID;
 
-	while (input != Common::KEYCODE_ESCAPE && !shouldQuitGame()) {
+	while (input != Common::KEYCODE_ESCAPE && !shouldQuit()) {
 		displayRawDataAtPos(winSeqSubFilesArray1[0], 0, 0);
 		displayFctFullScreen();
 		displayRawDataAtPos(winSeqSubFilesArray1[0], 0, 0);
@@ -1702,7 +1701,7 @@ void EfhEngine::handleMapMonsterMoves() {
 
 				break;
 			}
-		} while (!monsterMovedFl && retryCounter > 0 && !shouldQuitGame());
+		} while (!monsterMovedFl && retryCounter > 0 && !shouldQuit());
 	}
 
 	if (attackMonsterId != -1)
@@ -2039,7 +2038,7 @@ void EfhEngine::displayImp1Text(int16 textId) {
 						curTextId = nextTextId;
 				}
 
-			} while (!textComplete && curTextId != -1 && !shouldQuitGame());
+			} while (!textComplete && curTextId != -1 && !shouldQuit());
 
 			textComplete = false;
 			if (curTextId == 0xFF || curTextId == -1)
@@ -2426,7 +2425,7 @@ bool EfhEngine::checkMonsterCollision() {
 			default:
 				break;
 			}
-		} while (!endLoop && !shouldQuitGame());
+		} while (!endLoop && !shouldQuit());
 		return false;
 	}
 
diff --git a/engines/efh/efh.h b/engines/efh/efh.h
index 0c9039280c9..bc27c926447 100644
--- a/engines/efh/efh.h
+++ b/engines/efh/efh.h
@@ -300,9 +300,6 @@ public:
 	Common::Error loadGameState(int slot) override;
 	Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
 
-	bool _shouldQuit;
-	bool shouldQuitGame() const { return _shouldQuit || shouldQuit(); }
-
 protected:
 	int _lastTime;
 	// Engine APIs
diff --git a/engines/efh/fight.cpp b/engines/efh/fight.cpp
index e2476db2e34..bc1d6bb4fe9 100644
--- a/engines/efh/fight.cpp
+++ b/engines/efh/fight.cpp
@@ -94,7 +94,7 @@ bool EfhEngine::handleFight(int16 monsterId) {
 
 	drawCombatScreen(0, false, true);
 
-	for (bool mainLoopCond = false; !mainLoopCond && !shouldQuitGame();) {
+	for (bool mainLoopCond = false; !mainLoopCond && !shouldQuit();) {
 		if (isTPK()) {
 			resetTeamMonsterIdArray();
 			_ongoingFightFl = false;
@@ -1022,7 +1022,7 @@ int16 EfhEngine::determineTeamTarget(int16 charId, int16 unkFied18Val, bool chec
 				getLastCharAfterAnimCount(_guessAnimationAmount);
 			}
 		}
-	} while (retVal == -1 && !shouldQuitGame());
+	} while (retVal == -1 && !shouldQuit());
 
 	if (retVal == 27)
 		retVal = -1;
@@ -1128,7 +1128,7 @@ bool EfhEngine::getTeamAttackRoundPlans() {
 			default:
 				break;
 			}
-		} while (_teamChar[charId]._lastAction == 0 && !shouldQuitGame());
+		} while (_teamChar[charId]._lastAction == 0 && !shouldQuit());
 	}
 
 	return retVal;
@@ -1662,7 +1662,7 @@ int16 EfhEngine::selectMonsterGroup() {
 
 	int16 retVal = -1;
 
-	while (retVal == -1 && !shouldQuitGame()) {
+	while (retVal == -1 && !shouldQuit()) {
 		Common::KeyCode input = handleAndMapInput(true);
 		switch (input) {
 		case Common::KEYCODE_ESCAPE:
diff --git a/engines/efh/files.cpp b/engines/efh/files.cpp
index 9ce0f3bc03e..cbc31419134 100644
--- a/engines/efh/files.cpp
+++ b/engines/efh/files.cpp
@@ -105,7 +105,7 @@ void EfhEngine::rImageFile(const Common::Path &filename, uint8 *targetBuffer, ui
 	// => Write a class to handle that more properly
 	uint8 *ptr = targetBuffer;
 	uint16 counter = 0;
-	while (READ_LE_INT16(ptr) != 0 && !shouldQuitGame()) {
+	while (READ_LE_INT16(ptr) != 0 && !shouldQuit()) {
 		subFilesArray[counter] = ptr;
 		++counter;
 		int16 imageWidth = READ_LE_INT16(ptr);
diff --git a/engines/efh/init.cpp b/engines/efh/init.cpp
index f33a75aafbf..bed2900f5ea 100644
--- a/engines/efh/init.cpp
+++ b/engines/efh/init.cpp
@@ -240,7 +240,6 @@ EfhEngine::EfhEngine(OSystem *syst, const ADGameDescription *gd) : Engine(syst),
 	_system = syst;
 	_rnd = nullptr;
 
-	_shouldQuit = false;
 	_lastTime = 0;
 	_platform = Common::kPlatformUnknown;
 	_mainSurface = nullptr;
diff --git a/engines/efh/menu.cpp b/engines/efh/menu.cpp
index 6c8a35fd9e1..cdc9a4517c2 100644
--- a/engines/efh/menu.cpp
+++ b/engines/efh/menu.cpp
@@ -122,7 +122,7 @@ bool EfhEngine::handleDeathMenu() {
 			displayFctFullScreen();
 	}
 
-	for (bool found = false; !found && !shouldQuitGame();) {
+	for (bool found = false; !found && !shouldQuit();) {
 		Common::KeyCode input = waitForKey();
 		switch (input) {
 		case Common::KEYCODE_l:
@@ -133,7 +133,7 @@ bool EfhEngine::handleDeathMenu() {
 			found = _saveAuthorized;
 			break;
 		case Common::KEYCODE_q:
-			_shouldQuit = true;
+			quitGame();
 			return true;
 			break;
 		case Common::KEYCODE_r:
@@ -657,7 +657,7 @@ int16 EfhEngine::handleStatusMenu(int16 gameMode, int16 charId) {
 
 			prepareStatusMenu(windowId, menuId, curMenuLine, charId, true);
 
-		} while (!selectionDoneFl && !shouldQuitGame()); // Loop until a menu entry is confirmed by the user by pressing the enter key
+		} while (!selectionDoneFl && !shouldQuit()); // Loop until a menu entry is confirmed by the user by pressing the enter key
 
 		bool validationFl = true;
 
@@ -763,7 +763,7 @@ int16 EfhEngine::handleStatusMenu(int16 gameMode, int16 charId) {
 						}
 						givenFl = false;
 					}
-				} while (!givenFl && !var2 && destCharId != 0x1B && !shouldQuitGame());
+				} while (!givenFl && !var2 && destCharId != 0x1B && !shouldQuit());
 
 				if (givenFl) {
 					removeObject(charId, objectId);
diff --git a/engines/efh/script.cpp b/engines/efh/script.cpp
index 09a69174f5e..895e620267c 100644
--- a/engines/efh/script.cpp
+++ b/engines/efh/script.cpp
@@ -73,7 +73,7 @@ int16 EfhEngine::script_parse(Common::String stringBuffer, int16 posX, int16 pos
 	int16 curWordPos = 0;
 	setTextPos(posX, curLineNb * 9 + posY);
 
-	while (!doneFlag && !shouldQuitGame()) {
+	while (!doneFlag && !shouldQuit()) {
 		uint8 curChar = *buffer;
 		if (curChar != 0x5E && curChar != 0x20 && curChar != 0 && curChar != 0x7C) { // '^', ' ', NUL, '|'
 			noTextFlag = false;
diff --git a/engines/efh/sound.cpp b/engines/efh/sound.cpp
index 752b335133e..b5feec4e216 100644
--- a/engines/efh/sound.cpp
+++ b/engines/efh/sound.cpp
@@ -27,7 +27,7 @@ void EfhEngine::songDelay(int delay) {
 	debugC(3, kDebugEngine, "songDelay %d", delay);
 
 	int remainingDelay = delay / 2;
-	while (remainingDelay > 0 && !shouldQuitGame()) {
+	while (remainingDelay > 0 && !shouldQuit()) {
 		remainingDelay -= 3;
 		_system->delayMillis(3);
 	}
@@ -90,7 +90,7 @@ Common::KeyCode EfhEngine::playSong(uint8 *buffer) {
 			if (inputChar == Common::KEYCODE_ESCAPE || inputChar == Common::KEYCODE_RETURN)
 				stopFl = 0;
 		}
-	} while (stopFl != 0 && !shouldQuitGame());
+	} while (stopFl != 0 && !shouldQuit());
 
 	_mixer->stopHandle(_speakerHandle);
 	delete _speakerStream;
@@ -164,7 +164,7 @@ void EfhEngine::generateSound2(int startFreq, int endFreq, int speed) {
 		songDelay(speed);
 		_speakerStream->stop();
 		curFreq += delta;
-	} while (curFreq < endFreq && !shouldQuitGame());
+	} while (curFreq < endFreq && !shouldQuit());
 
 
 	_mixer->stopHandle(_speakerHandle);
diff --git a/engines/efh/utils.cpp b/engines/efh/utils.cpp
index de42271b454..22ad37d69bf 100644
--- a/engines/efh/utils.cpp
+++ b/engines/efh/utils.cpp
@@ -50,7 +50,7 @@ void EfhEngine::decryptImpFile(bool techMapFl) {
 				_imp1PtrArray[counter++] = curPtr;
 		} else
 			++curPtr;
-	} while (*curPtr != 0x60 && counter <= target && !shouldQuitGame());
+	} while (*curPtr != 0x60 && counter <= target && !shouldQuit());
 
 	if (ConfMan.getBool("dump_scripts")) {
 		// Dump the decompressed IMP file
@@ -143,7 +143,7 @@ Common::KeyCode EfhEngine::getLastCharAfterAnimCount(int16 delay) {
 	_customAction = kActionNone;
 
 	uint32 lastMs = _system->getMillis();
-	while (delay > 0 && lastChar == Common::KEYCODE_INVALID && _customAction == kActionNone && !shouldQuitGame()) {
+	while (delay > 0 && lastChar == Common::KEYCODE_INVALID && _customAction == kActionNone && !shouldQuit()) {
 		_system->delayMillis(20);
 		uint32 newMs = _system->getMillis();
 
@@ -168,7 +168,7 @@ Common::KeyCode EfhEngine::getInput(int16 delay) {
 	Common::KeyCode retVal = Common::KEYCODE_INVALID;
 
 	uint32 lastMs = _system->getMillis();
-	while (delay > 0 && !shouldQuitGame()) {
+	while (delay > 0 && !shouldQuit()) {
 		_system->delayMillis(20);
 		uint32 newMs = _system->getMillis();
 
@@ -194,14 +194,14 @@ Common::KeyCode EfhEngine::getKeyCode(const Common::Event &event) {
 		switch (retVal) {
 		case Common::KEYCODE_x:
 		case Common::KEYCODE_q:
-			_shouldQuit = true;
+			quitGame();
 			retVal = Common::KEYCODE_INVALID;
 			break;
 		default:
 			break;
 		}
 	} else if (event.kbd.flags & Common::KBD_ALT && retVal == Common::KEYCODE_F4) {
-		_shouldQuit = true;
+		quitGame();
 	}
 
 	return retVal;
@@ -213,7 +213,7 @@ Common::KeyCode EfhEngine::waitForKey() {
 	Common::Event event;
 
 	uint32 lastMs = _system->getMillis();
-	while (retVal == Common::KEYCODE_INVALID && !shouldQuitGame()) {
+	while (retVal == Common::KEYCODE_INVALID && !shouldQuit()) {
 		_system->delayMillis(20);
 		uint32 newMs = _system->getMillis();
 
@@ -239,7 +239,7 @@ Common::KeyCode EfhEngine::handleAndMapInput(bool animFl) {
 	_customAction = kActionNone;
 
 	uint32 lastMs = _system->getMillis();
-	while (retVal == Common::KEYCODE_INVALID && _customAction == kActionNone && !shouldQuitGame()) {
+	while (retVal == Common::KEYCODE_INVALID && _customAction == kActionNone && !shouldQuit()) {
 		_system->getEventManager()->pollEvent(event);
 
 		if (event.type == Common::EVENT_KEYUP)


Commit: 7e7b236a12d1170b2d8b8bfa7845e8dd1a219343
    https://github.com/scummvm/scummvm/commit/7e7b236a12d1170b2d8b8bfa7845e8dd1a219343
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2025-04-29T19:21:05+03:00

Commit Message:
EFH: Remove getKeyCode()

Changed paths:
    engines/efh/efh.h
    engines/efh/utils.cpp


diff --git a/engines/efh/efh.h b/engines/efh/efh.h
index bc27c926447..29e93958256 100644
--- a/engines/efh/efh.h
+++ b/engines/efh/efh.h
@@ -524,7 +524,6 @@ private:
 	int16 getRandom(int16 maxVal);
 	Common::KeyCode getLastCharAfterAnimCount(int16 delay);
 	Common::KeyCode getInput(int16 delay);
-	Common::KeyCode getKeyCode(const Common::Event & event);
 	Common::KeyCode waitForKey();
 	Common::KeyCode handleAndMapInput(bool animFl);
 	bool getValidationFromUser();
diff --git a/engines/efh/utils.cpp b/engines/efh/utils.cpp
index 22ad37d69bf..33ed35bc7ac 100644
--- a/engines/efh/utils.cpp
+++ b/engines/efh/utils.cpp
@@ -186,27 +186,6 @@ Common::KeyCode EfhEngine::getInput(int16 delay) {
 	return retVal;
 }
 
-Common::KeyCode EfhEngine::getKeyCode(const Common::Event &event) {
-	Common::KeyCode retVal = event.kbd.keycode;
-	if (retVal == Common::KEYCODE_LCTRL || retVal == Common::KEYCODE_RCTRL || retVal == Common::KEYCODE_RALT || retVal == Common::KEYCODE_LALT)
-		retVal = Common::KEYCODE_INVALID;
-	else  if (event.kbd.flags & Common::KBD_CTRL) {
-		switch (retVal) {
-		case Common::KEYCODE_x:
-		case Common::KEYCODE_q:
-			quitGame();
-			retVal = Common::KEYCODE_INVALID;
-			break;
-		default:
-			break;
-		}
-	} else if (event.kbd.flags & Common::KBD_ALT && retVal == Common::KEYCODE_F4) {
-		quitGame();
-	}
-
-	return retVal;
-}
-
 Common::KeyCode EfhEngine::waitForKey() {
 	debugC(1, kDebugUtils, "waitForKey");
 	Common::KeyCode retVal = Common::KEYCODE_INVALID;
@@ -223,8 +202,12 @@ Common::KeyCode EfhEngine::waitForKey() {
 		}
 
 		_system->getEventManager()->pollEvent(event);
-		if (event.type == Common::EVENT_KEYUP)
-			retVal = getKeyCode(event);
+		if (event.type == Common::EVENT_KEYUP) {
+			if ((event.kbd.flags & Common::KBD_CTRL) && event.kbd.keycode == Common::KEYCODE_q)
+				quitGame();
+			if (!event.kbd.flags)
+				retVal = event.kbd.keycode;
+		}
 	}
 
 	return retVal;
@@ -242,8 +225,12 @@ Common::KeyCode EfhEngine::handleAndMapInput(bool animFl) {
 	while (retVal == Common::KEYCODE_INVALID && _customAction == kActionNone && !shouldQuit()) {
 		_system->getEventManager()->pollEvent(event);
 
-		if (event.type == Common::EVENT_KEYUP)
-			retVal = getKeyCode(event);
+		if (event.type == Common::EVENT_KEYUP) {
+			if ((event.kbd.flags & Common::KBD_CTRL) && event.kbd.keycode == Common::KEYCODE_q)
+				quitGame();
+			if (!event.kbd.flags)
+				retVal = event.kbd.keycode;
+		}
 
 		if (event.type == Common::EVENT_CUSTOM_ENGINE_ACTION_START)
 			_customAction = event.customType;




More information about the Scummvm-git-logs mailing list