[Scummvm-devel] PS2 backend - up & running (almost)

Max Horn max at quendi.de
Wed Nov 5 16:01:37 CET 2008

Hi Max!

Am 03.11.2008 um 18:04 schrieb sunmax at libero.it:

> Hi there!
> (1)  AboutDialog ctr and (**iter) crash
> Ok, got it!
> _pluginObject is NULL
> in [ Plugin::getName() : base/plugins.cpp @50 ]
> even if the iterator is still valid. Trying to call
> a method on that [ _pluginObject->getName() ] causes
> the TLB fetch exception :-(
> Any idea on what may be causing that ?
> (I mean: valid iter, null object)

Valid iter, null object is nothing special: The list that is iterated  
there is a list of pointers, and of course it can contain NULL pointers.

For reference, the PS2 port does *not* use dynamic plugins, right? So  
then the code of StaticPluginProvider in base/plugins.cpp is involved.  
Which does several "new StaticPlugin" calls, maybe one of those fails  
due to low memory?

> If I see correctly, nothing changed in AboutDialog ctr
> from 0.12.0 so the root should be somewhere else.
> I assume this is a ScummVM PS2 exclusive bug ;-)
> Let me know if you need extra details, I'll be glad
> to provide them!
> Idem for get (**iter)->getCopyright :
> the first 2 iterations in AboutDialog ctr are fine,
> on the third it crashes. Can somebody explain me why
> with "getName()" we use member "." for the method,
> but "->" for getCopyright() ?
> They are both called on (**iter).

Well, (**iter) is an object of class Plugin (actually, of a subclass  
of Plugin), which implements the getName() method, hence you can write
But getCopyright() is a MetaEngine method, and it is invoked via an  
overloaded "->" operator, see the template class PluginSubclass in  
base/plugins.h -- thus, invoking getCopyright() involves "->".

> (2)  Uh, what's my backend again ?
> I think ScummVM PS2 is affected by Alzheimer, when I set
> "Theme Path:" using the dialog, then do "OK", since I am
> skeptical by nature I go back to check that it kept the
> path, but it actually says "None" :-(

Have you recently checked whether the code in backends/fs/ps2 works  
correctly? If not, that might explain it.

> Themes used to work on PS in 0.12.0 if you kept them in
> the folder where ScummVM was launched. It's no longer
> the case.

Well, themes are no referenced via a full path. In the past, you could  
have this in your .ini:
but now it really should be a full path, suitable as parameter for  
FSNode (and hence for Ps2FilesystemNode).


> (yeah, and as reported to me, clicking on "Misc/Theme"
>  crashes too)

Bad. Any indication as to where it crashes?

> (yeah, and it crashes on "Quit" too...)

You mean the "Quit" button in the launcher?

> Ok, last minute update: if I try to force the full path
> name in LoadTheme, something as dumb as:
> fileName =
>   "mass:/scummvm/scummvm-0.13.0svn/scummmodern.zip";

You should in theory be able to get the same effect by putting this  
into your .ini file:
  gui_theme= mass:/scummvm/scummvm-0.13.0svn/scummmodern.zip

> now it fails in unzip.cpp (@ 1380) where in the ZipArchive
> ctr unzOpen returns NULL for _zipFile.

Weird. Maybe it *is* a memory issue?  Also, what ZLIB version are you  
using / linking into ScummVM?

> Is my stupid hack doomed to fail ?
> (the file of course is there ;-)

Let's hope not, we just need to figure out why .zip file loading  


> button_0 : (damned Florida sun, it goes everywhere...)
>           ok, fresh boot, all the buttons are in place
>           N: we could use some space-saving and gain the
>           precious pixels between the buttons rows back
>           to the list

I just commited a change that should "fix" this (although I think the  
"old" GUI looked more or less the same ?).

> button_1 : closeup of "Load" - note: the color are wrong
>           "Load" is supposed to be disabled but it does
>           actually react to mouse over...

I tried to reproduce this but couldn't. I even tried deleting my  
config file, and started ScummVM with fresh settings, no go. Can you  
tell us how to reproduce this? Can you reproduce it on your desktop  

> button_2 : see? both "About" (enabled) and "Load" (dis-)
>           reacted on mouse over and they are both 1 extra
>           pixel up and left

I can not confirm the mouse over reaction in latest SVN (trunk rev  

I agree that the text look as if it was too far up. And in the  
horizontal case, I think it's actually a bug. I just commited a fix to  
graphics/font.cpp which makes this look a bit better, IMO.

But for vertical centering, I don't think this is a but. We center  
vertically based on the maximal upward and downward extent of any  
character in the font. If you also look at the "Options" button, the  
three buttons all have the same baseline; and in "Options", you  
clearly see that the baseline can't be pushed further down. On the  
other hand, the "About" button has no character that extend below the  
baseline, but it has several high characters that almost touch the  
upper border, which indeed causes it to look "too much up".

We could change the centering to work based on the characters actually  
in the string, but then the baselines of the four buttons would  
suddenly seem to jitter, which would also look wrong. I am afraid  
there really is no perfect solution to this... at least none I can  
think of.

> button_3 : moving the pointer out does not help, it stays
>           misplaced
> list_0 : yeah, this picture sucks, but shows the point:
>         see what the poor PS2 users are left to choose
>         games from?

Ahhhhhhh, so you were not talking about the game list in the launcher,  
but rather about the file browser. I see :). This should be fixed now,  
too, I get 8 rows or so now. Could probably get it up to 9 with some  
extra tweaking.

> (4)  Pixelformat
> I like the new GUI but it feels a bit slower on PS2 when
> moving the pointer around. Maybe my eyes are deceived cause
> the colors look wrong so my perception is different.

It's entirely possible that it's slower. Are you using the  
"antialiased" or the "normal" renderer? Switching to the latter (in  
the options dialog, "misc" tab) might speed up things a bit.

> I will
> get the latest SVN during the week-end (uff, 5 days to go)
> and of course implement the new pixelformat stuff ;-)

Good luck with all that. Your efforts certainly will help other  
porters a lot, so I appreciate it a lot! I'll try what I can to help  
you through it.


More information about the Scummvm-devel mailing list