maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Games (https://talk.maemo.org/forumdisplay.php?f=12)
-   -   Palm Pre gets SDL! native gaming (https://talk.maemo.org/showthread.php?t=39809)

javispedro 2010-01-09 00:24

Palm Pre gets SDL! native gaming
 
http://www.precentral.net/palm-bring...ve-development

I guess you might want to know why am I interested on this kind of news... some random device getting commercial games. Well, I think you'll understand when you see what I see:
  • The Palm Pre has a OMAP3430
  • The Palm Pre has a PowerVR SGX and OpenGL ES 2.0 libs
  • The Palm Pre is running GNU/Linux
  • The official way to code native apps in the Palm Pre is using SDL 1.2, which has a standard interface and Palm has released their modifications in compliance to the LGPL.
  • Did I say it's getting (some) commercial games?
  • The N900 has a OMAP3430
  • The N900 has a PowerVR SGX and OpenGL ES 2.0 libs
  • The N900 is running GNU/Linux
  • The N900 has SDL 1.2
  • Thus the N900 could potentially run the same unmodified Palm Pre binaries (and vice versa)

Of course, I still don't know what the draconian DRM scheme will be, but even then, I think this is a pretty interesting fact to consider :D And hopefully, may induce Nokia to make a similar announcement in the future...

Capt'n Corrupt 2010-01-09 00:46

Re: Palm Pre gets SDL! native gaming
 
This is great news! I'd love to see some Pre games (commercial and otherwise) find their way to the N900. Also, the development community just got a lot larger!

}:^)~

antoarts 2010-01-09 07:42

Re: Palm Pre gets SDL! native gaming
 
Don't forget the fact that the Palm Pre has multitouch support, while the N900 hasn't. Many games will probably use that feature, which will make the games for the pre unplayable at the N900...

tso 2010-01-09 07:46

Re: Palm Pre gets SDL! native gaming
 
depends, they could make use of the keyboard as well.

antoarts 2010-01-09 07:51

Re: Palm Pre gets SDL! native gaming
 
Quote:

Originally Posted by tso (Post 460756)
depends, they could make use of the keyboard as well.

But then they won't directly run on the n900 (if they don't make use of the pre's keyboard)

javispedro 2010-03-10 01:49

Re: Palm Pre gets SDL! native gaming
 
Well, the Palm native SDK has been released today, and yes, it is indeed a codesourcery toolchain + a patched SDL for OpenGL ES support (not unlike the SDL_gles extensions I released a few days ago to extras-devel...)
Instead of, say,
Code:

SDL_GLES_Init(SDL_GLES_VERSION_2_0)
(like on SDL_gles) a Palm native SDK developer would have to
Code:

SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
. I could change my extension to resemble that easily... (rest is mostly the same).
  • Keyboard events go through the usual way.
  • Single finger touchscreen events are sent via mouse events (like on the N900), multi finger touchscreen events are sent via "multiple mice" events.
  • Gestures in the gesture area via virtual keyboard events.
  • Accelerometer is read via the sdl joystick interface (like on the N900 with accelemymote).
  • Sound is handled via the Pulseaudio SDL driver (and SDL_mixer) -- like on the N900.
  • They have written a very simple SDL binding for some media player framework (gstreamer, I suppose): SDL_cinema. The wrapper is very simple (too much IMO).
  • They have a new SDL event type for their OS stuff, like the above library's end-of-stream event.
  • They also have an extra library for OS stuff: preventing the screen autodimming (Nokia has this already in hildon-games-wrapper), changing/detecting the device orientation, enabling the gesture area, their own equivalent of Maemo's liblocation, etc.
So, source compatibility can be attained with a few one-line preprocessor macros :). Let's see about binary compatibility.

SavageD 2010-03-10 02:09

Re: Palm Pre gets SDL! native gaming
 
very excited ^_^...although I have a bit of a problem...maybe games would search for specific license/signatures of the device, that'll be a major problem right there, also games maybe extremely buggy, lets face it we're tired of bugs :( . As I have learnt through life, things arent always as easy as they seem...Although I quite sure that a minor notification to ea would make em develop/port games for the n900.

javispedro 2010-10-20 16:58

Re: Palm Pre gets SDL! native gaming
 
3 Attachment(s)
Oh, you're going to love this...

ArnimS 2010-10-20 17:02

Re: Palm Pre gets SDL! native gaming
 
A new win is born!

Reffyyyy 2010-10-20 17:22

Re: Palm Pre gets SDL! native gaming
 
I'm surprised this thread hasn't exploded yet. Great work once again.

Tiboric 2010-10-20 17:26

Re: Palm Pre gets SDL! native gaming
 
wow that's cool stuff. got any more games running?

MINKIN2 2010-10-20 17:45

Re: Palm Pre gets SDL! native gaming
 
Oh this going to be nice. Naughty, but nice ;)

Schriek 2010-10-20 18:03

Re: Palm Pre gets SDL! native gaming
 
This is sweet, any chance of getting some sort of tutorial ?

javispedro 2010-10-20 19:21

Re: Palm Pre gets SDL! native gaming
 
1 Attachment(s)
3d rendering now works :) (SDL on the Pre allocates a 16bpp depth buffer by default, which is news to me).

javispedro 2010-10-20 19:22

Re: Palm Pre gets SDL! native gaming
 
1 Attachment(s)
Quote:

Originally Posted by Tiboric (Post 846283)
wow that's cool stuff. got any more games running?

Yep. This one crashes before starting the game because it tries to play a cinematic, which is not implemented.

bunanson 2010-10-20 19:28

Re: Palm Pre gets SDL! native gaming
 
WANT!

please, how to do it, big boy...............

(2 palms together on top of head, and knee down in position in a begging demeaner :-) )

AND, I have access to one palm pre... need to say more?

bun

Bratag 2010-10-20 19:30

Re: Palm Pre gets SDL! native gaming
 
Wait a second - when did my pants get tighter ... oh yeah... after reading this. FULL OF WIN!!

Laughing Man 2010-10-20 19:30

Re: Palm Pre gets SDL! native gaming
 
Is there a reason why it's scrunched up and rotated sideways? I'm guessing it has to do with the Palm Pre's orientation and resolution?

Turkishflavor 2010-10-20 19:31

Re: Palm Pre gets SDL! native gaming
 
epic win! the n900 is getting better and better! love it :D

bunanson 2010-10-20 19:37

Re: Palm Pre gets SDL! native gaming
 
Quote:

Originally Posted by Turkishflavor (Post 846398)
epic win! the n900 is getting better and better! love it :D

I thought I was ONLY ONE noticed that, we have more [ANNOUNCE] for new apps in the last 2 weeks then the whole 1st 6 month since N900 launched! The one I like the most, among many good apps, is our supermoderator's Here and Now. If you have not noticed it, go dig it out, it is fun. Salute to TMO, the breeding habitat for N900!

bun

robbie 2010-10-20 19:57

Re: Palm Pre gets SDL! native gaming
 
Quote:

Originally Posted by Laughing Man (Post 846397)
Is there a reason why it's scrunched up and rotated sideways? I'm guessing it has to do with the Palm Pre's orientation and resolution?

Probably. The pre has a very low resolution: 320x480

ivgalvez 2010-10-20 20:59

Re: Palm Pre gets SDL! native gaming
 
This is absolutely amazing. Congratulations Javier.

diegofigueroa 2010-10-20 21:04

Re: Palm Pre gets SDL! native gaming
 
Good news, very nice work!

chase15 2010-10-20 21:14

Re: Palm Pre gets SDL! native gaming
 
auto-installer please :D that looks cool...

javispedro 2010-10-21 14:33

Re: Palm Pre gets SDL! native gaming
 
1 Attachment(s)
Looking (and sounding) better...


Source is at http://gitorious.org/preenv/preenv . (LGPL 2.1).

Note that you very probably need to own a Pre to use it (commercial games wise).

ivgalvez 2010-10-21 16:32

Re: Palm Pre gets SDL! native gaming
 
Looks very good. How about controls?
(touch screen/keyboard/accelerometer)

javispedro 2010-10-21 16:43

Re: Palm Pre gets SDL! native gaming
 
Touch screen = Pre has multitouch, some games use it (Sims uses two fingers for "rotate camera" gesture). On N900, I can only simulate one finger, so no rotate camera for Sims.
Keyboard = "Should work"
Accelerometer = EDIT: Already works, out of the box.

ivgalvez 2010-10-22 07:00

Re: Palm Pre gets SDL! native gaming
 
You are the man!

Maybe multitouch could be kinda simulated the same way as in Hildon desktop when you tap in both sides at the same time and desktop switch is much faster than normal gesture.

Second approach could be using proximity sensor combined with touch screen.

And finally, map second touch to keyboard arrows.

Airtux 2010-10-22 22:25

Re: Palm Pre gets SDL! native gaming
 
Oooh my god! very amazing! it's possible to found this emulator or games in appli manager one day?

Show this in a video youtube please!

anidel 2010-10-23 03:42

Re: Palm Pre gets SDL! native gaming
 
What about sounds?

anidel 2010-10-23 03:43

Re: Palm Pre gets SDL! native gaming
 
And, OT, why I haven't seen Palm Pre OS running on the N900 or viceversa?
Or even MeeGo on a Pre?

porselinaheart 2010-10-23 04:07

Re: Palm Pre gets SDL! native gaming
 
'fap' 'fap'

javispedro 2010-10-23 15:40

Re: Palm Pre gets SDL! native gaming
 
Quote:

Originally Posted by anidel (Post 848422)
What about sounds?

Yes, they work! Including background music. In fact, Pre games usually use Vorbis music, which the Pre flawlessly supports and the N900 doesn't (heh!) without extras packages.

Quote:

Originally Posted by anidel (Post 848423)
And, OT, why I haven't seen Palm Pre OS running on the N900 or viceversa?
Or even MeeGo on a Pre?

WebOS on the N900 -- Same reason you don't get Maemo on any other device. Because it's not 100% OSS, and nobody has started a project to purge it from the closed stuff. As the closed vs free ratio is worse than the Maemo one, such a project would need even more work than Mer, etc..
(BTW, I know at least one person who tried to run the closed components of WebOS on the N900 with "some" success)
Meego on the Pre -- dunno. Pre kernel is open save for some DSP stuff (Texas Instruments copyright iirc).




On latest git even _cinematics_ work, so I can already play certain cool-looking racing game with a screenshot on the 2nd page of this thread!

pingu 2010-10-23 21:53

Re: Palm Pre gets SDL! native gaming
 
I want to install this but unfortunatly I don't know how. if someone could write the commands list for installing it in "/opt/preenv/" I will really appreciate it?

javispedro 2010-10-23 22:06

Re: Palm Pre gets SDL! native gaming
 
1 Attachment(s)
Ok, the package is in extras-devel, called "Preenv" 0.1. As it has no graphical user interface, you will not find it in the application manager, so you have to install from the command line.

To get games, grab your Pre and copy your application storage directory out of it (that depends on your version of WebOS and requires rooting it, so it is out of the scope of this little post). Then copy it into your N900's home directory (note: /home/user !, not MyDocs).

To enter the "Pre environment", just type "preenv" on the terminal. This will spawn another shell with the correct LD_LIBRARY_PATH. Now you can try running your games as if they were native applications (they are!). They all run fullscreen; quit them using Ctrl+Backspace.

You can also generate a menu icon for a game (like if it was a N900 game!); just run "desktopgen <path to a game's appinfo.json file>" within the Pre environment. (desktopgen needs root for obvious reasons; the rest of preenv doesn't).


Remember that this only runs "Native" applications. If an application makes use of the Mojo framework (javascript, html widgets, ...) it's no longer native. ALL OpenGL games are "native" applications, though.

Also, currently only OpenGL ES 1 PORTRAIT games will be automatically rotated & enlarged.

A screenshot with the result of running "desktopgen" on some Pre games (those two games run flawlessly):

ivyking 2010-10-23 22:26

Re: Palm Pre gets SDL! native gaming
 
thanks a lot for your efforts !
how about mapping the proximity sensor + single finger scroll as virtual multitouch ? (I know this has been asked before , but now we can have a use for this !)

javispedro 2010-10-23 22:32

Re: Palm Pre gets SDL! native gaming
 
Quote:

Originally Posted by ivyking (Post 849032)
thanks a lot for your efforts !
how about mapping the proximity sensor + single finger scroll as virtual multitouch ?

I don't know how it would work like.

Multitouch is having two or more fingers at the screen at different positions. Think http://www.youtube.com/watch?v=V8_0Oz7KOso . The proximity sensor does not get position info!

(btw, that one game also works nearly flawlessly -- save for not being able to move and attack at the same time due to missing multitouch, which makes it a bit harder but still quite playable. it is also a bit slower than the original one, because preenv makes it run at 800x480. the startup cinematic also works.).

djs_tx 2010-10-23 22:34

Re: Palm Pre gets SDL! native gaming
 
Stupid idea....

I understand the legal aspects of "you must own a pre to do this" but...

EA wants to sell games. Have you thought about approaching EA and showing them how easy it is to expand their market? Of course I guess it could backfire and they could DRM the heck out of their games. But it sounds like a major opportunity for them.

If a hacker without any "inside" knowledge of their code can get them so functional with such little effort, why wouldn't they tweak their games a little and make them available in OVI?

Or am I crazy...?

javispedro 2010-10-23 22:38

Re: Palm Pre gets SDL! native gaming
 
Quote:

Originally Posted by djs_tx (Post 849040)
EA wants to sell games. Have you thought about approaching EA and showing them how easy it is to expand their market?

Oh well, that's what I would have really wanted, and the reason I waited a lot of time from noticing the similarities between the Pre and the N900 to starting the project. I was optimistic in that maybe we could see something similar from Nokia "soon".

Well, it didn't pay.

Even more depressing: from a technical point of view, EA could port _all_ of their games in an afternoon in man-hours. In fact, that's the time _I_ spent from having "just" the idea to actually seeing the Sims running!

anwar71839 2010-10-23 22:56

Re: Palm Pre gets SDL! native gaming
 
i cant find it. I tried to do it via xterminal too, no luck. :(


All times are GMT. The time now is 00:36.

vBulletin® Version 3.8.8