[Scummvm-cvs-logs] SF.net SVN: scummvm:[47694] scummvm/trunk/engines/sci/engine
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sat Jan 30 02:46:00 CET 2010
Revision: 47694
http://scummvm.svn.sourceforge.net/scummvm/?rev=47694&view=rev
Author: thebluegr
Date: 2010-01-30 01:45:59 +0000 (Sat, 30 Jan 2010)
Log Message:
-----------
Added support for String types to kFormat (seems to work but needs testing...)
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kernel32.cpp
scummvm/trunk/engines/sci/engine/kstring.cpp
Modified: scummvm/trunk/engines/sci/engine/kernel32.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel32.cpp 2010-01-30 01:14:25 UTC (rev 47693)
+++ scummvm/trunk/engines/sci/engine/kernel32.cpp 2010-01-30 01:45:59 UTC (rev 47694)
@@ -617,15 +617,7 @@
warning("kString(Printf)");
break;
case 12: // Printf Buf
- if (argc == 3)
- return kFormat(s, argc - 1, argv + 1);
- else
- // TODO
- // For some reason, argc > 3 crashes, e.g. in Torin full (there's a format
- // string %s%s, but the string passed for the first %s is invalid). Perhaps
- // a list is passed in this case?
- warning("kString(PrintBuf) - parameter count %d not supported", argc);
- break;
+ return kFormat(s, argc - 1, argv + 1);
case 13: { // atoi
Common::String string = s->_segMan->getString(argv[1]);
return make_reg(0, (uint16)atoi(string.c_str()));
Modified: scummvm/trunk/engines/sci/engine/kstring.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kstring.cpp 2010-01-30 01:14:25 UTC (rev 47693)
+++ scummvm/trunk/engines/sci/engine/kstring.cpp 2010-01-30 01:45:59 UTC (rev 47694)
@@ -28,6 +28,7 @@
#include "sci/resource.h"
#include "sci/engine/state.h"
#include "sci/engine/message.h"
+#include "sci/engine/selector.h"
#include "sci/engine/kernel.h"
namespace Sci {
@@ -270,6 +271,11 @@
switch (xfer) {
case 's': { /* Copy string */
reg_t reg = argv[startarg + paramindex];
+ if (s->_segMan->isObject(reg)) {
+ Selector slc = s->_kernel->findSelector("data"); // TODO: place in selector table
+ reg = read_selector(s->_segMan, reg, slc);
+ }
+
Common::String tempsource = (reg == NULL_REG) ? "" : kernel_lookup_text(s, reg,
arguments[paramindex + 1]);
int slen = strlen(tempsource.c_str());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list