Added the SCI2.1 kText kernel function (subop 0, kTextSize for now)

svn-id: r50265
This commit is contained in:
Filippos Karapetis 2010-06-25 14:50:10 +00:00
parent 494a7fa8ab
commit df37aff357
3 changed files with 17 additions and 4 deletions

View File

@ -357,6 +357,8 @@ static SciKernelFunction s_kernelFuncMap[] = {
{ "TextColors", kTextColors, ".*" },
{ "TextFonts", kTextFonts, ".*" },
{ "Portrait", kPortrait, ".*" },
{ "PalVary", kPalVary, "ii*" },
{ "AssertPalette", kAssertPalette, "i" },
{ "Empty", kEmpty, ".*" },
#ifdef ENABLE_SCI32
@ -389,13 +391,10 @@ static SciKernelFunction s_kernelFuncMap[] = {
{ "PlayVMD", kPlayVMD, ".*" },
{ "IsOnMe", kIsOnMe, "iio.*" },
{ "MulDiv", kMulDiv, "iii" },
{ "Text", kText, ".*" },
#endif
// its a stub, but its needed for Pharkas to work
{ "PalVary", kPalVary, "ii*" },
{ "AssertPalette", kAssertPalette, "i" },
#if 0
// Stub functions
/*09*/ { "Show", kShow, "i" },

View File

@ -439,6 +439,7 @@ reg_t kOnMe(EngineState *s, int argc, reg_t *argv);
reg_t kInPolygon(EngineState *s, int argc, reg_t *argv);
// SCI2.1 Kernel Functions
reg_t kText(EngineState *s, int argc, reg_t *argv);
reg_t kSave(EngineState *s, int argc, reg_t *argv);
reg_t kList(EngineState *s, int argc, reg_t *argv);
reg_t kRobot(EngineState *s, int argc, reg_t *argv);

View File

@ -511,6 +511,19 @@ reg_t kArray(EngineState *s, int argc, reg_t *argv) {
return NULL_REG;
}
reg_t kText(EngineState *s, int argc, reg_t *argv) {
switch (argv[0].toUint16()) {
case 0:
return kTextSize(s, argc - 1, argv + 1);
break;
default:
warning("kText(%d)", argv[0].toUint16());
break;
}
return s->r_acc;
}
reg_t kString(EngineState *s, int argc, reg_t *argv) {
switch (argv[0].toUint16()) {
case 0: { // New