Pandora Porting Arkanoid to the Pandora: Full How-to on Pandoralive


ekianjo

Hardcore Member
Joined
May 7, 2012
Messages
8,261
Location
神戸市、日本 (Japan)
It's all in the title. Welcome to a full How-to, from beginning to the end, including optimizations, written by one of the most active porters currently, PtitSeb. A very good read, if you want my opinion. And another excellent piece of material to start porting your own apps for Pandora, after Dredd's article on the Dillo Browser port. 

http://www.pandoralive.info/?p=700

arkapromo.png
 
Nice read, great pictures (somehow the cat meme did not make me quit reading)  :D

A few notes to ptitseb :

- genpxml from nand and in my toolchain should be the same by now (commited to git age ago)

- you should add a bash file to be sourced in your C::B.pnd so env vars like LDFLAGS CPPFLAGS PKG_CONFIG_SYSROOT_DIR etc (see what setprj set in my toolchain) so changing Makefile would be less of a requierement (thinking at -L/mnt/utmp/codeblocks/usr/lib &all)

- for things like Ooffice you should definatly use a cross-compiling toolchain : 3 days is fucking insane when cross-compiling it is a mater of an hour or 2 on my machine.

- configure would probably prefer double-dash arguments (--prefix not -prefix) ;)
 
I admit Dredd's Tutorial kept me going back.. but this was a good read.
 
Nice read, great pictures (somehow the cat meme did not make me quit reading)  :D

A few notes to ptitseb :

- genpxml from nand and in my toolchain should be the same by now (commited to git age ago)

- you should add a bash file to be sourced in your C::B.pnd so env vars like LDFLAGS CPPFLAGS PKG_CONFIG_SYSROOT_DIR etc (see what setprj set in my toolchain) so changing Makefile would be less of a requierement (thinking at -L/mnt/utmp/codeblocks/usr/lib &all)

- for things like Ooffice you should definatly use a cross-compiling toolchain : 3 days is fucking insane when cross-compiling it is a mater of an hour or 2 on my machine.

- configure would probably prefer double-dash arguments (--prefix not -prefix) ;)
Thanks for the comments.

For genpxml, I'll check, I though the output was a bit different (hum, at least default author is not the same ;) ), but it was on different package and I didn't compare the scripts,

For the environnement variables, I set some in C::B, like PKG_CONFIG and so on, but I don't set CFLAGS and friends. May be I should put some default "-m"blabla, without any "-O" ? Or a default "full" Pandora config with -O2. I don't know.

Cross compiling is certainly much faster (I'm compiling GCC 4.8, and with -flto, I can see that), but the setup is really tricky, and I had some difficulty to have LibreOffice compiling. But I've learned many since I tried, so may be I'll retry some day. Your Virtual Image is a excellent start for that anyway, and I have that image handy on my HDD :) .

The double dash have metamorphosed to unsecable dash, so yes, all configure (and a Wait--) is not printed the right way on the tuto :( . That's some LibreOffice or Word magic where you don't need..
 
Come to think of that: A modern tutorial on how to set up a cross compiling environment would be a very nice addition to the series...
 
I can contribute with my utterly failed attempts to do it, but I'm not sure they are useful as anything other than comic relief :D
 
hum, where are the boobs? :D

great job, thanks for that
 
Last edited by a moderator:
" * …or the otheway is to use the modified SDL lib from notaz. The magical SDL is highly optimized (fastest driver for the Pandora currently) and forces Fullscreen automatically. So there is no need to code anything, a linux command is enough.


We simply use the following to define the proper SDL driver:


export SDL_VIDEODRIVER="omapdss""


This doesn't describe what needs to be done to get Notaz's SDL installed.
 
" * …or the otheway is to use the modified SDL lib from notaz. The magical SDL is highly optimized (fastest driver for the Pandora currently) and forces Fullscreen automatically. So there is no need to code anything, a linux command is enough.


We simply use the following to define the proper SDL driver:


export SDL_VIDEODRIVER="omapdss""


This doesn't describe what needs to be done to get Notaz's SDL installed.
Doing this export before launching *any* SDL software make it use the notaz's SDL driver automaticaly. It's already installed on SuperZaxxon firmware at least since v1.50 (I don't remember), so there is nothing more to do (on an OpenPandora).
Does this answer the question or did I missed the question?
 
Last edited by a moderator:
Nice tutorial, p'titSeb!

Some comments: you're working a lot with explicit absolute paths like /mnt/utmp/Arka/icon.png. That will work, but I think it's better to work with relative paths like ./icon.png, that way you don't need to create a fake /mnt/utmp/Arka directory and so on, but you can just run stuff from whatever directory you put your stuff in. Your method has the advantage that it works on everything that needs a "make install" and a way to set the prefix (even stuff that hard-bakes absolute paths into its binaries), but in most cases it is not needed to do the "make install" and the compiled binary will find its data files if they are in the normal spot in the source tree.

The reason why I don't like those absolute paths is that it makes it harder to unpack a PND and run it directly from whatever directory you put it in. Also if some day the PND execution mechanism changes slightly such that the mount point is different, it will stop working if you put those absolute paths everywhere.

Also you don't need to manually export HOME and those other environment variables, they are set already automatically (except LD_LIBRARY_PATH of course).

Finally, how smart is that copy_libs.sh script? Does it always just copy all libs, or does it try to actually track the dependencies? I would avoid adding any library that is not strictly needed, and I would only include libraries that are already available in the firmware if you really need that specific version to make it work. If the firmware version also works, it's better not to include another version of the library, for three reasons: 1) avoid PND size bloat, 2) avoid redundant RAM usage because of potentially having different copies/versions of the same library in memory simultaneously, and 3) if the firmware some day upgrades to a newer and better version of the library, you'll want your PND to benefit from that.
 
Yeah, we definitely need more half-naked women in that article. Or fully naked, that would also do. It's pretty dry without them.

D.
 
Nice tutorial, p'titSeb!

Some comments: you're working a lot with explicit absolute paths like /mnt/utmp/Arka/icon.png. That will work, but I think it's better to work with relative paths like ./icon.png, that way you don't need to create a fake /mnt/utmp/Arka directory and so on, but you can just run stuff from whatever directory you put your stuff in. Your method has the advantage that it works on everything that needs a "make install" and a way to set the prefix (even stuff that hard-bakes absolute paths into its binaries), but in most cases it is not needed to do the "make install" and the compiled binary will find its data files if they are in the normal spot in the source tree.

The reason why I don't like those absolute paths is that it makes it harder to unpack a PND and run it directly from whatever directory you put it in. Also if some day the PND execution mechanism changes slightly such that the mount point is different, it will stop working if you put those absolute paths everywhere.

Also you don't need to manually export HOME and those other environment variables, they are set already automatically (except LD_LIBRARY_PATH of course).

Finally, how smart is that copy_libs.sh script? Does it always just copy all libs, or does it try to actually track the dependencies? I would avoid adding any library that is not strictly needed, and I would only include libraries that are already available in the firmware if you really need that specific version to make it work. If the firmware version also works, it's better not to include another version of the library, for three reasons: 1) avoid PND size bloat, 2) avoid redundant RAM usage because of potentially having different copies/versions of the same library in memory simultaneously, and 3) if the firmware some day upgrades to a newer and better version of the library, you'll want your PND to benefit from that.
Hi _wb_. Thank you for your kind comments.

About the absolute path, I do agree that this is heavy artillerie, and clearly not needed here. But, I had so many problem in the past with that, I now do the same process every time, without checking if it's needed or not. I have a few scripts to automatized the "fake pnd" creation and so on, so it doesn't bother me much. But you're right, if the PND system is changed, my PNDs probably won't survive it, and at least the run_script will have to be adapted.

For the HOME and so on, again, it's probably not needed all the time, but many time I redirect HOME inside a home/ subfolder of the appdata. So I do define HOME, PATH, LD_LIBRARY_PATH and other on a systematic way, to limit as much as I can the "oups... PND won't launch, I repackage" incident. I'm a bit paranoid, so I have a tendancies to define as mush things as I can by myself, so I now precisely what is going on. But yes, that also can by optionnal.

The copy_libs.sh is a very very dumb script. I hesitate a lot before puting it in the tutorial. It's just an "ldd" of the file you give it in parameter (it doesn't handled wildcard or --help, very dumb...), and copy all libs that are not from /lib or /usr/lib. So it copy many many libs, with the dependencies. So it can copy useless libs... Well, it's a bit more complicated (about useless). For example, there is a copy of SDL inside code::blocks, with the hack to not freeze when using GLES+WrapMouse. This SDL has been compiled with codeblocks. So it's linked with a more up-to-date version of X11 than the one in the Firmware. So, when you "copy_libs" Arka, you get the SDL from code::blocks (because codeblocks libs come first). With this SDL, you also get X11 from codeblocks, and many libX associates... If you just remove the libX11 (ar the other libX) from the PND but let SDL, you will have some error at run. But if you remove the SDL, the libX11 is safe to remove.

So to have some minimal "copy_libs", I should modify the script to:

1. do "sudo ldconfig" so unmount the codeblocks libs...

2. do the ldd, and try to copy only libs that are "not found", from the lib folder of codeblocks

3. remount the codeblocks, with "sudo ldconfig -f $CDEVROOT/init/ld.so.cfg"

That would probably be a much better way, but I haven't done that yet.

But yes, the copy_libs is dumb, and will bloated the PND with a bit too much lib. I choose to be on the safe side, better too much than not enough. The downside is you don't get benifit from newer release in the Firmware. It's a "console" phylosophie, more than a computer phyolosophie.
 
Last edited by a moderator:
Yeah, we definitely need more half-naked women in that article. Or fully naked, that would also do. It's pretty dry without them.


D.
that forum thread is dry at least...
I found those pictures are very funny and entertaining and tied well with the tutorial.  Much better than those Victoria Secrets girls.  I think these cats are smarter than those women :D   
 
I think the best alternative would be to find pictures of half naked models doing funny cat things. ;)
 
Back
Top