Author Topic: [68k] TIGCC under Linux?  (Read 13484 times)

0 Members and 1 Guest are viewing this topic.

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: [68k] TIGCC under Linux?
« Reply #15 on: January 31, 2012, 10:11:41 am »
Here is the script :D

Code: [Select]
As for sending files to TIEmu, when TIEmu is started:

dbus-send --dest=org.ticalc.lpg.tiemu.TiEmuDBus /org/ticalc/lpg/tiemu/TiEmuDBus \
  org.ticalc.lpg.tiemu.TiEmuDBus.send_file string:foo.89z

qdbus org.ticalc.lpg.tiemu.TiEmuDBus /org/ticalc/lpg/tiemu/TiEmuDBus send_file foo.89z



A script which handles starting TIEmu if it's not started yet, sending files to it, and executing a program:

#!/bin/bash
if qdbus | grep "^ *org.ticalc.lpg.tiemu.TiEmuDBus" > /dev/null ; then
    :
else
    tiemu &
    qdbus | grep "^ *org.ticalc.lpg.tiemu.TiEmuDBus" > /dev/null
fi
while [ $? -ne 0 ] ; do
    sleep 1
    qdbus | grep "^ *org.ticalc.lpg.tiemu.TiEmuDBus" > /dev/null
done
READY=`qdbus org.ticalc.lpg.tiemu.TiEmuDBus /org/ticalc/lpg/tiemu/TiEmuDBus ready_for_transfers`
if [ $? -ne 0 ] ; then
    echo 'error: ready_for_tranfers failed'
    exit 1
fi
while [ "$READY" == "false" ] ; do
    sleep 1
    READY=`qdbus org.ticalc.lpg.tiemu.TiEmuDBus /org/ticalc/lpg/tiemu/TiEmuDBus ready_for_transfers`
    if [ $? -ne 0 ] ; then
        echo 'error: ready_for_tranfers failed'
        exit 1
    fi
done
while [ -n "$1" ] ; do
    case "$1" in
      *.89[a-z]|*.9[2x][a-z]|*.v2[a-z])
        SUCCESS=`qdbus org.ticalc.lpg.tiemu.TiEmuDBus /org/ticalc/lpg/tiemu/TiEmuDBus send_file "$1"`
        if [ $? -ne 0 -o "$SUCCESS" == "false" ] ; then
            echo 'error: send_file failed'
            exit 1
        fi
        ;;
      *)
        SUCCESS=`qdbus org.ticalc.lpg.tiemu.TiEmuDBus /org/ticalc/lpg/tiemu/TiEmuDBus execute_command "$1"`
        if [ $? -ne 0 -o "$SUCCESS" == "false" ] ; then
            echo 'error: execute_command failed'
            exit 1
        fi
        ;;
    esac
    shift
done
exit 0

#Usage:
#./tiemudbus.sh tigcc-projects/bgammon/bgammon.89[yz] 'bgammon()'

Lionel gave it to me a time ago :D

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: [68k] TIGCC under Linux?
« Reply #16 on: January 31, 2012, 10:28:18 am »
Thanks ;)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: [68k] TIGCC under Linux?
« Reply #17 on: January 31, 2012, 10:48:13 am »
That script is great! Thanks :)

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: [68k] TIGCC under Linux?
« Reply #18 on: January 31, 2012, 03:00:55 pm »
Also, its really nice 68k is getting more active :)
Could it be that because of the Ndless, some 68k people returned?

Anyway, I'm happy :)