[Scummvm-cvs-logs] scummvm master -> 19cac9bb11287f007edc1a8db0bc6b97ca5d98fa

bluegr md5 at scummvm.org
Fri Oct 7 02:01:30 CEST 2011


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

Summary:
189357dc9b SCI: Added some extra static selectors
19cac9bb11 SCI21: Some initial work on kBitmap


Commit: 189357dc9b7a7dd7bd20e7214eb0ebe9c5c9df85
    https://github.com/scummvm/scummvm/commit/189357dc9b7a7dd7bd20e7214eb0ebe9c5c9df85
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-10-06T16:52:28-07:00

Commit Message:
SCI: Added some extra static selectors

These aren't needed by the engine, but make debugging easier in games that
have no selector vocabulary

Changed paths:
    engines/sci/engine/static_selectors.cpp



diff --git a/engines/sci/engine/static_selectors.cpp b/engines/sci/engine/static_selectors.cpp
index cca4c47..8f33377 100644
--- a/engines/sci/engine/static_selectors.cpp
+++ b/engines/sci/engine/static_selectors.cpp
@@ -102,18 +102,28 @@ static const char * const sci2Selectors[] = {
 #endif
 
 static const SelectorRemap sciSelectorRemap[] = {
-	{    SCI_VERSION_0_EARLY,     SCI_VERSION_0_LATE,   "moveDone", 170 },
-	{    SCI_VERSION_0_EARLY,     SCI_VERSION_0_LATE,     "points", 316 },
-	{    SCI_VERSION_0_EARLY,     SCI_VERSION_0_LATE,      "flags", 368 },
-	{    SCI_VERSION_1_EARLY,     SCI_VERSION_1_LATE,    "nodePtr",  44 },
-	{     SCI_VERSION_1_LATE,     SCI_VERSION_1_LATE, "cantBeHere",  57 },
-	{    SCI_VERSION_1_EARLY,     SCI_VERSION_1_LATE,  "topString", 101 },
-	{    SCI_VERSION_1_EARLY,     SCI_VERSION_1_LATE,      "flags", 102 },
+	{    SCI_VERSION_0_EARLY,     SCI_VERSION_0_LATE,   "moveDone",  170 },
+	{    SCI_VERSION_0_EARLY,     SCI_VERSION_0_LATE,     "points",  316 },
+	{    SCI_VERSION_0_EARLY,     SCI_VERSION_0_LATE,      "flags",  368 },
+	{    SCI_VERSION_1_EARLY,     SCI_VERSION_1_LATE,    "nodePtr",   44 },
+	{     SCI_VERSION_1_LATE,     SCI_VERSION_1_LATE, "cantBeHere",   57 },
+	{    SCI_VERSION_1_EARLY,     SCI_VERSION_1_LATE,  "topString",  101 },
+	{    SCI_VERSION_1_EARLY,     SCI_VERSION_1_LATE,      "flags",  102 },
 	// SCI1.1
-	{        SCI_VERSION_1_1,        SCI_VERSION_1_1,    "nodePtr",  41 },
-	{        SCI_VERSION_1_1,        SCI_VERSION_1_1, "cantBeHere",  54 },
-	{        SCI_VERSION_1_1,        SCI_VERSION_2_1,     "-info-",4103 },
-	{ SCI_VERSION_NONE,             SCI_VERSION_NONE,            0,   0 }
+	{        SCI_VERSION_1_1,        SCI_VERSION_1_1,    "nodePtr",   41 },
+	{        SCI_VERSION_1_1,        SCI_VERSION_1_1, "cantBeHere",   54 },
+	// The following are not really needed. They've only been defined to
+	// ease game debugging.
+	{        SCI_VERSION_1_1,        SCI_VERSION_2_1,    "-objID-", 4096 },
+	{        SCI_VERSION_1_1,        SCI_VERSION_2_1,     "-size-", 4097 },
+	{        SCI_VERSION_1_1,        SCI_VERSION_2_1, "-propDict-", 4098 },
+	{        SCI_VERSION_1_1,        SCI_VERSION_2_1, "-methDict-", 4099 },
+	{        SCI_VERSION_1_1,        SCI_VERSION_2_1, "-classScript-", 4100 },
+	{        SCI_VERSION_1_1,        SCI_VERSION_2_1,   "-script-", 4101 },
+	{        SCI_VERSION_1_1,        SCI_VERSION_2_1,    "-super-", 4102 },
+	//
+	{        SCI_VERSION_1_1,        SCI_VERSION_2_1,     "-info-", 4103 },
+	{ SCI_VERSION_NONE,             SCI_VERSION_NONE,            0,    0 }
 };
 
 struct ClassReference {


Commit: 19cac9bb11287f007edc1a8db0bc6b97ca5d98fa
    https://github.com/scummvm/scummvm/commit/19cac9bb11287f007edc1a8db0bc6b97ca5d98fa
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-10-06T16:52:30-07:00

Commit Message:
SCI21: Some initial work on kBitmap

Changed paths:
    engines/sci/engine/kernel.h
    engines/sci/engine/kernel_tables.h
    engines/sci/engine/kgraphics.cpp



diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index ff3c67c..b605908 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -476,6 +476,7 @@ reg_t kSetLanguage(EngineState *s, int argc, reg_t *argv);
 reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv);
 reg_t kSetFontRes(EngineState *s, int argc, reg_t *argv);
 reg_t kFont(EngineState *s, int argc, reg_t *argv);
+reg_t kBitmap(EngineState *s, int argc, reg_t *argv);
 #endif
 
 reg_t kDoSoundInit(EngineState *s, int argc, reg_t *argv);
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index b01fa9d..d3adcac 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -546,6 +546,7 @@ static SciKernelMapEntry s_kernelMap[] = {
 	{ MAP_CALL(ScrollWindow),      SIG_EVERYWHERE,           "(.*)",                  NULL,            NULL },
 	{ MAP_CALL(SetFontRes),        SIG_EVERYWHERE,           "ii",                    NULL,            NULL },
 	{ MAP_CALL(Font),              SIG_EVERYWHERE,           "i(.*)",                 NULL,            NULL },
+	{ MAP_CALL(Bitmap),            SIG_EVERYWHERE,           "(.*)",                  NULL,            NULL },
 
 	// SCI2.1 Empty Functions
 
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 0eda91b..9f309ae 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -1670,6 +1670,95 @@ reg_t kFont(EngineState *s, int argc, reg_t *argv) {
 	return s->r_acc;
 }
 
+reg_t kBitmap(EngineState *s, int argc, reg_t *argv) {
+	// Used for bitmap operations in SCI2.1 and SCI3.
+	// This is the SCI2.1 version, the functionality seems to have changed in SCI3.
+
+	switch (argv[0].toUint16()) {
+	case 0:	// init bitmap surface
+		{
+		// 6 params, called e.g. from TextView::init() in Torin's Passage,
+		// script 64890 and TransView::init() in script 64884
+		uint16 width = argv[1].toUint16();
+		uint16 height = argv[2].toUint16();
+		uint16 skip = argv[3].toUint16();
+		uint16 back = argv[4].toUint16();
+		uint16 width2 = (argc >= 6) ? argv[5].toUint16() : 0;
+		uint16 height2 = (argc >= 7) ? argv[6].toUint16() : 0;
+		uint16 transparent = (argc >= 8) ? argv[7].toUint16() : 0;
+		warning("kBitmap(0): width %d, height %d, skip %d, back %d, width2 %d, height2 %d, transparent %d",
+				width, height, skip, back, width2, height2, transparent);
+		// returns a pointer to a bitmap
+		}
+		break;
+	case 1:	// dispose bitmap surface
+		// 1 param, bitmap pointer, called e.g. from MenuItem::dispose
+		// in Torin's Passage, script 64893
+		warning("kBitmap(1), bitmap ptr %04x:%04x", PRINT_REG(argv[1]));
+		break;
+	case 2:	// dispose bitmap surface, with extra param
+		// 2 params, called e.g. from MenuItem::dispose in Torin's Passage,
+		// script 64893
+		warning("kBitmap(2), unk1 %d, bitmap ptr %04x:%04x", argv[1].toUint16(), PRINT_REG(argv[2]));
+		break;
+	case 3:	// tiled surface
+		{
+		// 6 params, called e.g. from TiledBitmap::resize() in Torin's Passage,
+		// script 64869
+		reg_t bitmapPtr = argv[1];	// obtained from kBitmap(0)
+		// The tiled view seems to always have 2 loops.
+		// These loops need to have 1 cel in loop 0 and 8 cels in loop 1.
+		uint16 view = argv[2].toUint16();	// vTiles selector
+		uint16 loop = argv[3].toUint16();
+		uint16 cel = argv[4].toUint16();
+		uint16 x = argv[5].toUint16();
+		uint16 y = argv[6].toUint16();
+		warning("kBitmap(3): bitmap ptr %04x:%04x, view %d, loop %d, cel %d, x %d, y %d",
+				PRINT_REG(bitmapPtr), view, loop, cel, x, y);
+		}
+		break;
+	case 4:	// process text
+		{
+		// 13 params, called e.g. from TextButton::createBitmap() in Torin's Passage,
+		// script 64894
+		reg_t bitmapPtr = argv[1];	// obtained from kBitmap(0)
+		Common::String text = s->_segMan->getString(argv[2]);
+		// unk3
+		// unk4
+		// unk5
+		// unk6
+		// skip?
+		// back?
+		uint16 font = argv[9].toUint16();
+		uint16 mode = argv[10].toUint16();
+		// unk
+		uint16 dimmed = argv[12].toUint16();
+		warning("kBitmap(4): bitmap ptr %04x:%04x, font %d, mode %d, dimmed %d - text: \"%s\"",
+				PRINT_REG(bitmapPtr), font, mode, dimmed, text.c_str());
+		}
+		break;
+	case 5:
+		{
+		// 6 params, called e.g. from TextView::init() and TextView::draw()
+		// in Torin's Passage, script 64890
+		reg_t bitmapPtr = argv[1];	// obtained from kBitmap(0)
+		uint16 unk1 = argv[2].toUint16();	// unknown, usually 0, judging from scripts?
+		uint16 unk2 = argv[3].toUint16();	// unknown, usually 0, judging from scripts?
+		uint16 width = argv[4].toUint16();	// width - 1
+		uint16 height = argv[5].toUint16();	// height - 1
+		uint16 back = argv[6].toUint16();
+		warning("kBitmap(5): bitmap ptr %04x:%04x, unk1 %d, unk2 %d, width %d, height %d, back %d",
+				PRINT_REG(bitmapPtr), unk1, unk2, width, height, back);
+		}
+		break;
+	default:
+		kStub(s, argc, argv);
+		break;
+	}
+
+	return s->r_acc;
+}
+
 #endif
 
 } // End of namespace Sci






More information about the Scummvm-git-logs mailing list