Porting to the Maemo5/N900

Porting to the Maemo5/N900

Postby AapoRantalainen » 09 Jan 2012, 20:10

Hi, I'm 'porting' Me&My Shadow to the Maemo 5 / Nokia N900.
Maemo is debian derived Linux and N900 is ARM-Linux phone.

Maemo has every used library already, so svn-181 compiles without modifications (this is the reason I'm talking about 'porting' not porting).

I have already filed bugs to the Track (user:aapoaapo).

Issues with N900:
*Keyboard doesn't have function-keys
*Keyboard doesn't have escape
*Screen size is 800x480 (fullscreen) (menus need tuning)
*Official SDL-mixer can't handle ogg-files (Mixer can be compiled inside binary. UnOfficial mixer can be easily used. File can be converted to wav).
*Game is a little bit slow
I'm thinking how to get game faster. First profiling shows that most of the time is spent on drawing background image (that black.png).
Game::render
->ThemeBackground::draw
->ThemeBackgroundPicture::draw
->sdlBlit

------
I know some of needed modifications are not useful for upstream, but some could be.
Last edited by AapoRantalainen on 11 Jan 2012, 01:03, edited 1 time in total.
AapoRantalainen
 
Posts: 5
Joined: 09 Jan 2012, 19:59

Re: Porting to the Maemo5/N900

Postby Edward_Lii » 09 Jan 2012, 20:25

Hello AapoRantalainen,

AapoRantalainen {l Wrote}:Hi, I'm 'porting' Me&My Shadow to the Maemo 5 / Nokia N900.
Maemo is debian derived Linux and N900 is ARM-Linux phone.

Wow, that sounds really cool. :cool:

AapoRantalainen {l Wrote}:*Keyboard doesn't have function-keys
*Keyboard doesn't have escape

I think the function key could go upstream, but the escape key?
It explains why you requested it though. ;)

AapoRantalainen {l Wrote}:*Screen size is 800x480 (fullscreen) (menus need tuning)

Sadly, MeAndMyShadow uses a static window size of 800x600.
If you're planning on changing this then it would be great if you could make it dynamic. (Independent of widht/height)
Although it would require some extra work on the main menu since the buttons are embedded in the background image.

AapoRantalainen {l Wrote}:*Official SDL-mixer can't handle ogg-files (Mixer can be compiled inside binary. UnOfficial mixer can be easily used. File can be converted to wav).

Originally it was a .midi, don't think that would have been any better. :p
Converting it to .wav sounds like a good solution.

AapoRantalainen {l Wrote}:I'm thinking how to get game faster. First profiling shows that most of the time is spent on drawing background image (that black.png).

:? , black.png isn't used anymore, it should be removed actually.
But yeah, drawing takes a lot of time, not sure what can be done about it really.

Anyway, I wish you good luck and please keep us updated with your progress. :)
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Porting to the Maemo5/N900

Postby ctdabomb » 09 Jan 2012, 20:26

converting to a .wav makes big files
Some people are like slinkies... not really good for anything, but you still can't help smiling when you shove them down the stairs.
ctdabomb
 
Posts: 1075
Joined: 13 Dec 2011, 21:21
Location: halfway there

Re: Porting to the Maemo5/N900

Postby Tedium » 09 Jan 2012, 20:40

Edward_Lii {l Wrote}:Sadly, MeAndMyShadow uses a static window size of 800x600.
If you're planning on changing this then it would be great if you could make it dynamic. (Independent of widht/height)
Although it would require some extra work on the main menu since the buttons are embedded in the background image.

The current menu is one picture, but I can give you the menu components. (background, buttons and title separated) ;)
User avatar
Tedium
 
Posts: 122
Joined: 19 Oct 2011, 10:40

Re: Porting to the Maemo5/N900

Postby acme_pjz » 10 Jan 2012, 07:00

Hi,

AapoRantalainen {l Wrote}:Hi, I'm 'porting' Me&My Shadow to the Maemo 5 / Nokia N900.
Maemo is debian derived Linux and N900 is ARM-Linux phone.


Good idea :) How about Android?

AapoRantalainen {l Wrote}:*Game is a little bit slow
I'm thinking how to get game faster. First profiling shows that most of the time is spent on drawing background image (that black.png).
Game::render
->ThemeBackground::draw
->ThemeBackgroundPicture::draw
->sdlBlit


Maybe because SDL 1.2 doesn't use hardware-accelerated 2D graphics drawing... Can we try new SDL 1.3 beta?
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Porting to the Maemo5/N900

Postby MCMic » 10 Jan 2012, 09:22

The player should be able to configure keys in a menu.
I think we should keep sounds in ogg.

The game should support different resolutions :-)
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Porting to the Maemo5/N900

Postby Edward_Lii » 10 Jan 2012, 15:39

Hello MCMic,

MCMic {l Wrote}:The player should be able to configure keys in a menu.

We should make some sort of InputManager which will be used to check the configured buttons.
And the InputManager could then also be used for joysticks.

MCMic {l Wrote}:I think we should keep sounds in ogg.

We keep the upstream version in .ogg.
But if the port for Maemo5/N900 requires .wav it can be converted for that version only.

MCMic {l Wrote}:The game should support different resolutions :-)

What if we try to plan the roadmap like this:
    0.3 = Statistics
    0.4 = Joystick (InputManager)
    0.5 = Resolutions

acme_pjz {l Wrote}:Good idea :) How about Android?

That would be a lot harder since AFAIK making apps for Android requires you to write in Java, with exception of rooted devices.
If only I rewrote meandmyshadow in Java when I had the chance. :p

acme_pjz {l Wrote}:Maybe because SDL 1.2 doesn't use hardware-accelerated 2D graphics drawing... Can we try new SDL 1.3 beta?

IIRC there is a way to let SDL 1.2 use openGL to make use of hardware-acceleration.
Of course we can 1.3 a try, but it would be better if we could get it optimized under 1.2.
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Porting to the Maemo5/N900

Postby AapoRantalainen » 11 Jan 2012, 01:02

Hi,
my Maemo5-port is going on. I will soon make some video for it, it is already in playable state.

Here is all I have at very this moment: https://gitorious.org/meandmyshadow_mae ... adow_maemo
Some commits I have filed as bug in Track.

This version can be compiled without -DMAEMO5 (Tuned in CMakeList.txt) and it works (almost) same as svn-184.
----
Keyboard: I made 'compile time configure file' with macros:
https://gitorious.org/meandmyshadow_mae ... s.h#line58
----
Resolution: I scaled and tuned menu png-images, and used variables SCREEN_HEIGHT and SCREEN_WIDTH. It is not dynamical, but at least something:
e.g. https://gitorious.org/meandmyshadow_mae ... 6b87bcc85a
-----
Ogg-files: So far I haven't done anything for this. I have earlier packaged another game with SDL-mixer built on inside binary, it is not big deal.
But Nokia is not anymore supporting Maemo, so more and more people are using UnOfficial (official community made) SDL-mixer (because there are no hope that Nokia will fix that crappy one).
-----
Speed:
I made test level with much of ShadowBlock and disabled background drawing totally. Game was fast, but didn't refresh background (only ShadowBlocks), so there are ghost lines etc. Some "dirty rectangle"-technique for background would be good.

I replaced background-image with solid color and game is faster now.
https://gitorious.org/meandmyshadow_mae ... pp#line666
Of course it is not cool as with image.
------
No mouse:
I realized that mouse wheel and right mouse button are needed on LevelEditor. I started to add keyboard fallback for them.
https://sourceforge.net/apps/trac/meand ... /ticket/25
------
SDL-1.3:
For Maemo, I'm afraid this will not change anything better. There are SDL-1.3 for Maemo5 but I I think it is never really tested and maybe not have any acceleration.
--------
Android:
Just let me finish this first =)
Android can handle C code, it only needs thin java-wrapper for starting it. It doesn't need rooted device. Actually I have made my first SDL-gradient test-package and installed it to the Android-device (I think issue might be SDL-gfx, SDL-mixer, SDL-ttf, SDL-image...).

But many(?) Android device doesn't have keyboard, so there must be on-screen-buttons for playing. And how about single-touch touchscreens then? Android is large field, which one to aim?
(I'm interested in on-screen-buttons -> Maemo6/N9 https://en.wikipedia.org/wiki/Nokia_N9)
AapoRantalainen
 
Posts: 5
Joined: 09 Jan 2012, 19:59

Re: Porting to the Maemo5/N900

Postby AapoRantalainen » 12 Jan 2012, 19:32

First announcement can be read on: http://talk.maemo.org/showthread.php?p=1149545
There are screenshot and link to the youtube video.

This is view to the package: http://maemo.org/packages/view/meandmyshadow/
-----
I bundled SDL-mixer to the binary with very hacky way, because my cmake skills were not enough.
-----
On Maemo5 things should be installed to the /opt
AapoRantalainen
 
Posts: 5
Joined: 09 Jan 2012, 19:59

Re: Porting to the Maemo5/N900

Postby Edward_Lii » 12 Jan 2012, 20:04

Hello AapoRantalainen,

AapoRantalainen {l Wrote}:First announcement can be read on: http://talk.maemo.org/showthread.php?p=1149545
There are screenshot and link to the youtube video.

That looks cool! :cool:
Real strange to see meandmyshadow run on a handheld device.

AapoRantalainen {l Wrote}:This is view to the package: http://maemo.org/packages/view/meandmyshadow/

Sadly I can't test it. :(
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Who is online

Users browsing this forum: No registered users and 1 guest