[Scummvm-devel] PS2 : stack madness

Max Horn max at quendi.de
Thu Apr 2 15:10:30 CEST 2009

Am 01.04.2009 um 23:06 schrieb sunmax at libero.it:

> Hi there ScummVM Team!
> @ Max // hashmap
> PS2 GCC 3.2.2 cross-compiler ICEs when trying to compile some code.
> It's specifically _drawFunctions template instantiated by  
> ThemeParser ctr.
> Common::HashMap<Common::String, DrawingFunctionCallback,
> Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _drawFunctions;
> GCC 3.2.2 does not like the "DrawingFunctionCallback" part of it.

Aha. While that is still weird, that might be a hint at the cause of  
the ICE / stack corruption, and how to workaround it. Apparently,  
method pointers like that don't quite work right.


> Since that's the portion that GCC is icing on, and that we are hacking
> on PS2 to work by commenting out the _defaultVal ctr, I am inclined to
> think that bogus code is produced when compiling that.

Quite possible.

> Max, to prove my theory: is there anyway to run ScummVM without -any-
> theme? I mean not only disabling the "fancy themes" like on DS, but a
> straight shot to the game?
> Does the GMM always require a theme to be loaded?

Without a theme, you can't draw any GUI. Hence, the best you could do  
is to disable the launcher, GMM, F5 dialog in SCUMM etc., i.e.  
everything using the GUI for anything. That doesn't really help :).

A better way will be to rewrite the draw step dispatching code, which  
I think is a good idea anyway ;).

I'll take a look at rewriting that code and sending you a patch for  
testing whether that helps.

> If this is true (I am still not 100% sure, but it seems to explain a
> few things) the cleanest solution would be to upgrade PS2 toolchains
> and core libs, which I won't be able to get in place before the end
> of the Summer. So all other suggestions are welcome!

I think this is a good idea in any case, *on the long run* at least ;).


>>> Last but not least: You prolly noticed that I set up this buildbot
>>> thingy. Are you interested in setting up the PS2 toolchain on that
>>> Linux server?
> Yes, I am aware of it and it's on my TODO list.
> - does it require the backend to be "configure"-friendly or the
>   current hacked Makefile.ps2 would work with it ?

We would prefer if the backend was "configure"-friendly, and we  
already converted several backends to do that (DC, Wii, PSP, ...) and  
I hope to get this working for the NDS (after the 0.13.1 release  
maybe, i.e. after Neil's next set of changes, which I would merge into  
trunk after he commits them. Unless he merges them himself, of  
course... ;).

> - what's the complexity of getting the PS2 toolchain on it ?

Should be the same complexity as getting it to any other linux machine.

I.e., *you* know more about the complexity than anybody else on the  
team ;).

> I am not really lazy, but my first priority is the user base and
> to provide them with a crash free ScummVM experience. If current
> PS2 gcc and toolchains are buggy I would rather focus on that
> so that we have a bit more recent ones asap to integrate on
> the buildbot server and produce more robust ELF.

Fair enough. I think that on the long run, having PS2 builds on the  
buildbot will help us improve stability, but since your time is  
limited, you should distribute the way you deem best :)

> Anyway if it's a minor task and you think it might help any way,
> just let me know how I can assist with that.

Again, how "minor" or "major" is depends on factors you know better  
than most of us. I am sure Andre (and others?) will be happy to  
discuss details with you.


More information about the Scummvm-devel mailing list