Beta Pandora Frogatto


Farox

Certified Guru
Joined
Jan 8, 2009
Messages
2,413
Age
56
Location
Italy
Website
rbnet.it
Hi
I have managed to compile the Frogatto game for Pandora using the Maemo sources based on the latest 1.0.2 version.
The Maemo port is based on SDL+SDL_gles and other library.

You can download at http://www.steekr.com/n/50-2/share/LNK81904c9920e49356c/ my steekr online storage space.

This is a very quick build and is not tested (as i don't have a Pandora yet ) .

In the archive there are the frogatto bin and the data needed (taken from the maemo package repo ).
I don't know if the runme.sh file is good enough to run the game ...

This is how the preferences are readed and writed on the source file preferences.cpp:

namespace {
int unique_user_id = 0;

int screen_editor_mode = 0;

bool no_sound_ = false;
bool no_music_ = false;
bool show_debug_hitboxes_ = false;
bool use_pretty_scaling_ = false;
bool fullscreen_ = false;
bool resizable_ = false;
bool debug_ = true;
bool reverse_ab_ = false;

std::string level_path_ = "data/level/";

bool send_stats_ = true;

.-.-.-.-.-.-.-.--.

#elif TARGET_OS_MAEMO
bool sim_iphone_ = false;

#ifndef PREFERENCES_PATH
#define PREFERENCES_PATH "~/.frogatto/"
#endif
int virtual_screen_width_ = 800;
int virtual_screen_height_ = 480;

int actual_screen_width_ = 800;
int actual_screen_height_ = 480;

bool screen_rotated_ = false;

bool show_fps_ = false;
bool use_joystick_ = true;

bool load_compiled_ = true;

bool use_16bpp_textures_ = true;

-..-.-.-.---.-

#define SAVE_FILENAME "save.cfg"
#define AUTOSAVE_FILENAME "autosave.cfg"


-.-.-.-.-.-.-.-.-.-..

namespace {
void expand_path(std::string& str) {
if(!str.empty() && str[0] == '~') {
str = std::string(getenv("HOME")) + std::string(str.begin()+1, str.end());
}
}
}

void expand_data_paths() {
expand_path(level_path_);
expand_path(save_file_path_);
expand_path(auto_save_file_path_);
expand_path(preferences_path_);
}
----------------------------------------------------------------
so if the game don't start please try to change the runme.sh file to modify the HOME dir ...
hoping that the builded game binary is ok .

This is the compilation option used under a Codeblocks project:

NO_EDITOR
SDL_VIDEO_OPENGL_ES
_GNU_SOURCE
_REENTRANT
IMPLEMENT_SAVE_PNG
TARGET_OS_MAEMO


-fno-inline-functions
-fthreadsafe-statics
-Wnon-virtual-dtor
-Wreturn-type
-mcpu=cortex-a8
-ftree-vectorize
-mfloat-abi=softfp
-mfpu=neon


-O2 optimization
-s minimizes size


and this is the lib needed to link it :
-lGLES_CM -lSDL -lSDL_mixer
-lSDL_image -lSDL_ttf -lIMGegl
-lpng12 -lboost_regex-mt -ljpeg
-lboost_system-mt -lsrv_um -lglib-2.0
-lts-1.0 -lfreetype -lTIFF -lz -lmad
-losso -ldbus-1 -ldbus-glib-1
-lgobject-2.0 -lgthread-2.0
-lSDL_gles -lEGL

So if you have a Pandora please try it and let me know how (and if ) it run.

Links:
Frogatto page http://www.frogatto.com/

Maemo port by Philipp Zabel http://maemo.org/packages/view/frogatto-engine/
Maemo source code http://maemo.org/packages/package_instance/view/fremantle_extras-devel_free_armel/frogatto-engine/1.0.2-maemo2/


Farox
 
Okay, first quick test: Seems you're using the wrong libraries when compiling for the Pandora. Got the following errors:

Code:
/usr/lib/libstdc++.so.6: version 'GLIBCXX_3.4.11' not found
/usr/lib/libstdc++.so.6: version 'CXXABI_ARM_1.3.3' not found

Further testing:
Manually included the libstdc++.so.6 it was expecting into the archive, that fixed that.

Now I'm getting:

Code:
could not initialize libosso
could not init OSSO

Is that OSS sound? Will dive in more :)

EDIT: Okay... actually not OSS. OSSO seems to be part of the MAEMO system... it sets a lot of environment variables like what hardware rev you are, etc.
Basically, this script does that:

Code:
#!/bin/sh
# Application Framework environment variable defines for all AF programs,
# programs started by AF startup scripts and the D-BUS session bus.
#
# This file is part of osso-af-startup.
#
# Copyright (C) 2004-2007 Nokia Corporation. All rights reserved.
#
# Contact: Gabriel Schulhof <gabriel.schulhof@nokia.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License 
# version 2 as published by the Free Software Foundation. 
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA

# cancel 'set -e' because grep may return non-zero
set +e

export AF_INIT_DIR=/etc/osso-af-init

source_if_is()
{
  farg=$AF_INIT_DIR/$1 

  shift

  if [ -f $farg ]; then
    source $farg $@
  else
    echo "AF Warning: '$farg' not found"
  fi
}

# user name is appended for multi-user Scratchbox
USER=`whoami`
if [ "x$USER" = "xroot" ]; then
  export SESSION_BUS_ADDRESS_FILE=/tmp/session_bus_address.user
  export SESSION_BUS_PID_FILE=/tmp/dbus_session_bus.pid.user
else
  export SESSION_BUS_ADDRESS_FILE=/tmp/session_bus_address.$USER
  export SESSION_BUS_PID_FILE=/tmp/dbus_session_bus.pid.$USER
fi

# these could have changed since last sourcing
if test -f $AF_INIT_DIR/locale; then
  source $AF_INIT_DIR/locale
else
  unset LC_ALL
  export LC_MESSAGES=en_GB
  export LANG=en_GB
  export LC_TIME=en_GB
fi

if [ -r $SESSION_BUS_ADDRESS_FILE ]; then
  source $SESSION_BUS_ADDRESS_FILE
fi
# Note: TMPDIR uses flash but UI states are saved to RAM
export TMPDIR=/var/tmp ;# needed here because sudo clears this

# the following should not change in run-time
if [ "x$AF_DEFINES_SOURCED" = "x" ]; then
  export AF_PIDDIR=/tmp/af-piddir
  if [ ! -d $AF_PIDDIR ]; then
    # note, no write to flash involved here
    mkdir $AF_PIDDIR
    # I'm not the only one writing here
    chmod 777 $AF_PIDDIR
  fi

  if [ ! -e /targets/links/scratchbox.config ]; then
    if [ "x$DISPLAY" = "x" ]; then
      export DISPLAY=:0.0
    fi
  fi
  export LAUNCHWRAPPER=$AF_INIT_DIR/launch-wrapper.sh

  # check the machine
  echo `uname -m` | grep "^armv" > /dev/null
  if [ $? = 0 -a -x /usr/sbin/dsmetool ]; then
    export LAUNCHWRAPPER_NICE=$AF_INIT_DIR/nice-launch-wrapper.sh
    export LAUNCHWRAPPER_NICE_KILL=$AF_INIT_DIR/nice-kill-launch-wrapper.sh
    export LAUNCHWRAPPER_NICE_TRYRESTART=$AF_INIT_DIR/nice-launch-wrapper-tryrestart.sh
    export LAUNCHWRAPPER_TRYRESTART=$AF_INIT_DIR/launch-wrapper-tryrestart.sh
  else
    export LAUNCHWRAPPER_NICE=$LAUNCHWRAPPER
    export LAUNCHWRAPPER_NICE_KILL=$LAUNCHWRAPPER
    export LAUNCHWRAPPER_NICE_TRYRESTART=$LAUNCHWRAPPER
    export LAUNCHWRAPPER_TRYRESTART=$LAUNCHWRAPPER
  fi

  export STATESAVEDIR=/tmp/osso-appl-states
  if [ ! -d $STATESAVEDIR ]; then
    mkdir $STATESAVEDIR
    chmod 01777 $STATESAVEDIR
  fi

  if [ ! -d /scratchbox ]; then
    if [ ! -e /tmp/.opi.tmp -a -x /usr/bin/osso-product-info ]; then
      if [ "x$USER" = "xroot" ]; then
        _SUDO='
      else
        _SUDO='sudo'
      fi
      $_SUDO /usr/bin/osso-product-info 1> /tmp/.opi.tmp.tmp 2> /dev/null
      $_SUDO /bin/mv -f /tmp/.opi.tmp.tmp /tmp/.opi.tmp 2> /dev/null
      unset _SUDO
    fi
    if [ -r /tmp/.opi.tmp ]; then
      VNAMES=`awk -F '=' '{print $1}' < /tmp/.opi.tmp`
      source /tmp/.opi.tmp
      export $VNAMES
      unset VNAMES
    fi
  fi

  # Mount point of the MMC
  export MMC_MOUNTPOINT='/media/mmc1' MMC_DEVICE_FILE='/dev/mmcblk0p1'

  # Only the following hardware types have internal MMCs
  if test "x$OSSO_PRODUCT_HARDWARE" = "xRX-34" || \
     test "x$OSSO_PRODUCT_HARDWARE" = "xRX-44" || \
     test "x$OSSO_PRODUCT_HARDWARE" = "xRX-48" || \
     test "x$OSSO_PRODUCT_HARDWARE" = "xRX-51"; then

    export INTERNAL_MMC_MOUNTPOINT='/home/user/MyDocs'
    export INTERNAL_MMC_SWAP_LOCATION=$INTERNAL_MMC_MOUNTPOINT
    export OSSO_SWAP=$INTERNAL_MMC_MOUNTPOINT

    # enable UPnP/AV support
    export UPNP_ROOT='upnpav://'

    # enable multiple BT device support
    export DISABLE_GATEWAY=1
    export HILDON_FM_OBEX_ROOT='obex://'
  else
    export OSSO_SWAP=$MMC_MOUNTPOINT
  fi
  export ILLEGAL_FAT_CHARS=\\\/:\*\?\<\>\| MAX_FILENAME_LENGTH=255

  # MMC swap file location (directory)
  export MMC_SWAP_LOCATION=$MMC_MOUNTPOINT

  # The MyDocs directory
  if test "x$INTERNAL_MMC_MOUNTPOINT" = "x"; then
    export MYDOCSDIR=$HOME/MyDocs
  else
    export MYDOCSDIR=$INTERNAL_MMC_MOUNTPOINT
  fi

  source_if_is osso-gtk.defs
# There is no matchbox.defs in Fremantle
#  source_if_is matchbox.defs
  source_if_is keyboard.defs
  source_if_is sdl.defs

  # Enabling SAPWOOD_DEBUG when device is in rd-mode and in scratchbox
  if [ -d /scratchbox ]; then
    export SAPWOOD_DEBUG=scaling
  elif [ -f /usr/bin/cal-tool ]; then
    if (/usr/bin/cal-tool --get-rd-mode | grep enabled) > /dev/null; then
      export SAPWOOD_DEBUG=scaling
    fi
  fi

  export AF_DEFINES_SOURCED=1

fi  ;# AF_DEFINES_SOURCED definition check


Looks a bit weird for me... either the depending on OSSO needs to be removed from the program or we need to find out what environment variables are needed for the game to run.

The binary works fine (when using the correct libstdc++-library), otherwise it wouldn't show me that error :)
 
Last edited:
:) Thank you ED.
I'm crosscompiling using Codesourcery and codeblocks under windows...for the libstdc++.lib i think i have incorrectly setup the toolchain...
The lib OSSO is used on Maemo port (and on Nokia phone ) i could try to remove it.
 
Always happy to help. That game looks kick-ass :D

Looks like libosso is only needed for Maemo stuff, so it should be save to remove.
 
Farox said:
:) Thank you ED.
I'm crosscompiling using Codesourcery and codeblocks under windows...for the libstdc++.lib i think i have incorrectly setup the toolchain...
The lib OSSO is used on Maemo port (and on Nokia phone ) i could try to remove it.

you need to go back to an older Codesourcery like 2007q3, anything c++ ive had mismatches with anything newer.
 
Last edited by a moderator:
I'm using 2009q3 (the same Ivanovic, cpasjuste, etc. use) and that still works fine :)
 
EvilDragon said:
I'm using 2009q3 (the same Ivanovic, cpasjuste, etc. use) and that still works fine :)

are you getting the correct lib from angstrom, or copying the CS lib to the nand?
 
Last edited by a moderator:
Sorry for the late reply ...work and family could take time.. ;)

I have builded a new version without the lib OSSO and some other libs needed to build with this Nokia lib.

Download at ----------------- this is the binary file only , if you need to take the data you could see at first message ..

Sorry fixed link http://www.steekr.co...04c9a50e877f87/

I don't know how to fix the stdc++ error if some one could explain please...i will gratefull

Thank you .
 
Also i'm thinking of give to someone who have more time (A Pandora and more skills ;) ) the source because i will take too much time to build and submit the changes .
So if someone is interested let me know.
 
Tried to run it. All errors are gone exept for the libstdc++ errors.
Seems like you try to compile against a version that is not on the pandora.

There is this package in the nand:
http://www.angstrom-distribution.org/repo/?pkgname=libstdc%2B%2B6

And here is a develpackage in the angstromrepositories:
http://www.angstrom-distribution.org/repo/?pkgname=libstdc%2B%2B-dev

maybe try these for your build.

(I am no programmer or something, just try to help)

Edit: ED, where did you get the correct libs from and can you post them here?
 
Hm, still using wrong libstdc++-library... are you sure you are using the Pandora one?

Well, it goes further now, but I get the following output:

Code:
Preferences dir: .//.frogatto/
JOYSTICKS: 1
initialized ttf
initialized 1 joysticks
loading image './images/backgrounds/loading_screen.png'
IMAGE SIZE: 153600
OpenGL version: OpenGL ES-CM 1.1
OpenGL vendor: Imagination Technologies
OpenGL extensions: GL_OES_byte_coordinates GL_OES_fixed_point 
GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format 
GL_OES_compressed_paletted_texture GL_OES_point_sprite 
GL_OES_point_size_array GL_OES_matrix_palette GL_OES_draw_texture 
GL_OES_query_matrix GL_OES_texture_env_crossbar 
GL_OES_texture_mirrored_repeat GL_OES_texture_cube_map 
GL_OES_blend_subtract GL_OES_blend_func_separate 
GL_OES_blend_equation_separate GL_OES_stencil_wrap 
GL_OES_extended_matrix_palette GL_OES_framebuffer_object 
GL_OES_rgb8_rgba8 GL_OES_depth24 GL_OES_stencil8 
GL_OES_compressed_ETC1_RGB8_texture GL_OES_mapbuffer GL_OES_EGL_image 
GL_EXT_multi_draw_arrays GL_OES_required_internalformat 
GL_IMG_read_format GL_IMG_texture_compression_pvrtc 
GL_IMG_texture_format_BGRA8888 GL_EXT_texture_format_BGRA8888 
GL_IMG_texture_stream GL_IMG_vertex_program 
Using only pot textures
512KB TEXTURE backgrounds/loading_screen.png: 480x320
ILLEGAL SCHEMA ELEMENT: 'repeated character'
Pandora_Frogatto.bin: 
G:\Pandora\frogatto_102\pandora\wml_schema.cpp:117: 
wml::schema::schema(wml::const_node_ptr): Assertion `false' failed.
Aborted
 
EvilDragon said:
Hm, still using wrong libstdc++-library... are you sure you are using the Pandora one?

Well, it goes further now, but I get the following output:

Code:
ILLEGAL SCHEMA ELEMENT: 'repeated character'
Pandora_Frogatto.bin: 
G:\Pandora\frogatto_102\pandora\wml_schema.cpp:117: 
wml::schema::schema(wml::const_node_ptr): Assertion `false' failed.
Aborted
(trimmed the output to the relevant potion)

In general it looks like it does start correctly. That is: When starting some invalid stuff occurs. This issue is most likely not related to libstdc++. Could be that you either have some broken config files (.cfg files, the stuff where WML code is in) or the schema validator has a real problem. In general this is most likely not a plain lib issue.
 
Last edited by a moderator:
OK thanks for pointing out the error...

This is the code in Main.cpp
Code:
 graphics::texture::manager texture_manager;

    wml::const_node_ptr preloads;
    loading_screen loader;

    try {
        wml::schema::init(wml::parse_wml_from_file("data/schema.cfg"));  <--- [u]this is the file to load that give the error....[/u]
        graphical_font::init(wml::parse_wml_from_file("data/fonts.cfg"));
        preloads = wml::parse_wml_from_file("data/preload.cfg");
        int preload_items = std::distance(preloads->begin_child("preload"), preloads->end_child("preload"));
        loader.set_number_of_items(preload_items+7); // 7 is the number of items that will be loaded below
        loader.load(preloads);
        loader.draw_and_increment("Initializing custom object");
        custom_object::init();
        loader.draw_and_increment("Initializing custom object functions");
        init_custom_object_functions(wml::parse_wml_from_file("data/functions.cfg"));
        loader.draw_and_increment("Initializing tiles");
        tile_map::init(wml::parse_wml_from_file("data/tiles.cfg",
                       wml::schema::get("tiles")));
        loader.draw_and_increment("Initializing GUI");

        wml::const_node_ptr gui_node = wml::parse_wml_from_file(preferences::load_compiled() ? "data/compiled/gui.cfg" : "data/gui.cfg");
        gui_section::init(gui_node);
        loader.draw_and_increment("Initializing GUI");
        framed_gui_element::init(gui_node);
    } catch(const wml::parse_error& e) {
        return 0;
    }


now looking at the routine in wml_schema.cpp

Code:
schema::schema(wml::const_node_ptr node)
  : id_(node->name()), default_prefix_(node->attr("default_prefix"))
{
    for(wml::node::const_attr_iterator i = node->begin_attr();
        i != node->end_attr(); ++i) {
        assert(i->first.empty() == false);

        if(i->first[0] == '_') {
            std::string element(i->first.begin() + 1, i->first.end());
            static const boost::regex pattern("(optional|required|repeated) ([a-z_]+)");
            boost::smatch match;
            if(!boost::regex_match(i->second.str(), match, pattern)) {
                std::cerr << "ILLEGAL SCHEMA ELEMENT: '" << i->second << "'\n";
                assert(false);
            }

            element_info info;
            info.type = std::string(match[2].first, match[2].second);

            std::string cardinality(match[1].first, match[1].second);
            if(cardinality == "optional") {
                info.cardinality = ELEMENT_OPTIONAL;
            } else if(cardinality == "required") {
                info.cardinality = ELEMENT_REQUIRED;
            } else {
                info.cardinality = ELEMENT_REPEATED;
            }

            elements_[element] = info;
        } else {
            if(i->first != "default_prefix") {
                attributes_[i->first] = parse_attribute_info(i->second);
            }
        }
    }
}

i have compared the file schema.cfg with the windows version and are the same...i don't know :(

I have read on the forum of the Frogatto page that there are possible incompatibility with earlier version of Boost lib ...
now i'm downloading the latest from Angstrom repo , a new recompile will follow.
 
I have problem linking the last (on angstrom repo the version is 1.41.0-r8.1.6) compiled boost libs , in particular the regex lib that is compiled with ICU support .
links ....http://www.angstrom-distribution.org/repo/?pkgname=boost-regex

Now to link correctly is needed another set of libs libicuuc36 and libicui18n36 and libicudata36 so i added to the project but now the linker tell me that is needed a
new dat file that is part of ICU package (i think ) but is not in angstrom repo.

So if someone have time to build the new boost libs (the last version is 1.44.0 at http://www.boost.org/ )
without the ICU part that would be very nice ...i will try for myself but don't be sure if i can reach to build it.

Anyway if someone else want try to build the game i don't mind , my primary intention is to see the game runnable on Pandora.

Thanks
 
Farox said:
I have problem linking the last (on angstrom repo the version is 1.41.0-r8.1.6) compiled boost libs , in particular the regex lib that is compiled with ICU support .
links ....http://www.angstrom-...ame=boost-regex

Now to link correctly is needed another set of libs libicuuc36 and libicui18n36 and libicudata36 so i added to the project but now the linker tell me that is needed a
new dat file that is part of ICU package (i think ) but is not in angstrom repo.

So if someone have time to build the new boost libs (the last version is 1.44.0 at http://www.boost.org/ )
without the ICU part that would be very nice ...i will try for myself but don't be sure if i can reach to build it.

Anyway if someone else want try to build the game i don't mind , my primary intention is to see the game runnable on Pandora.

Thanks

I have boost built (1.41), i can give a try whats/where your latest source?
 
Last edited by a moderator:
Last edited by a moderator:
Back
Top