[Scummvm-devel] Bugs blocking the DS port: SAGA Engine font loading crash, Options menus crash, GMM load/save crash

Neil Millstone neil at millstone.demon.co.uk
Sun May 15 12:46:01 CEST 2011


Hi Team,

I wonder if anyone could offer me some input onto three crash bug which 
I'm looking at right now for the DS port.  These are all in areas of the 
code that I'm not familiar with so I'd like to get some input from the 
authors, if possible.  I'm cc'ing who I think are the authors.

1.

Inherit the Earth in the Saga engine now doesn't run on the DS, crashing 
to a white screen (it's a wierd kind of crash which I can't trap).

I spent hours reverting to older versions of ScummVM and building until 
I came accross the commit that broke the build.  It's this one:

* SAGA: replace Font "::*alloc" & "::free" with Common::Array
https://github.com/scummvm/scummvm/commit/1bd1a253f0bdc063b4795a68fab52e2d98d2f181

I can't see any problems with it, but if someone who knows the code 
better than me can take a look at it, I would be very grateful.


2.

In gui/options.cpp, closing any options dialog crashes the game (by 
running out of RAM).

I tracked this down to this code in OptionsDialog::handleCommand():

case kCloseCmd:
         if (g_gui.theme()->getThemeId() != _oldTheme) {
             g_gui.loadNewTheme(_oldTheme);
             ConfMan.set("gui_theme", _oldTheme);
         }
         close();
         break;

This looks like it's intended to reload the theme if the selection was 
changed.  For me, the g_gui.theme()->getThemeId() returns the name of 
the modern theme, while _oldTheme specifies 'builtin'.  This causes the 
'builtin' theme to be reloaded, crashing ScummVM due to lack of memory.

ScummVM DS always uses the 'builtin' theme due to memory constraints.

I have fixed this (for me) by changing the following in 
OptionsDialog::init()

     _oldTheme = ConfMan.get("gui_theme");
becomes
     _oldTheme = g_gui.theme()->getThemeId();

I  haven't got a way of testing this on other ports, so if somebody 
could advice me if this is sensible, I'll make the change.


3.

The third bug I have is the Global Main Menu save/load dialogs.  These 
crash the DS with an out of memory error every time they are used.  I've 
tested this using BASS and LURE, both of which have plenty of memory 
free.  Has there been a big increase in the amount of RAM these use?

If anyone can point me in the right direction, I'll look into a fix.


Thanks for everyone's help!


Cheers,


- Neil (agentq)





More information about the Scummvm-devel mailing list