Harmattan port?

Discussion about other and unofficial ports of ScummVM

Moderator: ScummVM Team

User avatar
andei
Posts: 18
Joined: Wed May 02, 2012 7:45 pm
Location: Finland

Post by andei »

I think I figured out why those nasty scaler / aspect ratio problems are happening. Right now unpatched ScummVM crashes with the following error:

Code: Select all

scummvm: graphics/scaler.cpp:209: void Normal2x(const uint8*, uint32, uint8*, uint32, int, int): Assertation '((((size_t)dstPtr) & ((4) - 1)) == 0)' failed.
Aborted (core dumped)
This is caused by small x11-fix-event-coordinates patch used in the official Harmattan SDL library. It always sets window size to full N9 screen resolution, but I suspect ScummVM prefers to choose its own window sizes. Without the SDL patch all video options work, but then of course touchscreen coordinates tracking is way off.

So either this has to be worked around in ScummVM or a different Harmattan SDL coordinates fix is needed. I'm not sure which is more feasible... and both tasks look too complex for me to tackle alone. Would anyone like to help out?

Please? Pretty please? Please pretty please with sugar on top? :D
User avatar
LordHoto
ScummVM Developer
Posts: 1029
Joined: Sun Oct 30, 2005 3:58 pm
Location: Germany

Post by LordHoto »

andei wrote:I think I figured out why those nasty scaler / aspect ratio problems are happening. Right now unpatched ScummVM crashes with the following error:

Code: Select all

scummvm: graphics/scaler.cpp:209: void Normal2x(const uint8*, uint32, uint8*, uint32, int, int): Assertation '((((size_t)dstPtr) & ((4) - 1)) == 0)' failed.
Aborted (core dumped)
This is caused by small x11-fix-event-coordinates patch used in the official Harmattan SDL library. It always sets window size to full N9 screen resolution, but I suspect ScummVM prefers to choose its own window sizes. Without the SDL patch all video options work, but then of course touchscreen coordinates tracking is way off.

So either this has to be worked around in ScummVM or a different Harmattan SDL coordinates fix is needed. I'm not sure which is more feasible... and both tasks look too complex for me to tackle alone. Would anyone like to help out?

Please? Pretty please? Please pretty please with sugar on top? :D
That assertion shows that the destination buffer is not aligned on (at least) a 4 byte boundary. You will need to assure that to allow the Normal2x scaler to work fine.
Orologiaio
Posts: 13
Joined: Thu Jan 05, 2012 3:16 pm

Post by Orologiaio »

I don't know if it is related to this scaler issue, but I'm not able to play The Curse of Monkey Island, it says it can't switch to 640x480.

I also noticed a small graphical glitch in the title scene of Indiana Jones and the Fate of Atlantis, with SuperSAL2x filter on. The zooming "Indiana Jones" title acts strangely till its fully zoomed. The game is however fully playable so far.
User avatar
andei
Posts: 18
Joined: Wed May 02, 2012 7:45 pm
Location: Finland

Post by andei »

Orologiaio, The Curse of Monkey Island not working is definitely related to the same issue. :( Right now the Harmattan port can't switch resolutions, so only games with 320x200 pixel original graphics work. If anyone knows how to fix this, please post a patch. It might take a while for me to figure it out.

And thanks LordHoto, I kind of understand... at least in some level. But not well enough, so tomorrow it's library time. Section: big and heavy programming books. I'm beginning to realize I may have jumped into the pool without first learning to swim properly.

Feel free throw a second lifebuoy at any time!
User avatar
Freddo
Posts: 287
Joined: Mon Oct 31, 2005 4:41 pm

Post by Freddo »

Here is a small blog entry about the scaling routine that I guess anotherguest use for the Symbian port. No idea if it will help or not.
http://www.summeli.fi/?p=1227

Would it be possible to let ScummVM always work at 640x480 and then upscale the 320x200 games to 640x480?
User avatar
tsoliman
ScummVM Developer
Posts: 404
Joined: Wed Jan 19, 2011 3:47 pm
Location: USA

Post by tsoliman »

andei wrote:Right now the Harmattan port can't switch resolutions, so only games with 320x200 pixel original graphics work.
The solution is to use OpenGL instead of SDL surface (what Maemo is using now)

I currently don't have a N9 or a N900 which would both be good candidates to develop this for.

(my N810 doesn't have any OpenGL support AFAIK)
User avatar
LordHoto
ScummVM Developer
Posts: 1029
Joined: Sun Oct 30, 2005 3:58 pm
Location: Germany

Post by LordHoto »

tsoliman wrote:
andei wrote:Right now the Harmattan port can't switch resolutions, so only games with 320x200 pixel original graphics work.
The solution is to use OpenGL instead of SDL surface (what Maemo is using now)

I currently don't have a N9 or a N900 which would both be good candidates to develop this for.

(my N810 doesn't have any OpenGL support AFAIK)
Using the current OpenGL code is at your own risk though, it might get fully replaced without any warning.
User avatar
andei
Posts: 18
Joined: Wed May 02, 2012 7:45 pm
Location: Finland

Post by andei »

tsoliman wrote:The solution is to use OpenGL instead of SDL surface (what Maemo is using now)
Hmm, I was afraid of that. Took a peek at the OpenGL enabled Android port and suddenly heard this eerie voice repeating, "You must not go there... you must not go there...". Scary complicated stuff. :shock:

I'm going to remove that x11-fix-event-coordinates patch and try to figure out a way to replicate it's functionality in ScummVM friendly fashion. Hopefully that will get SDL surface working better.

And thanks for the blog link Freddo - I'll look into that too.
User avatar
andei
Posts: 18
Joined: Wed May 02, 2012 7:45 pm
Location: Finland

Post by andei »

Here's an updated Nokia N9 port for testing:

scummvm_1.4.1_armel.deb

And here are the sources and a patch for SDL:

scummvm-1.4.1-harmattan_10052012.diff.gz
x11-alt-fix-event-coordinates.gz

A modified Harmattan SDL library (preferably statically linked) is needed for building this version. Skip the x11-fix-event-coordinates patch and use the one above. It calculates how much empty space is around the window and adjusts and clips touchscreen event coordinates accordingly. Not the most elegant solution perhaps, but it makes ScummVM happy.

Assembly optimized scalers, aspect ratio correction and different resolution games should be fixed now. I don't have The Curse of Monkey Island to test, so can you give it a spin Orologiaio? Just remove the old ScummVM package before installing this new one.

Hope everything works. :)
HKisd
Posts: 1
Joined: Wed May 16, 2012 11:16 am
Location: Finland

Post by HKisd »

andei: Thank you. Great work! Graphics and scalers seem to work nicely in the latest version.

One small issue I noticed that sometimes volume control from buttons won't work. It controls ringer volume instead of application volume. Same also happened with the earlier version. At least Day of the Tentacle's start animation has this problem.

By the way N9 is great phone! It is unbelievable that Elop destroyed this excellent platform.
FastIkarus
Posts: 8
Joined: Sat Nov 24, 2007 3:34 pm
Location: Prague, Czech republic

Post by FastIkarus »

Andei, wonderful work, many thanks! Making N9 even more wonderful!:)

I have issue with Sam & Max Hit the Road (CD version/English). It just crashes whole ScummVM when I press the start button. It works.on my PC. I don't know what other info I can provide, so I am not sure that you (or anyone) can help me, but if not, I can play other games :) again, thank you for N9 port, great job!
Orologiaio
Posts: 13
Joined: Thu Jan 05, 2012 3:16 pm

Post by Orologiaio »

andei wrote:Here's an updated Nokia N9 port for testing:

scummvm_1.4.1_armel.deb

And here are the sources and a patch for SDL:

scummvm-1.4.1-harmattan_10052012.diff.gz
x11-alt-fix-event-coordinates.gz

A modified Harmattan SDL library (preferably statically linked) is needed for building this version. Skip the x11-fix-event-coordinates patch and use the one above. It calculates how much empty space is around the window and adjusts and clips touchscreen event coordinates accordingly. Not the most elegant solution perhaps, but it makes ScummVM happy.

Assembly optimized scalers, aspect ratio correction and different resolution games should be fixed now. I don't have The Curse of Monkey Island to test, so can you give it a spin Orologiaio? Just remove the old ScummVM package before installing this new one.

Hope everything works. :)
Sorry, I didn't have the chance to come back here for some time. I'll test and get back to you as soon as possible!
Thank you.

EDIT: It works! I could play CoMI with no issues, I could also enable aspect ratio correction (and finally play older games at a decent resolution ant not in a tiny stamp :P ).
I'm still noticing that small issue with the Indiana Jones title while it's zooming, so that's not related to the scaler which as far as I can tell is now totally fixed. And it's a trivial issue, I find it disturbing but I'm a perfectionist ;)

Thanks again for your efforts andei, and keep up the good work!
User avatar
andei
Posts: 18
Joined: Wed May 02, 2012 7:45 pm
Location: Finland

Post by andei »

Cheers! It's so nice to hear that things are working. Well, mostly working at least. :)

Orologiaio, now I get what you mean about the weird zoom in FoA intro. I'll see if something can be done about that.

HKisd, very strange... I'm not seeing those volume control problems in DotT. Are there other easily reproduced situations where you're experiencing this? Something like that might happen if you have other applications open that play audio and request volume button control from the OS.

And FastIkarus, Sam & Max definitely should work. Try removing the game from ScummVM list and add it back. Also try again copying the game data files from your computer. You could also try resetting all settings by deleting or renaming /home/user/.scummvmrc file.

Finally, if you have N9 developer mode enabled, start ScummVM from the Terminal application like this...

/opt/scummvm/bin/scummvm

...then run the game and look for any messages on the Terminal screen.
FastIkarus
Posts: 8
Joined: Sat Nov 24, 2007 3:34 pm
Location: Prague, Czech republic

Post by FastIkarus »

andei wrote:And FastIkarus, Sam & Max definitely should work. Try removing the game from ScummVM list and add it back. Also try again copying the game data files from your computer. You could also try resetting all settings by deleting or renaming /home/user/.scummvmrc file.

Finally, if you have N9 developer mode enabled, start ScummVM from the Terminal application like this...

/opt/scummvm/bin/scummvm

...then run the game and look for any messages on the Terminal screen.
Terminal helped, thanks for tip. It seems like some problem with MIDI music:

Code: Select all

~ $ /opt/scummvm/bin/scummvm

WARNING: SDL mixer output buffer size: 1024 differs from desired: 2048!

Keyboard pack 'vkeybd_default' loaded successfully

User picked target 'samnmax' (gameid 'samnmax')...

Looking for a plugin supporting this gameid... SCUMM [all games]

Starting 'Sam & Max Hit the Road'

WARNING: TiMidity: connect(): Connection refused!

WARNING: TiMidity: can't open control connection (host=127.0.0.1, port=7777)!

IMuse initialization - Unknown Error!
I disabled MIDI in settings and game works without problems, even music plays, I guess at least CD version of Sam&Max doesn't need MIDI...
User avatar
andei
Posts: 18
Joined: Wed May 02, 2012 7:45 pm
Location: Finland

Post by andei »

^That's great - glad you got Sam & Max working!

The N9 doesn't have a hardware synth or TiMidity packages, so MIDI music isn't really supported at the moment. WildMidi is in the official Harmattan repository, but I'm not sure if it works with ScummVM.
Post Reply