[Scummvm-devel] LUA on WinCE and PS2

Max Horn max at quendi.de
Thu May 19 11:17:09 CEST 2011

Am 19.05.2011 um 08:48 schrieb Filippos Karapetis:

>> A small update about the non-compiling sword25 engine which currently blocks buildbot builds of the WinCE port:
> Wow, the WinCE SDK is really mussing a lot of functionality...

Not really. It's very normal to not have these APIs. Most of them are either highly POSIX centric (tmpfile, getenv, system; and to a high degree strcoll, if you consider that before strcoll was introduced, many systems handled locales in different ways from each other).

>> There are some other functions used in the lua code which don't exist on WinCE; maybe some (all?) of them should be also added to common/forbidden.h, but before doing this on my own, I'd like to know if you agree with the following list:

The list of forbidden symbols sadly won't affect lua, because the lua code does not include common/scummsys.h and hence does not include common/forbidden.h, either. That's the only reason Lua still compiles on master.

>> tmpfile (liolib.cpp:171)
> Well, this one has specialized usage, mostly for renaming.

It is already in the list of forbidden symbols (at least on master) anyway. No engine should use it. No engine should rename files, for that matter, other than savestates (and for that it should use the savefile manager).

>> getenv (loadlib.cpp:415 & loslib.cpp:49)
> I believe that this one is used to find the user path to save scummvm.ini

This is not yet among the forbidden symbols, but the plan always was to have it there eventually. A few backend files use it, and base/commandLine.cpp does -- but there is absolutely no reason for any engine to use it, and indeed, Lua is the only code in engines/ that uses it.

>> system (loslib.cpp:22)
>> clock (loslib.cpp:55)
> This might be used for the savegame timestamps in sword25, can't test
> it now though

Both are already on the list of forbidden symbols. There is no excuse for using system, which is meant to execute commands via a *shell*. Why would an adventure game engine need to do this???

And clock is not suitable for savegame timestamps (assuming you meant "time and date the savegame" was made). It's nearest equivalent in ScummVM is OSystem::getMillis.

>> strcoll (lvm.cpp:205)
> This could be substituted with strcmp, if it's missing?

Indeed, we don't support or use locales in our engines at this time. It seems that on Android, the lua headers already replace strcoll by strcmp.


More information about the Scummvm-devel mailing list