Ticket #8311: scummvm-linupy-noflip.patch

File scummvm-linupy-noflip.patch, 8.7 KB (added by SF/kilobug, 20 years ago)

A patch against CVS without xyflip code

  • backends/sdl/sdl-common.cpp

    diff -ru scummvm/backends/sdl/sdl-common.cpp scummvm-arm/backends/sdl/sdl-common.cpp
    old new  
    595595        while(SDL_PollEvent(&ev)) {
    596596                switch(ev.type) {
    597597                case SDL_KEYDOWN:
     598#ifdef LINUPY
     599                        // Yopy has no ALT key, steal the SHIFT key
     600                        // (which isn't used much anyway)
     601                        if (ev.key.keysym.mod & KMOD_SHIFT)
     602                                b |= KBD_ALT;
     603                        if (ev.key.keysym.mod & KMOD_CTRL)
     604                                b |= KBD_CTRL;
     605#else
    598606                        if (ev.key.keysym.mod & KMOD_SHIFT)
    599607                                b |= KBD_SHIFT;
    600608                        if (ev.key.keysym.mod & KMOD_CTRL)
    601609                                b |= KBD_CTRL;
    602610                        if (ev.key.keysym.mod & KMOD_ALT)
    603611                                b |= KBD_ALT;
     612#endif
    604613                        event->kbd.flags = b;
    605614
    606615                        // Alt-Return toggles full screen mode                         
     
    714723                                }
    715724                        }
    716725
     726#ifdef LINUPY
     727                        // On Yopy map the End button to quit
     728                        if ((ev.key.keysym.sym==293)) {
     729                                event->event_code = EVENT_QUIT;
     730                                return true;
     731                        }
     732                        // Map menu key to f5 (scumm menu)
     733                        if (ev.key.keysym.sym==306) {
     734                                event->event_code = EVENT_KEYDOWN;
     735                                event->kbd.keycode = SDLK_F5;
     736                                event->kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0);
     737                                return true;
     738                        }
     739                        // Map action key to action
     740                        if (ev.key.keysym.sym==291) {
     741                                event->event_code = EVENT_KEYDOWN;
     742                                event->kbd.keycode = SDLK_TAB;
     743                                event->kbd.ascii = mapKey(SDLK_TAB, ev.key.keysym.mod, 0);
     744                                return true;
     745                        }
     746                        // Map OK key to skip cinematic
     747                        if (ev.key.keysym.sym==292) {
     748                                event->event_code = EVENT_KEYDOWN;
     749                                event->kbd.keycode = SDLK_ESCAPE;
     750                                event->kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0);
     751                                return true;
     752                        }
     753#endif
     754
    717755#ifdef QTOPIA
    718756                        // quit on fn+backspace on zaurus
    719757                        if (ev.key.keysym.sym == 127) {
  • configure

    Only in scummvm-arm: config.h
    Only in scummvm-arm: config.log
    Only in scummvm-arm: config.mak
    diff -ru scummvm/configure scummvm-arm/configure
    old new  
    4242_backend=sdl
    4343_ranlib=ranlib
    4444_sdlconfig=sdl-config
     45_host=""
     46_sdlpath="$PATH"
    4547
    4648cc_check() {
    4749        echo >> "$TMPLOG"
     
    7577        return 0;
    7678}
    7779EOF
    78 eval "$1 -o tmp_cxx_compiler tmp_cxx_compiler.cpp 2> /dev/null" && eval "./tmp_cxx_compiler 2> /dev/null" && rm -f tmp_cxx_compiler tmp_cxx_compiler.cpp
     80
     81if test -n "$_host"; then
     82    # In cross-compiling mode, we cannot run the result
     83    eval "$1 -o tmp_cxx_compiler tmp_cxx_compiler.cpp 2> /dev/null" && rm -f tmp_cxx_compiler tmp_cxx_compiler.cpp
     84else
     85    eval "$1 -o tmp_cxx_compiler tmp_cxx_compiler.cpp 2> /dev/null" && eval "./tmp_cxx_compiler 2> /dev/null" && rm -f tmp_cxx_compiler tmp_cxx_compiler.cpp
     86fi
    7987}
    8088
    8189#
     
    9098       
    9199        IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS=":"
    92100       
    93         for path_dir in $PATH; do
     101        for path_dir in $_sdlpath; do
    94102          for sdlconfig in $sdlconfigs; do
    95             if test -e "$path_dir/$sdlconfig" ; then
    96               _sdlconfig=$sdlconfig
     103            if test -x "$path_dir/$sdlconfig" ; then
     104              _sdlconfig="$path_dir/$sdlconfig"
    97105              echo $_sdlconfig
    98106              break
    99107            fi
     
    171179  -h, --help             display this help and exit
    172180  --backend=BACKEND      backend to build (sdl, sdlgl, x11, morphos, dc, gp32) [sdl]
    173181
     182Special configuration feature:
     183  --host=HOST            cross-compile to target HOST (arm-linux, ...)
     184                         special targets: linupy for Yopy PDA
     185
    174186Optional Features:
    175187  --disable-scumm          don't build the SCUMM engine
    176188  --disable-simon          don't build the simon engine
     
    191203  --disable-zlib           disable zlib (compression) support [autodetect]
    192204  --disable-mpeg2          disable mpeg2 codec for cutscenes [autodetect]
    193205  --with-mpeg2-prefix=PFX  Prefix where libmpeg2 is installed (optional)
     206  --with-sdl-prefix=PFX    Prefix where the sdl-config script is installed
    194207 
    195208EOF
    196209    exit 0
     
    255268      --enable-release)
    256269        DEBFLAGS=""
    257270        ;;
     271      --with-sdl-prefix=*)
     272        arg=`echo $ac_option | cut -d '=' -f 2`
     273        _sdlpath="$arg:$arg/bin"
     274        ;;
     275      --host=*)
     276        _host=`echo $ac_option | cut -d '=' -f 2`
     277        ;;
    258278      *)
    259279        echo "error: unrecognised option: $ac_option
    260280Try \`$0 --help' for more information." >&2
     
    264284done;
    265285
    266286CXXFLAGS="$CXXFLAGS $DEBFLAGS"
     287
     288if test "$_host" = "linupy"; then
     289    _host=arm-linux
     290    CXXFLAGS="$CXXFLAGS -DLINUPY"
     291fi
     292
    267293#
    268294# Determine the C++ compiler
    269295#
    270296printf "Looking for C++ compiler... "
    271 compilers="$CXX g++ c++"
     297if test -n "$_host"; then
     298    compilers="$CXX $_host-g++ $_host-c++"
     299else
     300    compilers="$CXX g++ c++"
     301fi
     302
    272303CXX=
    273304for compiler in $compilers; do
    274   if test_compiler $compiler; then
    275     CXX=$compiler
    276     echo $CXX
    277     break
    278   fi
     305    if test_compiler $compiler; then
     306        CXX=$compiler
     307        echo $CXX
     308        break
     309    fi
    279310done
    280311if test -z $CXX; then
    281312    echo "none found!"
     
    373404        _mak_queen='# DISABLE_QUEEN = 1'
    374405fi
    375406
    376 #
    377 # Determine hosttype
    378 #
    379 # TODO - also add an command line option to override this?!?
    380 # TODO - recognize more systems, e.g. *BSD
    381 printf "Checking hosttype... "
    382 hosttype=`uname -s`
    383 echo $hosttype
    384 case $hosttype in
     407
     408if test -n "$_host"; then
     409    # Cross-compiling mode - add your target here if needed
     410    case "$_host" in
     411        arm-linux)
     412            echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
     413            DEFINES="$DEFINES -DUNIX"
     414            _def_endianess='#define SCUMM_LITTLE_ENDIAN'
     415            _def_align='#define SCUMM_NEED_ALIGNMENT'
     416            type_1_byte='char'
     417            type_2_byte='short'
     418            type_4_byte='int'
     419            ;;
     420        *)
     421            echo "Cross-compiling to unkown target, please add your target to configure."
     422            exit 1
     423            ;;
     424    esac
     425           
     426else
     427    #
     428    # Determine hosttype
     429    #
     430    # TODO - also add an command line option to override this?!?
     431    # TODO - recognize more systems, e.g. *BSD
     432    printf "Checking hosttype... "
     433    hosttype=`uname -s`
     434    echo $hosttype
     435    case $hosttype in
    385436        Linux | OpenBSD | FreeBSD | NetBSD | BSD/OS | SunOS | HP-UX | BeOS)
    386437                DEFINES="$DEFINES -DUNIX"
    387438                ;;
     
    410461                echo "WARNING: could not establish system type, assuming unix like"
    411462                DEFINES="$DEFINES -DUNIX"
    412463                ;;
    413 esac
     464    esac
    414465
    415 #
    416 # Check for endianess
    417 #
    418 printf "Checking endianess... "
    419 cat <<EOF >tmp_endianess_check.cpp
     466    #
     467    # Check for endianess
     468    #
     469    printf "Checking endianess... "
     470    cat <<EOF >tmp_endianess_check.cpp
    420471#include <stdio.h>
    421472#include <stdlib.h>
    422473int main(int argc, char **argv)
     
    432483        return 0;
    433484}
    434485EOF
    435 $CXX -o tmp_endianess_check tmp_endianess_check.cpp
    436 endianess=`./tmp_endianess_check`
    437 echo $endianess;
    438 case $endianess in
     486    $CXX -o tmp_endianess_check tmp_endianess_check.cpp
     487    endianess=`./tmp_endianess_check`
     488    echo $endianess;
     489    case $endianess in
    439490        big)
    440                 _def_endianess='#define SCUMM_BIG_ENDIAN'
    441                 ;;
     491            _def_endianess='#define SCUMM_BIG_ENDIAN'
     492            ;;
    442493        little)
    443                 _def_endianess='#define SCUMM_LITTLE_ENDIAN'
    444                 ;;
     494            _def_endianess='#define SCUMM_LITTLE_ENDIAN'
     495            ;;
    445496        *)
    446                 exit 1
    447                 ;;
    448 esac
    449 rm -f tmp_endianess_check tmp_endianess_check.cpp
    450 
    451 #
    452 # Check whether memory alignment is required
    453 #
    454 echo -n "Alignment required... "
    455 cat > $TMPC << EOF
     497            exit 1
     498            ;;
     499    esac
     500    rm -f tmp_endianess_check tmp_endianess_check.cpp
     501
     502    #
     503    # Check whether memory alignment is required
     504    #
     505    echo -n "Alignment required... "
     506    cat > $TMPC << EOF
    456507#include <stdlib.h>
    457508#include <signal.h>
    458509int main(int argc, char **argv)
     
    467518        return 0;
    468519}
    469520EOF
    470 _need_memalign=yes
    471 cc_check && $TMPO && _need_memalign=no
    472 if test "$_need_memalign" = yes ; then
    473   _def_align='#define SCUMM_NEED_ALIGNMENT'
    474 else
    475  _def_align='#undef SCUMM_NEED_ALIGNMENT'
     521    _need_memalign=yes
     522    cc_check && $TMPO && _need_memalign=no
     523    if test "$_need_memalign" = yes ; then
     524        _def_align='#define SCUMM_NEED_ALIGNMENT'
     525    else
     526        _def_align='#undef SCUMM_NEED_ALIGNMENT'
     527    fi
     528    echo "$_need_memalign"
     529
     530    #
     531    # Determine data type sizes
     532    # TODO: proper error checking
     533    #
     534    printf "Type with 1 byte... "
     535    type_1_byte=`find_type_with_size 1`
     536    echo "$type_1_byte"
     537   
     538    printf "Type with 2 bytes... "
     539    type_2_byte=`find_type_with_size 2`
     540    echo "$type_2_byte"
     541   
     542    printf "Type with 4 bytes... "
     543    type_4_byte=`find_type_with_size 4`
     544    echo "$type_4_byte"
     545   
    476546fi
    477 echo "$_need_memalign"
    478 
    479 #
    480 # Determine data type sizes
    481 # TODO: proper error checking
    482 #
    483 printf "Type with 1 byte... "
    484 type_1_byte=`find_type_with_size 1`
    485 echo "$type_1_byte"
    486 
    487 printf "Type with 2 bytes... "
    488 type_2_byte=`find_type_with_size 2`
    489 echo "$type_2_byte"
    490 
    491 printf "Type with 4 bytes... "
    492 type_4_byte=`find_type_with_size 4`
    493 echo "$type_4_byte"
    494 
    495547
    496548echocheck "Ogg Vorbis"
    497549if test "$_vorbis" = auto ; then