[Scummvm-git-logs] scummvm master -> fdafab949c657cf55e965b90e6bc09ceb117f398

sev- sev at scummvm.org
Thu Oct 28 21:46:21 UTC 2021


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

Summary:
7889cb9a9f GROOVIE: Initial work on WineRack puzzle
12fe207f86 GROOVIE: Added logic table to WineRack puzzle
fdafab949c GROOVIE: Added override keyword


Commit: 7889cb9a9f41213048b94f54ea33bde264dd8ca9
    https://github.com/scummvm/scummvm/commit/7889cb9a9f41213048b94f54ea33bde264dd8ca9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-10-29T00:45:55+03:00

Commit Message:
GROOVIE: Initial work on WineRack puzzle

Changed paths:
    engines/groovie/logic/winerack.cpp
    engines/groovie/logic/winerack.h


diff --git a/engines/groovie/logic/winerack.cpp b/engines/groovie/logic/winerack.cpp
index cccca7214f..51192c4d71 100644
--- a/engines/groovie/logic/winerack.cpp
+++ b/engines/groovie/logic/winerack.cpp
@@ -47,7 +47,7 @@ void WineRackGame::run(byte *scriptVariables) {
 		placeBottle(pos, kWineBottlePlayer);
 		scriptVariables[0] = pos / 10;
 		scriptVariables[1] = pos % 10;
-		scriptVariables[3] = FUN_00412c90();
+		scriptVariables[3] = sub09();
 		break;
 	case 5:	// Opponent's move
 		scriptVariables[3] = 0;
@@ -55,24 +55,27 @@ void WineRackGame::run(byte *scriptVariables) {
 		placeBottle(pos, kWineBottleOpponent);
 		scriptVariables[0] = pos / 10;
 		scriptVariables[1] = pos % 10;
-		scriptVariables[3] = FUN_00412cf0() != 0 ? 1 : 0;
+		scriptVariables[3] = sub12() != 0 ? 1 : 0;
 		break;
 	default:
 		scriptVariables[3] = 0;
 		placeBottle(scriptVariables[0] * 10 + scriptVariables[1], 2);
-		scriptVariables[3] = FUN_00412c90() != 0 ? 2 : 0;
 
-		pos = calculateNextMove(kWineBottleOpponent);
-		placeBottle(pos, kWineBottleOpponent);
-		scriptVariables[0] = pos / 10;
-		scriptVariables[1] = pos % 10;
-		scriptVariables[3] = FUN_00412cf0() != 0 ? 1 : 0;
+		if (sub09()) {
+			scriptVariables[3] = 2;
+		} else {
+			pos = calculateNextMove(kWineBottleOpponent);
+			placeBottle(pos, kWineBottleOpponent);
+			scriptVariables[0] = pos / 10;
+			scriptVariables[1] = pos % 10;
+			scriptVariables[3] = sub12() != 0 ? 1 : 0;
+		}
 		break;
 	}
 }
 
 void WineRackGame::initGrid(byte difficulty) {
-	memset(_wineRackGrid, 0, 25);
+	memset(_wineRackGrid, 0, 100);
 
 	switch (difficulty) {
 	case 0:
@@ -103,6 +106,7 @@ void WineRackGame::initGrid(byte difficulty) {
 		_wineRackGrid[82] = kWineBottlePlayer;
 		_wineRackGrid[91] = kWineBottlePlayer;
 		break;
+
 	case 1:
 		_totalBottles = 12;
 
@@ -119,6 +123,10 @@ void WineRackGame::initGrid(byte difficulty) {
 		_wineRackGrid[16] = kWineBottleOpponent;
 		_wineRackGrid[14] = kWineBottleOpponent;
 		break;
+
+	default:
+		_totalBottles = 0;
+		break;
 	}
 }
 
@@ -128,42 +136,40 @@ void WineRackGame::placeBottle(byte pos, byte val) {
 }
 
 byte WineRackGame::calculateNextMove(byte op) {
-	// TODO
 	return 0;
 }
 
-uint32 WineRackGame::FUN_00412c90() {
-	int i = 0;
-	uint32 res = 0;
-	int unk = 0;
+uint32 WineRackGame::sub09() {
+	memset(_wineRackGrid2, 0, 100);
 
-	//memset(_wineRackGrid2, 0, 25);	// TODO: wineRackGrid2
-
-	while ((_wineRackGrid[i] != kWineBottlePlayer /* ||
-			(res = FUN_00412c10(100, i, 2, 3, &unk), unk != 1)*/)) {	// TODO
-		if (i++ > 9) {
-			return res & 0xffffff00;
+	for (int i = 0; i < 10; i++) {
+		if (_wineRackGrid[i] == kWineBottlePlayer) {
+			int var;
+			sub10(100, i, 2, 3, &var);
+			if (var == 1)
+				return 1;
 		}
 	}
-	return res >> 8;
+
+	return 0;
 }
 
-uint32 WineRackGame::FUN_00412cf0() {
-	int i = 0;
-	uint32 res = 0;
-	int unk = 0;
+void WineRackGame::sub10(int8 a1, int8 a2, int a3, int a4, int *a5) {
+}
 
-	//memset(_wineRackGrid2, 0, 25);	// TODO: wineRackGrid2
+uint32 WineRackGame::sub12() {
+	memset(_wineRackGrid2, 0, 25);
 
-	do {
+	for (int i = 0; i < 100; i += 10) {
 		if (_wineRackGrid[i] == kWineBottleOpponent) {
-			//res = FUN_00412c10(100, i, 1, 2, &unk), unk != 1;	// TODO
-			if (unk == 1)
-				return res >> 8;
+			int var;
+			sub10(100, i, 1, 2, &var);
+			if (var == 1)
+				return 1;
 		}
-	} while (i < 100);
+	}
 
-	return res & 0xffffff00;
+	return 0;
 }
 
 } // End of Groovie namespace
diff --git a/engines/groovie/logic/winerack.h b/engines/groovie/logic/winerack.h
index e00c3842f9..59031c622e 100644
--- a/engines/groovie/logic/winerack.h
+++ b/engines/groovie/logic/winerack.h
@@ -37,16 +37,18 @@ class WineRackGame {
 public:
 	WineRackGame();
 	void run(byte *scriptVariables);
-	
+
 private:
 	void initGrid(byte difficulty);
 	void placeBottle(byte pos, byte val);
 	byte calculateNextMove(byte op);
-	uint32 FUN_00412c90();
-	uint32 FUN_00412cf0();
+	uint32 sub09();
+	void sub10(int8 a1, int8 a2, int a3, int a4, int *a5);
+	uint32 sub12();
 
 	int _totalBottles;
 	byte _wineRackGrid[100];
+	byte _wineRackGrid2[100];
 	Common::RandomSource _random;
 };
 


Commit: 12fe207f86fe33c666c24dadc5b755807b0cc0c9
    https://github.com/scummvm/scummvm/commit/12fe207f86fe33c666c24dadc5b755807b0cc0c9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-10-29T00:45:55+03:00

Commit Message:
GROOVIE: Added logic table to WineRack puzzle

Changed paths:
    engines/groovie/logic/winerack.cpp


diff --git a/engines/groovie/logic/winerack.cpp b/engines/groovie/logic/winerack.cpp
index 51192c4d71..e791daea4b 100644
--- a/engines/groovie/logic/winerack.cpp
+++ b/engines/groovie/logic/winerack.cpp
@@ -30,6 +30,10 @@ enum WineBottle {
 	kWineBottlePlayer = 2
 };
 
+namespace {
+extern const int8 wineRackLogicTable[1200];
+}
+
 WineRackGame::WineRackGame() : _random("WineRackGame"), _totalBottles(0) {
 	memset(_wineRackGrid, 0, 100);
 }
@@ -172,4 +176,111 @@ uint32 WineRackGame::sub12() {
 	return 0;
 }
 
+namespace {
+
+const int8 wineRackLogicTable[1200] = {
+	-1, -1,  1, 10, -1, -1, -1, -1, 11, -1, -1, -1,
+	-1, -1,  2, 11, 10,  0, -1, -1, 12, 20, -1, -1,
+	-1, -1,  3, 12, 11,  1, -1, -1, 13, 21, 10, -1,
+	-1, -1,  4, 13, 12,  2, -1, -1, 14, 22, 11, -1,
+	-1, -1,  5, 14, 13,  3, -1, -1, 15, 23, 12, -1,
+	-1, -1,  6, 15, 14,  4, -1, -1, 16, 24, 13, -1,
+	-1, -1,  7, 16, 15,  5, -1, -1, 17, 25, 14, -1,
+	-1, -1,  8, 17, 16,  6, -1, -1, 18, 26, 15, -1,
+	-1, -1,  9, 18, 17,  7, -1, -1, 19, 27, 16, -1,
+	-1, -1, -1, 19, 18,  8, -1, -1, -1, 28, 17, -1,
+	 0,  1, 11, 20, -1, -1, -1,  2, 21, -1, -1, -1,
+	 1,  2, 12, 21, 20, 10, -1,  3, 22, 30, -1,  0,
+	 2,  3, 13, 22, 21, 11, -1,  4, 23, 31, 20,  1,
+	 3,  4, 14, 23, 22, 12, -1,  5, 24, 32, 21,  2,
+	 4,  5, 15, 24, 23, 13, -1,  6, 25, 33, 22,  3,
+	 5,  6, 16, 25, 24, 14, -1,  7, 26, 34, 23,  4,
+	 6,  7, 17, 26, 25, 15, -1,  8, 27, 35, 24,  5,
+	 7,  8, 18, 27, 26, 16, -1,  9, 28, 36, 25,  6,
+	 8,  9, 19, 28, 27, 17, -1, -1, 29, 37, 26,  7,
+	 9, -1, -1, 29, 28, 18, -1, -1, -1, 38, 27,  8,
+	10, 11, 21, 30, -1, -1,  1, 12, 31, -1, -1, -1,
+	11, 12, 22, 31, 30, 20,  2, 13, 32, 40, -1, 10,
+	12, 13, 23, 32, 31, 21,  3, 14, 33, 41, 30, 11,
+	13, 14, 24, 33, 32, 22,  4, 15, 34, 42, 31, 12,
+	14, 15, 25, 34, 33, 23,  5, 16, 35, 43, 32, 13,
+	15, 16, 26, 35, 34, 24,  6, 17, 36, 44, 33, 14,
+	16, 17, 27, 36, 35, 25,  7, 18, 37, 45, 34, 15,
+	17, 18, 28, 37, 36, 26,  8, 19, 38, 46, 35, 16,
+	18, 19, 29, 38, 37, 27,  9, -1, 39, 47, 36, 17,
+	19, -1, -1, 39, 38, 28, -1, -1, -1, 48, 37, 18,
+	20, 21, 31, 40, -1, -1, 11, 22, 41, -1, -1, -1,
+	21, 22, 32, 41, 40, 30, 12, 23, 42, 50, -1, 20,
+	22, 23, 33, 42, 41, 31, 13, 24, 43, 51, 40, 21,
+	23, 24, 34, 43, 42, 32, 14, 25, 44, 52, 41, 22,
+	24, 25, 35, 44, 43, 33, 15, 26, 45, 53, 42, 23,
+	25, 26, 36, 45, 44, 34, 16, 27, 46, 54, 43, 24,
+	26, 27, 37, 46, 45, 35, 17, 28, 47, 55, 44, 25,
+	27, 28, 38, 47, 46, 36, 18, 29, 48, 56, 45, 26,
+	28, 29, 39, 48, 47, 37, 19, -1, 49, 57, 46, 27,
+	29, -1, -1, 49, 48, 38, -1, -1, -1, 58, 47, 28,
+	30, 31, 41, 50, -1, -1, 21, 32, 51, -1, -1, -1,
+	31, 32, 42, 51, 50, 40, 22, 33, 52, 60, -1, 30,
+	32, 33, 43, 52, 51, 41, 23, 34, 53, 61, 50, 31,
+	33, 34, 44, 53, 52, 42, 24, 35, 54, 62, 51, 32,
+	34, 35, 45, 54, 53, 43, 25, 36, 55, 63, 52, 33,
+	35, 36, 46, 55, 54, 44, 26, 37, 56, 64, 53, 34,
+	36, 37, 47, 56, 55, 45, 27, 38, 57, 65, 54, 35,
+	37, 38, 48, 57, 56, 46, 28, 39, 58, 66, 55, 36,
+	38, 39, 49, 58, 57, 47, 29, -1, 59, 67, 56, 37,
+	39, -1, -1, 59, 58, 48, -1, -1, -1, 68, 57, 38,
+	40, 41, 51, 60, -1, -1, 31, 42, 61, -1, -1, -1,
+	41, 42, 52, 61, 60, 50, 32, 43, 62, 70, -1, 40,
+	42, 43, 53, 62, 61, 51, 33, 44, 63, 71, 60, 41,
+	43, 44, 54, 63, 62, 52, 34, 45, 64, 72, 61, 42,
+	44, 45, 55, 64, 63, 53, 35, 46, 65, 73, 62, 43,
+	45, 46, 56, 65, 64, 54, 36, 47, 66, 74, 63, 44,
+	46, 47, 57, 66, 65, 55, 37, 48, 67, 75, 64, 45,
+	47, 48, 58, 67, 66, 56, 38, 49, 68, 76, 65, 46,
+	48, 49, 59, 68, 67, 57, 39, -1, 69, 77, 66, 47,
+	49, -1, -1, 69, 68, 58, -1, -1, -1, 78, 67, 48,
+	50, 51, 61, 70, -1, -1, 41, 52, 71, -1, -1, -1,
+	51, 52, 62, 71, 70, 60, 42, 53, 72, 80, -1, 50,
+	52, 53, 63, 72, 71, 61, 43, 54, 73, 81, 70, 51,
+	53, 54, 64, 73, 72, 62, 44, 55, 74, 82, 71, 52,
+	54, 55, 65, 74, 73, 63, 45, 56, 75, 83, 72, 53,
+	55, 56, 66, 75, 74, 64, 46, 57, 76, 84, 73, 54,
+	56, 57, 67, 76, 75, 65, 47, 58, 77, 85, 74, 55,
+	57, 58, 68, 77, 76, 66, 48, 59, 78, 86, 75, 56,
+	58, 59, 69, 78, 77, 67, 49, -1, 79, 87, 76, 57,
+	59, -1, -1, 79, 78, 68, -1, -1, -1, 88, 77, 58,
+	60, 61, 71, 80, -1, -1, 51, 62, 81, -1, -1, -1,
+	61, 62, 72, 81, 80, 70, 52, 63, 82, 90, -1, 60,
+	62, 63, 73, 82, 81, 71, 53, 64, 83, 91, 80, 61,
+	63, 64, 74, 83, 82, 72, 54, 65, 84, 92, 81, 62,
+	64, 65, 75, 84, 83, 73, 55, 66, 85, 93, 82, 63,
+	65, 66, 76, 85, 84, 74, 56, 67, 86, 94, 83, 64,
+	66, 67, 77, 86, 85, 75, 57, 68, 87, 95, 84, 65,
+	67, 68, 78, 87, 86, 76, 58, 69, 88, 96, 85, 66,
+	68, 69, 79, 88, 87, 77, 59, -1, 89, 97, 86, 67,
+	69, -1, -1, 89, 88, 78, -1, -1, -1, 98, 87, 68,
+	70, 71, 81, 90, -1, -1, 61, 72, 91, -1, -1, -1,
+	71, 72, 82, 91, 90, 80, 62, 73, 92, -1, -1, 70,
+	72, 73, 83, 92, 91, 81, 63, 74, 93, -1, 90, 71,
+	73, 74, 84, 93, 92, 82, 64, 75, 94, -1, 91, 72,
+	74, 75, 85, 94, 93, 83, 65, 76, 95, -1, 92, 73,
+	75, 76, 86, 95, 94, 84, 66, 77, 96, -1, 93, 74,
+	76, 77, 87, 96, 95, 85, 67, 78, 97, -1, 94, 75,
+	77, 78, 88, 97, 96, 86, 68, 79, 98, -1, 95, 76,
+	78, 79, 89, 98, 97, 87, 69, -1, 99, -1, 96, 77,
+	79, -1, -1, 99, 98, 88, -1, -1, -1, -1, 97, 78,
+	80, 81, 91, -1, -1, -1, 71, 82, -1, -1, -1, -1,
+	81, 82, 92, -1, -1, 90, 72, 83, -1, -1, -1, 80,
+	82, 83, 93, -1, -1, 91, 73, 84, -1, -1, -1, 81,
+	83, 84, 94, -1, -1, 92, 74, 85, -1, -1, -1, 82,
+	84, 85, 95, -1, -1, 93, 75, 86, -1, -1, -1, 83,
+	85, 86, 96, -1, -1, 94, 76, 87, -1, -1, -1, 84,
+	86, 87, 97, -1, -1, 95, 77, 88, -1, -1, -1, 85,
+	87, 88, 98, -1, -1, 96, 78, 89, -1, -1, -1, 86,
+	88, 89, 99, -1, -1, 97, 79, -1, -1, -1, -1, 87,
+	89, -1, -1, -1, -1, 98, -1, -1, -1, -1, -1, 88
+};
+
+} // End of anonymous namespace
+
 } // End of Groovie namespace


Commit: fdafab949c657cf55e965b90e6bc09ceb117f398
    https://github.com/scummvm/scummvm/commit/fdafab949c657cf55e965b90e6bc09ceb117f398
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-10-29T00:45:55+03:00

Commit Message:
GROOVIE: Added override keyword

Changed paths:
    engines/groovie/music.h


diff --git a/engines/groovie/music.h b/engines/groovie/music.h
index a5fd537ee2..7a69749d56 100644
--- a/engines/groovie/music.h
+++ b/engines/groovie/music.h
@@ -213,7 +213,7 @@ public:
 
 protected:
 	virtual Common::String getFilename(uint32 fileref);
-	void updateVolume();
+	void updateVolume() override;
 	bool load(uint32 fileref, bool loop) override;
 	void unload(bool updateState = true) override;
 




More information about the Scummvm-git-logs mailing list