[Scummvm-git-logs] scummvm master -> ab4131fd5ceab38a861f29f523fb96234c23dc51
sev-
sev at scummvm.org
Sat Oct 23 16:55:11 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:
be64198410 GROOVIE: Made o_sleep() non-blocking
eca09acb7c GROOVIE: Added skeleton for Triangle puzzle
ab4131fd5c GROOVIE: Some cleanup to Beehive puzzle logic
Commit: be64198410752415909de761e34ccbc58ae8d83f
https://github.com/scummvm/scummvm/commit/be64198410752415909de761e34ccbc58ae8d83f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-10-23T19:54:57+03:00
Commit Message:
GROOVIE: Made o_sleep() non-blocking
Changed paths:
engines/groovie/script.cpp
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index 4bf8ad233e..d103c96718 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -1124,7 +1124,14 @@ void Script::o_sleep() {
debugC(1, kDebugScript, "Groovie::Script: SLEEP 0x%04X (%d ms)", time, time*3);
- _vm->_system->delayMillis(time * 3);
+ uint32 endTime = _vm->_system->getMillis() + time * 3;
+
+ Common::Event ev;
+ while (_vm->_system->getMillis() < endTime) {
+ _vm->_system->getEventManager()->pollEvent(ev);
+ _vm->_system->updateScreen();
+ _vm->_system->delayMillis(10);
+ }
}
void Script::o_strcmpnejmp() { // 0x1A
Commit: eca09acb7c07698c86ecbb4917305c1162d2f34a
https://github.com/scummvm/scummvm/commit/eca09acb7c07698c86ecbb4917305c1162d2f34a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-10-23T19:54:57+03:00
Commit Message:
GROOVIE: Added skeleton for Triangle puzzle
Changed paths:
A engines/groovie/logic/triangle.cpp
A engines/groovie/logic/triangle.h
engines/groovie/module.mk
engines/groovie/script.cpp
engines/groovie/script.h
diff --git a/engines/groovie/logic/triangle.cpp b/engines/groovie/logic/triangle.cpp
new file mode 100644
index 0000000000..74c1414267
--- /dev/null
+++ b/engines/groovie/logic/triangle.cpp
@@ -0,0 +1,127 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "groovie/groovie.h"
+#include "groovie/logic/triangle.h"
+
+namespace Groovie {
+
+namespace {
+extern const int8 triangleLookup1[12];
+extern const int8 triangleLookup2[12];
+extern const int8 triangleLookup3[12];
+extern const int8 beehiveLogicTable2[800];
+}
+
+TriangleGame::TriangleGame() {
+}
+
+void TriangleGame::run(byte *scriptVariables) {
+}
+
+namespace {
+
+const int8 triangleLookup1[12] = {
+ 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66
+};
+
+const int8 triangleLookup2[12] = {
+ 0, 2, 5, 9, 14, 20, 27, 35, 44, 54, 65, 66
+};
+
+const int8 triangleLookup3[12] = {
+ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66
+};
+
+const int8 triangleLogicTable[924] = {
+ -1, -1, 2, 1, -1, -1, 0, 0, 10, 10, 6, 0, 10, 10,
+ 0, 2, 4, 3, -1, -1, 0, 1, 9, 9, 5, 1, 9, 9,
+ -1, -1, 5, 4, 1, 0, 1, 0, 9, 11, 5, 1, 9, 9,
+ 1, 4, 7, 6, -1, -1, 0, 2, 8, 8, 4, 2, 8, 8,
+ 2, 5, 8, 7, 3, 1, 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, 34, 26, 20, 6, 0, 4, 16, 3, 6, 4, 6,
+ 21, 29, 37, 36, -1, -1, 0, 7, 3, 3, 3, 7, 7, 3,
+ 22, 30, 38, 37, 28, 21, 1, 6, 3, 5, 2, 6, 6, 3,
+ 23, 31, 39, 38, 29, 22, 2, 5, 3, 7, 1, 5, 5, 3,
+ 24, 32, 40, 39, 30, 23, 3, 4, 3, 9, 0, 4, 4, 3,
+ 25, 33, 41, 40, 31, 24, 4, 3, 3, 11, 0, 4, 3, 4,
+ 26, 34, 42, 41, 32, 25, 5, 2, 3, 13, 1, 5, 3, 5,
+ 27, 35, 43, 42, 33, 26, 6, 1, 3, 15, 2, 6, 3, 6,
+ -1, -1, 44, 43, 34, 27, 7, 0, 3, 17, 3, 7, 3, 7,
+ 28, 37, 46, 45, -1, -1, 0, 8, 2, 2, 4, 8, 8, 2,
+ 29, 38, 47, 46, 36, 28, 1, 7, 2, 4, 3, 7, 7, 2,
+ 30, 39, 48, 47, 37, 29, 2, 6, 2, 6, 2, 6, 6, 2,
+ 31, 40, 49, 48, 38, 30, 3, 5, 2, 8, 1, 5, 5, 3,
+ 32, 41, 50, 49, 39, 31, 4, 4, 2, 10, 1, 4, 4, 4,
+ 33, 42, 51, 50, 40, 32, 5, 3, 2, 12, 1, 5, 3, 5,
+ 34, 43, 52, 51, 41, 33, 6, 2, 2, 14, 2, 6, 2, 6,
+ 35, 44, 53, 52, 42, 34, 7, 1, 2, 16, 3, 7, 2, 7,
+ -1, -1, 54, 53, 43, 35, 8, 0, 2, 18, 4, 8, 2, 8,
+ 36, 46, 56, 55, -1, -1, 0, 9, 1, 1, 5, 9, 9, 1,
+ 37, 47, 57, 56, 45, 36, 1, 8, 1, 3, 4, 8, 8, 1,
+ 38, 48, 58, 57, 46, 37, 2, 7, 1, 5, 3, 7, 7, 2,
+ 39, 49, 59, 58, 47, 38, 3, 6, 1, 7, 2, 6, 6, 3,
+ 40, 50, 60, 59, 48, 39, 4, 5, 1, 9, 2, 5, 5, 4,
+ 41, 51, 61, 60, 49, 40, 5, 4, 1, 11, 2, 5, 4, 5,
+ 42, 52, 62, 61, 50, 41, 6, 3, 1, 13, 2, 6, 3, 6,
+ 43, 53, 63, 62, 51, 42, 7, 2, 1, 15, 3, 7, 2, 7,
+ 44, 54, 64, 63, 52, 43, 8, 1, 1, 17, 4, 8, 1, 8,
+ -1, -1, 65, 64, 53, 44, 9, 0, 1, 19, 5, 9, 1, 9,
+ 45, 56, -1, -1, -1, -1, 0, 10, 0, 0, 6, 10, 10, 0,
+ 46, 57, -1, -1, 55, 45, 1, 9, 0, 2, 5, 9, 9, 1,
+ 47, 58, -1, -1, 56, 46, 2, 8, 0, 4, 4, 8, 8, 2,
+ 48, 59, -1, -1, 57, 47, 3, 7, 0, 6, 3, 7, 7, 3,
+ 49, 60, -1, -1, 58, 48, 4, 6, 0, 8, 3, 6, 6, 4,
+ 50, 61, -1, -1, 59, 49, 5, 5, 0, 10, 3, 5, 5, 5,
+ 51, 62, -1, -1, 60, 50, 6, 4, 0, 12, 3, 6, 4, 6,
+ 52, 63, -1, -1, 61, 51, 7, 3, 0, 14, 3, 7, 3, 7,
+ 53, 64, -1, -1, 62, 52, 8, 2, 0, 16, 4, 8, 2, 8,
+ 54, 65, -1, -1, 63, 53, 9, 1, 0, 18, 5, 9, 1, 9,
+ -1, -1, -1, -1, 64, 54, 10, 0, 0, 20, 6, 10, 0, 10
+};
+
+} // End of anonymous namespace
+
+
+} // End of Groovie namespace
diff --git a/engines/groovie/logic/triangle.h b/engines/groovie/logic/triangle.h
new file mode 100644
index 0000000000..34e64be60f
--- /dev/null
+++ b/engines/groovie/logic/triangle.h
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef GROOVIE_LOGIC_TRIANGLE_H
+#define GROOVIE_LOGIC_TRIANGLE_H
+
+#include "common/random.h"
+#include "common/system.h"
+
+namespace Groovie {
+
+class TriangleGame {
+public:
+ TriangleGame();
+ void run(byte *scriptVariables);
+};
+
+} // End of Groovie namespace
+
+#endif // GROOVIE_LOGIC_TRIANGLE_H
diff --git a/engines/groovie/module.mk b/engines/groovie/module.mk
index 0959f512a7..a83d748819 100644
--- a/engines/groovie/module.mk
+++ b/engines/groovie/module.mk
@@ -23,6 +23,7 @@ MODULE_OBJS += \
logic/gallery.o \
logic/mousetrap.o \
logic/tlcgame.o \
+ logic/triangle.o \
video/roq.o
endif
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index d103c96718..c30db233ab 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -2098,7 +2098,7 @@ void Script::o_gamelogic() {
_gallery.run(_variables);
break;
case 4: // 11H Triangle puzzle in the chapel (tx.grv)
- // TODO
+ _triangle.run(_variables);
break;
case 5: // 11H/UHP Mouse trap puzzle in the lab (al.grv)
_mouseTrap.run(_variables);
diff --git a/engines/groovie/script.h b/engines/groovie/script.h
index 305a4b0d26..e65b185fb2 100644
--- a/engines/groovie/script.h
+++ b/engines/groovie/script.h
@@ -29,6 +29,7 @@
#include "groovie/logic/cake.h"
#include "groovie/logic/gallery.h"
#include "groovie/logic/mousetrap.h"
+#include "groovie/logic/triangle.h"
#endif
#include "common/random.h"
@@ -267,6 +268,7 @@ private:
CakeGame _cake;
GalleryGame _gallery;
MouseTrapGame _mouseTrap;
+ TriangleGame _triangle;
#endif
};
Commit: ab4131fd5ceab38a861f29f523fb96234c23dc51
https://github.com/scummvm/scummvm/commit/ab4131fd5ceab38a861f29f523fb96234c23dc51
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-10-23T19:54:57+03:00
Commit Message:
GROOVIE: Some cleanup to Beehive puzzle logic
Changed paths:
engines/groovie/logic/beehive.cpp
diff --git a/engines/groovie/logic/beehive.cpp b/engines/groovie/logic/beehive.cpp
index e65cd73566..d097bb795b 100644
--- a/engines/groovie/logic/beehive.cpp
+++ b/engines/groovie/logic/beehive.cpp
@@ -68,7 +68,7 @@ void BeehiveGame::run(byte *scriptVariables) {
sub02(&v22, tempState);
if (v22) {
for (int i = 0; i < v22; i++)
- scriptVariables[tempState[i] + 25] = 1;
+ scriptVariables[tempState[i] + 25] = kBeehiveColorRed;
} else {
*hexDifference = getHexDifference();
}
@@ -80,8 +80,8 @@ void BeehiveGame::run(byte *scriptVariables) {
v24 = 10 * scriptVariables[0] + scriptVariables[1];
sub18(v24, &v22, tempState);
for (int j = 0; j < v22; j++)
- scriptVariables[tempState[j] + 25] = 1;
- scriptVariables[v24 + 25] = 1;
+ scriptVariables[tempState[j] + 25] = kBeehiveColorRed;
+ scriptVariables[v24 + 25] = kBeehiveColorRed;
return;
case 3:
@@ -164,7 +164,7 @@ void BeehiveGame::sub02(int8 *a1, int8 *a2) {
}
}
- for (int i = 0; i < 12; ++i) {
+ for (int i = 0; i < 12; i++) {
if (v3)
break;
More information about the Scummvm-git-logs
mailing list