pax_global_header00006660000000000000000000000064132771150170014516gustar00rootroot0000000000000052 comment=4b0cfb90075c26f74a72e1ac8c5366d86f982fc7 libticalcs-1.1.9+dfsg/000077500000000000000000000000001327711501700145565ustar00rootroot00000000000000libticalcs-1.1.9+dfsg/ABOUT-NLS000066400000000000000000002721551327711501700160210ustar00rootroot000000000000001 Notes on the Free Translation Project *************************************** Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that free software will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work on translations can contact the appropriate team. When reporting bugs in the `intl/' directory or bugs which may be related to internationalization, you should tell about the version of `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. 1.1 Quick configuration advice ============================== If you want to exploit the full power of internationalization, you should configure it using ./configure --with-included-gettext to force usage of internationalizing routines provided within this package, despite the existence of internationalizing capabilities in the operating system where this package is being installed. So far, only the `gettext' implementation in the GNU C library version 2 provides as many features (such as locale alias, message inheritance, automatic charset conversion or plural form handling) as the implementation here. It is also not possible to offer this additional functionality on top of a `catgets' implementation. Future versions of GNU `gettext' will very likely convey even more functionality. So it might be a good idea to change to GNU `gettext' as soon as possible. So you need _not_ provide this option if you are using GNU libc 2 or you have installed a recent copy of the GNU gettext package with the included `libintl'. 1.2 INSTALL Matters =================== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. If not, the included GNU `gettext' library will be used. This library is wholly contained within this package, usually in the `intl/' subdirectory, so prior installation of the GNU `gettext' package is _not_ required. Installers may use special options at configuration time for changing the default behaviour. The commands: ./configure --with-included-gettext ./configure --disable-nls will, respectively, bypass any pre-existing `gettext' to use the internationalizing routines provided within this package, or else, _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl.a' file and will decide to use this. This might not be desirable. You should use the more recent version of the GNU `gettext' library. I.e. if the file `intl/VERSION' shows that the library which comes with this package is more recent, you should use ./configure --with-included-gettext to prevent auto-detection. The configuration process will not test for the `catgets' function and therefore it will not be used. The reason is that even an emulation of `gettext' on top of `catgets' could not provide all the extensions of the GNU `gettext' library. Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. 1.3 Using This Package ====================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. If you happen to have the `LC_ALL' or some other `LC_xxx' environment variables set, you should unset them before setting `LANG', otherwise the setting of `LANG' will not have the desired effect. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your language by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. Special advice for Norwegian users: The language code for Norwegian bokma*l changed from `no' to `nb' recently (in 2003). During the transition period, while some message catalogs for this language are installed under `nb' and some older ones under `no', it's recommended for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and older translations are used. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. 1.4 Translating Teams ===================== For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://translationproject.org/', in the "Teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `coordinator@translationproject.org' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skills are praised more than programming skills, here. 1.5 Available Packages ====================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of May 2010. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am ar as ast az be be@latin bg bn_IN bs ca crh +---------------------------------------------------+ a2ps | [] [] | aegis | | ant-phone | | anubis | | aspell | [] [] | bash | | bfd | | bibshelf | [] | binutils | | bison | | bison-runtime | [] | bluez-pin | [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] [] | cpio | | cppi | | cpplib | [] | cryptsetup | | dfarc | | dialog | [] [] | dico | | diffutils | [] | dink | | doodle | | e2fsprogs | [] | enscript | [] | exif | | fetchmail | [] | findutils | [] | flex | [] | freedink | | gas | | gawk | [] [] | gcal | [] | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] [] [] | gettext-tools | [] [] | gip | [] | gjay | | gliv | [] | glunarclock | [] [] | gnubiff | | gnucash | [] | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | | gold | | gpe-aerial | | gpe-beam | | gpe-bluetooth | | gpe-calendar | | gpe-clock | [] | gpe-conf | | gpe-contacts | | gpe-edit | | gpe-filemanager | | gpe-go | | gpe-login | | gpe-ownerinfo | [] | gpe-package | | gpe-sketchbook | | gpe-su | [] | gpe-taskmanager | [] | gpe-timesheet | [] | gpe-today | [] | gpe-todo | | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | [] [] | gsasl | | gss | | gst-plugins-bad | [] | gst-plugins-base | [] | gst-plugins-good | [] | gst-plugins-ugly | [] | gstreamer | [] [] [] | gtick | | gtkam | [] | gtkorphan | [] | gtkspell | [] [] [] | gutenprint | | hello | [] | help2man | | hylafax | | idutils | | indent | [] [] | iso_15924 | | iso_3166 | [] [] [] [] [] [] [] [] | iso_3166_2 | | iso_4217 | | iso_639 | [] [] [] [] [] | iso_639_3 | [] | jwhois | | kbd | | keytouch | [] | keytouch-editor | | keytouch-keyboa... | [] | klavaro | [] | latrine | | ld | [] | leafpad | [] [] | libc | [] [] | libexif | () | libextractor | | libgnutls | | libgpewidget | | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | [] | libidn | | lifelines | | liferea | [] [] | lilypond | | linkdr | [] | lordsawar | | lprng | | lynx | [] | m4 | | mailfromd | | mailutils | | make | | man-db | | man-db-manpages | | minicom | | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | | psmisc | | pspp | [] | pwdutils | | radius | [] | recode | [] [] | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] [] | sed | [] [] | sharutils | [] [] | shishi | | skencil | | solfege | | solfege-manual | | soundtracker | | sp | | sysstat | | tar | [] | texinfo | | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] [] | wyslij-po | | xchat | [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +---------------------------------------------------+ af am ar as ast az be be@latin bg bn_IN bs ca crh 6 0 2 3 19 1 11 3 28 3 1 38 5 cs da de el en en_GB en_ZA eo es et eu fa fi +-------------------------------------------------+ a2ps | [] [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] () | anubis | [] [] [] | aspell | [] [] [] [] [] | bash | [] [] [] [] | bfd | [] [] | bibshelf | [] [] [] [] | binutils | [] [] | bison | [] [] [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] | bombono-dvd | [] [] | buzztard | [] [] [] | cflow | [] [] [] | clisp | [] [] [] [] | coreutils | [] [] [] [] | cpio | [] | cppi | [] | cpplib | [] [] [] | cryptsetup | [] | dfarc | [] [] [] [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] [] | dink | [] [] [] | doodle | [] | e2fsprogs | [] [] [] | enscript | [] [] [] | exif | () [] [] [] | fetchmail | [] [] () [] [] [] | findutils | [] [] [] [] | flex | [] [] [] | freedink | [] [] [] [] | gas | [] | gawk | [] [] [] | gcal | [] | gcc | [] [] | gettext-examples | [] [] [] [] [] | gettext-runtime | [] [] [] [] [] | gettext-tools | [] [] [] | gip | [] [] [] [] [] | gjay | [] [] | gliv | [] [] [] [] | glunarclock | [] [] [] | gnubiff | () | gnucash | [] () () () () () | gnuedu | [] [] | gnulib | [] [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] [] | gpe-aerial | [] [] [] [] [] | gpe-beam | [] [] [] [] [] | gpe-bluetooth | [] [] [] | gpe-calendar | [] [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] [] [] | gpe-contacts | [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] [] | gpe-go | [] [] [] [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] [] [] [] | gpe-package | [] [] [] [] | gpe-sketchbook | [] [] [] [] [] | gpe-su | [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] | gpe-today | [] [] [] [] [] | gpe-todo | [] [] [] [] | gphoto2 | [] [] () [] [] [] [] | gprof | [] [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] [] | grub | [] [] [] | gsasl | [] [] | gss | [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] [] | gstreamer | [] [] [] [] [] [] | gtick | [] () [] [] | gtkam | [] [] () [] [] | gtkorphan | [] [] [] [] | gtkspell | [] [] [] [] [] [] [] [] | gutenprint | [] [] [] [] | hello | [] [] [] [] [] | help2man | [] [] | hylafax | [] [] | idutils | [] [] [] | indent | [] [] [] [] [] [] [] [] | iso_15924 | [] () [] [] [] | iso_3166 | [] [] [] () [] [] [] () [] | iso_3166_2 | () | iso_4217 | [] [] [] () [] [] [] | iso_639 | [] [] [] () [] [] [] | iso_639_3 | | jwhois | [] [] | kbd | [] [] [] [] [] | keytouch | [] [] [] | keytouch-editor | [] [] [] | keytouch-keyboa... | [] [] | klavaro | [] [] [] [] | latrine | [] () [] | ld | [] [] [] | leafpad | [] [] [] [] [] [] [] | libc | [] [] [] [] [] | libexif | [] [] () | libextractor | | libgnutls | [] | libgpewidget | [] [] [] | libgpg-error | [] [] | libgphoto2 | [] () | libgphoto2_port | [] () [] | libgsasl | [] | libiconv | [] [] [] [] [] [] | libidn | [] [] [] [] | lifelines | [] () | liferea | [] [] [] [] [] | lilypond | [] [] [] [] | linkdr | [] [] [] [] | lordsawar | [] | lprng | | lynx | [] [] [] [] | m4 | [] [] [] [] [] | mailfromd | | mailutils | [] | make | [] [] [] [] | man-db | | man-db-manpages | | minicom | [] [] [] [] [] | mkisofs | [] | myserver | | nano | [] [] [] [] | opcodes | [] [] [] | parted | [] [] | pies | | popt | [] [] [] [] [] [] | psmisc | [] [] [] [] | pspp | [] | pwdutils | [] | radius | [] | recode | [] [] [] [] [] [] [] | rosegarden | () () () () | rpm | [] [] [] | rush | | sarg | | screem | | scrollkeeper | [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] | sharutils | [] [] [] [] [] | shishi | | skencil | [] () [] | solfege | [] [] [] [] | solfege-manual | [] [] | soundtracker | [] [] [] | sp | [] | sysstat | [] [] [] [] | tar | [] [] [] [] [] | texinfo | [] [] [] | tin | [] [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] [] | vice | () () | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] [] | wget | [] [] [] [] | wyslij-po | [] | xchat | [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] [] | +-------------------------------------------------+ cs da de el en en_GB en_ZA eo es et eu fa fi 64 105 117 18 1 8 0 28 89 18 19 0 104 fr ga gl gu he hi hr hu hy id is it ja ka kn +------------------------------------------------+ a2ps | [] [] [] | aegis | [] [] | ant-phone | [] [] | anubis | [] [] [] | aspell | [] [] [] [] | bash | [] [] [] | bfd | [] [] | bibshelf | [] [] [] [] | binutils | [] [] | bison | [] [] [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] | bombono-dvd | | buzztard | [] | cflow | [] [] | clisp | [] | coreutils | [] [] [] [] [] | cpio | [] [] [] | cppi | [] | cpplib | [] [] | cryptsetup | [] [] [] | dfarc | [] [] | dialog | [] [] [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] [] [] | dink | [] | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] | exif | [] [] [] [] [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] | flex | [] [] | freedink | [] [] | gas | [] [] | gawk | [] [] [] [] () [] | gcal | [] | gcc | [] | gettext-examples | [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] | gettext-tools | [] [] [] [] | gip | [] [] [] [] [] | gjay | | gliv | () | glunarclock | [] [] [] | gnubiff | () [] () | gnucash | () () () () [] | gnuedu | [] [] | gnulib | [] [] [] [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] | gpe-aerial | [] [] | gpe-beam | [] [] [] | gpe-bluetooth | [] [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] | gpe-conf | [] [] [] | gpe-contacts | [] [] [] | gpe-edit | [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] [] | gpe-su | [] [] [] [] [] | gpe-taskmanager | [] [] [] [] | gpe-timesheet | [] [] [] [] | gpe-today | [] [] [] [] [] [] | gpe-todo | [] [] | gphoto2 | [] [] [] [] [] | gprof | [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] | grub | [] [] [] | gsasl | [] [] [] [] | gss | [] [] [] [] | gst-plugins-bad | [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] | gstreamer | [] [] [] [] | gtick | [] [] [] [] | gtkam | [] [] [] [] [] | gtkorphan | [] [] [] | gtkspell | [] [] [] [] [] [] [] [] | gutenprint | [] [] [] | hello | [] [] | help2man | [] | hylafax | [] | idutils | [] [] [] [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | () [] [] | iso_3166 | () [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | () [] [] [] | iso_4217 | () [] [] [] [] | iso_639 | () [] [] [] [] [] [] [] | iso_639_3 | () [] [] | jwhois | [] [] [] [] | kbd | [] [] | keytouch | [] [] [] [] [] | keytouch-editor | [] [] [] [] | keytouch-keyboa... | [] [] [] [] | klavaro | [] [] | latrine | [] [] | ld | [] [] [] | leafpad | [] [] [] [] [] [] () | libc | [] [] [] [] | libexif | | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] [] | libgphoto2_port | [] [] [] | libgsasl | [] [] [] [] | libiconv | [] [] [] [] [] | libidn | [] [] [] | lifelines | () | liferea | [] [] [] [] | lilypond | [] | linkdr | [] [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] [] [] | m4 | [] [] [] [] [] | mailfromd | | mailutils | [] [] | make | [] [] [] [] [] [] [] [] | man-db | [] [] | man-db-manpages | [] | minicom | [] [] [] [] | mkisofs | [] [] [] | myserver | | nano | [] [] [] [] [] | opcodes | [] [] [] | parted | [] [] [] [] | pies | | popt | [] [] [] [] [] [] [] [] | psmisc | [] [] | pspp | | pwdutils | [] [] | radius | [] [] | recode | [] [] [] [] [] [] [] | rosegarden | () () () () | rpm | [] [] | rush | | sarg | [] | screem | [] [] | scrollkeeper | [] [] [] | sed | [] [] [] [] [] [] [] | sharutils | [] [] [] [] [] [] | shishi | [] | skencil | [] | solfege | [] [] [] | solfege-manual | [] [] | soundtracker | [] [] | sp | [] () | sysstat | [] [] [] [] | tar | [] [] [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | [] [] | util-linux-ng | [] [] [] [] [] | vice | () () () | vmm | [] | vorbis-tools | [] | wastesedge | () () | wdiff | | wget | [] [] [] [] [] [] [] | wyslij-po | [] [] | xchat | [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] | +------------------------------------------------+ fr ga gl gu he hi hr hu hy id is it ja ka kn 121 53 20 4 8 2 5 53 2 120 5 83 66 0 4 ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne +-----------------------------------------------+ a2ps | [] | aegis | | ant-phone | | anubis | [] [] | aspell | [] | bash | | bfd | | bibshelf | [] [] | binutils | | bison | [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] | cpio | | cppi | | cpplib | | cryptsetup | | dfarc | [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] | dink | | doodle | | e2fsprogs | | enscript | | exif | [] | fetchmail | | findutils | | flex | | freedink | [] | gas | | gawk | | gcal | | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] | gettext-tools | [] | gip | [] [] | gjay | | gliv | | glunarclock | [] | gnubiff | | gnucash | () () () () | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | [] | gold | | gpe-aerial | [] | gpe-beam | [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] | gpe-contacts | [] [] | gpe-edit | [] | gpe-filemanager | [] [] | gpe-go | [] [] [] | gpe-login | [] | gpe-ownerinfo | [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] | gpe-timesheet | [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | | gsasl | | gss | | gst-plugins-bad | [] [] | gst-plugins-base | [] [] | gst-plugins-good | [] [] | gst-plugins-ugly | [] [] [] [] [] | gstreamer | | gtick | | gtkam | [] | gtkorphan | [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | | hello | [] [] [] | help2man | | hylafax | | idutils | | indent | | iso_15924 | [] [] | iso_3166 | [] [] () [] [] [] [] [] | iso_3166_2 | | iso_4217 | [] [] | iso_639 | [] [] | iso_639_3 | [] | jwhois | [] | kbd | | keytouch | [] | keytouch-editor | [] | keytouch-keyboa... | [] | klavaro | [] | latrine | [] | ld | | leafpad | [] [] [] | libc | [] | libexif | | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | | libidn | | lifelines | | liferea | | lilypond | | linkdr | | lordsawar | | lprng | | lynx | | m4 | | mailfromd | | mailutils | | make | [] | man-db | | man-db-manpages | | minicom | [] | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | [] [] [] | psmisc | | pspp | | pwdutils | | radius | | recode | | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] | sed | | sharutils | | shishi | | skencil | | solfege | [] | solfege-manual | | soundtracker | | sp | | sysstat | [] | tar | [] | texinfo | [] | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] | wyslij-po | | xchat | [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +-----------------------------------------------+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne 20 5 10 1 12 48 4 2 2 4 24 10 19 3 1 nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr +---------------------------------------------------+ a2ps | [] [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] [] | anubis | [] [] [] | aspell | [] [] [] [] [] | bash | [] [] | bfd | [] | bibshelf | [] [] | binutils | [] [] | bison | [] [] [] | bison-runtime | [] [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] () | buzztard | [] [] | cflow | [] | clisp | [] [] | coreutils | [] [] [] [] [] [] | cpio | [] [] [] | cppi | [] | cpplib | [] | cryptsetup | [] | dfarc | [] | dialog | [] [] [] [] | dico | [] | diffutils | [] [] [] [] [] [] | dink | () | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] [] | exif | [] [] [] () [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] | flex | [] [] [] [] [] | freedink | [] [] | gas | | gawk | [] [] [] [] | gcal | | gcc | [] | gettext-examples | [] [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] [] [] [] | gettext-tools | [] [] [] [] [] [] | gip | [] [] [] [] [] | gjay | | gliv | [] [] [] [] [] [] | glunarclock | [] [] [] [] [] | gnubiff | [] () | gnucash | [] () () () | gnuedu | [] | gnulib | [] [] [] [] | gnunet | | gnunet-gtk | | gnutls | [] [] | gold | | gpe-aerial | [] [] [] [] [] [] [] | gpe-beam | [] [] [] [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] [] [] [] | gpe-clock | [] [] [] [] [] [] [] [] | gpe-conf | [] [] [] [] [] [] [] | gpe-contacts | [] [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] [] [] [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] [] [] [] [] [] | gpe-su | [] [] [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] [] | gpe-todo | [] [] [] [] [] | gphoto2 | [] [] [] [] [] [] [] [] | gprof | [] [] [] | gpsdrive | [] [] | gramadoir | [] [] | grep | [] [] [] [] | grub | [] [] [] | gsasl | [] [] [] [] | gss | [] [] [] | gst-plugins-bad | [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] | gtkam | [] [] [] [] [] [] | gtkorphan | [] | gtkspell | [] [] [] [] [] [] [] [] [] [] | gutenprint | [] [] | hello | [] [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] [] [] [] | iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | iso_3166_2 | [] [] [] | iso_4217 | [] [] [] [] [] [] [] [] | iso_639 | [] [] [] [] [] [] [] [] [] | iso_639_3 | [] [] | jwhois | [] [] [] [] | kbd | [] [] [] | keytouch | [] [] [] | keytouch-editor | [] [] [] | keytouch-keyboa... | [] [] [] | klavaro | [] [] | latrine | [] [] | ld | | leafpad | [] [] [] [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] | libgphoto2_port | [] [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] | libidn | [] [] | lifelines | [] [] | liferea | [] [] [] [] [] () () [] | lilypond | [] | linkdr | [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] | m4 | [] [] [] [] [] | mailfromd | [] | mailutils | [] | make | [] [] [] [] | man-db | [] [] [] | man-db-manpages | [] [] [] | minicom | [] [] [] [] | mkisofs | [] [] [] | myserver | | nano | [] [] [] [] | opcodes | [] [] | parted | [] [] [] [] | pies | [] | popt | [] [] [] [] | psmisc | [] [] [] | pspp | [] [] | pwdutils | [] | radius | [] [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () | rpm | [] [] [] | rush | [] [] | sarg | | screem | | scrollkeeper | [] [] [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | [] | skencil | [] [] | solfege | [] [] [] [] | solfege-manual | [] [] [] | soundtracker | [] | sp | | sysstat | [] [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] [] | vice | [] | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] | +---------------------------------------------------+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr 135 10 4 7 105 1 29 61 47 91 3 55 47 8 37 sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW +---------------------------------------------------+ a2ps | [] [] [] [] [] | 27 aegis | [] | 9 ant-phone | [] [] [] [] | 9 anubis | [] [] [] [] | 15 aspell | [] [] [] | 20 bash | [] [] | 11 bfd | [] | 6 bibshelf | [] [] [] | 16 binutils | [] [] | 8 bison | [] [] | 12 bison-runtime | [] [] [] [] [] [] | 29 bluez-pin | [] [] [] [] [] [] [] [] | 37 bombono-dvd | [] | 4 buzztard | [] | 7 cflow | [] [] [] | 9 clisp | | 10 coreutils | [] [] [] [] | 22 cpio | [] [] [] [] [] [] | 13 cppi | [] [] | 5 cpplib | [] [] [] [] [] [] | 13 cryptsetup | [] [] | 7 dfarc | [] | 9 dialog | [] [] [] [] [] [] [] | 30 dico | [] | 2 diffutils | [] [] [] [] [] [] | 30 dink | | 4 doodle | [] [] | 7 e2fsprogs | [] [] [] | 11 enscript | [] [] [] [] | 17 exif | [] [] [] | 16 fetchmail | [] [] [] | 17 findutils | [] [] [] [] [] | 20 flex | [] [] [] [] | 15 freedink | [] | 10 gas | [] | 4 gawk | [] [] [] [] | 18 gcal | [] [] | 5 gcc | [] [] [] | 7 gettext-examples | [] [] [] [] [] [] [] | 34 gettext-runtime | [] [] [] [] [] [] [] | 30 gettext-tools | [] [] [] [] [] [] | 22 gip | [] [] [] [] | 22 gjay | [] | 3 gliv | [] [] [] | 14 glunarclock | [] [] [] [] [] | 19 gnubiff | [] [] | 4 gnucash | () [] () () | 9 gnuedu | [] [] | 7 gnulib | [] [] [] [] | 16 gnunet | [] | 1 gnunet-gtk | [] [] [] | 5 gnutls | [] [] [] | 10 gold | [] | 4 gpe-aerial | [] [] [] | 18 gpe-beam | [] [] [] | 19 gpe-bluetooth | [] [] [] | 13 gpe-calendar | [] [] [] [] | 12 gpe-clock | [] [] [] [] [] | 28 gpe-conf | [] [] [] [] | 20 gpe-contacts | [] [] [] | 17 gpe-edit | [] [] [] | 12 gpe-filemanager | [] [] [] [] | 16 gpe-go | [] [] [] [] [] | 25 gpe-login | [] [] [] | 11 gpe-ownerinfo | [] [] [] [] [] | 25 gpe-package | [] [] [] | 13 gpe-sketchbook | [] [] [] | 20 gpe-su | [] [] [] [] [] | 30 gpe-taskmanager | [] [] [] [] [] | 29 gpe-timesheet | [] [] [] [] [] | 25 gpe-today | [] [] [] [] [] [] | 30 gpe-todo | [] [] [] [] | 17 gphoto2 | [] [] [] [] [] | 24 gprof | [] [] [] | 15 gpsdrive | [] [] [] | 11 gramadoir | [] [] [] | 11 grep | [] [] [] | 10 grub | [] [] [] | 14 gsasl | [] [] [] [] | 14 gss | [] [] [] | 11 gst-plugins-bad | [] [] [] [] | 22 gst-plugins-base | [] [] [] [] [] | 24 gst-plugins-good | [] [] [] [] [] | 25 gst-plugins-ugly | [] [] [] [] [] | 29 gstreamer | [] [] [] [] | 22 gtick | [] [] [] | 13 gtkam | [] [] [] | 20 gtkorphan | [] [] [] | 14 gtkspell | [] [] [] [] [] [] [] [] [] | 45 gutenprint | [] | 10 hello | [] [] [] [] [] [] | 21 help2man | [] [] | 7 hylafax | [] | 5 idutils | [] [] [] [] | 17 indent | [] [] [] [] [] [] | 30 iso_15924 | () [] () [] [] | 16 iso_3166 | [] [] () [] [] () [] [] [] () | 53 iso_3166_2 | () [] () [] | 9 iso_4217 | [] () [] [] () [] [] | 26 iso_639 | [] [] [] () [] () [] [] [] [] | 38 iso_639_3 | [] () | 8 jwhois | [] [] [] [] [] | 16 kbd | [] [] [] [] [] | 15 keytouch | [] [] [] | 16 keytouch-editor | [] [] [] | 14 keytouch-keyboa... | [] [] [] | 14 klavaro | [] | 11 latrine | [] [] [] | 10 ld | [] [] [] [] | 11 leafpad | [] [] [] [] [] [] | 33 libc | [] [] [] [] [] | 21 libexif | [] () | 6 libextractor | [] | 1 libgnutls | [] [] [] | 9 libgpewidget | [] [] [] | 14 libgpg-error | [] [] [] | 9 libgphoto2 | [] [] | 8 libgphoto2_port | [] [] [] [] | 13 libgsasl | [] [] [] | 13 libiconv | [] [] [] [] | 21 libidn | () [] [] | 11 lifelines | [] | 4 liferea | [] [] [] | 21 lilypond | [] | 7 linkdr | [] [] [] [] [] | 17 lordsawar | | 1 lprng | [] | 3 lynx | [] [] [] [] | 17 m4 | [] [] [] [] | 19 mailfromd | [] [] | 3 mailutils | [] | 5 make | [] [] [] [] | 21 man-db | [] [] [] | 8 man-db-manpages | | 4 minicom | [] [] | 16 mkisofs | [] [] | 9 myserver | | 0 nano | [] [] [] [] | 21 opcodes | [] [] [] | 11 parted | [] [] [] [] [] | 15 pies | [] [] | 3 popt | [] [] [] [] [] [] | 27 psmisc | [] [] | 11 pspp | | 4 pwdutils | [] [] | 6 radius | [] [] | 9 recode | [] [] [] [] | 28 rosegarden | () | 0 rpm | [] [] [] | 11 rush | [] [] | 4 sarg | | 1 screem | [] | 3 scrollkeeper | [] [] [] [] [] | 27 sed | [] [] [] [] [] | 30 sharutils | [] [] [] [] [] | 22 shishi | [] | 3 skencil | [] [] | 7 solfege | [] [] [] [] | 16 solfege-manual | [] | 8 soundtracker | [] [] [] | 9 sp | [] | 3 sysstat | [] [] | 15 tar | [] [] [] [] [] [] | 23 texinfo | [] [] [] [] | 16 tin | | 4 unicode-han-tra... | | 0 unicode-transla... | | 2 util-linux-ng | [] [] [] [] | 20 vice | () () | 1 vmm | [] | 4 vorbis-tools | [] | 6 wastesedge | | 2 wdiff | [] [] | 7 wget | [] [] [] [] [] | 26 wyslij-po | [] [] | 8 xchat | [] [] [] [] [] [] | 36 xdg-user-dirs | [] [] [] [] [] [] [] [] [] | 60 xkeyboard-config | [] [] [] [] | 25 +---------------------------------------------------+ 84 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW 178 domains 119 1 3 2 0 10 66 50 155 17 97 7 41 2610 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If May 2010 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://translationproject.org/extra/matrix.html'. 1.6 Using `gettext' in new packages =================================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `coordinator@translationproject.org' to make the `.pot' files available to the translation teams. libticalcs-1.1.9+dfsg/AUTHORS000066400000000000000000000045201327711501700156270ustar00rootroot00000000000000Lionel Debroux: maintainer (2009-) ================================== web: http://lpg.ticalc.org/prj_tilp , http://tict.ticalc.org , https://tiplanet.org mail: lionel_debroux@yahoo.fr Romain Liévin (roms): former maintainer (1999-2009), main developer, Win32 port =============================================================================== web: http://lpg.ticalc.org/prj_tilp mail: roms@tilp.info Julien Blache (jb): Mac OS-X port, Debian packaging, libusb preliminary support =============================================================================== web: http://jblache.org mail: jb@jblache.org Tijl Coosemans (Kalimero): BSD port =================================== web: http://tijl.studentenweb.org mail: tijl@ulyssis.org -> some code and concepts of ticables-2 library Jesse Palmer (jp3d): icon designer ================================== web: http://jp3d.net mail: jp@jp3d.net Benjamin Moody (FloppusMaximus): TI-8x charset images, modern TI-Z80 support, ideas, etc. ========================================================================================= web: http://lpg.ticalc.org/prj_tilem/index.html mail: benjamin.moody@gmail.com Kevin Kofler: KDE file dialogs, miscellaneous improvements and bugfixes ======================================================================= web: http://www.tigen.org/kevin.kofler/ mail: kevin.kofler@chello.at Tyler Cassidy (tylerc): group file manager (GFM) ================================================ web: http://www.calcforge.org/ mail: nexon89@gmail.com Packagers and former packagers: =============================== - Julien Blache : Linux/Debian - Kevin Kofler : Linux/Fedora - Romain Liévin : Win32 - Lionel Debroux : Win32 - Albert Huang : Linux/Debian - Jon Sturm : Linux/Arch - Ben Rosser : Linux/Fedora - Fabian Vogt : Linux/OpenSUSE All the others who have contributed to ====================================== The users, the helpers, the testers, the bug reporters, ... Special thanks to Texas Instruments France who donated the following devices in order to help testing TILP II: * on Aug 22nd, 2005: 82, 83, 89, 92+, V200; * in July 2011: Nspire CX CAS; * in 2013: 84+CSE; * in 2015: 83PCE, 82A, 84+CE-T. libticalcs-1.1.9+dfsg/COPYING000066400000000000000000000432541327711501700156210ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. libticalcs-1.1.9+dfsg/ChangeLog000066400000000000000000001606221327711501700163370ustar00rootroot00000000000000SubVersion: $Id$ Log of changes (libticalcs): - 01/11/2016, version 1.1.9: debrouxl - comment out ID-List capability for the 83PCE and 84+CE. Reported by Adriweb, testing by Lionel unsurprisingly confirmed the issue. - add clock support for the TI-eZ80 series; add and use dusb_cmd_s_param_set_r_data_ack() to factor some code, add torture test for it. - fixes for 84+(SE) DUSB and TI-eZ80 ROM dumping issues reported by Irrelium, Pie-jacke and Adriweb on IRC. - use naming prefixes in dbus_pkt.h, dusb_cmd.h, nsp_cmd.h; fallout in other files. - lots of new DUSB parameter IDs, DUSB-related code hardening, new entries in InfosMask / CalcInfos, new functions related to DUSB vpkts, DUSB CAs, DUSB CPs, NSP vpkts, and the corresponding torture tests. - factor out more code in cmd{z80,68k}.c, thanks to a new helper function. - expose a bunch of tiz80_* and ti68k_* DBUS functions, which both raises flexibility and allows rewriting their callers as macros, factoring a bunch of (quasi-)duplicated code. - add Nspire key definitions file, use a mixture of generic and Nspire-specific send key in test_ticalcs_2. - widen key codes argument of ticalcs_calc_send_key() and CalcFncts.send_key() from 16 to 32 bits, so that ticalcs_calc_send_key() can be used for Nspire keypresses. - synchronize send_var and send_var_ns implementations, fixing e.g. missing entry->action == ACT_SKIP checks or a missing pbar update; prevent nullptr derefs and OOB writes upon specially crafted FileContent instances, which might be passed directly to libticalcs, though libtifiles is not supposed to generate such invalid structs (and probably doesn't under normal conditions, given lack of bug reports). - allocate a second 65542-byte buffer for DBUS in CalcHandle, and use it at several places. Fixes TI-68k/DBUS transfer issues reported by Oliver "Boscop" Hoog. - add a no-probe mode to test_ticalcs_2, so that e.g. dissection is available without a connected calculator. - fix a couple UMRs, factor out a bit of code related to sending TI-Z80 DBUS backups, print decimal size at more places. - move more globals to _CalcHandle for thread safety / independence of cable instances, which requires a bunch of API changes for passing CalcHandle *. Additionally, make a number of API parameters unsigned and fix the induced warnings. - export Nspire RLE-compressed screen uncompression as ticalcs_screen_nspire_rle_uncompress() and 84+CSE RLE-compressed screen uncompression as ticalcs_screen_84pcse_rle_uncompress(). - remove all occurrences of TRYF from calc_73.c, which completes, at long last, the TRYF removal work :) - remove all occurrences of TRYF from calc_9x.c, fix leaks and memory errors. - unify calc_89.c and calc_92.c to calc_9x.c. - fix VarEntry memory leaks, some of them pointed by Coverity. - fixes and improvements mainly in NSP code. - replace {snprintf,strncpy} + explicit termination by usage of new ticalcs_{slprintf,strlcpy} macros, as I should have done earlier (suggested by Benjamin Moody); include tiny pause.h and macros.h from internal.h; don't include ticonv.h explicitly, ticalcs.h depends on it through tifiles.h. - correct format of 84+ DUSB remote keycode packets. - fix TI-73 and 83+ keycode definitions, and add new keycodes. - unify calc_80.c, calc_83.c and calc_86.c to calc_8x.c. Remove all occurrences of TRYF from the merged file. - unify calc_85.c and calc_86.c. Remove all occurrences of TRYF from the merged file. - unify calc_82.c and calc_85.c, which are the closest calc_*.c files, as we knew. Remove all occurrences of TRYF from the merged file. - in calc_*.c files for DBUS calculators, use macros for calls to cmd*.c files, so that it's easier to spot the differences, for later unification of (a subset of) the code. Squelch several occurrences of diff noise. Non-Functional Change. - support sending backups to 84+ / 84+CSE / 82A / 84+T DUSB. - support sending/receiving backup version number for 83+ DBUS. - for Z80 DBUS, allow embedded NULs in variable names. - fix integer conversions when parsing Z80 backup headers. - expand the documentation of ticalcs_calc_isready. Suggested by Benjamin Moody. - use correct length when receiving apps from 84+ DUSB. - add initial support for 84+T model, fix several bugs in 82A support. - in the torture tests, use __LINE__ instead of a counter, and remove some of the blank lines. Suggested by Benjamin Moody. - in ticalcs_device_info_to_model(), use a saner default for unexpected variant for the TI-(e)Z80 USB cable, and constify the argument. Suggested by Benjamin Moody. - leverage ticonv_varname_to_utf8_sn() to simplify a significant number of repeated code snippets in calc_*.c; use ticonv_varname_to_utf8_sn() instead of ticonv_varname_to_utf8_s(). - treat all unknown rejection codes as errors. - handle version byte for DUSB transfers to 84+ series. - handle version byte for DBUS transfers to 83+/84+/84+CSE. - add 83PCE / 84+CE ROM dumping. Calculator-side dumper made by jacobly. - add and rewrite functions related to calc model categories and protocol support; replace a number of g_free() calls by wrapper of g_free() calls; add torture tests for the new functions. - split the bulk of dbus_recv() to dbus_recv_header() + dbus_recv_data(); export those and add torture tests for them; remove some long-dead code in dbus_pkt.c, remove dbus_recv_2(). Indirectly suggested by a discussion with SirCmpwn about the computer side of KnightOS's linking code; also a very old suggestion by Benjamin Moody. - kick out more occurrences of TRYF, is_ready + send_key + execute + recv_screen edition; factor out some code common to get_dirlist() functions; shorten the "length" argument of ti{89,92}_recv_XDP(); fix some bugs pointed by Benjamin Moody. - inline our trivial logging functions, which enables checking arguments wrt. format (without putting format annotations, that is), fix several bugs uncovered by this change; remove all remaining occurrences of TRYC from libticables. - add FTS_NONSILENT in CalcFeatures; advertise it for the 82, 85, 89/92+/89T(DBUS)/V200 and 92. - add Travis CI integration. - replace deprecated AC_PROG_LIBTOOL with LT_INIT. - add bitmap (screen) conversion functions, add ticalcs_calc_recv_screen_rgb888() and ticalcs_free_screen(), add torture tests, replace a number of Glib function calls by indirect equivalent calls. - in calc_84p.c::get_version(), add exact math retrieval, fix bpp, and add 83PCE/84+CE detection; add ticalcs_infos_to_string() (formerly the bulk of tilp_calc_get_infos()), add torture test, use it in test_ticalcs_2, add translations. - add DUSB packet dissection to libticalcs, already a superset of what libticables does for DUSB; add several bounds checks; in torture_ticalcs, use several subroutines to improve maintainability, add torture tests and unit tests. - fix a NULL pointer passed to memcpy in dusb_recv_data_varsize() flagged by ubsan; fix UMRs in dusb_cmd_r_var_header(); add support for receiving RclWindw from 83PCE / 84PCE (found by own tests, thanks Adrien "Adriweb" Bertrand" for the reason); whitespace changes. - fill in TI-eZ80 support in dusb_vpkt.c::workaround_{send,recv}(): computer -> calculator needs ZLPs, but calculator -> computer doesn't. Reported by jacobly. - fix a couple obvious errors in keys files. - import several functions from libti* clients (tilp, titools). Most functions made and/or suggested by Benjamin Moody. - define attribute 0x13 as AID_ARCHIVED2; omit harmful 'archived' attribute when deleting variables on DUSB calculators (84+ family, 83PCE/84+CE, 89T). - make FileContent.num_entries, FlashContent.num_pages, TigContent.n_vars, TigContent.n_apps, CableOptions.timeout, CableOptions.delay unsigned; have several functions of the API take or return unsigned int instead of int. - move some file-static variables (long-standing gripes of multiple persons) to a new struct inside _CalcHandle or use what's available there; add dusb_set_buf_size(), suggested by Benjamin Moody. - scattered fixes resulting from Coverity Scan, afl-fuzz and code inspection. - add a number of helper functions for symmetry, add them to the torture tests, and fix memory leaks & memory errors in the torture tests and/or the libraries. - fix -Wmissing-prototypes warnings, as suggested by Benjamin Moody; fix the build on FreeBSD 10; cleanup for MacOS X (twice, Adrien "Adriweb" Bertrand reported a buggy change). - add support for sending OS upgrade files, FlashApp files and > ~1000-byte regular files to, and receiving FlashApp files from, TI-eZ80 calculators. Add a product ID field to CalcFncts and instances thereof. - add .send_all_vars_backup and .recv_all_vars_backup function pointers to CalcFncts; adjust all instances of CalcFncts; add ticalcs_calc_{send,recv}_all_vars_backup(); change the prototype of internal tixx_recv_all_vars_backup(); reduce code duplication by introducing noop_*() functions in calc_00.c, and use them from other calc_*.c files. - nested folders support for Nspires (SF feature request #3459852); while at it, get rid of TRYF in Nspire code, as well as of the few TRYC in the library. - in the README, mention that autoreconf needs to be run before ./configure can run. Reported by SirCmpwn. - use the correct full name for the V200 PLT. Reported by Adrien "Adriweb" Bertrand. - export ERROR_EOT alongside ERROR_ABORT, it can be useful for some clients of the library. Suggested by Benjamin Moody. - fix packet size for DUSB remote keypresses. - when using VALIDATE_*() and RETURN_IF_*() macros, postfix them by ;, and for good measure, wrap them into do { ... } while(0);. Suggested by Adrien "Adriweb" Bertrand and Benjamin Moody. - add some 83PCE / 84+CE / 84+CE-T and 82A support, and perform the usual software engineering work. - fix dozens of more (UAF, DF, OOB accesses) or less (tiny memory leaks, dead code) severe issues reported by Coverity Scan. Several other issues found by code inspection. - define REJ_VERSION in dbus_pkt.h. - fix packet size for TI84PC variable headers. - restore special-casing of ERR_EOT return value from dusb_cmd_r_var_header(), lost in a recent commit. Reported by Hooloovoo. - Add .gitignore, remove globbing from libtifiles makefile.am, fix a warning in libticables error.c, remove unneeded config.h.in - get rid of TRYF in DUSB code and DUSB calc code, fixing a number of minor memory leaks and constifying pid / aid arrays in the process. - reduce code duplication by factoring sanity checks to new VALIDATE_*() and RETURN_IF_HANDLE_*() macros; several drive-by fixes, e.g. many remaining left shifts with count larger than width of type, or minor memory leaks caused by TRYF. - reduce code duplication by consolidating cmd73.c, cmd80.c, cmd82.c and cmd85.c into a single cmdz80.c file. Constify a data pointer argument to several functions. - reduce code duplication by consolidating cmd89.c and cmd92.c into a single cmd68k.c file. Constify a data pointer argument to several functions. - replace all remaining calls to strcpy() by strncpy(), even where no overflow would occur; several drive-by fixes, e.g. left shifts with count larger than type width, or initialization of local char arrays by empty constant strings. - fix the prototype of multiple ti*_XDP functions, reported by Michael Tautschnig (TILP SF bug #216). - attempt to cope with NULL CalcFncts pointers in improper CalcHandle structs; get rid of a number of TRYC. - add a bunch of machine IDs for communicating with CBL devices, found by CVSoft, Kerm and others. - add ticalcs_supported_calcs() API, suggested by Jonimus. - review error files. Have ticalcs_error_get() uniformly use g_strconcat/g_strdup like tifiles_error_get() and ticables_error_get(), instead of strcpy+strcat+g_strdup with a statically-sized buffer on the stack. - produce export (def) files on Win32. - build fixes for parallel make. - remove more auto-generated / copied files from the repository; upgrade gettext dependency to 0.18 (from May 2010). - in src, simplify TRYF(f(...)); return 0; to return f(...); in test_ticalcs_2, get rid of TRYF(). - fix romdump.c build after cmd73.h disappeared (the include wasn't needed anymore, at that); while at it, reformat the code, get rid of TRYF(...), make most functions from romdump.c static. - fix OS transfer on multiple TI-Z80 models. Patch by Jon Sturm, testing by him, Lionel and possibly others. - refactor headers exporting internal ti*_{send,recv}_* functions; add extern "C" for C++ mode to multiple exported headers. - kill a bunch of memory errors spotted by AddressSanitizer in the TI-Z80 and TI-68k calc_* and cmd* files; harden cmd82, cmd85, cmd92 and export the corresponding headers; add torture tests for newly exported functions. - in test_ticalcs_2, make sure not to read past the bounds of the array of function pointers. - add support for several DBUS commands for the 83+ family: sending EKE, DKE, ELD, DLD, GID, RID and SID, and receiving SID. Use them in test_ticalcs_2, add them to torture test. - harden and export cmd73, cmd80 and cmd89 functions; expand torture test. - in torture tests, print local traces to stderr instead of stdout. This restores `make check` output with recent autotools versions. - add two commands for sending and reading generic data in NavNet format from a Nspire, similar to TI's TI_NN_Write and TI_NN_Read; reimplement echo commands using the new commands; add the new functions to torture test. - remove auto-generated configure & Makefile.in from the repository. - fix a double free reported by aeTIos in the Nspire OS sending code, and a nearby memory leak while at it. - add support for 84+CSE screenshots. - add dusb_cmd_r_screenshot function, and torture tests. - add dusb_recv_data_varsize function, and torture tests. - add 84+CSE ROM dumping support, for both legacy I/O and DirectLink. - 31/03/2013, version 1.1.8: debrouxl - fix off-by-one in calc_84p.c::get_version(), which led to the last character of the product ID being cut off. Reported by ParkeR. - advertise ROM dumping support in CalcFncts calc_84p_usb. - regenerate with Autoconf 2.69 and Automake 1.11.5. - suppress name clashes between dusb_rpkt.h / nsp_rpkt.h and dusb_vpkt.h / nsp_vpkt.h. - export dbus_recv, dbus_send, dusb_recv, dusb_send, nsp_recv and nsp_send, i.e. provide to external users the ability to send and receive raw packets. - protect {dbus,dusb,nsp}_{recv,send} against NULL parameters. - add "torture test" programs for testing how functions of the public API react to NULL parameters. - fix several malloc/realloc/free vs. g_malloc/g_malloc0/g_free mismatches. - move a number of internal definitions to a new "internal.h" header; add several traces. - rename a bunch of internal functions, and remove the corresponding internal macros. - TI-68k ROM dumpers: remove redundant definitions of uint8_t, uint16_t and uint32_t. - integrate tf2hex and the ROM dumpers into the autotools chain, by Benjamin Moody. - add variable rename and variable attribute change functions, by Benjamin Moody; improve test_ticalcs_2; several drive-by fixes and improvements. - DUSB / NSP: kill more NULL dereferences by sanitizing function arguments; get rid of a number of TRYF; add a DUSB error code. - a fix for dusb_cmd, and an improvement to test_ticalcs_2. - integrate a couple fixes to the 84+ DUSB ROM dumper by Benjamin Moody, and switch the source code and building process of that ROM dumper from tasm to spasm. - integrate new TI-Z80 ROM dumper (with, among others, the ability to automatically dump 82 and 85, and the ability to unlock 73/83+/84+ Flash memory without an OS patch), and other ROM dumping improvements, by Benjamin Moody. - integrate the TI-68k ROM dumpers into the automake definitions, and optimize them in the process. - regenerate with Automake 1.11.6. - use LF line endings throughout the sources. - add initial, experimental TI-80 VSC support, by Randy Compton. - convert README to UTF-8. - add a Nspire error code related to OS extensions on OS versions which do not support them; add OS sending to test_ticalcs_2. - fix some spelling errors (or at least, infrequent forms) reported by Lintian (through Albert "alberthro" Huang) and rpmlint (through TC01). - fixes for i18n problems reported by Benjamin Moody. - in order to promote code reuse by external users of the library (instead of copy-paste), export functions from nsp_cmd and nsp_vpkt into the public API (though backwards compatibility will not necessarily be maintained strongly). - install keys83.h and keys86.h alongside the other headers. - add Nspire remote control feature, to mirror functionality exposed by TI's code and used by nRemote. Showcase it in test_ticalcs_2. - expand torture tests, and perform minor fixes. - update "counters" arrays in CalcFncts instances. They have been broken for years, since the DUMP_ROM -> DUMP_ROM1 + DUMP_ROM2 change, or the addition of EXECUTE, whichever occurred first. - in 84+ DUSB ROM dumper, enable UnlockFlash, so that the certificate page can be dumped. - test_ticalcs_2: in send_var(), add the ability to define the file name, if the target calculator is Nspire. - fix a number of problems related to unaligned reads/writes and left shifts of count >= width of type; fix more compiler warnings reported by clang. - fix more compiler warnings reported (or made more visible) by clang. - add 83+ family DBUS memory dump command; while at it, reformat, harden and export functions from cmd73.c. - when communicating with 84+ through DUSB, allow variables with the same name but different types. Patch by Benjamin Moody. Additionally, add a couple debugging traces in test_ticalcs_2. - add known 84+CSE hardware version, and plausible default model for unknown hardware versions. Reported by Benjamin Moody. - add prefixes to a number of functions and struct names, and adjust callers. - export dusb_vpkt functions and header, add torture test. - temporary kludge for sending 84+CSE Pic files. Patch by Benjamin Moody. - export dbus_cmd functions, add torture tests for dusb_cmd functions. - add several known command DBUS IDs (documented by Benjamin Moody and Brandon Wilson), this patch mostly by Jon Sturm. - nsp_cmd: add the 0x06 command, whose externally visible effect is to trigger a dialog whose title is "Transfers complete" and text is "All files have been transferred". - 14/12/2011, version 1.1.7: debrouxl - add error code returned by the Nspire when the anti-downgrade protection refuses an OS version older than the configured minimum version. - add support for getting screenshots from Nspire CX calculators. - nsp_rpkt.c: add a mode for dumping at most 12 bytes of the virtual packet, and make it default. - upgrade COPYING files and FSF addresses embedded in files, so as to make rpmlint happier. - dusb_cmd.c: cmd_r_var_content(): print size correctly. - reconfigure with autoconf 2.68 and libtool 2.4. - reconfigure with libtool 2.4.2. - take a whack at hundreds of NULL pointer dereferences by sanitizing function arguments. - move the workaround for file transfers of peculiar sizes mainly to libticalcs. - fix the incorrect reporting of Flashapps' sizes for 73 / 83+ family, when the DBUS protocol is used (SF bug #3440569). Reported and patched by Benjamin Moody, tested by Benjamin and Lionel. - if we're talking to a 73, don't try to test for 83+SE. The oldest 73 OS versions don't support get_version. Reported by Benjamin Moody, fix discussed by Lionel and Benjamin. - add error code returned by DUSB protocol calcs when refusing a FlashApp whose signature does not match. Reported by Albert H. - upgrade version of gettext to 0.17, released in late 2007. - add error code returned by Nspires when they're out of memory. Reported by XseuguhX. - 28/05/2011, version 1.1.6: debrouxl - remove autogenerated Changelog files and empty TRANSLATORS files. - change encoding in .rc file. - update the documentation of a number of functions in calc_xx.c. - fix ticalcs_dirlist_ve_exist for 73, 82, 83, 83+ and 84+: match types (in addition to names) for those models (reported by Jon Sturm). - fix a number of Nspire operations wrt. path names smaller than 8 characters. - implement variable deletion on the Nspire. - implement folder creation and deletion on the Nspire. - remove several functions that have been deprecated for years. - compiler warning fixes - misc. minor changes: - fix a number of compiler warnings, memory leaks, unclosed files. - DUSB DELAY_ACK packets: clamp absurdly high delay values, which can freeze libticalcs and its clients (SF bug #3002538, reported by "jimhap"). - fix Nspire ID retrieval: the two first characters were cut off. - misc. changes and documentation updates, most of them Nspire-related. - fix 86 ROM dumping. - minor changes to make autotools definitions work with both libtool 1.x and 2.x. - use AM_GNU_GETTEXT_VERSION to use a consistent version of gettext (namely 0.16, released in late 2006). - add support for dumping the OS of Nspire (CAS) calculators running OS 1.x. - avoid NULL dereferences in dirlist.c. - when receiving data from a Nspire, don't crash if we received zero bytes (this can happen). - prevent several other NULL dereferences. - don't crash upon sub-folders of folders. - prevent a number of NULL dereferences, and turn abrupt program aborts such as assert() and exit() into tests + ti*_critical(). - make it possible to receive 0-byte variables from a Nspire. - fix Nspire transfers that fail if the file has certain sizes (SF.net bug #3056097). - reconfigure under Debian Squeeze with Autoconf 2.67 and Automake 1.11.1. - add VS 2008 project/solution files. - fix a declaration after statement reported by Buckeye. - documentation and comment updates. - increase maximum delay value in CATCH_DELAY to 400K. - fix compilation of dusb_vpkt.c with VPKT_DBG=2. - hack to enable receiving variables from Nspires running OS >= 1.7, which return a martian ACK packet. - when performing a dirlist operation on Nspires, don't try to enumerate as folders TNS documents at the root of the "My documents" folder (e.g. themes.csv on OS 3.0+). - properly reset timeout in calc_nsp.c::is_ready. - 08/04/2010, version 1.1.5: debrouxl - TI-8x (Z80) ROM dumper source code relicensed to GPL, with Benjamin Moody's authorization. - TI-68k: when receiving a variable, strip the folder name if any. - added several missing "break;" in a switch() construct (calc_89.c). Reported by Patrick Pélissier. - added DirectLink USB ROM dumper for 84+ contributed by Brandon Wilson. - major fix: make Nspire connection reliable, at the expense of latency. - fixed cmd_s_execute (DUSB command) for 84+, perform more testing for both 89T and 84+. - renamed CMD_FM_UNKNOWN to CMD_FM_ATTRIBUTES. - updated translations. - updated to Autoconf 2.65. - 05/05/2009, version 1.1.4: roms - added new DBUS error code (invalid FLASH app signature) - 08/08/2008, version 1.1.3: roms - modified to support NSpire OS 1.4 (LOGIN packet with disconnection) - 26/01/2008, version 1.1.2: roms - added real support of OS 1.2 & 1.3 (true LOGIN packet support) - NSpire sequence number implemented fine now - NSpire CAS tested: fixed copying of Product Name - fixed bug #1885785 (error making libticalcs 1.1.0 on OS-X) - 22/01/2008, version 1.1.1: roms - added unknown directory list command for NSpire - 16/10/2007, version 1.1.0: roms - adding NSpire support... - unified Product Number & Main Calc Id into Product Id and maintained compatibility - use ticables_get_usb_devices() to probe USB hand-helds rathen than heuristic method (more reliable) - fixed printing of SKP packet (1 byte) - 04/10/2007, version 1.0.9: roms - fixed ROM dumping on TI92+/V200: switching to HOME screen failed - ROM dumping thru SilverLink under Linux is sometimes failing - added pause between file sending and ready check (fix bug #1808645?) - replaced some raw key codes by #defined ones - fixed some keys defines to be compliant with the HandHeld User's Manual (the manual defines the 'Q' key and not the 'q' one) - skip existing app when sending a TiGroup file (apps can't be overwritten) - 17/09/2007, version 1.0.8: roms - fixed full screen copy with Titanium - fixed displaying of full path with Titanium/USB - fixed sending of FLASH apps on TI73 - fixed sending of FLASH apps on non-SE (bug introduced in rev. 3291) - fixed progress bar update for backup & tigroup receiving - don't break USB communication if ROM dumping has been canceled - some Titanium/USB transfer can fail: fixed. - 17/06/2007, version 1.0.7: roms - fixed bug in ticalcs_dirlist_destroy: don't free TreeInfo when tree has no folder - replaced malloc/free by g_malloc/g_free - replaced TNode by GNode as provided by GLib - changed args for ticalcs_dirlist_ve_exist, otherwise this function is buggy with TI8x varnames (like lists due to presence of the '\' character) - fixed bug in ticalcs_dirlist_ve_add when no folder exists yet - added permanent TI83+/TI84+/83/86 variables to dirlist (Window Settings and others) - updated to follow ticonv API changes - USB hand-helds: fixed size of attribute array (usually smaller than needed). - 12/04/2007, version 1.0.6: roms - wrong battery status (debug) - no clock in TI83+ (SE); no clock in TI84+, too (not handled yet) - bug #1563667: impossible to flash TI-83+/SE - 23/02/2007, version 1.0.5: roms - enabled i18n - fixed TiEmu bug #1675675 / TiLP bug #1676133 - 18/02/2007, version 1.0.4: roms - added a new CalcFncts function entry: can execute a program remotely - added/fixed arrays for TI73,TI83+ and TI86 keys (needed by remote exec) - fixed bug #1657175: small program (309 bytes) are rejected by D-USB because too small. Ti-Connect re-negotiate packet size to a smaller value before sending variable contents. - 02/02/2007, version 1.0.3: roms - Kevin discovered a new D-USB command (0x11) which is related to remote control! - DirectLink remote control support implemented for Titanium - rom dumping is now remote controlled - 89/92/92+: set to HOME screen before sending dumping program - fixed "Conditional jump or move depends on uninitialised value(s)" bug (kevin) - fixed remote keys for TI84+/USB (little-endian) - 12/11/2006, version 1.0.2: roms - fixed memory overlap in send_flash_app (may be related to bug #1583155) - 21/02/2006, version 1.0.1: roms - use angle brackets to include installed ticonv.h (kevin). - conditionalize #pragma warning on #ifdef _MSC_VER, not #ifdef __WIN32_ (kevin). - changed TIEXPORT into TIEXPORT3 - B. Moody fix: replaced all snprintf by g_snprintf (truncate OS version under Linux) - 68k ROM dumpers: only dump 4 MB on HW4 (same as HW3) - check handle to avoid NULL dereference - dusb_cmd.c: uses BB00 packet value as delay - Titanium can't handle more that 16 parameters at a time => get_version split - 17/09/2006, tagged as version 1.0.0: roms - added support for TILIBS_DEPRECATED (exports symbols which have been tagged as deprecated) - 14/09/2006, version 0.2.8: roms - splitted ROM dumping into 2 parts (prgm sending and ROM receiving) so that user can have time to enter required commands - fixed TI73 OS sending - fixed TI73 version (BCD encoded) - fixed sending of FLASH OS on V200PLT (need to pass HW_ID). - 04/09/2006, version 0.2.7: roms - fixed TI73 probing - added new TI89 error code (0x21: can't delete var) - exported ERR_ABORT value - fixed TI84+ battery status - updated/fixed TI86 dumper - Titanium/USB didn't have the FTS_FOLDER flag - correctly set up the data_type & device_type field of FlashContent when receiving app - 26/08/2006, version 0.2.6: roms - checked with Valgrind, tested and validated. - 08/08/2006, version 0.2.5: roms - added TIG_BACKUP flag (needed to avoid clearing of RAM) - convert DUSB error packets into error message (O. Armand request) - convert DBUS error packets into error message (K. Kofler request) - 18/07/2006, version 0.2.4: roms - added ticalcs_probe for Kevin and I. This function is complete because it handles all of the probing (open/close handle, probe for all/FLASH only devices). - fixed TI-73 ROM dumps (untested, but the previous code definitely didn't work) (kevin) - fixed _FORTIFY_SOURCE and strict-aliasing warnings (kevin) - fixed warnings and bugs in the test program (kevin) - fixed "warning C4018: '<' : signed/unsigned mismatch" with MSVC - 07/07/2006, version 0.2.3: roms - refresh total counter (cnt3) when sending TiGroup file - begins count at 1 instead of 0 (cnt3) - fixed filename translation in TiGroup support - for now, use this naming scheme for TI9x var filenames: folder.var.extension (as tifiles2). - look for the correct module file name on MinGW in ticalcs_library_init (kevin) - 16/06/2006, version 0.2.2: roms - added full backup capability thru TiGroup files - 11/06/2006, version 0.2.1: roms - reworked/added field in CalcUpdate structure (API compat broken here, again) - added field in the CalcFncts structure which tells which counter may be used for refresh - checked/fixed all pbar counters - fixed typo (waiting -> waiting for) - some calcs needs 2P1L refresh for ROM dumper - some varname<->utf conversions were missing - adapt refresh of cnt1 depending on the link cable transfer capability - reset cnt2 value at transfer startup (needed and missing) - 08/06/2006, version 0.2.0: roms - reworked dirlist API (API compat broken here) - changed FLASH app dirlist format to be the same as var one - don't count archived (=FLASH) variables in ticalcs_dirlist_ram_used - updated 68k ROM dumpers to dump 8 MB on HW4 and rebuilt them with the latest CVS TIGCC (GCC 4.1.1, reduces size) (kevin) - 05/06/2006, version 0.1.5: roms - added stdints3.h header - increased verbosity of USB commands layer - re-enabled TI84+ OS sending - 31/05/2006, version 0.1.4: roms - don't export ticalcs_probe_calc_1/2 any longer because they can't be used easily outside of the library - fixed critical bug in the DBUS (2-bytes buffer overflow) and possible bug in the DUSB packet layer (null remainder). - fixed bug in TI84+ recv_idlist (attempting to modify const string) - 26/05/2006, version 0.1.3: roms/tyler - definetely fixed warnings on TI keys structures (roms) - fixed TI-83+/TI-84+ ROM Dumping Timeout Error Bug (tyler) - 16/05/2006, version 0.1.2: roms - implemented send_os for Titanium/USB and fixed some commands - implemented send_os for TI84+/USB - added Titanium/USB ROM dumper - increased ROM dumper block size from 1KB to 4KB (faster) - fixed misfeature in Titanium get_dirlist - fixed OS sending page address in TI84+/USB support - 06/05/2006, version 0.1.1: roms - make ticalcs_dirlist_mem_used useable with apps tree - implemented get_memfree functions - added a new probing method for USB hand-helds only (faster) - added FTS_BACKUP flag for hand-helds with real backup capability - added common function which emulates a backup by grouping - definitely fixed return value for probing functions - implemented a garbage collector for virtual packets, calc attributes anc calc parameters. Needed because a DUSB function may returns an error without releasing allocated memory (easier by this way). - added ticalcs_dirlist_flash_used which count memory used by both archived variables and apps - fixed pbar with TI73/84+ sending of FLASH app - fixed ca_del_array & cp_del_array for garbage collector - manage hand-held error codes - manage delaying packets - 15/04/2006, version 0.1.0: roms - implemented USB hand-helds support - split sending of FLASH app & os into 2 functions. - renamed some function of the API (send/recv_flash into send/recv_app) - 25/03/2006, version 0.0.8: roms - bitmap for screenshot is now allocated at the end of transfer. - work on DirectLink in progress. - 16/03/2006, version 0.0.7: roms - fixed bug in TI92 recv_backup - added periodic refresh from callbacks - 21/02/2006, version 0.0.6: roms - switched to ticonv library - send HOME key before dumping - don't list some system variables which appears in dirlist: regCoef and regEq. - fixed is_ready which checked the LSB instead of the MSB status word - added 2 functions for adding/removing an entry from a dirlist tree - directory list is now free'd - fixed TI73 sending & receiving of FLASH apps - fixed OS version formatting - set hw revision to -1 (n/a) for TI8x calcs - don't use static Flash/FileContent structures: they are badly released because often not zero'ed. - 20/02/2006, version 0.0.5: roms - error message is a glib allocated string for now. - 23/01/2006, version 0.0.4: roms - modified to follow ticables2 API changes. - fixed critical bug in ticalcs2.pc.in: the header location was include/tilp instead of include/tilp2 - 24/09/2005, version 0.0.3: roms - fixed critical bug in dbus_send: use len instead of length which makes 64KB blocks copied as 0B blocks :-( - 14/09/2005, version 0.0.2: roms - fixed/updated recv_var_ns routines - fixed build of /docs (Tijl) - TI73/8X+ auto-probe support updated. Calculator probing updated. Note: host check has been disabled in dbus_recv_ because ticalcs_probe may be used on any TI9x calc. - fixed non-exported symbol because exportX.h didn't include config.h (fvisibility). - 15/05/2005, version 0.0.1: roms - logging reworked (use glib) - a single public header with functions & defs, others are private - slightly fixed namespace sheme - use strong types such as TiCalcModel, ... - glib is used for logging (not very much for strings) - documentation system has been changed - functions pointers have been removed - library has been fully documented - decreased number of headers to include (1 or 3) ====[ Version II ]==== - 24/04/2005, version 4.5.9: roms Adding new function for non-silent variable receiving support. Needed for TiEmu (receive file). Bug fix from Christian Walther in non-silent variable receiving (folder name). - 05/03/2005, version 4.5.8: roms Added gcc 4.0 -fvisibility flag support. - 28/02/2005, version 4.5.7: roms Removed JB testing code in TI92 is_ready. Fixed TI89 Titanium ROM size in the progress bar. Fixed ROM dumping support for TI83+/84+ Silver Edition but still unusable. - 29/01/2005, version 4.5.6: roms Fixed TI89 unit to support Titanium FLASH transfers. Fixed TI73 unit to support TI84+ FLASH transfers. - 02/10/2004, version 4.5.5: roms Replaced VTi's TI83+ ROM dumper by a new one developped by "Benjamin Moody" . Works with 83+/84+. - 18/09/2004, version 4.5.4: roms Added TI89 Titanium support. File format seems to be the same as TI89. Added TI84+ (SE) support. File format seems to be the same as TI83+. Removed VTi's TI89/92+ ROM dumper by my own ROM dumper for TI89/TI92+/V200PLT/Titanium. Note: OS upgrade does not work on TI89t/TI84+. - 08/04/2004, version 4.5.3: roms Redirection of stdout/stderr. Fixed problem of i18n support: AM_GNU_GETTEXT must be put before any libs checking. - 20/03/2004, version 4.5.2: roms Added tree management (hacked from GLib) for internal use. This way removes GLib dependancies as well as multiple llibraries version (GLib 1.2 & 2.0). Added endianess check in configure for Mac OS. Tested with TiEmu: ok (backward compatible). Tested with TiLP: ok (need latest lib). Bug fix in tixx_directorylist2 (XXXX_NODE_NAME was not duplicated by malloc). This is the reason why dirlist v1=>2 was buggy ! - 27/08/2003, version 4.5.1: Maintenance release by JB. Upgraded to libtool 1.5 Upgraded to automake 1.7 Fixed src12/Makefile.am - 10/05/2003, version 4.5.0: Variable name is now translated for all calcs (charsets and tokens). - 15/04/2003, version 4.4.9: Added is_flash field (for consistency). - 12/04/2003, version 4.4.8: Changed src20 to src. - 30/03/2003, version 4.4.7: i18n updated. Included French translations. Code source parsed for _() occurences. i18n enabled for Windows. indent -kr -i2 - 21/03/2003, version 4.4.6: Configure script modified for various GLib supports. Glib1.2: src12 -> libticalcs.so.4.4.6 Glib2: src20 -> libticalcs-4.so.0.4.6 (0 is the ABI major). Note: src12 & src20 contains the same files, except for Makefile.*. - 18/03/2003, version 4.4.5 (testing phase): Added missing update_refresh() calls into ti82/85 support. Bug fix in ticalc_dirlist_numvars (introduced in 4.4.3). Clock functions (void) was missing -> segfault. Fixed 'content->calc_type = CALC_TI??' to 'content->calc_type = ticalcs_calc_type;' Added varname translation in sending var for the label. Bug fix in TI73/83+ & 82/83 support: padding was missing -> redundant vars. Boring because this bug exist since v4.x.x and has never been reported :-( - 09/03/2003, version 4.4.4 (testing phase): Added type to string conversion functions. Added TI82 ROM dumping. TI89/92/92+ ROM dumping cleanly exits now. - 02/03/2003, version 4.4.3: Directory list rework: added a new function (directorylist2) in the TicalcFunctions structure. Use _two_ (app & flash) _generic_ trees (does not make any assumption about the tree depth). Compatibility with dirlist form #1 functions has been kept & tested. Bug fix in TI89 support: send_flash didn't send the final ACK. - 23/02/2003, version 4.4.2: Added the ability to send TI83+ vars directly into FLASH (not tested). Bug fix in the clock support (clock setting failed before). Documentation is complete (I hope). Configure script modified for various GLib supports. Fix in TI89 backup support: returns a message when there is no vars to backup. - 22/02/2003, version 4.4.1: Few fixes in the TI89 support. - 08/02/2003, version 4.4.0: Dependancy changed: use GLib-2.0. Added dependancy into ticalcs.pc. Note: - if TiLP 6.0 (GTK1.2) is linked against this lib (GLib2.0), - if TiLP 7.0 (GTK2.0) is linked against a previous one (GLib1.2), it will segfaults ! Solution: static linking ? - 03/02/2003, version 4.3.2: Changed indentation to 'indent -kr -i8'. Clean-up (changes from libtifiles synch'ed). - 24/01/2003, version 4.3.1: Added BSD target to configure.ac. Tijl's patches merged. configure.ac cleaned-up. Compilable with MinGW (under MSYS and CygWin). - 25/12/2002, version 4.3.0: Some #define have been changed into enum (make code & doc better). Added a documentation generator as well as a completely rewritten html documentation. Changed indentation to 'indent -kr -i8'. I changed the name of some functions for a better consistency. Lib is still backward compatible (at compilation, not at linking time). - 23/12/2002, version 4.2.9: Added pkg-config support. - 15/11/2002, version 4.2.8: configure.ac improved. - 09/10/2002, version 4.2.7: ROM dump fixes: file descriptor was not closed -> invalid ROM size. - 30/09/2002, version 4.2.6: Some fixes (display). - 26/09/2002, version 4.2.5: Some changes due to libtifiles modifications for Win32. - 17/09/2002, version 4.2.4: ROM dump fixes. Auto-detect fix. pbar: label 'receiving var %s' - 16/09/2002, version 4.2.3: Win32 port. - 13/09/2002, version 4.2.2: testing phase: - TI83/86: ok - TI82/85: ok - TI73/83+: ok - TI92: - TI89/92+/V200 - 07/09/2002, version 4.2.1: ti73/83+ support merged into a single one (ti83+) - 05/09/2002, version 4.2.0: ticalc_check_if_[var|app]_exists modified. tixx_send_var: added new argument, the action list. error code sorting & clean-up. added some extra infos for error msg. - 02/09/2002, version 4.1.9: ti89/92+/v200 support merged into a single one (ti89) - 01/09/2002, version 4.1.8: set/get date function added. clock.c utilies added. - 31/08/2002, version 4.1.7: testing phase: - TI92 recv backup fixed - TI83+ send var fixed - 26/08/2002, version 4.1.6: added preliminary V200 support. V200 uses the same Machine IDs than TI92+. - 18/08/2002, version 4.1.5: added a new argument to tixx_directorylist: returns mem free or used testing phase: - TI73..86, dirlist fixed - TI83 & TI86, mem free added/fixed - TI83 & TI86, recv_var fixed - TI73/83+: os fixed - recv_flash: changed appname parameter for a TiVarEntry - added a new function in dirlist.c - TI89 dirlist fixed for AMS2.08 (FLASH apps) - 16/08/2002, version 4.1.4: uses ti8x/9x_create_[]_content. tree utility functions are now in dirlist.c - 14/08/2002, version 4.1.3: added a new header (wrapper): ticalcs.h byte/word/longword removed for uint8/16/32_ of stdint.h (ISO C 99) TI92 recv backup fixed. - 12/08/2002, version 4.1.2: Added displaying of folder list (misc.c). Clean-up in the various ticalc_set_cable, ticalc_set_calc, ... fncts. - 11/08/2002, version 4.1.1: Directory list system modified: uses tree instead of list. Currently uses GLib's GNode. Will be replaced later by my own GNode implementation. - 10/08/2002, version 4.1.0: Compatibility wrapper removed. Group header management removed. Minor bug fixes. - 08/08/2002, version 4.0.9: TI89 support added. - 31/07/2002, version 4.0.8: TI92 support added. - 27/07/2002, version 4.0.7: TI83+/TI73 support added. intelhexa.c removed - 25/07/2002, version 4.0.6: TI86 fixed. TI82/83/85/86 have been tested: OK ! - 23/07/2002, version 4.0.5: TI86 added. TI82 & 85 backup fixes (sending). TI86 backup to fix (pb of file format). - 21/07/2002, version 4.0.4: TI82/85/83 finished. - 17/07/2002, version 4.0.3: I begin to rewrite the calculator communication layer... - 13/07/2002, version 4.0.2: Some changes from libtifiles included: - headers - added keys code for ti73/83+ (not tested) - remote control with curses removed - 04/07/2002, version 4.0.1: byte2type & translate are now calc independant. Rebuilt under Win32. - 10/06/2002, version 4.0.0 (4.x.x): Moved some stuffs in the libtifiles library. Library version is now displayed in ticalc_init. - 04/06/2002, version 3.3.9: Mac OS-X merge. - 14/05/2002, version 3.3.8: TI89 FLASH support completely rewritten with the TI89/92+ SDK doc (contains FLASH file format). - 29/04/2002, version 3.3.7: Added ROM dump support for TI83+ in ti83p_supported_operations: ok ! Added a new type (0x4D: PRGM ?) and fixed group support: ok ! Pb with FLASH OS/App sending (signature): fixed by a 3.3.2 backport. Thanks to "Stephen Shaw" for these bug reports. TI73 FLASH support updated with TI83+ support. - 24/04/2002, version 3.3.6: ZIP vartype has no file extension for TI89/92+: fixed. - 15/04/2002, version 3.3.5: TI83+ ROM dumping support fixed (stop at 512KB instead of 256KB) Thanks to Thomas Shawn. - 11/04/2002, version 3.3.4: Another bug report: some TI89 FLASH apps (usually developped by third parties) replace the "License" string/header by their FLASH app name. Thanks to Brandon Barker . - 06/04/2002, version 3.3.3: TI has released a FLASH app for a limited amount of time (TI Cell Sheet). This FLASH app contains a certificate which was not handled by TiLP. Fixed for TI89/TI92+. Beware: certificates are still unsupported (currently skipped). Thanks to ?? . - 15/03/2002, version 3.3.2: LIBTICALCS_VERSION symbol is now always defined. Added the type 15h (appvar) and 17h (group) to TI83+. TI83+ pb with FLASH app sending (> 1 page): fixed (introduced in 3.1.8) TI83+, fixed checksums: TIGL compatible. Dirlist fixed for TI89/92+ (FLASH apps listed multiple times). Group (17h) support: the group is receive as a single var (contrary to TIGL. This allow to keep the group as is on calc -> advantage). Contrary to (maybe a drawback) TI's soft, it's not converted into a .8Xg group file. Removed verbose.c: already compiled in libticables -> problem with console management ! - 01/03/2002, version 3.3.1: Minor bug fix on TI83+ support (sending of vars) introduced in v3.2.0. Thanks to Paxl ! - 24/02/2002, version 3.3.0: Rounded to 3.3.0 for official release. - 23/02/2002, version 3.2.1: Merged with Mac OS-X again. - 17/02/2002, version 3.2.0: Added the ability to send a TI8x file on a TI83+ calculator. For calc which does not have folder: p->folder = p instead of list. Paxl problem fixed ( '/r/n' or '/r' in FLASH app signed by appsign. - 15/02/2002, version 3.1.9: Fixed some keys for remote control. - 14/02/2002, version 3.1.8: TI73/83+ FLASH file management moved in intelhexa.c/h. - 14/02/2002, version 3.1.7: Merge with Mac OS-X: building projects are in 'osx'. - 14/02/2002, version 3.1.6: Cleanup in the TicalcInfoUpdate structure (data rate moved in libticables). - 13/02/2002, version 3.1.5: Remote control fixes. - 12/02/2002, version 3.1.4: Little fixes. - 10/02/2002, version 3.1.3: VarInfo structure modified. - 02/02/2002, version 3.1.2: TI89 & 92+ key definitions and array updated and improved. - 23/01/2002, version 3.1.1: TI73 support added & tested. send_key added for TI73,83,83+,86. - 21/01/2002, version 3.1.0: Some clean-up, enhancements. Compatibility broken ! - 20/01/2002, version 3.0.7: The command line is cleared before doing a ROM dumping. TI73 support added (not tested). - 19/01/2002, version 3.0.6: TI83+, sending of FLASH Apps/Os works now. Receiving of FLASHapps: done. New function added: ticalc_83p_89_92p_isready. Allow to auto-detect a TI83+/89/92+ calculator. This function is cleaner than ti89_92_92p_isready and should be used as a replacement even if it does not check for a TI92 any longer. Little fix with ti83p_send_var ('transfer aborted'). - 15/01/2002, version 3.0.5: mutex: only one transfer possible and review update mechanism - 12/01/2002, version 3.0.4: ticalc_get_calc parameter changed. Dirlist function improved: the first element of linked list contains memory free (83/83+/86) or memory used (89/92/92+). - 10/01/2002, version 3.0.3: TI83+ support improved: sending of vars/backup works. Receiving of IDlist: implemented but not tested. Sending of FLASHapps/OS: pending (almost finished). - 29/12/2001, version 3.0.2: Some fixes. - 26/12/2001, version 3.0.1: Receiving of FLASH apps added. TicalcFncts structure modified. - 25/12/2001, version 3.0.0: Source code cleaned up. This release requires a libticables v3.x.x mini. - 21/12/2001, version 2.1.2: I have added 2 new functions: ticalc_init & ticalc_exit. These functions are not used yet. They have been written for use in future. Rudolf Polzer reported a problem while sending a FLASH app (TiCabri). It was due to a lack of memory so I have added a more explicit message for this case ti89_waitdata() improved. Error codes changed (valued). - 19/12/2001, version 2.1.1: probe.c: I have improved the ti89_92_92p_isready function. It directly detects the calc type as well as the TI83+ (new). To finish... - 11/12/2001, version 2.1.0: I have finished to patch TiLEM (lpg.ticalc.org/prj_tilem) for testing TI83+ support. TI83+ support widely improved: ready, screendump, dirlist, receive var, receive backup tested and certified as OK. The send var/backup functions have not been tested. - 09/12/2001, version 2.0.9: isready function implemented (TI83+) but not tested. Macros (update.h) disabled. - 20/11/2001, version 2.0.8: Win32 projects are now distributed with source code. - 19/11/2001, version 2.0.7: French PO files have been updated (i18n). - 17/11/2001, version 2.0.6: Recompiled under WiN32. - 14/11/2001, version 2.0.5: Changed parameters name of ticalc_set_update(). Fixed macros of update.h for avoiding NULL accesses with the function pointers of the 'update' struct. - 08/11/2001, version 2.0.4: Added a m4 macro for checking libticables in configure scripts. - 27/10/2001, version 2.0.3: warnings fixed. - 19/10/2001, version 2.0.2: Updated to Am/Ac2.52: configure.in renamed into configure.ac. - 15/10/2001, version 2.0.1: FLASH support broken, due to type conversion (ti89.c.old/ti92p.c.old) for MSVC warnings. - 04/10/2001, version 2.0.0: compatibility broken -> v2.x.x Added the stop() function in the update structure for future use. The library is backward compatible with programs which use the old library. Nethertheless, programs need to be recompiled. - 14/09/2001, version 1.8.5: Headers are now C++ compliant (extern "C"). Thomas Wolf has written a BCC32 v5.x (or C++Builder5+) wrapper for the libticables. He has also bring about some modifications to the libticables that I have merged. I have also cleaned up the source code and the headers. At last, test_libticalcs has been updated. I have removed many warnings under MSVC (none to level3). - 14/09/2001, version 1.8.4: added some macros for avoiding NULL accesses with the function pointers of the 'update' struct. If the struct has not been set, this will not crash the library. - 13/09/2001, version 1.8.3: recompiled on Win32: some fixes. - 16/07/2001, version 1.8.2: Julien Solignac alias x1cygnus (developer of the TI83(+) TiLEM 'Ti Linux EMulator') has widely improved the TI83+ support. - 03/07/2001, version 1.8.1: TI89...92+ support improved: check if the calc var already exists and wait an action from user - 30/06/2001, version 1.8.0: TI89/TI92+ group file bug fixed (I hope...) - 21/06/2001, version 1.7.9: TI86 ROM dumper and TI86 support improved. - 20/06/2001, version 1.7.8: I have found a tricky bug with GtkTiEmu which allows to improve the ti89_isOK, ti92_isOK and ti92p_isOK functions. There should not be 'Invalid byte' any longer. - 15/06/2001, version 1.7.7: TI83 bug fix in dirlist (due to recent modifs) - 06/06/2001, version 1.7.6: TI85 ROM dumper added both for Usgard & Zshell. - 04/06/2001, version 1.7.5: see the bug_report3.html for the pb. Not fixed yet. TI89 support has been tested again. It is fully compliant. - 28/05/2001, version 1.7.4: minor bug fix in the TI92+ FLASH routine (calc does not reboot automatically). - 26/05/2001, version 1.7.3: TI83+ support cleaned but not tested with VTi yet. - 25/05/2001, version 1.7.2: ROM dumping added for TI83(+) calcs but tested only on TI83. The ability to send a .tib file (old FLASH file format, replaced now by .9xu/.89u file format). - 23/05/2001, version 1.7.1: TI92+ ROM dump dumps only 1 MB instead of 2 MB. TI92+ files was not correctly recognized by TiLP (**TI92p*/**TI92P*). - 22/05/2001, version 1.7.0: TI92+ auto-detection pb is now fixed (a missing break, grr). - 13/05/2001, version 1.6.9: vartype missing in the TI83 support. ROM dumping capability added to TI83. - 08/05/2001, version 1.6.8: VERSION symbol changed due to some interactions under Win32 compiler. - 05/05/2001, version 1.6.7: a mail from Xavier Larue paxl@ca.inter.net: TI83+ error codes have not been updated. - 04/05/2001, version 1.6.6: ROM dumping works now for TI89. Not tested on TI92+ yet but it should work. - 01/05/2001, version 1.6.5: bug fix in the TI83 support (ASM vartype missing). - 21/04/2001, version 1.6.4: bug fixes in TI89/TI92+ support: backups corrupted with calculators which contained FLASHapps - 20/04/2001, version 1.6.3: ROM dumping for TI89/92+ implemented but does not work. - 14/04/2001, version 1.6.2: ROM dumping program is now included into the library (rom*.h). These files comes from Rusty Wagner's VTi. Done for TI92. - 25/03/2001, version 1.6.1: intl.h removed for Debian packaging - 22/03/2001, version 1.6.0: verbose.c removed (libticables) - 17/03/2001, version 1.5.9: minor bug fix in the TI89 FLASH routine (calc does not reboot automatically). - 11/03/2001, version 1.5.8: minor modifications on DISPLAY(). - 04/03/2001, version 1.5.7: changing the macros LSW to LSB_ and next LSB. Source code cleaned. - 27/02/2001, version 1.5.6: modifications made for compiling under Borland C++ 4.52 (Win16 target) - 24/02/2001, version 1.5.5: some filenames have been changed for the Debian release. - 22/02/2001, version 1.5.4: at last, my system administrator have given to me some right on a SPARC station for testing TiLP. It works but I have done some modifications. - 21/02/2001, version 1.5.3: a new set of functions have been added for providing a request service (the application asks to the lib whether this function is supported or not by the calc). Not finished yet ! - 20/02/2001, version 1.5.2: TI86 support improved and backups (both backups in 3 & 4 parts -> old & new calcs) are now supported. Thanks to Tim Singer (the FastLink's developper) for the informations on TI86 backup. I do not use its proprietary (but open) format but the same format as the TI82/83/85 format. - 14/02/2001, version 1.5.1: TI83 support improved. - 13/02/2001, version 1.5.0: i18 support finished for both Linux & Win32. - 06/02/2001, version 1.4.9: TI89 support improved. - 30/01/2001, version 1.4.8: file checking added for 82,85,89,92,92+. - 29/01/2001, version 1.4.7: all headers files are now in instead of - 28/01/2001, version 1.4.6: i18 support added. - 22/01/2001, version 1.4.5: TI85 support improved: skip/exit, pbar. - 21/01/2001, version 1.4.4: TI82 support improved: skip/exit, pbar. - 20/01/2001, version 1.4.3: I have fixed up a problem with the use of curses and results of the configure script. - 03/01/2001, version 1.4.2: all headers files are now in instead of - 21/11/2000, version 1.4.1: all tiXX.c files modified according to the new fields in the update_fncts structure. - 20/11/2000, version 1.4.0: new fields added to the update_fncts structure for speeding up the transfers (refresh) - 16/11/2000, version 1.3.9: a new type added for the TI92+: DoorsOS ZIP type, 0x1C. - 12/11/2000, version 1.3.8: IDlist, FLASH app & OS support added for the TI92+ as well as improvement of the TI92+ support and cleaning of the code. I have also modified the TI89 & TI92+ backup functions: they do not work if the calc has a FLASH app. - 11/11/2000, version 1.3.7: I have replaced the 0 in TIXX_FLASH by -1 which causes EXPR var to be not diplayed in the dirlist - 29/10/2000, version 1.3.6: ti89.c and ti92p.c files have been patched by J. Derque. - 28/10/2000, version 1.3.5: I finished the error.c module (errcodes mechanism). - 24/10/2000, version 1.3.4: external/exported functions and variables names begin with the 'ticable_' prefix in order to be conform with the GNU Coding Standard. - 23/10/2000, version 1.3.3: I received a patch from Mikael Magnusson for the TI83+ support. I also added another function 'tixx_flash' to make the GUI independant of the calculator definitions. - 23/10/2000, version 1.3.2: I received 2 patches from J. Derque. One for uninstalling the library components (lib & header), the other is a 'lib-config' script. - 21/10/2000, version 1.3.1: TI86 support cleaned/improved. - 15/10/2000, version 1.3.0: special characters (such as alpha) can now be received without triggering a checksum error. - 07/10/2000, version 1.2.8: some vartypes added to the TI89. - 01/10/2000, version 1.2.7: config.h & autoconf & autoheader & system type added. Modifications made for the Debian integration. - 30/09/2000, version 1.2.6: FLASHing of apps/AMS added for the TI89 - 25/09/2000: version 1.2.5: screendump functions have been improved... - 25/09/2000, version 1.2.4: 2 functions (open_ti_file & close_ti_file) added for circumvent a new bug in the Windows version. This bug appeared after the previous modifications. - 20/09/2000, version 1.2.3: a small modification in the header files. A bug in the TI89/92+ directory list due to recent modifs. - 19/09/2000, version 1.2.2: a bug in the ROMdump function: it works only if the calc is in the 'main' folder. - 18/09/2000: version 1.2.1: the 'CID' work is finished. - 18/09/2000: version 1.2.0: I received today a mail with some patches for managing the TI83+. At last !!! A great thanks to Mikael Magnusson - 14/09/2000: version 1.1.9: TiLP is going to be ported under Windows with MFC and under BeOS. Then, I begin a huge work of cleaning/improvement/documentation (CID) of the libTIcalc. Phase 1: cleaning of exported functions. Turn the libTIcable into a calc API. - 01/09/2000: version 1.1.8: ROM version improved: works fine ! - 22/08/2000: version 1.1.7: get_rom_version function added. - 13/08/2000: version 1.1.6: I added a new function for doing ROM dumps. - 08/08/2000: version 1.1.5: I implemented the new error message management. I let the previous error function for backward compatibility. - 20/07/2000: version 1.1.4: I added some error messages since I modified the libTIcables. - 29/06/2000: version 1.1.2: I defined an assertion macro so that the source code is clearer/more obvious. - 27/06/2000: version 1.1.1: I begin an overhaul of the source. I have to do the html doc also. Moreover, there is a guy who want reuse this lib to port TiLT under BeOS ! - 30/05/2000: version 1.1.0: I modified the calc lib. There is no update_cable function any longer. - 29/05/2000: version 1.0.5: the cables lib is now loaded in TiLT and not in the calcs lib any longer. - 25/05/2000: version 1.0.4: overhaul of the source files - 23/05/2000: version 1.0.3: JB reports me a problem of var type with the 89 and asm vars. - 19/05/2000: version 1.0.2: I finished to standardize the function calls for calc routines. - 18/05/2000: version 1.0.1: set_cable routine modified for ti-lsd - 15/05/2000: version 1.0.0: TI calc routines in .so/.DLL libticalcs-1.1.9+dfsg/INSTALL000066400000000000000000000366101327711501700156150ustar00rootroot00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command `./configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. libticalcs-1.1.9+dfsg/LOGO000066400000000000000000000006751327711501700152510ustar00rootroot00000000000000 _______ _____ ____ _ _ ____ ____ |__ __|_ _| / ___| / \ | | / ___| / __\ | | | | | / / , \ | | | / | |__ | | | | | | / /_\ \ | | | | \__ \ | | _| |_ | \___ / _____ \ | |___ | \__ ___| | |_| |_____| \____| /_/ \_\ |_____| \____||_____/ v0.1.2 by Romain Liévin Logo by Tyler Cassidy Edited by Thepro libticalcs-1.1.9+dfsg/Makefile.am000066400000000000000000000005021327711501700166070ustar00rootroot00000000000000## Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS=-I m4 # Subdirectories to scan SUBDIRS = build/mingw po src tests if USE_DOCGEN SUBDIRS += docs endif # Extra files to add to the (distributed) package EXTRA_DIST = LOGO build pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = ticalcs2.pc libticalcs-1.1.9+dfsg/Makefile.in000066400000000000000000000713031327711501700166270ustar00rootroot00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @USE_DOCGEN_TRUE@am__append_1 = docs subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = ticalcs2.pc CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = build/mingw po src tests docs am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/ticalcs2.pc.in ABOUT-NLS AUTHORS COPYING ChangeLog \ INSTALL NEWS README compile config.guess config.rpath \ config.sub install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best DIST_TARGETS = dist-bzip2 dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_LIBVERSION = @LT_LIBVERSION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ RC = @RC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPASM = @SPASM@ STRIP = @STRIP@ TFDOCGEN = @TFDOCGEN@ TICABLES_CFLAGS = @TICABLES_CFLAGS@ TICABLES_LIBS = @TICABLES_LIBS@ TICONV_CFLAGS = @TICONV_CFLAGS@ TICONV_LIBS = @TICONV_LIBS@ TIFILES_CFLAGS = @TIFILES_CFLAGS@ TIFILES_LIBS = @TIFILES_LIBS@ TIPACK = @TIPACK@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 # Subdirectories to scan SUBDIRS = build/mingw po src tests $(am__append_1) # Extra files to add to the (distributed) package EXTRA_DIST = LOGO build pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = ticalcs2.pc all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 ticalcs2.pc: $(top_builddir)/config.status $(srcdir)/ticalcs2.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-pkgconfigDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pkgconfigDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libticalcs-1.1.9+dfsg/NEWS000066400000000000000000000000001327711501700152430ustar00rootroot00000000000000libticalcs-1.1.9+dfsg/README000066400000000000000000000064701327711501700154450ustar00rootroot00000000000000 _______ _____ ____ _ _ ____ ____ |__ __|_ _| / ___| / \ | | / ___| / __\ | | | | | / / , \ | | | / | |__ | | | | | | / /_\ \ | | | | \__ \ | | _| |_ | \___ / _____ \ | |___ | \__ ___| | |_| |_____| \____| /_/ \_\ |_____| \____||_____/ This library is part of the TILP framework by Romain Liévin et al. See the AUTHORS file for more detailed authorship information. ------------------------------------------------------------------------------- Requirements ------------------------------------------------------------------------------- OS: - any *nix with a reasonably modern C compiler (a current GCC or Clang will definitely work) or - Microsoft Windows, MSVC or MSYS+MinGW required for compiling from source Libraries: - GLib 2 (required) - libticonv (required) - libtifiles2 (required) - libticables2 (required) Tools for building from source: - autoreconf (required) - make (required) - tfdocgen (optional, required to build API docs) ------------------------------------------------------------------------------- Compilation ------------------------------------------------------------------------------- Untar the libticalcs2 archive, change directory to the libticalcs2 directory. Type "autoreconf -i -f" to generate the autotools files. Type "./configure" (add --prefix option to install to a non-default location). Type "make" and then "make install". "make install" requires root privileges to install to the default, system-wide location. ------------------------------------------------------------------------------- Availability ------------------------------------------------------------------------------- http://lpg.ticalc.org/prj_tilp ------------------------------------------------------------------------------- Copyright ------------------------------------------------------------------------------- Copyright (C) 1999-2011 the TiLP team See AUTHORS for detailed authorship information. This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. (A special exception applies when linking the library into TilEm, see the COPYING file for details.) This library 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 library (in the COPYING file); if not, see . ------------------------------------------------------------------------------- Texas Instruments and TI are trademarks of Texas Instruments Incorporated. For more informations: This document has been written independently of Texas Instruments. Please report any bugs, questions, etc. on the SourceForge infrastructure (http://sourceforge.net/tilp). Please indicate your platform, your calculator type and ROM version. The TiLP team libticalcs-1.1.9+dfsg/build/000077500000000000000000000000001327711501700156555ustar00rootroot00000000000000libticalcs-1.1.9+dfsg/build/mingw/000077500000000000000000000000001327711501700167765ustar00rootroot00000000000000libticalcs-1.1.9+dfsg/build/mingw/Makefile.am000066400000000000000000000003121327711501700210260ustar00rootroot00000000000000BASE = ticalcs2 RC ?= windres EXTRA_DIST = $(BASE).rc if OS_WIN32 noinst_DATA = $(BASE)-rc.o endif if OS_WIN32 all: $(BASE)-rc.o $(BASE)-rc.o : $(BASE).rc $(RC) $(BASE).rc $@ endiflibticalcs-1.1.9+dfsg/build/mingw/ReadMe.txt000066400000000000000000000000441327711501700206720ustar00rootroot00000000000000See the TiLP/build/mingw/ReadMe.txt.libticalcs-1.1.9+dfsg/build/mingw/ticalcs2.rc000066400000000000000000000025621327711501700210350ustar00rootroot00000000000000///////////////////////////////////////////////////////////////////////////// // // Version // #include "winver.h" VS_VERSION_INFO VERSIONINFO FILEVERSION 1,1,9,0 PRODUCTVERSION 1,1,9,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #ifdef _DEBUG FILEFLAGS (VS_FF_PRERELEASE | VS_FF_DEBUG) #else FILEFLAGS (VS_FF_PRERELEASE) #endif FILEOS VOS_NT_WINDOWS32 FILETYPE VFT_DLL FILESUBTYPE VFT2_UNKNOWN BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "Comments", "This lib is placed under GPL license. The license can be found on www.gnu.org\0" VALUE "CompanyName", "The TiLP Team\0" VALUE "FileDescription", "TI calculators library\0" VALUE "FileVersion", "1.1.9\0" VALUE "InternalName", "libticalcs2\0" VALUE "LegalCopyright", "Copyright \xA9 1999-2013, Romain Li\xE9vin, Julien Blache and contributors\0" VALUE "LegalTrademarks", "The TiLP Team\0" VALUE "OriginalFilename", "libticalcs2-12.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "TI calculators library\0" VALUE "ProductVersion", "1.1.9\0" VALUE "SpecialBuild", "Windows 2000/XP/Vista/7 version\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1252 END END libticalcs-1.1.9+dfsg/build/msvc/000077500000000000000000000000001327711501700166255ustar00rootroot00000000000000libticalcs-1.1.9+dfsg/build/msvc/net.bat000066400000000000000000000003631327711501700201050ustar00rootroot00000000000000del *.ncb del *.ilk del *.dep del *.opt del *.plg del *.aps del *.exp del *.idb del *.obj del *.pch del *.exe deltree /y output deltree /y debug deltree /y release rmdir /s /q output rmdir /s /q debug rmdir /s /q release clslibticalcs-1.1.9+dfsg/build/msvc/net.sh000077500000000000000000000000611327711501700177470ustar00rootroot00000000000000#!/bin/sh rm *.exp *.lib *.mak *.ncb *.opt *.plg libticalcs-1.1.9+dfsg/build/msvc/resource.h000066400000000000000000000006341327711501700206300ustar00rootroot00000000000000//{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by ticalcs2.rc // // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif libticalcs-1.1.9+dfsg/build/msvc/test_ticalcs.mak000066400000000000000000000156721327711501700220130ustar00rootroot00000000000000# Microsoft Developer Studio Generated NMAKE File, Based on test_ticalcs.dsp !IF "$(CFG)" == "" CFG=test_ticalcs - Win32 Debug !MESSAGE No configuration specified. Defaulting to test_ticalcs - Win32 Debug. !ENDIF !IF "$(CFG)" != "test_ticalcs - Win32 Release" && "$(CFG)" != "test_ticalcs - Win32 Debug" !MESSAGE Invalid configuration "$(CFG)" specified. !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "test_ticalcs.mak" CFG="test_ticalcs - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "test_ticalcs - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "test_ticalcs - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE !ERROR An invalid configuration is specified. !ENDIF !IF "$(OS)" == "Windows_NT" NULL= !ELSE NULL=nul !ENDIF !IF "$(CFG)" == "test_ticalcs - Win32 Release" OUTDIR=.\Release INTDIR=.\Release !IF "$(RECURSE)" == "0" ALL : ".\test_ticalcs.exe" !ELSE ALL : "ticables - Win32 Release" "ticalcs - Win32 Release" ".\test_ticalcs.exe" !ENDIF !IF "$(RECURSE)" == "1" CLEAN :"ticalcs - Win32 ReleaseCLEAN" "ticables - Win32 ReleaseCLEAN" !ELSE CLEAN : !ENDIF -@erase "$(INTDIR)\test_ticalcs.obj" -@erase "$(INTDIR)\vc60.idb" -@erase ".\test_ticalcs.exe" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "../../../ticables/src" /I "../../../tifiles/src" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WIN32__" /Fp"$(INTDIR)\test_ticalcs.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c .c{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .c{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << RSC=rc.exe BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\test_ticalcs.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\test_ticalcs.pdb" /machine:I386 /out:"test_ticalcs.exe" LINK32_OBJS= \ "$(INTDIR)\test_ticalcs.obj" \ ".\ticalcs.lib" \ "..\..\..\ticables\build\msvc\ticables.lib" ".\test_ticalcs.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ELSEIF "$(CFG)" == "test_ticalcs - Win32 Debug" OUTDIR=.\Debug INTDIR=.\Debug !IF "$(RECURSE)" == "0" ALL : "..\..\..\..\..\msvc\tilp\test_ticalcs.exe" !ELSE ALL : "ticables - Win32 Debug" "ticalcs - Win32 Debug" "..\..\..\..\..\msvc\tilp\test_ticalcs.exe" !ENDIF !IF "$(RECURSE)" == "1" CLEAN :"ticalcs - Win32 DebugCLEAN" "ticables - Win32 DebugCLEAN" !ELSE CLEAN : !ENDIF -@erase "$(INTDIR)\test_ticalcs.obj" -@erase "$(INTDIR)\vc60.idb" -@erase "$(INTDIR)\vc60.pdb" -@erase "$(OUTDIR)\test_ticalcs.pdb" -@erase "..\..\..\..\..\msvc\tilp\test_ticalcs.exe" -@erase "..\..\..\..\..\msvc\tilp\test_ticalcs.ilk" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP=cl.exe CPP_PROJ=/nologo /MLd /W3 /Gm /GX /ZI /Od /I "../../../ticables/src" /I "../../../tifiles/src" /D "_DEBUG" /D "__WIN32__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\test_ticalcs.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c .c{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .c{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << RSC=rc.exe BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\test_ticalcs.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\test_ticalcs.pdb" /debug /machine:I386 /out:"C:\msvc\tilp\test_ticalcs.exe" /pdbtype:sept LINK32_OBJS= \ "$(INTDIR)\test_ticalcs.obj" \ "..\..\..\..\..\msvc\tilp\ticalcs.lib" \ "..\..\..\..\..\msvc\tilp\ticables.lib" "..\..\..\..\..\msvc\tilp\test_ticalcs.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ENDIF !IF "$(NO_EXTERNAL_DEPS)" != "1" !IF EXISTS("test_ticalcs.dep") !INCLUDE "test_ticalcs.dep" !ELSE !MESSAGE Warning: cannot find "test_ticalcs.dep" !ENDIF !ENDIF !IF "$(CFG)" == "test_ticalcs - Win32 Release" || "$(CFG)" == "test_ticalcs - Win32 Debug" SOURCE=..\..\tests\test_ticalcs.c "$(INTDIR)\test_ticalcs.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !IF "$(CFG)" == "test_ticalcs - Win32 Release" "ticalcs - Win32 Release" : cd "." $(MAKE) /$(MAKEFLAGS) /F .\ticalcs.mak CFG="ticalcs - Win32 Release" cd "." "ticalcs - Win32 ReleaseCLEAN" : cd "." $(MAKE) /$(MAKEFLAGS) /F .\ticalcs.mak CFG="ticalcs - Win32 Release" RECURSE=1 CLEAN cd "." !ELSEIF "$(CFG)" == "test_ticalcs - Win32 Debug" "ticalcs - Win32 Debug" : cd "." $(MAKE) /$(MAKEFLAGS) /F .\ticalcs.mak CFG="ticalcs - Win32 Debug" cd "." "ticalcs - Win32 DebugCLEAN" : cd "." $(MAKE) /$(MAKEFLAGS) /F .\ticalcs.mak CFG="ticalcs - Win32 Debug" RECURSE=1 CLEAN cd "." !ENDIF !IF "$(CFG)" == "test_ticalcs - Win32 Release" "ticables - Win32 Release" : cd "\sources\roms\ticables\build\msvc" $(MAKE) /$(MAKEFLAGS) /F .\ticables.mak CFG="ticables - Win32 Release" cd "..\..\..\ticalcs\build\msvc" "ticables - Win32 ReleaseCLEAN" : cd "\sources\roms\ticables\build\msvc" $(MAKE) /$(MAKEFLAGS) /F .\ticables.mak CFG="ticables - Win32 Release" RECURSE=1 CLEAN cd "..\..\..\ticalcs\build\msvc" !ELSEIF "$(CFG)" == "test_ticalcs - Win32 Debug" "ticables - Win32 Debug" : cd "\sources\roms\ticables\build\msvc" $(MAKE) /$(MAKEFLAGS) /F .\ticables.mak CFG="ticables - Win32 Debug" cd "..\..\..\ticalcs\build\msvc" "ticables - Win32 DebugCLEAN" : cd "\sources\roms\ticables\build\msvc" $(MAKE) /$(MAKEFLAGS) /F .\ticables.mak CFG="ticables - Win32 Debug" RECURSE=1 CLEAN cd "..\..\..\ticalcs\build\msvc" !ENDIF !ENDIF libticalcs-1.1.9+dfsg/build/msvc/test_ticalcs2.dsp000066400000000000000000000106341327711501700221040ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="test_ticalcs2" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=test_ticalcs2 - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "test_ticalcs2.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "test_ticalcs2.mak" CFG="test_ticalcs2 - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "test_ticalcs2 - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "test_ticalcs2 - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "test_ticalcs2 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "" # PROP Intermediate_Dir "C:\msvc\Output\ticalcs2" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "../../../ticables2/src" /I "../../../tifiles2/src" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WIN32__" /YX /FD /c # ADD BASE RSC /l 0x40c /d "NDEBUG" # ADD RSC /l 0x40c /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:I386 /out:"..\..\tests\test_ticalcs2.exe" !ELSEIF "$(CFG)" == "test_ticalcs2 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "C:\msvc\tilp2\" # PROP Intermediate_Dir "C:\msvc\Output\ticalcs2" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /ML /W3 /Gm /GX /ZI /Od /I "../../../ticables2/src" /I "../../../tifiles2/src" /D "_DEBUG" /D "__WIN32__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x40c /d "_DEBUG" # ADD RSC /l 0x40c /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:I386 /out:"C:\msvc\tilp2\test_ticalcs_2.exe" /pdbtype:sept !ENDIF # Begin Target # Name "test_ticalcs2 - Win32 Release" # Name "test_ticalcs2 - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\tests\test_ticalcs_2.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project libticalcs-1.1.9+dfsg/build/msvc/test_ticalcs2.dsw000066400000000000000000000037341327711501700221160ustar00rootroot00000000000000Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "test_ticalcs2"=.\test_ticalcs2.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name ticalcs2 End Project Dependency Begin Project Dependency Project_Dep_Name ticables2 End Project Dependency Begin Project Dependency Project_Dep_Name tifiles2 End Project Dependency }}} ############################################################################### Project: "ticables2"=..\..\..\ticables2\build\msvc\ticables2.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "ticalcs2"=.\ticalcs2.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name ticables2 End Project Dependency Begin Project Dependency Project_Dep_Name tifiles2 End Project Dependency Begin Project Dependency Project_Dep_Name ticonv End Project Dependency }}} ############################################################################### Project: "ticonv"=..\..\..\ticonv\build\msvc\ticonv.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "tifiles2"=..\..\..\tifiles2\build\msvc\tifiles2.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name ticonv End Project Dependency }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### libticalcs-1.1.9+dfsg/build/msvc/test_ticalcs2.sln000066400000000000000000000070001327711501700221030ustar00rootroot00000000000000 Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_ticalcs2", "test_ticalcs2.vcproj", "{1919BD54-B038-45FE-A5FB-F05E22D1776C}" ProjectSection(ProjectDependencies) = postProject {2FF4D202-3072-4C33-ADAC-9D0C57C47C91} = {2FF4D202-3072-4C33-ADAC-9D0C57C47C91} {000D62B2-DF70-44EB-936C-CFEF0F33192D} = {000D62B2-DF70-44EB-936C-CFEF0F33192D} {0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E} = {0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ticables2", "..\..\..\ticables2\build\msvc\ticables2.vcproj", "{000D62B2-DF70-44EB-936C-CFEF0F33192D}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ticalcs2", "ticalcs2.vcproj", "{2FF4D202-3072-4C33-ADAC-9D0C57C47C91}" ProjectSection(ProjectDependencies) = postProject {000D62B2-DF70-44EB-936C-CFEF0F33192D} = {000D62B2-DF70-44EB-936C-CFEF0F33192D} {0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E} = {0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E} {B5B5319A-2398-4547-8FE4-864123C69A7A} = {B5B5319A-2398-4547-8FE4-864123C69A7A} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ticonv", "..\..\..\ticonv\build\msvc\ticonv.vcproj", "{B5B5319A-2398-4547-8FE4-864123C69A7A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tifiles2", "..\..\..\tifiles2\build\msvc\tifiles2.vcproj", "{0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E}" ProjectSection(ProjectDependencies) = postProject {B5B5319A-2398-4547-8FE4-864123C69A7A} = {B5B5319A-2398-4547-8FE4-864123C69A7A} EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {1919BD54-B038-45FE-A5FB-F05E22D1776C}.Debug|Win32.ActiveCfg = Debug|Win32 {1919BD54-B038-45FE-A5FB-F05E22D1776C}.Debug|Win32.Build.0 = Debug|Win32 {1919BD54-B038-45FE-A5FB-F05E22D1776C}.Release|Win32.ActiveCfg = Release|Win32 {1919BD54-B038-45FE-A5FB-F05E22D1776C}.Release|Win32.Build.0 = Release|Win32 {000D62B2-DF70-44EB-936C-CFEF0F33192D}.Debug|Win32.ActiveCfg = Debug|Win32 {000D62B2-DF70-44EB-936C-CFEF0F33192D}.Debug|Win32.Build.0 = Debug|Win32 {000D62B2-DF70-44EB-936C-CFEF0F33192D}.Release|Win32.ActiveCfg = Release|Win32 {000D62B2-DF70-44EB-936C-CFEF0F33192D}.Release|Win32.Build.0 = Release|Win32 {2FF4D202-3072-4C33-ADAC-9D0C57C47C91}.Debug|Win32.ActiveCfg = Debug|Win32 {2FF4D202-3072-4C33-ADAC-9D0C57C47C91}.Debug|Win32.Build.0 = Debug|Win32 {2FF4D202-3072-4C33-ADAC-9D0C57C47C91}.Release|Win32.ActiveCfg = Release|Win32 {2FF4D202-3072-4C33-ADAC-9D0C57C47C91}.Release|Win32.Build.0 = Release|Win32 {B5B5319A-2398-4547-8FE4-864123C69A7A}.Debug|Win32.ActiveCfg = Debug|Win32 {B5B5319A-2398-4547-8FE4-864123C69A7A}.Debug|Win32.Build.0 = Debug|Win32 {B5B5319A-2398-4547-8FE4-864123C69A7A}.Release|Win32.ActiveCfg = Release|Win32 {B5B5319A-2398-4547-8FE4-864123C69A7A}.Release|Win32.Build.0 = Release|Win32 {0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E}.Debug|Win32.ActiveCfg = Debug|Win32 {0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E}.Debug|Win32.Build.0 = Debug|Win32 {0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E}.Release|Win32.ActiveCfg = Release|Win32 {0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal libticalcs-1.1.9+dfsg/build/msvc/test_ticalcs2.suo000066400000000000000000000300001327711501700221110ustar00rootroot00000000000000ÐÏࡱá>þÿ þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýÿÿÿþÿÿÿ  þÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRoot Entryÿÿÿÿÿÿÿÿà›šÊf›Ê@ProjInfoExÿÿÿÿÿÿÿÿÿÿÿÿTaskListUserTasks$ÿÿÿÿDebuggerWatches ÿÿÿÿþÿÿÿþÿÿÿþÿÿÿþÿÿÿþÿÿÿ þÿÿÿþÿÿÿXþÿÿÿ !"#$%&'()*+,-./0123456þÿÿÿþÿÿÿ9:;<=>?þÿÿÿABCDEFGHIJKLMNOPQRSTU]þÿÿÿþÿÿÿYZ[\þÿÿÿþÿÿÿ_`abcdefghijklmnopþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÄí–8`LRD¬†Ê¿ 2;ðC 8C:\lpg\ticalcs2\build\msvc\~c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\crDebuggerBreakpoints( ÿÿÿÿDDebuggerExceptions&ÿÿÿÿÿÿÿÿÿÿÿÿDebuggerFindSource&ÿÿÿÿFDebuggerFindSymbol&ÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿt\src\Œc:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc\Œc:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\src\atl\Œc:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\include\DebuggerMemoryWindows,ÿÿÿÿÿÿÿÿÿÿÿÿTExternalFilesProjectContents: ÿÿÿÿÿÿÿÿþÿÿÿDocumentWindowPositions0ÿÿÿÿÿÿÿÿÿÿÿÿGDocumentWindowUserData.ÿÿÿÿ ÿÿÿÿ蹞 ÿÿÞ8]Ç \Ç Í«4ïþîÿMultiStartupProj=;4{1919BD54-B038-45FE-A5FB-F05E22D1776C}.dwStartupOpt=;StartupProject=&{1919BD54-B038-45FE-A5FBSolutionConfiguration, ÿÿÿÿ’ObjMgrContentsV8"ÿÿÿÿ7ClassViewContents$ÿÿÿÿþÿÿÿProjExplorerState$ ÿÿÿÿ8â-F05E22D1776C};?{1919BD54-B038-45FE-A5FB-F05E22D1776C}.Release|Win32.fBatchBld=;={1919BD54-B038-45FE-A5FB-F05E22D1776C}.Debug|Win32.fBatchBld=;4{000D62B2-DF70-44EB-936C-CFEF0F33192D}.dwStartupOpt=;?{000D62B2-DF70-44EB-936C-CFEF0F33192D}.Release|Win32.fBatchBld=;={000D62B2-DF70-44EB-936C-CFEF0F33192D}.Debug|Win32.fBatchBld=;4{2FF4D202-3072-4C33-ADAC-9D0C57C47C91}.dwStartupOpt=;?{2FF4D202-3072-4C33-ADAC-9D0C57C47C91}.Release|Win32.fBatchBld=;={2FF4D202-3072-4C33-ADAC-9D0C57C47C91}.Debug|Win32.fBatchBld=;4{B5B5319A-2398-4547-8FE4-864123C69A7A}.dwStartupOpt=;={B5B5319A-2398-4547-8FE4-864123C69A7A}.Debug|Win32.fBatchBld=;?{B5B5319A-2398-4547-8FE4-864123C69A7A}.Release|Win32.fBatchBld=;4{0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E}.dwStartupOpt=;={0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E}.Debug|Win32.fBatchBld=;?{0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E}.Release|Win32.fBatchBld=; ActiveCfg= Debug|Win32;Q `C:\lpg\ticalcs2\build\msvc\test_ticalcs2.vcprojZC:\lpg\ticables2\build\msvc\ticables2.vcprojVC:\lpg\ticalcs2\build\msvc\ticalcs2.vcprojNC:\lpg\ticonv\build\msvc\ticonv.vcprojVC:\lpg\tifiles2\build\msvc\tifiles2.vcprojUnloadedProjects"ÿÿÿÿÿÿÿÿþÿÿÿHiddenSlnFolders"ÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿOutliningStateDir$ÿÿÿÿÿÿÿÿÿÿÿÿ@®BookmarkStateÿÿÿÿÿÿÿÿV(Dc:\lpgsrc\ticables2\src\export1.h6c:\lpgsrc\ticonv\ChangeLog Bc:\lpgsrc\ticalcs2\src\export3.h:c:\lpgsrc\ticalcs2\ChangeLog<c:\lpgsrc\ticables2\ChangeLog>c:\lpgsrc\ticonv\src\export4.h :C:\lpgsrc\tifiles2\ChangeLog <c:\lpg\ticalcs2\src\ticalcs.hBc:\lpgsrc\tifiles2\src\tifiles.c<c:\lpgsrc\ticonv\src\ticonv.c@C:\lpgsrc\tifiles2\src\rwfile.cBc:\lpgsrc\tifiles2\src\tifiles.h<c:\lpgsrc\ticonv\src\ticonv.hFc:\lpgsrc\ticables2\src\ticables.cBC:\lpgsrc\tifiles2\src\export2.h Fc:\lpgsrc\ticables2\src\ticables.h6C:\lpgsrc\tilp2\src\main.c ~c:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\WinDef.hBc:\lpgsrc\ticalcs2\src\ticalcs.cBc:\lpgsrc\tic$Bookmarks V001.01XÏ TaskListShortcuts$ÿÿÿÿÿÿÿÿÿÿÿÿWOutliningState21"ÿÿÿÿÿÿÿÿÿÿÿÿ^„ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿú{2FF4D202-3072-4C33-ADAC-9D0C57C47C91}|ticalcs2.vcproj|c:\lpg\ticalcs2\src\ticalcs.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}1234alcs2\src\ticalcs.h<c:\lpg\ticalcs2\src\ticalcs.hȾûÏ&*,!-.!/>A BFHL MQSW X]_d eprv w€‚† ‡ŒŽ’ “­¯³ ´¸º¾ ¿ÚÜà áúü    ()139:>@FGQSacop~€–—®¾ÃÄàâ67FGWXabkmqv z÷ùüý #ýÿÿÿÿÿlibticalcs-1.1.9+dfsg/build/msvc/test_ticalcs2.vcproj000066400000000000000000000130561327711501700226220ustar00rootroot00000000000000 libticalcs-1.1.9+dfsg/build/msvc/ticalcs.mak000066400000000000000000000323541327711501700207500ustar00rootroot00000000000000# Microsoft Developer Studio Generated NMAKE File, Based on ticalcs.dsp !IF "$(CFG)" == "" CFG=ticalcs - Win32 Debug !MESSAGE No configuration specified. Defaulting to ticalcs - Win32 Debug. !ENDIF !IF "$(CFG)" != "ticalcs - Win32 Release" && "$(CFG)" != "ticalcs - Win32 Debug" !MESSAGE Invalid configuration "$(CFG)" specified. !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "ticalcs.mak" CFG="ticalcs - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "ticalcs - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "ticalcs - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE !ERROR An invalid configuration is specified. !ENDIF !IF "$(OS)" == "Windows_NT" NULL= !ELSE NULL=nul !ENDIF !IF "$(CFG)" == "ticalcs - Win32 Release" OUTDIR=. INTDIR=C:\msvc\Output\ticalcs !IF "$(RECURSE)" == "0" ALL : "..\..\tests\ticalcs.dll" !ELSE ALL : "tifiles - Win32 Release" "ticables - Win32 Release" "..\..\tests\ticalcs.dll" !ENDIF !IF "$(RECURSE)" == "1" CLEAN :"ticables - Win32 ReleaseCLEAN" "tifiles - Win32 ReleaseCLEAN" !ELSE CLEAN : !ENDIF -@erase "$(INTDIR)\clock.obj" -@erase "$(INTDIR)\cmd73.obj" -@erase "$(INTDIR)\cmd82.obj" -@erase "$(INTDIR)\cmd85.obj" -@erase "$(INTDIR)\cmd89.obj" -@erase "$(INTDIR)\cmd92.obj" -@erase "$(INTDIR)\dirlist.obj" -@erase "$(INTDIR)\Error.obj" -@erase "$(INTDIR)\Intrface.obj" -@erase "$(INTDIR)\keys73.obj" -@erase "$(INTDIR)\keys83p.obj" -@erase "$(INTDIR)\keys89.obj" -@erase "$(INTDIR)\keys92p.obj" -@erase "$(INTDIR)\packets.obj" -@erase "$(INTDIR)\printl.obj" -@erase "$(INTDIR)\Probe.obj" -@erase "$(INTDIR)\ti73.obj" -@erase "$(INTDIR)\Ti82.obj" -@erase "$(INTDIR)\Ti83.obj" -@erase "$(INTDIR)\Ti85.obj" -@erase "$(INTDIR)\Ti86.obj" -@erase "$(INTDIR)\Ti89.obj" -@erase "$(INTDIR)\Ti92.obj" -@erase "$(INTDIR)\ticalcs.res" -@erase "$(INTDIR)\tikeys.obj" -@erase "$(INTDIR)\tnode.obj" -@erase "$(INTDIR)\type2str.obj" -@erase "$(INTDIR)\vc60.idb" -@erase "$(OUTDIR)\ticalcs.exp" -@erase "$(OUTDIR)\ticalcs.lib" -@erase "..\..\tests\ticalcs.dll" "$(INTDIR)" : if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" CPP=cl.exe CPP_PROJ=/nologo /MT /w /W0 /GX /I "../../../cables/src" /I "../../../files/src" /I "../../../ticables/src" /I "../../../tifiles/src" /I "C:\Gtk2Dev\Include" /I "." /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D "TICALCS_EXPORTS" /D "__WIN32__" /Fp"$(INTDIR)\ticalcs.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c .c{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .c{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << MTL=midl.exe MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" RSC=rc.exe RSC_PROJ=/l 0x40c /fo"$(INTDIR)\ticalcs.res" /d "NDEBUG" BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\ticalcs.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\ticalcs.pdb" /machine:I386 /out:"..\..\tests\ticalcs.dll" /implib:"$(OUTDIR)\ticalcs.lib" LINK32_OBJS= \ "$(INTDIR)\cmd73.obj" \ "$(INTDIR)\cmd82.obj" \ "$(INTDIR)\cmd85.obj" \ "$(INTDIR)\cmd89.obj" \ "$(INTDIR)\cmd92.obj" \ "$(INTDIR)\ti73.obj" \ "$(INTDIR)\Ti82.obj" \ "$(INTDIR)\Ti83.obj" \ "$(INTDIR)\Ti85.obj" \ "$(INTDIR)\Ti86.obj" \ "$(INTDIR)\Ti89.obj" \ "$(INTDIR)\Ti92.obj" \ "$(INTDIR)\keys73.obj" \ "$(INTDIR)\keys83p.obj" \ "$(INTDIR)\keys89.obj" \ "$(INTDIR)\keys92p.obj" \ "$(INTDIR)\tikeys.obj" \ "$(INTDIR)\packets.obj" \ "$(INTDIR)\clock.obj" \ "$(INTDIR)\dirlist.obj" \ "$(INTDIR)\Error.obj" \ "$(INTDIR)\Intrface.obj" \ "$(INTDIR)\printl.obj" \ "$(INTDIR)\Probe.obj" \ "$(INTDIR)\tnode.obj" \ "$(INTDIR)\type2str.obj" \ "$(INTDIR)\ticalcs.res" \ "..\..\..\..\..\Gtk2Dev\lib\intl.lib" \ "..\..\..\ticables\build\msvc\ticables.lib" \ "..\..\..\tifiles\build\msvc\tifiles.lib" "..\..\tests\ticalcs.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ELSEIF "$(CFG)" == "ticalcs - Win32 Debug" OUTDIR=C:\msvc\tilp INTDIR=C:\msvc\Output\ticalcs # Begin Custom Macros OutDir=C:\msvc\tilp\ # End Custom Macros !IF "$(RECURSE)" == "0" ALL : "$(OUTDIR)\ticalcs.dll" !ELSE ALL : "tifiles - Win32 Debug" "ticables - Win32 Debug" "$(OUTDIR)\ticalcs.dll" !ENDIF !IF "$(RECURSE)" == "1" CLEAN :"ticables - Win32 DebugCLEAN" "tifiles - Win32 DebugCLEAN" !ELSE CLEAN : !ENDIF -@erase "$(INTDIR)\clock.obj" -@erase "$(INTDIR)\cmd73.obj" -@erase "$(INTDIR)\cmd82.obj" -@erase "$(INTDIR)\cmd85.obj" -@erase "$(INTDIR)\cmd89.obj" -@erase "$(INTDIR)\cmd92.obj" -@erase "$(INTDIR)\dirlist.obj" -@erase "$(INTDIR)\Error.obj" -@erase "$(INTDIR)\Intrface.obj" -@erase "$(INTDIR)\keys73.obj" -@erase "$(INTDIR)\keys83p.obj" -@erase "$(INTDIR)\keys89.obj" -@erase "$(INTDIR)\keys92p.obj" -@erase "$(INTDIR)\packets.obj" -@erase "$(INTDIR)\printl.obj" -@erase "$(INTDIR)\Probe.obj" -@erase "$(INTDIR)\ti73.obj" -@erase "$(INTDIR)\Ti82.obj" -@erase "$(INTDIR)\Ti83.obj" -@erase "$(INTDIR)\Ti85.obj" -@erase "$(INTDIR)\Ti86.obj" -@erase "$(INTDIR)\Ti89.obj" -@erase "$(INTDIR)\Ti92.obj" -@erase "$(INTDIR)\ticalcs.res" -@erase "$(INTDIR)\tikeys.obj" -@erase "$(INTDIR)\tnode.obj" -@erase "$(INTDIR)\type2str.obj" -@erase "$(INTDIR)\vc60.idb" -@erase "$(INTDIR)\vc60.pdb" -@erase "$(OUTDIR)\ticalcs.dll" -@erase "$(OUTDIR)\ticalcs.exp" -@erase "$(OUTDIR)\ticalcs.ilk" -@erase "$(OUTDIR)\ticalcs.lib" -@erase "$(OUTDIR)\ticalcs.pdb" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" "$(INTDIR)" : if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" CPP=cl.exe CPP_PROJ=/nologo /MTd /w /W0 /GX /ZI /Od /I "../../../ticables/src" /I "../../../tifiles/src" /I "C:\Gtk2Dev\Include" /I "." /D "_DEBUG" /D "_CONSOLE" /D "WIN32" /D "TICALCS_EXPORTS" /D "__WIN32__" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c .c{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .c{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << MTL=midl.exe MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" RSC=rc.exe RSC_PROJ=/l 0x40c /fo"$(INTDIR)\ticalcs.res" /d "_DEBUG" BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\ticalcs.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /incremental:yes /pdb:"$(OUTDIR)\ticalcs.pdb" /debug /machine:I386 /out:"$(OUTDIR)\ticalcs.dll" /implib:"$(OUTDIR)\ticalcs.lib" /pdbtype:sept LINK32_OBJS= \ "$(INTDIR)\cmd73.obj" \ "$(INTDIR)\cmd82.obj" \ "$(INTDIR)\cmd85.obj" \ "$(INTDIR)\cmd89.obj" \ "$(INTDIR)\cmd92.obj" \ "$(INTDIR)\ti73.obj" \ "$(INTDIR)\Ti82.obj" \ "$(INTDIR)\Ti83.obj" \ "$(INTDIR)\Ti85.obj" \ "$(INTDIR)\Ti86.obj" \ "$(INTDIR)\Ti89.obj" \ "$(INTDIR)\Ti92.obj" \ "$(INTDIR)\keys73.obj" \ "$(INTDIR)\keys83p.obj" \ "$(INTDIR)\keys89.obj" \ "$(INTDIR)\keys92p.obj" \ "$(INTDIR)\tikeys.obj" \ "$(INTDIR)\packets.obj" \ "$(INTDIR)\clock.obj" \ "$(INTDIR)\dirlist.obj" \ "$(INTDIR)\Error.obj" \ "$(INTDIR)\Intrface.obj" \ "$(INTDIR)\printl.obj" \ "$(INTDIR)\Probe.obj" \ "$(INTDIR)\tnode.obj" \ "$(INTDIR)\type2str.obj" \ "$(INTDIR)\ticalcs.res" \ "..\..\..\..\..\Gtk2Dev\lib\intl.lib" \ "$(OUTDIR)\ticables.lib" \ "$(OUTDIR)\tifiles.lib" "$(OUTDIR)\ticalcs.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ENDIF !IF "$(NO_EXTERNAL_DEPS)" != "1" !IF EXISTS("ticalcs.dep") !INCLUDE "ticalcs.dep" !ELSE !MESSAGE Warning: cannot find "ticalcs.dep" !ENDIF !ENDIF !IF "$(CFG)" == "ticalcs - Win32 Release" || "$(CFG)" == "ticalcs - Win32 Debug" SOURCE=..\..\src\cmd73.c "$(INTDIR)\cmd73.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\cmd82.c "$(INTDIR)\cmd82.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\cmd85.c "$(INTDIR)\cmd85.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\cmd89.c "$(INTDIR)\cmd89.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\cmd92.c "$(INTDIR)\cmd92.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\ti73.c "$(INTDIR)\ti73.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\Ti82.c "$(INTDIR)\Ti82.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\Ti83.c "$(INTDIR)\Ti83.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\Ti85.c "$(INTDIR)\Ti85.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\Ti86.c "$(INTDIR)\Ti86.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\Ti89.c "$(INTDIR)\Ti89.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\Ti92.c "$(INTDIR)\Ti92.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\keys73.c "$(INTDIR)\keys73.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\keys83p.c "$(INTDIR)\keys83p.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\keys89.c "$(INTDIR)\keys89.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\keys92p.c "$(INTDIR)\keys92p.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\tikeys.c "$(INTDIR)\tikeys.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\packets.c "$(INTDIR)\packets.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\clock.c "$(INTDIR)\clock.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\dirlist.c "$(INTDIR)\dirlist.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\Error.c "$(INTDIR)\Error.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\Intrface.c "$(INTDIR)\Intrface.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\printl.c "$(INTDIR)\printl.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\Probe.c "$(INTDIR)\Probe.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\tnode.c "$(INTDIR)\tnode.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\src\type2str.c "$(INTDIR)\type2str.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !IF "$(CFG)" == "ticalcs - Win32 Release" "ticables - Win32 Release" : cd "\sources\roms\ticables\build\msvc" $(MAKE) /$(MAKEFLAGS) /F .\ticables.mak CFG="ticables - Win32 Release" cd "..\..\..\ticalcs\build\msvc" "ticables - Win32 ReleaseCLEAN" : cd "\sources\roms\ticables\build\msvc" $(MAKE) /$(MAKEFLAGS) /F .\ticables.mak CFG="ticables - Win32 Release" RECURSE=1 CLEAN cd "..\..\..\ticalcs\build\msvc" !ELSEIF "$(CFG)" == "ticalcs - Win32 Debug" "ticables - Win32 Debug" : cd "\sources\roms\ticables\build\msvc" $(MAKE) /$(MAKEFLAGS) /F .\ticables.mak CFG="ticables - Win32 Debug" cd "..\..\..\ticalcs\build\msvc" "ticables - Win32 DebugCLEAN" : cd "\sources\roms\ticables\build\msvc" $(MAKE) /$(MAKEFLAGS) /F .\ticables.mak CFG="ticables - Win32 Debug" RECURSE=1 CLEAN cd "..\..\..\ticalcs\build\msvc" !ENDIF !IF "$(CFG)" == "ticalcs - Win32 Release" "tifiles - Win32 Release" : cd "\sources\roms\tifiles\build\msvc" $(MAKE) /$(MAKEFLAGS) /F .\tifiles.mak CFG="tifiles - Win32 Release" cd "..\..\..\ticalcs\build\msvc" "tifiles - Win32 ReleaseCLEAN" : cd "\sources\roms\tifiles\build\msvc" $(MAKE) /$(MAKEFLAGS) /F .\tifiles.mak CFG="tifiles - Win32 Release" RECURSE=1 CLEAN cd "..\..\..\ticalcs\build\msvc" !ELSEIF "$(CFG)" == "ticalcs - Win32 Debug" "tifiles - Win32 Debug" : cd "\sources\roms\tifiles\build\msvc" $(MAKE) /$(MAKEFLAGS) /F .\tifiles.mak CFG="tifiles - Win32 Debug" cd "..\..\..\ticalcs\build\msvc" "tifiles - Win32 DebugCLEAN" : cd "\sources\roms\tifiles\build\msvc" $(MAKE) /$(MAKEFLAGS) /F .\tifiles.mak CFG="tifiles - Win32 Debug" RECURSE=1 CLEAN cd "..\..\..\ticalcs\build\msvc" !ENDIF SOURCE=.\ticalcs.rc "$(INTDIR)\ticalcs.res" : $(SOURCE) "$(INTDIR)" $(RSC) $(RSC_PROJ) $(SOURCE) !ENDIF libticalcs-1.1.9+dfsg/build/msvc/ticalcs2.dsp000066400000000000000000000236721327711501700210530ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="ticalcs2" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=ticalcs2 - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "ticalcs2.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "ticalcs2.mak" CFG="ticalcs2 - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "ticalcs2 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "ticalcs2 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "ticalcs2 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "" # PROP Intermediate_Dir "C:\lpg\msvc\Output\ticalcs2" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /w /W0 /GX /I "../../../ticonv/src" /I "../../../ticables2/src" /I "../../../tifiles2/src" /I "c:\lpg\gtk\include" /I "c:\lpg\gtk\include\glib-2.0" /I "c:\lpg\gtk\lib\glib-2.0\include" /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D "TICALCS_EXPORTS" /D "__WIN32__" /D "ENABLE_NLS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x40c /d "NDEBUG" # ADD RSC /l 0x40c /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:I386 /out:"..\..\tests\libticalcs2-7.dll" !ELSEIF "$(CFG)" == "ticalcs2 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "c:\lpg\msvc\" # PROP Intermediate_Dir "C:\lpg\msvc\Output\ticalcs2" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /ZI /Od /I "../../../ticonv/src" /I "../../../ticables2/src" /I "../../../tifiles2/src" /I "c:\lpg\gtk\include" /I "c:\lpg\gtk\include\glib-2.0" /I "c:\lpg\gtk\lib\glib-2.0\include" /D "_DEBUG" /D "_CONSOLE" /D "ENABLE_NLS" /D "WIN32" /D "TICALCS_EXPORTS" /D "__WIN32__" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x40c /d "_DEBUG" # ADD RSC /l 0x40c /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"c:\lpg\msvc\libticalcs2-7.dll" /pdbtype:sept # SUBTRACT LINK32 /map !ENDIF # Begin Target # Name "ticalcs2 - Win32 Release" # Name "ticalcs2 - Win32 Debug" # Begin Group "TI calcs" # PROP Default_Filter "" # Begin Group "dbus_calcs" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\src\calc_00.c # End Source File # Begin Source File SOURCE=..\..\src\calc_73.c # End Source File # Begin Source File SOURCE=..\..\src\calc_82.c # End Source File # Begin Source File SOURCE=..\..\src\calc_83.c # End Source File # Begin Source File SOURCE=..\..\src\calc_85.c # End Source File # Begin Source File SOURCE=..\..\src\calc_86.c # End Source File # Begin Source File SOURCE=..\..\src\calc_89.c # End Source File # Begin Source File SOURCE=..\..\src\calc_92.c # End Source File # End Group # Begin Group "keys" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\src\keys73.c # End Source File # Begin Source File SOURCE=..\..\src\keys73.h # End Source File # Begin Source File SOURCE=..\..\src\keys83.c # End Source File # Begin Source File SOURCE=..\..\src\keys83.h # End Source File # Begin Source File SOURCE=..\..\src\keys83p.c # End Source File # Begin Source File SOURCE=..\..\src\keys83p.h # End Source File # Begin Source File SOURCE=..\..\src\keys86.c # End Source File # Begin Source File SOURCE=..\..\src\keys86.h # End Source File # Begin Source File SOURCE=..\..\src\keys89.c # End Source File # Begin Source File SOURCE=..\..\src\keys89.h # End Source File # Begin Source File SOURCE=..\..\src\keys92p.c # End Source File # Begin Source File SOURCE=..\..\src\keys92p.h # End Source File # Begin Source File SOURCE=..\..\src\tikeys.c # End Source File # End Group # Begin Group "dusb_cmds" # PROP Default_Filter "" # Begin Group "debug" # PROP Default_Filter "" # Begin Source File SOURCE="..\..\..\linkguide\analysis\logs\ti84+_usb\send_flash_os.pkt" # End Source File # Begin Source File SOURCE="..\..\..\..\..\ticables-dusb.log" # End Source File # Begin Source File SOURCE="..\..\..\linkguide\usb-protocol.txt" # End Source File # End Group # Begin Source File SOURCE=..\..\src\dusb_cmd.c # End Source File # Begin Source File SOURCE=..\..\src\dusb_cmd.h # End Source File # Begin Source File SOURCE=..\..\src\dusb_rpkt.c # End Source File # Begin Source File SOURCE=..\..\src\dusb_rpkt.h # End Source File # Begin Source File SOURCE=..\..\src\dusb_vpkt.c # End Source File # Begin Source File SOURCE=..\..\src\dusb_vpkt.h # End Source File # End Group # Begin Group "dusb_calcs" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\src\calc_84p.c # End Source File # Begin Source File SOURCE=..\..\src\calc_89t.c # End Source File # End Group # Begin Group "dbus_cmds" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\src\cmd73.c # End Source File # Begin Source File SOURCE=..\..\src\cmd82.c # End Source File # Begin Source File SOURCE=..\..\src\cmd85.c # End Source File # Begin Source File SOURCE=..\..\src\cmd89.c # End Source File # Begin Source File SOURCE=..\..\src\cmd92.c # End Source File # Begin Source File SOURCE=..\..\src\dbus_pkt.c # End Source File # End Group # Begin Group "nspire" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\src\calc_nsp.c # End Source File # Begin Source File SOURCE=..\..\src\nsp_cmd.c # End Source File # Begin Source File SOURCE=..\..\src\nsp_cmd.h # End Source File # Begin Source File SOURCE=..\..\src\nsp_rpkt.c # End Source File # Begin Source File SOURCE=..\..\src\nsp_rpkt.h # End Source File # Begin Source File SOURCE=..\..\src\nsp_vpkt.c # End Source File # Begin Source File SOURCE=..\..\src\nsp_vpkt.h # End Source File # End Group # Begin Source File SOURCE=..\..\src\backup.c # End Source File # Begin Source File SOURCE=..\..\src\calc_xx.c # End Source File # End Group # Begin Group "Others" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\src\clock.c # End Source File # Begin Source File SOURCE=..\..\src\logging.c # End Source File # Begin Source File SOURCE=..\..\src\probe.c # End Source File # Begin Source File SOURCE=..\..\src\update.c # End Source File # End Group # Begin Group "Headers" # PROP Default_Filter "" # End Group # Begin Group "ROMdumping" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\src\rom73.h # End Source File # Begin Source File SOURCE=..\..\src\rom82.h # End Source File # Begin Source File SOURCE=..\..\src\rom83.h # End Source File # Begin Source File SOURCE=..\..\src\rom83p.h # End Source File # Begin Source File SOURCE=..\..\src\rom85u.h # End Source File # Begin Source File SOURCE=..\..\src\rom85z.h # End Source File # Begin Source File SOURCE=..\..\src\rom86.h # End Source File # Begin Source File SOURCE=..\..\src\Rom89.h # End Source File # Begin Source File SOURCE=..\..\src\rom89t.h # End Source File # Begin Source File SOURCE=..\..\src\Rom92f2.h # End Source File # Begin Source File SOURCE=..\..\src\romdump.c # End Source File # Begin Source File SOURCE=..\..\docs\romdump.txt # End Source File # Begin Source File SOURCE="..\..\..\..\..\ticables-hex.log" # End Source File # End Group # Begin Group "API" # PROP Default_Filter "" # Begin Source File SOURCE=..\..\src\dirlist.c # End Source File # Begin Source File SOURCE=..\..\src\error.c # End Source File # Begin Source File SOURCE=..\..\src\ticalcs.c # End Source File # Begin Source File SOURCE=..\..\src\ticalcs.h # End Source File # Begin Source File SOURCE=..\..\src\type2str.c # End Source File # End Group # Begin Source File SOURCE=..\..\ChangeLog # End Source File # Begin Source File SOURCE=..\mingw\ticalcs2.rc # End Source File # Begin Source File SOURCE="c:\lpg\gtk\lib\glib-2.0.lib" # End Source File # Begin Source File SOURCE=c:\lpg\gtk\lib\intl.lib # End Source File # End Target # End Project libticalcs-1.1.9+dfsg/build/msvc/ticalcs2.dsw000066400000000000000000000026601327711501700210540ustar00rootroot00000000000000Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "ticables2"=..\..\..\ticables2\build\msvc\ticables2.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "ticalcs2"=.\ticalcs2.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name ticables2 End Project Dependency Begin Project Dependency Project_Dep_Name tifiles2 End Project Dependency Begin Project Dependency Project_Dep_Name ticonv End Project Dependency }}} ############################################################################### Project: "ticonv"=..\..\..\ticonv\build\msvc\ticonv.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "tifiles2"=..\..\..\tifiles2\build\msvc\tifiles2.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### libticalcs-1.1.9+dfsg/build/msvc/ticalcs2.sln000066400000000000000000000057361327711501700210620ustar00rootroot00000000000000 Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ticables2", "..\..\..\ticables2\build\msvc\ticables2.vcproj", "{000D62B2-DF70-44EB-936C-CFEF0F33192D}" ProjectSection(ProjectDependencies) = postProject {0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E} = {0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E} {B5B5319A-2398-4547-8FE4-864123C69A7A} = {B5B5319A-2398-4547-8FE4-864123C69A7A} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ticalcs2", "ticalcs2.vcproj", "{2FF4D202-3072-4C33-ADAC-9D0C57C47C91}" ProjectSection(ProjectDependencies) = postProject {0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E} = {0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E} {B5B5319A-2398-4547-8FE4-864123C69A7A} = {B5B5319A-2398-4547-8FE4-864123C69A7A} {000D62B2-DF70-44EB-936C-CFEF0F33192D} = {000D62B2-DF70-44EB-936C-CFEF0F33192D} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ticonv", "..\..\..\ticonv\build\msvc\ticonv.vcproj", "{B5B5319A-2398-4547-8FE4-864123C69A7A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tifiles2", "..\..\..\tifiles2\build\msvc\tifiles2.vcproj", "{0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E}" ProjectSection(ProjectDependencies) = postProject {B5B5319A-2398-4547-8FE4-864123C69A7A} = {B5B5319A-2398-4547-8FE4-864123C69A7A} EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {000D62B2-DF70-44EB-936C-CFEF0F33192D}.Debug|Win32.ActiveCfg = Debug|Win32 {000D62B2-DF70-44EB-936C-CFEF0F33192D}.Debug|Win32.Build.0 = Debug|Win32 {000D62B2-DF70-44EB-936C-CFEF0F33192D}.Release|Win32.ActiveCfg = Release|Win32 {000D62B2-DF70-44EB-936C-CFEF0F33192D}.Release|Win32.Build.0 = Release|Win32 {2FF4D202-3072-4C33-ADAC-9D0C57C47C91}.Debug|Win32.ActiveCfg = Debug|Win32 {2FF4D202-3072-4C33-ADAC-9D0C57C47C91}.Debug|Win32.Build.0 = Debug|Win32 {2FF4D202-3072-4C33-ADAC-9D0C57C47C91}.Release|Win32.ActiveCfg = Release|Win32 {2FF4D202-3072-4C33-ADAC-9D0C57C47C91}.Release|Win32.Build.0 = Release|Win32 {B5B5319A-2398-4547-8FE4-864123C69A7A}.Debug|Win32.ActiveCfg = Debug|Win32 {B5B5319A-2398-4547-8FE4-864123C69A7A}.Debug|Win32.Build.0 = Debug|Win32 {B5B5319A-2398-4547-8FE4-864123C69A7A}.Release|Win32.ActiveCfg = Release|Win32 {B5B5319A-2398-4547-8FE4-864123C69A7A}.Release|Win32.Build.0 = Release|Win32 {0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E}.Debug|Win32.ActiveCfg = Debug|Win32 {0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E}.Debug|Win32.Build.0 = Debug|Win32 {0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E}.Release|Win32.ActiveCfg = Release|Win32 {0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal libticalcs-1.1.9+dfsg/build/msvc/ticalcs2.suo000066400000000000000000000450001327711501700210600ustar00rootroot00000000000000ÐÏࡱá>þÿ þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýÿÿÿ  þÿÿÿ" !#þÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRoot Entryÿÿÿÿÿÿÿÿ€ñçxa›Ê/ProjInfoExÿÿÿÿÿÿÿÿÿÿÿÿTaskListUserTasks$ÿÿÿÿXmlPackageOptions$ÿÿÿÿÿÿÿÿÿÿÿÿ¿þÿÿÿþÿÿÿGþÿÿÿþÿÿÿþÿÿÿ þÿÿÿþÿÿÿOm !"#$%&'()*+,-./01oþÿÿÿ456789p;sþÿÿÿþÿÿÿ?þÿÿÿAþÿÿÿCþÿÿÿEþÿÿÿþÿÿÿHþÿÿÿJKLMNþÿÿÿPQRSTUVWXYZ[\]^_`abcdefghijklþÿÿÿnþÿÿÿþÿÿÿqrþÿÿÿtuvwxyz{|}þÿÿÿ€Äí–8`LRD¬†Ê¿ 2;ðC C:\lpgsrc\tifiles2\ChangeLogc:\lpgsrc>C:\lpgsrc\ticalcs2\build\msvc\~c:\Program Files (x86)\MDebuggerWatches ÿÿÿÿÿÿÿÿÿÿÿÿDebuggerBreakpoints( ÿÿÿÿJDebuggerExceptions&ÿÿÿÿDebuggerFindSource&ÿÿÿÿÿÿÿÿFicrosoft Visual Studio 9.0\VC\crt\src\Œc:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc\Œc:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\src\atl\Œc:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\include\蹞 ÿÿ—8M; L;PW)Í«4ïþîÿKW4Í«4ïþîÿLVMultiStartupProj=;4{000D62B2-DF70-44EB-936C-CFEF0F33192D}.dwStartupOpt=;StartupProjDebuggerFindSymbol&ÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿDebuggerMemoryWindows,ÿÿÿÿÿÿÿÿÿÿÿÿTExternalFilesProjectContents: ÿÿÿÿÿÿÿÿIBDocumentWindowPositions0ÿÿÿÿÿÿÿÿÿÿÿÿ»DocumentWindowUserData.ÿÿÿÿ ÿÿÿÿ”SolutionConfiguration, ÿÿÿÿ~ObjMgrContentsV8"ÿÿÿÿÿÿÿÿ2ClassViewContents$ÿÿÿÿÿÿÿÿþÿÿÿect=&{000D62B2-DF70-44EB-936C-CFEF0F33192D};?{000D62B2-DF70-44EB-936C-CFEF0F33192D}.Release|Win32.fBatchBld=;={000D62B2-DF70-44EB-936C-CFEF0F33192D}.Debug|Win32.fBatchBld=;4{2FF4D202-3072-4C33-ADAC-9D0C57C47C91}.dwStartupOpt=;?{2FF4D202-3072-4C33-ADAC-9D0C57C47C91}.Release|Win32.fBatchBld=;={2FF4D202-3072-4C33-ADAC-9D0C57C47C91}.Debug|Win32.fBatchBld=;4{B5B5319A-2398-4547-8FE4-864123C69A7A}.dwStartupOpt=;={B5B5319A-2398-4547-8FE4-864123C69A7A}.Debug|Win32.fBatchBld=;?{B5B5319A-2398-4547-8FE4-864123C69A7A}.Release|Win32.fBatchBld=;4{0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E}.dwStartupOpt=;={0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E}.Debug|Win32.fBatchBld=;?{0D4D2C20-8CB8-4ACF-8B5A-F3FDB9B38D1E}.Release|Win32.fBatchBld=;4{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}.dwStartupOpt=Q `C:\lpgsrc\ticables2\build\msvc\ticables2.vcproj`C:\lpgsrc\ticables2\build\msvc\ticables2.vcproj\C:\lpgsrc\ticalcs2\build\msvc\ticalcs2.vcproj\C:\lpProjExplorerState$ÿÿÿÿ3ZUnloadedProjects"ÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿHiddenSlnFolders"ÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿOutliningStateDir$ÿÿÿÿÿÿÿÿÿÿÿÿ:gsrc\ticalcs2\build\msvc\ticalcs2.vcprojTC:\lpgsrc\ticonv\bu Dc:\lpgsrc\ticables2\src\export1.h6c:\lpgsrc\ticonv\Cha$Bookmarks V001.01XÏ :C:\lpgsrc\tifiles2\ChangeLog©XT“ÿÿÿÿBookmarkStateÿÿÿÿ<(TaskListShortcuts$ÿÿÿÿÿÿÿÿÿÿÿÿ=OutliningState10"ÿÿÿÿ>JOutliningState9 ÿÿÿÿ@F6c:\lpgsrc\ticonv\ChangeLog¯u¥ ÿÿÿÿ:c:\lpgsrc\ticalcs2\ChangeLog±Uí¸ÿÿÿÿ<c:\lpgsrc\ticables2\ChangeLogÉ!<ÿÿÿÿ\ticalcs2\ChangeLogc:\lpgsrc\ticables2\ChangeLOutliningState8 ÿÿÿÿÿÿÿÿÿÿÿÿBJOutliningState7 ÿÿÿÿDLVsToolboxService"ÿÿÿÿFOutliningState5  ÿÿÿÿ~šogc:\lpgsrc\ticonv\ChangeLogc:\lpgsrc\ticables2\src\export1.h<open> C:\lpgsrc\tifiles2\src\export2.h<open> c:\lpgsrc\ticalcs2\src\export3.h<open> c:\lpgsrc\ticonv\src\export4.h<open> ø{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|<MiscFiles>|C:\lpgsrc\tifiles2\src\export2.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}123456¹ž ÿÿ—8M; L;ô{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|<MiscFiles>|c:\lpgsrc\ticonv\src\export4.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}12¹ž ÿÿ—8M; L;ø{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|<MiscFiles>|c:\lpgsrc\ticalcs2\src\export3.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}123456¹ž ÿÿ—8M; L;B{000D62B2-DF70-44EB-936C-CFEF0F33192D}|..\..\..\ticables2\build\msvc\ticables2.vcproj|c:\lpgsrc\ticables2\src\ticables.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}1234¹ž ÿÿ—8M; L;ú{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|<MiscFiles>|c:\lpgsrc\ticables2\src\export1.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}1234¹ž ÿÿ—8M; L;{2FF4D202-3072-4C33-ADAC-9D0C57C47C91}|ticalcs2.vcproj|c:\lpgsrc\ticalcs2\src\ticalcs.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}123456Í«4ïþîÿ=FÍ«4ïþîÿMW4Í«4ïþîÿïú(Í«4ïþîÿ; ActiveCfg= Debug|Win32;ild\msvc\ticonv.vcproj\C:\lpgsrc\tifiles2\build\msvc\tifiles2.vcprojngeLog Bc:\lpgsrc\ticalcs2\src\export3.h:c:\lpgsrc\ticalcs2\ChangeLog<c:\lpgsrc\ticables2\ChangeLog>c:\lpgsrc\ticonv\src\export4.h :C:\lpgsrc\tifiles2\ChangeLog @C:\lpgsrc\tifiles2\src\rwfile.cBC:\lpgsrc\tifiles2\src\export2.h Fc:\lpgsrc\ticables2\src\ticables.hBc:\lpgsrc\ticalcs2\src\ticalcs.hFc:\lpgsrc\ticables2\src\ticables.h»ÞÿÅ‚ƒ„…†‡ˆþÿÿÿŠ‹ŒŽ‘’“”•–—˜™š›þÿÿÿžŸ ¡¢þÿÿÿ¤¥¦§¨©ª«þÿÿÿ­®¯°±²þÿÿÿ´µ¶·¸¹º»þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ$(*%+,%-9< =CEI JNPT U]_c diko pwy‚ƒ‰Ž¥¦ÀÁÓÔèéòóüþ FHJK !KMÿÿÿÿBc:\lpgsrc\ticalcs2\src\ticalcs.hï.8&*,!-.!/>A BFHL MQSW X]_d eprv w€‚† ‡ŒŽ’ “OutliningState3 ÿÿÿÿ‰ŠOutliningState6 ÿÿÿÿÿÿÿÿÿÿÿÿœ¦OutliningState11"ÿÿÿÿÿÿÿÿÿÿÿÿ£OutliningState12"ÿÿÿÿ¬¦­¯³ ´¸º¾ ¿ÚÜà áúü    ()139:>@FGQSacop~€–—®¾ÃÄàâ67FGWXabkmqv z÷ùüý #ýÿÿÿÿÿBc:\lpgsrc\ticalcs2\src\export3.hÿ0O "%'(*,24*56*739:?+AB CFG GJLM^`ÿÿÿÿ>c:\lpgsrc\ticonv\src\export4.hp%;% "%'(*,24*56*739:?+AB CFG GJLNSV4WXYU Z[\T]M^`ÿÿÿÿBC:\lpgsrc\tifiles2\src\export2.h[,ît "%'(*,24*56*739:?+AB CFG GJLM^`ÿÿÿÿDc:\lpgsrc\ticables2\src\export1.h€ÓQ? "%'(*,24*56*739:?+AB COutliningState4 ÿÿÿÿÿÿÿÿÿÿÿÿ³ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿFG GJLNSV4WXYU Z[\T]M^`ÿÿÿÿlibticalcs-1.1.9+dfsg/build/msvc/ticalcs2.vcproj000066400000000000000000000712541327711501700215670ustar00rootroot00000000000000 libticalcs-1.1.9+dfsg/build/msvc/unistd.h000066400000000000000000000020641327711501700203060ustar00rootroot00000000000000/* TiLP - link program for TI calculators * Copyright (C) 1999-2001 Romain Lievin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef __WIN32__ #ifndef UNISTD_H #define UNISTD_H #include //for mkdir, chdir, getcwd #include //for access #define F_OK 0 #define mkdir(dir,mode) _mkdir(dir) void usleep(int ms); #endif #endif libticalcs-1.1.9+dfsg/configure.ac000066400000000000000000000163711327711501700170540ustar00rootroot00000000000000dnl Process this file with autoconf to produce a configure script. # Init. AC_PREREQ(2.57) AC_INIT(libticalcs2, 1.1.9, [tilp-users@lists.sourceforge.net]) dnl Release versioning info VERSION="1.1.9" AC_SUBST(VERSION) dnl Library version. dnl current:revision:age dnl * On a new release, increment 'revision'. dnl * If you added things to the api, increment 'current', dnl reset 'revision' and increment 'age'. dnl * If you changed/removed things from the api, increment 'current', dnl reset 'revision' and reset 'age'. m4_define(LT_CURRENT, 12) m4_define(LT_REVISION, 3) m4_define(LT_AGE, 0) LT_LIBVERSION="LT_CURRENT():LT_REVISION():LT_AGE()" AC_SUBST(LT_LIBVERSION) AM_INIT_AUTOMAKE([dist-bzip2 subdir-objects]) AM_MAINTAINER_MODE AC_CONFIG_MACRO_DIR([m4]) AC_PREFIX_DEFAULT(/usr/local) dnl Files to configure. AC_CONFIG_SRCDIR([src/ticalcs.c]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([ Makefile build/mingw/Makefile docs/Makefile po/Makefile.in src/Makefile src/tf2hex/Makefile src/romdump_8x/Makefile src/romdump_84p_usb/Makefile src/romdump_9x/Makefile src/romdump_89t_usb/Makefile src/romdump_834pce_usb/Makefile tests/Makefile ticalcs2.pc ]) # Setup libtool. AC_DISABLE_STATIC AC_LIBTOOL_WIN32_DLL LT_INIT # Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_LN_S AC_ISC_POSIX AC_PROG_AWK AC_CHECK_PROG(TFDOCGEN, tfdocgen, yes, no) AM_CONDITIONAL(USE_DOCGEN, test "$TFDOCGEN" != "no") AC_CHECK_TOOL(RC, windres, windres) # Checks for libraries. AM_GNU_GETTEXT(external) AM_GNU_GETTEXT_VERSION([0.18]) PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6.0) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) PKG_CHECK_MODULES(TICABLES, ticables2 >= 1.3.5) AC_SUBST(TICABLES_CFLAGS) AC_SUBST(TICABLES_LIBS) PKG_CHECK_MODULES(TICONV, ticonv >= 1.1.5) AC_SUBST(TICONV_CFLAGS) AC_SUBST(TICONV_LIBS) PKG_CHECK_MODULES(TIFILES, tifiles2 >= 1.1.0) AC_SUBST(TIFILES_CFLAGS) AC_SUBST(TIFILES_LIBS) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h time.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_BIGENDIAN AC_C_CONST # Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_CHECK_FUNCS([bzero memmove memset strcasecmp strdup]) # Platform specific tests. dnl AC_CANONICAL_HOST case "$host" in *-*-*bsd*) ARCH="-D__BSD__" ;; *-*-mingw*) ARCH="-D__WIN32__ -D__MINGW32__" ;; *) ARCH="-D__LINUX__" ;; esac CFLAGS="$CFLAGS $ARCH" # Ensure MSVC-compatible struct packing convention is used when # compiling for Win32 with gcc. # What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while # gcc2 uses "-fnative-struct". case $host_os in *mingw*|*cygwin*) if test x$GCC = xyes; then msnative_struct='' AC_MSG_CHECKING([how to get MSVC-compatible struct packing]) if test -z "$ac_cv_prog_CC"; then our_gcc="$CC" else our_gcc="$ac_cv_prog_CC" fi case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in 2.) if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then msnative_struct='-fnative-struct' fi ;; *) if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then msnative_struct='-mms-bitfields' fi ;; esac if test x"$msnative_struct" = x ; then AC_MSG_RESULT([no way]) AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code]) else CFLAGS="$CFLAGS $msnative_struct" AC_MSG_RESULT([${msnative_struct}]) fi fi ;; esac AM_CONDITIONAL(OS_WIN32, test "$msnative_struct") # Check for the new -fvisibility=hidden flag introduced in gcc 4.0 # Allow to reduce shared library size and avoid symbol clash case $host_os in *mingw*) ;; *) if test x$GCC = xyes; then visibility_flag='' AC_MSG_CHECKING([whether gcc accepts -fvisibility]) if test -z "$ac_cv_prog_CC"; then our_gcc="$CC" else our_gcc="$ac_cv_prog_CC" fi if $our_gcc -v --help 2>/dev/null | grep "fvisibility" >/dev/null; then visibility_flag='-fvisibility=hidden' fi if test x"$visibility_flag" = x ; then AC_MSG_RESULT([no]) else CFLAGS="$CFLAGS $visibility_flag" AC_MSG_RESULT([${visibility_flag}]) AC_DEFINE(HAVE_FVISIBILITY, 1, [Use -fvisibility=hidden flag]) fi fi ;; esac # Check for tools needed to build ROM dumpers # Find a C compiler for the build system (needed for compiling tf2hex) AC_ARG_VAR([CC_FOR_BUILD], [C compiler for programs to be run on the build system]) AC_ARG_VAR([CFLAGS_FOR_BUILD], [C compiler flags for CC_FOR_BUILD]) AC_MSG_CHECKING([for the host compiler]) if test "x$build" == "x$host" ; then # Not cross-compiling. CC_FOR_BUILD=$CC CFLAGS_FOR_BUILD=$CFLAGS AC_MSG_RESULT([${CC_FOR_BUILD}]) else # Try to find the host CC among several choices AC_CHECK_PROGS(CC_FOR_BUILD, [gcc cc clang c89 c99], [false]) if test "x$CC_FOR_BUILD" = "xfalse" ; then AC_MSG_FAILURE([not found.]) else AC_MSG_RESULT([${CC_FOR_BUILD}]) fi fi # * Pass --disable-builtin-rom-dumpers to force the ROM dumpers to be # recompiled. The default is not to recompile them (but maintainers should # recompile them and watch out for changes !) AC_ARG_ENABLE([builtin-rom-dumpers], AS_HELP_STRING([--disable-builtin-rom-dumpers], [do recompile ROM dumping utilities]), [], [enable_builtin_rom_dumpers=yes]) AC_ARG_VAR([SPASM], [SPASM Z80 assembler]) AC_ARG_VAR([TIPACK], [Tool for creating TI variable files]) have_spasm=no have_tipack=no have_tigcc=no : ${SPASM=spasm} : ${TIPACK=tipack} if test "x$enable_builtin_rom_dumpers" != "xyes" ; then AC_MSG_CHECKING([whether $SPASM works]) cat >conftest.asm <&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then have_spasm=yes fi AC_MSG_RESULT([$have_spasm]) if test "x$have_spasm" = "xyes" ; then AC_MSG_CHECKING([whether $TIPACK works]) if "$TIPACK" conftest.bin -p -o conftest.8xp >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then have_tipack=yes fi AC_MSG_RESULT([$have_tipack]) fi AC_MSG_CHECKING([whether tigcc works]) cat >conftest.c < void _main(void) { ClrScr(); DrawStr(0, 0, "Hello World !", A_NORMAL); GKeyIn(NULL, 0); } EOF if tigcc -Os -Wall -W -v conftest.c -o conftest >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then have_tigcc=yes fi AC_MSG_RESULT([$have_tigcc]) fi if test "x$have_spasm$have_tipack" = "xyesyes" ; then build_z80_rom_dumpers=yes else build_z80_rom_dumpers=no if test "x$enable_builtin_rom_dumpers" = "xno" ; then AC_MSG_FAILURE([spasm and/or tipack are not installed or are not usable.]) fi fi if test "x$have_tigcc" = "xyes" ; then build_68k_rom_dumpers=yes else build_68k_rom_dumpers=no if test "x$enable_builtin_rom_dumpers" = "xno" ; then AC_MSG_FAILURE([tigcc is not installed or is not usable.]) fi fi AM_CONDITIONAL(BUILD_Z80_ROM_DUMPERS, test "x$build_z80_rom_dumpers" = "xyes") AM_CONDITIONAL(BUILD_68K_ROM_DUMPERS, test "x$build_68k_rom_dumpers" = "xyes") # Output. AC_OUTPUT echo "Now, you can type 'make' and 'make install'." libticalcs-1.1.9+dfsg/docs/000077500000000000000000000000001327711501700155065ustar00rootroot00000000000000libticalcs-1.1.9+dfsg/docs/Makefile.am000066400000000000000000000010621327711501700175410ustar00rootroot00000000000000## Process this file with automake to produce Makefile.in EXTRA_DIST = *.txt html docdir = ${datadir}/doc/${PACKAGE} all: docs docs: tfdocgen ../ install: @INSTALL@ -d $(DESTDIR)${docdir} @INSTALL@ -d $(DESTDIR)${docdir}/html @INSTALL@ -m644 html/* $(DESTDIR)${docdir}/html @INSTALL@ -m644 ../AUTHORS ../ChangeLog ../COPYING ../README \ $(DESTDIR)${docdir} uninstall: rm -f $(DESTDIR)${docdir}/html/* clean: rm -f html/*.c.html html/*.h.html html/api.html files: @files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \ echo $$p; \ done libticalcs-1.1.9+dfsg/docs/ReadMe.txt000066400000000000000000000000761327711501700174070ustar00rootroot00000000000000You will the 'tfdocgen' program to build the documentation... libticalcs-1.1.9+dfsg/docs/api.txt000066400000000000000000000006221327711501700170200ustar00rootroot00000000000000ticalcs.h : Enumerations, structures and type definitions ticalcs.c : Entry Points error.c : General Functions type2str.c : Types / Strings conversions calc_xx.c : Hand-held management layer dirlist.c : Directory listing management clock.c : Clock support tikeys.c : Getting scancode for TI keys probe.c : Automatic probing of hand-held model backup.c : General backup support (backup and tig)libticalcs-1.1.9+dfsg/docs/html/000077500000000000000000000000001327711501700164525ustar00rootroot00000000000000libticalcs-1.1.9+dfsg/docs/html/api.html000066400000000000000000000251011327711501700201100ustar00rootroot00000000000000 Header File Index
TiCalcs Library API

The ticalcs library provide a complete API (Application Programming Interface)  which makes use of TI hand-helds and their link protocols easy and transparent.

Functions and data types are grouped in different topics, depending on their purpose. Click on a topic for the description of all functions and data types defined in this topic.

Enumerations, structures and type definitions
Entry Points
General Functions
Types / Strings conversions
Hand-held management layer
Directory listing management
Clock support
Getting scancode for TI keys
Automatic probing of hand-held model
General backup support (backup and tig)

Return to the main index

libticalcs-1.1.9+dfsg/docs/html/api_.html000066400000000000000000000017231327711501700202530ustar00rootroot00000000000000 Header File Index
TiCalcs Library API

The ticalcs library provide a complete API (Application Programming Interface)  which makes use of TI hand-helds and their link protocols easy and transparent.

Functions and data types are grouped in different topics, depending on their purpose. Click on a topic for the description of all functions and data types defined in this topic.

==========[ List of entries ]==========

Return to the main index

libticalcs-1.1.9+dfsg/docs/html/backup.c.html000066400000000000000000000047341327711501700210360ustar00rootroot00000000000000 Header File Index
General backup support (backup and tig)

ticalcs_calc_send_tigroup

TIEXPORT3 int TICALL ticalcs_calc_send_tigroup(CalcHandle* handle, TigContent* content, TigMode mode)

Send a TiGroup file.

handle :
a previously allocated handle
filename :
name of file
mode :
which vars/apps to send
Return value :
0 if ready else ERR_NOT_READY.

ticalcs_calc_recv_tigroup

TIEXPORT3 int TICALL ticalcs_calc_recv_tigroup(CalcHandle* handle, TigContent* content, TigMode mode)

Receive a TiGroup file.

handle :
a previously allocated handle
filename :
name of file
mode :
which vars/apps to receive
Return value :
0 if ready else ERR_NOT_READY.

Return to the main index




libticalcs-1.1.9+dfsg/docs/html/calc_xx.c.html000066400000000000000000001302201327711501700212000ustar00rootroot00000000000000 Header File Index
Hand-held management layer

ticalcs_calc_features

TIEXPORT3 CalcFeatures TICALL ticalcs_calc_features(CalcHandle* handle)

Returns the features and operations supported by the hand-held.

handle :
a previously allocated handle
Return value :
a mask of features (CalcFeatures).

ticalcs_calc_isready

TIEXPORT3 int TICALL ticalcs_calc_isready(CalcHandle* handle)

Check whether calc is ready.

handle :
a previously allocated handle
Return value :
after connecting to the calculator, you usually want to use this command once, before attempting to use any other commands. This is required on some models (protocols). There are exceptions to this general rule, especially when a DUSB calculator (84+ family, 89T) is in the OS receive mode, where the Ready check cannot be performed. Return value: 0 if ready else ERR_NOT_READY.

ticalcs_calc_send_key

TIEXPORT3 int TICALL ticalcs_calc_send_key(CalcHandle* handle, uint32_t key)

Check whether calc is ready.

handle :
a previously allocated handle
key :
a TI scancode
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_execute

TIEXPORT3 int TICALL ticalcs_calc_execute(CalcHandle* handle, VarEntry* ve, const char* args)

Remotely execute a program or a FLASH application. Restrictions: execution of FLASH applications is supported thru D-USB only.

handle :
a previously allocated handle
ve :
folder and variable name with type
args :
argument to pass to program (in TI-charset, aka native)
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_recv_screen

TIEXPORT3 int TICALL ticalcs_calc_recv_screen(CalcHandle* handle, CalcScreenCoord* sc, uint8_t** bitmap)

Request a screenshot and receive a raw bitmap in the calculator's native format (depending on the model, 1 bit B/W, 4-bit grayscale, 16-bit color).

handle :
a previously allocated handle
sc :
a structure which contains required screen format and returns screen sizes
bitmap :
adress of pointer for allocated bitmap. Must be freed when no longer needed.
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_recv_screen_rgb888

TIEXPORT3 int TICALL ticalcs_calc_recv_screen_rgb888(CalcHandle* handle, CalcScreenCoord* sc, uint8_t** bitmap)

Request a screenshot and receive a RGB888 bitmap (convenience function).

handle :
a previously allocated handle
sc :
a structure which contains required screen format and returns screen sizes
bitmap :
adress of pointer for allocated bitmap. Must be freed when no longer needed.
Return value :
0 if successful, an error code otherwise.

ticalcs_free_screen

g_free((void *)bitmap);

Frees a bitmap previously allocated by ticalcs_calc_recv_screen() or ticalcs_calc_recv_screen_rgb888().

bitmap :
a previously allocated bitmap
Return value :


ticalcs_calc_get_dirlist

TIEXPORT3 int TICALL ticalcs_calc_get_dirlist(CalcHandle* handle, GNode** vars, GNode **apps)

Request a directory listing.

handle :
a previously allocated handle
vars :
a tree of folder & variables
apps :
a tree of FLASH apps
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_get_memfree

TIEXPORT3 int TICALL ticalcs_calc_get_memfree(CalcHandle* handle, uint32_t* ram, uint32_t *flash)

Request free memory. Do a dirlist to update value.

handle :
a previously allocated handle
ram :
RAM memory available
flash :
Flash memory available
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_send_backup

TIEXPORT3 int TICALL ticalcs_calc_send_backup(CalcHandle* handle, BackupContent* content)

Send a backup.

handle :
a previously allocated handle
content :
backup content
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_recv_backup

TIEXPORT3 int TICALL ticalcs_calc_recv_backup(CalcHandle* handle, BackupContent* content)

Request a backup and receive it.

handle :
a previously allocated handle
content :
backup content
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_send_var

TIEXPORT3 int TICALL ticalcs_calc_send_var(CalcHandle* handle, CalcMode mode, FileContent* content)

Send one or more variables (silent mode).

handle :
a previously allocated handle
mode :
to document
content :
file content to send
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_recv_var

TIEXPORT3 int TICALL ticalcs_calc_recv_var(CalcHandle* handle, CalcMode mode, FileContent* content, VarRequest* vr)

Request receiving of _one_ variable (silent mode).

handle :
a previously allocated handle
mode: :
(null)
content :
where to store variable content
var :
a #VarRequest structure got with dirlist
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_send_var_ns

TIEXPORT3 int TICALL ticalcs_calc_send_var_ns(CalcHandle* handle, CalcMode mode, FileContent* content)

Send one or more variable (non-silent mode).

handle :
a previously allocated handle
mode: :
(null)
content :
file content to send
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_recv_var_ns

TIEXPORT3 int TICALL ticalcs_calc_recv_var_ns(CalcHandle* handle, CalcMode mode, FileContent* content, VarEntry** var)

Receive one or more variable (non-silent mode).

handle :
a previously allocated handle
mode: :
(null)
content :
where to store variables
var :
information on the received variable (if single) or NULL (if group)
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_send_app

TIEXPORT3 int TICALL ticalcs_calc_send_app(CalcHandle* handle, FlashContent* content)

Send a FLASH app.

handle :
a previously allocated handle
content :
content to send
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_recv_app

TIEXPORT3 int TICALL ticalcs_calc_recv_app(CalcHandle* handle, FlashContent* content, VarRequest* vr)

Request receiving of a FLASH app.

handle :
a previously allocated handle
content :
where to store content
var :
FLASH app to request
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_send_os

TIEXPORT3 int TICALL ticalcs_calc_send_os(CalcHandle* handle, FlashContent* content)

Send a FLASH os.

handle :
a previously allocated handle
content :
content to send
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_recv_idlist

TIEXPORT3 int TICALL ticalcs_calc_recv_idlist(CalcHandle* handle, uint8_t* idlist)

Request ID-LIST of hand-held.

handle :
a previously allocated handle
idlist :
static buffer (32 chars) where to store ID-LIST
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_dump_rom_1

TIEXPORT3 int TICALL ticalcs_calc_dump_rom_1(CalcHandle* handle)

Send a ROM dumping program to hand-held.

handle :
a previously allocated handle
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_dump_rom_2

TIEXPORT3 int TICALL ticalcs_calc_dump_rom_2(CalcHandle* handle, CalcDumpSize size, const char *filename)

Start dumping (if possible).

handle :
a previously allocated handle
size :
optional size of dump
filename :
where to store the dump
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_set_clock

TIEXPORT3 int TICALL ticalcs_calc_set_clock(CalcHandle* handle, CalcClock* _clock)

Set date & time of hand-held (if AMS >= 2.09).

handle :
a previously allocated handle
clock :
a #CalcClock structure
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_get_clock

TIEXPORT3 int TICALL ticalcs_calc_get_clock(CalcHandle* handle, CalcClock* _clock)

Get date & time of hand-held (if AMS >= 2.09).

handle :
a previously allocated handle
clock :
a #CalcClock structure
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_del_var

TIEXPORT3 int TICALL ticalcs_calc_del_var(CalcHandle* handle, VarRequest* vr)

Request deleting of a variable (if possible).

handle :
a previously allocated handle
var :
var to delete
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_new_fld

TIEXPORT3 int TICALL ticalcs_calc_new_fld(CalcHandle* handle, VarRequest* vr)

Request creation of a folder. Beware: %vr.name may be modified !

handle :
a previously allocated handle
vr :
name of folder to create (vr->folder)
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_get_version

TIEXPORT3 int TICALL ticalcs_calc_get_version(CalcHandle* handle, CalcInfos* infos)

Request version info.

handle :
a previously allocated handle
infos :
where to store version information
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_send_cert

TIEXPORT3 int TICALL ticalcs_calc_send_cert(CalcHandle* handle, FlashContent* content)

Send a certificate.

handle :
a previously allocated handle
content :
content to send
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_recv_cert

TIEXPORT3 int TICALL ticalcs_calc_recv_cert(CalcHandle* handle, FlashContent* content)

Request receiving of a FLASH app.

handle :
a previously allocated handle
content :
where to store content
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_rename_var

TIEXPORT3 int TICALL ticalcs_calc_rename_var(CalcHandle* handle, VarRequest* oldname, VarRequest *newname)

Remotely rename a variable, and/or move it to a different folder.

handle :
a previously allocated handle
oldname :
existing name and folder
newname :
new name and folder
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_change_attr

TIEXPORT3 int TICALL ticalcs_calc_change_attr(CalcHandle* handle, VarRequest* vr, FileAttr attr)

Remotely change a variable's archive/lock state.

handle :
a previously allocated handle
vr :
variable to modify
attr :
new attributes for variable
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_send_all_vars_backup

TIEXPORT3 int TICALL ticalcs_calc_send_all_vars_backup(CalcHandle* handle, FileContent* content)

Send a fake backup, for the models which support it.

handle :
a previously allocated handle
content :
backup content
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_recv_all_vars_backup

TIEXPORT3 int TICALL ticalcs_calc_recv_all_vars_backup(CalcHandle* handle, FileContent* content)

Request a fake backup (list of vars and apps) and receive it.

handle :
a previously allocated handle
content :
backup content
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_send_backup2

TIEXPORT3 int TICALL ticalcs_calc_send_backup2(CalcHandle* handle, const char* filename)

Send a backup from file.

handle :
a previously allocated handle
filename :
name of file which contains backup to send
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_recv_backup2

TIEXPORT3 int TICALL ticalcs_calc_recv_backup2(CalcHandle* handle, const char *filename)

Request a backup and receive it to file.

handle :
a previously allocated handle
filename :
name of file where to store backup
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_send_var2

TIEXPORT3 int TICALL ticalcs_calc_send_var2(CalcHandle* handle, CalcMode mode, const char* filename)

Send one or more variables (silent mode) from file.

handle :
a previously allocated handle
mode :
to document
filename :
name of file
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_recv_var2

TIEXPORT3 int TICALL ticalcs_calc_recv_var2(CalcHandle* handle, CalcMode mode, const char* filename, VarRequest* vr)

Request receiving of _one_ variable (silent mode).

handle :
a previously allocated handle
mode: :
(null)
content :
where to store variable content
var :
a #VarRequest structure got with dirlist
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_send_var_ns2

TIEXPORT3 int TICALL ticalcs_calc_send_var_ns2(CalcHandle* handle, CalcMode mode, const char* filename)

Send one or more variable (non-silent mode).

handle :
a previously allocated handle
mode: :
(null)
filename :
name of file
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_recv_var_ns2

TIEXPORT3 int TICALL ticalcs_calc_recv_var_ns2(CalcHandle* handle, CalcMode mode, const char* filename, VarEntry** vr)

Receive one or more variable (non-silent mode).

handle :
a previously allocated handle
mode: :
(null)
filename :
where to store variables
var :
information on the received variable (if single) or NULL (if group)
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_send_app2

TIEXPORT3 int TICALL ticalcs_calc_send_app2(CalcHandle* handle, const char* filename)

Send a FLASH app or os.

handle :
a previously allocated handle
filename :
name of file
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_recv_app2

TIEXPORT3 int TICALL ticalcs_calc_recv_app2(CalcHandle* handle, const char* filename, VarRequest* vr)

Request receiving of a FLASH app.

handle :
a previously allocated handle
content :
where to store content
var :
FLASH app to request
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_send_cert2

TIEXPORT3 int TICALL ticalcs_calc_send_cert2(CalcHandle* handle, const char* filename)

Send a certificate.

handle :
a previously allocated handle
filename :
name of file
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_send_os2

TIEXPORT3 int TICALL ticalcs_calc_send_os2(CalcHandle* handle, const char* filename)

Send a FLASH app.

handle :
a previously allocated handle
filename :
name of file
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_recv_cert2

TIEXPORT3 int TICALL ticalcs_calc_recv_cert2(CalcHandle* handle, const char* filename)

Request certificate. Depending on extension, saves it as *.9Xq or *.cer.

handle :
a previously allocated handle
filename :
name of file
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_send_tigroup2

TIEXPORT3 int TICALL ticalcs_calc_send_tigroup2(CalcHandle* handle, const char* filename, TigMode mode)

Send a TiGroup file.

handle :
a previously allocated handle
filename :
name of file
mode :
which vars/apps to send
Return value :
0 if successful, an error code otherwise.

ticalcs_calc_recv_tigroup2

TIEXPORT3 int TICALL ticalcs_calc_recv_tigroup2(CalcHandle* handle, const char* filename, TigMode mode)

Receive a TiGroup file.

handle :
a previously allocated handle
filename :
name of file
mode :
which vars/apps to receive
Return value :
0 if successful, an error code otherwise.

Return to the main index




libticalcs-1.1.9+dfsg/docs/html/clock.c.html000066400000000000000000000060231327711501700206550ustar00rootroot00000000000000 Header File Index
Clock support

ticalcs_clock_format2date

TIEXPORT3 const char *TICALL ticalcs_clock_format2date(CalcModel model, int value)

Convert a format type into a format string. Example: 1 -> "MM/DD/YY"

model :
a calculator model
value :
a format type
Return value :
a format string.

ticalcs_clock_date2format

TIEXPORT3 int TICALL ticalcs_clock_date2format(CalcModel model, const char *format)

Convert a format string into a format type. Example: "MM/DD/YY" -> 1

model :
a calculator model
format :
a format string
Return value :
a format string.

ticalcs_clock_show

TIEXPORT3 int TICALL ticalcs_clock_show(CalcModel model, CalcClock* s)

Display to stdout the content of the structure.

model :
calc model
clock :
a #CalcClock structure
Return value :
always 0.

Return to the main index




libticalcs-1.1.9+dfsg/docs/html/constant-s.gif000066400000000000000000000002401327711501700212260ustar00rootroot00000000000000GIF87a³€€€€€ÀÀÀÿÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ,SH@«2kPº÷”¶}$‡‰G‚ª®ß9±K×â[ÁÞw²ŒŽçÙ ž’XN>ÁN <"{IÜl©¤:S"³š ÷ÆMëí«£±oÆ2<»ØC;libticalcs-1.1.9+dfsg/docs/html/constant.gif000066400000000000000000000003401327711501700207670ustar00rootroot00000000000000GIF87a ³€€€€€ÀÀÀÿÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ, “ÈI«½˜€Í»çYdiž „Óˆ¾ä¸².ŒºsVÛ¦î¼Û/hSéˆ0#ˆŒå,̦òEN¡ÍÛS  Þוû ‡µÇÓÀË>÷¶”j`¦£—¯uA/†·Pmlvoi'f_}…&‡I~UDcqY'’”%–˜™ŽœNŠ”šŸ ¤A§ )ž®¯¤³´µ¶·O;libticalcs-1.1.9+dfsg/docs/html/dirlist.c.html000066400000000000000000000154111327711501700212350ustar00rootroot00000000000000 Header File Index
Directory listing management

ticalcs_dirlist_destroy

TIEXPORT3 void TICALL ticalcs_dirlist_destroy(GNode** tree)

Destroy the whole tree create by #ticalcs_calc_get_dirlist.

tree :
the tree to destroy.
Return value :
none.

ticalcs_dirlist_display

TIEXPORT3 void TICALL ticalcs_dirlist_display(GNode* tree)

Display to stdout the tree content formatted in a tab.

tree :
the tree to display.
Return value :
none.

ticalcs_dirlist_ve_exist

TIEXPORT3 VarEntry *TICALL ticalcs_dirlist_ve_exist(GNode* tree, VarEntry *s)

Parse the tree for the given varname & folder or appname.

tree :
the tree to parse.
s :
the full name of the variable or application to search for.
Return value :
a pointer on the #VarEntry found or NULL if not found.

ticalcs_dirlist_ve_count

TIEXPORT3 unsigned int TICALL ticalcs_dirlist_ve_count(GNode* tree)

Count how many entries (vars or apps) are listed in the tree.

tree :
a tree (var or app).
Return value :
the number of entries.

ticalcs_dirlist_ram_used

TIEXPORT3 int TICALL ticalcs_dirlist_ram_used(GNode* tree)

Count how much memory is used by variables listed in the tree.

tree :
a tree (var only).
Return value :
size of all variables in bytes.

ticalcs_dirlist_flash_used

TIEXPORT3 int TICALL ticalcs_dirlist_flash_used(GNode* vars, GNode* apps)

Count how much memory is used by archived variables and apps listed in the trees.

tree :
a tree (app only).
Return value :
size of all FLASH in bytes.

ticalcs_dirlist_ve_add

TIEXPORT3 void TICALL ticalcs_dirlist_ve_add(GNode* tree, VarEntry *entry)

Add an entry into the main tree (if it doesn't exist yet).

tree :
source tree.
entry :
entry to add.
Return value :
none.

ticalcs_dirlist_ve_del

TIEXPORT3 void TICALL ticalcs_dirlist_ve_del(GNode* tree, VarEntry *entry)

Remove an entry into the main tree (if it doesn't exist yet).

tree :
source tree.
entry :
entry to remove.
Return value :
none.

Return to the main index




libticalcs-1.1.9+dfsg/docs/html/error.c.html000066400000000000000000000046641327711501700207240ustar00rootroot00000000000000 Header File Index
General Functions

ticalcs_error_get

TIEXPORT3 int TICALL ticalcs_error_get(int number, char **message)

Attempt to match the message corresponding to the error number. The returned string must be freed when no longer needed. The error message has the following format: - 1: the error message - 2: the cause(s), explanations on how to fix it - 3: the error returned by the system

number :
error number (see error.h for list).
message :
a newly glib allocated string which contains corresponding error *message.
Return value :
0 if error has been caught, the error number otherwise (propagation).

ticalcs_error_free

TIEXPORT3 int TICALL ticalcs_error_free(char *message)

Free the given message string allocated by ticalcs_error_get();

message :
a message previously allocated by ticalcs_error_get()
Return value :
0 if the argument was valid and the message was freed, nonzero otherwise.

Return to the main index




libticalcs-1.1.9+dfsg/docs/html/faq.html000066400000000000000000000017241327711501700201130ustar00rootroot00000000000000 Frequently Asked Questions

Frequently Asked Questions


  
There is no specific FAQ for this library. But, you can take a look at the TiLP's FAQ.

Visit also the SourceForge page of the TiLP project. There are 2 mailing lists as well as a forum and a BTS (Bug Tracking System).


Return to the main index


libticalcs-1.1.9+dfsg/docs/html/function-s.gif000066400000000000000000000002511327711501700212240ustar00rootroot00000000000000GIF87a³ÿÿÿÿÿ€€€ÿÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ,\ÐH@«2kpº÷”¶}$‡‰G‚ªÁwç¯s©3At9Wg°"t`G P…ãLjLE=>±Ê‘f‡O‘Jª¥AgL'L¢ž;ß Ø)3Ïé7»mõá^þ!;libticalcs-1.1.9+dfsg/docs/html/function.gif000066400000000000000000000004151327711501700207660ustar00rootroot00000000000000GIF87a ³ÿÿÿÿÿ€€€ÿÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ, ÀÐÈI«½Ø€Í»çYdižP„Óˆ¾ä¸².ŒºsVÛ¦î¼Ûï Š'•΄|5c9ËîI”ž©¨ˆ9( ¥±¤Äìİ@—¬¥L×(4{ªWx–NR{Á$rP|z&†=m-a‡'‰ƒf‡_ke50›˜RˆŽ“Š„~$•v{’u%x}zž[yœ©±nˆ©\£«¯¬s¼TV}µ‹S¹WÆ„ÂÊXª™A6¶ŒÓ/ÕÈÛÜÇàáâãäQ;libticalcs-1.1.9+dfsg/docs/html/gnugpl.html000066400000000000000000000466011327711501700206430ustar00rootroot00000000000000 GNU General Public License v2.0

GNU GENERAL PUBLIC LICENSE

Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.  
51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA

Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Preamble

The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.

When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.

To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.

For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.

We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.

Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.

Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.

The precise terms and conditions for copying, distribution and modification follow.

TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".

Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.

1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.

You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.

2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:

a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.

In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.

3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:

a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.

If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.

4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.

5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.

6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.

7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.

It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.

This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.

8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.

9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.

10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.

NO WARRANTY

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.

one line to give the program's name and an idea of what it does.
Copyright (C) yyyy  name of author

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

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 Street, Fifth Floor, Boston, MA  02110-1301, USA.

Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this when it starts in an interactive mode:

Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
type `show w'.  This is free software, and you are welcome
to redistribute it under certain conditions; type `show c' 
for details.

The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.

You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:

Yoyodyne, Inc., hereby disclaims all copyright
interest in the program `Gnomovision'
(which makes passes at compilers) written 
by James Hacker.

signature of Ty Coon, 1 April 1989
Ty Coon, President of Vice

This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.

libticalcs-1.1.9+dfsg/docs/html/header.gif000066400000000000000000000006031327711501700203700ustar00rootroot00000000000000GIF87a ³úúúúúú„„„ÄÄÄúúúÿÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ, þÉI«½— ²§@ÑQâö]¥a˜!{¢ªŠ ¸pøá¶ àà:ˆ/—l Ú†ÀNg|õd<§0`ŒV•K’Õ>Ñc`~vjæ­ :Üi} xÜ5çRÛ0& €64"RhuDB8.…4C0}UUnD‘H74‰t`=˜"¥<ž«“^;UC>L!©’ž FhkE²³K%·“¼G¯¿ÀC‡©¤}CÓ0CÎ/8¯Ô#±¥\0éÒîãØíôê²ìááñ¥æ–*à®`»w֘ѣg/üôˆè„@.,˜ÜÂz7éAÔ'‘ⵋ=q‰°b-l EFÜ'ŽVj|×+ØÍ"Gö³y‚„¯–D‹ZÀÁTiÑN;libticalcs-1.1.9+dfsg/docs/html/headers.html000066400000000000000000000022161327711501700207540ustar00rootroot00000000000000 Header File Index
TiCalcs Library Header Files

There are few headers to include for using the ticalcs library. They are listed below:

ticalcs.h
Convenient header which includes all the stuff you need.

Note: these are the headers you are allowed to include in your program. Don't use any others, please !


Return to the main index

libticalcs-1.1.9+dfsg/docs/html/htlib.html000066400000000000000000000047121327711501700204460ustar00rootroot00000000000000 Making programs against the TiCables library

How to make a program against the ticalcs library


  
You will find in the test folder of the library source archive a test/example program which uses this library.
Below is a light version (most error management has been removed and update functions are set to void) of this program to make it clearer:

#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
#include <ticables.h>
#include <tifiles.h>
#include <ticalcs.h>
      
static void print_lc_error(int errnum)
{
  char *msg;

  ticables_error_get(errnum, &msg);
  fprintf(stderr, "Link cable error (code %i)...\n<<%s>>\n", errnum, msg);

  g_free(msg);
}

int main(int argc, char **argv)
{
  CableHandle* cable;
  CalcHandle* calc;
  int err;

  // init libs
  ticables_library_init();
  ticalcs_library_init();

  // set cable
  cable = ticables_handle_new(CABLE_BLK, PORT_2);
  if(cable == NULL)
    return -1;

  // set calc
  calc = ticalcs_handle_new(CALC_TI83);
  if(calc == NULL)
    return -1;

  // attach cable to calc (and open cable)
  err = ticalcs_cable_attach(calc, cable);

  err = ticalcs_calc_isready(h);
  if(err)
     print_lc_error(err);
  printf("Hand-held is %sready !\n", err ? "not " : "");

  // detach cable (made by handle_del, too)
  err = ticalcs_cable_detach(calc);

  // remove calc & cable
  ticalcs_handle_del(calc);
  ticables_handle_del(cable);

  return 0;
}
That's all !

NOTE: for this example to work, you probably have to add compiler options related to the include path and library path, e.g.
gcc -I/usr/include/tilp2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Os -g -Wall -W <...>.c -o <...> -lglib-2.0 -lticalcs2
or better
gcc -Os -g -Wall -W `pkg-config --cflags --libs ticalcs2` ticalcs.c -o ticalcs

Return to the main index

libticalcs-1.1.9+dfsg/docs/html/index.html000066400000000000000000000023541327711501700204530ustar00rootroot00000000000000 TiCalcs Library Documentation

TiCalcs-2 Library Documentation

Library version 1.1.5



Contents



How to...



Warning: This documentation, although quite complete, may contains some errors... In this case, feel free to report it.


Documentation written by Romain Liévin. libticalcs-1.1.9+dfsg/docs/html/info.gif000066400000000000000000000003631327711501700200760ustar00rootroot00000000000000GIF87a ³úúú„„}ÄÄ}ÿÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ, ¦°ÈI«½8ë­ÿ—}Bi–ŸHgÛjÁº4*Îu wy/ì ä€+_`ÙCJ„ÃâàhÒØã ÙcN›ÜÚ2à³M¬§ñ·¹}v—kí9§ŽëÚ2:ÜNàÑ%je?z|}xy4‚>~Š€p’l9cŽŠn5Yˆ„›‘X ¢£‘ZX¤ƒ&¨¯ƒ²¤:¦1¦ ¦­1£ÁÅÁÃÆÂ;libticalcs-1.1.9+dfsg/docs/html/info.html000066400000000000000000000072261327711501700203020ustar00rootroot00000000000000 General Information about TiCalcs library

General Information about the TiCalcs library


  
The TiCalcs library is a part of the TiLP project and constitutes with the other libraries a complete framework for developping linking and/or TI calculator files oriented applications.

Overview

The ticalcs library is a library which brings about all the functions needed to communicate with a Texas Instruments graphing calculator (or hand-held). Currently, it does not support some education devices (such as CBL/CBR and others).

This library is able to communicate with handhelds in a fairly transparent fashion. With this library, the developer does not have to worry about the packet oriented protocol, the file management and some other stuff.
The library provides a complete API which is very easy to use and makes things easier.

The library supports all the currently available calculators and their associated file formats:
- TI8x calculators: TI73, 82, 83, TI83+, 85 and 86 (with 2 sub-classes: TI73/83+ & 85/86).
- TI9x calculators: TI89, 92, 92+ and V200PLT.

This library has already been used by various projects (such as TiLP, TiEmu) and by other developers. The list of developers/users can be viewed on the TiLP web site (Developers section).

Requirements

This library is dependant of the ticonv, ticables and tifiles and GLib 2 libraries.
At the time being, this library is dependant of the GLib (version 1.2), too. The GLIb is used for its GTree capabilites. This dependancy should be removed later with a built-in tree support.

Bug Reports

There may still be some bugs in the library, please send an email to roms.

History

This library is a part of the TiLP project. I have been working for 3 years on TiLP as well as on some other projects (TiEmu, TiGCC).
I wroten this library for several reasons:
- split code,
- share code between my various project,
- provide source code to others.

Copyright

Copyright (C) 1999-2009 the TiLP team
See AUTHORS for detailed authorship information.

This library is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.

This library 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 library (in the COPYING file); if not, see http://www.gnu.org/licenses/.

Return to the main index

libticalcs-1.1.9+dfsg/docs/html/langext-s.gif000066400000000000000000000002701327711501700210420ustar00rootroot00000000000000GIF87a³€ÿ€€ÿÿ€ÿ€€ÿÿ€€€ÀÀÀÿÿøÿÿÿÿÿÿÿÿÿÿÿÿ,kÈIçºxÆ»g@†mœñq¡¨1Šá*JU]$cº¡ïzZ{†œ`8ì­`HXŽ· ÕL!±è,¹®K&¡ 3$¥ÓíêÒV0Q¼i]•f¶Õ£¦Ž?Á87é­ ä.(zc‚t2s')"ˆ2* ;libticalcs-1.1.9+dfsg/docs/html/langext.gif000066400000000000000000000004431327711501700206040ustar00rootroot00000000000000GIF87a ³€ÿ€€ÿÿ€ÿ€€ÿÿ€€€ÀÀÀÿÿøÿÿÿÿÿÿÿÿÿÿÿÿ, ÖÈIke+ë½û`(‚@ÂÞ¨†åÉ¥JlÄt­|­«¥Œá¯,“.ÃóýH–¤CüÈd³€@­Z­€]ȰåN ‚°xLÍñV¾ïuMhÁl¶ïx.(›Î@5{qErtbvNPpz{„gFiT‚ƒm}]#‰Šn†Oq‘u“…@$ŠW™¢=‘‹šQ‡—{¦GG ©‚« €¤|¡ ˆª x´£¼¸"=¶t¸63>RÈɹÆÎsÖ²FÇÈ”pÁÕxyJI æ@ íîïðêèóBC ñøøC;libticalcs-1.1.9+dfsg/docs/html/probe.c.html000066400000000000000000000215761327711501700207030ustar00rootroot00000000000000 Header File Index
Automatic probing of hand-held model

ticalcs_probe_calc_2

static int ticalcs_probe_calc_2(CalcHandle* handle, CalcModel* model)

This function tries and detect the calculator type for non-silent models by requesting a screedump and analyzing the Machine ID. It supposes your calc is on and plugged.

handle :
a previously allocated handle
type :
the calculator model
Return value :
08 6D 00 00 PC request a screen dump TI: MId 56 00 00 TI reply OK Beware: the call sequence is very important: 86, 85, 73, 83, 82 !!! Return value: 0 if successful, an error code otherwise.

ticalcs_probe_calc_1

static int ticalcs_probe_calc_1(CalcHandle* handle, CalcModel* model)

Check if the calculator is ready and detect the type. Works only on FLASH calculators with an AMS2.08 or OS2.00 by requesting the version. A previous version was based on MID but TI83+/84+, TI89/TI89t, TI92+/V200 could not be distinguished ;-(

handle :
a previously allocated handle
type :
the calculator model
Return value :
0 if successful, an error code otherwise.

ticalcs_probe_calc

TIEXPORT3 int TICALL ticalcs_probe_calc(CableHandle* cable, CalcModel* model)

This function attempts to detect the calculator model plugged onto the cable. It works in a heuristic fashion.

cable :
a valid (=opened/attached) link cable handle
model :
the calculator model which have been detected
Return value :
0 if successful, an error code otherwise.

ticalcs_probe_usb_calc

TIEXPORT3 int TICALL ticalcs_probe_usb_calc(CableHandle* cable, CalcModel* model)

This function attempts to detect the calculator model plugged onto the cable. It works in a heuristic fashion and with FLASH hand-helds only.

cable :
a valid (=opened/attached) link cable handle
model :
the calculator model which have been detected
Return value :
0 if successful, an error code otherwise.

ticalcs_probe

TIEXPORT3 int TICALL ticalcs_probe(CableModel c_model, CablePort c_port, CalcModel* model, int all)

This function attempts to detect the calculator model plugged onto a given link cable model/port. It works in a heuristic fashion. This function handles device opening/closing for you.

c_model :
link cable model
c_port :
link cable port
model :
hand-held model detected/found [out]
all :
which hand-helds to detect (FLASH only or all)
Return value :
0 if successful, an error code otherwise.

ticalcs_device_info_to_model

{

Converts a cable device info to a CalcModel, if possible.

info :
pointer to device info
Return value :
!= CALC_NONE if a precise calculator model can be determined through the cable+device info, CALC_NONE if invalid argument or SilverLink cable.

ticalcs_remap_model_from_usb

TIEXPORT3 CalcModel TICALL ticalcs_remap_model_from_usb(CableModel cable, CalcModel calc)

This function remaps a CALC_*_USB model to the corresponding CALC_* model, if said CALC_* model exists and the selected cable is USB.

cable :
a cable model model taken in #CableModel.
cable :
a calc model model taken in #CalcModel.
Return value :
the new calculator model, which can be the same as the passed one.

ticalcs_remap_model_from_usb

TIEXPORT3 CalcModel TICALL ticalcs_remap_model_to_usb(CableModel cable, CalcModel calc)

This function remaps a CALC_* model to the corresponding CALC_*_USB model, if said CALC_*_USB model exists and the selected cable is USB.

cable :
a cable model model taken in #CableModel.
cable :
a calc model model taken in #CalcModel.
Return value :
the new calculator model, which can be the same as the passed one.

Return to the main index




libticalcs-1.1.9+dfsg/docs/html/style.css000066400000000000000000000040341327711501700203250ustar00rootroot00000000000000 .IE3-DUMMY { CONT-SIZE: 100%; } BODY { FONT-SIZE: 10pt; FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; BACKGROUND-COLOR: #FFFFF8; } TABLE { BORDER-COLOR: #0000C0; BORDER-WIDTH: 1px; BACKGROUND-COLOR: #E0E0FF; } TD { FONT-SIZE: 10pt; FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; BORDER-COLOR: #0000C0; BORDER-WIDTH: 1px; BACKGROUND-COLOR: #F8FFF8; } PRE { FONT-SIZE: 9pt; FONT-FAMILY: Courier New; } CODE { FONT-SIZE: 10pt; FONT-FAMILY: Courier New; } TT { FONT-SIZE: 10pt; FONT-FAMILY: Courier New; } .TITLE { FONT-SIZE: 15pt; BORDER-STYLE: None; PADDING: 0; BACKGROUND-COLOR: #FFFFF8; } .DESCRIPTION { FONT-SIZE: 11pt; TEXT-ALIGN: RIGHT; BORDER-STYLE: None; PADDING: 0; BACKGROUND-COLOR: #FFFFF8; } .HEADER { FONT-SIZE: 9pt; BORDER-STYLE: None; PADDING: 0; BACKGROUND-COLOR: #FFFFF8; } .ITEMDESC { FONT-SIZE: 10pt; FONT-WEIGHT: Bold; } .HEADING { FONT-SIZE: 12pt; FONT-WEIGHT: Bold; TEXT-DECORATION: Underline; } .DEFTABLE { BORDER-STYLE: Solid; PADDING: 3pt; BACKGROUND-COLOR: #F8FAFF; } .DEFBG { BORDER-WIDTH: None; BORDER-STYLE: None; PADDING: 0; BACKGROUND-COLOR: #F8FAFF; } .DEFSUBTABLE { BORDER-WIDTH: None; BORDER-STYLE: None; PADDING: 0; MARGIN: -2px; BACKGROUND-COLOR: #F8FAFF; } .DEFINITION { FONT-SIZE: 10pt; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #F8FAFF; BORDER-WIDTH: None; BORDER-STYLE: None; PADDING: 0; TEXT-INDENT: -20pt; PADDING-LEFT: 20pt; } .COMMENT { FONT-SIZE: 10pt; FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; FONT-STYLE: Italic; } .INVTABLE { BORDER-WIDTH: None; BORDER-STYLE: None; PADDING: 0; BACKGROUND-COLOR: #FFFFF8; } .NOBORDER { BORDER-WIDTH: None; BORDER-STYLE: None; PADDING: 0; BACKGROUND-COLOR: #FFFFF8; } .NOBORDER TD { FONT-SIZE: 10pt; FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; BORDER-WIDTH: None; BORDER-STYLE: None; PADDING: 0; BACKGROUND-COLOR: #FFFFF8; } .H1IND { FONT-SIZE: 23pt; FONT-WEIGHT: Bold; COLOR: #0000A0; } .H2IND { FONT-SIZE: 16pt; FONT-WEIGHT: Bold; } .H3IND { FONT-SIZE: 13pt; FONT-WEIGHT: Bold; TEXT-DECORATION: Underline; } .SMALLICON { VERTICAL-ALIGN: Middle; } libticalcs-1.1.9+dfsg/docs/html/ticalcs.c.html000066400000000000000000000247631327711501700212170ustar00rootroot00000000000000 Header File Index
Entry Points

ticalcs_library_init

TIEXPORT3 int TICALL ticalcs_library_init(void)

This function must be the first one to call. It inits library internals.

Return value :
the instance count.

ticalcs_library_exit

TIEXPORT3 int TICALL ticalcs_library_exit(void)

This function must be the last one to call. Used to release internal resources.

Return value :
the instance count.

ticalcs_version_get

TIEXPORT3 const char *TICALL ticalcs_version_get(void)

This function returns the library version like "X.Y.Z".

Return value :
a string.

ticalcs_supported_calcs

TIEXPORT3 uint32_t TICALL ticalcs_supported_calcs (void)

This function returns the calcs built into the current binary.

Return value :
an integer containing a binary OR of (1 << CALC_*) values, where CALC_* values are defined in enum CalcModel.

ticalcs_handle_new

TIEXPORT3 CalcHandle* TICALL ticalcs_handle_new(CalcModel model)

Create a new handle associated with the given cable on the given port. Must be freed with ticables_handle_del when no longer needed. Note: the handle is a pointer on an opaque structure and should not be modified.

model :
a hand-held model
Return value :
NULL if error, an handle otherwise.

ticalcs_handle_del

TIEXPORT3 int TICALL ticalcs_handle_del(CalcHandle* handle)

Release the cable and free the associated resources. If cable has not been detached with #ticalcs_cable_detach, it will be detached.

handle :
the handle
Return value :
always 0.

ticalcs_handle_show

TIEXPORT3 int TICALL ticalcs_handle_show(CalcHandle* handle)

Show information stored in the handle.

handle :
the handle
Return value :
always 0.

ticalcs_cable_attach

TIEXPORT3 int TICALL ticalcs_cable_attach(CalcHandle* handle, CableHandle* cable)

Attach and open the given cable for use with the hand-held.

handle :
the handle
cable :
a cable to use
Return value :
0 if successful, an error code otherwise.

ticalcs_cable_detach

TIEXPORT3 int TICALL ticalcs_cable_detach(CalcHandle* handle)

Close and detach the cable associated with the hand-held.

handle :
the handle
cable :
a cable to use
Return value :
0 if successful, an error code otherwise.

ticalcs_update_set

TIEXPORT3 int TICALL ticalcs_update_set(CalcHandle* handle, CalcUpdate* upd)

Set the callbacks to use for the given handle.

handle :
the handle
update :
the callbacks to use
Return value :
0 if successful, an error code otherwise.

ticalcs_model_supports_dbus

{

Returns whether the given calculator model supports the protocol dubbed DBUS by libticalcs. That is, the standard protocol used by TI-Z80 and TI-68k calculators over the legacy I/O.

model :
a calculator model taken in #CalcModel.
Return value :
nonzero if the calculator supports the DBUS protocol, zero if it doesn't.

ticalcs_model_supports_dusb

{

Returns whether the given calculator model supports the protocol dubbed DUSB by libticalcs. That is, the standard protocol used by TI-Z80, TI-eZ80 and TI-68k calculators over the USB port.

model :
a calculator model taken in #CalcModel.
Return value :
nonzero if the calculator supports the DUSB protocol, zero if it doesn't.

ticalcs_model_supports_nsp

{

Returns whether the given calculator model supports the protocol dubbed NSP by libticalcs. That is, the standard protocol used by TI-Nspire calculators over the USB port.

model :
a calculator model taken in #CalcModel.
Return value :
nonzero if the calculator supports the NSP protocol, zero if it doesn't.

Return to the main index




libticalcs-1.1.9+dfsg/docs/html/ticalcs.h.html000066400000000000000000000630471327711501700212220ustar00rootroot00000000000000 Header File Index
Enumerations, structures and type definitions

CalcScreenFormat

SCREEN_FULL,

An enumeration which contains the following calculator types: /

Return value :


CalcPixelFormat

CALC_PIXFMT_MONO = 1, // Monochrome (1 bpp)

An enumeration which defines the format of screenshot images:

Return value :


CalcPathType

PATH_FULL,

An enumeration which contains the path type: /

Return value :


CalcMemType

MEMORY_NONE = 0,

An enumeration which contains the different memory sizes: /

Return value :


CalcMode

MODE_NORMAL = 0,

An enumeration which contains different mask modes: /

Return value :


CalcRomDumpSize

ROMSIZE_AUTO = 0,

An enumeration which contains the following ROM dump sizes: /

Return value :


CalcShellType

SHELL_NONE = 4,

An enumeration which contains the shell to use with ROM dumping: /

Return value :


CalcProductIDs

PRODUCT_ID_NONE = 0x00,

An enumeration which contains the product IDs used by TI graphing calculators: /

Return value :


CalcOperations

FTS_NONE = 0,

An enumeration which contains the different supported operations: /

Return value :


CalcAction

ACT_NONE = 0,

An enumeration which contains the action taken on a variable /

Return value :


InfosMask

INFOS_PRODUCT_NUMBER = (1 << 0), /* obsolete (never used) */

An enumeration which contains the different flags supported by CalcInfos: /

Return value :


CalcFnctsIdx

FNCT_IS_READY=0,

Index of function in the #CalcFncts structure: /

Return value :


TigMode

TIG_NONE = 0,

An enumeration which contains the data to save in tigroup: /

Return value :


DUSBRawPacket

uint32_t size; ///< raw packet size

Raw packet for the DUSB (84+(SE), 89T) protocol. /

Return value :


NSPRawPacket

uint16_t unused;

Raw packet for the Nspire NavNet protocol. /

Return value :


CalcScreenCoord

int format;

A structure used for storing screen size. /

format :
returns full or clipped image (#CalcScreenFormat)
width :
real width
height :
real height
clipped_width :
clipped width (89 for instance)
clipped_height :
clipped height (89 for instance)
pixel_format :
format of pixel data (#CalcPixelFormat)
Return value :


TreeInfo

CalcModel model;

A structure used for storing information about a directory list tree. /

model :
hand-held model
type :
var or app list (VAR_NODE_NAME or APP_NODE_NAME)
mem_used :
memory used (depends on hand-held model)
mem_free :
memory free (depends on hand-held model)
Return value :


KeyPair

char* name;

A structure which contains a TI scancode. /

name :
name of key (like "ESC")
value :
value of key (like 264)
Return value :


CalcKey

char* key_name; // Name of key

A structure which contains a TI scancode with key modifiers. FIXME: use KeyPair structure to pack infos ! /

key_name :
name of key
Return value :


CalcClock

uint16_t year;

A structure used for clock management. /

year :
year
month: :
(null)
day: :
(null)
hours: :
(null)
minutes: :
(null)
seconds: :
(null)
time_format :
12 or 24
date_format :
1 or 6
Return value :


CalcUpdate

char text[256];

Refresh/progress functions This structure allows to implement a kind of callbacks mechanism (which allow libCalcs to interact with user without being dependant of a GUI). /

text :
a text to display about the current operation (locale used is those defined by tifiles_transcoding_set)
cancel :
set to 1 if transfer have to be cancelled
rate :
data rate of cable
cnt1 :
current counter for link transfer operations (ticalcs2 only)
max1 :
max value of this counter
cnt2 :
current count for intermediate operations (ticalcs2 only)
max2 :
max value of this counter
cnt3 :
current counter for global operations (used by ticalcs2 or tilp)
max3 :
max value of this counter
mask :
which cntX is/are used (unused)
type :
pbar type (unused)
start :
init internal vars
stop :
release internal vars
refresh :
pass control to GUI for refresh
pbar :
refresh pprogress bar
label :
refresh label
Return value :


CalcInfos

CalcModel model;

A structure used to pass arguments. /

os :
OS version like "3.01"
bios :
BIOS (boot) version like 2.01
Return value :


CalcFncts

const int model;

A structure used for handling a hand-held. !!! This structure is for private use !!! /

model :
link cable model (CalcModel).
name :
name of hand-held like "TI89"
fullname :
complete name of hand-held like "TI-89"
description :
description of hand-held like "TI89 calculator"
features :
supported operations (CalcOperations)
counters :
defines which CalcUpdate counters have to be refreshed (indexed by CalcFnctsIdx)
is_ready :
check whether calculator is ready
send_key :
send key value
execute :
remotely execute a program or application
recv_screen :
request a screendump
get_dirlist :
request a listing of variables, folders (if any) and apps (if any)
send_backup :
send a backup
recv_backup :
request a backup
send_var :
send a variable (silent mode)
recv_var :
request a variable silent mode)
send_var_ns :
send a variable (non-silent mode)
recv_var_ns :
receive a variable (non-silent mode)
send_flash :
send a FLASH app/os
recv_flash :
request a FLASH app/os
recv_idlist :
request hand-held IDLIST
dump_rom_1 :
dump the hand-held ROM: send dumper (if any)
dump_rom_2 :
dump the hand-held ROM: launch dumper
set_clock :
set date/time
get_clock :
get date/time
del_var :
delete variable
new_fld :
create new folder (if supported)
get_version :
returns Boot code & OS version
send_cert :
send certificate stuff
recv_cert :
receive certificate stuff
rename_var :
rename a variable
change_attr :
change attributes of a variable
send_all_vars_backup :
send a fake backup (set of files and FlashApps)
recv_all_vars_backup :
request a fake backup (set of files and FlashApps)
Return value :


CalcHandle

CalcModel model;

A structure used to store information as a handle. !!! This structure is for private use !!! /

model :
cable model
calc :
calculator functions
update :
callbacks for GUI interaction
unused1 :
unused member kept for API compatibility purposes
buffer :
allocated data buffer for internal use
buffer2 :
allocated data buffer for internal use
open :
device has been opened
busy :
transfer is in progress
cable :
handle on cable used with this model
attached :
set if a cable has been attached
priv :
private per-handle data
Return value :


DeviceOptions

CableModel cable_model;

A convenient structure free of use by the user. /

cable_model :
model
cable_port :
port
cable_timeout :
timeout in tenth of seconds
cable_delay :
inter-bit delay in µs
calc_model :
calculator model
Return value :


Return to the main index




libticalcs-1.1.9+dfsg/docs/html/tikeys.c.html000066400000000000000000000112021327711501700210650ustar00rootroot00000000000000 Header File Index
Getting scancode for TI keys

ticalcs_keys_73

TIEXPORT3 const CalcKey* TICALL ticalcs_keys_73(uint8_t ascii_code)

Conversion of an ASCII code into a TI key.

code :
an ASCII character
Return value :
a TI key.

ticalcs_keys_83

TIEXPORT3 const CalcKey* TICALL ticalcs_keys_83(uint8_t ascii_code)

Conversion of an ASCII code into a TI key.

code :
an ASCII character
Return value :
a TI key.

ticalcs_keys_83p

TIEXPORT3 const CalcKey* TICALL ticalcs_keys_83p(uint8_t ascii_code)

Conversion of an ASCII code into a TI key.

code :
an ASCII character
Return value :
a TI key.

ticalcs_keys_86

TIEXPORT3 const CalcKey* TICALL ticalcs_keys_86(uint8_t ascii_code)

Conversion of an ASCII code into a TI key.

code :
an ASCII character
Return value :
a TI key.

ticalcs_keys_89

TIEXPORT3 const CalcKey* TICALL ticalcs_keys_89(uint8_t ascii_code)

Conversion of an ASCII code into a TI key.

code :
an ASCII character
Return value :
a TI key.

ticalcs_keys_92p

TIEXPORT3 const CalcKey* TICALL ticalcs_keys_92p(uint8_t ascii_code)

Conversion of an ASCII code into a TI key.

code :
an ASCII character
Return value :
a TI key.

Return to the main index




libticalcs-1.1.9+dfsg/docs/html/type-s.gif000066400000000000000000000002361327711501700203630ustar00rootroot00000000000000GIF87a³€ÿÿÿ€€€ÿÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ,Q°H@«2k`º÷”¶}$‡‰ש`…ª¹¾àÊ爷_žÁ+™oÒ«ÍDÀŒp&Íð”u6!- e S»ðí˽I‘Ðlok\£­îÍe’;libticalcs-1.1.9+dfsg/docs/html/type.gif000066400000000000000000000003601327711501700201210ustar00rootroot00000000000000GIF87a ³€ÿÿÿ€€€ÿÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ, £°ÈI«½¸€Í»çYdiž@„Óˆ¾ä¸².ŒºsV—ûé…=޼ y9K/eÚ¼T:Ÿo™JФ<Ìj­”]Ú·š1c9Šå ‘lC Ðt2×\R`  Û¿l}tG1f5s1dpy0BK[cwuA‡^‘7˜”iG’J^•€Ž¤Œ†qAŒ¡W)¯¥“£…Uqµx³¸>¾¿˜ÃÄÅÆÇI;libticalcs-1.1.9+dfsg/docs/html/type2str.c.html000066400000000000000000000036341327711501700213630ustar00rootroot00000000000000 Header File Index
Types / Strings conversions

ticalcs_model_to_string

TIEXPORT3 const char *TICALL ticalcs_model_to_string(CalcModel model)

Do an integer to string conversion.

model :
a calculator model.
Return value :
a string like "TI92+".

ticalcs_string_to_model

TIEXPORT3 CalcModel TICALL ticalcs_string_to_model(const char *str)

Do a string to integer conversion.

str :
a calculator model as string like "TI92".
Return value :
a calculator model.

Return to the main index




libticalcs-1.1.9+dfsg/docs/html/variable-s.gif000066400000000000000000000002401327711501700211620ustar00rootroot00000000000000GIF87a³ÿÿ€ÿ€€€ÀÀÀÿÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ,SÐH@«2kpº÷”¶}$‡‰G‚ª®ß9±KE'goI» ìG(S«_Àd‹q–ºfGð|_ ² ZjÉ;ÐæÆ¢ízë¦ÛÑ7üz©‡$;libticalcs-1.1.9+dfsg/docs/html/variable.gif000066400000000000000000000003441327711501700207270ustar00rootroot00000000000000GIF87a ³ÿÿ€ÿ€€€ÀÀÀÿÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ, —ÐÈI«½Ø€Í»çYdiž@„Óˆ¾ä¸².ŒºsVÛ¦î¼Û/hSéˆ0#ˆŒå,̦òEN¡ÍÛS”=JW®tã 40% ~1730 blocks on TI84+ (2048) => 85% ~1408 blocks on Titanium (4MB) => 35% 2°) TI can reply with the following packets (example of transmission) PC: AA55 0000 FF00 check whether ready (for sync after a transfer interrupt) TI: 0001 0000 0001 ready PC: 0003 0000 0003 request ROM size TI: 0003 0004 LLLHHLHH chk returns size as a long PC: 0005 0004 00000000 0009 request block at addr TI: 0006 0400 1024 bytes of data chk PC: 0005 0004 00000400 0409 request block at addr TI: 0006 0400 1024 bytes of data chk PC: AA55 0000 FF00 check whether ready (for sync after a transfer interrupt) TI: 0001 0000 0001 ready PC: 0005 0004 00000400 000D request block at addr TI: 0006 0400 1024 bytes of data chk PC: 0005 0004 00000800 0011 request block at addr TI: 0007 0004 0400 00FF 000A 1024 bytes filled with 0x00FF PC: 0002 0000 0002 exit dumper TI: 0002 0000 0002 3°) transmission error (timeout with SilverLink for instance) Send this until dumper replies (used to synchronize again): PC: AA55 0000 FF00 check whether ready (for sync after a transfer interrupt) TI: 0001 0000 0001 ready goes on... 4°) unknown packet PC: 1234 0000 1234 unknown packet TI: error: ignored => wait for next command libticalcs-1.1.9+dfsg/po/000077500000000000000000000000001327711501700151745ustar00rootroot00000000000000libticalcs-1.1.9+dfsg/po/LINGUAS000066400000000000000000000000441327711501700162170ustar00rootroot00000000000000# Set of available languages. fr de libticalcs-1.1.9+dfsg/po/Makefile.in.in000066400000000000000000000374421327711501700176600ustar00rootroot00000000000000# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.18 GETTEXT_MACRO_VERSION = 0.18 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ localedir = @localedir@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) @install_sh@ -d install_sh = $(SHELL) @install_sh@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ GMSGFMT_ = @GMSGFMT@ GMSGFMT_no = @GMSGFMT@ GMSGFMT_yes = @GMSGFMT_015@ GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) MSGFMT_ = @MSGFMT@ MSGFMT_no = @MSGFMT@ MSGFMT_yes = @MSGFMT_015@ MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@ XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: check-macro-version all-@USE_NLS@ all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. check-macro-version: @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ package_gnu='GNU '; \ else \ package_gnu=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --package-name="$${package_gnu}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ esac; \ }; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ esac; \ }; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: # Recreate Makefile by invoking config.status. Explicitly invoke the shell, # because execution permission bits may not work on the current file system. # Use @SHELL@, which is the shell determined by autoconf for the use by its # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && @SHELL@ ./config.status $(subdir)/$@.in po-directories force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libticalcs-1.1.9+dfsg/po/Makevars000066400000000000000000000034161327711501700166740ustar00rootroot00000000000000# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Free Software Foundation, Inc. # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = libticalcs-1.1.9+dfsg/po/POTFILES.in000066400000000000000000000006261327711501700167550ustar00rootroot00000000000000# List of source files containing translatable strings. src/backup.c src/calc_00.c src/calc_73.c src/calc_84p.c src/calc_8x.c src/calc_9x.c src/calc_89t.c src/calc_nsp.c src/calc_xx.c src/clock.c src/cmdz80.c src/cmd68k.c src/dbus_pkt.c src/dirlist.c src/dusb_cmd.c src/dusb_rpkt.c src/dusb_vpkt.c src/error.c src/nsp_cmd.c src/probe.c src/romdump.c src/ticalcs.c src/tikeys.c src/type2str.c src/update.c libticalcs-1.1.9+dfsg/po/Rules-quot000066400000000000000000000034001327711501700171740ustar00rootroot00000000000000# Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-create: $(MAKE) en@quot.po-update en@boldquot.po-create: $(MAKE) en@boldquot.po-update en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header libticalcs-1.1.9+dfsg/po/boldquot.sed000066400000000000000000000003311327711501700175170ustar00rootroot00000000000000s/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g s/“/“/g s/â€/â€/g s/‘/‘/g s/’/’/g libticalcs-1.1.9+dfsg/po/de.gmo000066400000000000000000000024601327711501700162720ustar00rootroot00000000000000Þ•¬<° ± ¿ÉØ è õ  !.? N[ j w‚‡°‹ < JVeu „‘ ¤ °½Ô é ö$(      Battery: %sBattery: Boot Version: Boot2 Version: Free Flash: Free RAM: Hardware Version: Language ID: OS Version: Physical Flash: Physical RAM: Product ID: Product Name: User Flash: User RAM: goodlowProject-Id-Version: libticalcs2 1.1.8 Report-Msgid-Bugs-To: tilp-users@lists.sourceforge.net POT-Creation-Date: 2016-11-01 09:58+0100 PO-Revision-Date: 2011-12-13 19:16+0100 Last-Translator: Andreas B. Mundt Language-Team: German Language: de MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Batterie: %s Batterie: Boot-Version: Boot2-Version: Freier Flash: Freier RAM: Hardware-Version: Sprach-ID: BS-Version: Physikalischer Flash: Physikalischer RAM: Produkt-ID: Produktname: Benutzer-Flash: Benutzer-RAM: gutniedriglibticalcs-1.1.9+dfsg/po/de.po000066400000000000000000000427301327711501700161320ustar00rootroot00000000000000# German translation of libticalcs2. # Copyright (C) 1999-2008 Romain LIEVIN, 1999-2005 Julien BLACHE, 2000-2001 # Thomas Corvazier, 2002 Jesse Palmer, 2003-2007 Kevin Kofler, 2003-2006 # Lauris Kaplinski, 2003 Sylvain Garsault,2006 Tyler Cassidy. # Chris Leick , 2010. # Andreas B. Mundt , 2013. # This file is distributed under the same license as the libticalcs2 package. # msgid "" msgstr "" "Project-Id-Version: libticalcs2 1.1.8\n" "Report-Msgid-Bugs-To: tilp-users@lists.sourceforge.net\n" "POT-Creation-Date: 2016-11-01 09:58+0100\n" "PO-Revision-Date: 2011-12-13 19:16+0100\n" "Last-Translator: Andreas B. Mundt \n" "Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: src/calc_00.c:213 msgid "Dummy hand-held" msgstr "" #: src/calc_00.c:214 msgid "Dummy hand-held used when no calc is set" msgstr "" #: src/calc_73.c:393 src/calc_84p.c:301 src/calc_8x.c:402 #, c-format msgid "Parsing %s" msgstr "" #: src/calc_73.c:854 msgid "Battery low, stopping flash app transfer" msgstr "" #: src/calc_73.c:859 src/calc_73.c:1502 src/calc_9x.c:1163 src/calc_89t.c:506 #, c-format msgid "FLASH name: \"%s\"" msgstr "" #: src/calc_73.c:860 src/calc_73.c:1503 src/calc_9x.c:1164 src/calc_89t.c:507 #, c-format msgid "FLASH size: %i bytes." msgstr "" #: src/calc_73.c:1278 src/calc_84p.c:1481 src/calc_84p.c:1511 #: src/calc_9x.c:1448 src/calc_89t.c:844 msgid "Setting clock..." msgstr "" #: src/calc_73.c:1324 src/calc_84p.c:1431 src/calc_84p.c:1581 #: src/calc_9x.c:1492 src/calc_89t.c:923 msgid "Getting clock..." msgstr "" #: src/calc_73.c:1400 src/calc_84p.c:1685 src/calc_8x.c:1255 src/calc_9x.c:1556 #: src/calc_9x.c:1588 src/calc_89t.c:1000 src/calc_nsp.c:835 #, c-format msgid "Deleting %s..." msgstr "" #: src/calc_73.c:1474 src/calc_9x.c:1715 src/calc_9x.c:1748 #, c-format msgid " OS: %s" msgstr "" #: src/calc_73.c:1475 src/calc_9x.c:1716 #, c-format msgid " BIOS: %s" msgstr "" #: src/calc_73.c:1476 #, c-format msgid " HW: %i" msgstr "" #: src/calc_73.c:1477 src/calc_9x.c:1717 src/calc_9x.c:1749 #, c-format msgid " Battery: %s" msgstr " Batterie: %s" #: src/calc_73.c:1477 src/type2str.c:340 msgid "good" msgstr "gut" #: src/calc_73.c:1477 src/type2str.c:340 msgid "low" msgstr "niedrig" #: src/calc_73.c:1549 src/calc_9x.c:1230 msgid "Header sent completely." msgstr "" #: src/calc_73.c:1562 msgid "Receiving certificate" msgstr "" #: src/calc_84p.c:1445 src/calc_84p.c:1595 #, c-format msgid "Could not determine clock type: %u %u" msgstr "" #: src/calc_84p.c:1454 msgid "Will set classic clock" msgstr "" #: src/calc_84p.c:1509 msgid "Will set new clock" msgstr "" #: src/calc_84p.c:1606 msgid "Found valid classic clock" msgstr "" #: src/calc_84p.c:1637 #, c-format msgid "Found classic clock but failed to retrieve its parameters: %u %u %u %u" msgstr "" #: src/calc_84p.c:1647 msgid "Found valid new clock" msgstr "" #: src/calc_84p.c:1662 #, c-format msgid "" "Found new clock but failed to retrieve its parameters: %u %u %u %u %u %u" msgstr "" #: src/calc_84p.c:1768 src/calc_89t.c:1189 msgid "Getting version..." msgstr "" #: src/calc_84p.c:2017 src/calc_84p.c:2026 src/calc_84p.c:2035 #: src/calc_84p.c:2051 src/calc_84p.c:2059 #, c-format msgid "Unhandled 84+ family member with product_id=%d hw_version=%d" msgstr "" #: src/calc_84p.c:2076 msgid "TI-84 Plus thru DirectLink" msgstr "" #: src/calc_84p.c:2147 msgid "TI-84 Plus C Silver Edition thru DirectLink" msgstr "" #: src/calc_84p.c:2218 msgid "TI-83 Premium CE thru DirectLink" msgstr "" #: src/calc_84p.c:2289 msgid "TI-84 Plus CE thru DirectLink" msgstr "" #: src/calc_84p.c:2360 msgid "TI-82 Advanced thru DirectLink" msgstr "" #: src/calc_84p.c:2431 msgid "TI-84 Plus T thru DirectLink" msgstr "" #: src/calc_8x.c:493 src/calc_8x.c:804 msgid "Waiting for user's action..." msgstr "" #: src/calc_8x.c:638 msgid "Waiting for backup..." msgstr "" #: src/calc_8x.c:1076 msgid "Waiting for var(s)..." msgstr "" #: src/calc_9x.c:353 src/calc_9x.c:441 src/calc_9x.c:580 #, c-format msgid "Name: %8s | Type: %8s | Attr: %i | Size: %08X" msgstr "" #: src/calc_9x.c:386 #, c-format msgid "Directory listing in %8s..." msgstr "" #: src/calc_9x.c:449 src/calc_9x.c:604 src/calc_89t.c:249 #, c-format msgid "Parsing %s/%s" msgstr "" #: src/calc_9x.c:699 #, c-format msgid "Block #%2i" msgstr "" #: src/calc_9x.c:1618 src/calc_89t.c:1096 src/calc_nsp.c:865 #, c-format msgid "Creating %s..." msgstr "" #: src/calc_9x.c:2010 msgid "V200 Personal Learning Tool" msgstr "" #: src/calc_89t.c:1031 src/calc_nsp.c:1034 #, c-format msgid "Renaming %s to %s..." msgstr "" #: src/calc_89t.c:1059 #, c-format msgid "Changing attributes of %s..." msgstr "" #: src/calc_89t.c:1416 msgid "TI-89 Titanium thru DirectLink" msgstr "" #: src/calc_nsp.c:232 #, c-format msgid "Unknown calculator model with %d bpp\n" msgstr "" #: src/calc_nsp.c:388 #, c-format msgid "Name: %s | Type: %8s | Attr: %i | Size: %08X" msgstr "" #: src/calc_nsp.c:421 #, c-format msgid "Not enumerating documents in %s because it's not a folder\n" msgstr "" #: src/calc_nsp.c:437 #, c-format msgid "Directory listing in <%s>...\n" msgstr "" #: src/calc_nsp.c:1057 msgid "Nspire thru DirectLink" msgstr "" #: src/calc_xx.c:91 msgid "Checking hand-held status:" msgstr "" #: src/calc_xx.c:125 #, c-format msgid "Sending key %08x:" msgstr "" #: src/calc_xx.c:162 #, c-format msgid "Executing %s/%s with %s:" msgstr "" #: src/calc_xx.c:199 msgid "Requesting screenshot:" msgstr "" #: src/calc_xx.c:297 msgid "Requesting folder & vars & apps listing:" msgstr "" #: src/calc_xx.c:351 msgid "Requesting RAM & FLASH free" msgstr "" #: src/calc_xx.c:386 msgid "Sending backup:" msgstr "" #: src/calc_xx.c:421 msgid "Requesting backup:" msgstr "" #: src/calc_xx.c:458 msgid "Sending one or more variables:" msgstr "" #: src/calc_xx.c:496 #, c-format msgid "Requesting variable '%s':" msgstr "" #: src/calc_xx.c:533 msgid "Sending variable (non-silent mode):" msgstr "" #: src/calc_xx.c:571 msgid "Receiving variable (non-silent mode):" msgstr "" #: src/calc_xx.c:606 msgid "Sending FLASH application:" msgstr "" #: src/calc_xx.c:643 msgid "Requesting receiving of FLASH application:" msgstr "" #: src/calc_xx.c:678 msgid "Sending FLASH os:" msgstr "" #: src/calc_xx.c:713 msgid "Requesting ID-LIST:" msgstr "" #: src/calc_xx.c:746 msgid "Sending ROM dumper:" msgstr "" #: src/calc_xx.c:782 msgid "Dumping ROM:" msgstr "" #: src/calc_xx.c:817 msgid "Setting clock:" msgstr "" #: src/calc_xx.c:852 msgid "Getting clock:" msgstr "" #: src/calc_xx.c:887 #, c-format msgid "Deleting variable '%s':" msgstr "" #: src/calc_xx.c:922 #, c-format msgid "Creating folder '%s':" msgstr "" #: src/calc_xx.c:957 msgid "Requesting version info:" msgstr "" #: src/calc_xx.c:992 msgid "Sending certificate:" msgstr "" #: src/calc_xx.c:1027 msgid "Requesting receiving of certificate:" msgstr "" #: src/calc_xx.c:1066 #, c-format msgid "Renaming variable '%s/%s' to '%s/%s':" msgstr "" #: src/calc_xx.c:1070 #, c-format msgid "Renaming variable '%s' to '%s':" msgstr "" #: src/calc_xx.c:1108 #, c-format msgid "Setting variable '%s' to %s:" msgstr "" #: src/calc_xx.c:1145 msgid "Sending fake (all vars) backup:" msgstr "" #: src/calc_xx.c:1180 msgid "Requesting fake (all vars) backup:" msgstr "" #: src/dirlist.c:194 #, c-format msgid "| B. name | T. name |Attr|Type| Size | Folder |\n" msgstr "" #: src/dirlist.c:204 #, c-format msgid "| No variables |\n" msgstr "" #: src/dirlist.c:208 #, c-format msgid "| No applications |\n" msgstr "" #: src/dirlist.c:212 #, c-format msgid "+------------------+----------+----+----+----------+----------+" msgstr "" #: src/error.c:72 msgid "Msg: transfer aborted." msgstr "" #: src/error.c:74 msgid "Cause: the user!" msgstr "" #: src/error.c:80 msgid "Msg: calculator is not ready." msgstr "" #: src/error.c:82 msgid "" "Cause: the calculator is busy (Var-Link menu, Window, ...). Press HOME..." msgstr "" #: src/error.c:88 msgid "Msg: checksum error." msgstr "" #: src/error.c:90 msgid "Cause: a transmission error. Try again." msgstr "" #: src/error.c:96 msgid "Msg: invalid host ID." msgstr "" #: src/error.c:98 msgid "" "Cause: received an unexpected Machine ID from calculator, probably due to a " "transmission error." msgstr "" #: src/error.c:104 msgid "Msg: invalid target ID." msgstr "" #: src/error.c:106 msgid "" "Cause: received an unexpected Target ID from calculator, probably due to a " "transmission error." msgstr "" #: src/error.c:112 msgid "Msg: invalid command ID." msgstr "" #: src/error.c:114 msgid "" "Cause: received an unexpected Command ID from calculator, probably due to a " "transmission error." msgstr "" #: src/error.c:120 msgid "Msg: not really an error, should not appear!" msgstr "" #: src/error.c:122 msgid "Cause: a bug. Drop us an email!" msgstr "" #: src/error.c:128 msgid "Msg: program or variable is incompatible with this OS version." msgstr "" #: src/error.c:130 msgid "" "Cause: this variable type may not be supported by the target calculator, or " "you may need to upgrade your calculator OS." msgstr "" #: src/error.c:136 msgid "Msg: contents has been refused." msgstr "" #: src/error.c:138 msgid "" "Cause: you attempted to send a variable which is locked/archived on the " "target calculator. The calculator may be out of memory. The certificate may " "be invalid or already installed." msgstr "" #: src/error.c:144 msgid "Invalid CTS packet." msgstr "" #: src/error.c:146 src/error.c:162 msgid "Cause: a transmission error." msgstr "" #: src/error.c:152 msgid "NACK received." msgstr "" #: src/error.c:154 msgid "Cause: the command has been refused." msgstr "" #: src/error.c:160 msgid "Invalid packet." msgstr "" #: src/error.c:171 msgid "The cable cannot be used." msgstr "" #: src/error.c:173 msgid "" "Cause: the cable has not been initialized due to a previous/current error." msgstr "" #: src/error.c:186 msgid "Msg: this function does not exist for this calculator." msgstr "" #: src/error.c:188 msgid "" "Cause: the operation you attempted is not supported by your calculator model." msgstr "" #: src/error.c:194 msgid "Msg: calculator out of memory." msgstr "" #: src/error.c:196 msgid "" "Cause: the calculator does not have memory enough for doing the operation." msgstr "" #: src/error.c:202 msgid "Msg: unable to open (reading) the file." msgstr "" #: src/error.c:204 src/error.c:212 msgid "Cause: disk space or permissions." msgstr "" #: src/error.c:210 msgid "Msg: unable to open (writing) the file." msgstr "" #: src/error.c:218 msgid "A transfer is in progress. You cannot start a new one." msgstr "" #: src/error.c:220 msgid "Cause: this should not happen. Probably a bug: drop us an email!" msgstr "" #: src/error.c:229 msgid "The requested var does not exist." msgstr "" #: src/error.c:231 msgid "" "Cause: you attempted to download a variable which does not exist on the " "calculator any longer. Maybe you have manually deleted it ?" msgstr "" #: src/error.c:237 msgid "There is nothing to backup." msgstr "" #: src/error.c:239 msgid "Cause: 0 variables stored onto your calculator." msgstr "" #: src/error.c:245 msgid "Invalid ticalcs handle." msgstr "" #: src/error.c:247 msgid "Cause: bad cable or calc model." msgstr "" #: src/error.c:253 msgid "Invalid parameter." msgstr "" #: src/error.c:255 msgid "" "Cause: if you see this in normal usage, a bug: drop us an email ! Otherwise, " "check the arguments you're passing to the function." msgstr "" #: src/error.c:261 msgid "Unknown screenshot format." msgstr "" #: src/error.c:263 msgid "Cause: a transmission error, or unsupported calculator version." msgstr "" #: src/error.c:269 msgid "Msg: hand-held returned an error." msgstr "" #: src/error.c:271 src/error.c:307 src/error.c:391 msgid "Cause: hand-held returned an uncaught error. Please report log." msgstr "" #: src/error.c:276 msgid "Msg: cannot delete application." msgstr "" #: src/error.c:280 msgid "Msg: invalid variable name." msgstr "" #: src/error.c:284 msgid "Msg: cannot overwrite variable (locked/archived)." msgstr "" #: src/error.c:288 msgid "Msg: cannot delete variable (locked/archived)." msgstr "" #: src/error.c:292 msgid "Msg: FLASH application rejected (bad target model)." msgstr "" #: src/error.c:296 msgid "Msg: malformed RTS packet (AMS version conflict)." msgstr "" #: src/error.c:300 src/error.c:380 msgid "Msg: FLASH application rejected (signature does not match)." msgstr "" #: src/error.c:305 src/error.c:389 msgid "Msg: hand-held returned an error (not caught)." msgstr "" #: src/error.c:312 msgid "Msg: invalid argument or name." msgstr "" #: src/error.c:316 msgid "Msg: cannot delete var/app from archive." msgstr "" #: src/error.c:320 msgid "Msg: transmission error." msgstr "" #: src/error.c:324 msgid "Msg: using basic mode while being in boot mode." msgstr "" #: src/error.c:328 src/error.c:396 msgid "Msg: out of memory." msgstr "" #: src/error.c:332 src/error.c:336 msgid "Msg: invalid name." msgstr "" #: src/error.c:340 msgid "Msg: busy?" msgstr "" #: src/error.c:344 msgid "Msg: can't overwrite, variable is locked." msgstr "" #: src/error.c:348 msgid "Msg: mode token too small." msgstr "" #: src/error.c:352 msgid "Msg: mode token too large." msgstr "" #: src/error.c:356 msgid "Msg: wrong size for parameter." msgstr "" #: src/error.c:360 msgid "Msg: invalid parameter ID." msgstr "" #: src/error.c:364 msgid "Msg: read-only parameter." msgstr "" #: src/error.c:368 msgid "Msg: wrong modify request?" msgstr "" #: src/error.c:372 msgid "Msg: remote control?" msgstr "" #: src/error.c:376 msgid "Msg: battery low." msgstr "" #: src/error.c:384 msgid "Msg: hand-held is busy (set your calculator to HOME screen)." msgstr "" #: src/error.c:400 msgid "Msg: OS installation failed. File is corrupted/wrong." msgstr "" #: src/error.c:405 msgid "Msg: packet too large." msgstr "" #: src/error.c:409 msgid "Msg: the variable or directory does not exist." msgstr "" #: src/error.c:413 msgid "Msg: the directory name is invalid." msgstr "" #: src/error.c:417 msgid "Msg: not currently listing a directory." msgstr "" #: src/error.c:421 msgid "Msg: no more files to list." msgstr "" #: src/error.c:425 msgid "Msg: the directory name already exists." msgstr "" #: src/error.c:430 msgid "Msg: the destination (folder or file) path is too long." msgstr "" #: src/error.c:434 msgid "Msg: the file name is invalid." msgstr "" #: src/error.c:438 msgid "Msg: no file extension." msgstr "" #: src/error.c:442 msgid "Msg: forbidden characters in folder name." msgstr "" #: src/error.c:452 msgid "Msg: OS upgrade type not recognized." msgstr "" #: src/error.c:456 msgid "Msg: anti-downgrade protection refuses this OS version." msgstr "" #: src/probe.c:91 msgid "Probing calculator...\n" msgstr "" #: src/probe.c:95 msgid "Check for TI86... " msgstr "" #: src/probe.c:119 msgid "Check for TI85... " msgstr "" #: src/probe.c:143 msgid "Check for TI73... " msgstr "" #: src/probe.c:167 msgid "Check for TI83... " msgstr "" #: src/probe.c:191 msgid "Check for TI82... " msgstr "" #: src/probe.c:217 msgid "Check for TI80... " msgstr "" #: src/probe.c:273 msgid "Check for TIXX... " msgstr "" #: src/probe.c:311 msgid "Check for TI92... " msgstr "" #: src/probe.c:355 msgid "Check for TI9X... " msgstr "" #: src/probe.c:370 msgid "Check for TI8X... " msgstr "" #: src/probe.c:385 #, c-format msgid "Calculator type: %s" msgstr "" #: src/ticalcs.c:238 #, c-format msgid "ticalcs library version %s" msgstr "" #: src/ticalcs.c:396 msgid "Link calc handle details:" msgstr "" #: src/ticalcs.c:397 #, c-format msgid " model : %s" msgstr "" #: src/type2str.c:62 src/type2str.c:72 src/type2str.c:94 src/type2str.c:104 msgid "full" msgstr "" #: src/type2str.c:63 src/type2str.c:76 msgid "clipped" msgstr "" #: src/type2str.c:64 src/type2str.c:96 src/type2str.c:128 msgid "unknown" msgstr "" #: src/type2str.c:95 src/type2str.c:108 msgid "local" msgstr "" #: src/type2str.c:126 src/type2str.c:136 msgid "free" msgstr "" #: src/type2str.c:127 src/type2str.c:140 msgid "used" msgstr "" #: src/type2str.c:293 msgid "Product Name: " msgstr "Produktname: " #: src/type2str.c:295 msgid "Product ID: " msgstr "Produkt-ID: " #: src/type2str.c:297 msgid "Language ID: " msgstr "Sprach-ID: " #: src/type2str.c:300 msgid "Device Type: " msgstr "" #: src/type2str.c:302 msgid "Hardware Version: " msgstr "Hardware-Version: " #: src/type2str.c:304 msgid "Boot Version: " msgstr "Boot-Version: " #: src/type2str.c:306 msgid "Boot2 Version: " msgstr "Boot2-Version: " #: src/type2str.c:308 msgid "OS Version: " msgstr "BS-Version: " #: src/type2str.c:310 msgid "Run level: " msgstr "" #: src/type2str.c:312 msgid "Clock speed: " msgstr "" #: src/type2str.c:314 msgid "Exact math engine: " msgstr "" #: src/type2str.c:315 msgid "Yes" msgstr "" #: src/type2str.c:315 msgid "No" msgstr "" #: src/type2str.c:317 msgid "LCD width: " msgstr "" #: src/type2str.c:319 msgid "LCD height: " msgstr "" #: src/type2str.c:321 msgid "Bits per pixel: " msgstr "" #: src/type2str.c:323 msgid "Color screen: " msgstr "" #: src/type2str.c:326 msgid "Physical RAM: " msgstr "Physikalischer RAM: " #: src/type2str.c:328 msgid "User RAM: " msgstr "Benutzer-RAM: " #: src/type2str.c:330 msgid "Free RAM: " msgstr "Freier RAM: " #: src/type2str.c:332 msgid "Physical Flash: " msgstr "Physikalischer Flash: " #: src/type2str.c:334 msgid "User Flash: " msgstr "Benutzer-Flash: " #: src/type2str.c:336 msgid "Free Flash: " msgstr "Freier Flash: " #: src/type2str.c:339 msgid "Battery: " msgstr " Batterie: " libticalcs-1.1.9+dfsg/po/en@boldquot.header000066400000000000000000000024711327711501700206260ustar00rootroot00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # libticalcs-1.1.9+dfsg/po/en@quot.header000066400000000000000000000022631327711501700177640ustar00rootroot00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # libticalcs-1.1.9+dfsg/po/fr.gmo000066400000000000000000000464271327711501700163240ustar00rootroot00000000000000Þ•ÕÄ%l   #,?;6{(² Ûå ö /4d?„Ä'á !)?K€‹_ _l^ÌJ+JvIÁ$ M0~@wЃH´Ìž±Ä×êý#6I\ w…%”ºÉßî 0N(^ ‡”¨ÁÒFèH/x’ ¨ µÀÑàó2BU m z †”3®;â5$T7y± ÃÎì) 5(U.~1­ßô) <> .{ !ª Ì ë !!-!H!`!1|!®!É!ä!ü!'",@"m"">˜"×"ñ"7#'>##f#Š#.©#6Ø#$&$'?$'g$/$¿$Ú$ù$.%-7%e%:h%£% º% Ç% Ò%à%ñ%& &$&3&%I&o&„&%¤&Ê&Þ&ú&" '(0'*Y'$„'©'À'Ú' ó'ÿ'(,(@(P(e(…(—(#¶(Ú(ë(ú() 6)+W)ƒ)¡)¾)Ù)ø)!*4*<P*%*³* Î* Û*æ*++5+K+b+u+y++†+‹++–+š+µ+½+@Â+,,­/, Ý- è-ö-ÿ-.?.DX.;. Ù.ä. õ.//&/=@/'~/N¦/"õ/20-K00y0fª0™1|«1w(2v 2@3MX3Y¦3$4L%4r4V‰4›à4‹|5‰6!’6´6È6Ü6ð677,7@7T7h7|7•7©72¹7ì7ÿ78/8J8Y8 x8™8G«8ó89989I9^b9eÁ9)':*Q: |: Š:–:±:Ê:ê:; ;7;H;];{;Œ; ;(ª;2Ó;;<LB<.<8¾<÷< =&=0C=5t='ª=QÒ=>$>?c>-£>Ñ>2ç>=?BX?,›?È?&ç? @/@(B@ k@Œ@7«@ ã@ A %A FA+gA:“AÎAåAMýA!KBmBDŠB)ÏB(ùB$"C0GC9xC²CÊC1çC3DXMD)¦D*ÐDûD/E.?EnEFrE¹EÏE áEíEþEFF 9FFFWFpF‹F&¤F,ËFøF" G.G4EG2zG#­GÑGëGH%H9HBHaHpHŽH H/µHåHþHI*IGI&bI‰I§I*ÇIòIJ+JEJ$cJ#ˆJ¬JAÊJ- K":K]KqKƒKŸK3¾KòK# L$0LULYLbLhLnLrLxL|L™L¡L@ªLëLMÏaˆ¢W¨u–’;]­My /„Œ: dfª½`ÍX4ËÃHl !=‚7Dh¥¿S º%^*<ÌC©&i•ʯRAn¡GÑ-QE(Tp·É‰Ž¶B6O °_5¼9ƒÆÈZÕ}‡š´'0€,¤bJÒ#PÓ¸ÄN)†{+ÎmÀK§¹8®qoI»2c$Ç‘vFt”Ôžs‹YœŸ3¦k£ .["“Å™Vr«˜Ugj—?µ@|>1³x\~¬²¾LŠ ±eЛzw…Á BIOS: %s Battery: %s HW: %i OS: %s model : %s+------------------+----------+----+----+----------+----------+A transfer is in progress. You cannot start a new one.Battery low, stopping flash app transferBattery: Bits per pixel: Block #%2iBoot Version: Boot2 Version: Calculator type: %sCause: 0 variables stored onto your calculator.Cause: a bug. Drop us an email!Cause: a transmission error, or unsupported calculator version.Cause: a transmission error.Cause: a transmission error. Try again.Cause: bad cable or calc model.Cause: disk space or permissions.Cause: hand-held returned an uncaught error. Please report log.Cause: if you see this in normal usage, a bug: drop us an email ! Otherwise, check the arguments you're passing to the function.Cause: received an unexpected Command ID from calculator, probably due to a transmission error.Cause: received an unexpected Machine ID from calculator, probably due to a transmission error.Cause: received an unexpected Target ID from calculator, probably due to a transmission error.Cause: the cable has not been initialized due to a previous/current error.Cause: the calculator does not have memory enough for doing the operation.Cause: the calculator is busy (Var-Link menu, Window, ...). Press HOME...Cause: the command has been refused.Cause: the operation you attempted is not supported by your calculator model.Cause: the user!Cause: this should not happen. Probably a bug: drop us an email!Cause: this variable type may not be supported by the target calculator, or you may need to upgrade your calculator OS.Cause: you attempted to download a variable which does not exist on the calculator any longer. Maybe you have manually deleted it ?Cause: you attempted to send a variable which is locked/archived on the target calculator. The calculator may be out of memory. The certificate may be invalid or already installed.Changing attributes of %s...Check for TI73... Check for TI80... Check for TI82... Check for TI83... Check for TI85... Check for TI86... Check for TI8X... Check for TI92... Check for TI9X... Check for TIXX... Checking hand-held status:Clock speed: Color screen: Could not determine clock type: %u %uCreating %s...Creating folder '%s':Deleting %s...Deleting variable '%s':Device Type: Directory listing in %8s...Directory listing in <%s>... Dummy hand-heldDummy hand-held used when no calc is setDumping ROM:Exact math engine: Executing %s/%s with %s:FLASH name: "%s"FLASH size: %i bytes.Found classic clock but failed to retrieve its parameters: %u %u %u %uFound new clock but failed to retrieve its parameters: %u %u %u %u %u %uFound valid classic clockFound valid new clockFree Flash: Free RAM: Getting clock...Getting clock:Getting version...Hardware Version: Header sent completely.Invalid CTS packet.Invalid packet.Invalid parameter.Invalid ticalcs handle.LCD height: LCD width: Language ID: Link calc handle details:Msg: FLASH application rejected (bad target model).Msg: FLASH application rejected (signature does not match).Msg: OS installation failed. File is corrupted/wrong.Msg: OS upgrade type not recognized.Msg: anti-downgrade protection refuses this OS version.Msg: battery low.Msg: busy?Msg: calculator is not ready.Msg: calculator out of memory.Msg: can't overwrite, variable is locked.Msg: cannot delete application.Msg: cannot delete var/app from archive.Msg: cannot delete variable (locked/archived).Msg: cannot overwrite variable (locked/archived).Msg: checksum error.Msg: contents has been refused.Msg: forbidden characters in folder name.Msg: hand-held is busy (set your calculator to HOME screen).Msg: hand-held returned an error (not caught).Msg: hand-held returned an error.Msg: invalid argument or name.Msg: invalid command ID.Msg: invalid host ID.Msg: invalid name.Msg: invalid parameter ID.Msg: invalid target ID.Msg: invalid variable name.Msg: malformed RTS packet (AMS version conflict).Msg: mode token too large.Msg: mode token too small.Msg: no file extension.Msg: no more files to list.Msg: not currently listing a directory.Msg: not really an error, should not appear!Msg: out of memory.Msg: packet too large.Msg: program or variable is incompatible with this OS version.Msg: read-only parameter.Msg: remote control?Msg: the destination (folder or file) path is too long.Msg: the directory name already exists.Msg: the directory name is invalid.Msg: the file name is invalid.Msg: the variable or directory does not exist.Msg: this function does not exist for this calculator.Msg: transfer aborted.Msg: transmission error.Msg: unable to open (reading) the file.Msg: unable to open (writing) the file.Msg: using basic mode while being in boot mode.Msg: wrong modify request?Msg: wrong size for parameter.NACK received.Name: %8s | Type: %8s | Attr: %i | Size: %08XName: %s | Type: %8s | Attr: %i | Size: %08XNoNot enumerating documents in %s because it's not a folder Nspire thru DirectLinkOS Version: Parsing %sParsing %s/%sPhysical Flash: Physical RAM: Probing calculator... Product ID: Product Name: Receiving certificateReceiving variable (non-silent mode):Renaming %s to %s...Renaming variable '%s' to '%s':Renaming variable '%s/%s' to '%s/%s':Requesting ID-LIST:Requesting RAM & FLASH freeRequesting backup:Requesting fake (all vars) backup:Requesting folder & vars & apps listing:Requesting receiving of FLASH application:Requesting receiving of certificate:Requesting screenshot:Requesting variable '%s':Requesting version info:Run level: Sending FLASH application:Sending FLASH os:Sending ROM dumper:Sending backup:Sending certificate:Sending fake (all vars) backup:Sending key %08x:Sending one or more variables:Sending variable (non-silent mode):Setting clock...Setting clock:Setting variable '%s' to %s:TI-82 Advanced thru DirectLinkTI-83 Premium CE thru DirectLinkTI-84 Plus C Silver Edition thru DirectLinkTI-84 Plus CE thru DirectLinkTI-84 Plus T thru DirectLinkTI-84 Plus thru DirectLinkTI-89 Titanium thru DirectLinkThe cable cannot be used.The requested var does not exist.There is nothing to backup.Unhandled 84+ family member with product_id=%d hw_version=%dUnknown calculator model with %d bpp Unknown screenshot format.User Flash: User RAM: V200 Personal Learning ToolWaiting for backup...Waiting for user's action...Waiting for var(s)...Will set classic clockWill set new clockYesclippedfreefullgoodlocallowticalcs library version %sunknownused| B. name | T. name |Attr|Type| Size | Folder | | No applications | | No variables | Project-Id-Version: libticalcs2 1.1.8 Report-Msgid-Bugs-To: tilp-users@lists.sourceforge.net POT-Creation-Date: 2016-11-01 09:58+0100 PO-Revision-Date: 2011-12-13 19:16+0100 Last-Translator: Lionel Debroux Language-Team: Français Language: fr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); BIOS: %s Batterie: %s HW: %i OS: %s modèle : %s+------------------+----------+----+----+----------+----------+Un transfert est en cours. Vous ne pouvez pas en démarrer un autre.Batterie faible, arrêt du transfert de l'application FlashBatterie: Bits par pixel: Bloc n°%2iVersion du Boot: Version du Boot2: Type de calculatrice: %sCause: aucune variable n'est stockée sur votre calculatrice.Cause: un bug. Envoyez-nous un e-mail !Cause: une erreur de transmission, ou une version de calculatrice non gérée.Cause: une erreur de transmission.Cause: une erreur de transmission. Essayez encore.Cause: mauvais cable ou mauvaise calculatriceCause: espace disque ou permissions incorrectes.Cause: la calculatrice a retourné une erreur non prise en charge. Veuillez rapporter le log d'erreur.Cause: si vous voyez ceci dans le cadre d'une utilisation normale: envoyez-nous un e-mail ! Sinon, vérifiez les arguments que vous passez à lafonction.Cause: reçu un identifiant de commande invalide depuis la calculatrice, certainement causé par une erreur de transmission.Cause: reçu un mauvais identifiant machine depuis la calculatrice, certainement causé par une erreur de transmission.Cause: reçu un identifiant cible invalide depuis la calculatrice, certainement causé par une erreur de transmission.Cause: le cable n'a pas été initialisé à cause d'une erreur.Cause: la calculatrice n'a pas assez de mémoire pour effectuer l'opération.Cause: la calculatrice est occupée (menu Var-Link, Window, ...). Presser la touche HOME.Cause: la commande a été refusée.Cause: cette opération n'est pas gérée par votre modèle de calculatrice.Cause: l'utilisateur !Cause: ceci ne devrait pas arriver. C'est probablement un bug: envoyez-nous un email !Cause: ce type de variable n'est peut-être pas géré par la calculatrice cible, ou vous avez peut-être besoin de mettre à jour l'OS de la calculatrice.Cause: vous avez tenté de télécharger une variable qui n'existe plus sur la calculatrice. Vous l'avez peut-être effacée manuellement ?Cause: vous avez tenté d'envoyer une variable verrouillée/archivée sur la calculatrice. La calculatrice manque peut-être de mémoire.Changement des attributs de %s...Essai avec TI83... Essai avec TI80... Essai avec TI82... Essai avec TI83... Essai avec TI85... Essai avec TI86... Essai avec TI8X... Essai avec TI92... Essai avec TI9X... Essai avec TIXX... Vérification du status:Vitesse d'horloge: Ecran couleur: Impossible de déterminer le type d'horloge: %u %uCréation de %s...Création du dossier '%s':Suppression de %s...Suppression variable '%s':Type de calc: Listage du dossier dans %8s...Listage du dossier dans <%s>... Calculatrice videCalculatrice vide utilisée quand aucune calculatrice n'est spécifiéeExtraction ROM:Moteur de calcul exact: Execution de %s/%s avec %s:Nom FLASH: "%s"Taille FLASH: %i octets.Trouvé une horloge de type ancien mais impossible de récupérer ses paramètres: %u %u %u %uTrouvé une horloge de type nouveau mais impossible de récupérer ses paramètres: %u %u %u %u %u %uTrouvé une horloge valide de type ancienTrouvé une horloge valide de type nouveauFlash libre: RAM libre: Réception de l'horloge...Réception de l'horloge:Récupération de la version...Version du Matériel: En-tête envoyé complètementPaquet CTS non valide.Paquet invalide.Paramètre invalide.Descripteur ticalcs invalide.Hauteur écran: Largeur écran: N° langue: Détails du descripteur de calculatrice:Msg: application rejetée (mauvaise calculatrice).Msg: application rejetée (la signature ne correspond pas).Msg: l'installation de l'OS a échoué. Le fichier est corrompu ou invalide.Msg: type de mise à jour de l'OS non reconnu.Msg: la protection anti-retour refuse cette version d'OSMsg: batterie faible.Msg: occupé ?Msg: la calculatrice n'est pas prête.Msg: la calculatrice n'a plus de mémoire libre.Msg: ne peut pas écraser la variable (verrouillée).Msg: ne peut pas effacer l'application.Msg: ne peut pas effacer la variable ou l'application depuis la mémoire archive.Msg: ne peut pas effacer la variable (verrouillée/archivée).Msg: ne peut pas écraser la variable (verrouillée/archivée).Msg: erreur de somme de contrôle (checksum).Msg: contenu refusé.Msg: caractères interdits dans le nom de dossier.Msg: calculatrice occupée (mettez la calculatrice sur HOME).Msg: la calculatrice a retourné une erreur (non prise en charge).Msg: la calculatrice a retourné une erreur.Msg: argument ou nom invalide.Msg: identifiant de commande invalide.Msg: identifiant hôte invalide.Msg: nom invalide.Msg: identifiant de paramètre invalide.Msg: identifiant cible invalide.Msg: nom de variable invalide.Msg: paquet RTS incorrect (conflit de version sur AMS).Msg: valeur du mode trop grande.Msg: valeur du mode trop petite.Msg: pas d'extension de fichier.Msg: valeur du mode trop petite.Msg: pas en train de lister un répertoire.Msg: Pas vraiment une erreur, ne devrait pas apparaître !Msg: plus de mémoire.Msg: paquet trop grand.Msg: le programme ou la variable est incompatible avec cette version de l'OS.Msg: paramètre en lecture seule.Msg: contrôle à distance ?Msg: le chemin de destination (répertoire ou fichier) est invalide.Msg: le nom de répertoire existe déjà.Msg: le nom de répertoire est invalide.Msg: le nom de fichier est invalide.Msg: la variable ou le répertoire n'existe pas.Msg: Cette fonction n'existe pas pour votre calculatrice.Msg: Transfert avorté.Msg: erreur de transmission.Msg: Impossible d'ouvrir (en lecture) le fichier.Msg: Impossible d'ouvrir (en écriture) le fichier.Msg: utilisation du mode de base alors que la calculatrice est en mode boot (dégradé).Msg: requête de modification incorrecte?Msg: taille incorrecte pour le paramètre.NACK (refus) reçu.Nom: %8s | Type: %8s | Attr: %i | Taille: %08XNom: %s | Type: %8s | Attr: %i | Taille: %08XNonN'énumère pas les documents dans %s car ce n'est pas un répertoire Nspire via DirectLinkVersion de l'OS: Parcourt %sLecture de %s/%sFlash physique: RAM physique: Recherche calculatrice... ID Produit: Nom du Produit: Réception du certificatRéception de variable(s):Renommage de %s en %s...Renommage de la variable '%s' en '%s':Renommage de la variable '%s/%s' en '%s/%s':Demande d'ID-LIST:Obtention de la RAM & FLASH libresRéception sauvegarde:Réception fausse sauvegarde (toutes les variables):Obtention des dossiers & variables & applications:Réception d'une application FLASH:Réception du certificat:Obtention capture écran:Réception de la variable '%s':Demande de version:Niveau: Envoi d'une application FLASH:Envoi d'un OS:Envoi de l'extracteur de ROM:Envoi sauvegarde:Envoi du certificat:Envoi fausse sauvegarde (toutes les variables):Envoi de la touche %08x:Envoi de variable(s):Envoi de variable(s):Mise à jour de l'horloge...Mise à jour de l'horloge:Définition de la variable '%s' en %s:TI-82 Advanced via DirectLinkTI-83 Premium CE via DirectLinkTI-84 Plus C Silver Edition via DirectLinkTI-84 Plus CE via DirectLinkTI-84 Plus T via DirectLinkTI-84 Plus via DirectLinkTI-89 Titanium via DirectLinkLe cable ne peut pas être utilisé.La variable demandée n'existe pas.Il n'y a rien à sauvegarder.Membre inconnu de la famille 84+ avec product_id=%d hw_version=%dModèle de calculatrice inconnu, avec %d bpp Format de capture d'écran inconnuFlash utilisateur: RAM utilisateur: V200 Personal Learning ToolEn attente pour sauvegarder...Attente d'une action de la part de l'utilisateur...Attente de variable(s)...Va régler l'horloge de type ancienVa régler l'horloge de type nouveauOuitronquélibrepleinbonlocalbaslibrairie ticalcs version %sinconnuutilisé|Nom Bin. |Nom Trad. |Attr|Type| Taille | Parent | | Pas d'application| | Pas de variable | libticalcs-1.1.9+dfsg/po/fr.po000066400000000000000000000613431327711501700161520ustar00rootroot00000000000000# French locale for libticalcs. # Copyright (C) 2003 Sylvain Garsault # Copyright (C) 2007 Romain Liévin # This file is distributed under the same license as the libticalcs2 package. # msgid "" msgstr "" "Project-Id-Version: libticalcs2 1.1.8\n" "Report-Msgid-Bugs-To: tilp-users@lists.sourceforge.net\n" "POT-Creation-Date: 2016-11-01 09:58+0100\n" "PO-Revision-Date: 2011-12-13 19:16+0100\n" "Last-Translator: Lionel Debroux \n" "Language-Team: Français \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: src/calc_00.c:213 msgid "Dummy hand-held" msgstr "Calculatrice vide" #: src/calc_00.c:214 msgid "Dummy hand-held used when no calc is set" msgstr "Calculatrice vide utilisée quand aucune calculatrice n'est spécifiée" #: src/calc_73.c:393 src/calc_84p.c:301 src/calc_8x.c:402 #, c-format msgid "Parsing %s" msgstr "Parcourt %s" #: src/calc_73.c:854 msgid "Battery low, stopping flash app transfer" msgstr "Batterie faible, arrêt du transfert de l'application Flash" #: src/calc_73.c:859 src/calc_73.c:1502 src/calc_9x.c:1163 src/calc_89t.c:506 #, c-format msgid "FLASH name: \"%s\"" msgstr "Nom FLASH: \"%s\"" #: src/calc_73.c:860 src/calc_73.c:1503 src/calc_9x.c:1164 src/calc_89t.c:507 #, c-format msgid "FLASH size: %i bytes." msgstr "Taille FLASH: %i octets." #: src/calc_73.c:1278 src/calc_84p.c:1481 src/calc_84p.c:1511 #: src/calc_9x.c:1448 src/calc_89t.c:844 msgid "Setting clock..." msgstr "Mise à jour de l'horloge..." #: src/calc_73.c:1324 src/calc_84p.c:1431 src/calc_84p.c:1581 #: src/calc_9x.c:1492 src/calc_89t.c:923 msgid "Getting clock..." msgstr "Réception de l'horloge..." #: src/calc_73.c:1400 src/calc_84p.c:1685 src/calc_8x.c:1255 src/calc_9x.c:1556 #: src/calc_9x.c:1588 src/calc_89t.c:1000 src/calc_nsp.c:835 #, c-format msgid "Deleting %s..." msgstr "Suppression de %s..." #: src/calc_73.c:1474 src/calc_9x.c:1715 src/calc_9x.c:1748 #, c-format msgid " OS: %s" msgstr " OS: %s" #: src/calc_73.c:1475 src/calc_9x.c:1716 #, c-format msgid " BIOS: %s" msgstr " BIOS: %s" #: src/calc_73.c:1476 #, c-format msgid " HW: %i" msgstr " HW: %i" #: src/calc_73.c:1477 src/calc_9x.c:1717 src/calc_9x.c:1749 #, c-format msgid " Battery: %s" msgstr " Batterie: %s" #: src/calc_73.c:1477 src/type2str.c:340 msgid "good" msgstr "bon" #: src/calc_73.c:1477 src/type2str.c:340 msgid "low" msgstr "bas" #: src/calc_73.c:1549 src/calc_9x.c:1230 msgid "Header sent completely." msgstr "En-tête envoyé complètement" #: src/calc_73.c:1562 msgid "Receiving certificate" msgstr "Réception du certificat" #: src/calc_84p.c:1445 src/calc_84p.c:1595 #, c-format msgid "Could not determine clock type: %u %u" msgstr "Impossible de déterminer le type d'horloge: %u %u" #: src/calc_84p.c:1454 msgid "Will set classic clock" msgstr "Va régler l'horloge de type ancien" #: src/calc_84p.c:1509 msgid "Will set new clock" msgstr "Va régler l'horloge de type nouveau" #: src/calc_84p.c:1606 msgid "Found valid classic clock" msgstr "Trouvé une horloge valide de type ancien" #: src/calc_84p.c:1637 #, c-format msgid "Found classic clock but failed to retrieve its parameters: %u %u %u %u" msgstr "" "Trouvé une horloge de type ancien mais impossible de récupérer ses " "paramètres: %u %u %u %u" #: src/calc_84p.c:1647 msgid "Found valid new clock" msgstr "Trouvé une horloge valide de type nouveau" #: src/calc_84p.c:1662 #, c-format msgid "" "Found new clock but failed to retrieve its parameters: %u %u %u %u %u %u" msgstr "" "Trouvé une horloge de type nouveau mais impossible de récupérer ses " "paramètres: %u %u %u %u %u %u" #: src/calc_84p.c:1768 src/calc_89t.c:1189 msgid "Getting version..." msgstr "Récupération de la version..." #: src/calc_84p.c:2017 src/calc_84p.c:2026 src/calc_84p.c:2035 #: src/calc_84p.c:2051 src/calc_84p.c:2059 #, c-format msgid "Unhandled 84+ family member with product_id=%d hw_version=%d" msgstr "Membre inconnu de la famille 84+ avec product_id=%d hw_version=%d" #: src/calc_84p.c:2076 msgid "TI-84 Plus thru DirectLink" msgstr "TI-84 Plus via DirectLink" #: src/calc_84p.c:2147 msgid "TI-84 Plus C Silver Edition thru DirectLink" msgstr "TI-84 Plus C Silver Edition via DirectLink" #: src/calc_84p.c:2218 msgid "TI-83 Premium CE thru DirectLink" msgstr "TI-83 Premium CE via DirectLink" #: src/calc_84p.c:2289 msgid "TI-84 Plus CE thru DirectLink" msgstr "TI-84 Plus CE via DirectLink" #: src/calc_84p.c:2360 msgid "TI-82 Advanced thru DirectLink" msgstr "TI-82 Advanced via DirectLink" #: src/calc_84p.c:2431 msgid "TI-84 Plus T thru DirectLink" msgstr "TI-84 Plus T via DirectLink" #: src/calc_8x.c:493 src/calc_8x.c:804 msgid "Waiting for user's action..." msgstr "Attente d'une action de la part de l'utilisateur..." #: src/calc_8x.c:638 msgid "Waiting for backup..." msgstr "En attente pour sauvegarder..." #: src/calc_8x.c:1076 msgid "Waiting for var(s)..." msgstr "Attente de variable(s)..." #: src/calc_9x.c:353 src/calc_9x.c:441 src/calc_9x.c:580 #, c-format msgid "Name: %8s | Type: %8s | Attr: %i | Size: %08X" msgstr "Nom: %8s | Type: %8s | Attr: %i | Taille: %08X" #: src/calc_9x.c:386 #, c-format msgid "Directory listing in %8s..." msgstr "Listage du dossier dans %8s..." #: src/calc_9x.c:449 src/calc_9x.c:604 src/calc_89t.c:249 #, c-format msgid "Parsing %s/%s" msgstr "Lecture de %s/%s" #: src/calc_9x.c:699 #, c-format msgid "Block #%2i" msgstr "Bloc n°%2i" #: src/calc_9x.c:1618 src/calc_89t.c:1096 src/calc_nsp.c:865 #, c-format msgid "Creating %s..." msgstr "Création de %s..." #: src/calc_9x.c:2010 msgid "V200 Personal Learning Tool" msgstr "V200 Personal Learning Tool" #: src/calc_89t.c:1031 src/calc_nsp.c:1034 #, c-format msgid "Renaming %s to %s..." msgstr "Renommage de %s en %s..." #: src/calc_89t.c:1059 #, c-format msgid "Changing attributes of %s..." msgstr "Changement des attributs de %s..." #: src/calc_89t.c:1416 msgid "TI-89 Titanium thru DirectLink" msgstr "TI-89 Titanium via DirectLink" #: src/calc_nsp.c:232 #, c-format msgid "Unknown calculator model with %d bpp\n" msgstr "Modèle de calculatrice inconnu, avec %d bpp\n" #: src/calc_nsp.c:388 #, c-format msgid "Name: %s | Type: %8s | Attr: %i | Size: %08X" msgstr "Nom: %s | Type: %8s | Attr: %i | Taille: %08X" #: src/calc_nsp.c:421 #, c-format msgid "Not enumerating documents in %s because it's not a folder\n" msgstr "N'énumère pas les documents dans %s car ce n'est pas un répertoire\n" #: src/calc_nsp.c:437 #, c-format msgid "Directory listing in <%s>...\n" msgstr "Listage du dossier dans <%s>...\n" #: src/calc_nsp.c:1057 msgid "Nspire thru DirectLink" msgstr "Nspire via DirectLink" #: src/calc_xx.c:91 msgid "Checking hand-held status:" msgstr "Vérification du status:" #: src/calc_xx.c:125 #, c-format msgid "Sending key %08x:" msgstr "Envoi de la touche %08x:" #: src/calc_xx.c:162 #, c-format msgid "Executing %s/%s with %s:" msgstr "Execution de %s/%s avec %s:" #: src/calc_xx.c:199 msgid "Requesting screenshot:" msgstr "Obtention capture écran:" #: src/calc_xx.c:297 msgid "Requesting folder & vars & apps listing:" msgstr "Obtention des dossiers & variables & applications:" #: src/calc_xx.c:351 msgid "Requesting RAM & FLASH free" msgstr "Obtention de la RAM & FLASH libres" #: src/calc_xx.c:386 msgid "Sending backup:" msgstr "Envoi sauvegarde:" #: src/calc_xx.c:421 msgid "Requesting backup:" msgstr "Réception sauvegarde:" #: src/calc_xx.c:458 msgid "Sending one or more variables:" msgstr "Envoi de variable(s):" #: src/calc_xx.c:496 #, c-format msgid "Requesting variable '%s':" msgstr "Réception de la variable '%s':" #: src/calc_xx.c:533 msgid "Sending variable (non-silent mode):" msgstr "Envoi de variable(s):" #: src/calc_xx.c:571 msgid "Receiving variable (non-silent mode):" msgstr "Réception de variable(s):" #: src/calc_xx.c:606 msgid "Sending FLASH application:" msgstr "Envoi d'une application FLASH:" #: src/calc_xx.c:643 msgid "Requesting receiving of FLASH application:" msgstr "Réception d'une application FLASH:" #: src/calc_xx.c:678 msgid "Sending FLASH os:" msgstr "Envoi d'un OS:" #: src/calc_xx.c:713 msgid "Requesting ID-LIST:" msgstr "Demande d'ID-LIST:" #: src/calc_xx.c:746 msgid "Sending ROM dumper:" msgstr "Envoi de l'extracteur de ROM:" #: src/calc_xx.c:782 msgid "Dumping ROM:" msgstr "Extraction ROM:" #: src/calc_xx.c:817 msgid "Setting clock:" msgstr "Mise à jour de l'horloge:" #: src/calc_xx.c:852 msgid "Getting clock:" msgstr "Réception de l'horloge:" #: src/calc_xx.c:887 #, c-format msgid "Deleting variable '%s':" msgstr "Suppression variable '%s':" #: src/calc_xx.c:922 #, c-format msgid "Creating folder '%s':" msgstr "Création du dossier '%s':" #: src/calc_xx.c:957 msgid "Requesting version info:" msgstr "Demande de version:" #: src/calc_xx.c:992 msgid "Sending certificate:" msgstr "Envoi du certificat:" #: src/calc_xx.c:1027 msgid "Requesting receiving of certificate:" msgstr "Réception du certificat:" #: src/calc_xx.c:1066 #, c-format msgid "Renaming variable '%s/%s' to '%s/%s':" msgstr "Renommage de la variable '%s/%s' en '%s/%s':" #: src/calc_xx.c:1070 #, c-format msgid "Renaming variable '%s' to '%s':" msgstr "Renommage de la variable '%s' en '%s':" #: src/calc_xx.c:1108 #, c-format msgid "Setting variable '%s' to %s:" msgstr "Définition de la variable '%s' en %s:" #: src/calc_xx.c:1145 msgid "Sending fake (all vars) backup:" msgstr "Envoi fausse sauvegarde (toutes les variables):" #: src/calc_xx.c:1180 msgid "Requesting fake (all vars) backup:" msgstr "Réception fausse sauvegarde (toutes les variables):" #: src/dirlist.c:194 #, c-format msgid "| B. name | T. name |Attr|Type| Size | Folder |\n" msgstr "|Nom Bin. |Nom Trad. |Attr|Type| Taille | Parent |\n" #: src/dirlist.c:204 #, c-format msgid "| No variables |\n" msgstr "| Pas de variable |\n" #: src/dirlist.c:208 #, c-format msgid "| No applications |\n" msgstr "| Pas d'application|\n" #: src/dirlist.c:212 #, c-format msgid "+------------------+----------+----+----+----------+----------+" msgstr "+------------------+----------+----+----+----------+----------+" #: src/error.c:72 msgid "Msg: transfer aborted." msgstr "Msg: Transfert avorté." #: src/error.c:74 msgid "Cause: the user!" msgstr "Cause: l'utilisateur !" #: src/error.c:80 msgid "Msg: calculator is not ready." msgstr "Msg: la calculatrice n'est pas prête." #: src/error.c:82 msgid "" "Cause: the calculator is busy (Var-Link menu, Window, ...). Press HOME..." msgstr "" "Cause: la calculatrice est occupée (menu Var-Link, Window, ...). Presser la " "touche HOME." #: src/error.c:88 msgid "Msg: checksum error." msgstr "Msg: erreur de somme de contrôle (checksum)." #: src/error.c:90 msgid "Cause: a transmission error. Try again." msgstr "Cause: une erreur de transmission. Essayez encore." #: src/error.c:96 msgid "Msg: invalid host ID." msgstr "Msg: identifiant hôte invalide." #: src/error.c:98 msgid "" "Cause: received an unexpected Machine ID from calculator, probably due to a " "transmission error." msgstr "" "Cause: reçu un mauvais identifiant machine depuis la calculatrice, " "certainement causé par une erreur de transmission." #: src/error.c:104 msgid "Msg: invalid target ID." msgstr "Msg: identifiant cible invalide." #: src/error.c:106 msgid "" "Cause: received an unexpected Target ID from calculator, probably due to a " "transmission error." msgstr "" "Cause: reçu un identifiant cible invalide depuis la calculatrice, " "certainement causé par une erreur de transmission." #: src/error.c:112 msgid "Msg: invalid command ID." msgstr "Msg: identifiant de commande invalide." #: src/error.c:114 msgid "" "Cause: received an unexpected Command ID from calculator, probably due to a " "transmission error." msgstr "" "Cause: reçu un identifiant de commande invalide depuis la calculatrice, " "certainement causé par une erreur de transmission." #: src/error.c:120 msgid "Msg: not really an error, should not appear!" msgstr "Msg: Pas vraiment une erreur, ne devrait pas apparaître !" #: src/error.c:122 msgid "Cause: a bug. Drop us an email!" msgstr "Cause: un bug. Envoyez-nous un e-mail !" #: src/error.c:128 msgid "Msg: program or variable is incompatible with this OS version." msgstr "" "Msg: le programme ou la variable est incompatible avec cette version de l'OS." #: src/error.c:130 msgid "" "Cause: this variable type may not be supported by the target calculator, or " "you may need to upgrade your calculator OS." msgstr "" "Cause: ce type de variable n'est peut-être pas géré par la calculatrice " "cible, ou vous avez peut-être besoin de mettre à jour l'OS de la " "calculatrice." #: src/error.c:136 msgid "Msg: contents has been refused." msgstr "Msg: contenu refusé." #: src/error.c:138 msgid "" "Cause: you attempted to send a variable which is locked/archived on the " "target calculator. The calculator may be out of memory. The certificate may " "be invalid or already installed." msgstr "" "Cause: vous avez tenté d'envoyer une variable verrouillée/archivée sur la " "calculatrice. La calculatrice manque peut-être de mémoire." #: src/error.c:144 msgid "Invalid CTS packet." msgstr "Paquet CTS non valide." #: src/error.c:146 src/error.c:162 msgid "Cause: a transmission error." msgstr "Cause: une erreur de transmission." #: src/error.c:152 msgid "NACK received." msgstr "NACK (refus) reçu." #: src/error.c:154 msgid "Cause: the command has been refused." msgstr "Cause: la commande a été refusée." #: src/error.c:160 msgid "Invalid packet." msgstr "Paquet invalide." #: src/error.c:171 msgid "The cable cannot be used." msgstr "Le cable ne peut pas être utilisé." #: src/error.c:173 msgid "" "Cause: the cable has not been initialized due to a previous/current error." msgstr "Cause: le cable n'a pas été initialisé à cause d'une erreur." #: src/error.c:186 msgid "Msg: this function does not exist for this calculator." msgstr "Msg: Cette fonction n'existe pas pour votre calculatrice." #: src/error.c:188 msgid "" "Cause: the operation you attempted is not supported by your calculator model." msgstr "" "Cause: cette opération n'est pas gérée par votre modèle de calculatrice." #: src/error.c:194 msgid "Msg: calculator out of memory." msgstr "Msg: la calculatrice n'a plus de mémoire libre." #: src/error.c:196 msgid "" "Cause: the calculator does not have memory enough for doing the operation." msgstr "" "Cause: la calculatrice n'a pas assez de mémoire pour effectuer l'opération." #: src/error.c:202 msgid "Msg: unable to open (reading) the file." msgstr "Msg: Impossible d'ouvrir (en lecture) le fichier." #: src/error.c:204 src/error.c:212 msgid "Cause: disk space or permissions." msgstr "Cause: espace disque ou permissions incorrectes." #: src/error.c:210 msgid "Msg: unable to open (writing) the file." msgstr "Msg: Impossible d'ouvrir (en écriture) le fichier." #: src/error.c:218 msgid "A transfer is in progress. You cannot start a new one." msgstr "Un transfert est en cours. Vous ne pouvez pas en démarrer un autre." #: src/error.c:220 msgid "Cause: this should not happen. Probably a bug: drop us an email!" msgstr "" "Cause: ceci ne devrait pas arriver. C'est probablement un bug: envoyez-nous " "un email !" #: src/error.c:229 msgid "The requested var does not exist." msgstr "La variable demandée n'existe pas." #: src/error.c:231 msgid "" "Cause: you attempted to download a variable which does not exist on the " "calculator any longer. Maybe you have manually deleted it ?" msgstr "" "Cause: vous avez tenté de télécharger une variable qui n'existe plus sur la " "calculatrice. Vous l'avez peut-être effacée manuellement ?" #: src/error.c:237 msgid "There is nothing to backup." msgstr "Il n'y a rien à sauvegarder." #: src/error.c:239 msgid "Cause: 0 variables stored onto your calculator." msgstr "Cause: aucune variable n'est stockée sur votre calculatrice." #: src/error.c:245 msgid "Invalid ticalcs handle." msgstr "Descripteur ticalcs invalide." #: src/error.c:247 msgid "Cause: bad cable or calc model." msgstr "Cause: mauvais cable ou mauvaise calculatrice" #: src/error.c:253 msgid "Invalid parameter." msgstr "Paramètre invalide." #: src/error.c:255 msgid "" "Cause: if you see this in normal usage, a bug: drop us an email ! Otherwise, " "check the arguments you're passing to the function." msgstr "" "Cause: si vous voyez ceci dans le cadre d'une utilisation normale: envoyez-" "nous un e-mail ! Sinon, vérifiez les arguments que vous passez à lafonction." #: src/error.c:261 msgid "Unknown screenshot format." msgstr "Format de capture d'écran inconnu" #: src/error.c:263 msgid "Cause: a transmission error, or unsupported calculator version." msgstr "" "Cause: une erreur de transmission, ou une version de calculatrice non gérée." #: src/error.c:269 msgid "Msg: hand-held returned an error." msgstr "Msg: la calculatrice a retourné une erreur." #: src/error.c:271 src/error.c:307 src/error.c:391 msgid "Cause: hand-held returned an uncaught error. Please report log." msgstr "" "Cause: la calculatrice a retourné une erreur non prise en charge. Veuillez " "rapporter le log d'erreur." #: src/error.c:276 msgid "Msg: cannot delete application." msgstr "Msg: ne peut pas effacer l'application." #: src/error.c:280 msgid "Msg: invalid variable name." msgstr "Msg: nom de variable invalide." #: src/error.c:284 msgid "Msg: cannot overwrite variable (locked/archived)." msgstr "Msg: ne peut pas écraser la variable (verrouillée/archivée)." #: src/error.c:288 msgid "Msg: cannot delete variable (locked/archived)." msgstr "Msg: ne peut pas effacer la variable (verrouillée/archivée)." #: src/error.c:292 msgid "Msg: FLASH application rejected (bad target model)." msgstr "Msg: application rejetée (mauvaise calculatrice)." #: src/error.c:296 msgid "Msg: malformed RTS packet (AMS version conflict)." msgstr "Msg: paquet RTS incorrect (conflit de version sur AMS)." #: src/error.c:300 src/error.c:380 msgid "Msg: FLASH application rejected (signature does not match)." msgstr "Msg: application rejetée (la signature ne correspond pas)." #: src/error.c:305 src/error.c:389 msgid "Msg: hand-held returned an error (not caught)." msgstr "Msg: la calculatrice a retourné une erreur (non prise en charge)." #: src/error.c:312 msgid "Msg: invalid argument or name." msgstr "Msg: argument ou nom invalide." #: src/error.c:316 msgid "Msg: cannot delete var/app from archive." msgstr "" "Msg: ne peut pas effacer la variable ou l'application depuis la mémoire " "archive." #: src/error.c:320 msgid "Msg: transmission error." msgstr "Msg: erreur de transmission." #: src/error.c:324 msgid "Msg: using basic mode while being in boot mode." msgstr "" "Msg: utilisation du mode de base alors que la calculatrice est en mode boot " "(dégradé)." #: src/error.c:328 src/error.c:396 msgid "Msg: out of memory." msgstr "Msg: plus de mémoire." #: src/error.c:332 src/error.c:336 msgid "Msg: invalid name." msgstr "Msg: nom invalide." #: src/error.c:340 msgid "Msg: busy?" msgstr "Msg: occupé ?" #: src/error.c:344 msgid "Msg: can't overwrite, variable is locked." msgstr "Msg: ne peut pas écraser la variable (verrouillée)." #: src/error.c:348 msgid "Msg: mode token too small." msgstr "Msg: valeur du mode trop petite." #: src/error.c:352 msgid "Msg: mode token too large." msgstr "Msg: valeur du mode trop grande." #: src/error.c:356 msgid "Msg: wrong size for parameter." msgstr "Msg: taille incorrecte pour le paramètre." #: src/error.c:360 msgid "Msg: invalid parameter ID." msgstr "Msg: identifiant de paramètre invalide." #: src/error.c:364 msgid "Msg: read-only parameter." msgstr "Msg: paramètre en lecture seule." #: src/error.c:368 msgid "Msg: wrong modify request?" msgstr "Msg: requête de modification incorrecte?" #: src/error.c:372 msgid "Msg: remote control?" msgstr "Msg: contrôle à distance ?" #: src/error.c:376 msgid "Msg: battery low." msgstr "Msg: batterie faible." #: src/error.c:384 msgid "Msg: hand-held is busy (set your calculator to HOME screen)." msgstr "Msg: calculatrice occupée (mettez la calculatrice sur HOME)." #: src/error.c:400 msgid "Msg: OS installation failed. File is corrupted/wrong." msgstr "" "Msg: l'installation de l'OS a échoué. Le fichier est corrompu ou invalide." #: src/error.c:405 msgid "Msg: packet too large." msgstr "Msg: paquet trop grand." #: src/error.c:409 msgid "Msg: the variable or directory does not exist." msgstr "Msg: la variable ou le répertoire n'existe pas." #: src/error.c:413 msgid "Msg: the directory name is invalid." msgstr "Msg: le nom de répertoire est invalide." #: src/error.c:417 msgid "Msg: not currently listing a directory." msgstr "Msg: pas en train de lister un répertoire." #: src/error.c:421 msgid "Msg: no more files to list." msgstr "Msg: valeur du mode trop petite." #: src/error.c:425 msgid "Msg: the directory name already exists." msgstr "Msg: le nom de répertoire existe déjà." #: src/error.c:430 msgid "Msg: the destination (folder or file) path is too long." msgstr "Msg: le chemin de destination (répertoire ou fichier) est invalide." #: src/error.c:434 msgid "Msg: the file name is invalid." msgstr "Msg: le nom de fichier est invalide." #: src/error.c:438 msgid "Msg: no file extension." msgstr "Msg: pas d'extension de fichier." #: src/error.c:442 msgid "Msg: forbidden characters in folder name." msgstr "Msg: caractères interdits dans le nom de dossier." #: src/error.c:452 msgid "Msg: OS upgrade type not recognized." msgstr "Msg: type de mise à jour de l'OS non reconnu." #: src/error.c:456 msgid "Msg: anti-downgrade protection refuses this OS version." msgstr "Msg: la protection anti-retour refuse cette version d'OS" #: src/probe.c:91 msgid "Probing calculator...\n" msgstr "Recherche calculatrice...\n" #: src/probe.c:95 msgid "Check for TI86... " msgstr "Essai avec TI86... " #: src/probe.c:119 msgid "Check for TI85... " msgstr "Essai avec TI85... " #: src/probe.c:143 msgid "Check for TI73... " msgstr "Essai avec TI83... " #: src/probe.c:167 msgid "Check for TI83... " msgstr "Essai avec TI83... " #: src/probe.c:191 msgid "Check for TI82... " msgstr "Essai avec TI82... " #: src/probe.c:217 msgid "Check for TI80... " msgstr "Essai avec TI80... " #: src/probe.c:273 msgid "Check for TIXX... " msgstr "Essai avec TIXX... " #: src/probe.c:311 msgid "Check for TI92... " msgstr "Essai avec TI92... " #: src/probe.c:355 msgid "Check for TI9X... " msgstr "Essai avec TI9X... " #: src/probe.c:370 msgid "Check for TI8X... " msgstr "Essai avec TI8X... " #: src/probe.c:385 #, c-format msgid "Calculator type: %s" msgstr " Type de calculatrice: %s" #: src/ticalcs.c:238 #, c-format msgid "ticalcs library version %s" msgstr "librairie ticalcs version %s" #: src/ticalcs.c:396 msgid "Link calc handle details:" msgstr "Détails du descripteur de calculatrice:" #: src/ticalcs.c:397 #, c-format msgid " model : %s" msgstr " modèle : %s" #: src/type2str.c:62 src/type2str.c:72 src/type2str.c:94 src/type2str.c:104 msgid "full" msgstr "plein" #: src/type2str.c:63 src/type2str.c:76 msgid "clipped" msgstr "tronqué" #: src/type2str.c:64 src/type2str.c:96 src/type2str.c:128 msgid "unknown" msgstr "inconnu" #: src/type2str.c:95 src/type2str.c:108 msgid "local" msgstr "local" #: src/type2str.c:126 src/type2str.c:136 msgid "free" msgstr "libre" #: src/type2str.c:127 src/type2str.c:140 msgid "used" msgstr "utilisé" #: src/type2str.c:293 msgid "Product Name: " msgstr "Nom du Produit: " #: src/type2str.c:295 msgid "Product ID: " msgstr "ID Produit: " #: src/type2str.c:297 msgid "Language ID: " msgstr "N° langue: " #: src/type2str.c:300 msgid "Device Type: " msgstr "Type de calc: " #: src/type2str.c:302 msgid "Hardware Version: " msgstr "Version du Matériel: " #: src/type2str.c:304 msgid "Boot Version: " msgstr "Version du Boot: " #: src/type2str.c:306 msgid "Boot2 Version: " msgstr "Version du Boot2: " #: src/type2str.c:308 msgid "OS Version: " msgstr "Version de l'OS: " #: src/type2str.c:310 msgid "Run level: " msgstr "Niveau: " #: src/type2str.c:312 msgid "Clock speed: " msgstr "Vitesse d'horloge: " #: src/type2str.c:314 msgid "Exact math engine: " msgstr "Moteur de calcul exact: " #: src/type2str.c:315 msgid "Yes" msgstr "Oui" #: src/type2str.c:315 msgid "No" msgstr "Non" #: src/type2str.c:317 msgid "LCD width: " msgstr "Largeur écran: " #: src/type2str.c:319 msgid "LCD height: " msgstr "Hauteur écran: " #: src/type2str.c:321 msgid "Bits per pixel: " msgstr "Bits par pixel: " #: src/type2str.c:323 msgid "Color screen: " msgstr "Ecran couleur: " #: src/type2str.c:326 msgid "Physical RAM: " msgstr "RAM physique: " #: src/type2str.c:328 msgid "User RAM: " msgstr "RAM utilisateur: " #: src/type2str.c:330 msgid "Free RAM: " msgstr "RAM libre: " #: src/type2str.c:332 msgid "Physical Flash: " msgstr "Flash physique: " #: src/type2str.c:334 msgid "User Flash: " msgstr "Flash utilisateur: " #: src/type2str.c:336 msgid "Free Flash: " msgstr "Flash libre: " #: src/type2str.c:339 msgid "Battery: " msgstr "Batterie: " libticalcs-1.1.9+dfsg/po/insert-header.sin000066400000000000000000000012401327711501700204360ustar00rootroot00000000000000# Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } libticalcs-1.1.9+dfsg/po/libticalcs2.pot000066400000000000000000000417241327711501700201230ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the libticalcs2 package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: libticalcs2 1.1.9\n" "Report-Msgid-Bugs-To: tilp-users@lists.sourceforge.net\n" "POT-Creation-Date: 2016-11-01 09:58+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: src/calc_00.c:213 msgid "Dummy hand-held" msgstr "" #: src/calc_00.c:214 msgid "Dummy hand-held used when no calc is set" msgstr "" #: src/calc_73.c:393 src/calc_84p.c:301 src/calc_8x.c:402 #, c-format msgid "Parsing %s" msgstr "" #: src/calc_73.c:854 msgid "Battery low, stopping flash app transfer" msgstr "" #: src/calc_73.c:859 src/calc_73.c:1502 src/calc_9x.c:1163 src/calc_89t.c:506 #, c-format msgid "FLASH name: \"%s\"" msgstr "" #: src/calc_73.c:860 src/calc_73.c:1503 src/calc_9x.c:1164 src/calc_89t.c:507 #, c-format msgid "FLASH size: %i bytes." msgstr "" #: src/calc_73.c:1278 src/calc_84p.c:1481 src/calc_84p.c:1511 #: src/calc_9x.c:1448 src/calc_89t.c:844 msgid "Setting clock..." msgstr "" #: src/calc_73.c:1324 src/calc_84p.c:1431 src/calc_84p.c:1581 #: src/calc_9x.c:1492 src/calc_89t.c:923 msgid "Getting clock..." msgstr "" #: src/calc_73.c:1400 src/calc_84p.c:1685 src/calc_8x.c:1255 src/calc_9x.c:1556 #: src/calc_9x.c:1588 src/calc_89t.c:1000 src/calc_nsp.c:835 #, c-format msgid "Deleting %s..." msgstr "" #: src/calc_73.c:1474 src/calc_9x.c:1715 src/calc_9x.c:1748 #, c-format msgid " OS: %s" msgstr "" #: src/calc_73.c:1475 src/calc_9x.c:1716 #, c-format msgid " BIOS: %s" msgstr "" #: src/calc_73.c:1476 #, c-format msgid " HW: %i" msgstr "" #: src/calc_73.c:1477 src/calc_9x.c:1717 src/calc_9x.c:1749 #, c-format msgid " Battery: %s" msgstr "" #: src/calc_73.c:1477 src/type2str.c:340 msgid "good" msgstr "" #: src/calc_73.c:1477 src/type2str.c:340 msgid "low" msgstr "" #: src/calc_73.c:1549 src/calc_9x.c:1230 msgid "Header sent completely." msgstr "" #: src/calc_73.c:1562 msgid "Receiving certificate" msgstr "" #: src/calc_84p.c:1445 src/calc_84p.c:1595 #, c-format msgid "Could not determine clock type: %u %u" msgstr "" #: src/calc_84p.c:1454 msgid "Will set classic clock" msgstr "" #: src/calc_84p.c:1509 msgid "Will set new clock" msgstr "" #: src/calc_84p.c:1606 msgid "Found valid classic clock" msgstr "" #: src/calc_84p.c:1637 #, c-format msgid "Found classic clock but failed to retrieve its parameters: %u %u %u %u" msgstr "" #: src/calc_84p.c:1647 msgid "Found valid new clock" msgstr "" #: src/calc_84p.c:1662 #, c-format msgid "" "Found new clock but failed to retrieve its parameters: %u %u %u %u %u %u" msgstr "" #: src/calc_84p.c:1768 src/calc_89t.c:1189 msgid "Getting version..." msgstr "" #: src/calc_84p.c:2017 src/calc_84p.c:2026 src/calc_84p.c:2035 #: src/calc_84p.c:2051 src/calc_84p.c:2059 #, c-format msgid "Unhandled 84+ family member with product_id=%d hw_version=%d" msgstr "" #: src/calc_84p.c:2076 msgid "TI-84 Plus thru DirectLink" msgstr "" #: src/calc_84p.c:2147 msgid "TI-84 Plus C Silver Edition thru DirectLink" msgstr "" #: src/calc_84p.c:2218 msgid "TI-83 Premium CE thru DirectLink" msgstr "" #: src/calc_84p.c:2289 msgid "TI-84 Plus CE thru DirectLink" msgstr "" #: src/calc_84p.c:2360 msgid "TI-82 Advanced thru DirectLink" msgstr "" #: src/calc_84p.c:2431 msgid "TI-84 Plus T thru DirectLink" msgstr "" #: src/calc_8x.c:493 src/calc_8x.c:804 msgid "Waiting for user's action..." msgstr "" #: src/calc_8x.c:638 msgid "Waiting for backup..." msgstr "" #: src/calc_8x.c:1076 msgid "Waiting for var(s)..." msgstr "" #: src/calc_9x.c:353 src/calc_9x.c:441 src/calc_9x.c:580 #, c-format msgid "Name: %8s | Type: %8s | Attr: %i | Size: %08X" msgstr "" #: src/calc_9x.c:386 #, c-format msgid "Directory listing in %8s..." msgstr "" #: src/calc_9x.c:449 src/calc_9x.c:604 src/calc_89t.c:249 #, c-format msgid "Parsing %s/%s" msgstr "" #: src/calc_9x.c:699 #, c-format msgid "Block #%2i" msgstr "" #: src/calc_9x.c:1618 src/calc_89t.c:1096 src/calc_nsp.c:865 #, c-format msgid "Creating %s..." msgstr "" #: src/calc_9x.c:2010 msgid "V200 Personal Learning Tool" msgstr "" #: src/calc_89t.c:1031 src/calc_nsp.c:1034 #, c-format msgid "Renaming %s to %s..." msgstr "" #: src/calc_89t.c:1059 #, c-format msgid "Changing attributes of %s..." msgstr "" #: src/calc_89t.c:1416 msgid "TI-89 Titanium thru DirectLink" msgstr "" #: src/calc_nsp.c:232 #, c-format msgid "Unknown calculator model with %d bpp\n" msgstr "" #: src/calc_nsp.c:388 #, c-format msgid "Name: %s | Type: %8s | Attr: %i | Size: %08X" msgstr "" #: src/calc_nsp.c:421 #, c-format msgid "Not enumerating documents in %s because it's not a folder\n" msgstr "" #: src/calc_nsp.c:437 #, c-format msgid "Directory listing in <%s>...\n" msgstr "" #: src/calc_nsp.c:1057 msgid "Nspire thru DirectLink" msgstr "" #: src/calc_xx.c:91 msgid "Checking hand-held status:" msgstr "" #: src/calc_xx.c:125 #, c-format msgid "Sending key %08x:" msgstr "" #: src/calc_xx.c:162 #, c-format msgid "Executing %s/%s with %s:" msgstr "" #: src/calc_xx.c:199 msgid "Requesting screenshot:" msgstr "" #: src/calc_xx.c:297 msgid "Requesting folder & vars & apps listing:" msgstr "" #: src/calc_xx.c:351 msgid "Requesting RAM & FLASH free" msgstr "" #: src/calc_xx.c:386 msgid "Sending backup:" msgstr "" #: src/calc_xx.c:421 msgid "Requesting backup:" msgstr "" #: src/calc_xx.c:458 msgid "Sending one or more variables:" msgstr "" #: src/calc_xx.c:496 #, c-format msgid "Requesting variable '%s':" msgstr "" #: src/calc_xx.c:533 msgid "Sending variable (non-silent mode):" msgstr "" #: src/calc_xx.c:571 msgid "Receiving variable (non-silent mode):" msgstr "" #: src/calc_xx.c:606 msgid "Sending FLASH application:" msgstr "" #: src/calc_xx.c:643 msgid "Requesting receiving of FLASH application:" msgstr "" #: src/calc_xx.c:678 msgid "Sending FLASH os:" msgstr "" #: src/calc_xx.c:713 msgid "Requesting ID-LIST:" msgstr "" #: src/calc_xx.c:746 msgid "Sending ROM dumper:" msgstr "" #: src/calc_xx.c:782 msgid "Dumping ROM:" msgstr "" #: src/calc_xx.c:817 msgid "Setting clock:" msgstr "" #: src/calc_xx.c:852 msgid "Getting clock:" msgstr "" #: src/calc_xx.c:887 #, c-format msgid "Deleting variable '%s':" msgstr "" #: src/calc_xx.c:922 #, c-format msgid "Creating folder '%s':" msgstr "" #: src/calc_xx.c:957 msgid "Requesting version info:" msgstr "" #: src/calc_xx.c:992 msgid "Sending certificate:" msgstr "" #: src/calc_xx.c:1027 msgid "Requesting receiving of certificate:" msgstr "" #: src/calc_xx.c:1066 #, c-format msgid "Renaming variable '%s/%s' to '%s/%s':" msgstr "" #: src/calc_xx.c:1070 #, c-format msgid "Renaming variable '%s' to '%s':" msgstr "" #: src/calc_xx.c:1108 #, c-format msgid "Setting variable '%s' to %s:" msgstr "" #: src/calc_xx.c:1145 msgid "Sending fake (all vars) backup:" msgstr "" #: src/calc_xx.c:1180 msgid "Requesting fake (all vars) backup:" msgstr "" #: src/dirlist.c:194 #, c-format msgid "| B. name | T. name |Attr|Type| Size | Folder |\n" msgstr "" #: src/dirlist.c:204 #, c-format msgid "| No variables |\n" msgstr "" #: src/dirlist.c:208 #, c-format msgid "| No applications |\n" msgstr "" #: src/dirlist.c:212 #, c-format msgid "+------------------+----------+----+----+----------+----------+" msgstr "" #: src/error.c:72 msgid "Msg: transfer aborted." msgstr "" #: src/error.c:74 msgid "Cause: the user!" msgstr "" #: src/error.c:80 msgid "Msg: calculator is not ready." msgstr "" #: src/error.c:82 msgid "" "Cause: the calculator is busy (Var-Link menu, Window, ...). Press HOME..." msgstr "" #: src/error.c:88 msgid "Msg: checksum error." msgstr "" #: src/error.c:90 msgid "Cause: a transmission error. Try again." msgstr "" #: src/error.c:96 msgid "Msg: invalid host ID." msgstr "" #: src/error.c:98 msgid "" "Cause: received an unexpected Machine ID from calculator, probably due to a " "transmission error." msgstr "" #: src/error.c:104 msgid "Msg: invalid target ID." msgstr "" #: src/error.c:106 msgid "" "Cause: received an unexpected Target ID from calculator, probably due to a " "transmission error." msgstr "" #: src/error.c:112 msgid "Msg: invalid command ID." msgstr "" #: src/error.c:114 msgid "" "Cause: received an unexpected Command ID from calculator, probably due to a " "transmission error." msgstr "" #: src/error.c:120 msgid "Msg: not really an error, should not appear!" msgstr "" #: src/error.c:122 msgid "Cause: a bug. Drop us an email!" msgstr "" #: src/error.c:128 msgid "Msg: program or variable is incompatible with this OS version." msgstr "" #: src/error.c:130 msgid "" "Cause: this variable type may not be supported by the target calculator, or " "you may need to upgrade your calculator OS." msgstr "" #: src/error.c:136 msgid "Msg: contents has been refused." msgstr "" #: src/error.c:138 msgid "" "Cause: you attempted to send a variable which is locked/archived on the " "target calculator. The calculator may be out of memory. The certificate may " "be invalid or already installed." msgstr "" #: src/error.c:144 msgid "Invalid CTS packet." msgstr "" #: src/error.c:146 src/error.c:162 msgid "Cause: a transmission error." msgstr "" #: src/error.c:152 msgid "NACK received." msgstr "" #: src/error.c:154 msgid "Cause: the command has been refused." msgstr "" #: src/error.c:160 msgid "Invalid packet." msgstr "" #: src/error.c:171 msgid "The cable cannot be used." msgstr "" #: src/error.c:173 msgid "" "Cause: the cable has not been initialized due to a previous/current error." msgstr "" #: src/error.c:186 msgid "Msg: this function does not exist for this calculator." msgstr "" #: src/error.c:188 msgid "" "Cause: the operation you attempted is not supported by your calculator model." msgstr "" #: src/error.c:194 msgid "Msg: calculator out of memory." msgstr "" #: src/error.c:196 msgid "" "Cause: the calculator does not have memory enough for doing the operation." msgstr "" #: src/error.c:202 msgid "Msg: unable to open (reading) the file." msgstr "" #: src/error.c:204 src/error.c:212 msgid "Cause: disk space or permissions." msgstr "" #: src/error.c:210 msgid "Msg: unable to open (writing) the file." msgstr "" #: src/error.c:218 msgid "A transfer is in progress. You cannot start a new one." msgstr "" #: src/error.c:220 msgid "Cause: this should not happen. Probably a bug: drop us an email!" msgstr "" #: src/error.c:229 msgid "The requested var does not exist." msgstr "" #: src/error.c:231 msgid "" "Cause: you attempted to download a variable which does not exist on the " "calculator any longer. Maybe you have manually deleted it ?" msgstr "" #: src/error.c:237 msgid "There is nothing to backup." msgstr "" #: src/error.c:239 msgid "Cause: 0 variables stored onto your calculator." msgstr "" #: src/error.c:245 msgid "Invalid ticalcs handle." msgstr "" #: src/error.c:247 msgid "Cause: bad cable or calc model." msgstr "" #: src/error.c:253 msgid "Invalid parameter." msgstr "" #: src/error.c:255 msgid "" "Cause: if you see this in normal usage, a bug: drop us an email ! Otherwise, " "check the arguments you're passing to the function." msgstr "" #: src/error.c:261 msgid "Unknown screenshot format." msgstr "" #: src/error.c:263 msgid "Cause: a transmission error, or unsupported calculator version." msgstr "" #: src/error.c:269 msgid "Msg: hand-held returned an error." msgstr "" #: src/error.c:271 src/error.c:307 src/error.c:391 msgid "Cause: hand-held returned an uncaught error. Please report log." msgstr "" #: src/error.c:276 msgid "Msg: cannot delete application." msgstr "" #: src/error.c:280 msgid "Msg: invalid variable name." msgstr "" #: src/error.c:284 msgid "Msg: cannot overwrite variable (locked/archived)." msgstr "" #: src/error.c:288 msgid "Msg: cannot delete variable (locked/archived)." msgstr "" #: src/error.c:292 msgid "Msg: FLASH application rejected (bad target model)." msgstr "" #: src/error.c:296 msgid "Msg: malformed RTS packet (AMS version conflict)." msgstr "" #: src/error.c:300 src/error.c:380 msgid "Msg: FLASH application rejected (signature does not match)." msgstr "" #: src/error.c:305 src/error.c:389 msgid "Msg: hand-held returned an error (not caught)." msgstr "" #: src/error.c:312 msgid "Msg: invalid argument or name." msgstr "" #: src/error.c:316 msgid "Msg: cannot delete var/app from archive." msgstr "" #: src/error.c:320 msgid "Msg: transmission error." msgstr "" #: src/error.c:324 msgid "Msg: using basic mode while being in boot mode." msgstr "" #: src/error.c:328 src/error.c:396 msgid "Msg: out of memory." msgstr "" #: src/error.c:332 src/error.c:336 msgid "Msg: invalid name." msgstr "" #: src/error.c:340 msgid "Msg: busy?" msgstr "" #: src/error.c:344 msgid "Msg: can't overwrite, variable is locked." msgstr "" #: src/error.c:348 msgid "Msg: mode token too small." msgstr "" #: src/error.c:352 msgid "Msg: mode token too large." msgstr "" #: src/error.c:356 msgid "Msg: wrong size for parameter." msgstr "" #: src/error.c:360 msgid "Msg: invalid parameter ID." msgstr "" #: src/error.c:364 msgid "Msg: read-only parameter." msgstr "" #: src/error.c:368 msgid "Msg: wrong modify request?" msgstr "" #: src/error.c:372 msgid "Msg: remote control?" msgstr "" #: src/error.c:376 msgid "Msg: battery low." msgstr "" #: src/error.c:384 msgid "Msg: hand-held is busy (set your calculator to HOME screen)." msgstr "" #: src/error.c:400 msgid "Msg: OS installation failed. File is corrupted/wrong." msgstr "" #: src/error.c:405 msgid "Msg: packet too large." msgstr "" #: src/error.c:409 msgid "Msg: the variable or directory does not exist." msgstr "" #: src/error.c:413 msgid "Msg: the directory name is invalid." msgstr "" #: src/error.c:417 msgid "Msg: not currently listing a directory." msgstr "" #: src/error.c:421 msgid "Msg: no more files to list." msgstr "" #: src/error.c:425 msgid "Msg: the directory name already exists." msgstr "" #: src/error.c:430 msgid "Msg: the destination (folder or file) path is too long." msgstr "" #: src/error.c:434 msgid "Msg: the file name is invalid." msgstr "" #: src/error.c:438 msgid "Msg: no file extension." msgstr "" #: src/error.c:442 msgid "Msg: forbidden characters in folder name." msgstr "" #: src/error.c:452 msgid "Msg: OS upgrade type not recognized." msgstr "" #: src/error.c:456 msgid "Msg: anti-downgrade protection refuses this OS version." msgstr "" #: src/probe.c:91 msgid "Probing calculator...\n" msgstr "" #: src/probe.c:95 msgid "Check for TI86... " msgstr "" #: src/probe.c:119 msgid "Check for TI85... " msgstr "" #: src/probe.c:143 msgid "Check for TI73... " msgstr "" #: src/probe.c:167 msgid "Check for TI83... " msgstr "" #: src/probe.c:191 msgid "Check for TI82... " msgstr "" #: src/probe.c:217 msgid "Check for TI80... " msgstr "" #: src/probe.c:273 msgid "Check for TIXX... " msgstr "" #: src/probe.c:311 msgid "Check for TI92... " msgstr "" #: src/probe.c:355 msgid "Check for TI9X... " msgstr "" #: src/probe.c:370 msgid "Check for TI8X... " msgstr "" #: src/probe.c:385 #, c-format msgid "Calculator type: %s" msgstr "" #: src/ticalcs.c:238 #, c-format msgid "ticalcs library version %s" msgstr "" #: src/ticalcs.c:396 msgid "Link calc handle details:" msgstr "" #: src/ticalcs.c:397 #, c-format msgid " model : %s" msgstr "" #: src/type2str.c:62 src/type2str.c:72 src/type2str.c:94 src/type2str.c:104 msgid "full" msgstr "" #: src/type2str.c:63 src/type2str.c:76 msgid "clipped" msgstr "" #: src/type2str.c:64 src/type2str.c:96 src/type2str.c:128 msgid "unknown" msgstr "" #: src/type2str.c:95 src/type2str.c:108 msgid "local" msgstr "" #: src/type2str.c:126 src/type2str.c:136 msgid "free" msgstr "" #: src/type2str.c:127 src/type2str.c:140 msgid "used" msgstr "" #: src/type2str.c:293 msgid "Product Name: " msgstr "" #: src/type2str.c:295 msgid "Product ID: " msgstr "" #: src/type2str.c:297 msgid "Language ID: " msgstr "" #: src/type2str.c:300 msgid "Device Type: " msgstr "" #: src/type2str.c:302 msgid "Hardware Version: " msgstr "" #: src/type2str.c:304 msgid "Boot Version: " msgstr "" #: src/type2str.c:306 msgid "Boot2 Version: " msgstr "" #: src/type2str.c:308 msgid "OS Version: " msgstr "" #: src/type2str.c:310 msgid "Run level: " msgstr "" #: src/type2str.c:312 msgid "Clock speed: " msgstr "" #: src/type2str.c:314 msgid "Exact math engine: " msgstr "" #: src/type2str.c:315 msgid "Yes" msgstr "" #: src/type2str.c:315 msgid "No" msgstr "" #: src/type2str.c:317 msgid "LCD width: " msgstr "" #: src/type2str.c:319 msgid "LCD height: " msgstr "" #: src/type2str.c:321 msgid "Bits per pixel: " msgstr "" #: src/type2str.c:323 msgid "Color screen: " msgstr "" #: src/type2str.c:326 msgid "Physical RAM: " msgstr "" #: src/type2str.c:328 msgid "User RAM: " msgstr "" #: src/type2str.c:330 msgid "Free RAM: " msgstr "" #: src/type2str.c:332 msgid "Physical Flash: " msgstr "" #: src/type2str.c:334 msgid "User Flash: " msgstr "" #: src/type2str.c:336 msgid "Free Flash: " msgstr "" #: src/type2str.c:339 msgid "Battery: " msgstr "" libticalcs-1.1.9+dfsg/po/quot.sed000066400000000000000000000002311327711501700166550ustar00rootroot00000000000000s/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g libticalcs-1.1.9+dfsg/po/remove-potcdate.sin000066400000000000000000000006601327711501700210070ustar00rootroot00000000000000# Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } libticalcs-1.1.9+dfsg/po/stamp-po000066400000000000000000000000121327711501700166500ustar00rootroot00000000000000timestamp libticalcs-1.1.9+dfsg/src/000077500000000000000000000000001327711501700153455ustar00rootroot00000000000000libticalcs-1.1.9+dfsg/src/Makefile.am000066400000000000000000000071101327711501700174000ustar00rootroot00000000000000## Process this file with automake to produce Makefile.in AM_CFLAGS = -Wall -W SUBDIRS = tf2hex romdump_8x romdump_84p_usb romdump_834pce_usb romdump_9x romdump_89t_usb # libraries and files to compile and install lib_LTLIBRARIES = libticalcs2.la libticalcsincludedir = $(includedir)/tilp2 libticalcsinclude_HEADERS = \ ticalcs.h export3.h stdints3.h \ keys73.h keys83.h keys83p.h keys86.h keys89.h keys92p.h \ dbus_pkt.h dusb_rpkt.h dusb_vpkt.h dusb_cmd.h nsp_vpkt.h nsp_cmd.h \ cmdz80.h cmd68k.h # build instructions libticalcs2_la_CPPFLAGS = -I$(top_srcdir)/intl \ -DLOCALEDIR=\"$(datadir)/locale\" \ @GLIB_CFLAGS@ @TICABLES_CFLAGS@ @TIFILES_CFLAGS@ @TICONV_CFLAGS@ -DTICALCS_EXPORTS libticalcs2_la_LIBADD = @GLIB_LIBS@ @LTLIBINTL@ \ @TICABLES_LIBS@ @TIFILES_LIBS@ @TICONV_LIBS@ libticalcs2_la_LDFLAGS = -no-undefined -version-info @LT_LIBVERSION@ libticalcs2_la_SOURCES = *.h \ backup.c \ calc_00.c calc_xx.c \ calc_73.c calc_8x.c calc_9x.c \ calc_84p.c calc_89t.c \ calc_nsp.c \ clock.c \ cmdz80.c cmd68k.c dusb_cmd.c nsp_cmd.c \ dirlist.c \ error.c \ keys73.c keys83.c keys83p.c keys86.c keys89.c keys92p.c \ dbus_pkt.c \ dusb_rpkt.c dusb_vpkt.c \ nsp_rpkt.c nsp_vpkt.c \ probe.c \ romdump.c \ screen.c \ ticalcs.c \ tikeys.c \ type2str.c \ update.c if OS_WIN32 libticalcs2_la_DEPENDENCIES = ../build/mingw/ticalcs2-rc.o libticalcs2_la_LDFLAGS += -Wl,../build/mingw/ticalcs2-rc.o -Wl,--output-def,libticalcs2.def EXTRA_DIST = libticalcs2.def endif tf2hex = ./tf2hex/tf2hex BUILT_SOURCES = if BUILD_Z80_ROM_DUMPERS BUILT_SOURCES += rom73.h rom82.h rom83.h rom83p.h rom84p.h rom84pc.h rom84pcu.h rom834pceu.h rom85.h rom86.h rom73.h: romdump_8x/dump73.73p $(tf2hex) $(tf2hex) romdump_8x/dump73.73p $(srcdir)/rom73.h 73 rom82.h: romdump_8x/dump82.82y $(tf2hex) $(tf2hex) romdump_8x/dump82.82y $(srcdir)/rom82.h 82 rom83.h: romdump_8x/dump83.83p $(tf2hex) $(tf2hex) romdump_8x/dump83.83p $(srcdir)/rom83.h 83 rom83p.h: romdump_8x/dump83p.8xp $(tf2hex) $(tf2hex) romdump_8x/dump83p.8xp $(srcdir)/rom83p.h 8Xp rom84pc.h: romdump_8x/dump84pc.8xp $(tf2hex) $(tf2hex) romdump_8x/dump84pc.8xp $(srcdir)/rom84pc.h 84pc rom85.h: romdump_8x/dump85.85s $(tf2hex) $(tf2hex) romdump_8x/dump85.85s $(srcdir)/rom85.h 85 rom86.h: romdump_8x/dump86.86p $(tf2hex) $(tf2hex) romdump_8x/dump86.86p $(srcdir)/rom86.h 86 romdump_8x/dump73.73p romdump_8x/dump82.82y romdump_8x/dump83.83p romdump_8x/dump83p.8xp romdump_8x/dump85.85s romdump_8x/dump86.86p romdump_8x/dump84pc.8xp: cd romdump_8x && $(MAKE) rom84p.h: romdump_84p_usb/dump84p.8xp $(tf2hex) $(tf2hex) romdump_84p_usb/dump84p.8xp $(srcdir)/rom84p.h 84p rom84pcu.h: romdump_84p_usb/dump84pcu.8xp $(tf2hex) $(tf2hex) romdump_84p_usb/dump84pcu.8xp $(srcdir)/rom84pcu.h 84pcu romdump_84p_usb/dump84p.8xp romdump_84p_usb/dump84pcu.8xp: cd romdump_84p_usb && $(MAKE) rom834pceu.h: romdump_834pce_usb/dump834pceu.8xp $(tf2hex) $(tf2hex) romdump_834pce_usb/dump834pceu.8xp $(srcdir)/rom834pceu.h 834pceu romdump_834pce_usb/dump834pceu.8xp: cd romdump_834pce_usb && $(MAKE) endif if BUILD_68K_ROM_DUMPERS BUILT_SOURCES += rom89.h rom89t.h rom92f2.h rom89.h: romdump_9x/romdump.89z $(tf2hex) $(tf2hex) romdump_9x/romdump.89z $(srcdir)/rom89.h 89 rom89t.h: romdump_89t_usb/romdump.89z $(tf2hex) $(tf2hex) romdump_89t_usb/romdump.89z $(srcdir)/rom89t.h 89t rom92f2.h: romdump_9x/romdump.92p $(tf2hex) $(tf2hex) romdump_9x/romdump.92p $(srcdir)/rom92f2.h 92 romdump_9x/romdump.89z: cd romdump_9x && $(MAKE) romdump_9x/romdump.92p: romdump_9x/romdump.89z cd romdump_9x && $(MAKE) romdump_89t_usb/romdump.89z: cd romdump_89t_usb && $(MAKE) endif libticalcs-1.1.9+dfsg/src/backup.c000066400000000000000000000235251327711501700167650ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: link_nul.c 1059 2005-05-14 09:45:42Z roms $ */ /* libticalcs2 - hand-helds support library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Pseudo-backup support (common). */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "ticalcs.h" #include "internal.h" #include "logging.h" #include "error.h" #include "cmd68k.h" int tixx_recv_all_vars_backup(CalcHandle* handle, FileContent* content) { int i, j, k; int i_max; GNode *vars, *apps; int nvars, ivars = 0; int b = 0; FileContent **group; FileContent *single; int ret; VALIDATE_HANDLE(handle); if (content == NULL) { ticalcs_critical("tixx_recv_backup: content is NULL"); return -1; } VALIDATE_CALCFNCTS(handle->calc); // Do a directory list and check for something to backup ret = handle->calc->get_dirlist(handle, &vars, &apps); if (ret) { return ret; } nvars = ticalcs_dirlist_ve_count(vars); if (!nvars) { return ERR_NO_VARS; } update_->cnt2 = update_->cnt3 = 0; update_->max2 = update_->max3 = nvars; update_->pbar(); // Check whether the last folder is empty b = g_node_n_children(g_node_nth_child(vars, g_node_n_children(vars) - 1)); PAUSE(100); // needed by TI84+/USB // Create a group file k = 0; group = tifiles_content_create_group(nvars); // Receive all vars except for FLASH apps i_max = g_node_n_children(vars); for (i = 0; i < i_max; i++) { GNode *parent = g_node_nth_child(vars, i); int j_max = g_node_n_children(parent); for (j = 0; j < j_max; j++) { GNode *node = g_node_nth_child(parent, j); VarEntry *ve = (VarEntry *) (node->data); update_->cnt2 = update_->cnt3 = ++ivars; update_->pbar(); // we need to group files ! ret = handle->calc->is_ready(handle); if (ret) { goto end; } group[k] = tifiles_content_create_regular(handle->model); ret = handle->calc->recv_var(handle, 0, group[k++], ve); if (ret) { goto end; } } } end: ticalcs_dirlist_destroy(&vars); ticalcs_dirlist_destroy(&apps); if (!ret) { FileContent * cnt; ret = tifiles_group_contents(group, &cnt); if (!ret) { cnt->model = content->model; // Steal contents of cnt, then clean up. memcpy(content, cnt, sizeof(*content)); cnt->num_entries = 0; cnt->entries = NULL; tifiles_content_delete_regular(cnt); ticalcs_strlcpy(content->comment, tifiles_comment_set_group(), sizeof(content->comment)); } } tifiles_content_delete_group(group); return ret; } /* Pseudo full-backup support (common). */ /** * ticalcs_calc_send_tigroup: * @handle: a previously allocated handle * @filename: name of file * @mode: which vars/apps to send * * Send a TiGroup file. * * Return value: 0 if ready else ERR_NOT_READY. **/ TIEXPORT3 int TICALL ticalcs_calc_send_tigroup(CalcHandle* handle, TigContent* content, TigMode mode) { TigEntry **ptr; GNode *vars, *apps; int nvars = 0; int napps = 0; int ret; VALIDATE_HANDLE(handle); if (content == NULL) { ticalcs_critical("ticalcs_calc_send_tigroup: content is NULL"); return -1; } VALIDATE_CALCFNCTS(handle->calc); ret = handle->calc->get_dirlist(handle, &vars, &apps); if (ret) { return ret; } if ((mode & TIG_RAM) || (mode & TIG_ARCHIVE)) { nvars = content->n_vars; } if (mode & TIG_FLASH) { napps = content->n_apps; } update_->cnt3 = 0; update_->max3 = nvars + napps; update_->pbar(); if ((handle->model == CALC_TI89 || handle->model == CALC_TI92P || handle->model == CALC_TI89T || handle->model == CALC_V200) && (mode & TIG_BACKUP)) { // erase memory ret = ti89_send_VAR(handle, 0, TI89_BKUP, "main"); if (!ret) { ret = ti89_recv_ACK(handle, NULL); if (!ret) { ret = ti89_recv_CTS(handle); if (!ret) { ret = ti89_send_ACK(handle); if (!ret) { ret = ti89_send_EOT(handle); if (!ret) { ret = ti89_recv_ACK(handle, NULL); } } } } } } if (!ret) { // Send vars if ((mode & TIG_RAM) || (mode & TIG_ARCHIVE)) { for (ptr = content->var_entries; *ptr; ptr++) { TigEntry *te = *ptr; update_->cnt3++; update_->pbar(); if ((te->content.regular->entries[0]->attr == ATTRB_ARCHIVED) && !(mode & TIG_ARCHIVE)) { continue; } if ((te->content.regular->entries[0]->attr != ATTRB_ARCHIVED) && !(mode & TIG_RAM)) { continue; } ret = handle->calc->send_var(handle, MODE_BACKUP, te->content.regular); if (ret) { break; } } } if (!ret) { ret = handle->calc->is_ready(handle); if (!ret) { // Send apps if (mode & TIG_FLASH) { for (ptr = content->app_entries; *ptr; ptr++) { TigEntry *te = *ptr; VarEntry ve; update_->cnt3++; update_->pbar(); // can't overwrite apps so check before sending app memset(&ve, 0, sizeof(VarEntry)); ticalcs_strlcpy(ve.name, te->content.flash->name, sizeof(ve.name)); if (!ticalcs_dirlist_ve_exist(apps, &ve)) { ret = handle->calc->send_app(handle, te->content.flash); if (ret) { break; } } } } } } } ticalcs_dirlist_destroy(&vars); ticalcs_dirlist_destroy(&apps); return ret; } /** * ticalcs_calc_recv_tigroup: * @handle: a previously allocated handle * @filename: name of file * @mode: which vars/apps to receive * * Receive a TiGroup file. * * Return value: 0 if ready else ERR_NOT_READY. **/ TIEXPORT3 int TICALL ticalcs_calc_recv_tigroup(CalcHandle* handle, TigContent* content, TigMode mode) { int i, j; GNode *vars, *apps; int nvars = 0; int napps = 0; int b = 0; int ret; VALIDATE_HANDLE(handle); if (content == NULL) { ticalcs_critical("ticalcs_calc_send_tigroup: content is NULL"); return -1; } VALIDATE_CALCFNCTS(handle->calc); update_->cnt3 = 0; update_->pbar(); // Do a directory list and check for something to backup ret = handle->calc->get_dirlist(handle, &vars, &apps); if (ret) { return ret; } if ((mode & TIG_RAM) || (mode & TIG_ARCHIVE)) { nvars = ticalcs_dirlist_ve_count(vars); } if (mode & TIG_FLASH) { napps = ticalcs_dirlist_ve_count(apps); } update_->cnt3 = 0; update_->max3 = nvars + napps; update_->pbar(); if (!nvars && !napps) { ret = ERR_NO_VARS; // THIS RETURNS ! goto end; } // Check whether the last folder is empty b = g_node_n_children(g_node_nth_child(vars, g_node_n_children(vars) - 1)); PAUSE(100); // needed by TI84+/USB // Receive all vars if ((mode & TIG_RAM) || (mode & TIG_ARCHIVE)) { int i_max = g_node_n_children(vars); for (i = 0; i < i_max; i++) { GNode *parent = g_node_nth_child(vars, i); int j_max = g_node_n_children(parent); for (j = 0; j < j_max; j++) { GNode *node = g_node_nth_child(parent, j); VarEntry *ve = (VarEntry *) (node->data); TigEntry *te; PAUSE(100); ret = handle->calc->is_ready(handle); if (ret) { goto end; } PAUSE(100); update_->cnt3++; update_->pbar(); if (((mode & TIG_ARCHIVE) && (ve->attr == ATTRB_ARCHIVED)) || ((mode & TIG_RAM) && ve->attr != ATTRB_ARCHIVED)) { char *filename; char *varname = ticonv_varname_to_filename(handle->model, ve->name, ve->type); char *fldname = ticonv_varname_to_filename(handle->model, ve->folder, -1); if (handle->calc->features & FTS_FOLDER) { filename = g_strconcat(fldname, ".", varname, ".", tifiles_vartype2fext(handle->model, ve->type), NULL); } else { filename = g_strconcat(varname, ".", tifiles_vartype2fext(handle->model, ve->type), NULL); } g_free(varname); g_free(fldname); te = tifiles_te_create(filename, TIFILE_SINGLE, handle->model); g_free(filename); if (te != NULL) { ret = handle->calc->recv_var(handle, 0, te->content.regular, ve); if (ret) { tifiles_te_delete(te); goto end; } tifiles_content_add_te(content, te); } else { ret = ERR_MALLOC; goto end; } } } } } // Receive all apps if (mode & TIG_FLASH) { int i_max = g_node_n_children(apps); for(i = 0; i < i_max; i++) { GNode *parent = g_node_nth_child(apps, i); int j_max = g_node_n_children(parent); for (j = 0; j < j_max; j++) { GNode *node = g_node_nth_child(parent, j); VarEntry *ve = (VarEntry *) (node->data); TigEntry *te; char *filename; char *basename; ret = handle->calc->is_ready(handle); if (ret) { goto end; } update_->cnt3++; update_->pbar(); basename = ticonv_varname_to_filename(handle->model, ve->name, ve->type); filename = g_strconcat(basename, ".", tifiles_vartype2fext(handle->model, ve->type), NULL); g_free(basename); te = tifiles_te_create(filename, TIFILE_FLASH, handle->model); g_free(filename); if (te != NULL) { ret = handle->calc->recv_app(handle, te->content.flash, ve); if (ret) { tifiles_te_delete(te); goto end; } tifiles_content_add_te(content, te); } else { ret = ERR_MALLOC; goto end; } } } } end: ticalcs_dirlist_destroy(&apps); ticalcs_dirlist_destroy(&vars); return ret; } libticalcs-1.1.9+dfsg/src/calc_00.c000066400000000000000000000136201327711501700167140ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs2 - hand-helds support library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Initialize the LinkCable structure with default functions */ /* This module can be used as sample code.*/ #ifdef HAVE_CONFIG_H #include #endif #include #include "ticalcs.h" #include "gettext.h" #include "internal.h" int noop_is_ready (CalcHandle* handle) { (void)handle; return 0; } int noop_send_key (CalcHandle* handle, uint32_t key) { (void)handle, (void)key; return 0; } int noop_execute (CalcHandle* handle, VarEntry *ve, const char* args) { (void)handle, (void)ve, (void)args; return 0; } int noop_recv_screen (CalcHandle* handle, CalcScreenCoord* sc, uint8_t** bitmap) { (void)handle, (void)sc, (void)bitmap; return 0; } int noop_get_dirlist (CalcHandle* handle, GNode** vars, GNode** apps) { (void)handle, (void)vars, (void)apps; return 0; } int noop_get_memfree (CalcHandle* handle, uint32_t* ram, uint32_t* flash) { (void)handle, (void)ram, (void)flash; return 0; } int noop_send_backup (CalcHandle* handle, BackupContent* content) { (void)handle, (void)content; return 0; } int noop_recv_backup (CalcHandle* handle, BackupContent* content) { (void)handle, (void)content; return 0; } int noop_send_var (CalcHandle* handle, CalcMode mode, FileContent* content) { (void)handle, (void)mode, (void)content; return 0; } int noop_recv_var (CalcHandle* handle, CalcMode mode, FileContent* content, VarRequest* vr) { (void)handle, (void)mode, (void)content, (void)vr; return 0; } int noop_send_var_ns (CalcHandle* handle, CalcMode mode, FileContent* content) { (void)handle, (void)mode, (void)content; return 0; } int noop_recv_var_ns (CalcHandle* handle, CalcMode mode, FileContent* content, VarEntry** ve) { (void)handle, (void)mode, (void)content, (void)ve; return 0; } int noop_send_flash (CalcHandle* handle, FlashContent* content) { (void)handle, (void)content; return 0; } int noop_recv_flash (CalcHandle* handle, FlashContent* content, VarRequest* vr) { (void)handle, (void)content, (void)vr; return 0; } int noop_send_os (CalcHandle* handle, FlashContent* content) { (void)handle, (void)content; return 0; } int noop_recv_idlist (CalcHandle* handle, uint8_t* idlist) { (void)handle, (void)idlist; return 0; } int noop_dump_rom_1 (CalcHandle* handle) { (void)handle; return 0; } int noop_dump_rom_2 (CalcHandle* handle, CalcDumpSize size, const char *filename) { (void)handle, (void)size, (void)filename; return 0; } int noop_set_clock (CalcHandle* handle, CalcClock* _clock) { (void)handle, (void)_clock; return 0; } int noop_get_clock (CalcHandle* handle, CalcClock* _clock) { (void)handle, (void)_clock; return 0; } int noop_del_var (CalcHandle* handle, VarRequest* vr) { (void)handle, (void)vr; return 0; } int noop_new_folder (CalcHandle* handle, VarRequest* vr) { (void)handle, (void)vr; return 0; } int noop_get_version (CalcHandle* handle, CalcInfos* infos) { (void)handle, (void)infos; return 0; } int noop_send_cert (CalcHandle* handle, FlashContent* content) { (void)handle, (void)content; return 0; } int noop_recv_cert (CalcHandle* handle, FlashContent* content) { (void)handle, (void)content; return 0; } int noop_rename_var (CalcHandle* handle, VarRequest* oldname, VarRequest* newname) { (void)handle, (void)oldname, (void)newname; return 0; } int noop_change_attr (CalcHandle* handle, VarRequest* vr, FileAttr attr) { (void)handle, (void)vr, (void)attr; return 0; } int noop_send_all_vars_backup (CalcHandle* handle, FileContent* content) { (void)handle, (void)content; return 0; } int noop_recv_all_vars_backup (CalcHandle* handle, FileContent* content) { (void)handle, (void)content; return 0; } const CalcFncts calc_00 = { CALC_NONE, "NONE", N_("Dummy hand-held"), N_("Dummy hand-held used when no calc is set"), FTS_NONE, PRODUCT_ID_NONE, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "", /* recv_screen */ "", /* get_dirlist */ "", /* get_memfree */ "", /* send_backup */ "", /* recv_backup */ "", /* send_var */ "", /* recv_var */ "", /* send_var_ns */ "", /* recv_var_ns */ "", /* send_app */ "", /* recv_app */ "", /* send_os */ "", /* recv_idlist */ "", /* dump_rom_1 */ "", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "", /* del_var */ "", /* new_folder */ "", /* get_version */ "", /* send_cert */ "", /* recv_cert */ "", /* rename */ "", /* chattr */ "", /* send_all_vars_backup */ "" /* recv_all_vars_backup */ }, &noop_is_ready, &noop_send_key, &noop_execute, &noop_recv_screen, &noop_get_dirlist, &noop_get_memfree, &noop_send_backup, &noop_recv_backup, &noop_send_var, &noop_recv_var, &noop_send_var_ns, &noop_recv_var_ns, &noop_send_flash, &noop_recv_flash, &noop_send_os, &noop_recv_idlist, &noop_dump_rom_1, &noop_dump_rom_2, &noop_set_clock, &noop_get_clock, &noop_del_var, &noop_new_folder, &noop_get_version, &noop_send_cert, &noop_recv_cert, &noop_rename_var, &noop_change_attr, &noop_send_all_vars_backup, &noop_recv_all_vars_backup }; libticalcs-1.1.9+dfsg/src/calc_73.c000066400000000000000000001136601327711501700167330ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: link_nul.c 1059 2005-05-14 09:45:42Z roms $ */ /* libticalcs2 - hand-helds support library, a part of the TiLP project * Copyright (c) 1999-2005 Romain Liévin * Copyright (c) 2005 Benjamin Moody (ROM dumper) * Copyright (c) 2006 Tyler Cassidy * Copyright (C) 2006 Kevin Kofler * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* TI73/TI83+/TI84+ support. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "ticalcs.h" #include "gettext.h" #include "internal.h" #include "logging.h" #include "error.h" #include "dbus_pkt.h" #include "cmdz80.h" #include "rom73.h" #include "rom83p.h" #include "rom84pc.h" #include "romdump.h" #include "keys83p.h" #define SEND_RDY ti73_send_RDY #define SEND_KEY ti73_send_KEY #define SEND_SCR ti73_send_SCR #define SEND_ACK ti73_send_ACK #define SEND_VAR ti73_send_VAR #define SEND_VAR2 ti73_send_VAR2 #define SEND_XDP ti73_send_XDP #define SEND_REQ ti73_send_REQ #define SEND_REQ2 ti73_send_REQ2 #define SEND_RTS ti73_send_RTS #define SEND_CTS ti73_send_CTS #define SEND_DEL ti73_send_DEL #define SEND_VER ti73_send_VER #define SEND_EOT ti73_send_EOT #define RECV_ACK ti73_recv_ACK #define RECV_VAR ti73_recv_VAR #define RECV_VAR2 ti73_recv_VAR2 #define RECV_XDP ti73_recv_XDP #define RECV_SKP ti73_recv_SKP #define RECV_CTS ti73_recv_CTS // Screen coordinates of the TI83+ #define TI73_ROWS 64 #define TI73_COLS 96 #define TI84PC_ROWS 240 #define TI84PC_COLS 320 static int is_ready (CalcHandle* handle) { int ret; uint16_t status; ret = SEND_RDY(handle); if (!ret) { ret = RECV_ACK(handle, &status); if (!ret) { ret = (MSB(status) & 0x01) ? ERR_NOT_READY : 0; } } return ret; } static int send_key (CalcHandle* handle, uint32_t key) { int ret; uint16_t status; ret = SEND_KEY(handle, (uint16_t)key); if (!ret) { ret = RECV_ACK(handle, &status); // when the key is received if (!ret) { ret = RECV_ACK(handle, NULL); // after it completes the resulting action } } return ret; } static int execute (CalcHandle* handle, VarEntry *ve, const char* args) { int ret; if (handle->model == CALC_TI73 && ve->type == TI73_ASM) { return ERR_VOID_FUNCTION; } // Go back to homescreen PAUSE(200); ret = send_key(handle, KEY83P_Quit); if (!ret) { ret = send_key(handle, KEY83P_Clear); if (!ret) { ret = send_key(handle, KEY83P_Clear); } } if (!ret) { // Launch program by remote control if (ve->type == TI83p_ASM) { ret = send_key(handle, KEY83P_Asm); } if (!ret) { ret = send_key(handle, KEY83P_Exec); if (!ret) { unsigned int i; for (i = 0; !ret && i < strlen(ve->name); i++) { const CalcKey *ck = ticalcs_keys_83p((ve->name)[i]); ret = send_key(handle, (uint32_t)(ck->normal.value)); } if (!ret) { ret = send_key(handle, KEY83P_Enter); PAUSE(200); } } } } return ret; } static int recv_screen (CalcHandle* handle, CalcScreenCoord* sc, uint8_t** bitmap) { int ret; uint8_t *buffer = handle->buffer2; uint8_t *data = NULL; data = (uint8_t *)ticalcs_alloc_screen(65537U); if (data == NULL) { return ERR_MALLOC; } ret = SEND_SCR(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { uint16_t pktsize; ret = RECV_XDP(handle, &pktsize, data); if (!ret || ret == ERR_CHECKSUM) // problem with checksum { ret = SEND_ACK(handle); if (!ret) { if (pktsize == TI73_COLS * TI73_ROWS / 8) { /* TI-73 / 83+ / 84+ */ sc->width = TI73_COLS; sc->height = TI73_ROWS; sc->clipped_width = TI73_COLS; sc->clipped_height = TI73_ROWS; sc->pixel_format = CALC_PIXFMT_MONO; *bitmap = ticalcs_realloc_screen(data, TI73_COLS * TI73_ROWS / 8); } else { /* TI-84+CSE */ uint32_t size = pktsize; sc->width = TI84PC_COLS; sc->height = TI84PC_ROWS; sc->clipped_width = TI84PC_COLS; sc->clipped_height = TI84PC_ROWS; sc->pixel_format = CALC_PIXFMT_RGB_565_LE; while (1) { ret = RECV_XDP(handle, &pktsize, buffer); if (ret == ERR_EOT) { ret = SEND_ACK(handle); break; } *bitmap = ticalcs_realloc_screen(data, size + pktsize); if (*bitmap != NULL) { data = *bitmap; memcpy(data + size, buffer, pktsize); size += pktsize; ret = SEND_ACK(handle); if (ret) { break; } update_->max1 = TI84PC_COLS * TI84PC_ROWS * 2; update_->cnt1 = size; update_->pbar(); } else { ticalcs_free_screen(data); ret = ERR_MALLOC; break; } } if (!ret) { *bitmap = ticalcs_alloc_screen(TI84PC_ROWS * TI84PC_COLS * 2); ret = ticalcs_screen_84pcse_rle_uncompress(data, size, *bitmap, TI84PC_ROWS * TI84PC_COLS * 2); } } } } } } if (ret) { ticalcs_free_screen(*bitmap); *bitmap = NULL; } return ret; } static int get_dirlist (CalcHandle* handle, GNode** vars, GNode** apps) { int ret; TreeInfo *ti; GNode *folder, *root, *node; uint16_t unused; uint32_t memory; char *utf8; ret = dirlist_init_trees(handle, vars, apps); if (ret) { return ret; } ti = (*vars)->data; ret = SEND_REQ(handle, 0x0000, TI73_DIR, "\0\0\0\0\0\0\0", 0x00, 0x00); if (!ret) { ret = RECV_ACK(handle, &unused); if (!ret) { ret = RECV_XDP(handle, &unused, handle->buffer2); if (!ret) { ret = SEND_ACK(handle); if (!ret) { uint8_t * mem = (uint8_t *)handle->buffer2; memory = (((uint32_t)(mem[1])) << 8) | mem[0]; // Clamp mem_free to a 16-bit value. } } } } if (ret) { return ret; } ti->mem_free = memory; folder = dirlist_create_append_node(NULL, vars); if (!folder) { return ERR_MALLOC; } root = dirlist_create_append_node(NULL, apps); if (!root) { return ERR_MALLOC; } // Add permanent variables (Window, RclWindow, TblSet aka WINDW, ZSTO, TABLE) { VarEntry *ve; ve = tifiles_ve_create(); ve->type = TI84p_WINDW; node = dirlist_create_append_node(ve, &folder); if (node != NULL) { if (handle->model != CALC_TI73) { ve = tifiles_ve_create(); ve->type = TI84p_ZSTO; node = dirlist_create_append_node(ve, &folder); } if (node != NULL) { ve = tifiles_ve_create(); ve->type = TI84p_TABLE; node = dirlist_create_append_node(ve, &folder); } } } if (!node) { return ERR_MALLOC; } for (;;) { VarEntry *ve = tifiles_ve_create(); uint16_t ve_size; int ret2; ret = RECV_VAR(handle, &ve_size, &ve->type, ve->name, &ve->attr, &ve->version); ve->size = ve_size; ret2 = SEND_ACK(handle); if (ret) { if (ret == ERR_EOT) { ret = 0; } error: tifiles_ve_delete(ve); break; } if (ret2) { ret = ret2; goto error; } if (ve->type == TI73_APPL) { /* Size is reported as a number of pages -- compute amount of space consumed (the actual application may be somewhat smaller.) Note: the MSB of the "size" word is the application's starting page number. */ ve->size = (ve->size & 0xff) * 0x4000; } node = dirlist_create_append_node(ve, (ve->type != TI73_APPL) ? &folder : &root); if (!node) { return ERR_MALLOC; } utf8 = ticonv_varname_to_utf8(handle->model, ve->name, ve->type); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Parsing %s"), utf8); ticonv_utf8_free(utf8); update_label(); } return ret; } static int get_memfree (CalcHandle* handle, uint32_t* ram, uint32_t* flash) { int ret; uint16_t unused; *ram = -1; *flash = -1; ret = SEND_REQ(handle, 0x0000, TI73_DIR, "\0\0\0\0\0\0\0", 0x00, 0x00); if (!ret) { ret = RECV_ACK(handle, &unused); if (!ret) { ret = RECV_XDP(handle, &unused, handle->buffer2); if (!ret) { ret = SEND_EOT(handle); if (!ret) { uint8_t * mem = (uint8_t *)handle->buffer2; *ram = (((uint32_t)(mem[1])) << 8) | mem[0]; // Clamp mem_free to a 16-bit value. } } } } return ret; } static int send_backup (CalcHandle* handle, BackupContent* content) { int ret; uint16_t length; char varname[9]; uint8_t rej_code; uint16_t status; length = content->data_length1; varname[0] = LSB(content->data_length2); varname[1] = MSB(content->data_length2); varname[2] = LSB(content->data_length3); varname[3] = MSB(content->data_length3); varname[4] = LSB(content->mem_address); varname[5] = MSB(content->mem_address); varname[6] = 0; varname[7] = 0; varname[8] = 0; do { ret = SEND_RTS(handle, content->data_length1, TI73_BKUP, varname, 0x00, content->version); if (!ret) { ret = RECV_ACK(handle, &status); if (!ret) { ret = RECV_SKP(handle, &rej_code); if (!ret) { ret = SEND_ACK(handle); } } } if (!ret) { switch (rej_code) { case DBUS_REJ_EXIT: case DBUS_REJ_SKIP: return ERR_ABORT; case DBUS_REJ_MEMORY: return ERR_OUT_OF_MEMORY; case DBUS_REJ_VERSION: return ERR_VAR_VERSION; case 0: // CTS break; default: return ERR_VAR_REJECTED; } update_->cnt2 = 0; update_->max2 = 3; update_->pbar(); ret = SEND_XDP(handle, content->data_length1, content->data_part1); if (!ret) { ret = RECV_ACK(handle, &status); } if (ret) { break; } update_->cnt2++; update_->pbar(); ret = SEND_XDP(handle, content->data_length2, content->data_part2); if (!ret) { ret = RECV_ACK(handle, &status); } if (ret) { break; } update_->cnt2++; update_->pbar(); ret = SEND_XDP(handle, content->data_length3, content->data_part3); if (!ret) { ret = RECV_ACK(handle, &status); } if (ret) { break; } update_->cnt2++; update_->pbar(); ret = SEND_ACK(handle); } } while(0); return ret; } static int recv_backup (CalcHandle* handle, BackupContent* content) { int ret; char varname[9]; uint8_t attr, ver; content->model = handle->model; ticalcs_strlcpy(content->comment, tifiles_comment_set_backup(), sizeof(content->comment)); varname[0] = 0; ret = SEND_REQ(handle, 0x0000, TI73_BKUP, "\0\0\0\0\0\0\0", 0x00, 0x00); if (!ret) { ret = RECV_ACK(handle, NULL); } if (ret) { return ret; } do { ret = RECV_VAR(handle, &content->data_length1, &content->type, varname, &attr, &ver); if (ret) { break; } content->data_length2 = (uint8_t)varname[0] | (((uint16_t)(uint8_t)varname[1]) << 8); content->data_length3 = (uint8_t)varname[2] | (((uint16_t)(uint8_t)varname[3]) << 8); content->mem_address = (uint8_t)varname[4] | (((uint16_t)(uint8_t)varname[5]) << 8); content->version = ver; ret = SEND_ACK(handle); if (!ret) { ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); } } if (ret) { break; } update_->cnt2 = 0; update_->max2 = 3; update_->pbar(); content->data_part1 = tifiles_ve_alloc_data(65536); ret = RECV_XDP(handle, &content->data_length1, content->data_part1); if (!ret) { ret = SEND_ACK(handle); } if (ret) { break; } update_->cnt2++; update_->pbar(); content->data_part2 = tifiles_ve_alloc_data(65536); ret = RECV_XDP(handle, &content->data_length2, content->data_part2); if (!ret) { ret = SEND_ACK(handle); } if (ret) { break; } update_->cnt2++; update_->pbar(); content->data_part3 = tifiles_ve_alloc_data(65536); ret = RECV_XDP(handle, &content->data_length3, content->data_part3); if (!ret) { ret = SEND_ACK(handle); } if (ret) { break; } update_->cnt2++; update_->pbar(); content->data_part4 = NULL; } while(0); return ret; } static int send_var (CalcHandle* handle, CalcMode mode, FileContent* content) { int ret = 0; unsigned int i; uint8_t rej_code; uint16_t status; update_->cnt2 = 0; update_->max2 = content->num_entries; for (i = 0; !ret && i < content->num_entries; i++) { VarEntry *entry = content->entries[i]; uint16_t size; if (!ticalcs_validate_varentry(entry)) { ticalcs_critical("%s: skipping invalid content entry #%u", __FUNCTION__, i); continue; } if (entry->action == ACT_SKIP) { ticalcs_info("%s: skipping variable #%u because requested", __FUNCTION__, i); continue; } if (entry->size >= 65536U) { ticalcs_critical("%s: oversized variable has size %u, clamping to 65535", __FUNCTION__, entry->size); size = 65535; } else { size = (uint16_t)entry->size; } ret = SEND_RTS(handle, size, entry->type, entry->name, entry->attr, entry->version); if (!ret) { ret = RECV_ACK(handle, &status); if (!ret) { ret = RECV_SKP(handle, &rej_code); if (!ret) { ret = SEND_ACK(handle); } } } if (ret) { break; } switch (rej_code) { case DBUS_REJ_EXIT: ret = ERR_ABORT; break; case DBUS_REJ_SKIP: continue; case DBUS_REJ_MEMORY: ret = ERR_OUT_OF_MEMORY; break; case DBUS_REJ_VERSION: ret = ERR_VAR_VERSION; // Fall through. case 0: // CTS break; default: ret = ERR_VAR_REJECTED; break; } if (ret) { break; } ticonv_varname_to_utf8_sn(handle->model, entry->name, update_->text, sizeof(update_->text), entry->type); update_label(); ret = SEND_XDP(handle, size, entry->data); if (!ret) { ret = RECV_ACK(handle, &status); if (!ret) { ret = SEND_EOT(handle); if (!ret) { ticalcs_info("Sent variable #%u", i); update_->cnt2 = i+1; update_->max2 = content->num_entries; update_->pbar(); } } } } return ret; } static int recv_var (CalcHandle* handle, CalcMode mode, FileContent* content, VarRequest* vr) { int ret; uint16_t unused; VarEntry *ve; uint16_t ve_size; content->model = handle->model; ticalcs_strlcpy(content->comment, tifiles_comment_set_single(), sizeof(content->comment)); content->num_entries = 1; content->entries = tifiles_ve_create_array(1); ve = content->entries[0] = tifiles_ve_create(); memcpy(ve, vr, sizeof(VarEntry)); ticonv_varname_to_utf8_sn(handle->model, vr->name, update_->text, sizeof(update_->text), vr->type); update_label(); do { // silent request ret = SEND_REQ(handle, (uint16_t)vr->size, vr->type, vr->name, vr->attr, vr->version); if (!ret) { ret = RECV_ACK(handle, &unused); if (!ret) { ret = RECV_VAR(handle, &ve_size, &ve->type, ve->name, &ve->attr, &ve->version); } } if (ret) { break; } ve->size = ve_size; ret = SEND_ACK(handle); if (!ret) { ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); } } if (ret) { break; } ve->data = tifiles_ve_alloc_data(ve->size); ret = RECV_XDP(handle, &ve_size, ve->data); if (!ret) { ve->size = ve_size; if (handle->model != CALC_TI73 && ve->type == TI83p_PIC) { if (ve->version >= 0xA) { content->model = CALC_TI84PC; } else { content->model = CALC_TI83P; } } ret = SEND_ACK(handle); } } while(0); return ret; } static int get_version (CalcHandle* handle, CalcInfos* infos); static int send_flash (CalcHandle* handle, FlashContent* content) { int ret; FlashContent *ptr; unsigned int i, j; uint16_t size; int cpu15mhz = 0; // search for data header for (ptr = content; ptr != NULL; ptr = ptr->next) { if (ptr->data_type == TI83p_AMS || ptr->data_type == TI83p_APPL) { break; } } if (ptr == NULL) { return -1; } if (ptr->data_type == TI83p_AMS) { size = 0x100; } else if (ptr->data_type == TI83p_APPL) { size = 0x80; } else { return -1; } // check for 83+ Silver Edition (not usable in boot mode, sic!) if (handle->model != CALC_TI73 && ptr->data_type == TI83p_APPL) { CalcInfos infos; ret = get_version(handle, &infos); if (ret) { return ret; } cpu15mhz = infos.hw_version & 1; if (!infos.battery) { ticalcs_info(_("Battery low, stopping flash app transfer")); return -1; } } ticalcs_info(_("FLASH name: \"%s\""), ptr->name); ticalcs_info(_("FLASH size: %i bytes."), ptr->data_length); ticonv_varname_to_utf8_sn(handle->model, ptr->name, update_->text, sizeof(update_->text), ptr->data_type); update_label(); update_->cnt2 = 0; update_->max2 = ptr->data_length; for (i = 0; !ret && i < ptr->num_pages; i++) { FlashPage *fp = ptr->pages[i]; if ((ptr->data_type == TI83p_AMS) && (i == 1)) // need relocation ? { fp->addr = 0x4000; } for (j = 0; !ret && j < fp->size; j += size) { uint16_t addr = fp->addr + j; uint8_t* data = fp->data + j; ret = SEND_VAR2(handle, size, ptr->data_type, fp->flag, addr, fp->page); if (!ret) { ret = RECV_ACK(handle, NULL); } if (ret) { break; } if (handle->model == CALC_TI73 && ptr->data_type == TI83p_APPL) { ret = RECV_CTS(handle, 0); } // Depends on OS version? else { ret = RECV_CTS(handle, 10); } if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = SEND_XDP(handle, size, data); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { update_->cnt2 += size; update_->pbar(); } } } } } /* Note: TI83+SE, TI84+ and TI84+SE don't need a pause (otherwise transfer fails). TI73 and TI83+ need a pause (otherwise transfer fails). Delay also causes OS transfers to fail on the 15Mhz calcs and unneeded for OS's */ if (!ret && !cpu15mhz && ptr->data_type == TI83p_APPL) { if (i == 1) { PAUSE(1000); // This pause is NEEDED ! } if (i == ptr->num_pages - 2) { PAUSE(2500); // This pause is NEEDED ! } } } if (!ret) { ret = SEND_EOT(handle); if (!ret) { ret = RECV_ACK(handle, NULL); } } return ret; } static int recv_flash (CalcHandle* handle, FlashContent* content, VarRequest* vr) { int ret; FlashPage *fp; uint16_t data_addr; uint16_t old_page = 0; uint16_t data_page; uint16_t data_length; uint8_t data_type; uint32_t size; int first_block; int page; int offset; uint8_t buffer[FLASH_PAGE_SIZE + 4]; ticonv_varname_to_utf8_sn(handle->model, vr->name, update_->text, sizeof(update_->text), vr->type); update_label(); content->model = handle->model; ticalcs_strlcpy(content->name, vr->name, sizeof(content->name)); content->data_type = vr->type; content->device_type = handle->model == CALC_TI73 ? DEVICE_TYPE_73 : DEVICE_TYPE_83P; content->num_pages = 2048; // TI83+ has 512 KB of FLASH max content->pages = tifiles_fp_create_array(content->num_pages); page = 0; fp = content->pages[page] = tifiles_fp_create(); ret = SEND_REQ2(handle, 0x00, TI73_APPL, vr->name, 0x00); if (!ret) { ret = RECV_ACK(handle, NULL); } if (ret) { return ret; } update_->cnt2 = 0; update_->max2 = vr->size; for (size = 0, first_block = 1, offset = 0; !ret;) { char name[9]; int ret2; ret = RECV_VAR2(handle, &data_length, &data_type, name, &data_addr, &data_page); ret2 = SEND_ACK(handle); if (ret) { if (ret == ERR_EOT) { ret = 0; } break; } if (ret2) { ret = ret2; break; } if (first_block) { old_page = data_page; fp->addr = data_addr & 0x4000; fp->page = data_page; } if (old_page != data_page) { fp->addr = data_addr & 0x4000; fp->page = old_page; fp->flag = 0x80; fp->size = offset; fp->data = tifiles_fp_alloc_data(FLASH_PAGE_SIZE); memcpy(fp->data, buffer, fp->size); page++; offset = 0; old_page = data_page; fp = content->pages[page] = tifiles_fp_create(); } ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_XDP(handle, &data_length, &buffer[offset]); if (!ret) { ret = SEND_ACK(handle); } } } if (ret) { break; } if (first_block) { first_block = 0; /* compute actual application size */ if (buffer[0] == 0x80 && buffer[1] == 0x0f) { uint32_t len = ((uint32_t)(buffer[2])) << 24 | ((uint32_t)(buffer[3])) << 16 | ((uint32_t)(buffer[4])) << 8 | (uint32_t)(buffer[5]); update_->max2 = len + 75; } } size += data_length; offset += data_length; update_->cnt2 = size; update_->pbar(); } fp->addr = data_addr & 0x4000; fp->page = old_page; fp->flag = 0x80; fp->size = offset; fp->data = tifiles_fp_alloc_data(FLASH_PAGE_SIZE); memcpy(fp->data, buffer, fp->size); page++; content->num_pages = page; return ret; } static int recv_idlist (CalcHandle* handle, uint8_t* id) { int ret; uint16_t unused; uint16_t varsize; uint8_t vartype; char varname[9]; uint8_t varattr; uint8_t version; uint8_t data[16]; int i; ticalcs_strlcpy(update_->text, "ID-LIST", sizeof(update_->text)); update_label(); ret = SEND_REQ(handle, 0x0000, TI73_IDLIST, "\0\0\0\0\0\0\0", 0x00, 0x00); if (!ret) { ret = RECV_ACK(handle, &unused); if (!ret) { ret = RECV_VAR(handle, &varsize, &vartype, varname, &varattr, &version); if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_XDP(handle, &varsize, data); if (!ret) { ret = SEND_ACK(handle); if (!ret) { i = data[9]; data[9] = data[10]; data[10] = i; for (i = 4; i < varsize; i++) { sprintf((char *)&id[2 * (i-4)], "%02x", data[i]); } id[7*2] = '\0'; } } } } } } } } return ret; } static int dump_rom_1 (CalcHandle* handle) { // Send dumping program if (handle->model == CALC_TI73) { return rd_send(handle, "romdump.73p", romDumpSize73, romDump73); } else { CalcInfos infos; int ret = get_version(handle, &infos); if (!ret) { if (infos.hw_version < 5) { ret = rd_send(handle, "romdump.8Xp", romDumpSize8Xp, romDump8Xp); } else { ret = rd_send(handle, "romdump.8Xp", romDumpSize84pc, romDump84pc); } } return ret; } } static int dump_rom_2 (CalcHandle* handle, CalcDumpSize size, const char *filename) { static const uint16_t keys_83p[] = { 0x40, 0x09, 0x09, 0xFC9C, /* Quit, Clear, Clear, Asm( */ 0xDA, 0xAB, 0xA8, 0xA6, /* prgm, R, O, M */ 0x9D, 0xAE, 0xA6, 0xA9, /* D, U, M, P */ 0x86, 0x05 }; /* ), Enter */ static const uint16_t keys_73[] = { 0x40, 0x09, 0x09, 0xDA, /* Quit, Clear, Clear, prgm */ 0xAB, 0xA8, 0xA6, 0x9D, /* R, O, M, D, */ 0xAE, 0xA6, 0xA9, 0x05 }; /* U, M, P, Enter */ int ret = 0; const uint16_t *keys; unsigned int i, nkeys; if (handle->model == CALC_TI73) { keys = keys_73; nkeys = sizeof(keys_73) / sizeof(keys_73[0]); } else { keys = keys_83p; nkeys = sizeof(keys_83p) / sizeof(keys_83p[0]); } // Launch program by remote control PAUSE(200); for (i = 0; !ret && i < nkeys - 1; i++) { ret = send_key(handle, (uint32_t)(keys[i])); PAUSE(100); } if (!ret) { // This fixes a 100% reproducible timeout: send_key normally requests an ACK, // but when the program is running, no ACK is sent. Therefore, hit the Enter key // without requesting an ACK. ret = SEND_KEY(handle, keys[i]); if (!ret) { ret = RECV_ACK(handle, NULL); // when the key is received if (!ret) { PAUSE(1000); // Get dump // (Normally there would be another ACK after the program exits, // but the ROM dumper disables that behavior) ret = rd_dump(handle, filename); } } } return ret; } static int set_clock (CalcHandle* handle, CalcClock* _clock) { int ret; uint8_t buffer[9]; uint32_t calc_time; struct tm ref, cur; time_t r, c, now; time(&now); // retrieve current DST setting memcpy(&ref, localtime(&now), sizeof(struct tm)); ref.tm_year = 1997 - 1900; ref.tm_mon = 0; ref.tm_yday = 0; ref.tm_mday = 1; ref.tm_wday = 3; ref.tm_hour = 0; ref.tm_min = 0; ref.tm_sec = 0; //ref.tm_isdst = 1; r = mktime(&ref); //printf("%s\n", asctime(&ref)); cur.tm_year = _clock->year - 1900; cur.tm_mon = _clock->month - 1; cur.tm_mday = _clock->day; cur.tm_hour = _clock->hours; cur.tm_min = _clock->minutes; cur.tm_sec = _clock->seconds; cur.tm_isdst = 1; c = mktime(&cur); //printf("%s\n", asctime(&cur)); calc_time = (uint32_t)difftime(c, r); buffer[0] = 0; buffer[1] = 0; buffer[2] = MSB(MSW(calc_time)); buffer[3] = LSB(MSW(calc_time)); buffer[4] = MSB(LSW(calc_time)); buffer[5] = LSB(LSW(calc_time)); buffer[6] = _clock->date_format; buffer[7] = _clock->time_format; buffer[8] = 0xff; ticalcs_strlcpy(update_->text, _("Setting clock..."), sizeof(update_->text)); update_label(); ret = SEND_RTS(handle, 13, TI73_CLK, "\0x08\0\0\0\0\0\0\0", 0x00, 0x00); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_CTS(handle, 13); if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = SEND_XDP(handle, 9, buffer); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = SEND_EOT(handle); } } } } } } return ret; } static int get_clock (CalcHandle* handle, CalcClock* _clock) { int ret; uint16_t varsize; uint8_t vartype; uint8_t varattr; uint8_t version; char varname[9]; uint8_t * buffer = handle->buffer2; uint32_t calc_time; struct tm ref, *cur; time_t r, c, now; ticalcs_strlcpy(update_->text, _("Getting clock..."), sizeof(update_->text)); update_label(); ret = SEND_REQ(handle, 0x0000, TI73_CLK, "\0x08\0\0\0\0\0\0\0", 0x00, 0x00); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_VAR(handle, &varsize, &vartype, varname, &varattr, &version); if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_XDP(handle, &varsize, buffer); if (!ret) { ret = SEND_ACK(handle); } } } } } } } if (!ret) { calc_time = (((uint32_t)(buffer[2])) << 24) | (((uint32_t)(buffer[3])) << 16) | (((uint32_t)(buffer[4])) << 8) | (uint32_t)(buffer[5]); //printf("<%08x>\n", time); time(&now); // retrieve current DST setting memcpy(&ref, localtime(&now), sizeof(struct tm));; ref.tm_year = 1997 - 1900; ref.tm_mon = 0; ref.tm_yday = 0; ref.tm_mday = 1; ref.tm_wday = 3; ref.tm_hour = 0; ref.tm_min = 0; ref.tm_sec = 0; //ref.tm_isdst = 1; r = mktime(&ref); //printf("%s\n", asctime(&ref)); c = r + calc_time; cur = localtime(&c); //printf("%s\n", asctime(cur)); _clock->year = cur->tm_year + 1900; _clock->month = cur->tm_mon + 1; _clock->day = cur->tm_mday; _clock->hours = cur->tm_hour; _clock->minutes = cur->tm_min; _clock->seconds = cur->tm_sec; _clock->date_format = buffer[6]; _clock->time_format = buffer[7]; } return ret; } static int del_var (CalcHandle* handle, VarRequest* vr) { int ret; char *utf8; utf8 = ticonv_varname_to_utf8(handle->model, vr->name, vr->type); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Deleting %s..."), utf8); ticonv_utf8_free(utf8); update_label(); ret = SEND_DEL(handle, (uint16_t)vr->size, vr->type, vr->name, vr->attr); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_ACK(handle, NULL); } } return ret; } static int get_version (CalcHandle* handle, CalcInfos* infos) { int ret; uint16_t length; uint8_t buf[32]; ret = SEND_VER(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_XDP(handle, &length, buf); if (!ret) { ret = SEND_ACK(handle); } } } } } if (!ret) { memset(infos, 0, sizeof(CalcInfos)); if (handle->model == CALC_TI73) { ticalcs_slprintf(infos->os_version, sizeof(infos->os_version), "%1x.%02x", buf[0], buf[1]); ticalcs_slprintf(infos->boot_version, sizeof(infos->boot_version), "%1x.%02x", buf[2], buf[3]); } else { ticalcs_slprintf(infos->os_version, sizeof(infos->os_version), "%1i.%02i", buf[0], buf[1]); ticalcs_slprintf(infos->boot_version, sizeof(infos->boot_version), "%1i.%02i", buf[2], buf[3]); } infos->battery = (buf[4] & 1) ? 0 : 1; infos->hw_version = buf[5]; switch(buf[5]) { case 0: infos->model = CALC_TI83P; break; case 1: infos->model = CALC_TI83P; break; case 2: infos->model = CALC_TI84P; break; case 3: infos->model = CALC_TI84P; break; case 5: infos->model = CALC_TI84PC; break; default: infos->model = CALC_TI84PC; break; // If new models ever arise, they'll probably be 84+CSE or newer anyway. } infos->language_id = buf[6]; infos->sub_lang_id = buf[7]; infos->mask = INFOS_BOOT_VERSION | INFOS_OS_VERSION | INFOS_BATTERY | INFOS_HW_VERSION | INFOS_CALC_MODEL | INFOS_LANG_ID | INFOS_SUB_LANG_ID; tifiles_hexdump(buf, length); ticalcs_info(_(" OS: %s"), infos->os_version); ticalcs_info(_(" BIOS: %s"), infos->boot_version); ticalcs_info(_(" HW: %i"), infos->hw_version); ticalcs_info(_(" Battery: %s"), infos->battery ? _("good") : _("low")); } return ret; } static int send_cert (CalcHandle* handle, FlashContent* content) { int ret = 0; FlashContent *ptr; int i, nblocks; uint16_t size = 0xE8; // search for cert header for (ptr = content; ptr != NULL; ptr = ptr->next) { if (ptr->data_type == TI83p_CERT) { break; } } if (ptr != NULL) { // send content ticalcs_info(_("FLASH name: \"%s\""), ptr->name); ticalcs_info(_("FLASH size: %i bytes."), ptr->data_length); nblocks = ptr->data_length / size; update_->max2 = nblocks; ret = SEND_VAR2(handle, size, ptr->data_type, 0x04, 0x4000, 0x00); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_CTS(handle, 10); if (!ret) { ret = SEND_ACK(handle); } } } for (i = 0; !ret && i <= nblocks; i++) { uint16_t length = size; ret = SEND_XDP(handle, length, (ptr->data_part) + length * i); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_CTS(handle, size); if (!ret) { ret = SEND_ACK(handle); if (!ret) { update_->cnt2 = i; update_->pbar(); } } } } } if (!ret) { ret = SEND_EOT(handle); ticalcs_info(_("Header sent completely.")); } } return ret; } static int recv_cert (CalcHandle* handle, FlashContent* content) { int ret; int i; uint8_t buf[256]; ticalcs_strlcpy(update_->text, _("Receiving certificate"), sizeof(update_->text)); update_label(); content->model = handle->model; content->name[0] = 0; content->data_type = TI83p_CERT; content->device_type = 0x73; content->num_pages = 0; content->data_part = (uint8_t *)tifiles_ve_alloc_data(2 * 1024 * 1024); // 2MB max ret = SEND_REQ2(handle, 0x00, TI83p_GETCERT, "\0\0\0\0\0\0\0", 0x00); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = ticables_cable_recv(handle->cable, buf, 4); //VAR w/ no header if (!ret) { ticalcs_info(" TI->PC: VAR"); ret = SEND_ACK(handle); for (i = 0, content->data_length = 0; !ret; i++) { uint16_t block_size; ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_XDP(handle, &block_size, content->data_part); if (!ret) { ret = SEND_ACK(handle); if (!ret) { content->data_length += block_size; update_->cnt2 += block_size; update_->pbar(); } } } } } } } } return ret; } const CalcFncts calc_73 = { CALC_TI73, "TI73", "TI-73", "TI-73", OPS_ISREADY | OPS_KEYS | OPS_SCREEN | OPS_DIRLIST | OPS_BACKUP | OPS_VARS | OPS_FLASH | OPS_IDLIST | OPS_ROMDUMP | OPS_VERSION | OPS_OS | FTS_SILENT | FTS_MEMFREE | FTS_FLASH | FTS_BACKUP, PRODUCT_ID_TI73, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "2P", /* send_backup */ "2P", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "2P1L", /* send_var_ns */ "1P1L", /* recv_var_ns */ "2P1L", /* send_app */ "2P1L", /* recv_app */ "2P", /* send_os */ "1L", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "1L", /* send_cert */ "1L", /* recv_cert */ "", /* rename */ "", /* chattr */ "", /* send_all_vars_backup */ "" /* recv_all_vars_backup */ }, &is_ready, &send_key, &execute, &recv_screen, &get_dirlist, &get_memfree, &send_backup, &recv_backup, &send_var, &recv_var, &noop_send_var_ns, &noop_recv_var_ns, &send_flash, &recv_flash, &send_flash, &recv_idlist, &dump_rom_1, &dump_rom_2, &set_clock, &get_clock, &del_var, &noop_new_folder, &get_version, &send_cert, &recv_cert, &noop_rename_var, &noop_change_attr, &noop_send_all_vars_backup, &noop_recv_all_vars_backup }; const CalcFncts calc_83p = { CALC_TI83P, "TI83+", "TI-83 Plus", "TI-83 Plus", OPS_ISREADY | OPS_KEYS | OPS_SCREEN | OPS_DIRLIST | OPS_BACKUP | OPS_VARS | OPS_FLASH | OPS_IDLIST | OPS_ROMDUMP | OPS_DELVAR | OPS_VERSION | OPS_OS | FTS_SILENT | FTS_MEMFREE | FTS_FLASH | FTS_CERT | FTS_BACKUP, PRODUCT_ID_TI83P, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "2P", /* send_backup */ "2P", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "2P1L", /* send_var_ns */ "1P1L", /* recv_var_ns */ "2P1L", /* send_app */ "2P1L", /* recv_app */ "2P", /* send_os */ "1L", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "1L", /* send_cert */ "1L", /* recv_cert */ "", /* rename */ "", /* chattr */ "", /* send_all_vars_backup */ "" /* recv_all_vars_backup */ }, &is_ready, &send_key, &execute, &recv_screen, &get_dirlist, &get_memfree, &send_backup, &recv_backup, &send_var, &recv_var, &noop_send_var_ns, &noop_recv_var_ns, &send_flash, &recv_flash, &send_flash, &recv_idlist, &dump_rom_1, &dump_rom_2, &set_clock, &get_clock, &del_var, &noop_new_folder, &get_version, &send_cert, &recv_cert, &noop_rename_var, &noop_change_attr, &noop_send_all_vars_backup, &noop_recv_all_vars_backup }; const CalcFncts calc_84p = { CALC_TI84P, "TI84+", "TI-84 Plus", "TI-84 Plus", OPS_ISREADY | OPS_KEYS | OPS_SCREEN | OPS_DIRLIST | OPS_BACKUP | OPS_VARS | OPS_FLASH | OPS_IDLIST | OPS_ROMDUMP | OPS_CLOCK | OPS_DELVAR | OPS_VERSION | OPS_OS | FTS_SILENT | FTS_MEMFREE | FTS_FLASH | FTS_CERT | FTS_BACKUP, PRODUCT_ID_TI84P, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "2P", /* send_backup */ "2P", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "2P1L", /* send_var_ns */ "1P1L", /* recv_var_ns */ "2P1L", /* send_app */ "2P1L", /* recv_app */ "2P", /* send_os */ "1L", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "1L", /* send_cert */ "1L", /* recv_cert */ "", /* rename */ "", /* chattr */ "", /* send_all_vars_backup */ "" /* recv_all_vars_backup */ }, &is_ready, &send_key, &execute, &recv_screen, &get_dirlist, &get_memfree, &send_backup, &recv_backup, &send_var, &recv_var, &noop_send_var_ns, &noop_recv_var_ns, &send_flash, &recv_flash, &send_flash, &recv_idlist, &dump_rom_1, &dump_rom_2, &set_clock, &get_clock, &del_var, &noop_new_folder, &get_version, &send_cert, &recv_cert, &noop_rename_var, &noop_change_attr, &noop_send_all_vars_backup, &noop_recv_all_vars_backup }; const CalcFncts calc_84pcse = { CALC_TI84PC, "TI84+CSE", "TI-84 Plus Color Silver Edition", "TI-84 Plus Color Silver Edition", OPS_ISREADY | OPS_KEYS | OPS_SCREEN | OPS_DIRLIST | OPS_BACKUP | OPS_VARS | OPS_FLASH | OPS_IDLIST | OPS_ROMDUMP | OPS_CLOCK | OPS_DELVAR | OPS_VERSION | OPS_OS | FTS_SILENT | FTS_MEMFREE | FTS_FLASH | FTS_CERT | FTS_BACKUP, PRODUCT_ID_TI84PCSE, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "2P", /* send_backup */ "2P", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "2P1L", /* send_var_ns */ "1P1L", /* recv_var_ns */ "2P1L", /* send_app */ "2P1L", /* recv_app */ "2P", /* send_os */ "1L", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "1L", /* send_cert */ "1L", /* recv_cert */ "", /* rename */ "", /* chattr */ "", /* send_all_vars_backup */ "" /* recv_all_vars_backup */ }, &is_ready, &send_key, &execute, &recv_screen, &get_dirlist, &get_memfree, &send_backup, &recv_backup, &send_var, &recv_var, &noop_send_var_ns, &noop_recv_var_ns, &send_flash, &recv_flash, &send_flash, &recv_idlist, &dump_rom_1, &dump_rom_2, &set_clock, &get_clock, &del_var, &noop_new_folder, &get_version, &send_cert, &recv_cert, &noop_rename_var, &noop_change_attr, &noop_send_all_vars_backup, &noop_recv_all_vars_backup }; libticalcs-1.1.9+dfsg/src/calc_84p.c000066400000000000000000001723121327711501700171140ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs2 - hand-helds support library, a part of the TiLP project * Copyright (c) 1999-2005 Romain Liévin * Copyright (c) 2005 Benjamin Moody (ROM dumper) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* TI84+ support thru DirectUsb link. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "ticalcs.h" #include "gettext.h" #include "internal.h" #include "logging.h" #include "error.h" #include "dusb_vpkt.h" #include "dusb_cmd.h" #include "rom84p.h" #include "rom84pcu.h" #include "rom834pceu.h" #include "romdump.h" #include "keys83p.h" // Screen coordinates of the TI83+ #define TI84P_ROWS 64 #define TI84P_COLS 96 #define TI84PC_ROWS 240 #define TI84PC_COLS 320 static int is_ready (CalcHandle* handle) { int ret; static const DUSBModeSet mode = DUSB_MODE_NORMAL; ret = dusb_cmd_s_mode_set(handle, mode); if (!ret) { // use PID_HOMESCREEN to return status ? ret = dusb_cmd_r_mode_ack(handle); } return ret; } static int send_key_noack (CalcHandle* handle, uint32_t key) { int ret; ret = dusb_cmd_s_execute(handle, "", "", DUSB_EID_KEY, "", (uint16_t)key); if (!ret) { ret = dusb_cmd_r_delay_ack(handle); } return ret; } static int send_key (CalcHandle* handle, uint32_t key) { int ret; ret = send_key_noack(handle, key); if (!ret) { ret = dusb_cmd_r_data_ack(handle); } return ret; } static int execute (CalcHandle* handle, VarEntry *ve, const char *args) { uint8_t action; int ret; switch (ve->type) { case TI84p_ASM: action = DUSB_EID_ASM; break; case TI84p_APPL: action = DUSB_EID_APP; break; default: action = DUSB_EID_PRGM; break; } ret = dusb_cmd_s_execute(handle, ve->folder, ve->name, action, args, 0); if (!ret) { ret = dusb_cmd_r_data_ack(handle); } return ret; } static int recv_screen (CalcHandle* handle, CalcScreenCoord* sc, uint8_t** bitmap) { static const uint16_t pid[] = { DUSB_PID_SCREENSHOT }; uint32_t size; uint8_t *data; int ret; ret = dusb_cmd_s_param_request(handle, 1, pid); if (!ret) { ret = dusb_cmd_r_screenshot(handle, &size, &data); if (!ret) { switch (handle->model) { case CALC_TI84P_USB: case CALC_TI82A_USB: { if (size == TI84P_ROWS * TI84P_COLS / 8) { *bitmap = data; sc->width = TI84P_COLS; sc->height = TI84P_ROWS; sc->clipped_width = TI84P_COLS; sc->clipped_height = TI84P_ROWS; sc->pixel_format = CALC_PIXFMT_MONO; } else { g_free(data); *bitmap = NULL; ret = ERR_INVALID_SCREENSHOT; } break; } case CALC_TI84PC_USB: { size -= 4; *bitmap = ticalcs_alloc_screen(TI84PC_ROWS * TI84PC_COLS * 2); ret = ticalcs_screen_84pcse_rle_uncompress(data, size, *bitmap, TI84PC_ROWS * TI84PC_COLS * 2); g_free(data); if (ret) { ticalcs_free_screen(*bitmap); *bitmap = NULL; ret = ERR_INVALID_SCREENSHOT; } else { sc->width = TI84PC_COLS; sc->height = TI84PC_ROWS; sc->clipped_width = TI84PC_COLS; sc->clipped_height = TI84PC_ROWS; sc->pixel_format = CALC_PIXFMT_RGB_565_LE; } break; } case CALC_TI83PCE_USB: case CALC_TI84PCE_USB: { if (size == TI84PC_ROWS * TI84PC_COLS * 2) { // 83PCE, 84PCE *bitmap = data; sc->width = TI84PC_COLS; sc->height = TI84PC_ROWS; sc->clipped_width = TI84PC_COLS; sc->clipped_height = TI84PC_ROWS; sc->pixel_format = CALC_PIXFMT_RGB_565_LE; break; } // else fall through. } default: { g_free(data); *bitmap = NULL; ret = ERR_INVALID_SCREENSHOT; break; } } } } return ret; } static int get_dirlist (CalcHandle* handle, GNode** vars, GNode** apps) { static const uint16_t aids[] = { DUSB_AID_VAR_SIZE, DUSB_AID_VAR_TYPE, DUSB_AID_ARCHIVED }; const int size = sizeof(aids) / sizeof(uint16_t); int ret; DUSBCalcAttr **attr; GNode *folder, *root, *node; char fldname[40], varname[40]; char *utf8; ret = dirlist_init_trees(handle, vars, apps); if (ret) { return ret; } folder = dirlist_create_append_node(NULL, vars); if (!folder) { return ERR_MALLOC; } root = dirlist_create_append_node(NULL, apps); if (!root) { return ERR_MALLOC; } // Add permanent variables (Window, RclWin / RclWindw, TblSet aka WINDW, ZSTO, TABLE) { VarEntry *ve; ve = tifiles_ve_create(); ticalcs_strlcpy(ve->name, "Window", sizeof(ve->name)); ve->type = TI84p_WINDW; node = dirlist_create_append_node(ve, &folder); if (node != NULL) { ve = tifiles_ve_create(); // Actually, "RclWindw" works even on an old 84+ running OS 2.43, but libticalcs // has been using "RclWin" successfully on TI-Z80 DUSB models since the beginning... ticalcs_strlcpy(ve->name, (handle->model == CALC_TI84PC_USB || handle->model == CALC_TI83PCE_USB || handle->model == CALC_TI84PCE_USB) ? "RclWindw" : "RclWin", sizeof(ve->name)); ve->type = TI84p_ZSTO; node = dirlist_create_append_node(ve, &folder); if (node != NULL) { ve = tifiles_ve_create(); ticalcs_strlcpy(ve->name, "TblSet", sizeof(ve->name)); ve->type = TI84p_TABLE; node = dirlist_create_append_node(ve, &folder); } } } if (!node) { return ERR_MALLOC; } ret = dusb_cmd_s_dirlist_request(handle, size, aids); if (!ret) { for (;;) { VarEntry *ve; attr = dusb_ca_new_array(handle, size); ret = dusb_cmd_r_var_header(handle, fldname, varname, attr); if (ret) { // Not a real error. if (ret == ERR_EOT) { ret = 0; } dusb_ca_del_array(handle, size, attr); break; } ve = tifiles_ve_create(); ticalcs_strlcpy(ve->name, varname, sizeof(ve->name)); ve->size = ( (((uint32_t)(attr[0]->data[0])) << 24) | (((uint32_t)(attr[0]->data[1])) << 16) | (((uint32_t)(attr[0]->data[2])) << 8) | (((uint32_t)(attr[0]->data[3])) )); ve->type = (uint32_t)(attr[1]->data[3]); ve->attr = attr[2]->data[0] ? ATTRB_ARCHIVED : ATTRB_NONE; dusb_ca_del_array(handle, size, attr); node = dirlist_create_append_node(ve, (ve->type != TI73_APPL) ? &folder : &root); if (!node) { ret = ERR_MALLOC; break; } utf8 = ticonv_varname_to_utf8(handle->model, ve->name, ve->type); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Parsing %s"), utf8); ticonv_utf8_free(utf8); update_label(); } } return ret; } static int get_memfree (CalcHandle* handle, uint32_t* ram, uint32_t* flash) { static const uint16_t pids[] = { DUSB_PID_FREE_RAM, DUSB_PID_FREE_FLASH }; const int size = sizeof(pids) / sizeof(uint16_t); DUSBCalcParam **params; int ret; params = dusb_cp_new_array(handle, size); ret = dusb_cmd_s_param_request(handle, size, pids); if (!ret) { ret = dusb_cmd_r_param_data(handle, size, params); if (!ret) { *ram = ( (((uint32_t)(params[0]->data[4])) << 24) | (((uint32_t)(params[0]->data[5])) << 16) | (((uint32_t)(params[0]->data[6])) << 8) | (((uint32_t)(params[0]->data[7])) )); *flash = ( (((uint32_t)(params[1]->data[4])) << 24) | (((uint32_t)(params[1]->data[5])) << 16) | (((uint32_t)(params[1]->data[6])) << 8) | (((uint32_t)(params[1]->data[7])) )); } } dusb_cp_del_array(handle, size, params); return ret; } static int send_backup (CalcHandle* handle, BackupContent* content) { DUSBCalcAttr **attrs; const int nattrs = 3; uint32_t length; uint8_t *data, *p; int ret = 0; static const uint16_t keys[] = { KEY83P_Quit, KEY83P_LinkIO, KEY83P_Right, KEY83P_1 }; unsigned int i; attrs = dusb_ca_new_array(handle, nattrs); attrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE, 4); attrs[0]->data[0] = 0xF0; attrs[0]->data[1] = 0x07; attrs[0]->data[2] = 0x00; attrs[0]->data[3] = TI84p_BKUP; attrs[1] = dusb_ca_new(handle, DUSB_AID_VAR_VERSION, 4); attrs[1]->data[0] = 0x00; attrs[1]->data[1] = 0x00; attrs[1]->data[2] = 0x00; attrs[1]->data[3] = content->version; attrs[2] = dusb_ca_new(handle, DUSB_AID_BACKUP_HEADER, 8); attrs[2]->data[0] = MSB(content->data_length1); attrs[2]->data[1] = LSB(content->data_length1); attrs[2]->data[2] = MSB(content->data_length2); attrs[2]->data[3] = LSB(content->data_length2); attrs[2]->data[4] = MSB(content->data_length3); attrs[2]->data[5] = LSB(content->data_length3); attrs[2]->data[6] = MSB(content->mem_address); attrs[2]->data[7] = LSB(content->mem_address); length = content->data_length1 + content->data_length2 + content->data_length3; data = p = g_malloc(length); memcpy(p, content->data_part1, content->data_length1); p += content->data_length1; memcpy(p, content->data_part2, content->data_length2); p += content->data_length2; memcpy(p, content->data_part3, content->data_length3); // enter manual link mode for (i = 0; i < sizeof(keys) / sizeof(keys[0]) - 1; i++) { ret = send_key(handle, (uint32_t)(keys[i])); if (ret) { goto end; } } ret = send_key_noack(handle, (uint32_t)(keys[i])); if (ret) { goto end; } // send backup header ret = dusb_cmd_s_rts_ns(handle, "", "!", length, 3, CA(attrs)); if (ret) { goto end; } ret = dusb_cmd_r_delay_ack(handle); if (ret) { goto end; } // press key to accept the backup ret = send_key_noack(handle, KEY83P_1); if (ret) { goto end; } // acknowledgement of RTS ret = dusb_cmd_r_data_ack(handle); if (ret) { goto end; } // send backup contents ret = dusb_cmd_s_var_content(handle, length, data); if (ret) { goto end; } ret = dusb_cmd_r_data_ack(handle); if (ret) { goto end; } ret = dusb_cmd_s_eot(handle); end: dusb_ca_del_array(handle, nattrs, attrs); g_free(data); return ret; } static int send_var (CalcHandle* handle, CalcMode mode, FileContent* content) { unsigned int i; int ret = 0; for (i = 0; i < content->num_entries; i++) { DUSBCalcAttr **attrs; const int nattrs = 3; VarEntry *entry = content->entries[i]; uint32_t size; if (!ticalcs_validate_varentry(entry)) { ticalcs_critical("%s: skipping invalid content entry #%u", __FUNCTION__, i); continue; } if (entry->action == ACT_SKIP) { ticalcs_info("%s: skipping variable #%u because requested", __FUNCTION__, i); continue; } ticonv_varname_to_utf8_sn(handle->model, entry->name, update_->text, sizeof(update_->text), entry->type); update_label(); attrs = dusb_ca_new_array(handle, nattrs); attrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE, 4); attrs[0]->data[0] = 0xF0; attrs[0]->data[1] = 0x07; attrs[0]->data[2] = 0x00; attrs[0]->data[3] = entry->type; attrs[1] = dusb_ca_new(handle, DUSB_AID_ARCHIVED, 1); attrs[1]->data[0] = entry->attr == ATTRB_ARCHIVED ? 1 : 0; attrs[2] = dusb_ca_new(handle, DUSB_AID_VAR_VERSION, 4); attrs[2]->data[3] = entry->version; size = entry->size; if (entry->size >= 65536U) { ticalcs_critical("%s: variable size %u is suspiciously large", __FUNCTION__, size); } ret = dusb_cmd_s_rts(handle, "", entry->name, size, nattrs, CA(attrs)); dusb_ca_del_array(handle, nattrs, attrs); if (ret) { break; } ret = dusb_cmd_r_data_ack(handle); if (ret) { break; } ret = dusb_cmd_s_var_content(handle, size, entry->data); if (ret) { break; } ret = dusb_cmd_r_data_ack(handle); if (ret) { break; } ret = dusb_cmd_s_eot(handle); if (ret) { break; } update_->cnt2 = i + 1; update_->max2 = content->num_entries; update_->pbar(); PAUSE(50); // needed } return ret; } static int recv_var (CalcHandle* handle, CalcMode mode, FileContent* content, VarRequest* vr) { static const uint16_t aids[] = { DUSB_AID_ARCHIVED, DUSB_AID_VAR_VERSION, DUSB_AID_VAR_SIZE }; const int naids = sizeof(aids) / sizeof(uint16_t); DUSBCalcAttr **attrs; const int nattrs = 1; char fldname[40], varname[40]; uint8_t *data; VarEntry *ve; int ret; ticonv_varname_to_utf8_sn(handle->model, vr->name, update_->text, sizeof(update_->text), vr->type); update_label(); attrs = dusb_ca_new_array(handle, nattrs); attrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE2, 4); attrs[0]->data[0] = 0xF0; attrs[0]->data[1] = 0x07; attrs[0]->data[2] = 0x00; attrs[0]->data[3] = vr->type; ret = dusb_cmd_s_var_request(handle, "", vr->name, naids, aids, nattrs, CA(attrs)); dusb_ca_del_array(handle, nattrs, attrs); if (!ret) { attrs = dusb_ca_new_array(handle, naids); ret = dusb_cmd_r_var_header(handle, fldname, varname, attrs); if (!ret) { ret = dusb_cmd_r_var_content(handle, NULL, &data); if (!ret) { content->model = handle->model; ticalcs_strlcpy(content->comment, tifiles_comment_set_single(), sizeof(content->comment)); content->num_entries = 1; content->entries = tifiles_ve_create_array(1); ve = content->entries[0] = tifiles_ve_create(); memcpy(ve, vr, sizeof(VarEntry)); ve->size = ( (((uint32_t)(attrs[2]->data[0])) << 24) | (((uint32_t)(attrs[2]->data[1])) << 16) | (((uint32_t)(attrs[2]->data[2])) << 8) | (((uint32_t)(attrs[2]->data[3])) )); if (attrs[0]->size == 1) { ve->attr = (attrs[0]->data[0] ? ATTRB_ARCHIVED : 0); } if (attrs[1]->size == 4) { ve->version = attrs[1]->data[3]; } if (ve->type == TI83p_PIC) { if (ve->version >= 0xa) { content->model = CALC_TI84PC_USB; } else { content->model = CALC_TI84P_USB; } } ve->data = tifiles_ve_alloc_data(ve->size); memcpy(ve->data, data, ve->size); g_free(data); } } dusb_ca_del_array(handle, naids, attrs); } return ret; } static int send_all_vars_backup (CalcHandle* handle, FileContent* content) { return send_var(handle, MODE_BACKUP, content); } static int send_flash (CalcHandle* handle, FlashContent* content) { FlashContent *ptr; unsigned int i; DUSBCalcAttr **attrs; const int nattrs = 2; int ret = 0; uint8_t *data; uint32_t size; // search for data header for (ptr = content; ptr != NULL; ptr = ptr->next) { if (ptr->data_type == TI83p_AMS || ptr->data_type == TI83p_APPL) { break; } } if ( ptr == NULL || ptr->data_type != TI83p_APPL || ptr->pages == NULL) { return ERR_INVALID_PARAMETER; } #if 0 ticalcs_debug("#pages: %i", ptr->num_pages); ticalcs_debug("type: %02x", ptr->data_type); for (i = 0; i < ptr->num_pages; i++) { FlashPage *fp = ptr->pages[i]; ticalcs_debug("page #%i: %04x %02x %02x %04x", i, fp->addr, fp->page, fp->flag, fp->size); } ticalcs_debug("data length: %08x", ptr->data_length); #endif size = ptr->num_pages * FLASH_PAGE_SIZE; data = tifiles_fp_alloc_data(size); // must be rounded-up if (data == NULL) { return ERR_MALLOC; } update_->cnt2 = 0; update_->max2 = ptr->num_pages; for (i = 0; i < ptr->num_pages; i++) { FlashPage *fp = ptr->pages[i]; memcpy(data + i*FLASH_PAGE_SIZE, fp->data, FLASH_PAGE_SIZE); update_->cnt2 = i; update_->pbar(); } { FlashPage *fp = ptr->pages[--i]; memset(data + i*FLASH_PAGE_SIZE + fp->size, 0x00, FLASH_PAGE_SIZE - fp->size); update_->cnt2 = i; update_->pbar(); } // send ticonv_varname_to_utf8_sn(handle->model, ptr->name, update_->text, sizeof(update_->text), ptr->data_type); update_label(); attrs = dusb_ca_new_array(handle, nattrs); attrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE, 4); attrs[0]->data[0] = 0xF0; attrs[0]->data[1] = 0x07; attrs[0]->data[2] = 0x00; attrs[0]->data[3] = ptr->data_type; attrs[1] = dusb_ca_new(handle, DUSB_AID_ARCHIVED, 1); attrs[1]->data[0] = 0; ret = dusb_cmd_s_rts(handle, "", ptr->name, size, nattrs, CA(attrs)); dusb_ca_del_array(handle, nattrs, attrs); if (!ret) { ret = dusb_cmd_r_data_ack(handle); if (!ret) { ret = dusb_cmd_s_var_content(handle, size, data); if (!ret) { ret = dusb_cmd_r_data_ack(handle); if (!ret) { ret = dusb_cmd_s_eot(handle); } } } } g_free(data); return ret; } static int send_flash_834pce (CalcHandle* handle, FlashContent* content) { FlashContent *ptr; DUSBCalcAttr **attrs; const int nattrs = 2; int ret = 0; uint8_t *data; uint32_t size; // search for data header for (ptr = content; ptr != NULL; ptr = ptr->next) { if (ptr->data_type == TI83p_AMS || ptr->data_type == TI83p_APPL) { break; } } if ( ptr == NULL || ptr->data_type != TI83p_APPL || ptr->data_part == NULL) { return ERR_INVALID_PARAMETER; } size = ptr->data_length; data = ptr->data_part; update_->cnt2 = 0; update_->max2 = 0; // send ticonv_varname_to_utf8_sn(handle->model, ptr->name, update_->text, sizeof(update_->text), ptr->data_type); update_label(); attrs = dusb_ca_new_array(handle, nattrs); attrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE, 4); attrs[0]->data[0] = 0xF0; attrs[0]->data[1] = 0x0F; attrs[0]->data[2] = 0x00; attrs[0]->data[3] = ptr->data_type; attrs[1] = dusb_ca_new(handle, DUSB_AID_ARCHIVED, 1); attrs[1]->data[0] = 1; ret = dusb_cmd_s_rts(handle, "", ptr->name, size, nattrs, CA(attrs)); dusb_ca_del_array(handle, nattrs, attrs); if (!ret) { ret = dusb_cmd_r_data_ack(handle); if (!ret) { ret = dusb_cmd_s_var_content(handle, size, data); if (!ret) { ret = dusb_cmd_r_data_ack(handle); if (!ret) { ret = dusb_cmd_s_eot(handle); } } } } return ret; } static int recv_flash (CalcHandle* handle, FlashContent* content, VarRequest* vr) { static const uint16_t aids[] = { DUSB_AID_ARCHIVED, DUSB_AID_VAR_VERSION }; const int naids = sizeof(aids) / sizeof(uint16_t); DUSBCalcAttr **attrs; const int nattrs = 1; char fldname[40], varname[40]; uint8_t *data; uint32_t data_length; int page; uint16_t data_addr = 0x4000; uint16_t data_page = 0; int r, q; int ret; ticonv_varname_to_utf8_sn(handle->model, vr->name, update_->text, sizeof(update_->text), vr->type); update_label(); attrs = dusb_ca_new_array(handle, nattrs); attrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE2, 4); attrs[0]->data[0] = 0xF0; attrs[0]->data[1] = 0x07; attrs[0]->data[2] = 0x00; attrs[0]->data[3] = vr->type; ret = dusb_cmd_s_var_request(handle, "", vr->name, naids, aids, nattrs, CA(attrs)); dusb_ca_del_array(handle, nattrs, attrs); if (!ret) { attrs = dusb_ca_new_array(handle, naids); ret = dusb_cmd_r_var_header(handle, fldname, varname, attrs); if (!ret) { ret = dusb_cmd_r_var_content(handle, &data_length, &data); if (!ret) { content->model = handle->model; ticalcs_strlcpy(content->name, vr->name, sizeof(content->name)); content->data_type = vr->type; content->device_type = DEVICE_TYPE_83P; q = data_length / FLASH_PAGE_SIZE; r = data_length % FLASH_PAGE_SIZE; content->num_pages = q + 1; content->pages = tifiles_fp_create_array(content->num_pages); update_->cnt2 = 0; update_->max2 = q; for (page = 0; page < q; page++) { FlashPage *fp = content->pages[page] = tifiles_fp_create(); fp->addr = data_addr; fp->page = data_page++; fp->flag = 0x80; fp->size = FLASH_PAGE_SIZE; fp->data = tifiles_fp_alloc_data(FLASH_PAGE_SIZE); memcpy(fp->data, data + FLASH_PAGE_SIZE*page, FLASH_PAGE_SIZE); update_->cnt2 = page; update_->pbar(); } { FlashPage *fp = content->pages[page] = tifiles_fp_create(); fp->addr = data_addr; fp->page = data_page++; fp->flag = 0x80; fp->size = r; fp->data = tifiles_fp_alloc_data(FLASH_PAGE_SIZE); memcpy(fp->data, data + FLASH_PAGE_SIZE*page, r); update_->cnt2 = page; update_->pbar(); } content->num_pages = page+1; g_free(data); } } dusb_ca_del_array(handle, naids, attrs); } return ret; } static int recv_flash_834pce (CalcHandle* handle, FlashContent* content, VarRequest* vr) { static const uint16_t aids[] = { DUSB_AID_ARCHIVED, DUSB_AID_VAR_VERSION }; const int naids = sizeof(aids) / sizeof(uint16_t); DUSBCalcAttr **attrs; const int nattrs = 1; char fldname[40], varname[40]; uint8_t *data; uint32_t data_length; int ret; ticonv_varname_to_utf8_sn(handle->model, vr->name, update_->text, sizeof(update_->text), vr->type); update_label(); attrs = dusb_ca_new_array(handle, nattrs); attrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE2, 4); attrs[0]->data[0] = 0xF0; attrs[0]->data[1] = 0x0F; attrs[0]->data[2] = 0x00; attrs[0]->data[3] = vr->type; ret = dusb_cmd_s_var_request(handle, "", vr->name, naids, aids, nattrs, CA(attrs)); dusb_ca_del_array(handle, nattrs, attrs); if (!ret) { attrs = dusb_ca_new_array(handle, naids); ret = dusb_cmd_r_var_header(handle, fldname, varname, attrs); if (!ret) { ret = dusb_cmd_r_var_content(handle, &data_length, &data); if (!ret) { content->model = handle->model; ticalcs_strlcpy(content->name, vr->name, sizeof(content->name)); content->data_type = vr->type; content->device_type = DEVICE_TYPE_83P; content->data_length = data_length; content->data_part = data; // Borrow this memory block. content->hw_id = handle->calc->product_id; // Do NOT g_free(data); } } dusb_ca_del_array(handle, naids, attrs); } return ret; } static int send_os (CalcHandle* handle, FlashContent* content) { DUSBModeSet mode = { 2, 1, 0, 0, 0x0fa0 }; //MODE_BASIC; uint32_t pkt_size = 266; uint32_t os_size = 0; FlashContent *ptr; unsigned int i, j; int boot = 0; int ret; // search for data header for (ptr = content; ptr != NULL; ptr = ptr->next) { if (ptr->data_type == TI83p_AMS || ptr->data_type == TI83p_APPL) { break; } } if (ptr == NULL) { return ERR_INVALID_PARAMETER; } if (ptr->data_type != TI83p_AMS) { return ERR_INVALID_PARAMETER; } if (ptr->pages == NULL) { return ERR_INVALID_PARAMETER; } #if 0 ticalcs_debug("#pages: %i", ptr->num_pages); ticalcs_debug("type: %02x", ptr->data_type); for (i = 0; i < ptr->num_pages; i++) { FlashPage *fp = ptr->pages[i]; ticalcs_debug("page #%i: %04x %02x %02x %04x", i, fp->addr, fp->page, fp->flag, fp->size); //tifiles_hexdump(fp->data, 16); } ticalcs_debug("data length = %08x %i", ptr->data_length, ptr->data_length); #endif for (i = 0; i < ptr->num_pages; i++) { FlashPage *fp = ptr->pages[i]; if (fp->size < 256) { os_size += 4; } else { os_size += 4*(fp->size / 260); } } ticalcs_debug("os_size overhead = %i", os_size); os_size += ptr->data_length; ticalcs_debug("os_size new = %i", os_size); do { static const uint16_t pids[] = { DUSB_PID_OS_MODE }; const int size = sizeof(pids) / sizeof(uint16_t); DUSBCalcParam **params; // switch to BASIC mode ret = dusb_cmd_s_mode_set(handle, mode); if (ret) { break; } ret = dusb_cmd_r_mode_ack(handle); if (ret) { break; } // test for boot mode ret = dusb_cmd_s_param_request(handle, size, pids); if (ret) { break; } params = dusb_cp_new_array(handle, size); ret = dusb_cmd_r_param_data(handle, size, params); if (ret) { dusb_cp_del_array(handle, size, params); break; } boot = !params[0]->data[0]; dusb_cp_del_array(handle, size, params); // start OS transfer ret = dusb_cmd_s_os_begin(handle, os_size); if (ret) { break; } if (!boot) { ret = dusb_recv_buf_size_request(handle, &pkt_size); if (ret) { break; } ret = dusb_send_buf_size_alloc(handle, pkt_size); if (ret) { break; } } ret = dusb_cmd_r_os_ack(handle, &pkt_size); // this pkt_size is important if (ret) { break; } // send OS header/signature ret = dusb_cmd_s_os_header(handle, 0x4000, 0x7A, 0x80, pkt_size-4, ptr->pages[0]->data); if (ret) { break; } ret = dusb_cmd_r_os_ack(handle, &pkt_size); if (ret) { break; } // send OS data update_->cnt2 = 0; update_->max2 = ptr->num_pages; for (i = 0; i < ptr->num_pages; i++) { FlashPage *fp = ptr->pages[i]; fp->addr = 0x4000; if (i == 0) // need relocation { ret = dusb_cmd_s_os_data(handle, 0x4000, 0x7A, 0x80, pkt_size-4, fp->data); if (ret) { goto end; } ret = dusb_cmd_r_data_ack(handle); if (ret) { goto end; } } else if (i == ptr->num_pages-1) // idem { ret = dusb_cmd_s_os_data(handle, 0x4100, 0x7A, 0x80, pkt_size-4, fp->data); if (ret) { goto end; } ret = dusb_cmd_r_data_ack(handle); if (ret) { goto end; } } else { for (j = 0; j < fp->size; j += 256) { ret = dusb_cmd_s_os_data(handle, (uint16_t)(fp->addr + j), (uint8_t)fp->page, fp->flag, pkt_size-4, fp->data + j); if (ret) { goto end; } ret = dusb_cmd_r_data_ack(handle); if (ret) { goto end; } } } update_->cnt2 = i; update_->pbar(); } ret = dusb_cmd_s_eot(handle); if (ret) { break; } PAUSE(500); ret = dusb_cmd_r_eot_ack(handle); } while (0); end: return ret; } static int send_os_834pce (CalcHandle* handle, FlashContent* content) { DUSBModeSet mode = { 2, 1, 0, 0, 0x0fa0 }; //MODE_BASIC; uint32_t pkt_size = 0x3ff; uint32_t hdr_size = 0; uint32_t hdr_offset = 0; const uint32_t memory_offset = 0x30000U; FlashContent *ptr; uint8_t *d; int i, r, q; int ret; // search for data header for (ptr = content; ptr != NULL; ptr = ptr->next) { if (ptr->data_type == TI83p_AMS || ptr->data_type == TI83p_APPL) { break; } } if (ptr == NULL) { return ERR_INVALID_PARAMETER; } if (ptr->data_type != TI83p_AMS) { return ERR_INVALID_PARAMETER; } if (ptr->data_part == NULL) { return ERR_INVALID_PARAMETER; } // search for OS header (offset & size) hdr_offset = 0; for (i = 0, d = ptr->data_part; (d[i] != 0xFF) || (d[i+1] != 0xFF) || (d[i+2] != 0xFF) || (d[i+3] != 0xFF); i++); hdr_size = i - hdr_offset; do { // switch to BASIC mode ret = dusb_cmd_s_mode_set(handle, mode); if (ret) { break; } ret = dusb_cmd_r_mode_ack(handle); if (ret) { break; } // start OS transfer ret = dusb_cmd_s_os_begin(handle, ptr->data_length); if (ret) { break; } ret = dusb_cmd_r_os_ack(handle, &pkt_size); if (ret) { break; } // send OS header/signature ret = dusb_cmd_s_os_header_89(handle, hdr_size, ptr->data_part + hdr_offset); if (ret) { break; } ret = dusb_cmd_r_os_ack(handle, &pkt_size); if (ret) { break; } // send OS data q = ptr->data_length / (pkt_size - 4); r = ptr->data_length % (pkt_size - 4); update_->cnt2 = 0; update_->max2 = q; for (i = 0; i < q; i++) { ret = dusb_cmd_s_os_data_834pce(handle, memory_offset + i*(pkt_size - 4), (pkt_size - 4), ptr->data_part + i*(pkt_size - 4)); if (ret) { goto end; } ret = dusb_cmd_r_data_ack(handle); if (ret) { goto end; } update_->cnt2 = i; update_->pbar(); } ret = dusb_cmd_s_os_data_834pce(handle, memory_offset + q*(pkt_size - 4), r, ptr->data_part + i*(pkt_size - 4)); if (ret) { break; } ret = dusb_cmd_r_data_ack(handle); if (ret) { break; } update_->cnt2 = i; update_->pbar(); ret = dusb_cmd_s_eot(handle); if (ret) { break; } PAUSE(500); ret = dusb_cmd_r_eot_ack(handle); } while (0); end: return ret; } static int recv_idlist (CalcHandle* handle, uint8_t* id) { static const uint16_t aids[] = { DUSB_AID_ARCHIVED, DUSB_AID_VAR_VERSION }; const int naids = sizeof(aids) / sizeof(uint16_t); DUSBCalcAttr **attrs; const int nattrs = 1; char folder[40], name[40]; uint8_t *data; uint32_t i, varsize; int ret; ticalcs_strlcpy(update_->text, "ID-LIST", sizeof(update_->text)); update_label(); attrs = dusb_ca_new_array(handle, nattrs); attrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE2, 4); attrs[0]->data[0] = 0xF0; attrs[0]->data[1] = 0x07; attrs[0]->data[2] = 0x00; attrs[0]->data[3] = TI83p_IDLIST; ret = dusb_cmd_s_var_request(handle, "", "IDList", naids, aids, nattrs, CA(attrs)); dusb_ca_del_array(handle, nattrs, attrs); if (!ret) { attrs = dusb_ca_new_array(handle, naids); ret = dusb_cmd_r_var_header(handle, folder, name, attrs); if (!ret) { ret = dusb_cmd_r_var_content(handle, &varsize, &data); if (!ret) { i = data[9]; data[9] = data[10]; data[10] = i; for (i = 4; i < varsize && i < 16; i++) { sprintf((char *)&id[2 * (i-4)], "%02x", data[i]); } id[7*2] = '\0'; g_free(data); } } dusb_ca_del_array(handle, naids, attrs); } return ret; } static int get_version (CalcHandle* handle, CalcInfos* infos); static int dump_rom_1 (CalcHandle* handle) { CalcInfos infos; int ret; ret = get_version(handle, &infos); if (!ret) { PAUSE(100); if (infos.model == CALC_TI84P_USB) { ret = rd_send(handle, "romdump.8Xp", romDumpSize84p, romDump84p); } else if (infos.model == CALC_TI84PC_USB) { ret = rd_send(handle, "romdump.8Xp", romDumpSize84pcu, romDump84pcu); } else if (infos.model == CALC_TI84PCE_USB || infos.model == CALC_TI83PCE_USB) { ret = rd_send(handle, "romdump.8Xp", romDumpSize834pceu, romDump834pceu); } else { ret = 0; } } return ret; } static int dump_rom_2 (CalcHandle* handle, CalcDumpSize size, const char *filename) { CalcInfos infos; int ret; ret = get_version(handle, &infos); if (!ret) { PAUSE(100); if (infos.model == CALC_TI84PCE_USB || infos.model == CALC_TI83PCE_USB) { // The TI-eZ80 series does no longer provide direct remote program launch... // Therefore, use a less sophisticated and more complicated way to queue keypresses. unsigned int i; unsigned int iterations; static const uint16_t keys[] = { 0x40, 0x09, 0x09, 0xFC9C, /* Quit, Clear, Clear, Asm( */ 0xDA, 0xAB, 0xA8, 0xA6, /* prgm, R, O, M */ 0x9D, 0xAE, 0xA6, 0xA9, /* D, U, M, P */ 0x86 /* ) */ }; FILE *f; f = fopen(filename, "wb"); if (f == NULL) { return ERR_OPEN_FILE; } // Launch program by remote control PAUSE(200); for (i = 0; i < sizeof(keys) / sizeof(keys[0]); i++) { ret = send_key(handle, (uint32_t)(keys[i])); if (ret) { goto end; } PAUSE(100); } // Keep synchronized with the ROM dumper's source code, here and below. For now, it dumps 16 KB at a time. iterations = (uint32_t)(infos.flash_phys / 0x4000); for (i = 0; !ret && i < iterations; i++) { ret = dusb_cmd_s_execute(handle, "", "", DUSB_EID_KEY, "", 0x05); if (!ret) { FileContent *content; VarEntry ve; ret = dusb_cmd_r_delay_ack(handle); PAUSE(400); ticables_cable_reset(handle->cable); memset(&ve, 0, sizeof(VarEntry)); ticalcs_strlcpy(ve.name, "ROMDATA", sizeof(ve.name)); ve.type = 0x06; // PPRGM / ASM. content = tifiles_content_create_regular(handle->model); if (content == NULL) { ret = ERR_MALLOC; break; } ret = is_ready(handle); if (!ret) { ret = recv_var(handle, 0 /* MODE_NORMAL */, content, &ve); PAUSE(200); if (!ret) { if (content->num_entries == 1 && content->entries && content->entries[0] && content->entries[0]->size == 16386) { // Skip the two leading bytes. if (fwrite(content->entries[0]->data + 2, content->entries[0]->size - 2, 1, f) < 1) { ret = ERR_SAVE_FILE; } } else { ret = ERR_INVALID_PACKET; } } } } } end: fclose(f); } else { ret = dusb_cmd_s_execute(handle, "", "ROMDUMP", DUSB_EID_PRGM, "", 0); if (!ret) { ret = dusb_cmd_r_data_ack(handle); if (!ret) { PAUSE(3000); // Get dump ret = rd_dump(handle, filename); } } } } return ret; } static int set_clock (CalcHandle* handle, CalcClock* _clock) { static const uint16_t pids[2] = { DUSB_PID_CLASSIC_CLK_SUPPORT, DUSB_PID_NEW_CLK_SUPPORT }; const int size = sizeof(pids) / sizeof(uint16_t); DUSBCalcParam **params; int ret; // get raw clock ticalcs_strlcpy(update_->text, _("Getting clock..."), sizeof(update_->text)); update_label(); params = dusb_cp_new_array(handle, size); ret = dusb_cmd_s_param_request(handle, size, pids); if (!ret) { ret = dusb_cmd_r_param_data(handle, size, params); if (!ret) { int classic_clock = !!params[0]->ok && !!!params[1]->ok; int new_clock = !!!params[0]->ok && !!params[1]->ok; if (!classic_clock && !new_clock) { ticalcs_warning(_("Could not determine clock type: %u %u"), params[0]->ok, params[1]->ok); } else if (classic_clock) { uint32_t calc_time; struct tm ref, cur; time_t r, c, now; uint8_t data[4]; ticalcs_info(_("Will set classic clock")); time(&now); memcpy(&ref, localtime(&now), sizeof(struct tm)); ref.tm_year = 1997 - 1900; ref.tm_mon = 0; ref.tm_yday = 0; ref.tm_mday = 1; ref.tm_wday = 3; ref.tm_hour = 0; ref.tm_min = 0; ref.tm_sec = 0; //ref.tm_isdst = 1; r = mktime(&ref); cur.tm_year = _clock->year - 1900; cur.tm_mon = _clock->month - 1; cur.tm_mday = _clock->day; cur.tm_hour = _clock->hours; cur.tm_min = _clock->minutes; cur.tm_sec = _clock->seconds; cur.tm_isdst = 1; c = mktime(&cur); calc_time = (uint32_t)difftime(c, r); ticalcs_strlcpy(update_->text, _("Setting clock..."), sizeof(update_->text)); update_label(); data[0] = MSB(MSW(calc_time)); data[1] = LSB(MSW(calc_time)); data[2] = MSB(LSW(calc_time)); data[3] = LSB(LSW(calc_time)); ret = dusb_cmd_s_param_set_r_data_ack(handle, DUSB_PID_CLK_SEC_SINCE_1997, 4, data); if (!ret) { data[0] = _clock->date_format == 3 ? 0 : _clock->date_format; ret = dusb_cmd_s_param_set_r_data_ack(handle, DUSB_PID_CLK_DATE_FMT, 1, data); if (!ret) { data[0] = _clock->time_format == 24 ? 1 : 0; ret = dusb_cmd_s_param_set_r_data_ack(handle, DUSB_PID_CLK_TIME_FMT, 1, data); if (!ret) { data[0] = _clock->state; ret = dusb_cmd_s_param_set_r_data_ack(handle, DUSB_PID_CLK_ON, 1, data); } } } } else if (new_clock) { uint8_t data[4]; ticalcs_info(_("Will set new clock")); ticalcs_strlcpy(update_->text, _("Setting clock..."), sizeof(update_->text)); update_label(); data[0] = _clock->date_format == 3 ? 0 : _clock->date_format; ret = dusb_cmd_s_param_set_r_data_ack(handle, DUSB_PID_CLK_DATE_FMT, 1, data); if (!ret) { data[0] = _clock->time_format == 24 ? 0x81 : 0x80; ret = dusb_cmd_s_param_set_r_data_ack(handle, DUSB_PID_CLK_TIME_FMT, 1, data); if (!ret) { data[0] = (uint8_t)(_clock->year >> 8); data[1] = _clock->year & 0xFF; ret = dusb_cmd_s_param_set_r_data_ack(handle, DUSB_PID_CLK_YEAR, 2, data); if (!ret) { data[0] = _clock->month; ret = dusb_cmd_s_param_set_r_data_ack(handle, DUSB_PID_CLK_MONTH, 1, data); if (!ret) { data[0] = _clock->day; ret = dusb_cmd_s_param_set_r_data_ack(handle, DUSB_PID_CLK_DAY, 1, data); if (!ret) { data[0] = _clock->hours; ret = dusb_cmd_s_param_set_r_data_ack(handle, DUSB_PID_CLK_HOURS, 1, data); if (!ret) { data[0] = _clock->minutes; ret = dusb_cmd_s_param_set_r_data_ack(handle, DUSB_PID_CLK_MINUTES, 1, data); if (!ret) { data[0] = _clock->seconds; ret = dusb_cmd_s_param_set_r_data_ack(handle, DUSB_PID_CLK_SECONDS, 1, data); if (!ret) { data[0] = _clock->state; ret = dusb_cmd_s_param_set_r_data_ack(handle, DUSB_PID_CLK_ON, 1, data); } } } } } } } } } else { ret = ERR_INVALID_PACKET; } } } dusb_cp_del_array(handle, size, params); return ret; } static int get_clock (CalcHandle* handle, CalcClock* _clock) { static const uint16_t pids[12] = { DUSB_PID_CLASSIC_CLK_SUPPORT, DUSB_PID_NEW_CLK_SUPPORT, DUSB_PID_CLK_ON, DUSB_PID_CLK_SEC_SINCE_1997, DUSB_PID_CLK_DATE_FMT, DUSB_PID_CLK_TIME_FMT, DUSB_PID_CLK_SECONDS, DUSB_PID_CLK_MINUTES, DUSB_PID_CLK_HOURS, DUSB_PID_CLK_DAY, DUSB_PID_CLK_MONTH, DUSB_PID_CLK_YEAR }; const int size = sizeof(pids) / sizeof(uint16_t); DUSBCalcParam **params; int ret; // get raw clock ticalcs_strlcpy(update_->text, _("Getting clock..."), sizeof(update_->text)); update_label(); params = dusb_cp_new_array(handle, size); ret = dusb_cmd_s_param_request(handle, size, pids); if (!ret) { ret = dusb_cmd_r_param_data(handle, size, params); if (!ret) { int classic_clock = !!params[0]->ok && !!!params[1]->ok; int new_clock = !!!params[0]->ok && !!params[1]->ok; if (!classic_clock && !new_clock) { ticalcs_warning(_("Could not determine clock type: %u %u"), params[0]->ok, params[1]->ok); } else if (classic_clock) { if (params[2]->ok && params[3]->ok && params[4]->ok && params[5]->ok) { struct tm ref, *cur; time_t r, c, now; uint8_t * data = params[3]->data; uint32_t calc_time = (((uint32_t)data[0]) << 24) | (((uint32_t)data[1]) << 16) | (((uint32_t)data[2]) << 8) | (data[3] << 0); ticalcs_info(_("Found valid classic clock")); time(&now); // retrieve current DST setting memcpy(&ref, localtime(&now), sizeof(struct tm)); ref.tm_year = 1997 - 1900; ref.tm_mon = 0; ref.tm_yday = 0; ref.tm_mday = 1; ref.tm_wday = 3; ref.tm_hour = 0; ref.tm_min = 0; ref.tm_sec = 0; //ref.tm_isdst = 1; r = mktime(&ref); c = r + calc_time; cur = localtime(&c); _clock->year = cur->tm_year + 1900; _clock->month = cur->tm_mon + 1; _clock->day = cur->tm_mday; _clock->hours = cur->tm_hour; _clock->minutes = cur->tm_min; _clock->seconds = cur->tm_sec; _clock->date_format = params[4]->data[0] == 0 ? 3 : params[4]->data[0]; _clock->time_format = params[5]->data[0] ? 24 : 12; _clock->state = params[2]->data[0]; } else { ticalcs_warning(_("Found classic clock but failed to retrieve its parameters: %u %u %u %u"), params[2]->ok, params[3]->ok, params[4]->ok, params[5]->ok); } } else if (new_clock) { if (params[6]->ok && params[7]->ok && params[8]->ok && params[9]->ok && params[10]->ok && params[11]->ok) { uint8_t * data = params[11]->data; ticalcs_info(_("Found valid new clock")); _clock->year = (((uint16_t)data[0]) << 8) | (data[1] << 0); _clock->month = params[10]->data[0]; _clock->day = params[9]->data[0]; _clock->hours = params[8]->data[0]; _clock->minutes = params[7]->data[0]; _clock->seconds = params[6]->data[0]; _clock->date_format = params[4]->data[0] == 0 ? 3 : params[4]->data[0]; _clock->time_format = params[5]->data[0] == 0x80 ? 12 : 24; _clock->state = params[2]->data[0]; } else { ticalcs_warning(_("Found new clock but failed to retrieve its parameters: %u %u %u %u %u %u"), params[6]->ok, params[7]->ok, params[8]->ok, params[9]->ok, params[10]->ok, params[11]->ok); } } else { ret = ERR_INVALID_PACKET; } } } dusb_cp_del_array(handle, size, params); return ret; } static int del_var (CalcHandle* handle, VarRequest* vr) { DUSBCalcAttr **attr; const int size = 1; char *utf8; int ret; utf8 = ticonv_varname_to_utf8(handle->model, vr->name, vr->type); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Deleting %s..."), utf8); ticonv_utf8_free(utf8); update_label(); attr = dusb_ca_new_array(handle, size); attr[0] = dusb_ca_new(handle, 0x0011, 4); attr[0]->data[0] = 0xF0; attr[0]->data[1] = 0x0B; attr[0]->data[2] = 0x00; attr[0]->data[3] = vr->type; ret = dusb_cmd_s_var_delete(handle, "", vr->name, size, CA(attr)); dusb_ca_del_array(handle, size, attr); if (!ret) { ret = dusb_cmd_r_data_ack(handle); } return ret; } static int rename_var (CalcHandle* handle, VarRequest* oldname, VarRequest* newname) { DUSBCalcAttr **attrs; const int size = 1; int ret; attrs = dusb_ca_new_array(handle, size); attrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE2, 4); attrs[0]->data[0] = 0xF0; attrs[0]->data[1] = 0x07; attrs[0]->data[2] = 0x00; attrs[0]->data[3] = oldname->type; ret = dusb_cmd_s_var_modify(handle, "", oldname->name, 1, CA(attrs), "", newname->name, 0, NULL); dusb_ca_del_array(handle, size, attrs); if (!ret) { ret = dusb_cmd_r_data_ack(handle); } return ret; } static int change_attr (CalcHandle* handle, VarRequest* vr, FileAttr attr) { DUSBCalcAttr **srcattrs; DUSBCalcAttr **dstattrs; int ret; srcattrs = dusb_ca_new_array(handle, 1); srcattrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE2, 4); srcattrs[0]->data[0] = 0xF0; srcattrs[0]->data[1] = 0x07; srcattrs[0]->data[2] = 0x00; srcattrs[0]->data[3] = vr->type; dstattrs = dusb_ca_new_array(handle, 1); dstattrs[0] = dusb_ca_new(handle, DUSB_AID_ARCHIVED, 1); /* use 0xff here rather than 0x01 to work around an OS bug */ dstattrs[0]->data[0] = (attr == ATTRB_ARCHIVED ? 0xff : 0x00); ret = dusb_cmd_s_var_modify(handle, "", vr->name, 1, CA(srcattrs), "", vr->name, 1, CA(dstattrs)); dusb_ca_del_array(handle, 1, dstattrs); dusb_ca_del_array(handle, 1, srcattrs); if (!ret) { ret = dusb_cmd_r_data_ack(handle); } return ret; } static int get_version (CalcHandle* handle, CalcInfos* infos) { static const uint16_t pids[] = { DUSB_PID_OS_MODE, DUSB_PID_DEVICE_TYPE, DUSB_PID_PRODUCT_NAME, DUSB_PID_MAIN_PART_ID, DUSB_PID_HW_VERSION, DUSB_PID_LANGUAGE_ID, DUSB_PID_SUBLANG_ID, DUSB_PID_BOOT_BUILD_NUMBER, DUSB_PID_BOOT_VERSION, DUSB_PID_OS_BUILD_NUMBER, DUSB_PID_OS_VERSION, DUSB_PID_PHYS_RAM, DUSB_PID_USER_RAM, DUSB_PID_FREE_RAM, DUSB_PID_PHYS_FLASH, DUSB_PID_USER_FLASH, DUSB_PID_FREE_FLASH, DUSB_PID_LCD_WIDTH, DUSB_PID_LCD_HEIGHT, DUSB_PID_BITS_PER_PIXEL, DUSB_PID_COLOR_AVAILABLE, DUSB_PID_BATTERY, DUSB_PID_EXACT_MATH, DUSB_PID_CLASSIC_CLK_SUPPORT }; const int size = sizeof(pids) / sizeof(uint16_t); DUSBCalcParam **params; int i = 0; int ret; ticalcs_strlcpy(update_->text, _("Getting version..."), sizeof(update_->text)); update_label(); memset(infos, 0, sizeof(CalcInfos)); params = dusb_cp_new_array(handle, size); // TODO rewrite this function to ask for parameters in multiple phases, starting with 0x000A, then // model-dependent sets of parameters. That's how TI-Connect CE 5.x does. ret = dusb_cmd_s_param_request(handle, size, pids); if (!ret) { ret = dusb_cmd_r_param_data(handle, size, params); if (!ret) { uint8_t product_id = 0; uint8_t has_boot_build_number = 0; uint8_t has_os_build_number = 0; if (params[i]->ok && params[i]->size == 1) { infos->run_level = params[i]->data[0]; infos->mask |= INFOS_RUN_LEVEL; } i++; if (params[i]->ok && params[i]->size == 2) { infos->device_type = params[i]->data[1]; infos->mask |= INFOS_DEVICE_TYPE; } i++; if (params[i]->ok) { ticalcs_strlcpy(infos->product_name, (char *)params[i]->data, sizeof(infos->product_name)); infos->mask |= INFOS_PRODUCT_NAME; } i++; if (params[i]->ok && params[i]->size == 5) { product_id = params[i]->data[0]; ticalcs_slprintf(infos->main_calc_id, sizeof(infos->main_calc_id), "%02X%02X%02X%02X%02X", product_id, params[i]->data[1], params[i]->data[2], params[i]->data[3], params[i]->data[4]); infos->mask |= INFOS_MAIN_CALC_ID; ticalcs_strlcpy(infos->product_id, infos->main_calc_id, sizeof(infos->product_id)); infos->mask |= INFOS_PRODUCT_ID; } i++; if (params[i]->ok && params[i]->size == 2) { infos->hw_version = (((uint16_t)params[i]->data[0]) << 8) | params[i]->data[1]; infos->mask |= INFOS_HW_VERSION; } i++; if (params[i]->ok && params[i]->size == 1) { infos->language_id = params[i]->data[0]; infos->mask |= INFOS_LANG_ID; } i++; if (params[i]->ok && params[i]->size == 1) { infos->sub_lang_id = params[i]->data[0]; infos->mask |= INFOS_SUB_LANG_ID; } i++; if (params[i]->ok && params[i]->size == 2) { has_boot_build_number = 1; } i++; if (params[i]->ok && params[i]->size >= 3) { if (!has_boot_build_number) { ticalcs_slprintf(infos->boot_version, sizeof(infos->boot_version), "%1u.%02u", params[i]->data[1], params[i]->data[2]); infos->mask |= INFOS_BOOT_VERSION; } else if (params[i]->size == 4) { ticalcs_slprintf(infos->boot_version, sizeof(infos->boot_version), "%1u.%1u.%1u.%04u", params[i]->data[1], params[i]->data[2], params[i]->data[3], (((uint16_t)(params[i - 1]->data[0])) << 8) | params[i - 1]->data[1]); infos->mask |= INFOS_BOOT_VERSION; } // else do nothing. } i++; if (params[i]->ok && params[i]->size == 2) { has_os_build_number = 1; } i++; if (params[i]->ok && params[i]->size >= 3) { if (!has_os_build_number) { ticalcs_slprintf(infos->os_version, sizeof(infos->os_version), "%1u.%02u", params[i]->data[1], params[i]->data[2]); infos->mask |= INFOS_OS_VERSION; } else if (params[i]->size == 4) { ticalcs_slprintf(infos->os_version, sizeof(infos->os_version), "%1u.%1u.%1u.%04u", params[i]->data[1], params[i]->data[2], params[i]->data[3], (((uint16_t)(params[i - 1]->data[0])) << 8) | params[i - 1]->data[1]); infos->mask |= INFOS_OS_VERSION; } // else do nothing. } i++; if (params[i]->ok && params[i]->size == 8) { infos->ram_phys = ( (((uint64_t)(params[i]->data[0])) << 56) | (((uint64_t)(params[i]->data[1])) << 48) | (((uint64_t)(params[i]->data[2])) << 40) | (((uint64_t)(params[i]->data[3])) << 32) | (((uint64_t)(params[i]->data[4])) << 24) | (((uint64_t)(params[i]->data[5])) << 16) | (((uint64_t)(params[i]->data[6])) << 8) | (((uint64_t)(params[i]->data[7])) )); infos->mask |= INFOS_RAM_PHYS; } i++; if (params[i]->ok && params[i]->size == 8) { infos->ram_user = ( (((uint64_t)(params[i]->data[0])) << 56) | (((uint64_t)(params[i]->data[1])) << 48) | (((uint64_t)(params[i]->data[2])) << 40) | (((uint64_t)(params[i]->data[3])) << 32) | (((uint64_t)(params[i]->data[4])) << 24) | (((uint64_t)(params[i]->data[5])) << 16) | (((uint64_t)(params[i]->data[6])) << 8) | (((uint64_t)(params[i]->data[7])) )); infos->mask |= INFOS_RAM_USER; } i++; if (params[i]->ok && params[i]->size == 8) { infos->ram_free = ( (((uint64_t)(params[i]->data[0])) << 56) | (((uint64_t)(params[i]->data[1])) << 48) | (((uint64_t)(params[i]->data[2])) << 40) | (((uint64_t)(params[i]->data[3])) << 32) | (((uint64_t)(params[i]->data[4])) << 24) | (((uint64_t)(params[i]->data[5])) << 16) | (((uint64_t)(params[i]->data[6])) << 8) | (((uint64_t)(params[i]->data[7])) )); infos->mask |= INFOS_RAM_FREE; } i++; if (params[i]->ok && params[i]->size == 8) { infos->flash_phys = ( (((uint64_t)(params[i]->data[0])) << 56) | (((uint64_t)(params[i]->data[1])) << 48) | (((uint64_t)(params[i]->data[2])) << 40) | (((uint64_t)(params[i]->data[3])) << 32) | (((uint64_t)(params[i]->data[4])) << 24) | (((uint64_t)(params[i]->data[5])) << 16) | (((uint64_t)(params[i]->data[6])) << 8) | (((uint64_t)(params[i]->data[7])) )); infos->mask |= INFOS_FLASH_PHYS; } i++; if (params[i]->ok && params[i]->size == 8) { infos->flash_user = ( (((uint64_t)(params[i]->data[0])) << 56) | (((uint64_t)(params[i]->data[1])) << 48) | (((uint64_t)(params[i]->data[2])) << 40) | (((uint64_t)(params[i]->data[3])) << 32) | (((uint64_t)(params[i]->data[4])) << 24) | (((uint64_t)(params[i]->data[5])) << 16) | (((uint64_t)(params[i]->data[6])) << 8) | (((uint64_t)(params[i]->data[7])) )); infos->mask |= INFOS_FLASH_USER; } i++; if (params[i]->ok && params[i]->size == 8) { infos->flash_free = ( (((uint64_t)(params[i]->data[0])) << 56) | (((uint64_t)(params[i]->data[1])) << 48) | (((uint64_t)(params[i]->data[2])) << 40) | (((uint64_t)(params[i]->data[3])) << 32) | (((uint64_t)(params[i]->data[4])) << 24) | (((uint64_t)(params[i]->data[5])) << 16) | (((uint64_t)(params[i]->data[6])) << 8) | (((uint64_t)(params[i]->data[7])) )); infos->mask |= INFOS_FLASH_FREE; } i++; if (params[i]->ok && params[i]->size == 2) { infos->lcd_width = ( (((uint16_t)(params[i]->data[ 0])) << 8) | (((uint16_t)(params[i]->data[ 1])) )); infos->mask |= INFOS_LCD_WIDTH; } i++; if (params[i]->ok && params[i]->size == 2) { infos->lcd_height = ( (((uint16_t)(params[i]->data[ 0])) << 8) | (((uint16_t)(params[i]->data[ 1])) )); infos->mask |= INFOS_LCD_HEIGHT; } i++; if (params[i]->ok && params[i]->size == 1) { infos->bits_per_pixel = params[i]->data[0]; infos->mask |= INFOS_BPP; } i++; if (params[i]->ok && params[i]->size == 1) { infos->color_screen = params[i]->data[0]; infos->mask |= INFOS_COLOR_SCREEN; } i++; if (params[i]->ok && params[i]->size == 1) { infos->battery = params[i]->data[0]; infos->mask |= INFOS_BATTERY; } i++; if (params[i]->ok && params[i]->size == 1) { infos->exact_math = params[i]->data[0]; infos->mask |= INFOS_EXACT_MATH; } i++; switch (product_id) { case PRODUCT_ID_TI84P: { infos->model = CALC_TI84P_USB; if (infos->hw_version >= 4) { ticalcs_warning(_("Unhandled 84+ family member with product_id=%d hw_version=%d"), product_id, infos->hw_version); } break; } case PRODUCT_ID_TI82A: { infos->model = CALC_TI82A_USB; if (infos->hw_version >= 4) { ticalcs_warning(_("Unhandled 84+ family member with product_id=%d hw_version=%d"), product_id, infos->hw_version); } break; } case PRODUCT_ID_TI84PCSE: { infos->model = CALC_TI84PC_USB; if (infos->hw_version < 4) { ticalcs_warning(_("Unhandled 84+ family member with product_id=%d hw_version=%d"), product_id, infos->hw_version); } break; } case PRODUCT_ID_TI83PCE: // and case PRODUCT_ID_TI84PCE: { if (infos->exact_math) { infos->model = CALC_TI83PCE_USB; } else { infos->model = CALC_TI84PCE_USB; } if (infos->hw_version < 6) { ticalcs_warning(_("Unhandled 84+ family member with product_id=%d hw_version=%d"), product_id, infos->hw_version); } break; } default: { // Default to generic 84+(SE). infos->model = CALC_TI84P_USB; ticalcs_warning(_("Unhandled 84+ family member with product_id=%d hw_version=%d"), product_id, infos->hw_version); break; } } infos->mask |= INFOS_CALC_MODEL; } } dusb_cp_del_array(handle, size, params); return ret; } const CalcFncts calc_84p_usb = { CALC_TI84P_USB, "TI84+", "TI-84 Plus", N_("TI-84 Plus thru DirectLink"), OPS_ISREADY | OPS_SCREEN | OPS_DIRLIST | OPS_VARS | OPS_FLASH | OPS_OS | OPS_IDLIST | OPS_ROMDUMP | OPS_CLOCK | OPS_DELVAR | OPS_VERSION | OPS_BACKUP | OPS_KEYS | OPS_RENAME | OPS_CHATTR | FTS_SILENT | FTS_MEMFREE | FTS_FLASH, PRODUCT_ID_TI84P, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "1P", /* send_backup */ "", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "", /* send_var_ns */ "", /* recv_var_ns */ "2P1L", /* send_app */ "2P1L", /* recv_app */ "2P", /* send_os */ "1L", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "1L", /* send_cert */ "1L", /* recv_cert */ "", /* rename */ "", /* chattr */ "2P", /* send_all_vars_backup */ "2P", /* recv_all_vars_backup */ }, &is_ready, &send_key, &execute, &recv_screen, &get_dirlist, &get_memfree, &send_backup, &noop_recv_backup, &send_var, &recv_var, &noop_send_var_ns, &noop_recv_var_ns, &send_flash, &recv_flash, &send_os, &recv_idlist, &dump_rom_1, &dump_rom_2, &set_clock, &get_clock, &del_var, &noop_new_folder, &get_version, &noop_send_cert, &noop_recv_cert, &rename_var, &change_attr, &send_all_vars_backup, &tixx_recv_all_vars_backup }; const CalcFncts calc_84pcse_usb = { CALC_TI84PC_USB, "TI84+CSE", "TI-84 Plus C Silver Edition", N_("TI-84 Plus C Silver Edition thru DirectLink"), OPS_ISREADY | OPS_SCREEN | OPS_DIRLIST | OPS_VARS | OPS_FLASH | OPS_OS | OPS_IDLIST | OPS_ROMDUMP | OPS_CLOCK | OPS_DELVAR | OPS_VERSION | OPS_BACKUP | OPS_KEYS | OPS_RENAME | OPS_CHATTR | FTS_SILENT | FTS_MEMFREE | FTS_FLASH, PRODUCT_ID_TI84PCSE, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "1P", /* send_backup */ "", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "", /* send_var_ns */ "", /* recv_var_ns */ "2P1L", /* send_app */ "2P1L", /* recv_app */ "2P", /* send_os */ "1L", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "1L", /* send_cert */ "1L", /* recv_cert */ "", /* rename */ "", /* chattr */ "2P", /* send_all_vars_backup */ "2P", /* recv_all_vars_backup */ }, &is_ready, &send_key, &execute, &recv_screen, &get_dirlist, &get_memfree, &send_backup, &noop_recv_backup, &send_var, &recv_var, &noop_send_var_ns, &noop_recv_var_ns, &send_flash, &recv_flash, &send_os, &recv_idlist, &dump_rom_1, &dump_rom_2, &set_clock, &get_clock, &del_var, &noop_new_folder, &get_version, &noop_send_cert, &noop_recv_cert, &rename_var, &change_attr, &send_all_vars_backup, &tixx_recv_all_vars_backup }; const CalcFncts calc_83pce_usb = { CALC_TI83PCE_USB, "TI83PCE", "TI-83 Premium CE", N_("TI-83 Premium CE thru DirectLink"), OPS_ISREADY | OPS_SCREEN | OPS_DIRLIST | OPS_VARS | OPS_FLASH | OPS_OS | /*OPS_IDLIST |*/ OPS_ROMDUMP | OPS_CLOCK | OPS_DELVAR | OPS_VERSION | OPS_BACKUP | OPS_KEYS | OPS_RENAME | OPS_CHATTR | FTS_SILENT | FTS_MEMFREE | FTS_FLASH, PRODUCT_ID_TI83PCE, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "", /* send_backup */ "", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "", /* send_var_ns */ "", /* recv_var_ns */ "2P1L", /* send_app */ "2P1L", /* recv_app */ "2P", /* send_os */ "1L", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "1L", /* send_cert */ "1L", /* recv_cert */ "", /* rename */ "", /* chattr */ "2P", /* send_all_vars_backup */ "2P", /* recv_all_vars_backup */ }, &is_ready, &send_key, &execute, &recv_screen, &get_dirlist, &get_memfree, &noop_send_backup, &noop_recv_backup, &send_var, &recv_var, &noop_send_var_ns, &noop_recv_var_ns, &send_flash_834pce, &recv_flash_834pce, &send_os_834pce, &recv_idlist, &dump_rom_1, &dump_rom_2, &set_clock, &get_clock, &del_var, &noop_new_folder, &get_version, &noop_send_cert, &noop_recv_cert, &rename_var, &change_attr, &send_all_vars_backup, &tixx_recv_all_vars_backup }; const CalcFncts calc_84pce_usb = { CALC_TI84PCE_USB, "TI84+CE", "TI-84 Plus CE", N_("TI-84 Plus CE thru DirectLink"), OPS_ISREADY | OPS_SCREEN | OPS_DIRLIST | OPS_VARS | OPS_FLASH | OPS_OS | /*OPS_IDLIST |*/ OPS_ROMDUMP | OPS_CLOCK | OPS_DELVAR | OPS_VERSION | OPS_BACKUP | OPS_KEYS | OPS_RENAME | OPS_CHATTR | FTS_SILENT | FTS_MEMFREE | FTS_FLASH, PRODUCT_ID_TI84PCE, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "", /* send_backup */ "", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "", /* send_var_ns */ "", /* recv_var_ns */ "2P1L", /* send_app */ "2P1L", /* recv_app */ "2P", /* send_os */ "1L", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "1L", /* send_cert */ "1L", /* recv_cert */ "", /* rename */ "", /* chattr */ "2P", /* send_all_vars_backup */ "2P", /* recv_all_vars_backup */ }, &is_ready, &send_key, &execute, &recv_screen, &get_dirlist, &get_memfree, &noop_send_backup, &noop_recv_backup, &send_var, &recv_var, &noop_send_var_ns, &noop_recv_var_ns, &send_flash_834pce, &recv_flash_834pce, &send_os_834pce, &recv_idlist, &dump_rom_1, &dump_rom_2, &set_clock, &get_clock, &del_var, &noop_new_folder, &get_version, &noop_send_cert, &noop_recv_cert, &rename_var, &change_attr, &send_all_vars_backup, &tixx_recv_all_vars_backup }; const CalcFncts calc_82a_usb = { CALC_TI82A_USB, "TI82A", "TI-82 Advanced", N_("TI-82 Advanced thru DirectLink"), OPS_ISREADY | OPS_SCREEN | OPS_DIRLIST | OPS_VARS | /*OPS_FLASH |*/ OPS_OS | OPS_IDLIST | /*OPS_ROMDUMP |*/ OPS_CLOCK | OPS_DELVAR | OPS_VERSION | OPS_BACKUP | OPS_KEYS | OPS_RENAME | OPS_CHATTR | FTS_SILENT | FTS_MEMFREE | FTS_FLASH, PRODUCT_ID_TI82A, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "1P", /* send_backup */ "", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "", /* send_var_ns */ "", /* recv_var_ns */ "2P1L", /* send_app */ "2P1L", /* recv_app */ "2P", /* send_os */ "1L", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "1L", /* send_cert */ "1L", /* recv_cert */ "", /* rename */ "", /* chattr */ "2P", /* send_all_vars_backup */ "2P", /* recv_all_vars_backup */ }, &is_ready, &send_key, &execute, &recv_screen, &get_dirlist, &get_memfree, &send_backup, &noop_recv_backup, &send_var, &recv_var, &noop_send_var_ns, &noop_recv_var_ns, &send_flash, &recv_flash, &send_os, &recv_idlist, &dump_rom_1, &dump_rom_2, &set_clock, &get_clock, &del_var, &noop_new_folder, &get_version, &noop_send_cert, &noop_recv_cert, &rename_var, &change_attr, &send_all_vars_backup, &tixx_recv_all_vars_backup }; const CalcFncts calc_84pt_usb = { CALC_TI84PT_USB, "TI84PT", "TI-84 Plus T", N_("TI-84 Plus T thru DirectLink"), OPS_ISREADY | OPS_SCREEN | OPS_DIRLIST | OPS_VARS | /*OPS_FLASH |*/ OPS_OS | OPS_IDLIST | /*OPS_ROMDUMP |*/ OPS_CLOCK | OPS_DELVAR | OPS_VERSION | OPS_BACKUP | OPS_KEYS | OPS_RENAME | OPS_CHATTR | FTS_SILENT | FTS_MEMFREE | FTS_FLASH, PRODUCT_ID_TI84PT, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "1P", /* send_backup */ "", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "", /* send_var_ns */ "", /* recv_var_ns */ "2P1L", /* send_app */ "2P1L", /* recv_app */ "2P", /* send_os */ "1L", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "1L", /* send_cert */ "1L", /* recv_cert */ "", /* rename */ "", /* chattr */ "2P", /* send_all_vars_backup */ "2P", /* recv_all_vars_backup */ }, &is_ready, &send_key, &execute, &recv_screen, &get_dirlist, &get_memfree, &send_backup, &noop_recv_backup, &send_var, &recv_var, &noop_send_var_ns, &noop_recv_var_ns, &send_flash, &recv_flash, &send_os, &recv_idlist, &dump_rom_1, &dump_rom_2, &set_clock, &get_clock, &del_var, &noop_new_folder, &get_version, &noop_send_cert, &noop_recv_cert, &rename_var, &change_attr, &send_all_vars_backup, &tixx_recv_all_vars_backup }; libticalcs-1.1.9+dfsg/src/calc_89t.c000066400000000000000000001114661327711501700171300ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs2 - hand-helds support library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * Copyright (C) 2006 Kevin Kofler * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* TI89 Titanium support thru DirectUsb link. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "ticalcs.h" #include "gettext.h" #include "internal.h" #include "logging.h" #include "error.h" #include "dusb_vpkt.h" #include "dusb_cmd.h" #include "rom89t.h" #include "romdump.h" #include "keys89.h" // Screen coordinates of the Titanium #define TI89T_ROWS 128 #define TI89T_COLS 240 #define TI89T_ROWS_VISIBLE 100 #define TI89T_COLS_VISIBLE 160 static int is_ready (CalcHandle* handle) { int ret; static const DUSBModeSet mode = DUSB_MODE_NORMAL; ret = dusb_cmd_s_mode_set(handle, mode); if (!ret) { ret = dusb_cmd_r_mode_ack(handle); } return ret; } static int send_key (CalcHandle* handle, uint32_t key) { int ret; PAUSE(25); // this pause is needed between 2 keys ret = dusb_cmd_s_execute(handle, "", "", DUSB_EID_KEY, "", (uint16_t)key); if (!ret) { ret = dusb_cmd_r_data_ack(handle); } return ret; } static int execute (CalcHandle* handle, VarEntry *ve, const char *args) { uint8_t action; int ret; switch (ve->type) { case TI89t_ASM: action = DUSB_EID_ASM; break; case TI89t_APPL: action = DUSB_EID_APP; break; default: action = DUSB_EID_PRGM; break; } ret = dusb_cmd_s_execute(handle, ve->folder, ve->name, action, args, 0); if (!ret) { ret = dusb_cmd_r_data_ack(handle); } return ret; } static int recv_screen (CalcHandle* handle, CalcScreenCoord* sc, uint8_t** bitmap) { static const uint16_t pid[] = { DUSB_PID_SCREENSHOT }; const int size = 1; DUSBCalcParam **param; int ret; *bitmap = (uint8_t *)ticalcs_alloc_screen(TI89T_COLS * TI89T_ROWS / 8); if (*bitmap == NULL) { return ERR_MALLOC; } sc->width = TI89T_COLS; sc->height = TI89T_ROWS; sc->clipped_width = TI89T_COLS_VISIBLE; sc->clipped_height = TI89T_ROWS_VISIBLE; sc->pixel_format = CALC_PIXFMT_MONO; param = dusb_cp_new_array(handle, size); ret = dusb_cmd_s_param_request(handle, size, pid); while (!ret) { ret = dusb_cmd_r_param_data(handle, size, param); if (!ret) { if (!param[0]->ok || param[0]->size != TI89T_COLS * TI89T_ROWS / 8) { ticalcs_free_screen(*bitmap); ret = ERR_INVALID_PACKET; break; } memcpy(*bitmap, param[0]->data, TI89T_COLS * TI89T_ROWS / 8); // Clip the unused part of the screen (nevertheless usable with asm programs) if (sc->format == SCREEN_CLIPPED) { int i, j, k; for (i = 0, j = 0; j < TI89T_ROWS_VISIBLE; j++) { for (k = 0; k < (TI89T_COLS_VISIBLE >> 3); k++) { (*bitmap)[i++] = (*bitmap)[j * (TI89T_COLS >> 3) + k]; } } } } break; } dusb_cp_del_array(handle, size, param); return ret; } static int get_dirlist (CalcHandle* handle, GNode** vars, GNode** apps) { static const uint16_t aids[] = { DUSB_AID_VAR_TYPE, DUSB_AID_ARCHIVED, DUSB_AID_4APPVAR, DUSB_AID_VAR_SIZE, DUSB_AID_LOCKED, DUSB_AID_UNKNOWN_42 }; const int size = sizeof(aids) / sizeof(uint16_t); int ret; DUSBCalcAttr **attr; GNode *root, *folder = NULL; char fldname[40]; char varname[40]; char folder_name[40] = ""; char *u1, *u2; ret = dirlist_init_trees(handle, vars, apps); if (ret) { return ret; } root = dirlist_create_append_node(NULL, apps); if (!root) { return ERR_MALLOC; } ret = dusb_cmd_s_dirlist_request(handle, size, aids); if (!ret) { for (;;) { VarEntry *ve; GNode *node; attr = dusb_ca_new_array(handle, size); ret = dusb_cmd_r_var_header(handle, fldname, varname, attr); if (ret) { // Not a real error. if (ret == ERR_EOT) { ret = 0; } dusb_ca_del_array(handle, size, attr); break; } ve = tifiles_ve_create(); ticalcs_strlcpy(ve->folder, fldname, sizeof(ve->folder)); ticalcs_strlcpy(ve->name, varname, sizeof(ve->name)); ve->size = ( (((uint32_t)(attr[3]->data[0])) << 24) | (((uint32_t)(attr[3]->data[1])) << 16) | (((uint32_t)(attr[3]->data[2])) << 8) | (((uint32_t)(attr[3]->data[3])) )); ve->type = (uint32_t)(attr[0]->data[3]); ve->attr = attr[1]->data[0] ? ATTRB_ARCHIVED : attr[4]->data[0] ? ATTRB_LOCKED : ATTRB_NONE; dusb_ca_del_array(handle, size, attr); if (ve->type == TI89_DIR) { ticalcs_strlcpy(folder_name, ve->folder, sizeof(folder_name)); ticalcs_strlcpy(ve->name, ve->folder, sizeof(ve->name)); ve->folder[0] = 0; folder = dirlist_create_append_node(ve, vars); } else { if (!strcmp(ve->folder, "main") && (!strcmp(ve->name, "regcoef") || !strcmp(ve->name, "regeq"))) { tifiles_ve_delete(ve); } else { node = dirlist_create_append_node(ve, (ve->type != TI89_APPL) ? &folder : &root); if (!node) { ret = ERR_MALLOC; break; } } } /* ticalcs_info(_("Name: %8s | Type: %8s | Attr: %i | Size: %08X"), ve->name, tifiles_vartype2string(handle->model, ve->type), ve->attr, ve->size); */ u1 = ticonv_varname_to_utf8(handle->model, ((VarEntry *) (folder->data))->name, -1); u2 = ticonv_varname_to_utf8(handle->model, ve->name, ve->type); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Parsing %s/%s"), u1, u2); ticonv_utf8_free(u2); ticonv_utf8_free(u1); update_label(); } } return ret; } static int get_memfree (CalcHandle* handle, uint32_t* ram, uint32_t* flash) { static const uint16_t pids[] = { DUSB_PID_FREE_RAM, DUSB_PID_FREE_FLASH }; const int size = sizeof(pids) / sizeof(uint16_t); DUSBCalcParam **params; int ret; params = dusb_cp_new_array(handle, size); if (params != NULL) { ret = dusb_cmd_s_param_request(handle, size, pids); if (!ret) { ret = dusb_cmd_r_param_data(handle, size, params); if (!ret) { if (params[0]->ok && params[0]->size == 8 && params[1]->ok && params[1]->size == 8) { *ram = ( (((uint32_t)(params[0]->data[4])) << 24) | (((uint32_t)(params[0]->data[5])) << 16) | (((uint32_t)(params[0]->data[6])) << 8) | (((uint32_t)(params[0]->data[7])) )); *flash = ( (((uint32_t)(params[1]->data[4])) << 24) | (((uint32_t)(params[1]->data[5])) << 16) | (((uint32_t)(params[1]->data[6])) << 8) | (((uint32_t)(params[1]->data[7])) )); } else { ret = ERR_INVALID_PACKET; } } } } else { ret = ERR_MALLOC; } dusb_cp_del_array(handle, size, params); return ret; } static int send_var (CalcHandle* handle, CalcMode mode, FileContent* content) { unsigned int i; int ret = 0; update_->cnt2 = 0; update_->max2 = content->num_entries; for (i = 0; i < content->num_entries; i++) { DUSBCalcAttr **attrs; const int nattrs = 4; VarEntry * entry = content->entries[i]; uint32_t pkt_size; uint32_t size; char varname[18]; if (!ticalcs_validate_varentry(entry)) { ticalcs_critical("%s: skipping invalid content entry #%u", __FUNCTION__, i); continue; } if (entry->action == ACT_SKIP) { ticalcs_info("%s: skipping variable #%u because requested", __FUNCTION__, i); continue; } if (entry->folder[0]) { tifiles_build_fullname(handle->model, varname, entry->folder, entry->name); } else { ticalcs_strlcpy(varname, entry->name, sizeof(varname)); } ticonv_varname_to_utf8_sn(handle->model, varname, update_->text, sizeof(update_->text), entry->type); update_label(); attrs = dusb_ca_new_array(handle, nattrs); attrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE, 4); attrs[0]->data[0] = 0xF0; attrs[0]->data[1] = 0x0C; attrs[0]->data[2] = 0x00; attrs[0]->data[3] = entry->type; attrs[1] = dusb_ca_new(handle, DUSB_AID_ARCHIVED, 1); attrs[1]->data[0] = entry->attr == ATTRB_ARCHIVED ? 1 : 0; attrs[2] = dusb_ca_new(handle, DUSB_AID_VAR_VERSION, 4); attrs[2]->data[0] = 0; attrs[3] = dusb_ca_new(handle, DUSB_AID_LOCKED, 1); attrs[3]->data[0] = entry->attr == ATTRB_LOCKED ? 1 : 0; size = entry->size; if (entry->size >= 65536U) { ticalcs_critical("%s: variable size %u is suspiciously large", __FUNCTION__, size); } if (!(size & 1)) { ret = is_ready(handle); } if (ret) { dusb_ca_del_array(handle, nattrs, attrs); break; } ret = dusb_cmd_s_rts(handle, entry->folder, entry->name, size, nattrs, CA(attrs)); dusb_ca_del_array(handle, nattrs, attrs); if (ret) { break; } ret = dusb_cmd_r_data_ack(handle); if (ret) { break; } /* When sending variables with an odd varsize, bufer has to be negotiatied again with an even value. Moreover, buffer has to be smaller. Ti-Connect always use 0x3A which is very small for big variables. I prefer using an heuristic value to optimize data rate. */ if (size & 1) { pkt_size = size / 10; pkt_size >>= 1; pkt_size <<= 1; if (pkt_size < 0x3a) { pkt_size = 0x3a; } ret = dusb_send_buf_size_request(handle, pkt_size); if (ret) { break; } ret = dusb_recv_buf_size_alloc(handle, NULL); if (ret) { break; } } ret = dusb_cmd_s_var_content(handle, size, entry->data); if (ret) { break; } ret = dusb_cmd_r_data_ack(handle); if (ret) { break; } ret = dusb_cmd_s_eot(handle); if (ret) { break; } update_->cnt2 = i + 1; update_->max2 = content->num_entries; update_->pbar(); PAUSE(50); // needed } return ret; } static int recv_var (CalcHandle* handle, CalcMode mode, FileContent* content, VarRequest* vr) { static const uint16_t aids[] = { DUSB_AID_ARCHIVED, DUSB_AID_VAR_VERSION, DUSB_AID_LOCKED }; const int naids = sizeof(aids) / sizeof(uint16_t); DUSBCalcAttr **attrs; const int nattrs = 1; char fldname[40], varname[40]; uint8_t *data; VarEntry *ve; int ret; ticonv_varname_to_utf8_sn(handle->model, vr->name, update_->text, sizeof(update_->text), vr->type); update_label(); attrs = dusb_ca_new_array(handle, nattrs); attrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE2, 4); attrs[0]->data[0] = 0xF0; attrs[0]->data[1] = 0x0C; attrs[0]->data[2] = 0x00; attrs[0]->data[3] = vr->type; ret = dusb_cmd_s_var_request(handle, vr->folder, vr->name, naids, aids, nattrs, CA(attrs)); dusb_ca_del_array(handle, nattrs, attrs); if (!ret) { attrs = dusb_ca_new_array(handle, naids); ret = dusb_cmd_r_var_header(handle, fldname, varname, attrs); if (!ret) { ret = dusb_cmd_r_var_content(handle, NULL, &data); if (!ret) { content->model = handle->model; ticalcs_strlcpy(content->comment, tifiles_comment_set_single(), sizeof(content->comment)); content->num_entries = 1; content->entries = tifiles_ve_create_array(1); ve = content->entries[0] = tifiles_ve_create(); memcpy(ve, vr, sizeof(VarEntry)); ve->data = tifiles_ve_alloc_data(ve->size); memcpy(ve->data, data, ve->size); g_free(data); } } dusb_ca_del_array(handle, naids, attrs); } return ret; } static int send_all_vars_backup (CalcHandle* handle, FileContent* content) { return send_var(handle, MODE_BACKUP, content); } static int send_flash (CalcHandle* handle, FlashContent* content) { FlashContent *ptr; DUSBCalcAttr **attrs; const int nattrs = 4; int ret = 0; // send all headers except license for (ptr = content; ptr != NULL; ptr = ptr->next) { if (ptr->data_type == TI89_LICENSE) { continue; } ticalcs_info(_("FLASH name: \"%s\""), ptr->name); ticalcs_info(_("FLASH size: %i bytes."), ptr->data_length); ticonv_varname_to_utf8_sn(handle->model, ptr->name, update_->text, sizeof(update_->text), ptr->data_type); update_label(); attrs = dusb_ca_new_array(handle, nattrs); attrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE, 4); attrs[0]->data[0] = 0xF0; attrs[0]->data[1] = 0x0C; attrs[0]->data[2] = 0x00; attrs[0]->data[3] = ptr->data_type; attrs[1] = dusb_ca_new(handle, DUSB_AID_ARCHIVED, 1); attrs[1]->data[0] = 0; attrs[2] = dusb_ca_new(handle, DUSB_AID_VAR_VERSION, 4); attrs[2]->data[3] = 1; attrs[3] = dusb_ca_new(handle, DUSB_AID_LOCKED, 1); attrs[3]->data[0] = 0; ret = dusb_cmd_s_rts(handle, "", ptr->name, ptr->data_length, nattrs, CA(attrs)); dusb_ca_del_array(handle, nattrs, attrs); if (ret) { break; } ret = dusb_cmd_r_data_ack(handle); if (ret) { break; } ret = dusb_cmd_s_var_content(handle, ptr->data_length, ptr->data_part); if (ret) { break; } ret = dusb_cmd_r_data_ack(handle); if (ret) { break; } ret = dusb_cmd_s_eot(handle); if (ret) { break; } } return ret; } static int recv_flash (CalcHandle* handle, FlashContent* content, VarRequest* vr) { static const uint16_t aids[] = { DUSB_AID_ARCHIVED, DUSB_AID_VAR_VERSION, DUSB_AID_LOCKED }; const int naids = sizeof(aids) / sizeof(uint16_t); DUSBCalcAttr **attrs; const int nattrs = 1; char fldname[40], varname[40]; uint8_t *data; uint32_t data_length; int ret; ticonv_varname_to_utf8_sn(handle->model, vr->name, update_->text, sizeof(update_->text), vr->type); update_label(); attrs = dusb_ca_new_array(handle, nattrs); attrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE2, 4); attrs[0]->data[0] = 0xF0; attrs[0]->data[1] = 0x0C; attrs[0]->data[2] = 0x00; attrs[0]->data[3] = vr->type; ret = dusb_cmd_s_var_request(handle, "", vr->name, naids, aids, nattrs, CA(attrs)); dusb_ca_del_array(handle, nattrs, attrs); if (!ret) { attrs = dusb_ca_new_array(handle, naids); ret = dusb_cmd_r_var_header(handle, fldname, varname, attrs); if (!ret) { ret = dusb_cmd_r_var_content(handle, &data_length, &data); if (!ret) { content->model = handle->model; ticalcs_strlcpy(content->name, vr->name, sizeof(content->name)); content->data_type = vr->type; content->device_type = DEVICE_TYPE_89; content->data_length = data_length; content->data_part = data; // Borrow this memory block. content->hw_id = handle->calc->product_id; // Do NOT g_free(data); } } dusb_ca_del_array(handle, naids, attrs); } return ret; } static int send_os (CalcHandle* handle, FlashContent* content) { DUSBModeSet mode = { 2, 1, 0, 0, 0x0fa0 }; //MODE_BASIC; uint32_t pkt_size = 0x3ff; uint32_t hdr_size = 0; uint32_t hdr_offset = 0; FlashContent *ptr; uint8_t *d; int i, r, q; int ret; // search for data header for (ptr = content; ptr != NULL; ptr = ptr->next) { if (ptr->data_type == TI89_AMS || ptr->data_type == TI89_APPL) { break; } } if (ptr == NULL) { return ERR_INVALID_PARAMETER; } if (ptr->data_type != TI89_AMS) { return ERR_INVALID_PARAMETER; } if (ptr->data_part == NULL) { return ERR_INVALID_PARAMETER; } // search for OS header (offset & size) hdr_offset = 2+4; for (i = hdr_offset, d = ptr->data_part; (d[i] != 0xCC) || (d[i+1] != 0xCC) || (d[i+2] != 0xCC) || (d[i+3] != 0xCC); i++); hdr_size = i - hdr_offset - 6; do { // switch to BASIC mode ret = dusb_cmd_s_mode_set(handle, mode); if (ret) { break; } ret = dusb_cmd_r_mode_ack(handle); if (ret) { break; } // start OS transfer ret = dusb_cmd_s_os_begin(handle, ptr->data_length); if (ret) { break; } ret = dusb_cmd_r_os_ack(handle, &pkt_size); if (ret) { break; } // send OS header/signature ret = dusb_cmd_s_os_header_89(handle, hdr_size, ptr->data_part + hdr_offset); if (ret) { break; } ret = dusb_cmd_r_os_ack(handle, &pkt_size); if (ret) { break; } // send OS data q = ptr->data_length / 0x2000; r = ptr->data_length % 0x2000; update_->cnt2 = 0; update_->max2 = q; for (i = 0; i < q; i++) { ret = dusb_cmd_s_os_data_89(handle, 0x2000, ptr->data_part + i*0x2000); if (ret) { goto end; } ret = dusb_cmd_r_data_ack(handle); if (ret) { goto end; } update_->cnt2 = i; update_->pbar(); } ret = dusb_cmd_s_os_data_89(handle, r, ptr->data_part + i*0x2000); if (ret) { break; } ret = dusb_cmd_r_data_ack(handle); if (ret) { break; } update_->cnt2 = i; update_->pbar(); ret = dusb_cmd_s_eot(handle); if (ret) { break; } PAUSE(500); ret = dusb_cmd_r_eot_ack(handle); } while (0); end: return ret; } static int recv_idlist (CalcHandle* handle, uint8_t* id) { static const uint16_t pid[] = { DUSB_PID_FULL_ID }; const int size = 1; DUSBCalcParam **params; int ret; ticalcs_strlcpy(update_->text, "ID-LIST", sizeof(update_->text)); update_label(); params = dusb_cp_new_array(handle, size); if (params != NULL) { ret = dusb_cmd_s_param_request(handle, size, pid); if (!ret) { ret = dusb_cmd_r_param_data(handle, size, params); if (!ret) { if (params[0]->ok && params[0]->size == 18) { memcpy(&id[0], &(params[0]->data[1]), 5); memcpy(&id[5], &(params[0]->data[7]), 5); memcpy(&id[10], &(params[0]->data[13]), 5); id[14] = '\0'; } else { ret = ERR_INVALID_PACKET; } } } } else { ret = ERR_MALLOC; } dusb_cp_del_array(handle, size, params); return ret; } static int dump_rom_1 (CalcHandle* handle) { DUSBCalcParam *param; int ret; // Go back to HOME screen param = dusb_cp_new(handle, DUSB_PID_HOMESCREEN, 1); param->data[0] = 1; ret = dusb_cmd_s_param_set(handle, param); dusb_cp_del(handle, param); if (!ret) { ret = dusb_cmd_r_data_ack(handle); if (!ret) { // Send dumping program ret = rd_send(handle, "romdump.89z", romDumpSize89t, romDump89t); PAUSE(1000); } } return ret; } static int dump_rom_2 (CalcHandle* handle, CalcDumpSize size, const char *filename) { int ret; ret = dusb_cmd_s_execute(handle, "main", "romdump", DUSB_EID_ASM, "", 0); if (!ret) { ret = dusb_cmd_r_data_ack(handle); if (!ret) { // Get dump ret = rd_dump(handle, filename); } } return ret; } static int set_clock (CalcHandle* handle, CalcClock* _clock) { DUSBCalcParam *param; uint32_t calc_time; struct tm ref, cur; time_t r, c, now; int ret; time(&now); memcpy(&ref, localtime(&now), sizeof(struct tm)); ref.tm_year = 1997 - 1900; ref.tm_mon = 0; ref.tm_yday = 0; ref.tm_mday = 1; ref.tm_wday = 3; ref.tm_hour = 0; ref.tm_min = 0; ref.tm_sec = 0; //ref.tm_isdst = 1; r = mktime(&ref); cur.tm_year = _clock->year - 1900; cur.tm_mon = _clock->month - 1; cur.tm_mday = _clock->day; cur.tm_hour = _clock->hours; cur.tm_min = _clock->minutes; cur.tm_sec = _clock->seconds; cur.tm_isdst = 1; c = mktime(&cur); calc_time = (uint32_t)difftime(c, r); ticalcs_strlcpy(update_->text, _("Setting clock..."), sizeof(update_->text)); update_label(); do { param = dusb_cp_new(handle, DUSB_PID_CLK_SEC_SINCE_1997, 4); param->data[0] = MSB(MSW(calc_time)); param->data[1] = LSB(MSW(calc_time)); param->data[2] = MSB(LSW(calc_time)); param->data[3] = LSB(LSW(calc_time)); ret = dusb_cmd_s_param_set(handle, param); dusb_cp_del(handle, param); if (ret) { break; } ret = dusb_cmd_r_data_ack(handle); if (ret) { break; } param = dusb_cp_new(handle, DUSB_PID_CLK_DATE_FMT, 1); param->data[0] = _clock->date_format == 3 ? 0 : _clock->date_format; ret = dusb_cmd_s_param_set(handle, param); dusb_cp_del(handle, param); if (ret) { break; } ret = dusb_cmd_r_data_ack(handle); if (ret) { break; } param = dusb_cp_new(handle, DUSB_PID_CLK_TIME_FMT, 1); param->data[0] = _clock->time_format == 24 ? 1 : 0; ret = dusb_cmd_s_param_set(handle, param); dusb_cp_del(handle, param); if (ret) { break; } ret = dusb_cmd_r_data_ack(handle); if (ret) { break; } param = dusb_cp_new(handle, DUSB_PID_CLK_ON, 1); param->data[0] = _clock->state; ret = dusb_cmd_s_param_set(handle, param); dusb_cp_del(handle, param); if (ret) { break; } ret = dusb_cmd_r_data_ack(handle); } while (0); return ret; } static int get_clock (CalcHandle* handle, CalcClock* _clock) { static const uint16_t pids[5] = { DUSB_PID_CLASSIC_CLK_SUPPORT, DUSB_PID_CLK_SEC_SINCE_1997, DUSB_PID_CLK_DATE_FMT, DUSB_PID_CLK_TIME_FMT, DUSB_PID_CLK_ON }; const int size = sizeof(pids) / sizeof(uint16_t); DUSBCalcParam **params; uint32_t calc_time; struct tm ref, *cur; time_t r, c, now; int ret; // get raw clock ticalcs_strlcpy(update_->text, _("Getting clock..."), sizeof(update_->text)); update_label(); params = dusb_cp_new_array(handle, size); ret = dusb_cmd_s_param_request(handle, size, pids); if (!ret) { ret = dusb_cmd_r_param_data(handle, size, params); if (!ret) { // It's not a fatal error if DUSB_PID_CLASSIC_CLK_SUPPORT is not handled. if (params[0]->ok && params[0]->size == 1) { if (!params[0]->data[0]) { ret = ERR_UNSUPPORTED; } } else { if ( params[1]->ok && params[0]->size == 4 && params[2]->ok && params[1]->size == 1 && params[3]->ok && params[2]->size == 1 && params[4]->ok && params[3]->size == 1) { // and computes calc_time = (((uint32_t)params[0]->data[0]) << 24) | (((uint32_t)params[0]->data[1]) << 16) | (((uint32_t)params[0]->data[2]) << 8) | (params[0]->data[3] << 0); time(&now); // retrieve current DST setting memcpy(&ref, localtime(&now), sizeof(struct tm)); ref.tm_year = 1997 - 1900; ref.tm_mon = 0; ref.tm_yday = 0; ref.tm_mday = 1; ref.tm_wday = 3; ref.tm_hour = 0; ref.tm_min = 0; ref.tm_sec = 0; //ref.tm_isdst = 1; r = mktime(&ref); c = r + calc_time; cur = localtime(&c); _clock->year = cur->tm_year + 1900; _clock->month = cur->tm_mon + 1; _clock->day = cur->tm_mday; _clock->hours = cur->tm_hour; _clock->minutes = cur->tm_min; _clock->seconds = cur->tm_sec; _clock->date_format = params[1]->data[0] == 0 ? 3 : params[1]->data[0]; _clock->time_format = params[2]->data[0] ? 24 : 12; _clock->state = params[3]->data[0]; } else { ret = ERR_INVALID_PACKET; } } } } dusb_cp_del_array(handle, size, params); return ret; } static int del_var (CalcHandle* handle, VarRequest* vr) { DUSBCalcAttr **attr; const int size = 1; char varname[68]; char *utf8; int ret; tifiles_build_fullname(handle->model, varname, vr->folder, vr->name); utf8 = ticonv_varname_to_utf8(handle->model, varname, vr->type); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Deleting %s..."), utf8); ticonv_utf8_free(utf8); update_label(); attr = dusb_ca_new_array(handle, size); attr[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE2, 4); attr[0]->data[0] = 0xF0; attr[0]->data[1] = 0x0C; attr[0]->data[2] = 0x00; attr[0]->data[3] = vr->type; ret = dusb_cmd_s_var_delete(handle, vr->folder, vr->name, size, CA(attr)); dusb_ca_del_array(handle, size, attr); if (!ret) { ret = dusb_cmd_r_data_ack(handle); } return ret; } static int rename_var (CalcHandle* handle, VarRequest* oldname, VarRequest* newname) { DUSBCalcAttr **attrs; const int size = 1; char varname1[68], varname2[68]; char *utf81, *utf82; int ret; tifiles_build_fullname(handle->model, varname1, oldname->folder, oldname->name); tifiles_build_fullname(handle->model, varname2, newname->folder, newname->name); utf81 = ticonv_varname_to_utf8(handle->model, varname1, oldname->type); utf82 = ticonv_varname_to_utf8(handle->model, varname2, newname->type); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Renaming %s to %s..."), utf81, utf82); ticonv_utf8_free(utf82); ticonv_utf8_free(utf81); update_label(); attrs = dusb_ca_new_array(handle, size); attrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE2, 4); attrs[0]->data[0] = 0xF0; attrs[0]->data[1] = 0x0C; attrs[0]->data[2] = 0x00; attrs[0]->data[3] = oldname->type; ret = dusb_cmd_s_var_modify(handle, oldname->folder, oldname->name, 1, CA(attrs), newname->folder, newname->name, 0, NULL); dusb_ca_del_array(handle, size, attrs); if (!ret) { ret = dusb_cmd_r_data_ack(handle); } return ret; } static int change_attr (CalcHandle* handle, VarRequest* vr, FileAttr attr) { DUSBCalcAttr **srcattrs; DUSBCalcAttr **dstattrs; int ret = 0; char *utf8; utf8 = ticonv_varname_to_utf8(handle->model, vr->folder, -1); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Changing attributes of %s..."), utf8); ticonv_utf8_free(utf8); update_label(); srcattrs = dusb_ca_new_array(handle, 1); srcattrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE2, 4); srcattrs[0]->data[0] = 0xF0; srcattrs[0]->data[1] = 0x0C; srcattrs[0]->data[2] = 0x00; srcattrs[0]->data[3] = vr->type; dstattrs = dusb_ca_new_array(handle, 2); dstattrs[0] = dusb_ca_new(handle, DUSB_AID_ARCHIVED, 1); dstattrs[0]->data[0] = (attr == ATTRB_ARCHIVED ? 0x01 : 0x00); dstattrs[1] = dusb_ca_new(handle, DUSB_AID_LOCKED, 1); dstattrs[1]->data[0] = (attr == ATTRB_LOCKED ? 0x01 : 0x00); ret = dusb_cmd_s_var_modify(handle, vr->folder, vr->name, 1, CA(srcattrs), vr->folder, vr->name, 2, CA(dstattrs)); dusb_ca_del_array(handle, 2, dstattrs); dusb_ca_del_array(handle, 1, srcattrs); if (!ret) { ret = dusb_cmd_r_data_ack(handle); } return ret; } static int new_folder (CalcHandle* handle, VarRequest* vr) { uint8_t data[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x40, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23 }; char *fldname = vr->folder; DUSBCalcParam *param; DUSBCalcAttr **attrs; const int nattrs = 4; char *utf8; int ret; utf8 = ticonv_varname_to_utf8(handle->model, vr->folder, -1); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Creating %s..."), utf8); ticonv_utf8_free(utf8); update_label(); // send empty expression in specified folder attrs = dusb_ca_new_array(handle, nattrs); attrs[0] = dusb_ca_new(handle, DUSB_AID_VAR_TYPE, 4); attrs[0]->data[0] = 0xF0; attrs[0]->data[1] = 0x0C; attrs[0]->data[2] = 0x00; attrs[0]->data[3] = 0x00; attrs[1] = dusb_ca_new(handle, DUSB_AID_ARCHIVED, 1); attrs[1]->data[0] = 0; attrs[2] = dusb_ca_new(handle, DUSB_AID_VAR_VERSION, 4); attrs[2]->data[0] = 0; attrs[3] = dusb_ca_new(handle, DUSB_AID_LOCKED, 1); attrs[3]->data[0] = 0; do { ret = dusb_cmd_s_rts(handle, fldname, "a1234567", sizeof(data), nattrs, CA(attrs)); dusb_ca_del_array(handle, nattrs, attrs); if (ret) { break; } ret = dusb_cmd_r_data_ack(handle); if (ret) { break; } ret = dusb_cmd_s_var_content(handle, sizeof(data), data); if (ret) { break; } ret = dusb_cmd_r_data_ack(handle); if (ret) { break; } ret = dusb_cmd_s_eot(handle); if (ret) { break; } // go back to HOME screen param = dusb_cp_new(handle, DUSB_PID_HOMESCREEN, 1); param->data[0] = 1; ret = dusb_cmd_s_param_set(handle, param); dusb_cp_del(handle, param); if (ret) { break; } ret = dusb_cmd_r_data_ack(handle); if (ret) { break; } // delete 'a1234567' variable ticalcs_strlcpy(vr->name, "a1234567", sizeof(vr->name)); ret = del_var(handle, vr); } while (0); return ret; } static int get_version (CalcHandle* handle, CalcInfos* infos) { static const uint16_t pids1[] = { DUSB_PID_PRODUCT_NAME, DUSB_PID_MAIN_PART_ID, DUSB_PID_HW_VERSION, DUSB_PID_LANGUAGE_ID, DUSB_PID_SUBLANG_ID, DUSB_PID_DEVICE_TYPE, DUSB_PID_BOOT_VERSION, DUSB_PID_OS_VERSION, DUSB_PID_PHYS_RAM, DUSB_PID_USER_RAM, DUSB_PID_FREE_RAM, DUSB_PID_PHYS_FLASH, DUSB_PID_FREE_FLASH, DUSB_PID_FREE_FLASH, DUSB_PID_LCD_WIDTH, DUSB_PID_LCD_HEIGHT, }; static const uint16_t pids2[] = { DUSB_PID_BITS_PER_PIXEL, DUSB_PID_BATTERY, DUSB_PID_OS_MODE, DUSB_PID_CLASSIC_CLK_SUPPORT }; // Titanium can't manage more than 16 parameters at a time const int size1 = sizeof(pids1) / sizeof(uint16_t); const int size2 = sizeof(pids2) / sizeof(uint16_t); DUSBCalcParam **params1; DUSBCalcParam **params2; int i = 0; int ret = 0; ticalcs_strlcpy(update_->text, _("Getting version..."), sizeof(update_->text)); update_label(); memset(infos, 0, sizeof(CalcInfos)); params1 = dusb_cp_new_array(handle, size1); params2 = dusb_cp_new_array(handle, size2); do { ret = dusb_cmd_s_param_request(handle, size1, pids1); if (!ret) { ret = dusb_cmd_r_param_data(handle, size1, params1); if (!ret) { ret = dusb_cmd_s_param_request(handle, size2, pids2); if (!ret) { ret = dusb_cmd_r_param_data(handle, size2, params2); } } } if (ret) { break; } if (params1[i]->ok) { ticalcs_strlcpy(infos->product_name, (char *)params1[i]->data, sizeof(infos->product_name)); infos->mask |= INFOS_PRODUCT_NAME; } i++; if (params1[i]->ok && params1[i]->size >= 18) { strncpy(infos->main_calc_id, (char*)&(params1[i]->data[1]), 5); strncpy(infos->main_calc_id+5, (char*)&(params1[i]->data[7]), 5); strncpy(infos->main_calc_id+10, (char*)&(params1[i]->data[13]), 4); infos->main_calc_id[14] = 0; infos->mask |= INFOS_MAIN_CALC_ID; ticalcs_strlcpy(infos->product_id, infos->main_calc_id, sizeof(infos->product_id)); infos->mask |= INFOS_PRODUCT_ID; } i++; if (params1[i]->ok && params1[i]->size == 2) { infos->hw_version = ((((uint16_t)params1[i]->data[0]) << 8) | params1[i]->data[1]) + 1; infos->mask |= INFOS_HW_VERSION; // hw version or model ? } i++; if (params1[i]->ok && params1[i]->size == 1) { infos->language_id = params1[i]->data[0]; infos->mask |= INFOS_LANG_ID; } i++; if (params1[i]->ok && params1[i]->size == 1) { infos->sub_lang_id = params1[i]->data[0]; infos->mask |= INFOS_SUB_LANG_ID; } i++; if (params1[i]->ok && params1[i]->size == 2) { infos->device_type = params1[i]->data[1]; infos->mask |= INFOS_DEVICE_TYPE; } i++; if (params1[i]->ok && params1[i]->size == 4) { ticalcs_slprintf(infos->boot_version, sizeof(infos->boot_version), "%1u.%02ub%u", params1[i]->data[1], params1[i]->data[2], params1[i]->data[3]); infos->mask |= INFOS_BOOT_VERSION; } i++; if (params1[i]->ok && params1[i]->size == 3) { ticalcs_slprintf(infos->os_version, sizeof(infos->os_version), "%1u.%02u", params1[i]->data[1], params1[i]->data[2]); infos->mask |= INFOS_OS_VERSION; } i++; if (params1[i]->ok && params1[i]->size == 8) { infos->ram_phys = ( (((uint64_t)(params1[i]->data[ 0])) << 56) | (((uint64_t)(params1[i]->data[ 1])) << 48) | (((uint64_t)(params1[i]->data[ 2])) << 40) | (((uint64_t)(params1[i]->data[ 3])) << 32) | (((uint64_t)(params1[i]->data[ 4])) << 24) | (((uint64_t)(params1[i]->data[ 5])) << 16) | (((uint64_t)(params1[i]->data[ 6])) << 8) | (((uint64_t)(params1[i]->data[ 7])) )); infos->mask |= INFOS_RAM_PHYS; } i++; if (params1[i]->ok && params1[i]->size == 8) { infos->ram_user = ( (((uint64_t)(params1[i]->data[ 0])) << 56) | (((uint64_t)(params1[i]->data[ 1])) << 48) | (((uint64_t)(params1[i]->data[ 2])) << 40) | (((uint64_t)(params1[i]->data[ 3])) << 32) | (((uint64_t)(params1[i]->data[ 4])) << 24) | (((uint64_t)(params1[i]->data[ 5])) << 16) | (((uint64_t)(params1[i]->data[ 6])) << 8) | (((uint64_t)(params1[i]->data[ 7])) )); infos->mask |= INFOS_RAM_USER; } i++; if (params1[i]->ok && params1[i]->size == 8) { infos->ram_free = ( (((uint64_t)(params1[i]->data[ 0])) << 56) | (((uint64_t)(params1[i]->data[ 1])) << 48) | (((uint64_t)(params1[i]->data[ 2])) << 40) | (((uint64_t)(params1[i]->data[ 3])) << 32) | (((uint64_t)(params1[i]->data[ 4])) << 24) | (((uint64_t)(params1[i]->data[ 5])) << 16) | (((uint64_t)(params1[i]->data[ 6])) << 8) | (((uint64_t)(params1[i]->data[ 7])) )); infos->mask |= INFOS_RAM_FREE; } i++; if (params1[i]->ok && params1[i]->size == 8) { infos->flash_phys = ( (((uint64_t)(params1[i]->data[ 0])) << 56) | (((uint64_t)(params1[i]->data[ 1])) << 48) | (((uint64_t)(params1[i]->data[ 2])) << 40) | (((uint64_t)(params1[i]->data[ 3])) << 32) | (((uint64_t)(params1[i]->data[ 4])) << 24) | (((uint64_t)(params1[i]->data[ 5])) << 16) | (((uint64_t)(params1[i]->data[ 6])) << 8) | (((uint64_t)(params1[i]->data[ 7])) )); infos->mask |= INFOS_FLASH_PHYS; } i++; if (params1[i]->ok && params1[i]->size == 8) { infos->flash_user = ( (((uint64_t)(params1[i]->data[ 0])) << 56) | (((uint64_t)(params1[i]->data[ 1])) << 48) | (((uint64_t)(params1[i]->data[ 2])) << 40) | (((uint64_t)(params1[i]->data[ 3])) << 32) | (((uint64_t)(params1[i]->data[ 4])) << 24) | (((uint64_t)(params1[i]->data[ 5])) << 16) | (((uint64_t)(params1[i]->data[ 6])) << 8) | (((uint64_t)(params1[i]->data[ 7])) )); infos->mask |= INFOS_FLASH_USER; } i++; if (params1[i]->ok && params1[i]->size == 8) { infos->flash_free = ( (((uint64_t)(params1[i]->data[ 0])) << 56) | (((uint64_t)(params1[i]->data[ 1])) << 48) | (((uint64_t)(params1[i]->data[ 2])) << 40) | (((uint64_t)(params1[i]->data[ 3])) << 32) | (((uint64_t)(params1[i]->data[ 4])) << 24) | (((uint64_t)(params1[i]->data[ 5])) << 16) | (((uint64_t)(params1[i]->data[ 6])) << 8) | (((uint64_t)(params1[i]->data[ 7])) )); infos->mask |= INFOS_FLASH_FREE; } i++; if (params1[i]->ok && params1[i]->size == 2) { infos->lcd_width = ( (((uint16_t)params1[i]->data[ 0]) << 8) | (((uint16_t)params1[i]->data[ 1]) )); infos->mask |= INFOS_LCD_WIDTH; } i++; if (params1[i]->ok && params1[i]->size == 2) { infos->lcd_height = ( (((uint16_t)params1[i]->data[ 0]) << 8) | (((uint16_t)params1[i]->data[ 1]) )); infos->mask |= INFOS_LCD_HEIGHT; } i++; i = 0; if (params2[i]->ok && params2[i]->size == 1) { infos->bits_per_pixel = params2[i]->data[0]; infos->mask |= INFOS_BPP; } if (params2[i]->ok && params2[i]->size == 1) { infos->battery = params2[i]->data[0]; infos->mask |= INFOS_BATTERY; } i++; if (params2[i]->ok && params2[i]->size == 1) { infos->run_level = params2[i]->data[0]; infos->mask |= INFOS_RUN_LEVEL; } i++; if (params2[i]->ok && params2[i]->size == 1) { infos->clock_support = params2[i]->data[0]; infos->mask |= INFOS_CLOCK_SUPPORT; } i++; infos->model = CALC_TI89T; infos->mask |= INFOS_CALC_MODEL; } while (0); dusb_cp_del_array(handle, size2, params2); dusb_cp_del_array(handle, size1, params1); return ret; } const CalcFncts calc_89t_usb = { CALC_TI89T_USB, "Titanium", "TI-89 Titanium", N_("TI-89 Titanium thru DirectLink"), OPS_ISREADY | OPS_SCREEN | OPS_DIRLIST | OPS_VARS | OPS_FLASH | OPS_OS | OPS_ROMDUMP | OPS_IDLIST | OPS_CLOCK | OPS_DELVAR | OPS_NEWFLD | OPS_VERSION | OPS_BACKUP | OPS_KEYS | OPS_RENAME | OPS_CHATTR | FTS_SILENT | FTS_MEMFREE | FTS_FLASH | FTS_FOLDER, PRODUCT_ID_TI89T, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "2P1L", /* send_backup */ "2P1L", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "2P1L", /* send_var_ns */ "1P1L", /* recv_var_ns */ "2P1L", /* send_app */ "2P1L", /* recv_app */ "2P", /* send_os */ "1L", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "1L", /* send_cert */ "1L", /* recv_cert */ "", /* rename */ "", /* chattr */ "2P1L", /* send_all_vars_backup */ "2P1L" /* recv_all_vars_backup */ }, &is_ready, &send_key, &execute, &recv_screen, &get_dirlist, &get_memfree, &noop_send_backup, &noop_recv_backup, &send_var, &recv_var, &noop_send_var_ns, &noop_recv_var_ns, &send_flash, &recv_flash, &send_os, &recv_idlist, &dump_rom_1, &dump_rom_2, &set_clock, &get_clock, &del_var, &new_folder, &get_version, &noop_send_cert, &noop_recv_cert, &rename_var, &change_attr, &send_all_vars_backup, &tixx_recv_all_vars_backup }; libticalcs-1.1.9+dfsg/src/calc_8x.c000066400000000000000000001023611327711501700170350ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: link_nul.c 1059 2005-05-14 09:45:42Z roms $ */ /* libticalcs2 - hand-helds support library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * Copyright (C) 2006 Kevin Kofler * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* TI82/83/85/86 support. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "ticalcs.h" #include "gettext.h" #include "internal.h" #include "logging.h" #include "error.h" #include "dbus_pkt.h" #include "cmdz80.h" #include "rom82.h" #include "rom83.h" #include "rom85.h" #include "rom86.h" #include "romdump.h" #include "keys83.h" #include "keys86.h" #define SEND_KEY(handle, scancode) ((handle->model < CALC_TI85) ? ti82_send_KEY(handle, scancode) : ti85_send_KEY(handle, scancode)) #define SEND_SCR(handle) ((handle->model < CALC_TI85) ? ti82_send_SCR(handle) : ti85_send_SCR(handle)) #define SEND_ACK(handle) ((handle->model < CALC_TI85) ? ti82_send_ACK(handle) : ti85_send_ACK(handle)) #define SEND_VAR(handle, varsize, vartype, varname) ((handle->model < CALC_TI85) ? ti82_send_VAR(handle, varsize, vartype, varname) : ti85_send_VAR(handle, varsize, vartype, varname)) #define SEND_XDP(handle, length, data) ((handle->model < CALC_TI85) ? ti82_send_XDP(handle, length, data) : ti85_send_XDP(handle, length, data)) #define SEND_REQ(handle, varsize, vartype, varname) ((handle->model < CALC_TI85) ? ti82_send_REQ(handle, varsize, vartype, varname) : ti85_send_REQ(handle, varsize, vartype, varname)) #define SEND_RTS(handle, varsize, vartype, varname) ((handle->model < CALC_TI85) ? ti82_send_RTS(handle, varsize, vartype, varname) : ti85_send_RTS(handle, varsize, vartype, varname)) #define SEND_CTS(handle) ((handle->model < CALC_TI85) ? ti82_send_CTS(handle) : ti85_send_CTS(handle)) #define SEND_EOT(handle) ((handle->model < CALC_TI85) ? ti82_send_EOT(handle) : ti85_send_EOT(handle)) #define RECV_ACK(handle, status) ((handle->model < CALC_TI85) ? ti82_recv_ACK(handle, status) : ti85_recv_ACK(handle, status)) #define RECV_VAR(handle, varsize, vartype, varname) ((handle->model < CALC_TI85) ? ti82_recv_VAR(handle, varsize, vartype, varname) : ti85_recv_VAR(handle, varsize, vartype, varname)) #define RECV_XDP(handle, length, data) ((handle->model < CALC_TI85) ? ti82_recv_XDP(handle, length, data) : ti85_recv_XDP(handle, length, data)) #define RECV_SKP(handle, rej_code) ((handle->model < CALC_TI85) ? ti82_recv_SKP(handle, rej_code) : ti85_recv_SKP(handle, rej_code)) #define RECV_ERR ti82_recv_ERR // Screen coordinates of the TI-80 #define TI80_ROWS 48 #define TI80_COLS 64 // Screen coordinates of the TI-82 #define TI82_ROWS 64 #define TI82_COLS 96 // Screen coordinates of the TI-83 #define TI83_ROWS 64 #define TI83_COLS 96 // Screen coordinates of the TI-85 #define TI85_ROWS 64 #define TI85_COLS 128 // Screen coordinates of the TI-86 #define TI86_ROWS 64 #define TI86_COLS 128 static int send_key (CalcHandle* handle, uint32_t key) { int ret; uint16_t status; ret = SEND_KEY(handle, (uint16_t)key); if (!ret) { ret = RECV_ACK(handle, &status); if (handle->model != CALC_TI83 && !ret) { ret = RECV_ACK(handle, &status); } } return ret; } static int execute (CalcHandle* handle, VarEntry *ve, const char* args) { int ret; // Go back to homescreen PAUSE(200); ret = send_key(handle, KEY83_Quit); if (!ret) { ret = send_key(handle, KEY83_Clear); if (!ret) { ret = send_key(handle, KEY83_Clear); } } if (!ret) { // Launch program by remote control if (ve->type == TI83_ASM) { ret = send_key(handle, KEY83_SendMBL); if (!ret) { ret = send_key(handle, KEY83_9); } } if (!ret) { ret = send_key(handle, KEY83_Exec); if (!ret) { unsigned int i; for (i = 0; !ret && i < strlen(ve->name); i++) { const CalcKey *ck = ticalcs_keys_83((ve->name)[i]); ret = send_key(handle, (uint32_t)(ck->normal.value)); } if (!ret) { ret = send_key(handle, KEY83_Enter); PAUSE(200); } } } } return ret; } static int recv_screen_80 (CalcHandle* handle, CalcScreenCoord* sc, uint8_t** bitmap) { int ret; uint8_t * buffer; *bitmap = (uint8_t *)ticalcs_alloc_screen(TI80_COLS * TI80_ROWS / 8); if (*bitmap == NULL) { return ERR_MALLOC; } sc->width = TI80_COLS; sc->height = TI80_ROWS; sc->clipped_width = TI80_COLS; sc->clipped_height = TI80_ROWS; sc->pixel_format = CALC_PIXFMT_MONO; ret = ti80_send_SCR(handle); if (!ret) { ret = ti80_recv_ACK(handle, NULL); if (!ret) { uint16_t max_cnt; ret = ti80_recv_XDP(handle, &max_cnt, handle->buffer); if (!ret) { int stripe, row, i = 0; buffer = (uint8_t *)(handle->buffer); for (stripe = 7; stripe >= 0; stripe--) { for (row = 0; row < TI80_ROWS; row++) { (*bitmap)[row * TI80_COLS / 8 + stripe] = buffer[i++]; } } } } } if (ret) { ticalcs_free_screen(*bitmap); *bitmap = NULL; } return ret; } static int recv_screen (CalcHandle* handle, CalcScreenCoord* sc, uint8_t** bitmap) { int ret; *bitmap = (uint8_t *)ticalcs_alloc_screen(65537U); if (*bitmap == NULL) { return ERR_MALLOC; } if (handle->model == CALC_TI82) { sc->width = TI82_COLS; sc->height = TI82_ROWS; sc->clipped_width = TI82_COLS; sc->clipped_height = TI82_ROWS; } else if (handle->model == CALC_TI83) { sc->width = TI83_COLS; sc->height = TI83_ROWS; sc->clipped_width = TI83_COLS; sc->clipped_height = TI83_ROWS; } else if (handle->model == CALC_TI85) { sc->width = TI85_COLS; sc->height = TI85_ROWS; sc->clipped_width = TI85_COLS; sc->clipped_height = TI85_ROWS; } else { sc->width = TI86_COLS; sc->height = TI86_ROWS; sc->clipped_width = TI86_COLS; sc->clipped_height = TI86_ROWS; } sc->pixel_format = CALC_PIXFMT_MONO; ret = SEND_SCR(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { uint16_t max_cnt; ret = RECV_XDP(handle, &max_cnt, *bitmap); if (!ret || ret == ERR_CHECKSUM) // problem with checksum { *bitmap = ticalcs_realloc_screen(*bitmap, (handle->model < CALC_TI85) ? TI82_COLS * TI82_ROWS / 8 : TI85_COLS * TI85_ROWS / 8); ret = SEND_ACK(handle); } } } if (ret) { ticalcs_free_screen(*bitmap); *bitmap = NULL; } return ret; } static int get_dirlist (CalcHandle* handle, GNode** vars, GNode** apps) { int ret; uint16_t unused; TreeInfo *ti; GNode *folder, *node; char *utf8; ret = dirlist_init_trees(handle, vars, apps); if (ret) { return ret; } ti = (*vars)->data; ret = SEND_REQ(handle, 0x0000, (handle->model == CALC_TI83) ? TI83_DIR : TI86_DIR, "\0\0\0\0\0\0\0"); if (!ret) { ret = RECV_ACK(handle, &unused); if (!ret) { ret = RECV_XDP(handle, &unused, handle->buffer2); if (!ret) { ret = SEND_ACK(handle); } } } if (!ret) { VarEntry *ve; uint8_t * mem = (uint8_t *)handle->buffer2; folder = dirlist_create_append_node(NULL, vars); if (handle->model == CALC_TI83) { ti->mem_free = (((uint32_t)(mem[1])) << 8) | mem[0]; // Clamp mem_free to a 16-bit value. // Add permanent variables (Window, RclWindow, TblSet aka WINDW, ZSTO, TABLE) ve = tifiles_ve_create(); ve->type = TI83_WINDW; node = dirlist_create_append_node(ve, &folder); if (node != NULL) { ve = tifiles_ve_create(); ve->type = TI83_ZSTO; node = dirlist_create_append_node(ve, &folder); if (node != NULL) { ve = tifiles_ve_create(); ve->type = TI83_TABLE; node = dirlist_create_append_node(ve, &folder); } } } else { ti->mem_free = (((uint32_t)(mem[0])) << 16) | (((uint32_t)(mem[1])) << 8) | mem[2]; // Add permanent variables (Func, Pol, Param, DifEq, ZRCL as WIND, WIND, WIND, WIND, WIND) ve = tifiles_ve_create(); ve->type = TI86_FUNC; node = dirlist_create_append_node(ve, &folder); if (node != NULL) { ve = tifiles_ve_create(); ve->type = TI86_POL; node = dirlist_create_append_node(ve, &folder); if (node != NULL) { ve = tifiles_ve_create(); ve->type = TI86_PARAM; node = dirlist_create_append_node(ve, &folder); if (node != NULL) { ve = tifiles_ve_create(); ve->type = TI86_DIFEQ; node = dirlist_create_append_node(ve, &folder); if (node != NULL) { ve = tifiles_ve_create(); ve->type = TI86_ZRCL; node = dirlist_create_append_node(ve, &folder); } } } } } if (!node) { ret = ERR_MALLOC; } else { for (;;) { uint16_t ve_size; int ret2; ve = tifiles_ve_create(); ret = RECV_VAR(handle, &ve_size, &ve->type, ve->name); ve->size = ve_size; ret2 = SEND_ACK(handle); if (ret) { if (ret == ERR_EOT) // end of transmission { ret = 0; } error: tifiles_ve_delete(ve); break; } if (ret2) { ret = ret2; goto error; } node = dirlist_create_append_node(ve, &folder); if (!node) { return ERR_MALLOC; } utf8 = ticonv_varname_to_utf8(handle->model, ve->name, ve->type); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Parsing %s"), utf8); ticonv_utf8_free(utf8); update_label(); } } } return ret; } static int get_memfree (CalcHandle* handle, uint32_t* ram, uint32_t* flash) { int ret; uint16_t unused; *ram = -1; *flash = -1; ret = SEND_REQ(handle, 0x0000, (handle->model == CALC_TI83) ? TI83_DIR : TI86_DIR, "\0\0\0\0\0\0\0"); if (!ret) { ret = RECV_ACK(handle, &unused); if (!ret) { ret = RECV_XDP(handle, &unused, handle->buffer2); if (!ret) { ret = SEND_EOT(handle); if (!ret) { uint8_t * mem = (uint8_t *)handle->buffer2; if (handle->model == CALC_TI83) { *ram = (((uint32_t)(mem[1])) << 8) | mem[0]; // Clamp mem_free to a 16-bit value. } else // if (handle->model == CALC_TI86) { *ram = (((uint32_t)(mem[0])) << 16) | (((uint32_t)(mem[1])) << 8) | mem[2]; } } } } } return ret; } static int send_backup (CalcHandle* handle, BackupContent* content) { int ret; uint16_t length; char varname[9]; uint8_t rej_code; uint16_t status; length = content->data_length1; varname[0] = LSB(content->data_length2); varname[1] = MSB(content->data_length2); varname[2] = LSB(content->data_length3); varname[3] = MSB(content->data_length3); varname[4] = LSB((handle->model != CALC_TI86) ? content->mem_address : content->data_length4); varname[5] = MSB((handle->model != CALC_TI86) ? content->mem_address : content->data_length4); varname[6] = 0; varname[7] = 0; varname[8] = 0; do { if (handle->model == CALC_TI83) { ret = SEND_RTS(handle, content->data_length1, TI83_BKUP, varname); } else { ret = SEND_VAR(handle, content->data_length1, (handle->model == CALC_TI82) ? TI82_BKUP : ((handle->model == CALC_TI85) ? TI85_BKUP : TI86_BKUP), varname); } if (!ret) { ret = RECV_ACK(handle, &status); } if (ret) { break; } if (handle->model == CALC_TI83) { ret = RECV_SKP(handle, &rej_code); } else { ticalcs_strlcpy(update_->text, _("Waiting for user's action..."), sizeof(update_->text)); update_label(); do { // wait for user's action update_refresh(); if (update_->cancel) { ret = ERR_ABORT; break; } ret = RECV_SKP(handle, &rej_code); } while (ret == ERROR_READ_TIMEOUT); } if (!ret) { ret = SEND_ACK(handle); } if (ret) { break; } switch (rej_code) { case DBUS_REJ_EXIT: case DBUS_REJ_SKIP: ret = ERR_ABORT; break; case DBUS_REJ_MEMORY: ret = ERR_OUT_OF_MEMORY; // Fall through. case 0: // CTS break; default: ret = ERR_VAR_REJECTED; break; } if (ret) { break; } update_->text[0] = 0; update_label(); update_->cnt2 = 0; update_->max2 = (handle->model != CALC_TI86) ? 3 : 4; update_->pbar(); ret = SEND_XDP(handle, content->data_length1, content->data_part1); if (!ret) { ret = RECV_ACK(handle, &status); } if (ret) { break; } update_->cnt2++; update_->pbar(); ret = SEND_XDP(handle, content->data_length2, content->data_part2); if (!ret) { ret = RECV_ACK(handle, &status); } if (ret) { break; } update_->cnt2++; update_->pbar(); if (content->data_length3) { ret = SEND_XDP(handle, content->data_length3, content->data_part3); if (!ret) { ret = RECV_ACK(handle, &status); } if (ret) { break; } } update_->cnt2++; update_->pbar(); if (handle->model == CALC_TI86) { ret = SEND_XDP(handle, content->data_length4, content->data_part4); if (!ret) { ret = RECV_ACK(handle, &status); } if (ret) { break; } update_->cnt2++; update_->pbar(); } if (handle->model == CALC_TI83) { ret = SEND_ACK(handle); } else if (handle->model == CALC_TI85) { ret = SEND_EOT(handle); } } while(0); return ret; } static int recv_backup (CalcHandle* handle, BackupContent* content) { int ret; char varname[9]; content->model = handle->model; ticalcs_strlcpy(content->comment, tifiles_comment_set_backup(), sizeof(content->comment)); if (handle->model == CALC_TI83) { ret = SEND_REQ(handle, 0x0000, TI83_BKUP, "\0\0\0\0\0\0\0"); if (!ret) { ret = RECV_ACK(handle, NULL); } if (ret) { return ret; } } else { ticalcs_strlcpy(update_->text, _("Waiting for backup..."), sizeof(update_->text)); update_label(); } varname[0] = 0; do { ret = RECV_VAR(handle, &(content->data_length1), &content->type, varname); if (ret) { break; } content->data_length2 = (uint8_t)varname[0] | (((uint16_t)(uint8_t)varname[1]) << 8); content->data_length3 = (uint8_t)varname[2] | (((uint16_t)(uint8_t)varname[3]) << 8); if (handle->model != CALC_TI86) { content->mem_address = (uint8_t)varname[4] | (((uint16_t)(uint8_t)varname[5]) << 8); } else { content->data_length4 = (uint8_t)varname[4] | (((uint16_t)(uint8_t)varname[5]) << 8); } ret = SEND_ACK(handle); if (!ret) { ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); } } if (ret) { break; } update_->text[0] = 0; update_label(); update_->cnt2 = 0; update_->max2 = (handle->model != CALC_TI86) ? 3 : 4; update_->pbar(); content->data_part1 = tifiles_ve_alloc_data(65536); ret = RECV_XDP(handle, &content->data_length1, content->data_part1); if (!ret) { ret = SEND_ACK(handle); } if (ret) { break; } update_->cnt2++; update_->pbar(); content->data_part2 = tifiles_ve_alloc_data(65536); ret = RECV_XDP(handle, &content->data_length2, content->data_part2); if (!ret) { ret = SEND_ACK(handle); } if (ret) { break; } update_->cnt2++; update_->pbar(); if (content->data_length3) { content->data_part3 = tifiles_ve_alloc_data(65536); ret = RECV_XDP(handle, &content->data_length3, content->data_part3); if (!ret) { ret = SEND_ACK(handle); } if (ret) { break; } } else { content->data_part3 = NULL; } update_->cnt2++; update_->pbar(); if (handle->model != CALC_TI86) { content->data_part4 = NULL; } else { content->data_part4 = tifiles_ve_alloc_data(65536); ret = RECV_XDP(handle, &content->data_length4, content->data_part4); if (!ret) { ret = SEND_ACK(handle); } if (ret) { break; } update_->cnt2++; update_->pbar(); } } while(0); return ret; } static int send_var_ns (CalcHandle* handle, CalcMode mode, FileContent* content) { unsigned int i; int ret = 0; uint8_t rej_code; uint16_t status; if ((mode & MODE_SEND_EXEC_ASM) && content->num_entries != 1) { ticalcs_critical("no variable to execute"); return -1; } update_->cnt2 = 0; update_->max2 = content->num_entries; for (i = 0; i < content->num_entries; i++) { VarEntry *entry = content->entries[i]; uint16_t size; if (!ticalcs_validate_varentry(entry)) { ticalcs_critical("%s: skipping invalid content entry #%u", __FUNCTION__, i); continue; } if (entry->action == ACT_SKIP) { ticalcs_info("%s: skipping variable #%u because requested", __FUNCTION__, i); continue; } if (entry->size >= 65536U) { ticalcs_critical("%s: oversized variable has size %u, clamping to 65535", __FUNCTION__, entry->size); size = 65535; } else { size = (uint16_t)entry->size; } ret = SEND_VAR(handle, size, entry->type, entry->name); if (!ret) { ret = RECV_ACK(handle, &status); } if (ret) { break; } ticalcs_strlcpy(update_->text, _("Waiting for user's action..."), sizeof(update_->text)); update_label(); do { // wait for user's action update_refresh(); if (update_->cancel) { ret = ERR_ABORT; break; } ret = RECV_SKP(handle, &rej_code); } while (ret == ERROR_READ_TIMEOUT); if (!ret) { ret = SEND_ACK(handle); } if (ret) { break; } switch (rej_code) { case DBUS_REJ_EXIT: ret = ERR_ABORT; break; case DBUS_REJ_SKIP: if (mode & MODE_SEND_EXEC_ASM) { ret = ERR_ABORT; break; } continue; case DBUS_REJ_MEMORY: ret = ERR_OUT_OF_MEMORY; // Fall through. case 0: // CTS break; default: ret = ERR_VAR_REJECTED; break; } if (ret) { break; } ticonv_varname_to_utf8_sn(handle->model, entry->name, update_->text, sizeof(update_->text), entry->type); update_label(); ret = SEND_XDP(handle, size, entry->data); if (!ret) { ret = RECV_ACK(handle, &status); } if (ret) { break; } ticalcs_info("Sent variable #%u", i); update_->cnt2 = i+1; update_->max2 = content->num_entries; update_->pbar(); } if (mode & MODE_SEND_EXEC_ASM) { ret = ti82_send_asm_exec(handle, content->entries[0]); if (!ret) { ret = RECV_ERR(handle, &status); if (!ret) { ret = SEND_ACK(handle); } } } else if ((mode & MODE_SEND_ONE_VAR) || (mode & MODE_SEND_LAST_VAR)) { ret = SEND_EOT(handle); if (!ret) { ret = RECV_ACK(handle, NULL); } } return ret; } static int send_var_8285 (CalcHandle* handle, CalcMode mode, FileContent* content) { return send_var_ns(handle, mode, content); } static int send_var_8386 (CalcHandle* handle, CalcMode mode, FileContent* content) { int ret = 0; unsigned int i; uint8_t rej_code; uint16_t status; update_->cnt2 = 0; update_->max2 = content->num_entries; for (i = 0; !ret && i < content->num_entries; i++) { VarEntry *entry = content->entries[i]; uint16_t size; if (!ticalcs_validate_varentry(entry)) { ticalcs_critical("%s: skipping invalid content entry #%u", __FUNCTION__, i); continue; } if (entry->action == ACT_SKIP) { ticalcs_info("%s: skipping variable #%u because requested", __FUNCTION__, i); continue; } if (entry->size >= 65536U) { ticalcs_critical("%s: oversized variable has size %u, clamping to 65535", __FUNCTION__, entry->size); size = 65535; } else { size = (uint16_t)entry->size; } ret = SEND_RTS(handle, size, entry->type, entry->name); if (!ret) { ret = RECV_ACK(handle, &status); if (!ret) { ret = RECV_SKP(handle, &rej_code); if (!ret) { ret = SEND_ACK(handle); } } } if (ret) { break; } switch (rej_code) { case DBUS_REJ_EXIT: ret = ERR_ABORT; break; case DBUS_REJ_SKIP: continue; case DBUS_REJ_MEMORY: ret = ERR_OUT_OF_MEMORY; // Fall through. case 0: // CTS break; default: ret = ERR_VAR_REJECTED; break; } if (ret) { break; } ticonv_varname_to_utf8_sn(handle->model, entry->name, update_->text, sizeof(update_->text), entry->type); update_label(); ret = SEND_XDP(handle, size, entry->data); if (!ret) { ret = RECV_ACK(handle, &status); if (!ret) { ret = SEND_EOT(handle); if (!ret) { ticalcs_info("Sent variable #%u", i); update_->cnt2 = i+1; update_->max2 = content->num_entries; update_->pbar(); } } } } return ret; } static int recv_var (CalcHandle* handle, CalcMode mode, FileContent* content, VarRequest* vr) { int ret; uint16_t unused; VarEntry *ve; uint16_t ve_size; content->model = handle->model; ticalcs_strlcpy(content->comment, tifiles_comment_set_single(), sizeof(content->comment)); content->num_entries = 1; content->entries = tifiles_ve_create_array(1); ve = content->entries[0] = tifiles_ve_create(); memcpy(ve, vr, sizeof(VarEntry)); ticonv_varname_to_utf8_sn(handle->model, vr->name, update_->text, sizeof(update_->text), vr->type); update_label(); do { // silent request ret = SEND_REQ(handle, (uint16_t)vr->size, vr->type, vr->name); if (!ret) { ret = RECV_ACK(handle, &unused); if (!ret) { ret = RECV_VAR(handle, &ve_size, &ve->type, ve->name); } } if (ret) { break; } ve->size = ve_size; ret = SEND_ACK(handle); if (!ret) { ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); } } if (ret) { break; } ve->data = tifiles_ve_alloc_data(ve->size); ret = RECV_XDP(handle, &ve_size, ve->data); if (!ret) { ve->size = ve_size; ret = SEND_ACK(handle); } } while(0); return ret; } static int recv_var_ns (CalcHandle* handle, CalcMode mode, FileContent* content, VarEntry** vr) { int nvar = 0; int ret = 0; uint16_t ve_size; ticalcs_strlcpy(update_->text, _("Waiting for var(s)..."), sizeof(update_->text)); update_label(); content->model = handle->model; content->num_entries = 0; for (nvar = 0;; nvar++) { VarEntry *ve = tifiles_ve_create(); int ret2; do { update_refresh(); if (update_->cancel) { ret = ERR_ABORT; goto error; } ret = RECV_VAR(handle, &ve_size, &(ve->type), ve->name); ve->size = ve_size; } while (ret == ERROR_READ_TIMEOUT); ret2 = SEND_ACK(handle); if (ret) { if (ret == ERR_EOT) // end of transmission { ret = 0; } goto error; } if (ret2) { ret = ret2; goto error; } ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ticonv_varname_to_utf8_sn(handle->model, ve->name, update_->text, sizeof(update_->text), ve->type); update_label(); ve->data = tifiles_ve_alloc_data(ve->size); ret = RECV_XDP(handle, &ve_size, ve->data); if (!ret) { ve->size = ve_size; ret = SEND_ACK(handle); } } } if (!ret) { tifiles_content_add_entry(content, ve); } else { error: tifiles_ve_delete(ve); break; } } if (nvar == 1) { ticalcs_strlcpy(content->comment, tifiles_comment_set_single(), sizeof(content->comment)); *vr = tifiles_ve_dup(content->entries[0]); } else { ticalcs_strlcpy(content->comment, tifiles_comment_set_group(), sizeof(content->comment)); *vr = NULL; } return ret; } static int dump_rom_1 (CalcHandle* handle) { // Send dumping program if (handle->model == CALC_TI82) { return rd_send(handle, "romdump.82p", romDumpSize82, romDump82); } else if (handle->model == CALC_TI83) { return rd_send(handle, "romdump.83p", romDumpSize83, romDump83); } else if (handle->model == CALC_TI85) { return rd_send(handle, "romdump.85s", romDumpSize85, romDump85); } else { return rd_send(handle, "romdump.86p", romDumpSize86, romDump86); } } static int dump_rom_2 (CalcHandle* handle, CalcDumpSize size, const char *filename) { int ret = 0; unsigned int i; if (handle->model == CALC_TI83) { static const uint16_t keys[] = { 0x40, 0x09, 0x09, /* Quit, Clear, Clear, */ 0xFE63, 0x97, 0xDA, /* Send(, 9, prgm */ 0xAB, 0xA8, 0xA6, 0x9D, /* R, O, M, D */ 0xAE, 0xA6, 0xA9, 0x05 /* U, M, P, Enter */ }; // Launch program by remote control for (i = 0; !ret && i < sizeof(keys) / sizeof(keys[0]); i++) { ret = send_key(handle, (uint32_t)(keys[i])); PAUSE(100); } } else if (handle->model == CALC_TI86) { static const uint16_t keys[] = { 0x76, 0x08, 0x08, /* Quit, Clear, Clear, */ 0x28, 0x3A, 0x34, 0x11, /* A, S, M, (, */ 0x39, 0x36, 0x34, 0x2B, /* R, O, M, D, */ 0x56, 0x4E, 0x51, 0x12, /* u, m, p, ), */ 0x06 /* Enter */ }; uint16_t dummy; // Launch program by remote control for (i = 0; !ret && i < (sizeof(keys) / sizeof(keys[0])) - 1; i++) { ret = send_key(handle, (uint32_t)(keys[i])); } if (!ret) { ret = SEND_KEY(handle, keys[i]); if (!ret) { ret = RECV_ACK(handle, &dummy); } PAUSE(200); } } if (!ret) { // Get dump ret = rd_dump(handle, filename); // TI-86: normally there would be another ACK after the program exits, but the ROM dumper disables that behaviour. } return ret; } static int del_var (CalcHandle* handle, VarRequest* vr) { int ret = 0; static const uint16_t keys[] = { 0x40, 0x09, 0x09, /* Quit, Clear, Clear, */ 0x3e, 0x9d, 0x04, /* Catalog, D, Down */ 0x04, 0x04, 0x05 /* Down, Down, Enter */ }; unsigned int i; char *utf8; utf8 = ticonv_varname_to_utf8(handle->model, vr->name, vr->type); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Deleting %s..."), utf8); ticonv_utf8_free(utf8); update_label(); // Input keys by remote control for (i = 0; !ret && i < sizeof(keys) / sizeof(keys[0]); i++) { ret = send_key(handle, (uint32_t)(keys[i])); } for (i = 0; !ret && i < strlen(vr->name); i++) { char c = toupper(vr->name[i]); if (isdigit(c)) { ret = send_key(handle, (uint32_t)(0x008e + c - '0')); } else { ret = send_key(handle, (uint32_t)(0x009a + c - 'A')); } } if (!ret) { ret = send_key(handle, 0x0005); // Enter } return ret; } const CalcFncts calc_80 = { CALC_TI80, "TI80", "TI-80", "TI-80 ViewScreen", OPS_SCREEN, PRODUCT_ID_NONE, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "", /* get_dirlist */ "", /* get_memfree */ "", /* send_backup */ "", /* recv_backup */ "", /* send_var */ "", /* recv_var */ "", /* send_var_ns */ "", /* recv_var_ns */ "", /* send_app */ "", /* recv_app */ "", /* send_os */ "", /* recv_idlist */ "", /* dump_rom_1 */ "", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "", /* del_var */ "", /* new_folder */ "", /* get_version */ "", /* send_cert */ "", /* recv_cert */ "", /* rename */ "", /* chattr */ "", /* send_all_vars_backup */ "" /* recv_all_vars_backup */ }, &noop_is_ready, &noop_send_key, &noop_execute, &recv_screen_80, &noop_get_dirlist, &noop_get_memfree, &noop_send_backup, &noop_recv_backup, &noop_send_var, &noop_recv_var, &noop_send_var_ns, &noop_recv_var_ns, &noop_send_flash, &noop_recv_flash, &noop_send_flash, &noop_recv_idlist, &noop_dump_rom_1, &noop_dump_rom_2, &noop_set_clock, &noop_get_clock, &noop_del_var, &noop_new_folder, &noop_get_version, &noop_send_cert, &noop_recv_cert, &noop_rename_var, &noop_change_attr, &noop_send_all_vars_backup, &noop_recv_all_vars_backup }; const CalcFncts calc_82 = { CALC_TI82, "TI82", "TI-82", "TI-82", OPS_SCREEN | OPS_BACKUP | OPS_VARS | OPS_ROMDUMP | FTS_BACKUP | FTS_NONSILENT, PRODUCT_ID_NONE, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "", /* get_dirlist */ "", /* get_memfree */ "2P1L", /* send_backup */ "2P1L", /* recv_backup */ "", /* send_var */ "", /* recv_var */ "2P1L", /* send_var_ns */ "1P1L", /* recv_var_ns */ "", /* send_app */ "", /* recv_app */ "", /* send_os */ "", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "", /* del_var */ "", /* new_folder */ "", /* get_version */ "", /* send_cert */ "", /* recv_cert */ "", /* rename */ "", /* chattr */ "", /* send_all_vars_backup */ "" /* recv_all_vars_backup */ }, &noop_is_ready, &noop_send_key, &noop_execute, &recv_screen, &noop_get_dirlist, &get_memfree, &send_backup, &recv_backup, &send_var_8285, &noop_recv_var, &send_var_ns, &recv_var_ns, &noop_send_flash, &noop_recv_flash, &noop_send_os, &noop_recv_idlist, &dump_rom_1, &dump_rom_2, &noop_set_clock, &noop_get_clock, &noop_del_var, &noop_new_folder, &noop_get_version, &noop_send_cert, &noop_recv_cert, &noop_rename_var, &noop_change_attr, &noop_send_all_vars_backup, &noop_recv_all_vars_backup }; const CalcFncts calc_83 = { CALC_TI83, "TI83", "TI-83", "TI-83", OPS_KEYS | OPS_SCREEN | OPS_DIRLIST | OPS_BACKUP | OPS_VARS | OPS_ROMDUMP | OPS_DELVAR | FTS_SILENT | FTS_MEMFREE | FTS_BACKUP, PRODUCT_ID_NONE, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "2P", /* send_backup */ "2P", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "2P1L", /* send_var_ns */ "1P1L", /* recv_var_ns */ "", /* send_app */ "", /* recv_app */ "", /* send_os */ "", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "", /* new_folder */ "", /* get_version */ "", /* send_cert */ "", /* recv_cert */ "", /* rename */ "", /* chattr */ "", /* send_all_vars_backup */ "" /* recv_all_vars_backup */ }, &noop_is_ready, &send_key, &execute, &recv_screen, &get_dirlist, &get_memfree, &send_backup, &recv_backup, &send_var_8386, &recv_var, &noop_send_var_ns, &noop_recv_var_ns, &noop_send_flash, &noop_recv_flash, &noop_send_os, &noop_recv_idlist, &dump_rom_1, &dump_rom_2, &noop_set_clock, &noop_get_clock, &del_var, &noop_new_folder, &noop_get_version, &noop_send_cert, &noop_recv_cert, &noop_rename_var, &noop_change_attr, &noop_send_all_vars_backup, &noop_recv_all_vars_backup }; const CalcFncts calc_85 = { CALC_TI85, "TI85", "TI-85", "TI-85", OPS_SCREEN | OPS_BACKUP | OPS_VARS | OPS_ROMDUMP | FTS_BACKUP | FTS_NONSILENT, PRODUCT_ID_NONE, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "", /* get_dirlist */ "", /* get_memfree */ "2P1L", /* send_backup */ "2P1L", /* recv_backup */ "", /* send_var */ "", /* recv_var */ "2P1L", /* send_var_ns */ "1P1L", /* recv_var_ns */ "", /* send_app */ "", /* recv_app */ "", /* send_os */ "", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "", /* del_var */ "", /* new_folder */ "", /* get_version */ "", /* send_cert */ "", /* recv_cert */ "", /* rename */ "", /* chattr */ "", /* send_all_vars_backup */ "" /* recv_all_vars_backup */ }, &noop_is_ready, &noop_send_key, &noop_execute, &recv_screen, &noop_get_dirlist, &get_memfree, &send_backup, &recv_backup, &send_var_8285, &noop_recv_var, &send_var_ns, &recv_var_ns, &noop_send_flash, &noop_recv_flash, &noop_send_os, &noop_recv_idlist, &dump_rom_1, &dump_rom_2, &noop_set_clock, &noop_get_clock, &noop_del_var, &noop_new_folder, &noop_get_version, &noop_send_cert, &noop_recv_cert, &noop_rename_var, &noop_change_attr, &noop_send_all_vars_backup, &noop_recv_all_vars_backup }; const CalcFncts calc_86 = { CALC_TI86, "TI86", "TI-86", "TI-86", OPS_KEYS | OPS_SCREEN | OPS_DIRLIST | OPS_BACKUP | OPS_VARS | OPS_ROMDUMP | FTS_SILENT | FTS_MEMFREE | FTS_BACKUP, PRODUCT_ID_NONE, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "2P1L", /* send_backup */ "2P1L", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "2P1L", /* send_var_ns */ "1P1L", /* recv_var_ns */ "", /* send_app */ "", /* recv_app */ "", /* send_os */ "", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "", /* del_var */ "", /* new_folder */ "", /* get_version */ "", /* send_cert */ "", /* recv_cert */ "", /* rename */ "", /* chattr */ "", /* send_all_vars_backup */ "" /* recv_all_vars_backup */ }, &noop_is_ready, &send_key, &noop_execute, &recv_screen, &get_dirlist, &get_memfree, &send_backup, &recv_backup, &send_var_8386, &recv_var, &noop_send_var_ns, &noop_recv_var_ns, &noop_send_flash, &noop_recv_flash, &noop_send_os, &noop_recv_idlist, &dump_rom_1, &dump_rom_2, &noop_set_clock, &noop_get_clock, &noop_del_var, &noop_new_folder, &noop_get_version, &noop_send_cert, &noop_recv_cert, &noop_rename_var, &noop_change_attr, &noop_send_all_vars_backup, &noop_recv_all_vars_backup }; libticalcs-1.1.9+dfsg/src/calc_9x.c000066400000000000000000001330271327711501700170410ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: link_nul.c 1059 2005-05-14 09:45:42Z roms $ */ /* libticalcs2 - hand-helds support library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * Copyright (C) 2006 Kevin Kofler * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* TI89/TI92+/V200/TI89T/TI92 support. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "ticalcs.h" #include "gettext.h" #include "internal.h" #include "logging.h" #include "error.h" #include "cmd68k.h" #include "rom89.h" #include "rom92f2.h" #include "romdump.h" #include "keys89.h" #include "keys92p.h" #define SEND_RDY(handle) (handle->model != CALC_TI92 ? ti89_send_RDY(handle) : ti92_send_RDY(handle)) #define SEND_KEY(handle, scancode) (handle->model != CALC_TI92 ? ti89_send_KEY(handle, scancode) : ti92_send_KEY(handle, scancode)) #define SEND_SCR(handle) (handle->model != CALC_TI92 ? ti89_send_SCR(handle) : ti92_send_SCR(handle)) #define SEND_ACK(handle) (handle->model != CALC_TI92 ? ti89_send_ACK(handle) : ti92_send_ACK(handle)) #define SEND_VAR(handle, varsize, vartype, varname) (handle->model != CALC_TI92 ? ti89_send_VAR(handle, varsize, vartype, varname) : ti92_send_VAR(handle, varsize, vartype, varname)) #define SEND_XDP(handle, length, data) (handle->model != CALC_TI92 ? ti89_send_XDP(handle, length, data) : ti92_send_XDP(handle, length, data)) #define SEND_REQ(handle, varsize, vartype, varname) (handle->model != CALC_TI92 ? ti89_send_REQ(handle, varsize, vartype, varname) : ti92_send_REQ(handle, varsize, vartype, varname)) #define SEND_RTS(handle, varsize, vartype, varname) (handle->model != CALC_TI92 ? ti89_send_RTS(handle, varsize, vartype, varname) : ti92_send_RTS(handle, varsize, vartype, varname)) #define SEND_RTS2 ti89_send_RTS2 #define SEND_CTS(handle) (handle->model != CALC_TI92 ? ti89_send_CTS(handle) : ti92_send_CTS(handle)) #define SEND_CNT(handle) (handle->model != CALC_TI92 ? ti89_send_CNT(handle) : ti92_send_CNT(handle)) #define SEND_DEL ti89_send_DEL #define SEND_VER ti89_send_VER #define SEND_EOT(handle) (handle->model != CALC_TI92 ? ti89_send_EOT(handle) : ti92_send_EOT(handle)) #define RECV_ACK(handle, status) (handle->model != CALC_TI92 ? ti89_recv_ACK(handle, status) : ti92_recv_ACK(handle, status)) #define RECV_VAR(handle, varsize, vartype, varname) (handle->model != CALC_TI92 ? ti89_recv_VAR(handle, varsize, vartype, varname) : ti92_recv_VAR(handle, varsize, vartype, varname)) #define RECV_XDP(handle, length, data) (handle->model != CALC_TI92 ? ti89_recv_XDP(handle, length, data) : ti92_recv_XDP(handle, length, data)) #define RECV_CTS(handle) (handle->model != CALC_TI92 ? ti89_recv_CTS(handle) : ti92_recv_CTS(handle)) #define RECV_SKP(handle, rej_code) (handle->model != CALC_TI92 ? ti89_recv_SKP(handle, rej_code) : ti92_recv_SKP(handle, rej_code)) #define RECV_CNT(handle) (handle->model != CALC_TI92 ? ti89_recv_CNT(handle) : ti92_recv_CNT(handle)) #define RECV_EOT(handle) (handle->model != CALC_TI92 ? ti89_recv_EOT(handle) : ti92_recv_EOT(handle)) // Screen coordinates of the TI-89 / TI-92+ #define TI89_ROWS 128 #define TI89_COLS 240 #define TI89_ROWS_VISIBLE 100 #define TI89_COLS_VISIBLE 160 #define TI92_ROWS 128 #define TI92_COLS 240 static int is_ready (CalcHandle* handle) { int ret; uint16_t status; ret = SEND_RDY(handle); if (!ret) { ret = RECV_ACK(handle, &status); if (!ret) { ret = (MSB(status) & 0x01) ? ERR_NOT_READY : 0; } } return ret; } static int send_key (CalcHandle* handle, uint32_t key) { int ret; uint16_t status; ret = SEND_KEY(handle, (uint16_t)key); if (!ret) { ret = RECV_ACK(handle, &status); PAUSE(50); } return ret; } static int go_to_homescreen(CalcHandle * handle) { int ret; PAUSE(200); if (handle->model == CALC_TI89 || handle->model == CALC_TI89T) { ret = send_key(handle, KEY89_HOME); if (!ret) { ret = send_key(handle, KEY89_CLEAR); if (!ret) { ret = send_key(handle, KEY89_CLEAR); } } } else if (handle->model == CALC_TI92 || handle->model == CALC_TI92P || handle->model == CALC_V200) { ret = send_key(handle, KEY92P_CTRL + KEY92P_Q); if (!ret) { ret = send_key(handle, KEY92P_CLEAR); if (!ret) { ret = send_key(handle, KEY92P_CLEAR); } } } else { ret = ERR_VOID_FUNCTION; } return ret; } static int execute (CalcHandle* handle, VarEntry *ve, const char* args) { int ret = 0; if (ve->type == TI89_APPL) { return ERR_VOID_FUNCTION; } ret = go_to_homescreen(handle); if (!ret) { unsigned int i; // Launch program by remote control for (i = 0; !ret && i < strlen(ve->folder); i++) { ret = send_key(handle, (uint32_t)(uint8_t)((ve->folder)[i])); } if (!ret && strcmp(ve->folder, "")) { ret = send_key(handle, (uint32_t)'\\'); } for (i = 0; !ret && i < strlen(ve->name); i++) { ret = send_key(handle, (uint32_t)(uint8_t)((ve->name)[i])); } if (!ret) { ret = send_key(handle, KEY89_LP); if (!ret) { if (args) { for (i = 0; !ret && i < strlen(args); i++) { ret = send_key(handle, (uint32_t)(uint8_t)(args[i])); } } if (!ret) { ret = send_key(handle, KEY89_RP); if (!ret) { ret = send_key(handle, KEY89_ENTER); PAUSE(200); } } } } } return ret; } static int recv_screen (CalcHandle* handle, CalcScreenCoord* sc, uint8_t** bitmap) { int ret; *bitmap = (uint8_t *)ticalcs_alloc_screen(65537U); if (*bitmap == NULL) { return ERR_MALLOC; } sc->width = TI89_COLS; sc->height = TI89_ROWS; if (handle->model == CALC_TI89 || handle->model == CALC_TI89T) { sc->clipped_width = TI89_COLS_VISIBLE; sc->clipped_height = TI89_ROWS_VISIBLE; } else { sc->clipped_width = TI89_COLS; sc->clipped_height = TI89_ROWS; } sc->pixel_format = CALC_PIXFMT_MONO; ret = SEND_SCR(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { uint16_t max_cnt; ret = RECV_XDP(handle, &max_cnt, *bitmap); if (!ret || ret == ERR_CHECKSUM) // problem with checksum { // Clip the unused part of the screen (nevertheless usable with asm programs) if ( ((handle->model == CALC_TI89) || (handle->model == CALC_TI89T)) && (sc->format == SCREEN_CLIPPED)) { int i, j, k; for (i = 0, j = 0; j < TI89_ROWS_VISIBLE; j++) { for (k = 0; k < (TI89_COLS_VISIBLE >> 3); k++) { (*bitmap)[i++] = (*bitmap)[j * (TI89_COLS >> 3) + k]; } } } *bitmap = ticalcs_realloc_screen(*bitmap, TI89_COLS * TI89_ROWS / 8); ret = SEND_ACK(handle); } } } if (ret) { ticalcs_free_screen(*bitmap); *bitmap = NULL; } return ret; } static int get_dirlist (CalcHandle* handle, GNode** vars, GNode** apps) { VarEntry info; uint16_t block_size; uint8_t * buffer = handle->buffer2; int ret; int i, j; uint8_t extra = (handle->model == CALC_V200) ? 8 : 0; GNode *root, *node = NULL; ret = dirlist_init_trees(handle, vars, apps); if (ret) { return ret; } root = dirlist_create_append_node(NULL, apps); if (!root) { return ERR_MALLOC; } ret = SEND_REQ(handle, ((uint32_t)TI89_FDIR) << 24, TI89_RDIR, "\0\0\0\0\0\0\0"); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_VAR(handle, &info.size, &info.type, info.name); if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_XDP(handle, &block_size, buffer); if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = RECV_EOT(handle); if (!ret) { ret = SEND_ACK(handle); } } } } } } } } } if (ret) { return ret; } for (j = 4; j < (int)block_size;) { VarEntry *fe = tifiles_ve_create(); memcpy(fe->name, buffer + j, 8); fe->name[8] = '\0'; fe->type = buffer[j + 8]; fe->attr = buffer[j + 9]; fe->size = ( (((uint32_t)buffer[j + 10]) ) | (((uint32_t)buffer[j + 11]) << 8) | (((uint32_t)buffer[j + 12]) << 16)); // | (((uint32_t)buffer[j + 13]) << 24); j += 14 + extra; fe->folder[0] = 0; ticalcs_info(_("Name: %8s | Type: %8s | Attr: %i | Size: %08X"), fe->name, tifiles_vartype2string(handle->model, fe->type), fe->attr, fe->size); if (fe->type == TI89_DIR) { node = dirlist_create_append_node(fe, vars); if (!node) { break; } } else if (fe->type == TI89_APPL) { // AMS<2.08 returns FLASH apps continue; } } if (!node) { return ERR_MALLOC; } // get list of variables into each folder for (i = 0; i < (int)g_node_n_children(*vars); i++) { GNode *folder = g_node_nth_child(*vars, i); char *folder_name = ((VarEntry *) (folder->data))->name; char *u1, *u2; ticalcs_info(_("Directory listing in %8s..."), folder_name); ret = SEND_REQ(handle, ((uint32_t)TI89_LDIR) << 24, TI89_RDIR, folder_name); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_VAR(handle, &info.size, &info.type, info.name); if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_XDP(handle, &block_size, buffer); if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = RECV_EOT(handle); if (!ret) { ret = SEND_ACK(handle); } } } } } } } } } if (!ret) { for (j = 4 + 14 + extra; j < (int)block_size;) { VarEntry *ve = tifiles_ve_create(); memcpy(ve->name, buffer + j, 8); ve->name[8] = '\0'; ve->type = buffer[j + 8]; ve->attr = buffer[j + 9]; ve->size = ( (((uint32_t)buffer[j + 10]) ) | (((uint32_t)buffer[j + 11]) << 8) | (((uint32_t)buffer[j + 12]) << 16)); // | (((uint32_t)buffer[j + 13]) << 24); j += 14 + extra; ticalcs_strlcpy(ve->folder, folder_name, sizeof(ve->folder)); ticalcs_info(_("Name: %8s | Type: %8s | Attr: %i | Size: %08X"), ve->name, tifiles_vartype2string(handle->model, ve->type), ve->attr, ve->size); u1 = ticonv_varname_to_utf8(handle->model, ((VarEntry *) (folder->data))->name, -1); u2 = ticonv_varname_to_utf8(handle->model, ve->name, ve->type); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Parsing %s/%s"), u1, u2); ticonv_utf8_free(u2); ticonv_utf8_free(u1); update_label(); if (ve->type == TI89_APPL) { VarEntry arg; memset(&arg, 0, sizeof(arg)); ticalcs_strlcpy(arg.name, ve->name, sizeof(arg.name)); if (!ticalcs_dirlist_ve_exist(*apps, &arg)) { ve->folder[0] = 0; node = dirlist_create_append_node(ve, &root); if (!node) { return ERR_MALLOC; } } } else { if (!strcmp(ve->folder, "main") && (!strcmp(ve->name, "regcoef") || !strcmp(ve->name, "regeq"))) { tifiles_ve_delete(ve); } else { node = dirlist_create_append_node(ve, &folder); if (!node) { return ERR_MALLOC; } } } } ticalcs_info(" "); } } return ret; } static int get_dirlist_92 (CalcHandle* handle, GNode** vars, GNode** apps) { VarEntry info; int ret; ret = dirlist_init_trees(handle, vars, apps); if (!ret) { ret = SEND_REQ(handle, 0, TI92_RDIR, "\0\0\0\0\0\0\0"); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_VAR(handle, &info.size, &info.type, info.name); } } } if (ret) { return ret; } for (;;) { VarEntry *ve; GNode *folder = NULL; char folder_name[9]; char *utf8; uint8_t * buffer = handle->buffer2; uint16_t unused; folder_name[8] = 0; ret = SEND_ACK(handle); if (!ret) { ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_XDP(handle, &unused, buffer); } } } if (ret) { break; } ve = tifiles_ve_create(); memcpy(ve->name, buffer + 4, 8); // skip 4 extra 00s ve->name[8] = '\0'; ve->type = buffer[12]; ve->attr = buffer[13]; ve->size = buffer[14] | (((uint32_t)buffer[15]) << 8) | (((uint32_t)buffer[16]) << 16) | (((uint32_t)buffer[17]) << 24); ve->folder[0] = 0; if (ve->type == TI92_DIR) { ticalcs_strlcpy(folder_name, ve->name, sizeof(folder_name)); folder = dirlist_create_append_node(ve, vars); } else { ticalcs_strlcpy(ve->folder, folder_name, sizeof(ve->folder)); if (!strcmp(ve->folder, "main") && (!strcmp(ve->name, "regcoef") || !strcmp(ve->name, "regeq"))) { tifiles_ve_delete(ve); ve = NULL; } else { GNode *node = dirlist_create_append_node(ve, &folder); if (node == NULL) { return ERR_MALLOC; } } } if (ve != NULL) { ticalcs_info(_("Name: %8s | Type: %8s | Attr: %i | Size: %08X"), ve->name, tifiles_vartype2string(handle->model, ve->type), ve->attr, ve->size); } ret = SEND_ACK(handle); if (!ret) { ret = RECV_CNT(handle); if (ret) { if (ret == ERR_EOT) { ret = SEND_ACK(handle); } break; } } if (ve != NULL && folder != NULL) { utf8 = ticonv_varname_to_utf8(handle->model, ve->name, ve->type); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Parsing %s/%s"), ((VarEntry *) (folder->data))->name, utf8); ticonv_utf8_free(utf8); update_->label(); } } return ret; } static int get_memfree (CalcHandle* handle, uint32_t* ram, uint32_t *flash) { (void)handle; *ram = *flash = -1; return 0; } static int send_backup (CalcHandle* handle, BackupContent* content) { int ret; unsigned int i; unsigned int nblocks; ret = SEND_VAR(handle, content->data_length, TI92_BKUP, content->rom_version); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { update_->cnt2 = 0; nblocks = content->data_length / 1024; handle->updat->max2 = nblocks; for (i = 0; !ret && i <= nblocks; i++) { uint32_t length = (i != nblocks) ? 1024 : content->data_length % 1024; ret = SEND_VAR(handle, length, TI92_BKUP, content->rom_version); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_CTS(handle); if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = SEND_XDP(handle, length, content->data_part + 1024 * i); if (!ret) { ret = RECV_ACK(handle, NULL); } } } } } handle->updat->cnt2 = i; update_pbar(); } if (!ret) { ret = SEND_EOT(handle); } } } return ret; } static int recv_backup (CalcHandle* handle, BackupContent* content) { uint32_t block_size; int block, ret = 0; uint16_t unused; uint8_t *ptr; ret = SEND_REQ(handle, 0, TI92_BKUP, "main\\backup"); if (!ret) { ret = RECV_ACK(handle, &unused); if (!ret) { content->model = CALC_TI92; ticalcs_strlcpy(content->comment, tifiles_comment_set_backup(), sizeof(content->comment)); content->data_part = tifiles_ve_alloc_data(128 * 1024); content->type = TI92_BKUP; content->data_length = 0; for (block = 0; !ret; block++) { int ret2; ticalcs_slprintf(update_->text, sizeof(update_->text), _("Block #%2i"), block); update_label(); ret = RECV_VAR(handle, &block_size, &content->type, content->rom_version); ret2 = SEND_ACK(handle); if (ret) { if (ret == ERR_EOT) { ret = 0; } break; } if (ret2) { ret = ret2; break; } ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ptr = content->data_part + content->data_length; ret = RECV_XDP(handle, &unused, ptr); if (!ret) { memmove(ptr, ptr + 4, block_size); ret = SEND_ACK(handle); if (!ret) { content->data_length += block_size; } } } } } } } return ret; } static int send_var (CalcHandle* handle, CalcMode mode, FileContent* content) { int ret = 0; unsigned int i; uint16_t status; update_->cnt2 = 0; update_->max2 = content->num_entries; for (i = 0; !ret && i < content->num_entries; i++) { VarEntry *entry; uint8_t * buffer = handle->buffer2; uint8_t vartype; char varname[18]; uint32_t size; entry = content->entries[i]; if (!ticalcs_validate_varentry(entry)) { ticalcs_critical("%s: skipping invalid content entry #%u", __FUNCTION__, i); continue; } vartype = entry->type; if (entry->action == ACT_SKIP) { continue; } if ((mode & MODE_LOCAL_PATH) && !(mode & MODE_BACKUP)) { // local & not backup ticalcs_strlcpy(varname, entry->name, sizeof(varname)); } else { // full or backup tifiles_build_fullname(handle->model, varname, entry->folder, entry->name); } ticonv_varname_to_utf8_sn(handle->model, varname, update_->text, sizeof(update_->text), vartype); update_label(); switch (entry->attr) { //case ATTRB_NONE: vartype = TI89_BKUP; break; case ATTRB_LOCKED: vartype = 0x26; break; case ATTRB_PROTECTED: case ATTRB_ARCHIVED: vartype = 0x27; break; } size = entry->size; if (size >= 65536U) { ticalcs_critical("%s: oversized variable has size %u, clamping to 65535", __FUNCTION__, size); size = 65535; } ret = SEND_RTS(handle, size, vartype, varname); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_CTS(handle); if (!ret) { ret = SEND_ACK(handle); if (!ret) { buffer[0] = 0; buffer[1] = 0; buffer[2] = 0; buffer[3] = 0; memcpy(buffer + 4, entry->data, size); ret = SEND_XDP(handle, size + 4, buffer); if (!ret) { ret = RECV_ACK(handle, &status); if (!ret) { ret = SEND_EOT(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ticalcs_info("Sent variable #%u", i); update_->cnt2 = i+1; update_->max2 = content->num_entries; update_->pbar(); } } } } } } } } } return ret; } static int recv_var (CalcHandle* handle, CalcMode mode, FileContent* content, VarRequest* vr) { int ret = 0; uint16_t status; VarEntry *ve; uint16_t unused; char varname[20]; content->model = handle->model; ve = tifiles_ve_create(); memcpy(ve, vr, sizeof(VarEntry)); tifiles_build_fullname(handle->model, varname, vr->folder, vr->name); ticonv_varname_to_utf8_sn(handle->model, varname, update_->text, sizeof(update_->text), vr->type); update_label(); ret = SEND_REQ(handle, 0, vr->type, varname); if (!ret) { ret = RECV_ACK(handle, &status); if (!ret) { if (status != 0) { return ERR_MISSING_VAR; } ret = RECV_VAR(handle, &ve->size, &ve->type, ve->name); if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ve->data = tifiles_ve_alloc_data(ve->size + 4); ret = RECV_XDP(handle, &unused, ve->data); if (!ret) { memmove(ve->data, ve->data + 4, ve->size); ret = SEND_ACK(handle); if (!ret) { ret = RECV_EOT(handle); if (!ret) { ret = SEND_ACK(handle); if (!ret) { PAUSE(250); tifiles_content_add_entry(content, ve); } } } } } } } } } } return ret; } static int send_all_vars_backup (CalcHandle* handle, FileContent* content) { int ret; // erase memory ret = SEND_VAR(handle, 0, TI89_BKUP, "main"); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_CTS(handle); if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = SEND_EOT(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { // next, send var(s) ret = send_var(handle, MODE_BACKUP, content); } } } } } } return ret; } static int send_var_ns (CalcHandle* handle, CalcMode mode, FileContent* content) { int ret = 0; unsigned int i; uint16_t status; update_->cnt2 = 0; update_->max2 = content->num_entries; for (i = 0; !ret && i < content->num_entries; i++) { VarEntry *entry; uint8_t * buffer = handle->buffer2; uint8_t vartype; char varname[18]; uint32_t size; entry = content->entries[i]; if (!ticalcs_validate_varentry(entry)) { ticalcs_critical("%s: skipping invalid content entry #%u", __FUNCTION__, i); continue; } vartype = entry->type; if (entry->action == ACT_SKIP) { ticalcs_info("%s: skipping variable #%u because requested", __FUNCTION__, i); continue; } if ((mode & MODE_LOCAL_PATH) && ((handle->model == CALC_TI92) || !(mode & MODE_BACKUP))) { // local & not backup ticalcs_strlcpy(varname, entry->name, sizeof(varname)); } else { // full or backup tifiles_build_fullname(handle->model, varname, entry->folder, entry->name); } ticonv_varname_to_utf8_sn(handle->model, varname, update_->text, sizeof(update_->text), vartype); update_label(); size = entry->size; if (size >= 65536U) { ticalcs_critical("%s: oversized variable has size %u, clamping to 65535", __FUNCTION__, size); size = 65535; } ret = SEND_VAR(handle, size, vartype, varname); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_CTS(handle); if (!ret) { ret = SEND_ACK(handle); if (!ret) { buffer[0] = 0; buffer[1] = 0; buffer[2] = 0; buffer[3] = 0; memcpy(buffer + 4, entry->data, size); ret = SEND_XDP(handle, size + 4, buffer); if (!ret) { ret = RECV_ACK(handle, &status); if (!ret) { ret = SEND_EOT(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ticalcs_info("Sent variable #%u", i); if (mode & MODE_BACKUP || handle->model == CALC_TI92) { update_->cnt2 = i+1; update_->max2 = content->num_entries; update_->pbar(); } } } } } } } } } } return ret; } static int recv_var_ns (CalcHandle* handle, CalcMode mode, FileContent* content, VarEntry** vr) { uint16_t unused; int nvar, ret = 0; char tipath[18]; char *tiname; content->model = handle->model; content->num_entries = 0; // receive packets for (nvar = 0;; nvar++) { VarEntry *ve = tifiles_ve_create(); int ret2; ticalcs_strlcpy(ve->folder, "main", sizeof(ve->folder)); ret = RECV_VAR(handle, &ve->size, &ve->type, tipath); ret2 = SEND_ACK(handle); if (ret) { if (ret == ERR_EOT) // end of transmission { ret = 0; } goto error; } if (ret2) { ret = ret2; goto error; } // from Christian (calculator can send varname or fldname/varname) if ((tiname = strchr(tipath, '\\')) != NULL) { *tiname = '\0'; ticalcs_strlcpy(ve->folder, tipath, sizeof(ve->folder)); ticalcs_strlcpy(ve->name, tiname + 1, sizeof(ve->name)); } else { ticalcs_strlcpy(ve->folder, "main", sizeof(ve->folder)); ticalcs_strlcpy(ve->name, tipath, sizeof(ve->name)); } ticonv_varname_to_utf8_sn(handle->model, ve->name, update_->text, sizeof(update_->text), ve->type); update_label(); ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ve->data = tifiles_ve_alloc_data(ve->size + 4); ret = RECV_XDP(handle, &unused, ve->data); if (!ret) { memmove(ve->data, ve->data + 4, ve->size); ret = SEND_ACK(handle); } } } if (!ret) { tifiles_content_add_entry(content, ve); } else { error: tifiles_ve_delete(ve); break; } } if (nvar > 1) { *vr = NULL; } else { *vr = tifiles_ve_dup(content->entries[0]); } return ret; } static int send_flash (CalcHandle* handle, FlashContent* content) { int ret = 0; FlashContent *ptr; int i, nblocks; // send all headers except license for (ptr = content; !ret && ptr != NULL; ptr = ptr->next) { if (ptr->data_type == TI89_LICENSE) { continue; } ticalcs_info(_("FLASH name: \"%s\""), ptr->name); ticalcs_info(_("FLASH size: %i bytes."), ptr->data_length); ticonv_varname_to_utf8_sn(handle->model, ptr->name, update_->text, sizeof(update_->text), ptr->data_type); update_label(); if (ptr->data_type == TI89_AMS) { if (handle->model == CALC_TI89T || handle->model == CALC_V200) { ret = SEND_RTS2(handle, ptr->data_length, ptr->data_type, ptr->hw_id); } else { ret = SEND_RTS(handle, ptr->data_length, ptr->data_type, "\0\0\0\0\0\0\0"); } } else { ret = SEND_RTS(handle, ptr->data_length, ptr->data_type, ptr->name); } if (!ret) { nblocks = ptr->data_length / 65536; update_->max2 = nblocks+1; for (i = 0; !ret && i <= nblocks; i++) { uint32_t length = (i != nblocks) ? 65536 : ptr->data_length % 65536; ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_CTS(handle); if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = SEND_XDP(handle, length, (ptr->data_part) + 65536 * i); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { if (i != nblocks) { ret = SEND_CNT(handle); } else { ret = SEND_EOT(handle); } update_->cnt2 = i; update_->pbar(); } } } } } } if (!ret) { ret = RECV_ACK(handle, NULL); ticalcs_info(_("Header sent completely.")); } } } return ret; } static int recv_flash (CalcHandle* handle, FlashContent* content, VarRequest* vr) { int ret; int i; ticonv_varname_to_utf8_sn(handle->model, vr->name, update_->text, sizeof(update_->text), vr->type); update_label(); content->model = handle->model; content->data_part = (uint8_t *)tifiles_ve_alloc_data(4 * 1024 * 1024); // 4MB max content->data_type = vr->type; switch(handle->model) { case CALC_TI89: case CALC_TI89T: content->device_type = DEVICE_TYPE_89; break; case CALC_TI92P: case CALC_V200: content->device_type = DEVICE_TYPE_92P; break; default: return ERR_FATAL_ERROR; } ret = SEND_REQ(handle, 0x00, vr->type, vr->name); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_VAR(handle, &content->data_length, &content->data_type, content->name); if (!ret) { update_->cnt2 = 0; update_->max2 = vr->size; for (i = 0, content->data_length = 0; !ret; i++) { uint16_t block_size; ret = SEND_ACK(handle); if (!ret) { ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_XDP(handle, &block_size, content->data_part + content->data_length); if (!ret) { ret = SEND_ACK(handle); if (!ret) { content->data_length += block_size; ret = RECV_CNT(handle); if (ret) { if (ret == ERR_EOT) { ret = 0; } break; } update_->cnt2 += block_size; update_->pbar(); } } } } } } if (!ret) { ret = SEND_ACK(handle); } } } } return ret; } static int recv_idlist (CalcHandle* handle, uint8_t* idlist) { int ret; uint32_t varsize; uint16_t pktsize; uint8_t vartype; char varname[9]; ticalcs_strlcpy(update_->text, "ID-LIST", sizeof(update_->text)); update_label(); ret = SEND_REQ(handle, 0x0000, TI89_IDLIST, "\0\0\0\0\0\0\0"); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_VAR(handle, &varsize, &vartype, varname); if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_XDP(handle, &pktsize, idlist); if (!ret) { memmove(idlist, idlist + 8, pktsize - 8); idlist[pktsize - 8] = '\0'; ret = SEND_ACK(handle); if (!ret) { ret = RECV_EOT(handle); if (!ret) { ret = SEND_ACK(handle); } } } } } } } } } return ret; } static int dump_rom_1 (CalcHandle* handle) { int ret = 0; ret = go_to_homescreen(handle); PAUSE(200); if (!ret) { // Send dumping program if (handle->model != CALC_TI92) { ret = rd_send(handle, "romdump.89z", romDumpSize89, romDump89); } else { ret = rd_send(handle, "romdump.92p", romDumpSize92, romDump92); } PAUSE(1000); } return ret; } static int dump_rom_2 (CalcHandle* handle, CalcDumpSize size, const char *filename) { int ret = 0; unsigned int i; static const uint16_t keys[] = { 'm', 'a', 'i', 'n', '\\', 'r', 'o', 'm', 'd', 'u', 'm', 'p', KEY89_LP, KEY89_RP, KEY89_ENTER }; // Launch program by remote control for (i = 0; !ret && i < sizeof(keys) / sizeof(keys[0]); i++) { ret = send_key(handle, (uint32_t)(keys[i])); } PAUSE(200); // Get dump if (!ret) { ret = rd_dump(handle, filename); } return ret; } static int set_clock (CalcHandle* handle, CalcClock* _clock) { int ret; uint8_t buffer[16]; uint16_t status; buffer[0] = 0; buffer[1] = 0; buffer[2] = 0; buffer[3] = 0; buffer[4] = 0; buffer[5] = 0; buffer[6] = _clock->year >> 8; buffer[7] = _clock->year & 0x00ff; buffer[8] = _clock->month; buffer[9] = _clock->day; buffer[10] = _clock->hours; buffer[11] = _clock->minutes; buffer[12] = _clock->seconds; buffer[13] = _clock->date_format; buffer[14] = _clock->time_format; buffer[15] = 0xff; ticalcs_strlcpy(update_->text, _("Setting clock..."), sizeof(update_->text)); update_label(); ret = SEND_RTS(handle, 0x10, TI89_CLK, "Clock"); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_CTS(handle); if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = SEND_XDP(handle, 0x10, buffer); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = SEND_EOT(handle); if (!ret) { ret = RECV_ACK(handle, &status); } } } } } } } return ret; } static int get_clock (CalcHandle* handle, CalcClock* _clock) { int ret; uint32_t varsize; uint16_t pktsize; uint8_t vartype; char varname[9]; ticalcs_strlcpy(update_->text, _("Getting clock..."), sizeof(update_->text)); update_label(); ret = SEND_REQ(handle, 0x0000, TI89_CLK, "Clock"); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_VAR(handle, &varsize, &vartype, varname); if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { uint8_t * buffer = (uint8_t *)(handle->buffer2); ret = RECV_XDP(handle, &pktsize, buffer); if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = RECV_EOT(handle); if (!ret) { ret = SEND_ACK(handle); if (!ret) { _clock->year = (((uint16_t)buffer[6]) << 8) | buffer[7]; _clock->month = buffer[8]; _clock->day = buffer[9]; _clock->hours = buffer[10]; _clock->minutes = buffer[11]; _clock->seconds = buffer[12]; _clock->date_format = buffer[13]; _clock->time_format = buffer[14]; } } } } } } } } } } return ret; } static int del_var (CalcHandle* handle, VarRequest* vr) { int ret; char varname[18]; char *utf8; tifiles_build_fullname(handle->model, varname, vr->folder, vr->name); utf8 = ticonv_varname_to_utf8(handle->model, varname, vr->type); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Deleting %s..."), utf8); ticonv_utf8_free(utf8); update_label(); ret = SEND_DEL(handle, vr->size, vr->type, varname); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_ACK(handle, NULL); } } return ret; } static int del_var_92 (CalcHandle* handle, VarRequest* vr) { int ret = 0; unsigned int i; static const uint16_t keys[] = { KEY92P_ON, KEY92P_ESC, KEY92P_ESC, KEY92P_ESC, KEY92P_2ND + KEY92P_ESC, KEY92P_2ND + KEY92P_ESC, KEY92P_CTRL + KEY92P_Q, KEY92P_CLEAR, KEY92P_CLEAR, 'd', 'e', 'l', 'v', 'a', 'r', KEY92P_SPACE }; char varname[18]; char *utf8; tifiles_build_fullname(handle->model, varname, vr->folder, vr->name); utf8 = ticonv_varname_to_utf8(handle->model, varname, vr->type); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Deleting %s..."), utf8); ticonv_utf8_free(utf8); update_label(); for (i = 0; !ret && i < sizeof(keys) / sizeof(keys[0]); i++) { ret = send_key(handle, (uint32_t)(keys[i])); } for (i = 0; !ret && i < strlen(varname); i++) { ret = send_key(handle, (uint32_t)(uint8_t)(varname[i])); } if (!ret) { ret = send_key(handle, KEY92P_ENTER); } return ret; } static int new_folder (CalcHandle* handle, VarRequest* vr) { int ret; uint8_t data[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x40, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23 }; char varname[18]; char *utf8; tifiles_build_fullname(handle->model, varname, vr->folder, "a1234567"); utf8 = ticonv_varname_to_utf8(handle->model, vr->folder, -1); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Creating %s..."), utf8); ticonv_utf8_free(utf8); update_label(); // send empty expression ret = SEND_RTS(handle, 0x10, 0x00, varname); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_CTS(handle); if (!ret) { ret = SEND_ACK(handle); if (!ret) { ret = SEND_XDP(handle, 0x10, data); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = SEND_EOT(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { PAUSE(250); // delete 'a1234567' variable ticalcs_strlcpy(vr->name, "a1234567", sizeof(vr->name)); ret = ((handle->model != CALC_TI92) ? del_var : del_var_92)(handle, vr); } } } } } } } } return ret; } static int get_version (CalcHandle* handle, CalcInfos* infos) { int ret; uint16_t length; uint8_t buf[32]; ret = SEND_VER(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = SEND_CTS(handle); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_XDP(handle, &length, buf); if (!ret) { ret = SEND_ACK(handle); } } } } } if (!ret) { memset(infos, 0, sizeof(CalcInfos)); ticalcs_slprintf(infos->os_version, sizeof(infos->os_version), "%1d.%02d", buf[0], buf[1]); ticalcs_slprintf(infos->boot_version, sizeof(infos->boot_version), "%1d.%02d", buf[2], buf[3]); infos->battery = buf[4] == 1 ? 0 : 1; switch(buf[13]) { case 1: case 3: infos->hw_version = buf[5] + 1; break; case 8: infos->hw_version = buf[5]; break; case 9: infos->hw_version = buf[5] + 1; break; } switch(buf[13]) { case 1: infos->model = CALC_TI92P; break; case 3: infos->model = CALC_TI89; break; case 8: infos->model = CALC_V200; break; case 9: infos->model = CALC_TI89T; break; } infos->language_id = buf[6]; infos->sub_lang_id = buf[7]; infos->mask = INFOS_BOOT_VERSION | INFOS_OS_VERSION | INFOS_BATTERY | INFOS_HW_VERSION | INFOS_CALC_MODEL | INFOS_LANG_ID | INFOS_SUB_LANG_ID; tifiles_hexdump(buf, length); ticalcs_info(_(" OS: %s"), infos->os_version); ticalcs_info(_(" BIOS: %s"), infos->boot_version); ticalcs_info(_(" Battery: %s"), infos->battery ? "good" : "low"); } return ret; } static int get_version_92 (CalcHandle* handle, CalcInfos* infos) { int ret; uint32_t size; uint8_t type; char name[32]; ret = SEND_REQ(handle, 0, TI92_BKUP, "main\\version"); if (!ret) { ret = RECV_ACK(handle, NULL); if (!ret) { ret = RECV_VAR(handle, &size, &type, name); if (!ret) { ret = SEND_EOT(handle); if (!ret) { memset(infos, 0, sizeof(CalcInfos)); strncpy(infos->os_version, name, 4); infos->os_version[4] = 0; infos->hw_version = 1; infos->mask = INFOS_OS_VERSION | INFOS_HW_VERSION; ticalcs_info(_(" OS: %s"), infos->os_version); ticalcs_info(_(" Battery: %s"), infos->battery ? "good" : "low"); } } } } return ret; } static int send_cert (CalcHandle* handle, FlashContent* content) { return send_flash(handle, content); } static int recv_cert (CalcHandle* handle, FlashContent* content) { VarEntry ve; int ret = 0; memset(&ve, 0, sizeof(VarEntry)); ve.type = TI89_GETCERT; ve.name[0] = 0; ret = recv_flash(handle, content, &ve); if (!ret) { // fix up for certificate memmove(content->data_part, content->data_part + 4, content->data_length - 4); content->data_type = TI89_CERTIF; switch(handle->model) { case CALC_TI89: content->device_type = DEVICE_TYPE_89; break; case CALC_TI89T: content->device_type = DEVICE_TYPE_89; break; case CALC_TI92P: content->device_type = DEVICE_TYPE_92P; break; case CALC_V200: content->device_type = DEVICE_TYPE_92P; break; default: content->device_type = DEVICE_TYPE_89; break; } content->name[0] = 0; } return ret; } const CalcFncts calc_89 = { CALC_TI89, "TI89", "TI-89", "TI-89", OPS_ISREADY | OPS_KEYS | OPS_SCREEN | OPS_DIRLIST | OPS_BACKUP | OPS_VARS | OPS_FLASH | OPS_IDLIST | OPS_CLOCK | OPS_ROMDUMP | OPS_DELVAR | OPS_NEWFLD | OPS_VERSION | FTS_SILENT | FTS_FOLDER | FTS_FLASH | FTS_CERT | FTS_NONSILENT, PRODUCT_ID_TI89, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "", /* send_backup */ "", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "2P1L", /* send_var_ns */ "1P1L", /* recv_var_ns */ "2P1L", /* send_app */ "2P1L", /* recv_app */ "2P", /* send_os */ "1L", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "1L", /* send_cert */ "1L", /* recv_cert */ "", /* rename */ "", /* chattr */ "2P1L", /* send_all_vars_backup */ "2P1L" /* recv_all_vars_backup */ }, &is_ready, &send_key, &execute, &recv_screen, &get_dirlist, &get_memfree, &noop_send_backup, &noop_recv_backup, &send_var, &recv_var, &send_var_ns, &recv_var_ns, &send_flash, &recv_flash, &send_flash, &recv_idlist, &dump_rom_1, &dump_rom_2, &set_clock, &get_clock, &del_var, &new_folder, &get_version, &send_cert, &recv_cert, &noop_rename_var, &noop_change_attr, &send_all_vars_backup, &tixx_recv_all_vars_backup, }; const CalcFncts calc_92p = { CALC_TI92P, "TI92+", "TI-92 Plus", "TI-92 Plus", OPS_ISREADY | OPS_KEYS | OPS_SCREEN | OPS_DIRLIST | OPS_BACKUP | OPS_VARS | OPS_FLASH | OPS_IDLIST | OPS_CLOCK | OPS_ROMDUMP | OPS_DELVAR | OPS_NEWFLD | OPS_VERSION | OPS_OS | FTS_SILENT | FTS_FOLDER | FTS_FLASH | FTS_CERT | FTS_NONSILENT, PRODUCT_ID_TI92P, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "", /* send_backup */ "", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "2P1L", /* send_var_ns */ "1P1L", /* recv_var_ns */ "2P1L", /* send_app */ "2P1L", /* recv_app */ "2P", /* send_os */ "1L", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "1L", /* send_cert */ "1L", /* recv_cert */ "", /* rename */ "", /* chattr */ "2P1L", /* send_all_vars_backup */ "2P1L" /* recv_all_vars_backup */ }, &is_ready, &send_key, &execute, &recv_screen, &get_dirlist, &get_memfree, &noop_send_backup, &noop_recv_backup, &send_var, &recv_var, &send_var_ns, &recv_var_ns, &send_flash, &recv_flash, &send_flash, &recv_idlist, &dump_rom_1, &dump_rom_2, &set_clock, &get_clock, &del_var, &new_folder, &get_version, &send_cert, &recv_cert, &noop_rename_var, &noop_change_attr, &send_all_vars_backup, &tixx_recv_all_vars_backup, }; const CalcFncts calc_89t = { CALC_TI89T, "Titanium", "TI-89 Titanium", "TI-89 Titanium", OPS_ISREADY | OPS_KEYS | OPS_SCREEN | OPS_DIRLIST | OPS_BACKUP | OPS_VARS | OPS_FLASH | OPS_IDLIST | OPS_CLOCK | OPS_ROMDUMP | OPS_DELVAR | OPS_NEWFLD | OPS_VERSION | OPS_OS | FTS_SILENT | FTS_FOLDER | FTS_FLASH | FTS_CERT | FTS_NONSILENT, PRODUCT_ID_TI89T, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "", /* send_backup */ "", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "2P1L", /* send_var_ns */ "1P1L", /* recv_var_ns */ "2P1L", /* send_app */ "2P1L", /* recv_app */ "2P", /* send_os */ "1L", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "1L", /* send_cert */ "1L", /* recv_cert */ "", /* rename */ "", /* chattr */ "2P1L", /* send_all_vars_backup */ "2P1L" /* recv_all_vars_backup */ }, &is_ready, &send_key, &execute, &recv_screen, &get_dirlist, &get_memfree, &noop_send_backup, &noop_recv_backup, &send_var, &recv_var, &send_var_ns, &recv_var_ns, &send_flash, &recv_flash, &send_flash, &recv_idlist, &dump_rom_1, &dump_rom_2, &set_clock, &get_clock, &del_var, &new_folder, &get_version, &send_cert, &recv_cert, &noop_rename_var, &noop_change_attr, &send_all_vars_backup, &tixx_recv_all_vars_backup, }; const CalcFncts calc_v2 = { CALC_V200, "V200", "V200PLT", N_("V200 Personal Learning Tool"), OPS_ISREADY | OPS_KEYS | OPS_SCREEN | OPS_DIRLIST | OPS_BACKUP | OPS_VARS | OPS_FLASH | OPS_IDLIST | OPS_CLOCK | OPS_ROMDUMP | OPS_DELVAR | OPS_NEWFLD | OPS_VERSION | OPS_OS | FTS_SILENT | FTS_FOLDER | FTS_FLASH | FTS_CERT | FTS_NONSILENT, PRODUCT_ID_TIV200, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "", /* send_backup */ "", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "2P1L", /* send_var_ns */ "1P1L", /* recv_var_ns */ "2P1L", /* send_app */ "2P1L", /* recv_app */ "2P", /* send_os */ "1L", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "1L", /* send_cert */ "1L", /* recv_cert */ "", /* rename */ "", /* chattr */ "2P1L", /* send_all_vars_backup */ "2P1L" /* recv_all_vars_backup */ }, &is_ready, &send_key, &execute, &recv_screen, &get_dirlist, &get_memfree, &noop_send_backup, &noop_recv_backup, &send_var, &recv_var, &send_var_ns, &recv_var_ns, &send_flash, &recv_flash, &send_flash, &recv_idlist, &dump_rom_1, &dump_rom_2, &set_clock, &get_clock, &del_var, &new_folder, &get_version, &send_cert, &recv_cert, &noop_rename_var, &noop_change_attr, &send_all_vars_backup, &tixx_recv_all_vars_backup, }; const CalcFncts calc_92 = { CALC_TI92, "TI92", "TI-92", "TI-92", OPS_ISREADY | OPS_KEYS | OPS_SCREEN | OPS_DIRLIST | OPS_BACKUP | OPS_VARS | OPS_ROMDUMP | OPS_DELVAR | OPS_NEWFLD | OPS_VERSION | FTS_SILENT | FTS_FOLDER | FTS_BACKUP | FTS_NONSILENT, PRODUCT_ID_NONE, {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "2P", /* send_backup */ "1P1L", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "2P1L", /* send_var_ns */ "1P1L", /* recv_var_ns */ "", /* send_app */ "", /* recv_app */ "", /* send_os */ "", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "", /* send_cert */ "", /* recv_cert */ "", /* rename */ "", /* chattr */ "", /* send_all_vars_backup */ "" /* recv_all_vars_backup */ }, &is_ready, &send_key, &execute, &recv_screen, &get_dirlist_92, &get_memfree, &send_backup, &recv_backup, &send_var_ns, &recv_var, &send_var_ns, &recv_var_ns, &noop_send_flash, &noop_recv_flash, &noop_send_os, &noop_recv_idlist, &dump_rom_1, &dump_rom_2, &noop_set_clock, &noop_get_clock, &del_var_92, &new_folder, &get_version_92, &noop_send_cert, &noop_recv_cert, &noop_rename_var, &noop_change_attr, &noop_send_all_vars_backup, &noop_recv_all_vars_backup, }; libticalcs-1.1.9+dfsg/src/calc_nsp.c000066400000000000000000000613371327711501700173050ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: calc_89t.c 3810 2007-09-25 19:14:30Z roms $ */ /* libticalcs2 - hand-helds support library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * Copyright (C) 2006 Kevin Kofler * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Nspire support thru DirectUsb link. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "ticalcs.h" #include "gettext.h" #include "internal.h" #include "logging.h" #include "error.h" #include "nsp_vpkt.h" #include "nsp_cmd.h" // Helper function for multiple functions below. static gchar * build_path(CalcModel model, VarRequest * vr) { const char * dot_if_any; gchar * path; // Don't add a dot if this file type is unknown. if (vr->type >= NSP_MAXTYPES) { dot_if_any = ""; } else { dot_if_any = "."; } if (!strcmp(vr->folder, "")) { path = g_strconcat("/", vr->name, dot_if_any, tifiles_vartype2fext(model, vr->type), NULL); } else { path = g_strconcat("/", vr->folder, "/", vr->name, dot_if_any, tifiles_vartype2fext(model, vr->type), NULL); } return path; } // Helper macro for closing a session, but forwarding a prior error, if any. #define DO_CLOSE_SESSION(handle) \ do \ { \ if (!ret) \ { \ ret = nsp_session_close(handle); \ } \ else \ { \ nsp_session_close(handle); \ } \ } while (0); //int nsp_reset = 0; /* How things behave depending on OS version... - 1.1: no login request - 1.2 & 1.3: hand-held request LOGIN connection three seconds after device reset - 1.4: login request + service disconnect */ static int is_ready (CalcHandle* handle) { // If re-enabled, these ones should be moved to handle->priv. //static int rom_11 = 0; //static int rom_14 = 0; int ret; // XXX debrouxl forcing a full sequence makes all operations a LOT slower (especially on // older OS), but fixes the 100% reproducible loss of connection after a few "Status" // operations or a single "List" operation, on my S-0907A non-CAS Nspire. // Tested with OS 1.1.9253, 1.2.2398, 1.3.2407, 1.4.11653, 1.6.4379, 1.7.2471, 1.7.1.50. // // A better fix is needed in the mid- and long-term. // checking for OS version and LOGIN packet //if (!nsp_reset) do { static const char echostr[] = "ready"; int old; uint32_t size; uint8_t *data; // XXX debrouxl moving those two calls above the 'if (!nsp_reset)' test fixes connection // loss, but linking with at least 1.7.1.50 does not work properly after that: at least // directory listing and screenshot don't do anything beyond the "Status" probe. ret = nsp_addr_request(handle); if (ret) { break; } ret = nsp_addr_assign(handle, NSP_DEV_ADDR); if (ret) { break; } // XXX when commenting this OS version detection code, sending many Status or Dirlist // requests in quick succession often triggers memory corruption (hangs, reboots, // a variable amount of black pixels on the screen) on (at least) Nspire (CAS) OS 1.7... ticalcs_info(" waiting for LOGIN request (OS >= 1.2 check)..."); old = ticables_options_set_timeout(handle->cable, 40); // 3s mini ret = nsp_cmd_r_login(handle); // no call to nsp_send_nack(handle) because nack is managed in nsp_recv_data() ticables_options_set_timeout(handle->cable, old); if (ret) { ticalcs_info("OS = 1.1"); //rom_11 = !0; ret = nsp_addr_request(handle); if (ret) { break; } ret = nsp_addr_assign(handle, NSP_DEV_ADDR); if (ret) { break; } } else { ret = nsp_recv_disconnect(handle); if (ret) { ticalcs_info("OS = 1.2 or 1.3"); //rom_14 = 0; } else { ticalcs_info("OS = 1.4 or later"); //rom_14 = !0; } } //nsp_reset = !0; // Now use ECHO packet as ready check ret = nsp_session_open(handle, NSP_SID_ECHO); if (!ret) { ret = nsp_cmd_s_echo(handle, sizeof(echostr), (uint8_t *)echostr); if (!ret) { ret = nsp_cmd_r_echo(handle, &size, &data); if (!ret) { g_free(data); } } } } while (0); return ret; } static int send_key (CalcHandle* handle, uint32_t key) { int ret; ret = nsp_cmd_s_key(handle, key); return ret; } // Forward declaration static int get_version (CalcHandle* handle, CalcInfos* infos); static int recv_screen (CalcHandle* handle, CalcScreenCoord* sc, uint8_t** bitmap) { int ret; CalcInfos infos; // First of all, we have to identify the Nspire model. ret = get_version(handle, &infos); if (!ret) { if (infos.bits_per_pixel == 4) { // Nspire (CAS) Clickpad or Touchpad. sc->pixel_format = CALC_PIXFMT_GRAY_4; } else if (infos.bits_per_pixel == 16) { // Nspire (CAS) CX or CM. sc->pixel_format = CALC_PIXFMT_RGB_565_LE; } else { ticalcs_critical(_("Unknown calculator model with %d bpp\n"), infos.bits_per_pixel); return ERR_UNSUPPORTED; // THIS RETURNS ! } // Do screenshot ret = nsp_session_open(handle, NSP_SID_SCREEN_RLE); if (!ret) { ret = nsp_cmd_s_screen_rle(handle, 0); if (!ret) { uint32_t size = 0; uint8_t cmd, *data; ret = nsp_cmd_r_screen_rle(handle, &cmd, &size, &data); if (!ret) { sc->width = sc->clipped_width = (((uint16_t)data[8]) << 8) | data[9]; sc->height = sc->clipped_height = (((uint16_t)data[10]) << 8) | data[11]; size = ( (((uint32_t)data[0]) << 24) | (((uint32_t)data[1]) << 16) | (((uint32_t)data[2]) << 8) | (((uint32_t)data[3]) )); g_free(data); if (sc->width > 320) { ticalcs_critical("%s: no calculator model known to this library has screens of width > 320 pixels", __FUNCTION__); ret = ERR_INVALID_PACKET; } else if (sc->height > 240) { ticalcs_critical("%s: no calculator model known to this library has screens of height > 240 pixels", __FUNCTION__); ret = ERR_INVALID_PACKET; } else if (size > 2 * sc->width * sc->height) { ticalcs_critical("%s: no calculator model known to this library uses more than 16 bpp", __FUNCTION__); ret = ERR_INVALID_PACKET; } else { ret = nsp_cmd_r_screen_rle(handle, &cmd, &size, &data); if (!ret) { uint32_t len = sc->width * sc->height * infos.bits_per_pixel / 8; uint8_t * dst = ticalcs_alloc_screen(len); if (dst != NULL) { ret = ticalcs_screen_nspire_rle_uncompress(sc->pixel_format, data, size, dst, len); if (!ret) { *bitmap = dst; } else { ticalcs_free_screen(dst); } } else { ret = ERR_MALLOC; } g_free(data); } } } } DO_CLOSE_SESSION(handle); } } return ret; } // Helper function for get_dirlist, it does the bulk of the work. static int enumerate_folder(CalcHandle* handle, GNode** vars, const char * folder_name) { int ret; ticalcs_info("enumerate_folder<%s>\n", folder_name); do { char varname[VARNAME_MAX]; ret = nsp_cmd_s_dir_enum_init(handle, folder_name); if (ret) { break; } ret = nsp_cmd_r_dir_enum_init(handle); if (ret) { break; } for (;;) { VarEntry *fe; GNode *node; char *ext; uint32_t varsize; uint8_t vartype; ret = nsp_cmd_s_dir_enum_next(handle); if (ret) { break; } ret = nsp_cmd_r_dir_enum_next(handle, varname, &varsize, &vartype); if (ret == ERR_EOT) { ret = 0; break; } else if (ret != 0) { break; } fe = tifiles_ve_create(); ticalcs_strlcpy(fe->folder, folder_name + 1, sizeof(fe->folder)); // Skip leading / fe->size = varsize; fe->type = vartype; fe->attr = ATTRB_NONE; ext = tifiles_fext_get(varname); // Just a sanity check if (ext) { // Did the file name have any non-empty extension ? if (*ext) { // Do we know about this file type ? if (fe->type < NSP_MAXTYPES) { // Then we can remove the exension. *(ext-1) = '\0'; } // else don't remove the extension. } // else there is no extension to remove. } ticalcs_strlcpy(fe->name, varname, sizeof(fe->name)); node = dirlist_create_append_node(fe, vars); if (!node) { ret = ERR_MALLOC; break; } ticalcs_info(_("Name: %s | Type: %8s | Attr: %i | Size: %08X"), fe->name, tifiles_vartype2string(handle->model, fe->type), fe->attr, fe->size); } while (!ret) { int i; ret = nsp_cmd_s_dir_enum_done(handle); if (ret) { break; } ret = nsp_cmd_r_dir_enum_done(handle); if (ret) { break; } // Enumerate elements of root folder. for (i = 0; i < (int)g_node_n_children(*vars); i++) { char new_folder_name[FLDNAME_MAX]; const char * separator_if_any; GNode * folder = g_node_nth_child(*vars, i); uint8_t vartype = ((VarEntry *)(folder->data))->type; // Don't recurse into regular files (type 0, TNS or e.g. themes.csv on OS 3.0+). if (vartype == 0) { ticalcs_info(_("Not enumerating documents in %s because it's not a folder\n"), ((VarEntry *)(folder->data))->name); continue; } // Prevent names from starting with "//". if (strcmp(folder_name, "/")) { separator_if_any = "/"; } else { separator_if_any = ""; } ticalcs_slprintf(new_folder_name, sizeof(new_folder_name), "%s%s%s", folder_name, separator_if_any, ((VarEntry *)(folder->data))->name); ticalcs_info(_("Directory listing in <%s>...\n"), new_folder_name); ret = enumerate_folder(handle, &folder, new_folder_name); if (ret) { break; } } break; } } while (0); return ret; } static int get_dirlist (CalcHandle* handle, GNode** vars, GNode** apps) { GNode *root; int ret; ret = dirlist_init_trees(handle, vars, apps); if (ret) { return ret; } root = g_node_new(NULL); if (!root) { return ERR_MALLOC; } g_node_append(*apps, root); ret = nsp_session_open(handle, NSP_SID_FILE_MGMT); if (!ret) { ret = nsp_cmd_s_dir_attributes(handle, "/"); if (!ret) { ret = nsp_cmd_r_dir_attributes(handle, NULL, NULL, NULL); if (!ret) { ret = nsp_session_close(handle); if (!ret) { ret = nsp_session_open(handle, NSP_SID_FILE_MGMT); if (!ret) { ret = enumerate_folder(handle, vars, "/"); // Fall through for closing session. } } } } DO_CLOSE_SESSION(handle); } return ret; } static int get_memfree (CalcHandle* handle, uint32_t* ram, uint32_t* flash) { int ret; ret = nsp_session_open(handle, NSP_SID_DEV_INFOS); if (!ret) { ret = nsp_cmd_s_dev_infos(handle, NSP_CMD_DI_VERSION); if (!ret) { uint32_t size; uint8_t cmd, *data; ret = nsp_cmd_r_dev_infos(handle, &cmd, &size, &data); if (!ret) { *flash = ( (((uint32_t)data[4]) << 24) | (((uint32_t)data[5]) << 16) | (((uint32_t)data[6]) << 8) | (((uint32_t)data[7]) )); *ram = ( (((uint32_t)data[20]) << 24) | (((uint32_t)data[21]) << 16) | (((uint32_t)data[22]) << 8) | (((uint32_t)data[23]) )); g_free(data); } } DO_CLOSE_SESSION(handle); } return ret; } static int send_var (CalcHandle* handle, CalcMode mode, FileContent* content) { uint8_t status; gchar *path; int ret; VarEntry * entry; update_->cnt2 = 0; update_->max2 = 1; update_->pbar(); entry = content->entries[0]; if (!ticalcs_validate_varentry(entry)) { ticalcs_critical("%s: skipping invalid content entry #0", __FUNCTION__); return ERR_INVALID_PARAMETER; } if (entry->action == ACT_SKIP) { return 0; } //if (!strlen(entry->folder)) //{ // return ERR_ABORT; //} ret = nsp_session_open(handle, NSP_SID_FILE_MGMT); if (ret) { return ret; } path = build_path(handle->model, entry); ticonv_varname_to_utf8_sn(handle->model, path, update_->text, sizeof(update_->text), entry->type); update_label(); ret = nsp_cmd_s_put_file(handle, path, entry->size); g_free(path); if (!ret) { ret = nsp_cmd_r_put_file(handle); if (!ret) { ret = nsp_cmd_s_file_contents(handle, entry->size, entry->data); if (!ret) { ret = nsp_cmd_r_status(handle, &status); } } } DO_CLOSE_SESSION(handle); return ret; } static int recv_var (CalcHandle* handle, CalcMode mode, FileContent* content, VarRequest* vr) { char *path; int ret; ret = nsp_session_open(handle, NSP_SID_FILE_MGMT); if (ret) { return ret; } path = build_path(handle->model, vr); ticonv_varname_to_utf8_sn(handle->model, path, update_->text, sizeof(update_->text), vr->type); update_label(); ret = nsp_cmd_s_get_file(handle, path); g_free(path); if (!ret) { ret = nsp_cmd_r_get_file(handle, &(vr->size)); if (!ret) { ret = nsp_cmd_s_file_ok(handle); if (!ret) { uint8_t *data = NULL; if (vr->size) { ret = nsp_cmd_r_file_contents(handle, &(vr->size), &data); } if (!ret) { ret = nsp_cmd_s_status(handle, NSP_ERR_OK); if (!ret) { VarEntry *ve; content->model = handle->model; ticalcs_strlcpy(content->comment, tifiles_comment_set_single(), sizeof(content->comment)); content->num_entries = 1; content->entries = tifiles_ve_create_array(1); ve = content->entries[0] = tifiles_ve_create(); memcpy(ve, vr, sizeof(VarEntry)); ve->data = tifiles_ve_alloc_data(ve->size); if (data && ve->data) { memcpy(ve->data, data, ve->size); } } g_free(data); } } } } // Close session at the end. // XXX don't check the result of this call, to enable reception of variables from Nspires running OS >= 1.7. // Those versions send a martian packet: // * a src port never seen before in the conversation; // * an improper dest port; // * a 1-byte payload containing 02 (i.e. an invalid address for the next packet). // * .ack = 0x00 (instead of 0x0A). nsp_session_close(handle); return ret; } static int send_os (CalcHandle* handle, FlashContent* content) { int ret; if (content == NULL) { return -1; } tifiles_hexdump(content->data_part + content->data_length - 16, 16); do { ret = nsp_session_open(handle, NSP_SID_OS_INSTALL); if (!ret) { uint8_t value; ret = nsp_cmd_s_os_install(handle, content->data_length); if (ret) { break; } ret = nsp_cmd_r_os_install(handle); if (!ret) { uint8_t status; ret = nsp_cmd_s_os_contents(handle, 253, content->data_part); if (ret) { break; } ret = nsp_cmd_r_status(handle, &status); if (ret) { break; } ret = nsp_cmd_s_os_contents(handle, content->data_length - 253, content->data_part + 253); if (ret) { break; } } update_->cnt2 = 0; update_->max2 = 100; update_->pbar(); do { ret = nsp_cmd_r_progress(handle, &value); if (ret) { break; } update_->cnt2 = value; update_->pbar(); } while (value < 100); DO_CLOSE_SESSION(handle); } } while (0); return ret; } static int recv_idlist (CalcHandle* handle, uint8_t* id) { int ret; ret = nsp_session_open(handle, NSP_SID_DEV_INFOS); if (!ret) { ret = nsp_cmd_s_dev_infos(handle, NSP_CMD_DI_VERSION); if (!ret) { uint32_t size; uint8_t cmd, *data; ret = nsp_cmd_r_dev_infos(handle, &cmd, &size, &data); if (!ret) { strncpy((char *)id, (char*)(data + 82), 28); id[28] = 0; g_free(data); } } DO_CLOSE_SESSION(handle); } return ret; } static int dump_rom_1 (CalcHandle* handle) { (void)handle; return 0; } static int dump_rom_2 (CalcHandle* handle, CalcDumpSize size, const char *filename) { int ret; FILE *f; ticalcs_info("FIXME: make ROM dumping work above OS 1.x, using the Fron method"); f = fopen(filename, "wb"); if (f == NULL) { return ERR_OPEN_FILE; } ret = nsp_session_open(handle, NSP_SID_FILE_MGMT); if (!ret) { ret = nsp_cmd_s_get_file(handle, "../phoenix/install/TI-Nspire.tnc"); if (!ret) { uint32_t varsize; ret = nsp_cmd_r_get_file(handle, &varsize); if (!ret) { ret = nsp_cmd_s_file_ok(handle); if (!ret) { uint8_t *data; ret = nsp_cmd_r_file_contents(handle, &varsize, &data); if (!ret) { ret = nsp_cmd_s_status(handle, NSP_ERR_OK); if (!ret) { if (fwrite(data, varsize, 1, f) < 1) { ret = ERR_SAVE_FILE; } } g_free(data); } } } } DO_CLOSE_SESSION(handle); } fclose(f); return ret; } static int del_var (CalcHandle* handle, VarRequest* vr) { char *utf8; char *path; int ret; ret = nsp_session_open(handle, NSP_SID_FILE_MGMT); if (ret) { return ret; } path = build_path(handle->model, vr); utf8 = ticonv_varname_to_utf8(handle->model, path, vr->type); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Deleting %s..."), utf8); ticonv_utf8_free(utf8); update_label(); ret = nsp_cmd_s_del_file(handle, path); g_free(path); if (!ret) { ret = nsp_cmd_r_del_file(handle); } DO_CLOSE_SESSION(handle); return ret; } static int new_folder (CalcHandle* handle, VarRequest* vr) { char *utf8; char *path; int ret; ret = nsp_session_open(handle, NSP_SID_FILE_MGMT); if (ret) { return ret; } path = g_strconcat("/", vr->folder, NULL); utf8 = ticonv_varname_to_utf8(handle->model, path, -1); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Creating %s..."), utf8); ticonv_utf8_free(utf8); update_label(); ret = nsp_cmd_s_new_folder(handle, path); g_free(path); if (!ret) { ret = nsp_cmd_r_new_folder(handle); } DO_CLOSE_SESSION(handle); return ret; } static int get_version (CalcHandle* handle, CalcInfos* infos) { int ret; ret = nsp_session_open(handle, NSP_SID_DEV_INFOS); if (ret) { return ret; } do { uint32_t size; uint8_t cmd, *data; ret = nsp_cmd_s_dev_infos(handle, NSP_CMD_DI_MODEL); if (ret) { break; } ret = nsp_cmd_r_dev_infos(handle, &cmd, &size, &data); if (ret) { break; } ticalcs_strlcpy(infos->product_name, (char *)data, sizeof(infos->product_name)); infos->mask = INFOS_PRODUCT_NAME; g_free(data); ret = nsp_cmd_s_dev_infos(handle, NSP_CMD_DI_VERSION); if (ret) { break; } ret = nsp_cmd_r_dev_infos(handle, &cmd, &size, &data); if (ret) { break; } infos->model = CALC_NSPIRE; infos->flash_free = ( (((uint64_t)data[ 0]) << 56) | (((uint64_t)data[ 1]) << 48) | (((uint64_t)data[ 2]) << 40) | (((uint64_t)data[ 3]) << 32) | (((uint64_t)data[ 4]) << 24) | (((uint64_t)data[ 5]) << 16) | (((uint64_t)data[ 6]) << 8) | (((uint64_t)data[ 7]) )); infos->mask |= INFOS_FLASH_FREE; infos->flash_phys = ( (((uint64_t)data[ 8]) << 56) | (((uint64_t)data[ 9]) << 48) | (((uint64_t)data[10]) << 40) | (((uint64_t)data[11]) << 32) | (((uint64_t)data[12]) << 24) | (((uint64_t)data[13]) << 16) | (((uint64_t)data[14]) << 8) | (((uint64_t)data[15]) )); infos->mask |= INFOS_FLASH_PHYS; infos->ram_free = ( (((uint64_t)data[16]) << 56) | (((uint64_t)data[17]) << 48) | (((uint64_t)data[18]) << 40) | (((uint64_t)data[19]) << 32) | (((uint64_t)data[20]) << 24) | (((uint64_t)data[21]) << 16) | (((uint64_t)data[22]) << 8) | (((uint64_t)data[23]) )); infos->mask |= INFOS_RAM_FREE; infos->ram_phys = ( (((uint64_t)data[24]) << 56) | (((uint64_t)data[25]) << 48) | (((uint64_t)data[26]) << 40) | (((uint64_t)data[27]) << 32) | (((uint64_t)data[28]) << 24) | (((uint64_t)data[29]) << 16) | (((uint64_t)data[30]) << 8) | (((uint64_t)data[31]) )); infos->mask |= INFOS_RAM_PHYS; infos->battery = (data[32] == 0x01) ? 0 : 1; infos->mask |= INFOS_BATTERY; infos->clock_speed = data[35]; infos->mask |= INFOS_CLOCK_SPEED; ticalcs_slprintf(infos->os_version, sizeof(infos->os_version), "%1i.%1i.%04i", data[36], data[37], (((int)data[38]) << 8) | data[39]); infos->mask |= INFOS_OS_VERSION; ticalcs_slprintf(infos->boot_version, sizeof(infos->boot_version), "%1i.%1i.%04i", data[40], data[41], (((int)data[42]) << 8) | data[43]); infos->mask |= INFOS_BOOT_VERSION; ticalcs_slprintf(infos->boot2_version, sizeof(infos->boot2_version), "%1i.%1i.%04i", data[44], data[45], (((int)data[46]) << 8) | data[47]); infos->mask |= INFOS_BOOT2_VERSION; infos->hw_version = ( (((uint32_t)data[48]) << 24) | (((uint32_t)data[49]) << 16) | (((uint32_t)data[50]) << 8) | (((uint32_t)data[51]) )); infos->mask |= INFOS_HW_VERSION; infos->run_level = data[53]; infos->mask |= INFOS_RUN_LEVEL; infos->lcd_width = ( (((uint16_t)data[58]) << 8) | (((uint16_t)data[59]) )); infos->mask |= INFOS_LCD_WIDTH; infos->lcd_height = ( (((uint16_t)data[60]) << 8) | (((uint16_t)data[61]) )); infos->mask |= INFOS_LCD_HEIGHT; infos->bits_per_pixel = data[62]; infos->mask |= INFOS_BPP; infos->device_type = data[64]; infos->mask |= INFOS_DEVICE_TYPE; memset(infos->main_calc_id, 0, sizeof(infos->main_calc_id)); strncpy(infos->main_calc_id, (char*)(data + 82), 28); infos->mask |= INFOS_MAIN_CALC_ID; memset(infos->product_id, 0, sizeof(infos->product_id)); strncpy(infos->product_id, (char*)(data + 82), 28); infos->mask |= INFOS_PRODUCT_ID; g_free(data); } while (0); DO_CLOSE_SESSION(handle); return ret; } static int rename_var (CalcHandle* handle, VarRequest* oldname, VarRequest* newname) { char *utf81, *utf82; char *path1, *path2; int ret; ret = nsp_session_open(handle, NSP_SID_FILE_MGMT); if (ret) { return ret; } path1 = build_path(handle->model, oldname); path2 = build_path(handle->model, newname); utf81 = ticonv_varname_to_utf8(handle->model, path1, oldname->type); utf82 = ticonv_varname_to_utf8(handle->model, path2, newname->type); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Renaming %s to %s..."), utf81, utf82); ticonv_utf8_free(utf82); ticonv_utf8_free(utf81); update_label(); ret = nsp_cmd_s_rename_file(handle, path1, path2); g_free(path2); g_free(path1); if (!ret) { ret = nsp_cmd_r_rename_file(handle); } DO_CLOSE_SESSION(handle); return ret; } const CalcFncts calc_nsp = { CALC_NSPIRE, "Nspire", "Nspire handheld", N_("Nspire thru DirectLink"), OPS_ISREADY | OPS_VERSION | OPS_SCREEN | OPS_IDLIST | OPS_DIRLIST | OPS_VARS | OPS_OS | OPS_ROMDUMP | OPS_NEWFLD | OPS_DELVAR | OPS_RENAME | FTS_SILENT | FTS_MEMFREE | FTS_FOLDER, PRODUCT_ID_NSPIRE_CAS, // FIXME the Nspire series spans multiple product IDs. {"", /* is_ready */ "", /* send_key */ "", /* execute */ "1P", /* recv_screen */ "1L", /* get_dirlist */ "", /* get_memfree */ "", /* send_backup */ "", /* recv_backup */ "2P1L", /* send_var */ "1P1L", /* recv_var */ "2P1L", /* send_var_ns */ "1P1L", /* recv_var_ns */ "2P1L", /* send_app */ "2P1L", /* recv_app */ "2P", /* send_os */ "1L", /* recv_idlist */ "2P", /* dump_rom_1 */ "2P", /* dump_rom_2 */ "", /* set_clock */ "", /* get_clock */ "1L", /* del_var */ "1L", /* new_folder */ "", /* get_version */ "1L", /* send_cert */ "1L", /* recv_cert */ "", /* rename */ "", /* chattr */ "2P1L", /* send_all_vars_backup */ "2P1L" /* recv_all_vars_backup */ }, &is_ready, &send_key, &noop_execute, &recv_screen, &get_dirlist, &get_memfree, &noop_send_backup, &noop_recv_backup, &send_var, &recv_var, &noop_send_var_ns, &noop_recv_var_ns, &noop_send_flash, &noop_recv_flash, &send_os, &recv_idlist, &dump_rom_1, &dump_rom_2, &noop_set_clock, &noop_get_clock, &del_var, &new_folder, &get_version, &noop_send_cert, &noop_recv_cert, &rename_var, &noop_change_attr, &noop_send_all_vars_backup, &tixx_recv_all_vars_backup, }; libticalcs-1.1.9+dfsg/src/calc_xx.c000066400000000000000000001137031327711501700171370ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs2 - hand-helds support library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * Copyright (C) 2006 Kevin Kofler * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "ticalcs.h" #include "internal.h" #include "gettext.h" #include "logging.h" #include "error.h" /** * ticalcs_calc_features: * @handle: a previously allocated handle * * Returns the features and operations supported by the hand-held. * * Return value: a mask of features (CalcFeatures). **/ TIEXPORT3 CalcFeatures TICALL ticalcs_calc_features(CalcHandle* handle) { const CalcFncts *calc; if (handle == NULL) { ticalcs_critical("%s: handle is NULL", __FUNCTION__); return FTS_NONE; } calc = handle->calc; if (!calc) { return FTS_NONE; } return calc->features; } /** * ticalcs_calc_isready: * @handle: a previously allocated handle * * Check whether calc is ready. * * NOTE: after connecting to the calculator, you usually want to use this command once, * before attempting to use any other commands. This is required on some models (protocols). * There are exceptions to this general rule, especially when a DUSB calculator (84+ family, 89T) * is in the OS receive mode, where the Ready check cannot be performed. * * Return value: 0 if ready else ERR_NOT_READY. **/ TIEXPORT3 int TICALL ticalcs_calc_isready(CalcHandle* handle) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Checking hand-held status:")); handle->busy = 1; if (calc->is_ready) { ret = calc->is_ready(handle); } handle->busy = 0; return ret; } /** * ticalcs_calc_send_key: * @handle: a previously allocated handle * @key: a TI scancode * * Check whether calc is ready. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_send_key(CalcHandle* handle, uint32_t key) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Sending key %08x:"), key); handle->busy = 1; if (calc->send_key) { ret = calc->send_key(handle, key); } handle->busy = 0; return ret; } /** * ticalcs_calc_execute: * @handle: a previously allocated handle * @ve: folder and variable name with type * @args: argument to pass to program (in TI-charset, aka native) * * Remotely execute a program or a FLASH application. * Restrictions: execution of FLASH applications is supported thru D-USB only. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_execute(CalcHandle* handle, VarEntry* ve, const char* args) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_VARENTRY(ve); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Executing %s/%s with %s:"), ve->folder, ve->name, args); handle->busy = 1; if (calc->execute) { ret = calc->execute(handle, ve, args); } handle->busy = 0; return ret; } /** * ticalcs_calc_recv_screen: * @handle: a previously allocated handle * @sc: a structure which contains required screen format and returns screen sizes * @bitmap: adress of pointer for allocated bitmap. Must be freed when no longer needed. * * Request a screenshot and receive a raw bitmap in the calculator's native format (depending on the model, 1 bit B/W, 4-bit grayscale, 16-bit color). * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_recv_screen(CalcHandle* handle, CalcScreenCoord* sc, uint8_t** bitmap) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(sc); VALIDATE_NONNULL(bitmap); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Requesting screenshot:")); handle->busy = 1; if (calc->recv_screen) { ret = calc->recv_screen(handle, sc, bitmap); } handle->busy = 0; return ret; } /** * ticalcs_calc_recv_screen_rgb888: * @handle: a previously allocated handle * @sc: a structure which contains required screen format and returns screen sizes * @bitmap: adress of pointer for allocated bitmap. Must be freed when no longer needed. * * Request a screenshot and receive a RGB888 bitmap (convenience function). * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_recv_screen_rgb888(CalcHandle* handle, CalcScreenCoord* sc, uint8_t** bitmap) { int ret = ticalcs_calc_recv_screen(handle, sc, bitmap); if (!ret) { uint8_t * bitmap2 = NULL; if (sc->width > 320) { ticalcs_critical("%s: no calculator model known to this library has screens of width > 320 pixels", __FUNCTION__); ticalcs_free_screen(*bitmap); ret = ERR_INVALID_PARAMETER; } else if (sc->height > 240) { ticalcs_critical("%s: no calculator model known to this library has screens of height > 240 pixels", __FUNCTION__); ticalcs_free_screen(*bitmap); ret = ERR_INVALID_PARAMETER; } else { bitmap2 = ticalcs_alloc_screen(3 * sc->width * sc->height); ret = ticalcs_screen_convert_native_to_rgb888(sc->pixel_format, *bitmap, sc->width, sc->height, bitmap2); if (ret) { ticalcs_free_screen(bitmap2); bitmap2 = NULL; } } *bitmap = bitmap2; } return ret; } /** * ticalcs_free_screen: * @bitmap: a previously allocated bitmap * * Frees a bitmap previously allocated by ticalcs_calc_recv_screen() or ticalcs_calc_recv_screen_rgb888(). */ TIEXPORT3 void TICALL ticalcs_free_screen(uint8_t * bitmap) { g_free((void *)bitmap); } /** * ticalcs_calc_get_dirlist: * @handle: a previously allocated handle * @vars: a tree of folder & variables * @apps: a tree of FLASH apps * * Request a directory listing. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_get_dirlist(CalcHandle* handle, GNode** vars, GNode **apps) { const CalcFncts *calc; int ret = 0; TreeInfo *ti; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(vars); VALIDATE_NONNULL(apps); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); *vars = NULL; *apps = NULL; ticalcs_info(_("Requesting folder & vars & apps listing:")); handle->busy = 1; if (calc->get_dirlist) { ret = calc->get_dirlist(handle, vars, apps); } handle->busy = 0; if (!ret) { if (*vars != NULL) { ti = (*vars)->data; ti->mem_mask |= MEMORY_USED; ti->mem_used = ticalcs_dirlist_ram_used(*vars); } if (*apps != NULL) { ti = (*apps)->data; ti->mem_mask |= MEMORY_USED; ti->mem_used = ticalcs_dirlist_flash_used(*vars, *apps); } } return ret; } /** * ticalcs_calc_get_memfree: * @handle: a previously allocated handle * @ram: RAM memory available * @flash: Flash memory available * * Request free memory. Do a dirlist to update value. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_get_memfree(CalcHandle* handle, uint32_t* ram, uint32_t *flash) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(ram); VALIDATE_NONNULL(flash); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Requesting RAM & FLASH free")); handle->busy = 1; if (calc->get_memfree) { ret = calc->get_memfree(handle, ram, flash); } handle->busy = 0; return ret; } /** * ticalcs_calc_send_backup: * @handle: a previously allocated handle * @content: backup content * * Send a backup. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_send_backup(CalcHandle* handle, BackupContent* content) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_BACKUPCONTENT(content); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Sending backup:")); handle->busy = 1; if (calc->send_backup) { ret = calc->send_backup(handle, content); } handle->busy = 0; return ret; } /** * ticalcs_calc_recv_backup: * @handle: a previously allocated handle * @content: backup content * * Request a backup and receive it. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_recv_backup(CalcHandle* handle, BackupContent* content) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_BACKUPCONTENT(content); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Requesting backup:")); handle->busy = 1; if (calc->recv_backup) { ret = calc->recv_backup(handle, content); } handle->busy = 0; return ret; } /** * ticalcs_calc_send_var: * @handle: a previously allocated handle * @mode: to document * @content: file content to send * * Send one or more variables (silent mode). * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_send_var(CalcHandle* handle, CalcMode mode, FileContent* content) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_FILECONTENT(content); VALIDATE_FILECONTENT_ENTRIES(content); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Sending one or more variables:")); handle->busy = 1; if (calc->send_var) { ret = calc->send_var(handle, mode, content); } handle->busy = 0; return ret; } /** * ticalcs_calc_recv_var: * @handle: a previously allocated handle * @mode: * @content: where to store variable content * @var: a #VarRequest structure got with dirlist * * Request receiving of _one_ variable (silent mode). * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_recv_var(CalcHandle* handle, CalcMode mode, FileContent* content, VarRequest* vr) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_FILECONTENT(content); VALIDATE_VARREQUEST(vr); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Requesting variable '%s':"), vr->name); handle->busy = 1; if (calc->recv_var) { ret = calc->recv_var(handle, mode, content, vr); } handle->busy = 0; return ret; } /** * ticalcs_calc_send_var_ns: * @handle: a previously allocated handle * @mode: * @content: file content to send * * Send one or more variable (non-silent mode). * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_send_var_ns(CalcHandle* handle, CalcMode mode, FileContent* content) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_FILECONTENT(content); VALIDATE_FILECONTENT_ENTRIES(content); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Sending variable (non-silent mode):")); handle->busy = 1; if (calc->send_var_ns) { ret = calc->send_var_ns(handle, mode, content); } handle->busy = 0; return ret; } /** * ticalcs_calc_recv_var_ns: * @handle: a previously allocated handle * @mode: * @content: where to store variables * @var: information on the received variable (if single) or NULL (if group) * * Receive one or more variable (non-silent mode). * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_recv_var_ns(CalcHandle* handle, CalcMode mode, FileContent* content, VarEntry** var) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_FILECONTENT(content); VALIDATE_NONNULL(var); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Receiving variable (non-silent mode):")); handle->busy = 1; if (calc->recv_var_ns) { ret = calc->recv_var_ns(handle, mode, content, var); } handle->busy = 0; return ret; } /** * ticalcs_calc_send_app: * @handle: a previously allocated handle * @content: content to send * * Send a FLASH app. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_send_app(CalcHandle* handle, FlashContent* content) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_FLASHCONTENT(content); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Sending FLASH application:")); handle->busy = 1; if (calc->send_app) { ret = calc->send_app(handle, content); } handle->busy = 0; return ret; } /** * ticalcs_calc_recv_app: * @handle: a previously allocated handle * @content: where to store content * @var: FLASH app to request * * Request receiving of a FLASH app. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_recv_app(CalcHandle* handle, FlashContent* content, VarRequest* vr) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_FLASHCONTENT(content); VALIDATE_VARREQUEST(vr); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Requesting receiving of FLASH application:")); handle->busy = 1; if (calc->recv_app) { ret = calc->recv_app(handle, content, vr); } handle->busy = 0; return ret; } /** * ticalcs_calc_send_os: * @handle: a previously allocated handle * @content: content to send * * Send a FLASH os. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_send_os(CalcHandle* handle, FlashContent* content) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_FLASHCONTENT(content); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Sending FLASH os:")); handle->busy = 1; if (calc->send_os) { ret = calc->send_os(handle, content); } handle->busy = 0; return ret; } /** * ticalcs_calc_recv_idlist: * @handle: a previously allocated handle * @idlist: static buffer (32 chars) where to store ID-LIST * * Request ID-LIST of hand-held. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_recv_idlist(CalcHandle* handle, uint8_t* idlist) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(idlist); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Requesting ID-LIST:")); handle->busy = 1; if (calc->recv_idlist) { ret = calc->recv_idlist(handle, idlist); } handle->busy = 0; return ret; } /** * ticalcs_calc_dump_rom_1: * @handle: a previously allocated handle * * Send a ROM dumping program to hand-held. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_dump_rom_1(CalcHandle* handle) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Sending ROM dumper:")); handle->busy = 1; if (calc->dump_rom_1) { ret = calc->dump_rom_1(handle); } handle->busy = 0; return ret; } /** * ticalcs_calc_dump_rom_2: * @handle: a previously allocated handle * @size: optional size of dump * @filename: where to store the dump * * Start dumping (if possible). * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_dump_rom_2(CalcHandle* handle, CalcDumpSize size, const char *filename) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(filename); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Dumping ROM:")); handle->busy = 1; if (calc->dump_rom_2) { ret = calc->dump_rom_2(handle, size, filename); } handle->busy = 0; return ret; } /** * ticalcs_calc_set_clock: * @handle: a previously allocated handle * @clock: a #CalcClock structure * * Set date & time of hand-held (if AMS >= 2.09). * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_set_clock(CalcHandle* handle, CalcClock* _clock) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(_clock); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Setting clock:")); handle->busy = 1; if (calc->set_clock) { ret = calc->set_clock(handle, _clock); } handle->busy = 0; return ret; } /** * ticalcs_calc_get_clock: * @handle: a previously allocated handle * @clock: a #CalcClock structure * * Get date & time of hand-held (if AMS >= 2.09). * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_get_clock(CalcHandle* handle, CalcClock* _clock) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(_clock); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Getting clock:")); handle->busy = 1; if (calc->get_clock) { ret = calc->get_clock(handle, _clock); } handle->busy = 0; return ret; } /** * ticalcs_calc_del_var: * @handle: a previously allocated handle * @var: var to delete * * Request deleting of a variable (if possible). * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_del_var(CalcHandle* handle, VarRequest* vr) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_VARREQUEST(vr); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Deleting variable '%s':"), vr->name); handle->busy = 1; if (calc->del_var) { ret = calc->del_var(handle, vr); } handle->busy = 0; return ret; } /** * ticalcs_calc_new_fld: * @handle: a previously allocated handle * @vr: name of folder to create (vr->folder) * * Request creation of a folder. Beware: %vr.name may be modified ! * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_new_fld(CalcHandle* handle, VarRequest* vr) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_VARREQUEST(vr); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Creating folder '%s':"), vr->folder); handle->busy = 1; if (calc->new_fld) { ret = calc->new_fld(handle, vr); } handle->busy = 0; return ret; } /** * ticalcs_calc_get_version: * @handle: a previously allocated handle * @infos: where to store version information * * Request version info. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_get_version(CalcHandle* handle, CalcInfos* infos) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(infos); calc = handle->calc; VALIDATE_CALCFNCTS(calc); //RETURN_IF_HANDLE_NOT_ATTACHED(handle); // Disabled after '2005 probing changes. RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Requesting version info:")); handle->busy = 1; if (calc->get_version) { ret = calc->get_version(handle, infos); } handle->busy = 0; return ret; } /** * ticalcs_calc_send_cert: * @handle: a previously allocated handle * @content: content to send * * Send a certificate. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_send_cert(CalcHandle* handle, FlashContent* content) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_FLASHCONTENT(content); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Sending certificate:")); handle->busy = 1; if (calc->send_cert) { ret = calc->send_cert(handle, content); } handle->busy = 0; return ret; } /** * ticalcs_calc_recv_cert: * @handle: a previously allocated handle * @content: where to store content * * Request receiving of a FLASH app. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_recv_cert(CalcHandle* handle, FlashContent* content) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_FLASHCONTENT(content); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Requesting receiving of certificate:")); handle->busy = 1; if (calc->recv_cert) { ret = calc->recv_cert(handle, content); } handle->busy = 0; return ret; } /** * ticalcs_calc_rename_var: * @handle: a previously allocated handle * @oldname: existing name and folder * @newname: new name and folder * * Remotely rename a variable, and/or move it to a different folder. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_rename_var(CalcHandle* handle, VarRequest* oldname, VarRequest *newname) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_VARREQUEST(oldname); VALIDATE_VARREQUEST(newname); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); if (oldname->folder[0] && newname->folder[0]) { ticalcs_info(_("Renaming variable '%s/%s' to '%s/%s':"), oldname->folder, oldname->name, newname->folder, newname->name); } else { ticalcs_info(_("Renaming variable '%s' to '%s':"), oldname->name, newname->name); } handle->busy = 1; if (calc->rename_var) { ret = calc->rename_var(handle, oldname, newname); } handle->busy = 0; return ret; } /** * ticalcs_calc_change_attr: * @handle: a previously allocated handle * @vr: variable to modify * @attr: new attributes for variable * * Remotely change a variable's archive/lock state. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_change_attr(CalcHandle* handle, VarRequest* vr, FileAttr attr) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_VARREQUEST(vr); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Setting variable '%s' to %s:"), vr->name, tifiles_attribute_to_string(attr)); handle->busy = 1; if (calc->change_attr) { ret = calc->change_attr(handle, vr, attr); } handle->busy = 0; return ret; } /** * ticalcs_calc_send_all_vars_backup: * @handle: a previously allocated handle * @content: backup content * * Send a fake backup, for the models which support it. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_send_all_vars_backup(CalcHandle* handle, FileContent* content) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_FILECONTENT(content); VALIDATE_FILECONTENT_ENTRIES(content); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Sending fake (all vars) backup:")); handle->busy = 1; if (calc->send_all_vars_backup) { ret = calc->send_all_vars_backup(handle, content); } handle->busy = 0; return ret; } /** * ticalcs_calc_recv_all_vars_backup: * @handle: a previously allocated handle * @content: backup content * * Request a fake backup (list of vars and apps) and receive it. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_recv_all_vars_backup(CalcHandle* handle, FileContent* content) { const CalcFncts *calc; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_FILECONTENT(content); calc = handle->calc; VALIDATE_CALCFNCTS(calc); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); ticalcs_info(_("Requesting fake (all vars) backup:")); handle->busy = 1; if (calc->recv_all_vars_backup) { ret = calc->recv_all_vars_backup(handle, content); } handle->busy = 0; return ret; } // --- /** * ticalcs_calc_send_backup2: * @handle: a previously allocated handle * @filename: name of file which contains backup to send * * Send a backup from file. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_send_backup2(CalcHandle* handle, const char* filename) { int ret = ERR_FILE_OPEN; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(filename); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); if (ticalcs_calc_features(handle) & FTS_BACKUP) { // true backup capability BackupContent * content = tifiles_content_create_backup(handle->model); if (content != NULL) { ret = tifiles_file_read_backup(filename, content); if (!ret) { ret = ticalcs_calc_send_backup(handle, content); tifiles_content_delete_backup(content); } } } else { // pseudo-backup FileContent * content = tifiles_content_create_regular(handle->model); if (content != NULL) { ret = tifiles_file_read_regular(filename, content); if (!ret) { ret = ticalcs_calc_send_all_vars_backup(handle, content); tifiles_content_delete_regular(content); } } } return ret; } /** * ticalcs_calc_recv_backup2: * @handle: a previously allocated handle * @filename: name of file where to store backup * * Request a backup and receive it to file. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_recv_backup2(CalcHandle* handle, const char *filename) { int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(filename); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); if (ticalcs_calc_features(handle) & FTS_BACKUP) { // true backup capability BackupContent * content = tifiles_content_create_backup(handle->model); ret = ticalcs_calc_recv_backup(handle, content); if (!ret) { ret = tifiles_file_write_backup(filename, content); } tifiles_content_delete_backup(content); } else { // pseudo-backup FileContent * content = tifiles_content_create_regular(handle->model); ret = ticalcs_calc_recv_all_vars_backup(handle, content); if (!ret) { ret = tifiles_file_write_regular(filename, content, NULL); } tifiles_content_delete_regular(content); } return ret; } /** * ticalcs_calc_send_var2: * @handle: a previously allocated handle * @mode: to document * @filename: name of file * * Send one or more variables (silent mode) from file. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_send_var2(CalcHandle* handle, CalcMode mode, const char* filename) { FileContent *content; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(filename); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); content = tifiles_content_create_regular(handle->model); ret = tifiles_file_read_regular(filename, content); if (!ret) { ret = ticalcs_calc_send_var(handle, mode, content); tifiles_content_delete_regular(content); } return ret; } /** * ticalcs_calc_recv_var2: * @handle: a previously allocated handle * @mode: * @content: where to store variable content * @var: a #VarRequest structure got with dirlist * * Request receiving of _one_ variable (silent mode). * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_recv_var2(CalcHandle* handle, CalcMode mode, const char* filename, VarRequest* vr) { FileContent *content; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(filename); VALIDATE_VARREQUEST(vr); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); content = tifiles_content_create_regular(handle->model); ret = ticalcs_calc_recv_var(handle, mode, content, vr); if (!ret) { ret = tifiles_file_write_regular(filename, content, NULL); } tifiles_content_delete_regular(content); return ret; } /** * ticalcs_calc_send_var_ns2: * @handle: a previously allocated handle * @mode: * @filename: name of file * * Send one or more variable (non-silent mode). * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_send_var_ns2(CalcHandle* handle, CalcMode mode, const char* filename) { FileContent *content; int ret = ERR_FILE_OPEN; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(filename); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); content = tifiles_content_create_regular(handle->model); if (content != NULL) { ret = tifiles_file_read_regular(filename, content); if (!ret) { ret = ticalcs_calc_send_var_ns(handle, mode, content); tifiles_content_delete_regular(content); } } return ret; } /** * ticalcs_calc_recv_var_ns2: * @handle: a previously allocated handle * @mode: * @filename: where to store variables * @var: information on the received variable (if single) or NULL (if group) * * Receive one or more variable (non-silent mode). * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_recv_var_ns2(CalcHandle* handle, CalcMode mode, const char* filename, VarEntry** vr) { FileContent *content; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(filename); VALIDATE_NONNULL(vr); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); content = tifiles_content_create_regular(handle->model); ret = ticalcs_calc_recv_var_ns(handle, mode, content, vr); if (!ret) { ret = tifiles_file_write_regular(filename, content, NULL); } tifiles_content_delete_regular(content); return ret; } /** * ticalcs_calc_send_app2: * @handle: a previously allocated handle * @filename: name of file * * Send a FLASH app or os. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_send_app2(CalcHandle* handle, const char* filename) { FlashContent *content; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(filename); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); content = tifiles_content_create_flash(handle->model); ret = tifiles_file_read_flash(filename, content); if (!ret) { ret = ticalcs_calc_send_app(handle, content); tifiles_content_delete_flash(content); } return ret; } /** * ticalcs_calc_recv_app2: * @handle: a previously allocated handle * @content: where to store content * @var: FLASH app to request * * Request receiving of a FLASH app. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_recv_app2(CalcHandle* handle, const char* filename, VarRequest* vr) { FlashContent *content; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(filename); VALIDATE_VARREQUEST(vr); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); content = tifiles_content_create_flash(handle->model); ret = ticalcs_calc_recv_app(handle, content, vr); if (!ret) { ret = tifiles_file_write_flash(filename, content); } tifiles_content_delete_flash(content); return ret; } /** * ticalcs_calc_send_cert2: * @handle: a previously allocated handle * @filename: name of file * * Send a certificate. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_send_cert2(CalcHandle* handle, const char* filename) { FlashContent *content; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(filename); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); content = tifiles_content_create_flash(handle->model); ret = tifiles_file_read_flash(filename, content); if (!ret) { ret = ticalcs_calc_send_cert(handle, content); tifiles_content_delete_flash(content); } return ret; } /** * ticalcs_calc_send_os2: * @handle: a previously allocated handle * @filename: name of file * * Send a FLASH app. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_send_os2(CalcHandle* handle, const char* filename) { FlashContent *content; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(filename); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); content = tifiles_content_create_flash(handle->model); ret = tifiles_file_read_flash(filename, content); if (!ret) { ret = ticalcs_calc_send_os(handle, content); tifiles_content_delete_flash(content); } return ret; } /** * ticalcs_calc_recv_cert2: * @handle: a previously allocated handle * @filename: name of file * * Request certificate. Depending on extension, saves it as *.9Xq or *.cer. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_recv_cert2(CalcHandle* handle, const char* filename) { FlashContent *content = NULL; char *ext; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(filename); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); do { ext = tifiles_fext_get(filename); if (!strcmp(ext, "cer")) { // .cer format as generated by SDK gchar *basename = strdup(filename); FILE *f; gchar *e; if (basename == NULL) { ret = ERR_MALLOC; break; } e = tifiles_fext_get(basename); memcpy(e, "crt", 3); content = tifiles_content_create_flash(handle->model); if (content == NULL) { ret = ERR_MALLOC; break; } ret = ticalcs_calc_recv_cert(handle, content); if (ret) { free(basename); break; } f = fopen(basename, "wb"); free(basename); if (!f) { ret = ERR_SAVE_FILE; break; } if (fwrite(content->data_part, content->data_length, 1, f) < 1) { fclose(f); ret = ERR_SAVE_FILE; break; } if (fclose(f)) { ret = ERR_SAVE_FILE; break; } } else { // .??q format as generated by TI content = tifiles_content_create_flash(handle->model); ret = ticalcs_calc_recv_cert(handle, content); if (!ret) { ret = tifiles_file_write_flash(filename, content); } } } while (0); tifiles_content_delete_flash(content); return ret; } /** * ticalcs_calc_send_tigroup2: * @handle: a previously allocated handle * @filename: name of file * @mode: which vars/apps to send * * Send a TiGroup file. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_send_tigroup2(CalcHandle* handle, const char* filename, TigMode mode) { TigContent *content; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(filename); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); content = tifiles_content_create_tigroup(handle->model, 0); ret = tifiles_file_read_tigroup(filename, content); if (!ret) { ret = ticalcs_calc_send_tigroup(handle, content, mode); } tifiles_content_delete_tigroup(content); return ret; } /** * ticalcs_calc_recv_tigroup2: * @handle: a previously allocated handle * @filename: name of file * @mode: which vars/apps to receive * * Receive a TiGroup file. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_calc_recv_tigroup2(CalcHandle* handle, const char* filename, TigMode mode) { TigContent *content; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(filename); RETURN_IF_HANDLE_NOT_ATTACHED(handle); RETURN_IF_HANDLE_NOT_OPEN(handle); RETURN_IF_HANDLE_BUSY(handle); content = tifiles_content_create_tigroup(handle->model, 0); ret = ticalcs_calc_recv_tigroup(handle, content, mode); if (!ret) { ret = tifiles_file_write_tigroup(filename, content); } tifiles_content_delete_tigroup(content); return ret; } libticalcs-1.1.9+dfsg/src/calc_xx.h000066400000000000000000000034321327711501700171410ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: link_xxx.h 1059 2005-05-14 09:45:42Z roms $ */ /* libticalcs2 - hand-helds support library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TICALCS_CALCXX__ #define __TICALCS_CALCXX__ #include "ticalcs.h" extern const CalcFncts calc_00; extern const CalcFncts calc_73; extern const CalcFncts calc_82; extern const CalcFncts calc_83; extern const CalcFncts calc_83p; extern const CalcFncts calc_84p; extern const CalcFncts calc_85; extern const CalcFncts calc_86; extern const CalcFncts calc_89; extern const CalcFncts calc_89t; extern const CalcFncts calc_92; extern const CalcFncts calc_92p; extern const CalcFncts calc_v2; extern const CalcFncts calc_84p_usb; extern const CalcFncts calc_89t_usb; extern const CalcFncts calc_nsp; extern const CalcFncts calc_80; extern const CalcFncts calc_84pcse; extern const CalcFncts calc_84pcse_usb; extern const CalcFncts calc_83pce_usb; extern const CalcFncts calc_84pce_usb; extern const CalcFncts calc_82a_usb; extern const CalcFncts calc_84pt_usb; #endif libticalcs-1.1.9+dfsg/src/clock.c000066400000000000000000000065541327711501700166160ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Clock support for AMS >= 2.08. */ #include #include "ticalcs.h" #include "logging.h" #ifdef __WIN32__ #define strcasecmp _stricmp #endif #define MAX_FORMAT_89 8 #define MAX_FORMAT_84 3 static const char *TI_CLOCK_89[] = { "", "MM/DD/YY", "DD/MM/YY", "MM.DD.YY", "DD.MM.YY", "YY.MM.DD", "MM-DD-YY", "DD-MM-YY", "YY-MM-DD", "" }; static const char *TI_CLOCK_84[] = { "", "M/D/Y", "D/M/Y", "Y/M/D", "" }; /** * ticalcs_clock_format2date: * @model: a calculator model * @value: a format type * * Convert a format type into a format string. * Example: 1 -> "MM/DD/YY" * * Return value: a format string. **/ TIEXPORT3 const char *TICALL ticalcs_clock_format2date(CalcModel model, int value) { int v; if (tifiles_calc_is_ti9x(model)) { if (value < 1) { v = 1; } else if (value > MAX_FORMAT_89) { v = MAX_FORMAT_89; } else { v = value; } return TI_CLOCK_89[v]; } else if (tifiles_calc_is_ti8x(model)) { if (value < 1) { v = 1; } else if (value > MAX_FORMAT_84) { v = MAX_FORMAT_84; } else { v = value; } return TI_CLOCK_84[v]; } return ""; } /** * ticalcs_clock_date2format: * @model: a calculator model * @format: a format string * * Convert a format string into a format type. * Example: "MM/DD/YY" -> 1 * * Return value: a format string. **/ TIEXPORT3 int TICALL ticalcs_clock_date2format(CalcModel model, const char *format) { int i = 1; if (format == NULL) { ticalcs_critical("ticalcs_clock_date2format: format is NULL"); return 0; } if (tifiles_calc_is_ti9x(model)) { for (i = 1; i <= MAX_FORMAT_89; i++) { if (!strcasecmp(TI_CLOCK_89[i], format)) { break; } } if (i > MAX_FORMAT_89) { return 1; } } else if (tifiles_calc_is_ti8x(model)) { for (i = 1; i <= MAX_FORMAT_84; i++) { if (!strcasecmp(TI_CLOCK_84[i], format)) { break; } } if (i > MAX_FORMAT_84) { return 1; } } return i; } /** * ticalcs_clock_show: * @model: calc model * @clock: a #CalcClock structure * * Display to stdout the content of the structure. * * Return value: always 0. **/ TIEXPORT3 int TICALL ticalcs_clock_show(CalcModel model, CalcClock* s) { if (s != NULL) { ticalcs_info("Date: %02i/%02i/%02i", s->day, s->month, s->year); ticalcs_info("Time: %02i/%02i/%02i", s->hours, s->minutes, s->seconds); ticalcs_info("Time format: %02i", s->time_format); ticalcs_info("Date format: %s", ticalcs_clock_format2date(model, s->date_format)); } return 0; } libticalcs-1.1.9+dfsg/src/cmd68k.c000066400000000000000000000423631327711501700166150ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This unit handles: * TI-92 commands; * TI-89/92+/V200/89T commands. */ #include #include #include "ticalcs.h" #include "internal.h" #include "dbus_pkt.h" #include "error.h" #include "logging.h" #include "cmd68k.h" #ifdef _MSC_VER #pragma warning( disable : 4761 4244) #endif TIEXPORT3 uint8_t TICALL ti68k_handle_to_dbus_mid(CalcHandle * handle) { if (ticalcs_validate_handle(handle)) { switch (handle->model) { case CALC_TI89: case CALC_TI89T: return DBUS_MID_PC_TI89; case CALC_TI92: return DBUS_MID_PC_TI92; case CALC_TI92P: return DBUS_MID_PC_TI92p; case CALC_V200: return DBUS_MID_PC_V200; default: return DBUS_MID_PC_TIXX; } } return 0; } static inline int ti68k_send_simple_cmd(CalcHandle * handle, uint8_t target, uint8_t cmd, const char * cmdname, uint16_t length, const uint8_t* data) { VALIDATE_HANDLE(handle); ticalcs_info(" PC->TI: %s", cmdname); return dbus_send(handle, target, cmd, length, data); } static const uint8_t dbus_errors[] = { 0x03, 0x25, 0x1e, 0x21, 0x07, 0x24, 0x08 }; static int err_code(uint8_t *data) { int i; int code = data[2]; ticalcs_info(" TI->PC: SKP (%02x)", data[0]); for (i = 0; i < (int)(sizeof(dbus_errors) / sizeof(dbus_errors[0])); i++) { if(dbus_errors[i] == code) { return i+1; } } ticalcs_warning("D-BUS error code not found in list. Please report it at ."); return 0; } TIEXPORT3 int TICALL ti68k_send_VAR(CalcHandle* handle, uint32_t varsize, uint8_t vartype, const char *varname, uint8_t target) { uint8_t buffer[32]; char trans[127]; uint8_t extra = (target == DBUS_MID_PC_TI92) ? 0 : ((vartype == TI89_BKUP) ? 0 : 1); uint16_t len; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varname); len = (uint16_t)strlen(varname); if (len > 17) { ticalcs_critical("Oversized variable name has length %i, clamping to 17", len); len = 17; } ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), vartype); buffer[0] = LSB(LSW(varsize)); buffer[1] = MSB(LSW(varsize)); buffer[2] = LSB(MSW(varsize)); buffer[3] = MSB(MSW(varsize)); buffer[4] = vartype; buffer[5] = len; memcpy(buffer + 6, varname, len); buffer[6 + len] = 0x03; ticalcs_info(" PC->TI: VAR (size=0x%08X=%i, id=%02X, name=%s)", varsize, varsize, vartype, trans); return dbus_send(handle, target, DBUS_CMD_VAR, 6 + len + extra, buffer); } TIEXPORT3 int TICALL ti68k_send_CTS(CalcHandle* handle, uint8_t target) { return ti68k_send_simple_cmd(handle, target, DBUS_CMD_CTS, "CTS", 2, NULL); } TIEXPORT3 int TICALL ti68k_send_XDP(CalcHandle* handle, uint32_t length, const uint8_t * data, uint8_t target) { VALIDATE_HANDLE(handle); ticalcs_info(" PC->TI: XDP (0x%04X = %i bytes)", length, length); return dbus_send(handle, target, DBUS_CMD_XDP, length, data); } TIEXPORT3 int TICALL ti89_send_SKP(CalcHandle* handle, uint8_t rej_code) { uint8_t buffer[4] = { rej_code, 0, 0, 0 }; VALIDATE_HANDLE(handle); ticalcs_info(" PC->TI: SKP (rejection code = %i)", rej_code); return dbus_send(handle, ti68k_handle_to_dbus_mid(handle), DBUS_CMD_SKP, 3, buffer); } TIEXPORT3 int TICALL ti92_send_SKP(CalcHandle* handle, uint8_t rej_code) { VALIDATE_HANDLE(handle); ticalcs_info(" PC->TI: SKP (rejection code = %i)", rej_code); return dbus_send(handle, DBUS_MID_PC_TI92, DBUS_CMD_SKP, 1, &rej_code); } TIEXPORT3 int TICALL ti68k_send_ACK(CalcHandle* handle, uint8_t target) { return ti68k_send_simple_cmd(handle, target, DBUS_CMD_ACK, "ACK", 2, NULL); } TIEXPORT3 int TICALL ti68k_send_ERR(CalcHandle* handle, uint8_t target) { return ti68k_send_simple_cmd(handle, target, DBUS_CMD_ERR, "ERR", 2, NULL); } TIEXPORT3 int TICALL ti68k_send_RDY(CalcHandle* handle, uint8_t target) { return ti68k_send_simple_cmd(handle, target, DBUS_CMD_RDY, "RDY", 2, NULL); } TIEXPORT3 int TICALL ti68k_send_SCR(CalcHandle* handle, uint8_t target) { return ti68k_send_simple_cmd(handle, target, DBUS_CMD_SCR, "SCR", 2, NULL); } TIEXPORT3 int TICALL ti68k_send_CNT(CalcHandle* handle, uint8_t target) { return ti68k_send_simple_cmd(handle, target, DBUS_CMD_CNT, "CNT", 2, NULL); } TIEXPORT3 int TICALL ti68k_send_KEY(CalcHandle* handle, uint16_t scancode, uint8_t target) { uint8_t buf[4] = { target, DBUS_CMD_KEY, LSB(scancode), MSB(scancode) }; VALIDATE_HANDLE(handle); ticalcs_info(" PC->TI: KEY"); return ticables_cable_send(handle->cable, buf, 4); } TIEXPORT3 int TICALL ti68k_send_EOT(CalcHandle* handle, uint8_t target) { return ti68k_send_simple_cmd(handle, target, DBUS_CMD_EOT, "EOT", 2, NULL); } TIEXPORT3 int TICALL ti89_send_REQ(CalcHandle* handle, uint32_t varsize, uint8_t vartype, const char *varname) { uint8_t buffer[32]; uint16_t len; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varname); len = (uint16_t)strlen(varname); if (len > 17) { ticalcs_critical("Oversized variable name has length %i, clamping to 17", len); len = 17; } buffer[0] = LSB(LSW(varsize)); buffer[1] = MSB(LSW(varsize)); buffer[2] = LSB(MSW(varsize)); buffer[3] = MSB(MSW(varsize)); buffer[4] = vartype; buffer[5] = len; memcpy(buffer + 6, varname, len); buffer[6 + len] = 0x00; len += 6 + 1; if (vartype != TI89_CLK) { len--; } ticalcs_info(" PC->TI: REQ (size=0x%08X=%i, id=%02X, name=%s)", varsize, varsize, vartype, varname); return dbus_send(handle, ti68k_handle_to_dbus_mid(handle), DBUS_CMD_REQ, len, buffer); } TIEXPORT3 int TICALL ti92_send_REQ(CalcHandle* handle, uint32_t varsize, uint8_t vartype, const char *varname) { uint8_t buffer[32]; uint16_t len; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varname); len = (uint16_t)strlen(varname); if (len > 17) { ticalcs_critical("Oversized variable name has length %i, clamping to 17", len); len = 17; } buffer[0] = 0; buffer[1] = 0; buffer[2] = 0; buffer[3] = 0; buffer[4] = vartype; buffer[5] = len; memcpy(buffer + 6, varname, len); ticalcs_info(" PC->TI: REQ (size=0x%08X=%i, id=%02X, name=%s)", varsize, varsize, vartype, varname); return dbus_send(handle, DBUS_MID_PC_TI92, DBUS_CMD_REQ, 6 + len, buffer); } TIEXPORT3 int TICALL ti89_send_RTS(CalcHandle* handle, uint32_t varsize, uint8_t vartype, const char *varname) { uint8_t buffer[32]; uint16_t len; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varname); len = (uint16_t)strlen(varname); if (len > 17) { ticalcs_critical("Oversized variable name has length %i, clamping to 17", len); len = 17; } buffer[0] = LSB(LSW(varsize)); buffer[1] = MSB(LSW(varsize)); buffer[2] = LSB(MSW(varsize)); buffer[3] = MSB(MSW(varsize)); buffer[4] = vartype; buffer[5] = len; memcpy(buffer + 6, varname, len); buffer[6 + len] = 0x00; len += 6 + 1; // used by AMS <= 2.09 ? //if ((vartype == TI89_AMS) || (vartype == TI89_APPL)) len--; ticalcs_info(" PC->TI: RTS (size=0x%08X=%i, id=%02X, name=%s)", varsize, varsize, vartype, varname); return dbus_send(handle, ti68k_handle_to_dbus_mid(handle), DBUS_CMD_RTS, len, buffer); } TIEXPORT3 int TICALL ti92_send_RTS(CalcHandle* handle, uint32_t varsize, uint8_t vartype, const char *varname) { uint8_t buffer[32]; uint16_t len; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varname); len = (uint16_t)strlen(varname); if (len > 17) { ticalcs_critical("Oversized variable name has length %i, clamping to 17", len); len = 17; } buffer[0] = LSB(LSW(varsize)); buffer[1] = MSB(LSW(varsize)); buffer[2] = LSB(MSW(varsize)); buffer[3] = MSB(MSW(varsize)); buffer[4] = vartype; buffer[5] = len; memcpy(buffer + 6, varname, len); ticalcs_info(" PC->TI: RTS (size=0x%08X=%i, id=%02X, name=%s)", varsize, varsize, vartype, varname); return dbus_send(handle, DBUS_MID_PC_TI92, DBUS_CMD_RTS, 6 + len, buffer); } TIEXPORT3 int TICALL ti89_send_RTS2(CalcHandle* handle, uint32_t varsize, uint8_t vartype, uint8_t hw_id) { uint8_t buffer[9]; VALIDATE_HANDLE(handle); buffer[0] = LSB(LSW(varsize)); buffer[1] = MSB(LSW(varsize)); buffer[2] = LSB(MSW(varsize)); buffer[3] = MSB(MSW(varsize)); buffer[4] = vartype; buffer[5] = 0x00; buffer[6] = 0x08; buffer[7] = 0x00; buffer[8] = hw_id; // 0x08 -> V200, 0x09 -> Titanium (Hardware ID) ticalcs_info(" PC->TI: RTS (size=0x%08X=%i, id=%02X, hw_id=%02x)", varsize, varsize, vartype, hw_id); return dbus_send(handle, ti68k_handle_to_dbus_mid(handle), DBUS_CMD_RTS, 9, buffer); } TIEXPORT3 int TICALL ti89_send_VER(CalcHandle* handle) { return ti68k_send_simple_cmd(handle, ti68k_handle_to_dbus_mid(handle), DBUS_CMD_VER, "VER", 2, NULL); } TIEXPORT3 int TICALL ti89_send_DEL(CalcHandle* handle, uint32_t varsize, uint8_t vartype, const char *varname) { uint8_t buffer[32]; uint16_t len; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varname); len = (uint16_t)strlen(varname); if (len > 17) { ticalcs_critical("Oversized variable name has length %i, clamping to 17", len); len = 17; } buffer[0] = 0; buffer[1] = 0; buffer[2] = 0; buffer[3] = 0; buffer[4] = 0; buffer[5] = len; memcpy(buffer + 6, varname, len); ticalcs_info(" PC->TI: DEL (size=0x%08X=%i, id=%02X, name=%s)", varsize, varsize, vartype, varname); return dbus_send(handle, ti68k_handle_to_dbus_mid(handle), DBUS_CMD_DEL, 6 + len, buffer); } TIEXPORT3 int TICALL ti89_recv_VAR(CalcHandle* handle, uint32_t * varsize, uint8_t * vartype, char *varname) { uint8_t host, cmd; uint8_t *buffer; uint16_t length; uint8_t strl; uint8_t flag; char * varname_nofldname; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varsize); VALIDATE_NONNULL(vartype); VALIDATE_NONNULL(varname); buffer = (uint8_t *)handle->buffer; ret = dbus_recv(handle, &host, &cmd, &length, buffer); if (ret) { return ret; } if (cmd == DBUS_CMD_EOT) { ticalcs_info(" TI->PC: EOT"); return ERR_EOT; // not really an error } if (cmd == DBUS_CMD_SKP) { return ERR_CALC_ERROR1 + err_code(buffer); } if (cmd != DBUS_CMD_VAR) { return ERR_INVALID_CMD; } *varsize = buffer[0] | (((uint32_t)buffer[1]) << 8) | (((uint32_t)buffer[2]) << 16) | (((uint32_t)buffer[3]) << 24); *vartype = buffer[4]; strl = buffer[5]; memcpy(varname, buffer + 6, strl); varname[strl] = '\0'; flag = buffer[6 + strl]; if ((length != (6 + strlen(varname))) && (length != (7 + strlen(varname)))) { return ERR_INVALID_PACKET; } ticalcs_info(" TI->PC: VAR (size=0x%08X=%i, id=%02X, name=%s, flag=%i)", *varsize, *varsize, *vartype, varname, flag); varname_nofldname = tifiles_get_varname(varname); if (varname_nofldname != varname) { // This variable name contains a folder name. Erase it. ticalcs_info(" TI->PC: VAR: the variable name contains a folder name, stripping it."); memmove(varname, varname_nofldname, strlen(varname_nofldname)+1); } return 0; } TIEXPORT3 int TICALL ti92_recv_VAR(CalcHandle* handle, uint32_t * varsize, uint8_t * vartype, char *varname) { uint8_t host, cmd; uint8_t *buffer; uint16_t length; uint8_t strl; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varsize); VALIDATE_NONNULL(vartype); VALIDATE_NONNULL(varname); buffer = (uint8_t *)handle->buffer; ret = dbus_recv(handle, &host, &cmd, &length, buffer); if (ret) { return ret; } if (cmd == DBUS_CMD_EOT) { ticalcs_info(" TI->PC: EOT"); return ERR_EOT; // not really an error } if (cmd == DBUS_CMD_SKP) { return ERR_VAR_REJECTED; } if (cmd != DBUS_CMD_VAR) { return ERR_INVALID_CMD; } *varsize = buffer[0] | (((uint32_t)buffer[1]) << 8) | (((uint32_t)buffer[2]) << 16) | (((uint32_t)buffer[3]) << 24); *vartype = buffer[4]; strl = buffer[5]; memcpy(varname, buffer + 6, strl); varname[strl] = '\0'; if (length != (6 + strlen(varname))) { return ERR_INVALID_PACKET; } ticalcs_info(" TI->PC: VAR (size=0x%08X=%i, id=%02X, name=%s)", *varsize, *varsize, *vartype, varname); return 0; } static int ti68k_recv_CTS(CalcHandle* handle, uint8_t is_92) { uint8_t host, cmd; uint16_t length; uint8_t *buffer; int ret; VALIDATE_HANDLE(handle); buffer = (uint8_t *)handle->buffer; ret = dbus_recv(handle, &host, &cmd, &length, buffer); if (ret) { return ret; } if (cmd == DBUS_CMD_SKP) { return is_92 ? ERR_VAR_REJECTED : ERR_CALC_ERROR1 + err_code(buffer); } else if (cmd != DBUS_CMD_CTS) { return ERR_INVALID_CMD; } if (length != 0x0000) { return ERR_CTS_ERROR; } ticalcs_info(" TI->PC: CTS"); return 0; } TIEXPORT3 int TICALL ti89_recv_CTS(CalcHandle* handle) { return ti68k_recv_CTS(handle, 0); } TIEXPORT3 int TICALL ti92_recv_CTS(CalcHandle* handle) { return ti68k_recv_CTS(handle, 1); } TIEXPORT3 int TICALL ti68k_recv_SKP(CalcHandle* handle, uint8_t * rej_code) { uint8_t host, cmd; uint16_t length; uint8_t *buffer; int retval; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(rej_code); buffer = (uint8_t *)handle->buffer; *rej_code = 0; retval = dbus_recv(handle, &host, &cmd, &length, buffer); if (retval == 0) { if (cmd == DBUS_CMD_CTS) { ticalcs_info("CTS"); } else { if (cmd != DBUS_CMD_SKP) { retval = ERR_INVALID_CMD; } else { ticalcs_info(" TI->PC: SKP (rejection code = %i)", buffer[0]); if (rej_code != NULL) { *rej_code = buffer[0]; } } } } return retval; } TIEXPORT3 int TICALL ti68k_recv_XDP(CalcHandle* handle, uint16_t * length, uint8_t * data) { uint8_t host, cmd; int err; uint16_t len; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(length); err = dbus_recv(handle, &host, &cmd, &len, data); *length = len; if (cmd != DBUS_CMD_XDP) { return ERR_INVALID_CMD; } if (!err) { ticalcs_info(" TI->PC: XDP (%04X=%i bytes)", *length, *length); } return err; } /* ACK: receive acknowledge - status [in/out]: if NULL is passed, the function checks that 00 00 has been received. Otherwise, it put in status the received value. - int [out]: an error code */ static int ti68k_recv_ACK(CalcHandle* handle, uint16_t * status, uint8_t is_92) { uint8_t host, cmd; uint16_t length; uint8_t *buffer; int ret; VALIDATE_HANDLE(handle); buffer = (uint8_t *)handle->buffer; ret = dbus_recv(handle, &host, &cmd, &length, buffer); if (ret) { return ret; } if (!is_92 && cmd == DBUS_CMD_SKP) { return ERR_CALC_ERROR1 + err_code(buffer); } if (status != NULL) { *status = length; } else if (length != 0x0000) { return ERR_NACK; } if (cmd != DBUS_CMD_ACK) { return ERR_INVALID_CMD; } ticalcs_info(" TI->PC: ACK"); return 0; } TIEXPORT3 int TICALL ti89_recv_ACK(CalcHandle* handle, uint16_t * status) { return ti68k_recv_ACK(handle, status, 0); } TIEXPORT3 int TICALL ti92_recv_ACK(CalcHandle* handle, uint16_t * status) { return ti68k_recv_ACK(handle, status, 1); } TIEXPORT3 int TICALL ti68k_recv_CNT(CalcHandle* handle) { uint8_t host, cmd; uint16_t sts; int ret; VALIDATE_HANDLE(handle); ret = dbus_recv(handle, &host, &cmd, &sts, NULL); if (ret) { return ret; } if (cmd == DBUS_CMD_EOT) { return ERR_EOT; // not really an error } if (cmd != DBUS_CMD_CNT) { return ERR_INVALID_CMD; } ticalcs_info(" TI->PC: CNT"); return 0; } TIEXPORT3 int TICALL ti68k_recv_EOT(CalcHandle* handle) { uint8_t host, cmd; uint16_t length; int ret; VALIDATE_HANDLE(handle); ret = dbus_recv(handle, &host, &cmd, &length, NULL); if (ret) { return ret; } if (cmd != DBUS_CMD_EOT) { return ERR_INVALID_CMD; } ticalcs_info(" TI->PC: EOT"); return 0; } static int ti68k_recv_RTS(CalcHandle* handle, uint32_t * varsize, uint8_t * vartype, char *varname, uint8_t is_92) { uint8_t host, cmd; uint8_t *buffer; uint16_t length; uint8_t strl; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varsize); VALIDATE_NONNULL(vartype); VALIDATE_NONNULL(varname); buffer = (uint8_t *)handle->buffer; ret = dbus_recv(handle, &host, &cmd, &length, buffer); if (ret) { return ret; } if (cmd == DBUS_CMD_EOT) { return ERR_EOT; // not really an error } else if (cmd == DBUS_CMD_SKP) { return is_92 ? ERR_VAR_REJECTED : ERR_CALC_ERROR1 + err_code(buffer); } else if (cmd != DBUS_CMD_VAR) { return ERR_INVALID_CMD; } *varsize = buffer[0] | (((uint32_t)buffer[1]) << 8) | (((uint32_t)buffer[2]) << 16) | (((uint32_t)buffer[3]) << 24); *vartype = buffer[4]; strl = buffer[5]; memcpy(varname, buffer + 6, strl); varname[strl] = '\0'; if (length != (6 + strlen(varname))) { return ERR_INVALID_PACKET; } ticalcs_info(" TI->PC: RTS (size=0x%08X=%i, id=%02X, name=%s)", *varsize, *varsize, *vartype, varname); return 0; } TIEXPORT3 int TICALL ti89_recv_RTS(CalcHandle* handle, uint32_t * varsize, uint8_t * vartype, char *varname) { return ti68k_recv_RTS(handle, varsize, vartype, varname, 0); } TIEXPORT3 int TICALL ti92_recv_RTS(CalcHandle* handle, uint32_t * varsize, uint8_t * vartype, char *varname) { return ti68k_recv_RTS(handle, varsize, vartype, varname, 1); } libticalcs-1.1.9+dfsg/src/cmd68k.h000066400000000000000000000145251327711501700166210ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ // /!\ NOTE: for this file, backwards compatibility will not necessarily be maintained as strongly as it is for ticalcs.h ! #ifndef __TICALCS_CMD68K__ #define __TICALCS_CMD68K__ #include "dbus_pkt.h" #ifdef __cplusplus extern "C" { #endif /* Helper functions */ TIEXPORT3 uint8_t TICALL ti68k_handle_to_dbus_mid(CalcHandle * handle); /* TI-68k family, send functions */ TIEXPORT3 int TICALL ti68k_send_VAR(CalcHandle* handle, uint32_t varsize, uint8_t vartype, const char *varname, uint8_t target); TIEXPORT3 int TICALL ti68k_send_CTS(CalcHandle* handle, uint8_t target); TIEXPORT3 int TICALL ti68k_send_XDP(CalcHandle* handle, uint32_t length, const uint8_t * data, uint8_t target); TIEXPORT3 int TICALL ti68k_send_ACK(CalcHandle* handle, uint8_t target); TIEXPORT3 int TICALL ti68k_send_ERR(CalcHandle* handle, uint8_t target); TIEXPORT3 int TICALL ti68k_send_RDY(CalcHandle* handle, uint8_t target); TIEXPORT3 int TICALL ti68k_send_SCR(CalcHandle* handle, uint8_t target); TIEXPORT3 int TICALL ti68k_send_CNT(CalcHandle* handle, uint8_t target); TIEXPORT3 int TICALL ti68k_send_KEY(CalcHandle* handle, uint16_t scancode, uint8_t target); TIEXPORT3 int TICALL ti68k_send_EOT(CalcHandle* handle, uint8_t target); /* TI-68k family, receive functions */ TIEXPORT3 int TICALL ti68k_recv_SKP(CalcHandle* handle, uint8_t * rej_code); TIEXPORT3 int TICALL ti68k_recv_XDP(CalcHandle* handle, uint16_t * length, uint8_t * data); TIEXPORT3 int TICALL ti68k_recv_CNT(CalcHandle *handle); TIEXPORT3 int TICALL ti68k_recv_EOT(CalcHandle *handle); /* TI-89 family, send functions */ #define ti89_send_VAR(handle, varsize, vartype, varname) ti68k_send_VAR(handle, varsize, vartype, varname, ti68k_handle_to_dbus_mid(handle)) #define ti89_send_CTS(handle) ti68k_send_CTS(handle, ti68k_handle_to_dbus_mid(handle)) #define ti89_send_XDP(handle, length, data) ti68k_send_XDP(handle, length, data, ti68k_handle_to_dbus_mid(handle)) TIEXPORT3 int TICALL ti89_send_SKP(CalcHandle *handle, uint8_t rej_code); #define ti89_send_ACK(handle) ti68k_send_ACK(handle, ti68k_handle_to_dbus_mid(handle)) #define ti89_send_ERR(handle) ti68k_send_ERR(handle, ti68k_handle_to_dbus_mid(handle)) #define ti89_send_RDY(handle) ti68k_send_RDY(handle, ti68k_handle_to_dbus_mid(handle)) #define ti89_send_SCR(handle) ti68k_send_SCR(handle, ti68k_handle_to_dbus_mid(handle)) #define ti89_send_CNT(handle) ti68k_send_CNT(handle, ti68k_handle_to_dbus_mid(handle)) #define ti89_send_KEY(handle, scancode) ti68k_send_KEY(handle, scancode, ti68k_handle_to_dbus_mid(handle)) #define ti89_send_EOT(handle) ti68k_send_EOT(handle, ti68k_handle_to_dbus_mid(handle)) TIEXPORT3 int TICALL ti89_send_REQ(CalcHandle *handle, uint32_t varsize, uint8_t vartype, const char *varname); TIEXPORT3 int TICALL ti89_send_RTS(CalcHandle *handle, uint32_t varsize, uint8_t vartype, const char *varname); TIEXPORT3 int TICALL ti89_send_RTS2(CalcHandle *handle, uint32_t varsize, uint8_t vartype, uint8_t hw_id); TIEXPORT3 int TICALL ti89_send_VER(CalcHandle *handle); TIEXPORT3 int TICALL ti89_send_DEL(CalcHandle *handle, uint32_t varsize, uint8_t vartype, const char *varname); /* TI-89 family, receive functions */ TIEXPORT3 int TICALL ti89_recv_VAR(CalcHandle *handle, uint32_t * varsize, uint8_t * vartype, char *varname); TIEXPORT3 int TICALL ti89_recv_CTS(CalcHandle *handle); #define ti89_recv_SKP(handle, rej_code) ti68k_recv_SKP(handle, rej_code) #define ti89_recv_XDP(handle, length, data) ti68k_recv_XDP(handle, length, data) TIEXPORT3 int TICALL ti89_recv_ACK(CalcHandle *handle, uint16_t * status); #define ti89_recv_CNT(handle) ti68k_recv_CNT(handle) #define ti89_recv_EOT(handle) ti68k_recv_EOT(handle) TIEXPORT3 int TICALL ti89_recv_RTS(CalcHandle *handle, uint32_t * varsize, uint8_t * vartype, char *varname); /* TI-92, send functions */ #define ti92_send_VAR(handle, varsize, vartype, varname) ti68k_send_VAR(handle, varsize, vartype, varname, DBUS_MID_PC_TI92) #define ti92_send_CTS(handle) ti68k_send_CTS(handle, DBUS_MID_PC_TI92) #define ti92_send_XDP(handle, length, data) ti68k_send_XDP(handle, length, data, DBUS_MID_PC_TI92) TIEXPORT3 int TICALL ti92_send_SKP(CalcHandle *handle, uint8_t rej_code); #define ti92_send_ACK(handle) ti68k_send_ACK(handle, DBUS_MID_PC_TI92) #define ti92_send_ERR(handle) ti68k_send_ERR(handle, DBUS_MID_PC_TI92) #define ti92_send_RDY(handle) ti68k_send_RDY(handle, DBUS_MID_PC_TI92) #define ti92_send_SCR(handle) ti68k_send_SCR(handle, DBUS_MID_PC_TI92) #define ti92_send_CNT(handle) ti68k_send_CNT(handle, DBUS_MID_PC_TI92) #define ti92_send_KEY(handle, scancode) ti68k_send_KEY(handle, scancode, DBUS_MID_PC_TI92) #define ti92_send_EOT(handle) ti68k_send_EOT(handle, DBUS_MID_PC_TI92) TIEXPORT3 int TICALL ti92_send_REQ(CalcHandle *handle, uint32_t varsize, uint8_t vartype, const char *varname); TIEXPORT3 int TICALL ti92_send_RTS(CalcHandle *handle, uint32_t varsize, uint8_t vartype, const char *varname); /* TI-92, receive functions */ TIEXPORT3 int TICALL ti92_recv_VAR(CalcHandle *handle, uint32_t * varsize, uint8_t * vartype, char *varname); TIEXPORT3 int TICALL ti92_recv_CTS(CalcHandle *handle); #define ti92_recv_SKP(handle, rej_code) ti68k_recv_SKP(handle, rej_code) #define ti92_recv_XDP(handle, length, data) ti68k_recv_XDP(handle, length, data) TIEXPORT3 int TICALL ti92_recv_ACK(CalcHandle *handle, uint16_t * status); #define ti92_recv_CNT(handle) ti68k_recv_CNT(handle) #define ti92_recv_EOT(handle) ti68k_recv_EOT(handle) TIEXPORT3 int TICALL ti92_recv_RTS(CalcHandle *handle, uint32_t * varsize, uint8_t * vartype, char *varname); #ifdef __cplusplus } #endif #endif libticalcs-1.1.9+dfsg/src/cmdz80.c000066400000000000000000000735771327711501700166410ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This unit handles: * TI-80 commands; * TI-82 & TI-83 commands; * TI-85 & TI-86 commands; * TI-73 & TI-83+ & TI-84+ commands. */ #include #include #include "ticalcs.h" #include "internal.h" #include "dbus_pkt.h" #include "error.h" #include "logging.h" #include "cmdz80.h" #ifdef _MSC_VER #pragma warning( disable : 4761 ) #endif // Share some commands between TI-82 & TI-83, TI-85 & TI-86, TI-73 & TI-83+ & TI-84+ #define TI7383p_PC ((handle != NULL) ? ((handle->model == CALC_TI73) ? TI73_PC : TI83p_PC) : 0) #define TI7383p_BKUP ((handle->model == CALC_TI73) ? TI73_BKUP : TI83p_BKUP) #define EXTRAS ((handle->model == CALC_TI73) ? 0 : 2) #define TI8283_BKUP ((handle->model == CALC_TI82) ? TI82_BKUP : TI83_BKUP) #define TI8586_BKUP ((handle->model == CALC_TI85) ? TI85_BKUP : TI86_BKUP) TIEXPORT3 uint8_t TICALL tiz80_handle_to_dbus_mid(CalcHandle * handle) { if (ticalcs_validate_handle(handle)) { switch (handle->model) { case CALC_TI73: return DBUS_MID_PC_TI73; case CALC_TI82: return DBUS_MID_PC_TI82; case CALC_TI83: return DBUS_MID_PC_TI83; case CALC_TI83P: case CALC_TI84P: case CALC_TI84PC: return DBUS_MID_PC_TI83p; case CALC_TI85: return DBUS_MID_PC_TI85; case CALC_TI86: return DBUS_MID_PC_TI86; default: return DBUS_MID_PC_TIXX; } } return 0; } static inline int tiz80_send_simple_cmd(CalcHandle * handle, uint8_t target, uint8_t cmd, const char * cmdname, uint16_t length, const uint8_t* data) { VALIDATE_HANDLE(handle); ticalcs_info(" PC->TI: %s", cmdname); return dbus_send(handle, target, cmd, length, data); } /* VAR: Variable (std var header: NUL padded, fixed length) */ static int tiz80_send_bkup_VAR(CalcHandle* handle, uint8_t *buffer, uint16_t varsize, uint8_t vartype, const char * varname, uint8_t target) { memcpy((char *)buffer + 3, varname, 6); ticalcs_info(" PC->TI: VAR (size=0x%04X=%d, id=%02X, name=())", varsize, varsize, vartype); return dbus_send(handle, target, DBUS_CMD_VAR, 9, buffer); } TIEXPORT3 int TICALL ti73_send_VAR(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname, uint8_t varattr, uint8_t version) { uint8_t buffer[16]; char trans[127]; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varname); buffer[0] = LSB(varsize); buffer[1] = MSB(varsize); buffer[2] = vartype; if (vartype != TI7383p_BKUP || version != 0) { memcpy((char *)buffer + 3, varname, 8); buffer[11] = version; buffer[12] = (varattr == ATTRB_ARCHIVED) ? 0x80 : 0x00; ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), vartype); ticalcs_info(" PC->TI: VAR (size=0x%04X=%d, id=%02X, name=%s, attr=%d, version=%d)", varsize, varsize, vartype, trans, varattr, version); return dbus_send(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_VAR, 11 + EXTRAS, buffer); } else { return tiz80_send_bkup_VAR(handle, buffer, varsize, vartype, varname, tiz80_handle_to_dbus_mid_7383p(handle)); } } TIEXPORT3 int TICALL ti82_send_VAR(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname) { uint8_t buffer[16]; char trans[127]; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varname); buffer[0] = LSB(varsize); buffer[1] = MSB(varsize); buffer[2] = vartype; if (vartype != TI8283_BKUP) { memcpy((char *)buffer + 3, varname, 8); ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), vartype); ticalcs_info(" PC->TI: VAR (size=0x%04X=%d, id=%02X, name=%s)", varsize, varsize, vartype, trans); return dbus_send(handle, tiz80_handle_to_dbus_mid_8283(handle), DBUS_CMD_VAR, 11, buffer); } else { return tiz80_send_bkup_VAR(handle, buffer, varsize, vartype, varname, tiz80_handle_to_dbus_mid_8283(handle)); } } TIEXPORT3 int TICALL ti85_send_VAR(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname) { uint8_t buffer[16]; char trans[127]; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varname); buffer[0] = LSB(varsize); buffer[1] = MSB(varsize); buffer[2] = vartype; if (vartype != TI8586_BKUP) { int len = strlen(varname); if (len > 8) { ticalcs_critical("Oversized variable name has length %d, clamping to 8", len); len = 8; } buffer[3] = len; memcpy((char *)buffer + 4, varname, len); ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), vartype); ticalcs_info(" PC->TI: VAR (size=0x%04X=%d, id=%02X, name=%s)", varsize, varsize, vartype, trans); return dbus_send(handle, tiz80_handle_to_dbus_mid_8586(handle), DBUS_CMD_VAR, 4 + len, buffer); } else { return tiz80_send_bkup_VAR(handle, buffer, varsize, vartype, varname, tiz80_handle_to_dbus_mid_8586(handle)); } } /* FLASH (special var header: size, id, flag, offset, page) */ TIEXPORT3 int TICALL ti73_send_VAR2(CalcHandle* handle, uint32_t length, uint8_t type, uint8_t flag, uint16_t offset, uint16_t page) { uint8_t buffer[11]; VALIDATE_HANDLE(handle); buffer[0] = LSB(LSW(length)); buffer[1] = MSB(LSW(length)); buffer[2] = type; buffer[3] = LSB(MSW(length)); buffer[4] = MSB(MSW(length)); buffer[5] = flag; buffer[6] = LSB(offset); buffer[7] = MSB(offset); buffer[8] = LSB(page); buffer[9] = MSB(page); ticalcs_info(" PC->TI: VAR (size=0x%08X=%d, id=%02X, flag=%02X, offset=%04X, page=%02X)", length, length, type, flag, offset, page); return dbus_send(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_VAR, 10, buffer); } TIEXPORT3 int TICALL tiz80_send_CTS(CalcHandle* handle, uint8_t target) { return tiz80_send_simple_cmd(handle, target, DBUS_CMD_CTS, "CTS", 0, NULL); } TIEXPORT3 int TICALL tiz80_send_XDP(CalcHandle* handle, uint16_t length, const uint8_t * data, uint8_t target) { VALIDATE_HANDLE(handle); ticalcs_info(" PC->TI: XDP (0x%04X = %d bytes)", length, length); return dbus_send(handle, target, DBUS_CMD_XDP, length, data); } TIEXPORT3 int TICALL tiz80_send_SKP(CalcHandle* handle, uint8_t rej_code, uint8_t target) { VALIDATE_HANDLE(handle); ticalcs_info(" PC->TI: SKP (rejection code = %d)", rej_code); return dbus_send(handle, target, DBUS_CMD_SKP, 1, &rej_code); } TIEXPORT3 int TICALL tiz80_send_ACK(CalcHandle* handle, uint8_t target) { return tiz80_send_simple_cmd(handle, target, DBUS_CMD_ACK, "ACK", 2, NULL); } TIEXPORT3 int TICALL tiz80_send_ERR(CalcHandle* handle, uint8_t target) { return tiz80_send_simple_cmd(handle, target, DBUS_CMD_ERR, "ERR", 2, NULL); } TIEXPORT3 int TICALL ti73_send_RDY(CalcHandle* handle) { return tiz80_send_simple_cmd(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_RDY, "RDY", 2, NULL); } TIEXPORT3 int TICALL tiz80_send_SCR(CalcHandle* handle, uint8_t target) { return tiz80_send_simple_cmd(handle, target, DBUS_CMD_SCR, "SCR", 2, NULL); } TIEXPORT3 int TICALL ti80_send_SCR(CalcHandle* handle) { return tiz80_send_simple_cmd(handle, DBUS_MID_PC_TI80, DBUS_CMD_SCR, "SCR", 0, NULL); } TIEXPORT3 int TICALL tiz80_send_KEY(CalcHandle* handle, uint16_t scancode, uint8_t target) { uint8_t buf[4] = { target, DBUS_CMD_KEY, LSB(scancode), MSB(scancode) }; VALIDATE_HANDLE(handle); ticalcs_info(" PC->TI: KEY"); return ticables_cable_send(handle->cable, buf, 4); } TIEXPORT3 int TICALL tiz80_send_EOT(CalcHandle* handle, uint8_t target) { return tiz80_send_simple_cmd(handle, target, DBUS_CMD_EOT, "EOT", 2, NULL); } /* REQ: request variable (std var header: NUL padded, fixed length) */ TIEXPORT3 int TICALL ti73_send_REQ(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname, uint8_t varattr, uint8_t version) { uint8_t buffer[16]; char trans[127]; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varname); buffer[0] = LSB(varsize); buffer[1] = MSB(varsize); buffer[2] = vartype; memcpy((char *)buffer + 3, varname, 8); buffer[11] = version; buffer[12] = (varattr == ATTRB_ARCHIVED) ? 0x80 : 0x00; ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), vartype); ticalcs_info(" PC->TI: REQ (size=0x%04X=%d, id=%02X, name=%s, attr=%d)", varsize, varsize, vartype, trans, varattr); if (vartype != TI83p_IDLIST && vartype != TI83p_GETCERT) { return dbus_send(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_REQ, 11 + EXTRAS, buffer); } else if (vartype != TI83p_GETCERT && handle->model != CALC_TI73) { return dbus_send(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_REQ, 11, buffer); } else { return dbus_send(handle, DBUS_MID_PC_TI73, DBUS_CMD_REQ, 3, buffer); } } TIEXPORT3 int TICALL ti82_send_REQ(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname) { uint8_t buffer[16]; char trans[127]; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varname); buffer[0] = LSB(varsize); buffer[1] = MSB(varsize); buffer[2] = vartype; memcpy((char *)buffer + 3, varname, 8); ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), vartype); ticalcs_info(" PC->TI: REQ (size=0x%04X=%d, id=%02X, name=%s)", varsize, varsize, vartype, trans); return dbus_send(handle, tiz80_handle_to_dbus_mid_8283(handle), DBUS_CMD_REQ, 11, buffer); } TIEXPORT3 int TICALL ti85_send_REQ(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname) { uint8_t buffer[16]; char trans[127]; int len; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varname); ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), vartype); ticalcs_info(" PC->TI: REQ (size=0x%04X=%d, id=%02X, name=%s)", varsize, varsize, vartype, trans); if ((handle->model == CALC_TI86) && (vartype >= TI86_DIR) && (vartype <= TI86_ZRCL)) { memset(buffer, 0, 6); buffer[2] = vartype; return dbus_send(handle, DBUS_MID_PC_TI86, DBUS_CMD_REQ, 5, buffer); } else if ((handle->model == CALC_TI86) && (vartype == TI86_BKUP)) { memset(buffer, 0, 12); buffer[2] = vartype; return dbus_send(handle, DBUS_MID_PC_TI86, DBUS_CMD_REQ, 11, buffer); } else { buffer[0] = LSB(varsize); buffer[1] = MSB(varsize); buffer[2] = vartype; len = strlen(varname); if (len > 8) { ticalcs_critical("Oversized variable name has length %d, clamping to 8", len); len = 8; } buffer[3] = len; memcpy((char *)buffer + 4, varname, len); return dbus_send(handle, tiz80_handle_to_dbus_mid_8586(handle), DBUS_CMD_REQ, 4 + len, buffer); } } /* FLASH (special var header: size, id, flag, offset, page) */ TIEXPORT3 int TICALL ti73_send_REQ2(CalcHandle* handle, uint16_t appsize, uint8_t apptype, const char *appname, uint8_t appattr) { uint8_t buffer[16]; /* Note: attribute/version bytes are not used (and will be ignored by the calculator if included in the packet.) The 'appattr' parameter has no effect. */ VALIDATE_HANDLE(handle); VALIDATE_NONNULL(appname); buffer[0] = LSB(appsize); buffer[1] = MSB(appsize); buffer[2] = apptype; memcpy((char *)buffer + 3, appname, 8); ticalcs_info(" PC->TI: REQ (size=0x%04X=%d, id=%02X, name=%s)", appsize, appsize, apptype, appname); return dbus_send(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_REQ, 11, buffer); } /* Request to send (std var header: NUL padded, fixed length) */ TIEXPORT3 int TICALL ti73_send_RTS(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname, uint8_t varattr, uint8_t version) { uint8_t buffer[16]; char trans[127]; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varname); buffer[0] = LSB(varsize); buffer[1] = MSB(varsize); buffer[2] = vartype; memcpy((char *)buffer + 3, varname, 8); buffer[11] = version; buffer[12] = (varattr == ATTRB_ARCHIVED) ? 0x80 : 0x00; ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), vartype); ticalcs_info(" PC->TI: RTS (size=0x%04X=%d, id=%02X, name=%s, attr=%d)", varsize, varsize, vartype, trans, varattr); if (vartype != TI7383p_BKUP || version != 0) { // backup: special header return dbus_send(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_RTS, 11 + EXTRAS, buffer); } else { return dbus_send(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_RTS, 9, buffer); } } /* Request to send (std var header: NUL padded, fixed length) */ TIEXPORT3 int TICALL ti82_send_RTS(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname) { uint8_t buffer[16]; char trans[127]; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varname); buffer[0] = LSB(varsize); buffer[1] = MSB(varsize); buffer[2] = vartype; memcpy((char *)buffer + 3, varname, 8); ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), vartype); ticalcs_info(" PC->TI: RTS (size=0x%04X=%d, id=%02X, name=%s)", varsize, varsize, vartype, trans); if (vartype != TI8283_BKUP) { // backup: special header return dbus_send(handle, tiz80_handle_to_dbus_mid_8283(handle), DBUS_CMD_RTS, 11, buffer); } else { return dbus_send(handle, tiz80_handle_to_dbus_mid_8283(handle), DBUS_CMD_RTS, 9, buffer); } } /* Request to send (var header: SPC padded, fixed length) */ TIEXPORT3 int TICALL ti85_send_RTS(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname) { uint8_t buffer[16]; char trans[127]; int len; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varname); buffer[0] = LSB(varsize); buffer[1] = MSB(varsize); buffer[2] = vartype; len = strlen(varname); if (len > 8) { ticalcs_critical("Oversized variable name has length %d, clamping to 8", len); len = 8; } buffer[3] = len; memset(buffer + 4, ' ', 8); memcpy((char *)buffer + 4, varname, len); ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), vartype); ticalcs_info(" PC->TI: RTS (size=0x%04X=%d, id=%02X, name=%s)", varsize, varsize, vartype, trans); return dbus_send(handle, tiz80_handle_to_dbus_mid_8586(handle), DBUS_CMD_RTS, 12, buffer); return 0; } /* Send an invalid packet that causes the calc to execute assembly code stored in the most recently transferred variable. The program must perform whatever cleanup is necessary, including restoring (FPS), (OPS), and (errSP). You can do so by calling ResetStacks, or by jumping to JForceCmdNoChar when you exit. For ROM-independent methods, see romdump.asm. */ int ti82_send_asm_exec(CalcHandle* handle, VarEntry * var) { uint16_t ioData; uint16_t errSP; uint16_t onSP; uint16_t tempMem; uint16_t fpBase; uint8_t buffer[50]; uint16_t length, offset, endptr, es, sum; VALIDATE_HANDLE(handle); VALIDATE_VARENTRY(var); if (handle->model != CALC_TI82 && handle->model != CALC_TI85) { ticalcs_critical("asm_exec not supported for this model"); return ERR_UNSUPPORTED; } ioData = (handle->model == CALC_TI82 ? 0x81fd : 0x831e); errSP = (handle->model == CALC_TI82 ? 0x821a : 0x8338); onSP = (handle->model == CALC_TI82 ? 0x8143 : 0x81bc); tempMem = (handle->model == CALC_TI82 ? 0x8d0a : 0x8bdd); fpBase = (handle->model == CALC_TI82 ? 0x8d0c : 0x8bdf); buffer[0] = (handle->model == CALC_TI82 ? DBUS_MID_PC_TI82 : DBUS_MID_PC_TI85); buffer[1] = DBUS_CMD_VAR; /* Warning: Heavy wizardry begins here. ;) */ length = errSP + 2 - ioData; buffer[2] = LSB(length); buffer[3] = MSB(length); memset(buffer + 4, 0, length); /* ld sp, (onSP) */ buffer[4] = 0xed; buffer[5] = 0x7b; buffer[6] = LSB(onSP); buffer[7] = MSB(onSP); /* ld hl, (endptr) */ endptr = (var->name[0] == 0x24 ? fpBase : tempMem); buffer[8] = 0x2a; buffer[9] = LSB(endptr); buffer[10] = MSB(endptr); /* ld de, -program_size */ offset = -(var->size - 2); buffer[11] = 0x11; buffer[12] = LSB(offset); buffer[13] = MSB(offset); /* add hl, de */ buffer[14] = 0x19; /* jp (hl) */ buffer[15] = 0xe9; es = 4 + errSP - ioData; buffer[es] = LSB(errSP - 11); buffer[es + 1] = MSB(errSP - 11); buffer[es - 4] = (handle->model == CALC_TI82 ? 0x88 : 0); buffer[es - 3] = LSB(ioData); buffer[es - 2] = MSB(ioData); sum = tifiles_checksum(buffer + 4, length) + 0x5555; buffer[4 + length] = LSB(sum); buffer[4 + length + 1] = MSB(sum); ticalcs_info(" PC->TI: VAR (exec assembly; program size = 0x%04X)", var->size); return ticables_cable_send(handle->cable, buffer, length + 6); } TIEXPORT3 int TICALL ti73_send_VER(CalcHandle* handle) { return tiz80_send_simple_cmd(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_VER, "VER", 2, NULL); } TIEXPORT3 int TICALL ti73_send_DEL(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname, uint8_t varattr) { uint8_t buffer[16]; char trans[127]; /* Note: attribute/version bytes are not used (and will be ignored by the calculator if included in the packet.) The 'varattr' parameter has no effect. */ VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varname); buffer[0] = LSB(varsize); buffer[1] = MSB(varsize); buffer[2] = vartype == TI83p_APPL ? 0x14 : vartype; memcpy((char *)buffer + 3, varname, 8); ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), vartype); ticalcs_info(" PC->TI: DEL (name=%s)", trans); return dbus_send(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_DEL, 11, buffer); } TIEXPORT3 int TICALL ti73_send_DUMP(CalcHandle* handle, uint16_t page) { uint8_t buffer[8] = { page, 0x00, 0x00, 0x40, 0x00, 0x40, 0x0C, 0x00 }; VALIDATE_HANDLE(handle); ticalcs_info(" PC->TI: DUMP (page=%02X)", page); return dbus_send(handle, DBUS_MID_PC_TI83p, DBUS_CMD_DMP, 8, buffer); } TIEXPORT3 int TICALL ti73_send_EKE(CalcHandle* handle) { return tiz80_send_simple_cmd(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_EKE, "EKE", 2, NULL); } TIEXPORT3 int TICALL ti73_send_DKE(CalcHandle* handle) { return tiz80_send_simple_cmd(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_DKE, "DKE", 2, NULL); } TIEXPORT3 int TICALL ti73_send_ELD(CalcHandle* handle) { return tiz80_send_simple_cmd(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_ELD, "ELD", 2, NULL); } TIEXPORT3 int TICALL ti73_send_DLD(CalcHandle* handle) { return tiz80_send_simple_cmd(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_DLD, "DLD", 2, NULL); } TIEXPORT3 int TICALL ti73_send_GID(CalcHandle* handle) { return tiz80_send_simple_cmd(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_GID, "GID", 2, NULL); } TIEXPORT3 int TICALL ti73_send_RID(CalcHandle* handle) { return tiz80_send_simple_cmd(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_RID, "RID", 2, NULL); } TIEXPORT3 int TICALL ti73_send_SID(CalcHandle* handle, uint8_t * data) { return tiz80_send_simple_cmd(handle, tiz80_handle_to_dbus_mid_7383p(handle), DBUS_CMD_SID, "SID", 32, data); } TIEXPORT3 int TICALL ti73_recv_VAR(CalcHandle* handle, uint16_t * varsize, uint8_t * vartype, char *varname, uint8_t * varattr, uint8_t * version) { uint8_t host, cmd; uint8_t *buffer; uint16_t length; char trans[127]; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varsize); VALIDATE_NONNULL(vartype); VALIDATE_NONNULL(varname); VALIDATE_NONNULL(varattr); VALIDATE_NONNULL(version); buffer = (uint8_t *)handle->buffer; memset(buffer, 0, 13); ret = dbus_recv(handle, &host, &cmd, &length, buffer); if (ret) { return ret; } if (cmd == DBUS_CMD_EOT) { return ERR_EOT; // not really an error } if (cmd == DBUS_CMD_SKP) { return ERR_VAR_REJECTED; } if (cmd != DBUS_CMD_VAR) { return ERR_INVALID_CMD; } if(length < 9 || length > 13) //if ((length != (11 + EXTRAS)) && (length != 9)) { return ERR_INVALID_PACKET; } *varsize = buffer[0] | (((uint16_t)buffer[1]) << 8); *vartype = buffer[2]; memcpy(varname, (char *)buffer + 3, 8); varname[8] = '\0'; *version = buffer[11]; *varattr = (buffer[12] & 0x80) ? ATTRB_ARCHIVED : ATTRB_NONE; ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), *vartype); ticalcs_info(" TI->PC: VAR (size=0x%04X=%d, id=%02X, name=%s, attr=%d)", *varsize, *varsize, *vartype, trans, *varattr); return 0; } TIEXPORT3 int TICALL ti82_recv_VAR(CalcHandle* handle, uint16_t * varsize, uint8_t * vartype, char *varname) { uint8_t host, cmd; uint8_t *buffer; uint16_t length; char trans[127]; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varsize); VALIDATE_NONNULL(vartype); VALIDATE_NONNULL(varname); buffer = (uint8_t *)handle->buffer; ret = dbus_recv(handle, &host, &cmd, &length, buffer); if (ret) { return ret; } if (cmd == DBUS_CMD_EOT) { return ERR_EOT; // not really an error } if (cmd == DBUS_CMD_SKP) { return ERR_VAR_REJECTED; } if (cmd != DBUS_CMD_VAR) { return ERR_INVALID_CMD; } if ((length != 11) && (length != 9)) { return ERR_INVALID_PACKET; } *varsize = buffer[0] | (((uint16_t)buffer[1]) << 8); *vartype = buffer[2]; memcpy(varname, (char *)buffer + 3, 8); varname[8] = '\0'; ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), *vartype); ticalcs_info(" TI->PC: VAR (size=0x%04X=%d, id=%02X, name=%s)", *varsize, *varsize, *vartype, trans); return 0; } TIEXPORT3 int TICALL ti85_recv_VAR(CalcHandle* handle, uint16_t * varsize, uint8_t * vartype, char *varname) { uint8_t host, cmd; uint8_t *buffer; uint16_t length; char trans[127]; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varsize); VALIDATE_NONNULL(vartype); VALIDATE_NONNULL(varname); buffer = (uint8_t *)handle->buffer; ret = dbus_recv(handle, &host, &cmd, &length, buffer); if (ret) { return ret; } if (cmd == DBUS_CMD_EOT) { return ERR_EOT; // not really an error } if (cmd == DBUS_CMD_SKP) { return ERR_VAR_REJECTED; } if (cmd != DBUS_CMD_VAR) { return ERR_INVALID_CMD; } //if((length != (4+strlen(varname))) && (length != 9)) //return ERR_INVALID_PACKET; *varsize = buffer[0] | (((uint16_t)buffer[1]) << 8); *vartype = buffer[2]; if (*vartype != TI8586_BKUP) { uint8_t len = buffer[3]; if (len > 8) { len = 8; } memcpy(varname, (char *)buffer + 4, len); varname[8] = '\0'; } else { memcpy(varname, (char *)buffer + 3, 8); } ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), *vartype); ticalcs_info(" TI->PC: VAR (size=0x%04X=%d, id=%02X, name=%s)", *varsize, *varsize, *vartype, trans); return 0; } /* FLASH (special var header: size, id, flag, offset, page) */ TIEXPORT3 int TICALL ti73_recv_VAR2(CalcHandle* handle, uint16_t * length, uint8_t * type, char *name, uint16_t * offset, uint16_t * page) { uint8_t host, cmd; uint8_t *buffer; uint16_t len; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(length); VALIDATE_NONNULL(type); VALIDATE_NONNULL(name); VALIDATE_NONNULL(offset); VALIDATE_NONNULL(page); buffer = (uint8_t *)handle->buffer; ret = dbus_recv(handle, &host, &cmd, &len, buffer); if (ret) { return ret; } if (cmd == DBUS_CMD_EOT) { return ERR_EOT; // not really an error } if (cmd == DBUS_CMD_SKP) { return ERR_VAR_REJECTED; } if (cmd != DBUS_CMD_VAR) { return ERR_INVALID_CMD; } if (len != 10) { return ERR_INVALID_PACKET; } *length = buffer[0] | (((uint16_t)buffer[1]) << 8); *type = buffer[2]; memcpy(name, (char *)buffer + 3, 3); name[3] = '\0'; *offset = buffer[6] | (((uint16_t)buffer[7]) << 8); *page = buffer[8] | (((uint16_t)buffer[9]) << 8); *page &= 0xff; ticalcs_info(" TI->PC: VAR (size=0x%04X=%d, type=%02X, name=%s, offset=%04X, page=%02X)", *length, *length, *type, name, *offset, *page); return 0; } TIEXPORT3 int TICALL tiz80_recv_CTS(CalcHandle* handle, uint16_t length) { uint8_t host, cmd; uint16_t len; uint8_t *buffer; int ret; VALIDATE_HANDLE(handle); buffer = (uint8_t *)handle->buffer; ret = dbus_recv(handle, &host, &cmd, &len, buffer); if (ret) { return ret; } if (cmd == DBUS_CMD_SKP) { return ERR_VAR_REJECTED; } else if (cmd != DBUS_CMD_CTS) { return ERR_INVALID_CMD; } if (length != len) { return ERR_CTS_ERROR; } ticalcs_info(" TI->PC: CTS"); return 0; } TIEXPORT3 int TICALL tiz80_recv_SKP(CalcHandle* handle, uint8_t * rej_code) { uint8_t host, cmd; uint16_t length; uint8_t *buffer; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(rej_code); buffer = (uint8_t *)handle->buffer; *rej_code = 0; ret = dbus_recv(handle, &host, &cmd, &length, buffer); if (ret) { return ret; } if (cmd == DBUS_CMD_CTS) { ticalcs_info(" TI->PC: CTS"); return 0; } if (cmd != DBUS_CMD_SKP) { return ERR_INVALID_CMD; } *rej_code = buffer[0]; ticalcs_info(" TI->PC: SKP (rejection code = %d)", *rej_code); return 0; } static int tiz80_recv_XDP(CalcHandle* handle, uint16_t * length, uint8_t * data, uint8_t is_73) { uint8_t host, cmd; int ret; VALIDATE_HANDLE(handle); ret = dbus_recv(handle, &host, &cmd, length, data); if (ret) { return ret; } if (is_73 && cmd == DBUS_CMD_EOT) { ticalcs_info(" TI->PC: EOT"); return ERR_EOT; } if (cmd != DBUS_CMD_XDP) { return ERR_INVALID_CMD; } ticalcs_info(" TI->PC: XDP (%04X=%d bytes)", *length, *length); return 0; } TIEXPORT3 int TICALL ti73_recv_XDP(CalcHandle* handle, uint16_t * length, uint8_t * data) { return tiz80_recv_XDP(handle, length, data, 1); } TIEXPORT3 int TICALL ti82_recv_XDP(CalcHandle* handle, uint16_t * length, uint8_t * data) { return tiz80_recv_XDP(handle, length, data, 0); } TIEXPORT3 int TICALL ti85_recv_XDP(CalcHandle* handle, uint16_t * length, uint8_t * data) { return tiz80_recv_XDP(handle, length, data, 0); } TIEXPORT3 int TICALL ti80_recv_XDP(CalcHandle* handle, uint16_t * length, uint8_t * data) { return tiz80_recv_XDP(handle, length, data, 0); } TIEXPORT3 int TICALL ti73_recv_SID(CalcHandle* handle, uint16_t * length, uint8_t * data) { uint8_t host, cmd; int ret; ret = dbus_recv(handle, &host, &cmd, length, data); if (ret) { return ret; } if (cmd == DBUS_CMD_EOT) { ticalcs_info(" TI->PC: EOT"); return ERR_EOT; } else if (cmd != DBUS_CMD_SID) { return ERR_INVALID_CMD; } ticalcs_info(" TI->PC: SID (%04X bytes)", *length); return 0; } /* ACK: receive acknowledge - status [in/out]: if NULL is passed, the function checks that 00 00 has been received. Otherwise, it put in status the received value. - int [out]: an error code */ TIEXPORT3 int TICALL tiz80_recv_ACK(CalcHandle* handle, uint16_t * status) { uint8_t host, cmd; uint16_t length; uint8_t *buffer; int ret; VALIDATE_HANDLE(handle); buffer = (uint8_t *)handle->buffer; ret = dbus_recv(handle, &host, &cmd, &length, buffer); if (ret) { return ret; } if (status != NULL) { *status = length; } else if (length != 0x0000) // is an error code ? (=5 when app is rejected) { return ERR_NACK; } if (cmd != DBUS_CMD_ACK) { return ERR_INVALID_CMD; } ticalcs_info(" TI->PC: ACK"); return 0; } TIEXPORT3 int TICALL ti82_recv_ERR(CalcHandle* handle, uint16_t * status) { uint8_t host, cmd; uint16_t sts; int ret; VALIDATE_HANDLE(handle); ret = dbus_recv(handle, &host, &cmd, &sts, NULL); if (ret && ret != ERR_CHECKSUM) { return ret; } if (status != NULL) { *status = sts; } if (cmd != DBUS_CMD_ERR) { return ERR_INVALID_CMD; } ticalcs_info(" TI->PC: ERR"); return 0; } TIEXPORT3 int TICALL ti73_recv_RTS(CalcHandle* handle, uint16_t * varsize, uint8_t * vartype, char *varname, uint8_t * varattr, uint8_t * version) { uint8_t host, cmd; uint8_t *buffer; char trans[127]; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varsize); VALIDATE_NONNULL(vartype); VALIDATE_NONNULL(varname); VALIDATE_NONNULL(varattr); VALIDATE_NONNULL(version); buffer = (uint8_t *)handle->buffer; memset(buffer, 0, 13); ret = dbus_recv(handle, &host, &cmd, varsize, buffer); if (ret) { return ret; } if (cmd != DBUS_CMD_RTS) { return ERR_INVALID_CMD; } if (*varsize < 13) { return ERR_INVALID_PACKET; } *varsize = buffer[0] | (((uint16_t)buffer[1]) << 8); *vartype = buffer[2]; memcpy(varname, (char *)buffer + 3, 8); varname[8] = '\0'; *version = buffer[11]; *varattr = (buffer[12] & 0x80) ? ATTRB_ARCHIVED : ATTRB_NONE; ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), *vartype); ticalcs_info(" TI->PC: RTS (size=0x%04X=%d, id=%02X, name=%s, attr=%d)", *varsize, *varsize, *vartype, trans, *varattr); return 0; } TIEXPORT3 int TICALL ti82_recv_RTS(CalcHandle* handle, uint16_t * varsize, uint8_t * vartype, char *varname) { uint8_t host, cmd; uint8_t *buffer; char trans[127]; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varsize); VALIDATE_NONNULL(vartype); VALIDATE_NONNULL(varname); buffer = (uint8_t *)handle->buffer; ret = dbus_recv(handle, &host, &cmd, varsize, buffer); if (ret) { return ret; } if (cmd != DBUS_CMD_RTS) { return ERR_INVALID_CMD; } *varsize = buffer[0] | (((uint16_t)buffer[1]) << 8); *vartype = buffer[2]; memcpy(varname, (char *)buffer + 3, 8); varname[8] = '\0'; ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), *vartype); ticalcs_info(" TI->PC: RTS (size=0x%04X=%d, id=%02X, name=%s)", *varsize, *varsize, *vartype, trans); return 0; } TIEXPORT3 int TICALL ti85_recv_RTS(CalcHandle* handle, uint16_t * varsize, uint8_t * vartype, char *varname) { uint8_t host, cmd; uint8_t *buffer; char trans[127]; uint8_t strl; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(varsize); VALIDATE_NONNULL(vartype); VALIDATE_NONNULL(varname); buffer = (uint8_t *)handle->buffer; ret = dbus_recv(handle, &host, &cmd, varsize, buffer); if (ret) { return ret; } if (cmd != DBUS_CMD_RTS) { return ERR_INVALID_CMD; } *varsize = buffer[0] | (((uint16_t)buffer[1]) << 8); *vartype = buffer[2]; strl = buffer[3]; if (strl > 8) { strl = 8; } memcpy(varname, (char *)buffer + 4, strl); varname[8] = '\0'; ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), *vartype); ticalcs_info(" TI->PC: RTS (size=0x%04X=%d, id=%02X, name=%s)", *varsize, *varsize, *vartype, trans); return 0; } libticalcs-1.1.9+dfsg/src/cmdz80.h000066400000000000000000000230341327711501700166250ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ // /!\ NOTE: for this file, backwards compatibility will not necessarily be maintained as strongly as it is for ticalcs.h ! #ifndef __TICALCS_CMDZ80__ #define __TICALCS_CMDZ80__ #include "dbus_pkt.h" #ifdef __cplusplus extern "C" { #endif /* Helper functions and macros */ TIEXPORT3 uint8_t TICALL tiz80_handle_to_dbus_mid(CalcHandle * handle); static inline uint8_t tiz80_handle_to_dbus_mid_7383p(CalcHandle * handle) { return (handle != NULL) ? ((handle->model == CALC_TI73) ? DBUS_MID_PC_TI73 : DBUS_MID_PC_TI83p) : 0; } static inline uint8_t tiz80_handle_to_dbus_mid_8283(CalcHandle * handle) { return (handle != NULL) ? ((handle->model == CALC_TI82) ? DBUS_MID_PC_TI82 : DBUS_MID_PC_TI83) : 0; } static inline uint8_t tiz80_handle_to_dbus_mid_8586(CalcHandle * handle) { return (handle != NULL) ? ((handle->model == CALC_TI85) ? DBUS_MID_PC_TI85 : DBUS_MID_PC_TI86) : 0; } /* TI-Z80 family, send functions */ TIEXPORT3 int TICALL tiz80_send_CTS(CalcHandle* handle, uint8_t target); TIEXPORT3 int TICALL tiz80_send_XDP(CalcHandle* handle, uint16_t length, const uint8_t * data, uint8_t target); TIEXPORT3 int TICALL tiz80_send_SKP(CalcHandle* handle, uint8_t rej_code, uint8_t target); TIEXPORT3 int TICALL tiz80_send_ACK(CalcHandle* handle, uint8_t target); TIEXPORT3 int TICALL tiz80_send_ERR(CalcHandle* handle, uint8_t target); TIEXPORT3 int TICALL tiz80_send_SCR(CalcHandle* handle, uint8_t target); TIEXPORT3 int TICALL tiz80_send_KEY(CalcHandle* handle, uint16_t scancode, uint8_t target); TIEXPORT3 int TICALL tiz80_send_EOT(CalcHandle* handle, uint8_t target); /* TI-Z80 family, receive functions */ TIEXPORT3 int TICALL tiz80_recv_CTS(CalcHandle* handle, uint16_t length); TIEXPORT3 int TICALL tiz80_recv_SKP(CalcHandle* handle, uint8_t * rej_code); TIEXPORT3 int TICALL tiz80_recv_ACK(CalcHandle* handle, uint16_t * status); /* TI-80 (not Z80-based, in fact), send functions */ TIEXPORT3 int TICALL ti80_send_SCR(CalcHandle *handle); /* TI-80 (not Z80-based, in fact), receive functions */ TIEXPORT3 int TICALL ti80_recv_XDP(CalcHandle *handle, uint16_t * length, uint8_t * data); #define ti80_recv_ACK(handle, status) tiz80_recv_ACK(handle, status) /* TI-73 family, send functions */ TIEXPORT3 int TICALL ti73_send_VAR(CalcHandle *handle, uint16_t varsize, uint8_t vartype, const char *varname, uint8_t varattr, uint8_t version); TIEXPORT3 int TICALL ti73_send_VAR2(CalcHandle *handle, uint32_t length, uint8_t type, uint8_t flag, uint16_t offset, uint16_t page); #define ti73_send_CTS(handle) tiz80_send_CTS(handle, tiz80_handle_to_dbus_mid_7383p(handle)) #define ti73_send_XDP(handle, length, data) tiz80_send_XDP(handle, length, data, tiz80_handle_to_dbus_mid_7383p(handle)) #define ti73_send_SKP(handle, rej_code) tiz80_send_SKP(handle, rej_code, tiz80_handle_to_dbus_mid_7383p(handle)) #define ti73_send_ACK(handle) tiz80_send_ACK(handle, tiz80_handle_to_dbus_mid_7383p(handle)) #define ti73_send_ERR(handle) tiz80_send_ERR(handle, tiz80_handle_to_dbus_mid_7383p(handle)) TIEXPORT3 int TICALL ti73_send_RDY(CalcHandle *handle); #define ti73_send_SCR(handle) tiz80_send_SCR(handle, tiz80_handle_to_dbus_mid_7383p(handle)) #define ti73_send_KEY(handle, scancode) tiz80_send_KEY(handle, scancode, tiz80_handle_to_dbus_mid_7383p(handle)) #define ti73_send_EOT(handle) tiz80_send_EOT(handle, tiz80_handle_to_dbus_mid_7383p(handle)) TIEXPORT3 int TICALL ti73_send_REQ(CalcHandle *handle, uint16_t varsize, uint8_t vartype, const char *varname, uint8_t varattr, uint8_t version); TIEXPORT3 int TICALL ti73_send_REQ2(CalcHandle *handle, uint16_t appsize, uint8_t apptype, const char *appname, uint8_t appattr); TIEXPORT3 int TICALL ti73_send_RTS(CalcHandle *handle, uint16_t varsize, uint8_t vartype, const char *varname, uint8_t varattr, uint8_t version); TIEXPORT3 int TICALL ti73_send_VER(CalcHandle *handle); TIEXPORT3 int TICALL ti73_send_DEL(CalcHandle *handle, uint16_t varsize, uint8_t vartype, const char *varname, uint8_t varattr); TIEXPORT3 int TICALL ti73_send_DUMP(CalcHandle *handle, uint16_t page); TIEXPORT3 int TICALL ti73_send_EKE(CalcHandle *handle); TIEXPORT3 int TICALL ti73_send_DKE(CalcHandle *handle); TIEXPORT3 int TICALL ti73_send_ELD(CalcHandle *handle); TIEXPORT3 int TICALL ti73_send_DLD(CalcHandle *handle); TIEXPORT3 int TICALL ti73_send_GID(CalcHandle *handle); TIEXPORT3 int TICALL ti73_send_RID(CalcHandle *handle); TIEXPORT3 int TICALL ti73_send_SID(CalcHandle *handle, uint8_t * data); /* TI-73 family, receive functions */ TIEXPORT3 int TICALL ti73_recv_VAR(CalcHandle *handle, uint16_t * varsize, uint8_t * vartype, char *varname, uint8_t * varattr, uint8_t * version); TIEXPORT3 int TICALL ti73_recv_VAR2(CalcHandle *handle, uint16_t * length, uint8_t * type, char *name, uint16_t * offset, uint16_t * page); #define ti73_recv_CTS(handle, length) tiz80_recv_CTS(handle, length) #define ti73_recv_SKP(handle, rej_code) tiz80_recv_SKP(handle, rej_code) TIEXPORT3 int TICALL ti73_recv_XDP(CalcHandle *handle, uint16_t * length, uint8_t * data); TIEXPORT3 int TICALL ti73_recv_SID(CalcHandle *handle, uint16_t * length, uint8_t * data); #define ti73_recv_ACK(handle, status) tiz80_recv_ACK(handle, status) TIEXPORT3 int TICALL ti73_recv_RTS(CalcHandle *handle, uint16_t * varsize, uint8_t * vartype, char *varname, uint8_t * varattr, uint8_t * version); /* TI-82 & TI-83, send functions */ TIEXPORT3 int TICALL ti82_send_VAR(CalcHandle *handle, uint16_t varsize, uint8_t vartype, const char *varname); #define ti82_send_CTS(handle) tiz80_send_CTS(handle, tiz80_handle_to_dbus_mid_8283(handle)) #define ti82_send_XDP(handle, length, data) tiz80_send_XDP(handle, length, data, tiz80_handle_to_dbus_mid_8283(handle)) #define ti82_send_SKP(handle, rej_code) tiz80_send_SKP(handle, rej_code, tiz80_handle_to_dbus_mid_8283(handle)) #define ti82_send_ACK(handle) tiz80_send_ACK(handle, tiz80_handle_to_dbus_mid_8283(handle)) #define ti82_send_ERR(handle) tiz80_send_ERR(handle, tiz80_handle_to_dbus_mid_8283(handle)) #define ti82_send_SCR(handle) tiz80_send_SCR(handle, tiz80_handle_to_dbus_mid_8283(handle)) #define ti82_send_KEY(handle, scancode) tiz80_send_KEY(handle, scancode, DBUS_MID_PC_TI83) #define ti82_send_EOT(handle) tiz80_send_EOT(handle, tiz80_handle_to_dbus_mid_8283(handle)) TIEXPORT3 int TICALL ti82_send_REQ(CalcHandle *handle, uint16_t varsize, uint8_t vartype, const char *varname); TIEXPORT3 int TICALL ti82_send_RTS(CalcHandle *handle, uint16_t varsize, uint8_t vartype, const char *varname); /* TI-82 & TI-83, receive functions */ TIEXPORT3 int TICALL ti82_recv_VAR(CalcHandle *handle, uint16_t * varsize, uint8_t * vartype, char *varname); #define ti82_recv_CTS(handle) tiz80_recv_CTS(handle, 0) #define ti82_recv_SKP(handle, rej_code) tiz80_recv_SKP(handle, rej_code) TIEXPORT3 int TICALL ti82_recv_XDP(CalcHandle *handle, uint16_t * length, uint8_t * data); #define ti82_recv_ACK(handle, status) tiz80_recv_ACK(handle, status) TIEXPORT3 int TICALL ti82_recv_ERR(CalcHandle *handle, uint16_t * status); TIEXPORT3 int TICALL ti82_recv_RTS(CalcHandle *handle, uint16_t * varsize, uint8_t * vartype, char *varname); /* TI-85 & TI-86, send functions */ TIEXPORT3 int TICALL ti85_send_VAR(CalcHandle *handle, uint16_t varsize, uint8_t vartype, const char *varname); #define ti85_send_CTS(handle) tiz80_send_CTS(handle, tiz80_handle_to_dbus_mid_8586(handle)) #define ti85_send_XDP(handle, length, data) tiz80_send_XDP(handle, length, data, tiz80_handle_to_dbus_mid_8586(handle)) #define ti85_send_SKP(handle, rej_code) tiz80_send_SKP(handle, rej_code, tiz80_handle_to_dbus_mid_8586(handle)) #define ti85_send_ACK(handle) tiz80_send_ACK(handle, tiz80_handle_to_dbus_mid_8586(handle)) #define ti85_send_ERR(handle) tiz80_send_ERR(handle, tiz80_handle_to_dbus_mid_8586(handle)) #define ti85_send_SCR(handle) tiz80_send_SCR(handle, tiz80_handle_to_dbus_mid_8586(handle)) #define ti85_send_KEY(handle, scancode) tiz80_send_KEY(handle, scancode, tiz80_handle_to_dbus_mid_8586(handle)) #define ti85_send_EOT(handle) tiz80_send_EOT(handle, tiz80_handle_to_dbus_mid_8586(handle)) TIEXPORT3 int TICALL ti85_send_REQ(CalcHandle *handle, uint16_t varsize, uint8_t vartype, const char *varname); TIEXPORT3 int TICALL ti85_send_RTS(CalcHandle *handle, uint16_t varsize, uint8_t vartype, const char *varname); /* TI-85 & TI-86, receive functions */ TIEXPORT3 int TICALL ti85_recv_VAR(CalcHandle *handle, uint16_t * varsize, uint8_t * vartype, char *varname); #define ti85_recv_CTS(handle) tiz80_recv_CTS(handle, 0) #define ti85_recv_SKP(handle, rej_code) tiz80_recv_SKP(handle, rej_code) TIEXPORT3 int TICALL ti85_recv_XDP(CalcHandle *handle, uint16_t * length, uint8_t * data); #define ti85_recv_ACK(handle, status) tiz80_recv_ACK(handle, status) TIEXPORT3 int TICALL ti85_recv_RTS(CalcHandle *handle, uint16_t * varsize, uint8_t * vartype, char *varname); #ifdef __cplusplus } #endif #endif libticalcs-1.1.9+dfsg/src/dbus_pkt.c000066400000000000000000000172631327711501700173350ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This unit manages packets from/to D-BUS. */ #include #include #include "ticalcs.h" #include "internal.h" #include "dbus_pkt.h" #include "logging.h" #include "error.h" // We split packets into chunks to get control regularly and update statistics. /* Send a packet from PC (host) to TI (target): - target [in] : a machine ID uint8_t - cmd [in] : a command ID uint8_t - length [in] : length of buffer - data [in] : data to send (or 0x00 if NULL) - int [out] : an error code */ TIEXPORT3 int TICALL dbus_send(CalcHandle* handle, uint8_t target, uint8_t cmd, uint16_t len, const uint8_t* data) { int i; uint16_t sum; uint32_t length = (len == 0x0000) ? 65536 : len; // wrap around uint8_t *buf; int r, q; static int ref = 0; int ret; VALIDATE_HANDLE(handle); buf = (uint8_t *)handle->buffer; //[65536+6]; if (buf == NULL) { ticalcs_critical("%s: handle->buffer is NULL", __FUNCTION__); return ERR_INVALID_HANDLE; } ticables_progress_reset(handle->cable); if (data == NULL) { // short packet (no data) buf[0] = target; buf[1] = cmd; buf[2] = 0x00; buf[3] = 0x00; // The TI-80 does not use length ret = ticables_cable_send(handle->cable, buf, (target == DBUS_MID_PC_TI80) ? 2 : 4); } else { // std packet (data + checksum) buf[0] = target; buf[1] = cmd; buf[2] = LSB(length); buf[3] = MSB(length); // copy data memcpy(buf+4, data, length); // add checksum of packet sum = tifiles_checksum(data, length); buf[length+4+0] = LSB(sum); buf[length+4+1] = MSB(sum); // compute chunks handle->priv.progress_min_size = (handle->cable->model == CABLE_GRY) ? 512 : 2048; handle->priv.progress_blk_size = (length + 6) / 20; // 5% if (handle->priv.progress_blk_size == 0) { handle->priv.progress_blk_size = length + 6; } if (handle->priv.progress_blk_size < 32) { handle->priv.progress_blk_size = 128; // SilverLink doesn't like small block (< 32) } q = (length + 6) / handle->priv.progress_blk_size; r = (length + 6) % handle->priv.progress_blk_size; handle->updat->max1 = length + 6; handle->updat->cnt1 = 0; ret = 0; // send full chunks for (i = 0; i < q; i++) { ret = ticables_cable_send(handle->cable, &buf[i*handle->priv.progress_blk_size], handle->priv.progress_blk_size); if (ret) { break; } ticables_progress_get(handle->cable, NULL, NULL, &handle->updat->rate); handle->updat->cnt1 += handle->priv.progress_blk_size; if (length > handle->priv.progress_min_size) { handle->updat->pbar(); } if (handle->updat->cancel) { ret = ERR_ABORT; break; } } // send last chunk if (!ret) { ret = ticables_cable_send(handle->cable, &buf[i*handle->priv.progress_blk_size], (uint16_t)r); if (!ret) { ticables_progress_get(handle->cable, NULL, NULL, &handle->updat->rate); handle->updat->cnt1 += 1; if (length > handle->priv.progress_min_size) { handle->updat->pbar(); } if (handle->updat->cancel) { ret = ERR_ABORT; } } } } // force periodic refresh if (!ret && !(ref++ % 4)) { handle->updat->refresh(); } return ret; } TIEXPORT3 int TICALL dbus_recv_header(CalcHandle *handle, uint8_t* host, uint8_t* cmd, uint16_t* length) { int ret; uint8_t buf[4]; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(host); VALIDATE_NONNULL(cmd); VALIDATE_NONNULL(length); // Any packet has always at least 2 bytes (MID, CID) ret = ticables_cable_recv(handle->cable, buf, 2); if (!ret) { *host = buf[0]; *cmd = buf[1]; // Any non-TI-80 packet has a length; TI-80 data packets also have a length if (*host != DBUS_MID_TI80_PC || *cmd == DBUS_CMD_XDP) { ret = ticables_cable_recv(handle->cable, buf, 2); if (!ret) { *length = buf[0] | ((uint16_t)buf[1] << 8); } } else { *length = 0; } } return ret; } TIEXPORT3 int TICALL dbus_recv_data(CalcHandle *handle, uint16_t* length, uint8_t* data) { int ret; int i; uint16_t chksum; uint8_t buf[4]; int r, q; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(length); VALIDATE_NONNULL(data); // compute chunks handle->priv.progress_min_size = (handle->cable->model == CABLE_GRY) ? 512 : 2048; handle->priv.progress_blk_size = *length / 20; if (handle->priv.progress_blk_size == 0) { handle->priv.progress_blk_size = 1; } q = *length / handle->priv.progress_blk_size; r = *length % handle->priv.progress_blk_size; handle->updat->max1 = *length; handle->updat->cnt1 = 0; ret = 0; // recv full chunks for (i = 0; i < q; i++) { ret = ticables_cable_recv(handle->cable, &data[i*handle->priv.progress_blk_size], handle->priv.progress_blk_size); if (ret) { break; } ticables_progress_get(handle->cable, NULL, NULL, &handle->updat->rate); handle->updat->cnt1 += handle->priv.progress_blk_size; if (*length > handle->priv.progress_min_size) { handle->updat->pbar(); } if (handle->updat->cancel) { ret = ERR_ABORT; break; } } // recv last chunk if (!ret) { ret = ticables_cable_recv(handle->cable, &data[i*handle->priv.progress_blk_size], (uint16_t)r); if (!ret) { ticables_progress_get(handle->cable, NULL, NULL, &handle->updat->rate); ret = ticables_cable_recv(handle->cable, buf, 2); if (!ret) { handle->updat->cnt1++; if (*length > handle->priv.progress_min_size) { handle->updat->pbar(); } if (handle->updat->cancel) { ret = ERR_ABORT; } } } } if (!ret) { // verify checksum chksum = buf[0] | ((uint16_t)buf[1] << 8); if (chksum != tifiles_checksum(data, *length)) { ret = ERR_CHECKSUM; } } return ret; } /* Receive a packet from TI (target) to PC (host): - host [out] : a machine ID uint8_t - cmd [out] : a command ID uint8_t - length [out] : length of buffer - data [out] : received data (depending on command) - int [out] : an error code */ TIEXPORT3 int TICALL dbus_recv(CalcHandle* handle, uint8_t* host, uint8_t* cmd, uint16_t* length, uint8_t* data) { static int ref = 0; int ret; ret = dbus_recv_header(handle, host, cmd, length); if (!ret) { if (*cmd == DBUS_CMD_ERR || *cmd == DBUS_CMD_ERR2) { return ERR_CHECKSUM; // THIS RETURNS ! } switch (*cmd) { case DBUS_CMD_VAR: // std packet ( data + checksum) case DBUS_CMD_XDP: case DBUS_CMD_SKP: case DBUS_CMD_SID: case DBUS_CMD_REQ: case DBUS_CMD_IND: case DBUS_CMD_RTS: ret = dbus_recv_data(handle, length, data); break; case DBUS_CMD_CTS: // short packet (no data) case DBUS_CMD_ACK: case DBUS_CMD_ERR: case DBUS_CMD_ERR2: case DBUS_CMD_RDY: case DBUS_CMD_SCR: case DBUS_CMD_RID: case DBUS_CMD_KEY: case DBUS_CMD_EOT: case DBUS_CMD_CNT: break; default: return ERR_INVALID_CMD; // THIS RETURNS ! } if (!ret && !(ref++ % 4)) { // force periodic refresh handle->updat->refresh(); } } return ret; } libticalcs-1.1.9+dfsg/src/dbus_pkt.h000066400000000000000000000132211327711501700173300ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: packets.h 1179 2005-06-06 14:42:32Z roms $ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ // /!\ NOTE: for this file, backwards compatibility will not necessarily be maintained as strongly as it is for ticalcs.h ! #ifndef __TICALCS_DBUS__ #define __TICALCS_DBUS__ /*************/ /* Constants */ /*************/ // Machine IDs (host <-> target) #define DBUS_MID_PC_TIXX 0x00 #define DBUS_MID_PC_TI73 0x07 #define DBUS_MID_TI73_PC 0x74 #define DBUS_MID_CBL_TI73 0x12 #define DBUS_MID_TI73_CBL 0x95 #define DBUS_MID_PC_TI80 0x00 #define DBUS_MID_TI80_PC 0x80 #define DBUS_MID_PC_TI82 0x02 #define DBUS_MID_TI82_PC 0x82 #define DBUS_MID_CBL_TI82 0x12 #define DBUS_MID_TI82_CBL 0x82 #define DBUS_MID_PC_TI83 0x03 #define DBUS_MID_TI83_PC 0x83 #define DBUS_MID_CBL_TI83 0x12 #define DBUS_MID_TI83_CBL 0x95 #define DBUS_MID_PC_TI83p 0x23 #define DBUS_MID_TI83p_PC 0x73 #define DBUS_MID_CBL_TI83p 0x12 #define DBUS_MID_TI83p_CBL 0x95 #define DBUS_MID_PC_TI84p 0x23 #define DBUS_MID_TI84p_PC 0x73 #define DBUS_MID_CBL_TI84p 0x12 #define DBUS_MID_TI84p_CBL 0x95 #define DBUS_MID_PC_TI85 0x05 #define DBUS_MID_TI85_PC 0x85 #define DBUS_MID_CBL_TI85 0x15 #define DBUS_MID_TI85_CBL 0x85 #define DBUS_MID_PC_TI86 0x06 #define DBUS_MID_TI86_PC 0x86 #define DBUS_MID_CBL_TI86 0x15 #define DBUS_MID_TI86_CBL 0x85 #define DBUS_MID_PC_TI89 0x08 #define DBUS_MID_TI89_PC 0x98 #define DBUS_MID_CBL_TI89 0x19 #define DBUS_MID_TI89_CBL 0x89 #define DBUS_MID_PC_TI89t 0x08 #define DBUS_MID_TI89t_PC 0x98 #define DBUS_MID_CBL_TI89t 0x19 #define DBUS_MID_TI89t_CBL 0x89 #define DBUS_MID_PC_TI92 0x09 #define DBUS_MID_TI92_PC 0x89 #define DBUS_MID_CBL_TI92 0x19 #define DBUS_MID_TI92_CBL 0x89 #define DBUS_MID_PC_TI92p 0x08 #define DBUS_MID_TI92p_PC 0x88 #define DBUS_MID_CBL_TI92p 0x19 #define DBUS_MID_TI92p_CBL 0x89 #define DBUS_MID_PC_V200 0x08 #define DBUS_MID_V200_PC 0x88 #define DBUS_MID_CBL_V200 0x19 #define DBUS_MID_V200_CBL 0x89 // Command IDs /* * means there is data attached. # means the device id is ignored with this command. $ means it's a silent command */ // Official names found in TI's DBUS implementation in the activitygrapher TINCS Navigator plugin. #define DBUS_CMD_VAR 0x06 // [* ] Variable Header - includes a std variable header (official name: RTS) #define DBUS_CMD_CTS 0x09 // [ ] Continue - used to signal OK to send a variable (official name: RDY) #define DBUS_CMD_XDP 0x15 // [* ] Data packet - Pure data (official name: XDP) #define DBUS_CMD_ELD 0x29 // [ $] Enable Lockdown (official name: EBL) #define DBUS_CMD_DLD 0x2A // [ $] Disable Lockdown (official name: DBL) #define DBUS_CMD_EKE 0x2B // [ $] Enable Key Echo - start sending keypresses as scan codes in remote control packets (official name: EKE) #define DBUS_CMD_DKE 0x2C // [ $] Disable Key Echo (official name: DKE) #define DBUS_CMD_VER 0x2D // [ $] Request version (official name: RDI) #define DBUS_CMD_SKP 0x36 // [* ] Skip/Exit - used when duplicate name is found (official name: EOR) #define DBUS_CMD_SID 0x47 // [*#$] Send calc ID (official name: SIOA) #define DBUS_CMD_ACK 0x56 // [ ] Acknowledge (official name: ACK) #define DBUS_CMD_ERR 0x5A // [ ] Checksum error: send last packet again (official name: CHK) #define DBUS_CMD_RDY 0x68 // [ #$] Test if calc is ready (official name: RDC) #define DBUS_CMD_SCR 0x6D // [ $] Request screenshot (official name: REQ) #define DBUS_CMD_GID 0x6E // [ $] Get Calculator ID - on 83+ reads 9 bytes right from cert #define DBUS_CMD_DMP 0x6F // [* $] Request dump of memory page #define DBUS_CMD_TG2 0x70 // [* $] Testguard2 packet - its long and complicated. #define DBUS_CMD_RID 0x74 // [ #$] Request calc ID (official name: RIOA) #define DBUS_CMD_CNT 0x78 // [ $] Continue (official name: RTC) #define DBUS_CMD_KEY 0x87 // [ $] Send key (official name: SKY) #define DBUS_CMD_DEL 0x88 // [* $] Delete variable/app (official name: DVL) #define DBUS_CMD_RUN 0x89 // [* $] Run variable/app (official name: EPL) #define DBUS_CMD_EOT 0x92 // [ ] End Of Transmission: no more variables to send (official name: DONE) #define DBUS_CMD_REQ 0xA2 // [* $] Request variable - includes a std var header (official name: GET) #define DBUS_CMD_ERR2 0xB4 // [ ] Checksum error: send last packet again #define DBUS_CMD_IND 0xB7 // [* $] Request variable index (official name: GTE) #define DBUS_CMD_RTS 0xC9 // [* $] Request to send - includes a padded var header (official name: SEND) #define DBUS_CMD_RSE 0xCA // [* $] Request to send and execute - same as above but runs it after send (official name: SETP) // Rejection codes (CMD82_SKIP) #define DBUS_REJ_EXIT 1 #define DBUS_REJ_SKIP 2 #define DBUS_REJ_MEMORY 3 #define DBUS_REJ_VERSION 4 #endif libticalcs-1.1.9+dfsg/src/dirlist.c000066400000000000000000000316051327711501700171700ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Utility functions for directory list (tree management). All functions can be applied on both trees (vars & apps) because: - tree type is stored in the tree itself (TreeInfo), - vars & apps use the same tree format. */ #include #include #include #include #include "ticalcs.h" #include "internal.h" #include "gettext.h" #include "logging.h" /* Dirlist format: - Vars: top (data = TreeInfo) | + folder (data = NULL if TI8x, data = VarEntry if TI9x) | +- var1 (data = VarEntry) +- var2 (data = VarEntry) - Apps: top (data = TreeInfo) | + no folder (data = NULL) | +- app1 (data = VarEntry) +- app2 (data = VarEntry) */ static gboolean free_varentry(GNode* node, gpointer data) { (void)data; if (node && node->data) { VarEntry* ve = node->data; tifiles_ve_delete(ve); } return FALSE; } /** * ticalcs_dirlist_destroy: * @tree: the tree to destroy. * * Destroy the whole tree create by #ticalcs_calc_get_dirlist. * * Return value: none. **/ TIEXPORT3 void TICALL ticalcs_dirlist_destroy(GNode** tree) { if (tree != NULL && *tree != NULL) { TreeInfo *ti; if ((*tree)->children != NULL) { g_node_traverse(*tree, G_IN_ORDER, G_TRAVERSE_LEAVES, -1, free_varentry, NULL); } ti = (TreeInfo *)((*tree)->data); g_free(ti); g_node_destroy(*tree); *tree = NULL; } } static void display_node(TreeInfo * info, VarEntry * ve, unsigned char type) { char * utf8 = ticonv_varname_to_utf8(info->model, ve->name, type); int k; printf("| "); for (k = 0; k < 8; k++) { printf("%02X", (uint8_t) (ve->name)[k]); } printf(" | "); printf("%8s", utf8); printf(" | "); printf("%2i", ve->attr); printf(" | "); printf("%02X", ve->type); printf(" | "); printf("%08X", ve->size); printf(" | "); printf("%8s", ve->folder); printf(" |"); printf("\n"); ticonv_utf8_free(utf8); } static void display_tree(TreeInfo * info, GNode * vars) { int i; //ticalcs_info("vars has %d children", (int)g_node_n_children(vars)); for (i = 0; i < (int)g_node_n_children(vars); i++) // parse children { GNode *parent = g_node_nth_child(vars, i); VarEntry *fe = (VarEntry *) (parent->data); int j; if (fe != NULL) { display_node(info, fe, -1); } //ticalcs_info("parent has %d children", (int)g_node_n_children(parent)); if (info->model != CALC_NSPIRE) { for (j = 0; j < (int)g_node_n_children(parent); j++) { GNode *child = g_node_nth_child(parent, j); VarEntry *ve = (VarEntry *) (child->data); display_node(info, ve, ve->type); } } else { // Recurse into sub-folder if necessary. if (fe != NULL && fe->type == NSP_DIR) { //ticalcs_info("Recurse"); display_tree(info, parent); } } //ticalcs_info("finished enumerating %d children of parent", (int)g_node_n_children(parent)); } //ticalcs_info("finished enumerating %d children of vars", (int)g_node_n_children(vars)); } /** * ticalcs_dirlist_display: * @tree: the tree to display. * * Display to stdout the tree content formatted in a tab. * * Return value: none. **/ TIEXPORT3 void TICALL ticalcs_dirlist_display(GNode* tree) { GNode *vars = tree; TreeInfo *info; int i; if (tree == NULL) { ticalcs_critical("ticalcs_dirlist_display(NULL)"); return; } info = (TreeInfo *)(tree->data); if (info == NULL) { return; } printf( "+------------------+----------+----+----+----------+----------+\n"); printf(_("| B. name | T. name |Attr|Type| Size | Folder |\n")); printf( "+------------------+----------+----+----+----------+----------+\n"); i = (int)g_node_n_children(vars); //ticalcs_info("Root has %d children", i); display_tree(info, vars); if (!i) { if (!strcmp(info->type, VAR_NODE_NAME)) { printf(_("| No variables |\n")); } else if (!strcmp(info->type, APP_NODE_NAME)) { printf(_("| No applications |\n")); } } printf(_("+------------------+----------+----+----+----------+----------+")); printf("\n"); } /** * ticalcs_dirlist_ve_exist: * @tree: the tree to parse. * @s: the full name of the variable or application to search for. * * Parse the tree for the given varname & folder or appname. * * Return value: a pointer on the #VarEntry found or NULL if not found. **/ TIEXPORT3 VarEntry *TICALL ticalcs_dirlist_ve_exist(GNode* tree, VarEntry *s) { int i, j; GNode *vars = tree; TreeInfo *info; if (tree == NULL || s == NULL) { ticalcs_critical("ticalcs_dirlist_ve_exist: an argument is NULL"); return NULL; } info = (TreeInfo *)(tree->data); if (info == NULL) { return NULL; } if (strcmp(info->type, VAR_NODE_NAME) && strcmp(info->type, APP_NODE_NAME)) { return NULL; } for (i = 0; i < (int)g_node_n_children(vars); i++) // parse folders { GNode *parent = g_node_nth_child(vars, i); VarEntry *fe = (VarEntry *) (parent->data); if ((fe != NULL) && strcmp(fe->name, s->folder)) { continue; } for (j = 0; j < (int)g_node_n_children(parent); j++) //parse variables { GNode *child = g_node_nth_child(parent, j); VarEntry *ve = (VarEntry *) (child->data); if ( !strcmp(ve->name, s->name) && ( !((info->model >= CALC_TI73 && info->model <= CALC_TI84P) || info->model == CALC_TI84P_USB || info->model == CALC_TI83PCE_USB || info->model == CALC_TI84PCE_USB || info->model == CALC_TI82A_USB) || info->model == CALC_TI84PT_USB || (ve->type == s->type))) { return ve; } } } return NULL; } /** * ticalcs_dirlist_ve_count: * @tree: a tree (var or app). * * Count how many entries (vars or apps) are listed in the tree. * * Return value: the number of entries. **/ TIEXPORT3 unsigned int TICALL ticalcs_dirlist_ve_count(GNode* tree) { unsigned int i, j; GNode *vars = tree; unsigned int nvars = 0; TreeInfo *info; if (tree == NULL) { ticalcs_critical("ticalcs_dirlist_ve_count(NULL)"); return 0; } info = (TreeInfo *)(tree->data); if (info == NULL) { return 0; } if (strcmp(info->type, VAR_NODE_NAME) && strcmp(info->type, APP_NODE_NAME)) { return 0; } for (i = 0; i < g_node_n_children(vars); i++) // parse folders { GNode *parent = g_node_nth_child(vars, i); for (j = 0; j < g_node_n_children(parent); j++) //parse variables { nvars++; } } return nvars; } /** * ticalcs_dirlist_ram_used: * @tree: a tree (var only). * * Count how much memory is used by variables listed in the tree. * * Return value: size of all variables in bytes. **/ TIEXPORT3 int TICALL ticalcs_dirlist_ram_used(GNode* tree) { int i, j; GNode *vars = tree; uint32_t mem = 0; TreeInfo *info; if (tree == NULL) { ticalcs_critical("ticalcs_dirlist_ram_used(NULL)"); return 0; } info = (TreeInfo *)(tree->data); if (info == NULL) { return 0; } if (strcmp(info->type, VAR_NODE_NAME)) { return 0; } for (i = 0; i < (int)g_node_n_children(vars); i++) // parse folders { GNode *parent = g_node_nth_child(vars, i); for (j = 0; j < (int)g_node_n_children(parent); j++) //parse variables { GNode *child = g_node_nth_child(parent, j); VarEntry *ve = (VarEntry *) (child->data); if (ve->attr != ATTRB_ARCHIVED) { mem += ve->size; } } } return mem; } /** * ticalcs_dirlist_flash_used: * @tree: a tree (app only). * * Count how much memory is used by archived variables and apps listed in the trees. * * Return value: size of all FLASH in bytes. **/ TIEXPORT3 int TICALL ticalcs_dirlist_flash_used(GNode* vars, GNode* apps) { int i, j; uint32_t mem = 0; TreeInfo *info1; TreeInfo *info2; if (vars == NULL || apps == NULL) { ticalcs_critical("ticalcs_dirlist_flash_used: an argument is NULL"); return 0; } info1 = (TreeInfo *)(vars->data); info2 = (TreeInfo *)(apps->data); if (info1 == NULL || info2 == NULL) { return 0; } if (!strcmp(info1->type, VAR_NODE_NAME)) { for (i = 0; i < (int)g_node_n_children(vars); i++) // parse folders { GNode *parent = g_node_nth_child(vars, i); for (j = 0; j < (int)g_node_n_children(parent); j++) //parse variables { GNode *child = g_node_nth_child(parent, j); VarEntry *ve = (VarEntry *) (child->data); if (ve->attr == ATTRB_ARCHIVED) { mem += ve->size; } } } } if (!strcmp(info2->type, APP_NODE_NAME)) { for (i = 0; i < (int)g_node_n_children(apps); i++) { GNode *parent = g_node_nth_child(apps, i); for (j = 0; j < (int)g_node_n_children(parent); j++) //parse apps { GNode *child = g_node_nth_child(parent, i); VarEntry *ve = (VarEntry *) (child->data); mem += ve->size; } } } return mem; } /** * ticalcs_dirlist_ve_add: * @tree: source tree. * @entry: entry to add. * * Add an entry into the main tree (if it doesn't exist yet). * * Return value: none. **/ TIEXPORT3 void TICALL ticalcs_dirlist_ve_add(GNode* tree, VarEntry *entry) { TreeInfo *info; int i, j; int found = 0; GNode *parent = NULL; VarEntry *fe = NULL; GNode *child; VarEntry *ve; const char *folder; if (tree == NULL || entry == NULL) { ticalcs_critical("ticalcs_dirlist_ve_add: an argument is NULL"); return; } info = (TreeInfo *)(tree->data); if (info == NULL) { return; } if (strcmp(info->type, VAR_NODE_NAME) && strcmp(info->type, APP_NODE_NAME)) { return; } if (!strcmp(entry->folder, "") && tifiles_has_folder(info->model)) { folder = "main"; } else { folder = entry->folder; } // If TI8x tree is empty, create pseudo-folder (NULL) if (!g_node_n_children(tree) && !tifiles_has_folder(info->model)) { parent = g_node_new(NULL); g_node_append(tree, parent); } // Check for one folder at least... if (g_node_n_children(tree) > 0) { // Parse folders for (found = 0, i = 0; i < (int)g_node_n_children(tree); i++) { parent = g_node_nth_child(tree, i); fe = (VarEntry *) (parent->data); if (fe == NULL) { break; } if (!strcmp(fe->name, folder)) { found = !0; break; } } } // folder doesn't exist? => create! if ((!found && fe) || (!g_node_n_children(tree) && tifiles_has_folder(info->model))) { fe = tifiles_ve_create(); if (fe != NULL) { ticalcs_strlcpy(fe->name, entry->folder, sizeof(fe->name)); fe->type = TI89_DIR; parent = g_node_new(fe); g_node_append(tree, parent); } } if (!strcmp(entry->name, "")) { return; } // next, add variables beneath this folder for (found = 0, j = 0; j < (int)g_node_n_children(parent); j++) { child = g_node_nth_child(parent, j); ve = (VarEntry *) (child->data); if (!strcmp(ve->name, entry->name)) { found = !0; break; } } if (!found) { ve = tifiles_ve_dup(entry); if (ve != NULL) { child = g_node_new(ve); g_node_append(parent, child); } } if (fe && found) { fe->size++; } } /** * ticalcs_dirlist_ve_del: * @tree: source tree. * @entry: entry to remove. * * Remove an entry into the main tree (if it doesn't exist yet). * * Return value: none. **/ TIEXPORT3 void TICALL ticalcs_dirlist_ve_del(GNode* tree, VarEntry *entry) { TreeInfo *info; int i, j; int found = 0; GNode *parent = NULL; VarEntry *fe = NULL; GNode *child = NULL; VarEntry *ve; const char *folder; if (tree == NULL || entry == NULL) { ticalcs_critical("ticalcs_dirlist_ve_del: an argument is NULL"); return; } info = (TreeInfo *)(tree->data); if (info == NULL) { return; } if (strcmp(info->type, VAR_NODE_NAME)) { return; } if (!strcmp(entry->folder, "") && tifiles_has_folder(info->model)) { folder = "main"; } else { folder = entry->folder; } // Parse folders for (found = 0, i = 0; i < (int)g_node_n_children(tree); i++) { parent = g_node_nth_child(tree, i); fe = (VarEntry *) (parent->data); if (fe == NULL) { break; } if (!strcmp(fe->name, folder)) { found = !0; break; } } if (!found && fe) { return; } // next, delete variables beneath this folder for (found = 0, j = 0; j < (int)g_node_n_children(parent); j++) { child = g_node_nth_child(parent, j); ve = (VarEntry *) (child->data); if (!strcmp(ve->name, entry->name)) { found = !0; break; } } if (found) { tifiles_ve_delete(child->data); g_node_destroy(child); } if (fe && found) { fe->size--; } } libticalcs-1.1.9+dfsg/src/dusb_cmd.c000066400000000000000000001313241327711501700172750ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: cmd84p.c 2077 2006-03-31 21:16:19Z roms $ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This unit handles virtual packet types (commands) thru DirectLink. */ // Some functions should be renamed or re-organized... #include #include #include #include "ticalcs.h" #include "internal.h" #include "logging.h" #include "error.h" #include "dusb_vpkt.h" #include "dusb_cmd.h" // Type to string typedef struct { uint16_t id; const char *name; } DUSBCmdParamInfo; static const DUSBCmdParamInfo param_types[] = { { 0x0000, "" }, { DUSB_PID_PRODUCT_NUMBER, "Product number" }, { DUSB_PID_PRODUCT_NAME, "Product name" }, { DUSB_PID_MAIN_PART_ID, "Main part ID" }, { DUSB_PID_HW_VERSION, "Hardware version" }, { DUSB_PID_FULL_ID, "Full ID" }, { DUSB_PID_LANGUAGE_ID, "Language ID" }, { DUSB_PID_SUBLANG_ID, "Sub-language ID" }, { DUSB_PID_DEVICE_TYPE, "Device type" }, { DUSB_PID_BOOT_VERSION, "Boot version" }, { DUSB_PID_OS_MODE, "OS mode" }, { DUSB_PID_OS_VERSION, "OS version" }, { DUSB_PID_PHYS_RAM, "Physical RAM" }, { DUSB_PID_USER_RAM, "User RAM" }, { DUSB_PID_FREE_RAM, "Free RAM" }, { DUSB_PID_PHYS_FLASH, "Physical Flash" }, { DUSB_PID_USER_FLASH, "User Flash" }, { DUSB_PID_FREE_FLASH, "Free Flash" }, { DUSB_PID_USER_PAGES, "User pages" }, { DUSB_PID_FREE_PAGES, "Free pages" }, // 0x0013 { DUSB_PID_HAS_SCREEN, "Has screen" }, // 0x0019 { DUSB_PID_COLOR_AVAILABLE, "Color is available" }, // 0x001B { DUSB_PID_BITS_PER_PIXEL, "Bits per pixel" }, // 0x001D { DUSB_PID_LCD_WIDTH, "LCD width" }, { DUSB_PID_LCD_HEIGHT, "LCD height" }, // 0x001F { DUSB_PID_SCREENSHOT, "Screenshot" }, // 0x0022 { DUSB_PID_CLASSIC_CLK_SUPPORT, "Classic clock supported" }, { DUSB_PID_CLK_ON, "Clock ON" }, { DUSB_PID_CLK_SEC_SINCE_1997, "Clock sec since 1997" }, // 0x0025 { DUSB_PID_CLK_DATE_FMT, "Clock date format" }, // 0x0027 { DUSB_PID_CLK_TIME_FMT, "Clock time format" }, // 0x0028 { DUSB_PID_BATTERY, "Battery level" }, // 0x002D { DUSB_PID_USER_DATA_1, "User data area 1" }, // 0x0030 { DUSB_PID_FLASHAPPS, "FlashApps" }, // 0x0031 { DUSB_PID_USER_DATA_2, "User data area 2" }, // 0x0035 { DUSB_PID_MAIN_PART_ID_STRING, "Main part ID (as string)" }, // 0x0036 { DUSB_PID_HOMESCREEN, "Home screen" }, { DUSB_PID_BUSY, "Busy" }, { DUSB_PID_SCREEN_SPLIT, "Screen split mode" }, // 0x0039 { DUSB_PID_NEW_CLK_SUPPORT, "New clock supported" }, { DUSB_PID_CLK_SECONDS, "Clock seconds" }, { DUSB_PID_CLK_MINUTES, "Clock minutes" }, { DUSB_PID_CLK_HOURS, "Clock hours" }, { DUSB_PID_CLK_DAY, "Clock day" }, { DUSB_PID_CLK_MONTH, "Clock month" }, { DUSB_PID_CLK_YEAR, "Clock year" }, // 0x0040 { DUSB_PID_ANS, "Ans contents" }, // 0x0046 { DUSB_PID_OS_BUILD_NUMBER, "OS build number" }, // 0x0048 { DUSB_PID_BOOT_BUILD_NUMBER, "Boot build number" }, // 0x0049 { DUSB_PID_EXACT_MATH, "Exact math engine" }, // 0x004B { DUSB_PID_BOOT_HASH, "Boot hash" }, // 0x004C { DUSB_PID_OS_HASH, "OS hash" }, // 0x004D { DUSB_PID_PTT_MODE_SET, "PTT mode set" }, // 0x004F { DUSB_PID_OS_VERSION_STRING, "OS version (as string)" }, // 0x0052 { DUSB_PID_BOOT_VERSION_STRING, "Boot version (as string)" }, // 0x0053 { DUSB_PID_PTT_MODE_STATE, "PTT mode state" }, // 0x0054 { DUSB_PID_PTT_MODE_FEATURES, "PTT mode features" }, // 0x0055 { DUSB_PID_STOPWATCH_START, "Stopwatch start" }, // 0x0059 { DUSB_PID_STOPWATCH_VALUE1, "Stopwatch value 1" }, // 0x005B { DUSB_PID_STOPWATCH_VALUE2, "Stopwatch value 2" }, // 0x005C { -1, NULL} }; TIEXPORT3 const char* TICALL dusb_cmd_param_type2name(uint16_t id) { const DUSBCmdParamInfo *p; for (p = param_types; p->name != NULL; p++) { if (p->id == id) { return p->name; } } return "unknown: not listed"; } // Helpers TIEXPORT3 DUSBCalcParam* TICALL dusb_cp_new(CalcHandle * handle, uint16_t id, uint16_t size) { return dusb_cp_new_ex(handle, id, size, g_malloc0(size)); // aborts the program if it fails. } TIEXPORT3 DUSBCalcParam* TICALL dusb_cp_new_ex(CalcHandle * handle, uint16_t id, uint16_t size, uint8_t * data) { DUSBCalcParam* cp = NULL; if (ticalcs_validate_handle(handle)) { GList * cpca_list; cp = g_malloc0(sizeof(DUSBCalcParam)); // aborts the program if it fails. cp->id = id; cp->size = size; cp->data = data; cpca_list = g_list_append((GList *)(handle->priv.dusb_cpca_list), cp); handle->priv.dusb_cpca_list = (void *)cpca_list; } else { ticalcs_critical("%s: handle is invalid", __FUNCTION__); } return cp; } TIEXPORT3 void TICALL dusb_cp_fill(DUSBCalcParam * cp, uint16_t id, uint16_t size, uint8_t * data) { if (cp != NULL) { cp->id = id; cp->ok = 0; cp->size = size; cp->data = data; } else { ticalcs_critical("%s: cp is NULL", __FUNCTION__); } } TIEXPORT3 void TICALL dusb_cp_del(CalcHandle * handle, DUSBCalcParam* cp) { GList *cpca_list; if (!ticalcs_validate_handle(handle)) { ticalcs_critical("%s: handle is invalid", __FUNCTION__); return; } if (cp == NULL) { ticalcs_critical("%s: cp is NULL", __FUNCTION__); return; } cpca_list = g_list_remove((GList *)(handle->priv.dusb_cpca_list), cp); handle->priv.dusb_cpca_list = (void *)cpca_list; g_free(cp->data); g_free(cp); } TIEXPORT3 DUSBCalcParam ** TICALL dusb_cp_new_array(CalcHandle * handle, unsigned int size) { DUSBCalcParam ** array = NULL; if (ticalcs_validate_handle(handle)) { array = g_malloc0((size+1) * sizeof(DUSBCalcParam *)); // aborts the program if it fails. } else { ticalcs_critical("%s: handle is invalid", __FUNCTION__); } return array; } TIEXPORT3 void TICALL dusb_cp_del_array(CalcHandle * handle, unsigned int size, DUSBCalcParam **params) { unsigned int i; if (!ticalcs_validate_handle(handle)) { ticalcs_critical("%s: handle is invalid", __FUNCTION__); return; } if (params == NULL) { ticalcs_critical("%s: params is NULL", __FUNCTION__); return; } for (i = 0; i < size && params[i]; i++) { dusb_cp_del(handle, params[i]); } g_free(params); } TIEXPORT3 void * TICALL dusb_cp_alloc_data(uint16_t size) { return g_malloc0(size); } TIEXPORT3 DUSBCalcParam * TICALL dusb_cp_realloc_data(DUSBCalcParam* cp, uint16_t size) { if (cp != NULL) { uint8_t * data = g_realloc(cp->data, size); if (size > cp->size) { memset(data + cp->size, 0x00, size - cp->size); } cp->data = data; } return cp; } TIEXPORT3 void TICALL dusb_cp_free_data(void * data) { return g_free(data); } /////////////---------------- TIEXPORT3 DUSBCalcAttr* TICALL dusb_ca_new(CalcHandle * handle, uint16_t id, uint16_t size) { return dusb_ca_new_ex(handle, id, size, g_malloc0(size)); // aborts the program if it fails. } TIEXPORT3 DUSBCalcAttr* TICALL dusb_ca_new_ex(CalcHandle * handle, uint16_t id, uint16_t size, uint8_t * data) { DUSBCalcAttr* ca = NULL; if (ticalcs_validate_handle(handle)) { GList * cpca_list; ca = g_malloc0(sizeof(DUSBCalcAttr)); // aborts the program if it fails. ca->id = id; ca->size = size; ca->data = data; cpca_list = g_list_append((GList *)(handle->priv.dusb_cpca_list), ca); handle->priv.dusb_cpca_list = (void *)cpca_list; } else { ticalcs_critical("%s: handle is invalid", __FUNCTION__); } return ca; } TIEXPORT3 void TICALL dusb_ca_fill(DUSBCalcAttr * ca, uint16_t id, uint16_t size, uint8_t * data) { if (ca != NULL) { ca->id = id; ca->ok = 0; ca->size = size; ca->data = data; } else { ticalcs_critical("%s: ca is NULL", __FUNCTION__); } } TIEXPORT3 void TICALL dusb_ca_del(CalcHandle * handle, DUSBCalcAttr* ca) { GList *cpca_list; if (!ticalcs_validate_handle(handle)) { ticalcs_critical("%s: handle is invalid", __FUNCTION__); return; } if (ca == NULL) { ticalcs_critical("%s: ca is NULL", __FUNCTION__); return; } cpca_list = g_list_remove((GList *)(handle->priv.dusb_cpca_list), ca); handle->priv.dusb_cpca_list = (void *)cpca_list; g_free(ca->data); g_free(ca); } TIEXPORT3 DUSBCalcAttr ** TICALL dusb_ca_new_array(CalcHandle * handle, unsigned int size) { DUSBCalcAttr ** array = NULL; if (ticalcs_validate_handle(handle)) { array = g_malloc0((size+1) * sizeof(DUSBCalcAttr *)); // aborts the program if it fails. } else { ticalcs_critical("%s: handle is invalid", __FUNCTION__); } return array; } TIEXPORT3 void TICALL dusb_ca_del_array(CalcHandle * handle, unsigned int size, DUSBCalcAttr **attrs) { unsigned int i; if (!ticalcs_validate_handle(handle)) { ticalcs_critical("%s: handle is invalid", __FUNCTION__); return; } if (attrs == NULL) { ticalcs_critical("%s: attrs is NULL", __FUNCTION__); return; } for (i = 0; i < size && attrs[i]; i++) { dusb_ca_del(handle, attrs[i]); } g_free(attrs); } TIEXPORT3 void * TICALL dusb_ca_alloc_data(uint16_t size) { return g_malloc0(size); } TIEXPORT3 DUSBCalcParam * TICALL dusb_ca_realloc_data(DUSBCalcParam* ca, uint16_t size) { if (ca != NULL) { uint8_t * data = g_realloc(ca->data, size); if (size > ca->size) { memset(data + ca->size, 0x00, size - ca->size); } ca->data = data; } return ca; } TIEXPORT3 void TICALL dusb_ca_free_data(void * data) { return g_free(data); } /////////////---------------- static void byteswap(uint8_t *data, uint32_t len) { (void)data, (void)len; /* if(len == 2) { uint8_t tmp; tmp = data[0]; data[0] = data[1]; data[1] = tmp; } else if(len == 4) { uint8_t tmp; tmp = data[0]; data[0] = data[3]; data[3] = tmp; tmp = data[1]; data[1] = data[2]; data[2] = tmp; } */ } /////////////---------------- static const uint16_t usb_errors[] = { 0x0004, 0x0006, 0x0008, 0x0009, 0x000c, 0x000d, 0x000e, 0x0011, 0x0012, 0x001c, 0x001d, 0x0021, 0x0022, 0x0023, 0x0027, 0x0029, 0x002b, 0x002e, 0x0034 }; static int err_code(uint16_t code) { unsigned int i; for (i = 0; i < sizeof(usb_errors) / sizeof(usb_errors[0]); i++) { if (usb_errors[i] == code) { return i + 1; } } ticalcs_warning("USB error code 0x%02x not found in list. Please report it at .", code); return 0; } static int err_code_pkt(DUSBVirtualPacket *pkt) { return err_code((((uint16_t)pkt->data[0]) << 8) | pkt->data[1]); } /////////////---------------- int dusb_check_cmd_data(CalcModel model, const uint8_t * data, uint32_t len, uint32_t vtl_size, uint16_t vtl_type) { int ret = ERR_INVALID_PACKET; (void)vtl_size; switch (vtl_type) { case DUSB_VPKT_PING: { if (len == 10U) { ret = 0; } } break; case DUSB_VPKT_PARM_REQ: { if (len >= 2U) { uint16_t npids = (((uint16_t)(data[0])) << 8) | ((uint16_t)(data[1])); if (len == 2U + npids * 2) { ret = 0; } // else do nothing. } // else do nothing. } break; case DUSB_VPKT_PARM_DATA: { if (len >= 2U) { uint16_t nparams = (((uint16_t)(data[0])) << 8) | ((uint16_t)(data[1])); data += 2; if (len >= 2U + 3 * nparams) { uint16_t i; uint32_t additional_size = 0; int overrun = 0; for (i = 0; i < nparams; i++) { uint8_t ok = !(data[2]); data += 3; if (ok) { uint16_t size = (((uint16_t)(data[0])) << 8) | ((uint16_t)(data[1])); data += size + 2; additional_size += size + 2; } if (len < 2U + 3 * nparams + additional_size) { overrun = 1; break; } // else do nothing. } if (!overrun && len == 2U + 3 * nparams + additional_size) { ret = 0; } // else do nothing. } // else do nothing. } // else do nothing. } break; case DUSB_VPKT_PARM_SET: { if (len > 4U) { uint16_t size = (((uint16_t)(data[2])) << 8) | ((uint16_t)(data[3])); if (len == 4U + size) { ret = 0; } // else do nothing. } // else do nothing. } break; case DUSB_VPKT_OS_BEGIN: { if (len == 11U) { ret = 0; } } break; case DUSB_VPKT_OS_ACK: { if (len >= 4U) { ret = 0; } } break; case DUSB_VPKT_OS_HEADER: case DUSB_VPKT_OS_DATA: { if (model == CALC_TI89T_USB) { if (len > 0U) { ret = 0; } } else { if (len > 4U) { ret = 0; } } } break; case DUSB_VPKT_DELAY_ACK: { if (len == 4U) { ret = 0; } } break; case DUSB_VPKT_ERROR: { if (len == 2U) { ret = 0; } } break; // Nothing to do. case DUSB_VPKT_VAR_CNTS: case DUSB_VPKT_MODE_SET: case DUSB_VPKT_EOT_ACK: case DUSB_VPKT_DATA_ACK: case DUSB_VPKT_EOT: { ret = 0; } break; // TODO case DUSB_VPKT_DIR_REQ: case DUSB_VPKT_VAR_HDR: case DUSB_VPKT_RTS: case DUSB_VPKT_VAR_REQ: case DUSB_VPKT_MODIF_VAR: case DUSB_VPKT_EXECUTE: { ret = 0; } // Fall through for unknown vpkts, they're already marked invalid anyway. default: break; } if (ret) { ticalcs_critical("Validation failed for DUSB packet data of len=%lu, type=%04X", (unsigned long)len, vtl_type); } return ret; } int dusb_dissect_cmd_data(CalcModel model, FILE *f, const uint8_t * data, uint32_t len, uint32_t vtl_size, uint16_t vtl_type) { int ret = dusb_check_cmd_data(model, data, len, vtl_size, vtl_type); (void)vtl_size; if (ret) { return ret; } switch (vtl_type) { case DUSB_VPKT_PING: { uint16_t arg1 = (((uint16_t)(data[0])) << 8) | ((uint16_t)(data[1])); uint16_t arg2 = (((uint16_t)(data[2])) << 8) | ((uint16_t)(data[3])); uint16_t arg3 = (((uint16_t)(data[4])) << 8) | ((uint16_t)(data[5])); uint16_t arg4 = (((uint16_t)(data[6])) << 8) | ((uint16_t)(data[7])); uint16_t arg5 = (((uint16_t)(data[8])) << 8) | ((uint16_t)(data[9])); fprintf(f, "Set mode: { %u, %u, %u, %u, 0x%04X }\n", arg1, arg2, arg3, arg4, arg5); } break; case DUSB_VPKT_PARM_REQ: { uint16_t npids = (((uint16_t)(data[0])) << 8) | ((uint16_t)(data[1])); uint16_t i; if (len == 2U + npids * 2) { data += 2; fprintf(f, "Requested %u (%X) parameter IDs:\n", npids, npids); for (i = 0; i < npids; i++) { uint16_t pid = (((uint16_t)(data[0])) << 8) | ((uint16_t)(data[1])); data += 2; fprintf(f, "\t%04X (%s)\n", pid, dusb_cmd_param_type2name(pid)); } fputc('\n', f); } } break; case DUSB_VPKT_PARM_DATA: { uint16_t nparams = (((uint16_t)(data[0])) << 8) | ((uint16_t)(data[1])); uint16_t i; uint32_t additional_size = 0; if (len >= 2U + 3 * nparams) { data += 2; fprintf(f, "Received %u (%X) parameter values:\n", nparams, nparams); for (i = 0; i < nparams; i++) { uint16_t pid = (((uint16_t)(data[0])) << 8) | ((uint16_t)(data[1])); uint8_t ok; data += 2; ok = !(*data++); fprintf(f, "\t%04X (%s): ", pid, dusb_cmd_param_type2name(pid)); if (ok) { uint16_t j; uint16_t size = (((uint16_t)(data[0])) << 8) | ((uint16_t)(data[1])); data += 2; additional_size += size + 2; if (len < 2U + 3 * nparams + additional_size) { break; } fprintf(f, "OK, size %04X\n\t\t", size); for (j = 0; j < size;) { fprintf(f, "%02X ", *data++); if (!(++j & 15)) { fprintf(f, "\n\t\t"); } } fputc('\n', f); } else { fputs("NOK !\n", f); } } } // else do nothing. } break; case DUSB_VPKT_PARM_SET: { uint16_t id = (((uint16_t)(data[0])) << 8) | ((uint16_t)(data[1])); uint16_t size = (((uint16_t)(data[2])) << 8) | ((uint16_t)(data[3])); uint16_t i; data += 4; if (len == 4U + size) { fprintf(f, "Sending value of size %04X for parameter %04X\n\t", size, id); for (i = 0; i < size; i++) { fprintf(f, "%02X ", *data++); if (!(++i & 15)) { fprintf(f, "\n\t"); } } } // else do nothing. } break; case DUSB_VPKT_OS_BEGIN: { uint32_t size = (((uint32_t)data[7]) << 24) | (((uint32_t)data[8]) << 16) | (((uint32_t)data[9]) << 8) | (((uint32_t)data[10]) << 0); fprintf(f, "Size: %lu / %08lX\n", (unsigned long)size, (unsigned long)size); } break; case DUSB_VPKT_OS_ACK: { uint32_t size = (((uint32_t)data[0]) << 24) | (((uint32_t)data[1]) << 16) | (((uint32_t)data[2]) << 8) | (((uint32_t)data[3]) << 0); fprintf(f, "Chunk size: %lu / %08lX\n", (unsigned long)size, (unsigned long)size); } break; case DUSB_VPKT_OS_HEADER: case DUSB_VPKT_OS_DATA: { if (model == CALC_TI83PCE_USB || model == CALC_TI84PCE_USB) { uint32_t addr = (((uint32_t)data[3]) << 24) | (((uint32_t)data[2]) << 16) | (((uint32_t)data[1]) << 8) | (((uint32_t)data[0]) << 0); fprintf(f, "Address: %08lX\n", (unsigned long)addr); } else if (model != CALC_TI89T_USB) { uint16_t addr = (((uint16_t)data[0]) << 8) | (((uint32_t)data[1]) << 0); fprintf(f, "Address: %04X\tPage: %02X\tFlag: %02X\n", addr, data[2], data[3]); } // else do nothing. } break; case DUSB_VPKT_DELAY_ACK: { uint32_t delay = (((uint32_t)data[0]) << 24) | (((uint32_t)data[1]) << 16) | (((uint32_t)data[2]) << 8) | (data[3] << 0); fprintf(f, "Delay: %lu\n", (unsigned long)delay); } break; case DUSB_VPKT_ERROR: { int err = err_code((((uint16_t)data[0]) << 8) | (((uint32_t)data[1]) << 0)); fprintf(f, "Error code: %u (%04X)\n", err, err); } break; // Nothing to do. case DUSB_VPKT_VAR_CNTS: case DUSB_VPKT_MODE_SET: case DUSB_VPKT_EOT_ACK: case DUSB_VPKT_DATA_ACK: case DUSB_VPKT_EOT: break; // TODO case DUSB_VPKT_DIR_REQ: case DUSB_VPKT_VAR_HDR: case DUSB_VPKT_RTS: case DUSB_VPKT_VAR_REQ: case DUSB_VPKT_MODIF_VAR: case DUSB_VPKT_EXECUTE: { fputs("(no extra dissection performed for now)\n", f); } break; default: { fputs("(not performing extra dissection on unknown vpkt type)\n", f); } break; } return ret; } /////////////---------------- #define CATCH_DELAY() CATCH_DELAY_VARSIZE(NULL, 0) #define CATCH_DELAY_VARSIZE(ds, es) \ if (pkt->type == DUSB_VPKT_DELAY_ACK) \ { \ uint32_t delay = (((uint32_t)pkt->data[0]) << 24) | (((uint32_t)pkt->data[1]) << 16) | (((uint32_t)pkt->data[2]) << 8) | (pkt->data[3] << 0); \ ticalcs_info(" delay = %u", delay); \ if (delay > 400000) \ { \ delay = 400000; \ ticalcs_info(" (absurdly high delay, clamping to a more reasonable value)"); \ } \ \ PAUSE(delay/1000); \ \ dusb_vtl_pkt_del(handle, pkt); \ pkt = dusb_vtl_pkt_new_ex(handle, 0, 0, NULL); \ \ retval = (ds == NULL ? dusb_recv_data(handle, pkt) : dusb_recv_data_varsize(handle, pkt, ds, es)); \ if (retval) \ { \ goto end; \ } \ } // 0x0001: set mode or ping TIEXPORT3 int TICALL dusb_cmd_s_mode_set(CalcHandle *handle, const DUSBModeSet mode) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); retval = dusb_send_buf_size_request(handle, DUSB_DFL_BUF_SIZE); if (!retval) { retval = dusb_recv_buf_size_alloc(handle, NULL); if (!retval) { pkt = dusb_vtl_pkt_new_ex(handle, sizeof(mode), DUSB_VPKT_PING, dusb_vtl_pkt_alloc_data(sizeof(mode))); pkt->data[0] = MSB(mode.arg1); pkt->data[1] = LSB(mode.arg1); pkt->data[2] = MSB(mode.arg2); pkt->data[3] = LSB(mode.arg2); pkt->data[4] = MSB(mode.arg3); pkt->data[5] = LSB(mode.arg3); pkt->data[6] = MSB(mode.arg4); pkt->data[7] = LSB(mode.arg4); pkt->data[8] = MSB(mode.arg5); pkt->data[9] = LSB(mode.arg5); retval = dusb_send_data(handle, pkt); dusb_vtl_pkt_del(handle, pkt); ticalcs_info(" %04x %04x %04x %04x %04x", mode.arg1, mode.arg2, mode.arg3, mode.arg4, mode.arg5); } } return retval; } // 0x0002: begin OS transfer TIEXPORT3 int TICALL dusb_cmd_s_os_begin(CalcHandle *handle, uint32_t size) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = dusb_vtl_pkt_new_ex(handle, 11, DUSB_VPKT_OS_BEGIN, dusb_vtl_pkt_alloc_data(11)); pkt->data[7] = MSB(MSW(size)); pkt->data[8] = LSB(MSW(size)); pkt->data[9] = MSB(LSW(size)); pkt->data[10]= LSB(LSW(size)); retval = dusb_send_data(handle, pkt); dusb_vtl_pkt_del(handle, pkt); ticalcs_info(" size = %08x (%i)", size, size); return retval; } // 0x0003: acknowledgement of OS transfer TIEXPORT3 int TICALL dusb_cmd_r_os_ack(CalcHandle *handle, uint32_t *size) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = dusb_vtl_pkt_new_ex(handle, 0, 0, NULL); retval = dusb_recv_data(handle, pkt); if (!retval) { CATCH_DELAY(); if (pkt->type == DUSB_VPKT_ERROR) { retval = ERR_CALC_ERROR2 + err_code_pkt(pkt); goto end; } else if (pkt->type != DUSB_VPKT_OS_ACK) { retval = ERR_INVALID_PACKET; goto end; } if (size != NULL) { *size = (((uint32_t)pkt->data[0]) << 24) | (((uint32_t)pkt->data[1]) << 16) | (((uint32_t)pkt->data[2]) << 8) | (((uint32_t)pkt->data[3]) << 0); ticalcs_info(" chunk size = %08x (%i)", *size, *size); } } end: dusb_vtl_pkt_del(handle, pkt); return retval; } static int s_os(uint8_t type, CalcHandle *handle, uint16_t addr, uint8_t page, uint8_t flag, uint32_t size, uint8_t *data) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(data); pkt = dusb_vtl_pkt_new_ex(handle, 4 + size, type, dusb_vtl_pkt_alloc_data(4 + size)); pkt->data[0] = MSB(addr); pkt->data[1] = LSB(addr); pkt->data[2] = page; pkt->data[3] = flag; memcpy(pkt->data+4, data, size); retval = dusb_send_data(handle, pkt); dusb_vtl_pkt_del(handle, pkt); ticalcs_info(" addr=%04x, page=%02x, flag=%02x, size=%04x", addr, page, flag, size); return retval; } // 0x0004: OS header TIEXPORT3 int TICALL dusb_cmd_s_os_header(CalcHandle *handle, uint16_t addr, uint8_t page, uint8_t flag, uint32_t size, uint8_t *data) { return s_os(DUSB_VPKT_OS_HEADER, handle, addr, page, flag, size, data); } // 0x0005: OS data TIEXPORT3 int TICALL dusb_cmd_s_os_data(CalcHandle *handle, uint16_t addr, uint8_t page, uint8_t flag, uint32_t size, uint8_t *data) { return s_os(DUSB_VPKT_OS_DATA, handle, addr, page, flag, size, data); } // 0x0004: OS header TIEXPORT3 int TICALL dusb_cmd_s_os_header_89(CalcHandle *handle, uint32_t size, uint8_t *data) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(data); pkt = dusb_vtl_pkt_new_ex(handle, size, DUSB_VPKT_OS_HEADER, dusb_vtl_pkt_alloc_data(size)); memcpy(pkt->data, data, size); retval = dusb_send_data(handle, pkt); dusb_vtl_pkt_del(handle, pkt); ticalcs_info(" size = %08x (%i)", size, size); return retval; } // 0x0005: OS data TIEXPORT3 int TICALL dusb_cmd_s_os_data_89(CalcHandle *handle, uint32_t size, uint8_t *data) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(data); pkt = dusb_vtl_pkt_new_ex(handle, size, DUSB_VPKT_OS_DATA, dusb_vtl_pkt_alloc_data(size)); memcpy(pkt->data, data, size); retval = dusb_send_data(handle, pkt); dusb_vtl_pkt_del(handle, pkt); ticalcs_info(" size = %08x (%i)", size, size); return retval; } // 0x0005: OS data TIEXPORT3 int TICALL dusb_cmd_s_os_data_834pce(CalcHandle *handle, uint32_t addr, uint32_t size, uint8_t *data) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(data); pkt = dusb_vtl_pkt_new_ex(handle, 4 + size, DUSB_VPKT_OS_DATA, dusb_vtl_pkt_alloc_data(4 + size)); pkt->data[0] = (addr ) & 0xFF; pkt->data[1] = (addr >> 8) & 0xFF; pkt->data[2] = (addr >> 16) & 0xFF; pkt->data[3] = (addr >> 24) & 0xFF; memcpy(pkt->data+4, data, size); retval = dusb_send_data(handle, pkt); dusb_vtl_pkt_del(handle, pkt); ticalcs_info(" addr=%08x, size=%04x", addr, size); return retval; } // 0x0006: acknowledgement of EOT TIEXPORT3 int TICALL dusb_cmd_r_eot_ack(CalcHandle *handle) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = dusb_vtl_pkt_new_ex(handle, 0, 0, NULL); retval = dusb_recv_data(handle, pkt); if (!retval) { CATCH_DELAY(); if (pkt->type == DUSB_VPKT_ERROR) { retval = ERR_CALC_ERROR2 + err_code_pkt(pkt); } else if (pkt->type != DUSB_VPKT_EOT_ACK) { retval = ERR_INVALID_PACKET; } } end: dusb_vtl_pkt_del(handle, pkt); return retval; } // 0x0007: parameter request TIEXPORT3 int TICALL dusb_cmd_s_param_request(CalcHandle *handle, unsigned int npids, const uint16_t *pids) { DUSBVirtualPacket* pkt; unsigned int i; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_ATTRS(npids, pids); pkt = dusb_vtl_pkt_new_ex(handle, 2 + npids * sizeof(uint16_t), DUSB_VPKT_PARM_REQ, dusb_vtl_pkt_alloc_data(2 + npids * sizeof(uint16_t))); pkt->data[0] = MSB(npids); pkt->data[1] = LSB(npids); for (i = 0; i < npids; i++) { pkt->data[2*(i+1) + 0] = MSB(pids[i]); pkt->data[2*(i+1) + 1] = LSB(pids[i]); } retval = dusb_send_data(handle, pkt); dusb_vtl_pkt_del(handle, pkt); ticalcs_info(" npids=%i", npids); return retval; } // 0x0008: parameter data TIEXPORT3 int TICALL dusb_cmd_r_param_data(CalcHandle *handle, unsigned int nparams, DUSBCalcParam **params) { DUSBVirtualPacket* pkt; unsigned int i, j; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(params); pkt = dusb_vtl_pkt_new_ex(handle, 0, 0, NULL); retval = dusb_recv_data(handle, pkt); if (!retval) { CATCH_DELAY(); if (pkt->type == DUSB_VPKT_ERROR) { retval = ERR_CALC_ERROR2 + err_code_pkt(pkt); goto end; } else if (pkt->type != DUSB_VPKT_PARM_DATA) { retval = ERR_INVALID_PACKET; goto end; } if (((((unsigned int)pkt->data[0]) << 8) | pkt->data[1]) != nparams) { retval = ERR_INVALID_PACKET; goto end; } for (i = 0, j = 2; i < nparams; i++) { DUSBCalcParam *s = dusb_cp_new(handle, 0, 0); if (s != NULL) { s->id = ((uint16_t)pkt->data[j++]) << 8; s->id |= pkt->data[j++]; s->ok = !pkt->data[j++]; if (s->ok) { s->size = ((uint16_t)pkt->data[j++]) << 8; s->size |= pkt->data[j++]; if (s->size > 0) { s->data = (uint8_t *)g_malloc0(s->size); if (s->data != NULL) { memcpy(s->data, &pkt->data[j], s->size); } else { retval = ERR_MALLOC; break; } j += s->size; } } params[i] = s; } else { retval = ERR_MALLOC; break; } } } end: dusb_vtl_pkt_del(handle, pkt); ticalcs_info(" nparams=%i", nparams); return retval; } // 0x0008 (variant): screenshot data (for TI-84 Plus C support) TIEXPORT3 int TICALL dusb_cmd_r_screenshot(CalcHandle *handle, uint32_t *size, uint8_t **data) { DUSBVirtualPacket* pkt; uint32_t declared_size; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(size); VALIDATE_NONNULL(data); pkt = dusb_vtl_pkt_new_ex(handle, 0, 0, NULL); retval = dusb_recv_data_varsize(handle, pkt, &declared_size, 153600); if (!retval) { CATCH_DELAY_VARSIZE(&declared_size, 153600); if (pkt->type == DUSB_VPKT_ERROR) { retval = ERR_CALC_ERROR2 + err_code_pkt(pkt); goto end; } else if (pkt->type != DUSB_VPKT_PARM_DATA) { retval = ERR_INVALID_PACKET; goto end; } if ( ((((uint16_t)pkt->data[0]) << 8) | pkt->data[1]) != 1 || ((((uint16_t)pkt->data[2]) << 8) | pkt->data[3]) != DUSB_PID_SCREENSHOT || pkt->data[4] != 0) { retval = ERR_INVALID_PACKET; goto end; } *size = pkt->size - 7; *data = g_memdup(pkt->data + 7, pkt->size - 7); } end: dusb_vtl_pkt_del(handle, pkt); return retval; } // 0x0009: request directory listing TIEXPORT3 int TICALL dusb_cmd_s_dirlist_request(CalcHandle *handle, unsigned int naids, const uint16_t *aids) { DUSBVirtualPacket* pkt; unsigned int i; unsigned int j = 0; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_ATTRS(naids, aids); pkt = dusb_vtl_pkt_new_ex(handle, 4 + 2 * naids + 7, DUSB_VPKT_DIR_REQ, dusb_vtl_pkt_alloc_data(4 + 2 * naids + 7)); pkt->data[j++] = MSB(MSW(naids)); pkt->data[j++] = LSB(MSW(naids)); pkt->data[j++] = MSB(LSW(naids)); pkt->data[j++] = LSB(LSW(naids)); for (i = 0; i < naids; i++) { pkt->data[j++] = MSB(aids[i]); pkt->data[j++] = LSB(aids[i]); } pkt->data[j++] = 0x00; pkt->data[j++] = 0x01; pkt->data[j++] = 0x00; pkt->data[j++] = 0x01; pkt->data[j++] = 0x00; pkt->data[j++] = 0x01; pkt->data[j++] = 0x01; retval = dusb_send_data(handle, pkt); dusb_vtl_pkt_del(handle, pkt); ticalcs_info(" naids=%i", naids); return retval; } // 0x000A: variable header (name is utf-8) // beware: attr array contents is allocated by function TIEXPORT3 int TICALL dusb_cmd_r_var_header(CalcHandle *handle, char *folder, char *name, DUSBCalcAttr **attr) { DUSBVirtualPacket* pkt; uint8_t fld_len; uint8_t var_len; int nattr; int i, j; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(folder); VALIDATE_NONNULL(name); VALIDATE_NONNULL(attr); folder[0] = 0; name[0] = 0; pkt = dusb_vtl_pkt_new_ex(handle, 0, 0, NULL); retval = dusb_recv_data(handle, pkt); if (!retval) { CATCH_DELAY(); if (pkt->type == DUSB_VPKT_EOT) { retval = ERR_EOT; goto end; } else if (pkt->type == DUSB_VPKT_ERROR) { retval = ERR_CALC_ERROR2 + err_code_pkt(pkt); goto end; } else if (pkt->type != DUSB_VPKT_VAR_HDR) { retval = ERR_INVALID_PACKET; goto end; } j = 0; fld_len = pkt->data[j++]; if (fld_len) { memcpy(folder, &pkt->data[j], fld_len + 1); j += fld_len+1; } var_len = pkt->data[j++]; if (var_len) { memcpy(name, &pkt->data[j], var_len + 1); j += var_len+1; } nattr = (((int)pkt->data[j + 0]) << 8) | pkt->data[j + 1]; j += 2; for (i = 0; i < nattr; i++) { DUSBCalcAttr *s = attr[i] = dusb_ca_new(handle, 0, 0); s->id = ((uint16_t)pkt->data[j++]) << 8; s->id |= pkt->data[j++]; s->ok = !pkt->data[j++]; if (s->ok) { s->size = ((uint16_t)pkt->data[j++]) << 8; s->size |= pkt->data[j++]; s->data = (uint8_t *)g_malloc0(s->size); memcpy(s->data, &pkt->data[j], s->size); j += s->size; } } } end: dusb_vtl_pkt_del(handle, pkt); ticalcs_info(" folder=%s, name=%s", folder, name); return retval; } // 0x000B: request to send static int dusb_cmd_s_rts2(CalcHandle *handle, const char *folder, const char *name, uint32_t size, unsigned int nattrs, const DUSBCalcAttr **attrs, int modeflag) { DUSBVirtualPacket* pkt; int pks; unsigned int i; unsigned int j = 0; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(folder); VALIDATE_NONNULL(name); VALIDATE_ATTRS(nattrs, attrs); pks = 2 + strlen(name) + 1 + 5 + 2; if (strlen(folder)) { pks += strlen(folder)+1; } for (i = 0; i < nattrs; i++) { pks += 4 + attrs[i]->size; } pkt = dusb_vtl_pkt_new_ex(handle, pks, DUSB_VPKT_RTS, dusb_vtl_pkt_alloc_data(pks)); if (strlen(folder)) { pkt->data[j++] = strlen(folder); memcpy(pkt->data + j, folder, strlen(folder)+1); j += strlen(folder)+1; } else { pkt->data[j++] = 0; } pkt->data[j++] = strlen(name); memcpy(pkt->data + j, name, strlen(name)+1); j += strlen(name)+1; pkt->data[j++] = MSB(MSW(size)); pkt->data[j++] = LSB(MSW(size)); pkt->data[j++] = MSB(LSW(size)); pkt->data[j++] = LSB(LSW(size)); pkt->data[j++] = modeflag; pkt->data[j++] = MSB(nattrs); pkt->data[j++] = LSB(nattrs); for (i = 0; i < nattrs; i++) { pkt->data[j++] = MSB(attrs[i]->id); pkt->data[j++] = LSB(attrs[i]->id); pkt->data[j++] = MSB(attrs[i]->size); pkt->data[j++] = LSB(attrs[i]->size); memcpy(pkt->data + j, attrs[i]->data, attrs[i]->size); byteswap(pkt->data + j, attrs[i]->size); j += attrs[i]->size; } retval = dusb_send_data(handle, pkt); dusb_vtl_pkt_del(handle, pkt); ticalcs_info(" folder=%s, name=%s, size=%i, nattrs=%i", folder, name, size, nattrs); return retval; } // 0x000B: request to send ("silent") TIEXPORT3 int TICALL dusb_cmd_s_rts(CalcHandle *handle, const char *folder, const char *name, uint32_t size, unsigned int nattrs, const DUSBCalcAttr **attrs) { return dusb_cmd_s_rts2(handle, folder, name, size, nattrs, attrs, 0x01); } // 0x000B: request to send ("non-silent") TIEXPORT3 int TICALL dusb_cmd_s_rts_ns(CalcHandle *handle, const char *folder, const char *name, uint32_t size, unsigned int nattrs, const DUSBCalcAttr **attrs) { return dusb_cmd_s_rts2(handle, folder, name, size, nattrs, attrs, 0x02); } // 0x000C: variable request TIEXPORT3 int TICALL dusb_cmd_s_var_request(CalcHandle *handle, const char *folder, const char *name, unsigned int naids, const uint16_t *aids, unsigned int nattrs, const DUSBCalcAttr **attrs) { DUSBVirtualPacket* pkt; int pks; unsigned int i; unsigned int j = 0; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(folder); VALIDATE_NONNULL(name); VALIDATE_ATTRS(naids, aids); VALIDATE_ATTRS(nattrs, attrs); pks = 2 + strlen(name) + 1 + 5 + 2 + 2 * naids + 2; if (strlen(folder)) { pks += strlen(folder)+1; } for (i = 0; i < nattrs; i++) { pks += 4 + attrs[i]->size; } pks += 2; pkt = dusb_vtl_pkt_new_ex(handle, pks, DUSB_VPKT_VAR_REQ, dusb_vtl_pkt_alloc_data(pks)); if (strlen(folder)) { pkt->data[j++] = strlen(folder); memcpy(pkt->data + j, folder, strlen(folder)+1); j += strlen(folder)+1; } else { pkt->data[j++] = 0; } pkt->data[j++] = strlen(name); memcpy(pkt->data + j, name, strlen(name)+1); j += strlen(name)+1; pkt->data[j++] = 0x01; pkt->data[j++] = 0xFF; pkt->data[j++] = 0xFF; pkt->data[j++] = 0xFF; pkt->data[j++] = 0xFF; pkt->data[j++] = MSB(naids); pkt->data[j++] = LSB(naids); for (i = 0; i < naids; i++) { pkt->data[j++] = MSB(aids[i]); pkt->data[j++] = LSB(aids[i]); } pkt->data[j++] = MSB(nattrs); pkt->data[j++] = LSB(nattrs); for (i = 0; i < nattrs; i++) { pkt->data[j++] = MSB(attrs[i]->id); pkt->data[j++] = LSB(attrs[i]->id); pkt->data[j++] = MSB(attrs[i]->size); pkt->data[j++] = LSB(attrs[i]->size); memcpy(pkt->data + j, attrs[i]->data, attrs[i]->size); byteswap(pkt->data + j, attrs[i]->size); j += attrs[i]->size; } pkt->data[j++] = 0x00; pkt->data[j++] = 0x00; retval = dusb_send_data(handle, pkt); dusb_vtl_pkt_del(handle, pkt); ticalcs_info(" folder=%s, name=%s, naids=%i, nattrs=%i", folder, name, naids, nattrs); return retval; } // 0x000D: variable contents (recv) TIEXPORT3 int TICALL dusb_cmd_r_var_content(CalcHandle *handle, uint32_t *size, uint8_t **data) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(data); pkt = dusb_vtl_pkt_new_ex(handle, 0, 0, NULL); retval = dusb_recv_data(handle, pkt); if (!retval) { CATCH_DELAY(); if (pkt->type == DUSB_VPKT_ERROR) { retval = ERR_CALC_ERROR2 + err_code_pkt(pkt); goto end; } else if (pkt->type != DUSB_VPKT_VAR_CNTS) { retval = ERR_INVALID_PACKET; goto end; } if (size != NULL) { *size = pkt->size; } *data = g_malloc0(pkt->size); if (*data != NULL) { memcpy(*data, pkt->data, pkt->size); } else { retval = ERR_MALLOC; } ticalcs_info(" size=%i", pkt->size); } end: dusb_vtl_pkt_del(handle, pkt); return retval; } // 0x000D: variable contents (send) TIEXPORT3 int TICALL dusb_cmd_s_var_content(CalcHandle *handle, uint32_t size, uint8_t *data) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(data); pkt = dusb_vtl_pkt_new_ex(handle, size, DUSB_VPKT_VAR_CNTS, dusb_vtl_pkt_alloc_data(size)); memcpy(pkt->data, data, size); retval = dusb_send_data(handle, pkt); dusb_vtl_pkt_del(handle, pkt); ticalcs_info(" size=%i", size); return retval; } // 0x000E: parameter set TIEXPORT3 int TICALL dusb_cmd_s_param_set(CalcHandle *handle, const DUSBCalcParam *param) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(param); pkt = dusb_vtl_pkt_new_ex(handle, 2 + 2 + param->size, DUSB_VPKT_PARM_SET, dusb_vtl_pkt_alloc_data(2 + 2 + param->size)); pkt->data[0] = MSB(param->id); pkt->data[1] = LSB(param->id); pkt->data[2] = MSB(param->size); pkt->data[3] = LSB(param->size); memcpy(pkt->data + 4, param->data, param->size); retval = dusb_send_data(handle, pkt); dusb_vtl_pkt_del(handle, pkt); ticalcs_info(" pid=%04x, size=%04x", param->id, param->size); return retval; } // 0x0010: modify/rename/delete variable TIEXPORT3 int TICALL dusb_cmd_s_var_modify(CalcHandle *handle, const char *src_folder, const char *src_name, unsigned int n_src_attrs, const DUSBCalcAttr **src_attrs, const char *dst_folder, const char *dst_name, unsigned int n_dst_attrs, const DUSBCalcAttr **dst_attrs) { DUSBVirtualPacket* pkt; unsigned int i; unsigned int j = 0; unsigned int pks; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(src_folder); VALIDATE_NONNULL(src_name); VALIDATE_NONNULL(src_attrs); VALIDATE_NONNULL(dst_folder); VALIDATE_NONNULL(dst_name); VALIDATE_ATTRS(n_dst_attrs, dst_attrs); pks = 2 + strlen(src_name)+1 + 2; if (strlen(src_folder)) { pks += strlen(src_folder)+1; } for (i = 0; i < n_src_attrs; i++) { pks += 4 + src_attrs[i]->size; } pks += 5; if (strlen(dst_folder)) { pks += strlen(dst_folder)+1; } if (strlen(dst_name)) { pks += strlen(dst_name)+1; } for (i = 0; i < n_dst_attrs; i++) { pks += 4 + dst_attrs[i]->size; } pkt = dusb_vtl_pkt_new_ex(handle, pks, DUSB_VPKT_MODIF_VAR, dusb_vtl_pkt_alloc_data(pks)); if (strlen(src_folder)) { pkt->data[j++] = strlen(src_folder); memcpy(pkt->data + j, src_folder, strlen(src_folder)+1); j += strlen(src_folder)+1; } else { pkt->data[j++] = 0; } pkt->data[j++] = strlen(src_name); memcpy(pkt->data + j, src_name, strlen(src_name)+1); j += strlen(src_name)+1; pkt->data[j++] = MSB(n_src_attrs); pkt->data[j++] = LSB(n_src_attrs); for (i = 0; i < n_src_attrs; i++) { pkt->data[j++] = MSB(src_attrs[i]->id); pkt->data[j++] = LSB(src_attrs[i]->id); pkt->data[j++] = MSB(src_attrs[i]->size); pkt->data[j++] = LSB(src_attrs[i]->size); memcpy(pkt->data + j, src_attrs[i]->data, src_attrs[i]->size); j += src_attrs[i]->size; } pkt->data[j++] = 0x01; /* ??? */ if (strlen(dst_folder)) { pkt->data[j++] = strlen(dst_folder); memcpy(pkt->data + j, dst_folder, strlen(dst_folder)+1); j += strlen(dst_folder)+1; } else { pkt->data[j++] = 0; } if (strlen(dst_name)) { pkt->data[j++] = strlen(dst_name); memcpy(pkt->data + j, dst_name, strlen(dst_name)+1); j += strlen(dst_name)+1; } else { pkt->data[j++] = 0; } pkt->data[j++] = MSB(n_dst_attrs); pkt->data[j++] = LSB(n_dst_attrs); for (i = 0; i < n_dst_attrs; i++) { pkt->data[j++] = MSB(dst_attrs[i]->id); pkt->data[j++] = LSB(dst_attrs[i]->id); pkt->data[j++] = MSB(dst_attrs[i]->size); pkt->data[j++] = LSB(dst_attrs[i]->size); memcpy(pkt->data + j, dst_attrs[i]->data, dst_attrs[i]->size); j += dst_attrs[i]->size; } if (j == pks) { retval = dusb_send_data(handle, pkt); } else { // Really shouldn't occur. ticalcs_warning("Discrepancy in packet generation, not sending it"); retval = ERR_INVALID_PACKET; } ticalcs_info(" src_folder=%s, name=%s, nattrs=%i", src_folder, src_name, n_src_attrs); ticalcs_info(" dst_folder=%s, name=%s, nattrs=%i", dst_folder, dst_name, n_dst_attrs); dusb_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL dusb_cmd_s_var_delete(CalcHandle *handle, const char *folder, const char *name, unsigned int nattrs, const DUSBCalcAttr **attrs) { return dusb_cmd_s_var_modify(handle, folder, name, nattrs, attrs, "", "", 0, NULL); } // 0x0011: remote control TIEXPORT3 int TICALL dusb_cmd_s_execute(CalcHandle *handle, const char *folder, const char *name, uint8_t action, const char *args, uint16_t code) { DUSBVirtualPacket* pkt = NULL; int pks; int j = 0; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(folder); VALIDATE_NONNULL(name); pks = 3; if (handle->model == CALC_TI89T_USB && folder[0] != 0) { pks += strlen(folder) + 1; } if (name[0] != 0) { pks += strlen(name) + 1; } if (args) { pks += strlen(args); } if (action == DUSB_EID_KEY) { pks += 2; } pkt = dusb_vtl_pkt_new_ex(handle, pks, DUSB_VPKT_EXECUTE, dusb_vtl_pkt_alloc_data(pks)); pkt->data[j++] = strlen(folder); if (handle->model == CALC_TI89T_USB && folder[0] != 0) { memcpy(pkt->data + j, folder, strlen(folder) + 1); j += strlen(folder) + 1; } pkt->data[j++] = strlen(name); if (name[0] != 0) { memcpy(pkt->data + j, name, strlen(name) + 1); j += strlen(name) + 1; } pkt->data[j++] = action; if (args) { memcpy(pkt->data + j, args, strlen(args)); } if (action == DUSB_EID_KEY) { // TI-89T: big-endian // TI-84+, two-byte keycode: little-endian // (keyExtend first, kbdKey second) // TI-84+, one-byte keycode: either order works for Z80 OSes, // but big-endian is required by eZ80 if (handle->model == CALC_TI89T_USB || MSB(code) == 0) { pkt->data[j++] = MSB(code); pkt->data[j++] = LSB(code); } else { pkt->data[j++] = LSB(code); pkt->data[j++] = MSB(code); } } retval = dusb_send_data(handle, pkt); dusb_vtl_pkt_del(handle, pkt); if (action == DUSB_EID_KEY) { ticalcs_info(" action=%i, keycode=%04x", action, code); } else { ticalcs_info(" action=%i, folder=%s, name=%s, args=%s", action, folder, name, args ? args : "NULL"); } return retval; } // 0x0012: acknowledgement of mode setting TIEXPORT3 int TICALL dusb_cmd_r_mode_ack(CalcHandle *handle) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = dusb_vtl_pkt_new_ex(handle, 0, 0, NULL); retval = dusb_recv_data(handle, pkt); if (!retval) { CATCH_DELAY(); if (pkt->type == DUSB_VPKT_ERROR) { retval = ERR_CALC_ERROR2 + err_code_pkt(pkt); } else if (pkt->type != DUSB_VPKT_MODE_SET) { retval = ERR_INVALID_PACKET; } } end: dusb_vtl_pkt_del(handle, pkt); return retval; } // 0xAA00: acknowledgement of data TIEXPORT3 int TICALL dusb_cmd_r_data_ack(CalcHandle *handle) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = dusb_vtl_pkt_new_ex(handle, 0, 0, NULL); retval = dusb_recv_data(handle, pkt); if (!retval) { CATCH_DELAY(); if (pkt->type == DUSB_VPKT_ERROR) { retval = ERR_CALC_ERROR2 + err_code_pkt(pkt); } else if (pkt->type != DUSB_VPKT_DATA_ACK) { ticalcs_info("cmd_r_data_ack: expected type 0x%4X, received type 0x%4X", DUSB_VPKT_DATA_ACK, pkt->type); retval = ERR_INVALID_PACKET; } } end: dusb_vtl_pkt_del(handle, pkt); return retval; } // 0xBB00: delay acknowledgement TIEXPORT3 int TICALL dusb_cmd_r_delay_ack(CalcHandle *handle) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = dusb_vtl_pkt_new_ex(handle, 0, 0, NULL); retval = dusb_recv_data(handle, pkt); if (!retval) { if (pkt->type == DUSB_VPKT_ERROR) { retval = ERR_CALC_ERROR2 + err_code_pkt(pkt); } else if (pkt->type != DUSB_VPKT_DELAY_ACK) { ticalcs_info("cmd_r_data_ack: expected type 0x%4X, received type 0x%4X", DUSB_VPKT_DELAY_ACK, pkt->type); retval = ERR_INVALID_PACKET; } } PAUSE(100); dusb_vtl_pkt_del(handle, pkt); return retval; } // 0xDD00: end of transmission (send) TIEXPORT3 int TICALL dusb_cmd_s_eot(CalcHandle *handle) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = dusb_vtl_pkt_new_ex(handle, 0, DUSB_VPKT_EOT, NULL); retval = dusb_send_data(handle, pkt); dusb_vtl_pkt_del(handle, pkt); return retval; } // 0xDD00: end of transmission (recv) TIEXPORT3 int TICALL dusb_cmd_r_eot(CalcHandle *handle) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = dusb_vtl_pkt_new_ex(handle, 0, 0, NULL); retval = dusb_recv_data(handle, pkt); if (!retval) { CATCH_DELAY(); if (pkt->type == DUSB_VPKT_ERROR) { retval = ERR_CALC_ERROR2 + err_code_pkt(pkt); goto end; } else if (pkt->type != DUSB_VPKT_EOT) { retval = ERR_INVALID_PACKET; goto end; } } end: dusb_vtl_pkt_del(handle, pkt); return retval; } // 0xEE00: error TIEXPORT3 int TICALL dusb_cmd_s_error(CalcHandle *handle, uint16_t code) { DUSBVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = dusb_vtl_pkt_new_ex(handle, 2, DUSB_VPKT_ERROR, dusb_vtl_pkt_alloc_data(2)); pkt->data[0] = MSB(code); pkt->data[1] = LSB(code); retval = dusb_send_data(handle, pkt); dusb_vtl_pkt_del(handle, pkt); ticalcs_info(" code = %04x", code); return retval; } /////////////---------------- TIEXPORT3 int TICALL dusb_cmd_s_param_set_r_data_ack(CalcHandle *handle, uint16_t id, uint16_t size, const uint8_t * data) { DUSBCalcParam *param; int retval = 0; VALIDATE_HANDLE(handle); if (size > 0 && NULL == data) { return ERR_INVALID_PARAMETER; } param = dusb_cp_new(handle, id, size); if (NULL != data) { memcpy(param->data, data, size); } retval = dusb_cmd_s_param_set(handle, param); dusb_cp_del(handle, param); if (!retval) { retval = dusb_cmd_r_data_ack(handle); } return retval; } libticalcs-1.1.9+dfsg/src/dusb_cmd.h000066400000000000000000000437551327711501700173140ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: cmd84p.h 2074 2006-03-31 08:36:06Z roms $ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ // /!\ NOTE: for this file, backwards compatibility will not necessarily be maintained as strongly as it is for ticalcs.h ! #ifndef __DUSB_CMDS__ #define __DUSB_CMDS__ #ifdef __cplusplus extern "C" { #endif #define DUSB_DFL_BUF_SIZE 1024 // Parameter IDs #define DUSB_PID_PRODUCT_NUMBER 0x0001 #define DUSB_PID_PRODUCT_NAME 0x0002 #define DUSB_PID_MAIN_PART_ID 0x0003 #define DUSB_PID_HW_VERSION 0x0004 #define DUSB_PID_FULL_ID 0x0005 #define DUSB_PID_LANGUAGE_ID 0x0006 #define DUSB_PID_SUBLANG_ID 0x0007 #define DUSB_PID_DEVICE_TYPE 0x0008 #define DUSB_PID_BOOT_VERSION 0x0009 #define DUSB_PID_OS_MODE 0x000A #define DUSB_PID_OS_VERSION 0x000B #define DUSB_PID_PHYS_RAM 0x000C #define DUSB_PID_USER_RAM 0x000D #define DUSB_PID_FREE_RAM 0x000E #define DUSB_PID_PHYS_FLASH 0x000F #define DUSB_PID_USER_FLASH 0x0010 #define DUSB_PID_FREE_FLASH 0x0011 #define DUSB_PID_USER_PAGES 0x0012 #define DUSB_PID_FREE_PAGES 0x0013 // 0x0014-0x0018 (no access): 84+SE OS 2.43, 84+CSE OS 4.0, 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) and 89T AMS 3.10 refuse being requested these parameter IDs. #define DUSB_PID_HAS_SCREEN 0x0019 // 0x001A (read-only): 84+SE OS 2.43, 84+CSE OS 4.0 and 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) reply 00, 89T AMS 3.10 refuses being requested this parameter ID. #define DUSB_PID_COLOR_AVAILABLE 0x001B // 0x001C (read-only): 84+SE OS 2.43 replies 01, 84+CSE OS 4.0 and 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) reply 10, 89T AMS 3.10 refuses being requested this parameter ID. #define DUSB_PID_BITS_PER_PIXEL 0x001D #define DUSB_PID_LCD_WIDTH 0x001E #define DUSB_PID_LCD_HEIGHT 0x001F // 0x0020 (read-only): 84+SE OS 2.43 and 84+CSE OS 4.0 refuse being requested this parameter ID, 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) replies 00 C8, 89T AMS 3.10 replies 00 23. // 0x0021 (read-only): 84+SE OS 2.43 and 84+CSE OS 4.0 refuse being requested this parameter ID, 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) replies 00 C8, 89T AMS 3.10 replies 00 23. #define DUSB_PID_SCREENSHOT 0x0022 // 0x0023 (read-only): 84+SE OS 2.43, 84+CSE OS 4.0 and 89T AMS 3.10 reply 01; 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) refuses being requested this parameter ID. #define DUSB_PID_CLASSIC_CLK_SUPPORT 0x0023 #define DUSB_PID_CLK_ON 0x0024 #define DUSB_PID_CLK_SEC_SINCE_1997 0x0025 // 0x0026 (read-write): 84+SE OS 2.43 and 84+CSE OS 4.0 refuse being requested or set this parameter ID, 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) and 89T AMS 3.10 reply 00 00. #define DUSB_PID_CLK_DATE_FMT 0x0027 #define DUSB_PID_CLK_TIME_FMT 0x0028 // 0x0029 (read-only): 84+SE OS 2.43 replies 00, 84+CSE OS 4.0 and 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) reply 01, 89T AMS 3.10 refuses being requested this parameter ID. // 0x002A: 84+SE OS 2.43, 84+CSE OS 4.0, 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) and 89T AMS 3.10 refuse being requested this parameter ID. // 0x002B (read-write): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) replies initially 00. 84+SE OS 2.43, 84+CSE OS 4.0 and 89T AMS 3.10 refuse being requested or set this parameter ID. // 0x002C (read-only): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) replies 00. 84+SE OS 2.43, 84+CSE OS 4.0 and 89T AMS 3.10 refuse being requested this parameter ID. #define DUSB_PID_BATTERY 0x002D // 0x002E (read-only): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) replies 64, 89T AMS 3.10 replies 01, 84+SE OS 2.43 and 84+CSE OS 4.0 refuse being requested this parameter ID. // 0x002F (read-only): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) replies 01. 84+SE OS 2.43, 84+CSE OS 4.0 and 89T AMS 3.10 refuse being requested this parameter ID. // 0x0030 (read-write): 84+SE OS 2.43, 84+CSE OS 4.0 and 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) reply with 0x20 (32) bytes of data, initially all zeros. 89T AMS 3.10 refuses being requested this parameter ID. // Data does not survive RAM clear. DUSB counterpart of DBUS RID + SID pair. // 84+SE OS 2.43 reacts oddly to writes: written data does not necessarily read back ? #define DUSB_PID_USER_DATA_1 0x0030 // 0x0031 (read-only): 83PCE (OS 5.1.5.0019, 5.2.0.0035) and 89T AMS 3.10 reply with a subset of FlashApp headers. 84+SE and 84+CSE perform a lengthy operation. #define DUSB_PID_FLASHAPPS 0x0031 // 0x0032 (read-only): 84+SE OS 2.43, 84+CSE OS 4.0 and 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) reply 00, 89T AMS 3.10 refuses being requested this parameter ID. // 0x0033-0x0034 (no access): 84+SE OS 2.43, 84+CSE OS 4.0, 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) and 89T AMS 3.10 refuse being requested these parameter IDs. // 0x0035 (read-write): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) replies with 0x0A (10) bytes of data, initially all zeros. 84+SE OS 2.43, 84+CSE OS 4.0 and 89T AMS 3.10 refuse being requested this parameter ID. // Data does not survive RAM clear. Behaves like PID 0x0030, only smaller. May have another purpose ? #define DUSB_PID_USER_DATA_2 0x0035 #define DUSB_PID_MAIN_PART_ID_STRING 0x0036 #define DUSB_PID_HOMESCREEN 0x0037 #define DUSB_PID_BUSY 0x0038 #define DUSB_PID_SCREEN_SPLIT 0x0039 // ---------- 84+SE OS 2.43, 84+CSE OS 4.0 and 89T AMS 3.10 refuse being requested or set parameter IDs beyond this ---------- // 0x003A (read-only): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) replies 01 #define DUSB_PID_NEW_CLK_SUPPORT 0x003A #define DUSB_PID_CLK_SECONDS 0x003B #define DUSB_PID_CLK_MINUTES 0x003C #define DUSB_PID_CLK_HOURS 0x003D #define DUSB_PID_CLK_DAY 0x003E #define DUSB_PID_CLK_MONTH 0x003F #define DUSB_PID_CLK_YEAR 0x0040 // 0x0041 (read-write): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) initially replies 07 D0. Value is range-checked. // 0x0042 (read-write): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) replies 00 // 0x0043 (read-write): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) replies 00 // 0x0044 (read-write): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) replies 00 // 0x0045 (read-only): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) replies F0 0F 00 00 #define DUSB_PID_ANS 0x0046 // 0x0047 (read-only): 83PCE replies 00 (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) #define DUSB_PID_OS_BUILD_NUMBER 0x0048 #define DUSB_PID_BOOT_BUILD_NUMBER 0x0049 // 0x004A (read-only): 83PCE replies 00 (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) #define DUSB_PID_EXACT_MATH 0x004B // 0x004C (read-only): 83PCE replies with 0x20 (32) bytes of data, no clear pattern: boot code SHA-256 hash. // boot 5.0.0.0089: D6 98 7E 21 90 54 2F 1C 32 75 F5 EC A1 AF DF B5 // B2 20 14 A2 D3 E7 65 04 52 B1 D1 BD 3D 9D 1D 18 #define DUSB_PID_BOOT_HASH 0x004C // 0x004D (read-only): 83PCE replies with 0x20 (32) bytes of data, no clear pattern: OS SHA-256 hash. // OS 5.1.0.0110: 0D 83 11 A0 3C 9D 74 F0 6D 8C A4 22 6E 9A 30 BC // 4F 87 E0 0C 7A 18 7A 6F 01 FC 3E 0C 04 E2 B7 88 // OS 5.1.1.0112: 03 65 22 56 EA 98 7C AE AD A4 29 85 70 A4 9D FA // 05 28 97 71 0E 65 0B D7 DE 5F 15 93 1D A6 7C DB // OS 5.1.5.0019: 1C 9A CA 19 26 00 41 B6 0A C4 C8 FB D0 B9 C3 72 // AA 4F 1B 6C DC 49 B4 23 58 C6 14 E7 5E D6 D8 3D // OS 5.2.0.0035: C4 52 E6 F4 8C 78 37 13 B8 AB B7 FE F2 20 DD 12 // C5 C3 28 BA 23 BE A6 F3 68 57 77 DA 4F A5 C3 79 #define DUSB_PID_OS_HASH 0x004D // 0x004E (write-only): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) refuses being requested these parameter IDs but acknowledges writes. // 0x004F (write-only, multiple writes OR together): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) refuses being requested these parameter IDs but acknowledges writes. // Writing 01 00 00 01 enables PTT mode with features 01 00 00. // Writing 01 23 45 67 enables PTT mode with features 23 45 67. // Writing 01 FE DC BA on top of the previous write enables PTT mode with features FF DD FF. // Writing 01 00 02 00 on top of the previous write enables PTT mode with features FF DF FF. // Right after writing 01 xx xx xx, the PTT mode is not completely activated yet: the bar at the top of the screen is not automatically updated, the PTT LED doesn't blink. // Has a side effect on cursor position: moves it to the top left of the screen, overwriting top bar ?? #define DUSB_PID_PTT_MODE_SET 0x004F // 0x0050 (write-only, but values sometimes refused ?): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) refuses being requested these parameter IDs. // 0x0051 (no access): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) refuses being requested these parameter IDs #define DUSB_PID_OS_VERSION_STRING 0x0052 #define DUSB_PID_BOOT_VERSION_STRING 0x0053 // 0x0054 (read-only): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) replies 00 when not in PTT mode, 01 when in PTT mode. #define DUSB_PID_PTT_MODE_STATE 0x0054 // 0x0055 (read-only): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) replies 00 00 00 when not in PTT mode, 28 02 00 when in default PTT mode, and whatever was written there #define DUSB_PID_PTT_MODE_FEATURES 0x0055 // 0x0056-0x0057 (read-only): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) replies with invalid format. // 0x0058 (write-once): 83PCE OS 5.2.0.0035 replies with size 0. Error code 0012 occurs upon subsequent writes. // 0x0059 (write-only): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) refuses being requested this parameter ID. But it can be written on OS 5.2.0.0035. #define DUSB_PID_STOPWATCH_START 0x0059 // 0x005A (read-only): 83PCE OS 5.2.0.0035 replies 4 bytes. Fast up-counter, which runs even when stopwatch is stopped, reset by reads but not by keypresses. // 0x005B (read-only): 83PCE OS 5.2.0.0035 replies 4 bytes. Fast up-counter, which runs only when stopwatch is started, not reset by reads. #define DUSB_PID_STOPWATCH_VALUE1 0x005B // 0x005C (read-only): 83PCE OS 5.2.0.0035 replies 4 bytes. Fast up-counter, which runs only when stopwatch is started, not reset by reads. #define DUSB_PID_STOPWATCH_VALUE2 0x005C // 0x005D-0x008F (no access): 83PCE (OS 5.1.0.0110, 5.1.1.0112, 5.1.5.0019, 5.2.0.0035) refuses being requested these parameter IDs; writes yield a 0004 error code. // Attributes IDs #define DUSB_AID_VAR_SIZE 0x01 #define DUSB_AID_VAR_TYPE 0x02 #define DUSB_AID_ARCHIVED 0x03 #define DUSB_AID_UNKNOWN_04 0x04 #define DUSB_AID_4APPVAR 0x05 #define DUSB_AID_VAR_VERSION 0x08 #define DUSB_AID_VAR_TYPE2 0x11 #define DUSB_AID_ARCHIVED2 0x13 #define DUSB_AID_LOCKED 0x41 #define DUSB_AID_UNKNOWN_42 0x42 #define DUSB_AID_BACKUP_HEADER 0xFFFE // Execute commands #define DUSB_EID_PRGM 0x00 #define DUSB_EID_ASM 0x01 #define DUSB_EID_APP 0x02 #define DUSB_EID_KEY 0x03 #define DUSB_EID_UNKNOWN 0x04 // Modes #define DUSB_MODE_STARTUP { 1, 1, 0, 0, 0x07d0 } #define DUSB_MODE_BASIC { 2, 1, 0, 0, 0x07d0 } #define DUSB_MODE_NORMAL { 3, 1, 0, 0, 0x07d0 } // Structures typedef struct { uint16_t arg1; uint16_t arg2; uint16_t arg3; uint16_t arg4; uint16_t arg5; } DUSBModeSet; typedef struct { uint16_t id; uint8_t ok; uint16_t size; uint8_t* data; } DUSBCalcParam; typedef struct { uint16_t id; uint8_t ok; uint16_t size; uint8_t* data; } DUSBCalcAttr; // Type to string TIEXPORT3 const char* TICALL dusb_cmd_param_type2name(uint16_t id); // Helpers for calc params and attrs. TIEXPORT3 DUSBCalcParam* TICALL dusb_cp_new(CalcHandle * handle, uint16_t id, uint16_t size); TIEXPORT3 DUSBCalcParam* TICALL dusb_cp_new_ex(CalcHandle * handle, uint16_t id, uint16_t size, uint8_t * data); TIEXPORT3 void TICALL dusb_cp_fill(DUSBCalcParam * cp, uint16_t id, uint16_t size, uint8_t * data); TIEXPORT3 void TICALL dusb_cp_del(CalcHandle * handle, DUSBCalcParam* cp); TIEXPORT3 DUSBCalcParam** TICALL dusb_cp_new_array(CalcHandle * handle, unsigned int size); TIEXPORT3 void TICALL dusb_cp_del_array(CalcHandle * handle, unsigned int size, DUSBCalcParam **params); TIEXPORT3 void * TICALL dusb_cp_alloc_data(uint16_t size); TIEXPORT3 DUSBCalcParam * TICALL dusb_cp_realloc_data(DUSBCalcParam* vtl, uint16_t size); TIEXPORT3 void TICALL dusb_cp_free_data(void * data); TIEXPORT3 DUSBCalcAttr* TICALL dusb_ca_new(CalcHandle * handle, uint16_t id, uint16_t size); TIEXPORT3 DUSBCalcAttr* TICALL dusb_ca_new_ex(CalcHandle * handle, uint16_t id, uint16_t size, uint8_t * data); TIEXPORT3 void TICALL dusb_ca_fill(DUSBCalcAttr * ca, uint16_t id, uint16_t size, uint8_t * data); TIEXPORT3 void TICALL dusb_ca_del(CalcHandle * handle, DUSBCalcAttr* cp); TIEXPORT3 DUSBCalcAttr** TICALL dusb_ca_new_array(CalcHandle * handle, unsigned int size); TIEXPORT3 void TICALL dusb_ca_del_array(CalcHandle * handle, unsigned int size, DUSBCalcAttr **attrs); TIEXPORT3 void * TICALL dusb_ca_alloc_data(uint16_t size); TIEXPORT3 DUSBCalcParam * TICALL dusb_ca_realloc_data(DUSBCalcParam* vtl, uint16_t size); TIEXPORT3 void TICALL dusb_ca_free_data(void * data); // Command wrappers TIEXPORT3 int TICALL dusb_cmd_s_mode_set(CalcHandle *handle, const DUSBModeSet mode); TIEXPORT3 int TICALL dusb_cmd_s_os_begin(CalcHandle *handle, uint32_t size); TIEXPORT3 int TICALL dusb_cmd_r_os_ack(CalcHandle *handle, uint32_t *size); TIEXPORT3 int TICALL dusb_cmd_s_os_header(CalcHandle *handle, uint16_t addr, uint8_t page, uint8_t flag, uint32_t size, uint8_t *data); TIEXPORT3 int TICALL dusb_cmd_s_os_data(CalcHandle *handle, uint16_t addr, uint8_t page, uint8_t flag, uint32_t size, uint8_t *data); TIEXPORT3 int TICALL dusb_cmd_s_os_header_89(CalcHandle *handle, uint32_t size, uint8_t *data); TIEXPORT3 int TICALL dusb_cmd_s_os_data_89(CalcHandle *handle, uint32_t size, uint8_t *data); TIEXPORT3 int TICALL dusb_cmd_s_os_data_834pce(CalcHandle *handle, uint32_t addr, uint32_t size, uint8_t *data); TIEXPORT3 int TICALL dusb_cmd_r_eot_ack(CalcHandle *handle); TIEXPORT3 int TICALL dusb_cmd_s_param_request(CalcHandle *handle, unsigned int npids, const uint16_t *pids); TIEXPORT3 int TICALL dusb_cmd_r_param_data(CalcHandle *handle, unsigned int nparams, DUSBCalcParam **params); TIEXPORT3 int TICALL dusb_cmd_r_screenshot(CalcHandle *handle, uint32_t *size, uint8_t **data); TIEXPORT3 int TICALL dusb_cmd_s_dirlist_request(CalcHandle *handle, unsigned int naids, const uint16_t *aids); TIEXPORT3 int TICALL dusb_cmd_r_var_header(CalcHandle *handle, char *folder, char *name, DUSBCalcAttr **attr); TIEXPORT3 int TICALL dusb_cmd_s_rts(CalcHandle *handle, const char *folder, const char *name, uint32_t size, unsigned int nattrs, const DUSBCalcAttr **attrs); TIEXPORT3 int TICALL dusb_cmd_s_rts_ns(CalcHandle *handle, const char *folder, const char *name, uint32_t size, unsigned int nattrs, const DUSBCalcAttr **attrs); TIEXPORT3 int TICALL dusb_cmd_s_var_request(CalcHandle *handle, const char *folder, const char *name, unsigned int naids, const uint16_t *aids, unsigned int nattrs, const DUSBCalcAttr **attrs); TIEXPORT3 int TICALL dusb_cmd_s_var_content(CalcHandle *handle, uint32_t size, uint8_t *data); TIEXPORT3 int TICALL dusb_cmd_r_var_content(CalcHandle *handle, uint32_t *size, uint8_t **data); TIEXPORT3 int TICALL dusb_cmd_s_param_set(CalcHandle *handle, const DUSBCalcParam *param); TIEXPORT3 int TICALL dusb_cmd_s_var_modify(CalcHandle *handle, const char *src_folder, const char *src_name, unsigned int n_src_attrs, const DUSBCalcAttr **src_attrs, const char *dst_folder, const char *dst_name, unsigned int n_dst_attrs, const DUSBCalcAttr **dst_attrs); TIEXPORT3 int TICALL dusb_cmd_s_var_delete(CalcHandle *handle, const char *folder, const char *name, unsigned int nattrs, const DUSBCalcAttr **attrs); TIEXPORT3 int TICALL dusb_cmd_s_execute(CalcHandle *handle, const char *folder, const char *name, uint8_t action, const char *args, uint16_t code); TIEXPORT3 int TICALL dusb_cmd_r_mode_ack(CalcHandle *handle); TIEXPORT3 int TICALL dusb_cmd_r_data_ack(CalcHandle *handle); TIEXPORT3 int TICALL dusb_cmd_r_delay_ack(CalcHandle *handle); TIEXPORT3 int TICALL dusb_cmd_s_eot(CalcHandle *handle); TIEXPORT3 int TICALL dusb_cmd_r_eot(CalcHandle *handle); TIEXPORT3 int TICALL dusb_cmd_s_error(CalcHandle *handle, uint16_t code); // Higher-level helpers for command wrappers TIEXPORT3 int TICALL dusb_cmd_s_param_set_r_data_ack(CalcHandle *handle, uint16_t id, uint16_t size, const uint8_t * data); #ifdef __cplusplus } #endif #endif libticalcs-1.1.9+dfsg/src/dusb_rpkt.c000066400000000000000000000202121327711501700175030ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: packets.c 1404 2005-07-20 20:39:39Z roms $ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This unit manages raw packets from/to D-USB (DirectLink). */ #include #include #include "ticalcs.h" #include "internal.h" #include "dusb_rpkt.h" #include "dusb_vpkt.h" #include "logging.h" #include "error.h" typedef struct { uint8_t id; uint8_t data_hdr; uint8_t data; const char* name; } DUSBRawPacketInfo; static const DUSBRawPacketInfo dusbrawpackets[] = { { DUSB_RPKT_BUF_SIZE_REQ, 0, 4, "Buffer Size Request" }, { DUSB_RPKT_BUF_SIZE_ALLOC, 0, 4, "Buffer Size Allocation" }, { DUSB_RPKT_VIRT_DATA, 1, 6, "Virtual Packet Data with Continuation" }, { DUSB_RPKT_VIRT_DATA_LAST, 1, 6, "Virtual Packet Data Final" }, { DUSB_RPKT_VIRT_DATA_ACK, 0, 2, "Virtual Packet Data Acknowledgement" } }; TIEXPORT3 const char* TICALL dusb_rpkt_type2name(uint8_t id) { unsigned int i; for (i = 0; i < sizeof(dusbrawpackets) / sizeof(dusbrawpackets[0]); i++) { if (id == dusbrawpackets[i].id) { return dusbrawpackets[i].name; } } return ""; } TIEXPORT3 int TICALL dusb_send(CalcHandle* handle, DUSBRawPacket* pkt) { uint8_t buf[sizeof(pkt->data) + 5]; uint32_t size; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(pkt); memset(buf, 0, sizeof(buf)); size = pkt->size; if (size > sizeof(pkt->data)) { size = sizeof(pkt->data); } buf[0] = MSB(MSW(size)); buf[1] = LSB(MSW(size)); buf[2] = MSB(LSW(size)); buf[3] = LSB(LSW(size)); buf[4] = pkt->type; memcpy(buf + 5, pkt->data, size); //printf("dusb_send: pkt->size=%d\n", pkt->size); ticables_progress_reset(handle->cable); ret = ticables_cable_send(handle->cable, buf, size + 5); if (!ret) { if (size >= 128) { ticables_progress_get(handle->cable, NULL, NULL, &handle->updat->rate); } if (handle->updat->cancel) { ret = ERR_ABORT; } } return ret; } TIEXPORT3 int TICALL dusb_recv(CalcHandle* handle, DUSBRawPacket* pkt) { uint8_t buf[5]; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(pkt); // Any packet has always an header of 5 bytes (size & type) ticables_progress_reset(handle->cable); ret = ticables_cable_recv(handle->cable, buf, 5); while (!ret) { pkt->size = buf[3] | (((uint32_t)buf[2]) << 8) | (((uint32_t)buf[1]) << 16) | (((uint32_t)buf[0]) << 24); pkt->type = buf[4]; if ( (handle->model == CALC_TI84P_USB || handle->model == CALC_TI84PC_USB || handle->model == CALC_TI82A_USB || handle->model == CALC_TI84PT_USB) && pkt->size > 250) { ticalcs_warning("Raw packet is unexpectedly large: %u bytes", pkt->size); } else if ( (handle->model == CALC_TI83PCE_USB || handle->model == CALC_TI84PCE_USB) && pkt->size > 1018) { ticalcs_warning("Raw packet is unexpectedly large: %u bytes", pkt->size); } else if (handle->model == CALC_TI89T_USB) { // Fall through. } // else do nothing for now. if (pkt->size > sizeof(pkt->data)) { ticalcs_critical("Raw packet is too large: %u bytes", pkt->size); ret = ERR_INVALID_PACKET; break; } //printf("dusb_send: pkt->size=%d\n", pkt->size); // Next, follows data ret = ticables_cable_recv(handle->cable, pkt->data, pkt->size); if (!ret) { if (pkt->size >= 128) { ticables_progress_get(handle->cable, NULL, NULL, &handle->updat->rate); } if (handle->updat->cancel) { ret = ERR_ABORT; } } break; } return ret; } static const char* ep_way(uint8_t ep) { if (ep == 0x01) { return "TI>PC"; } else if (ep == 0x02) { return "PC>TI"; } else { return "XX>XX"; } } TIEXPORT3 int TICALL dusb_dissect(CalcModel model, FILE * f, const uint8_t * data, uint32_t len, uint8_t ep, uint8_t * first) { int ret = 0; uint32_t raw_size; uint8_t raw_type; VALIDATE_NONNULL(f); VALIDATE_NONNULL(data); VALIDATE_NONNULL(first); if (len < 5 || len > sizeof(((DUSBRawPacket *)0)->data)) { ticalcs_critical("Length %lu (%lX) is too small or too large for a valid DUSB raw packet", (unsigned long)len, (unsigned long)len); return ERR_INVALID_PACKET; } raw_size = (((uint32_t)(data[0])) << 24) | (((uint32_t)(data[1])) << 16) | (((uint32_t)(data[2])) << 8) | ((uint32_t)(data[3])); raw_type = data[4]; fprintf(f, "%08lX (%02X)\t\t\t\t\t\t\t| %s: %s\n", (unsigned long)raw_size, (unsigned int)raw_type, ep_way(ep), dusb_rpkt_type2name(raw_type)); if (raw_size > sizeof(((DUSBRawPacket *)0)->data) - 5) { ticalcs_critical("Raw size %lu (%lX) is too large for a valid DUSB raw packet", (unsigned long)raw_size, (unsigned long)raw_size); return ERR_INVALID_PACKET; } if (raw_type < 1 || raw_type > 5) { ticalcs_critical("Raw type unknown in DUSB raw packet"); return ERR_INVALID_PACKET; } if (len < 5U + dusbrawpackets[raw_type - 1].data) { ticalcs_critical("Length %ld is too small for a valid data part in DUSB raw packet of type %u", (unsigned long)len, raw_type); return ERR_INVALID_PACKET; } switch (raw_type) { case DUSB_RPKT_BUF_SIZE_REQ: case DUSB_RPKT_BUF_SIZE_ALLOC: { uint32_t tmp = (((uint32_t)(data[5])) << 24) | (((uint32_t)(data[6])) << 16) | (((uint32_t)(data[7])) << 8) | ((uint32_t)(data[8])); fprintf(f, "\t[%08lX]\n", (unsigned long)tmp); if (len != 5U + 4) { fputs("(unexpected size for a packet of that type)\n", f); } } break; case DUSB_RPKT_VIRT_DATA: case DUSB_RPKT_VIRT_DATA_LAST: { if (*first) { uint32_t vtl_size = (((uint32_t)(data[5])) << 24) | (((uint32_t)(data[6])) << 16) | (((uint32_t)(data[7])) << 8) | ((uint32_t)(data[8])); uint16_t vtl_type = (((uint16_t)(data[9])) << 8) | ((uint16_t)(data[10])); fprintf(f, "\t%08lX {%04X}\t\t\t\t\t\t| CMD: %s\n", (unsigned long)vtl_size, vtl_type, dusb_vpkt_type2name(vtl_type)); if (vtl_size != raw_size - 6) { fputs("(unexpected size for a packet of that type)\n", f); } if (!vtl_size) { fputs("(no data to dissect)\n", f); } else { uint32_t i; data += 11; len -= 11; if (len < vtl_size) { fputs("(packet truncated: insufficient given length)\n", f); } else if (len > vtl_size) { fputs("(given length larger than length in packet)\n", f); } fprintf(f, "\t\t"); for (i = 0; i < len;) { fprintf(f, "%02X ", *data++); if (!(++i & 15)) { fprintf(f, "\n\t\t"); } } data -= vtl_size; fputc('\n', f); ret = dusb_dissect_cmd_data(model, f, data, len, vtl_size, vtl_type); if (ret) { fputs("(inner data dissection had a problem with the packet)\n", f); } } } else { uint32_t i; fprintf(f, "\t%02X %02X %02X ", data[5], data[6], data[7]); data += 8; len -= 8; if (len < raw_size - 3) { fputs("(packet truncated: insufficient given length)\n", f); raw_size = len; } else if (len > raw_size - 3) { fputs("(given length larger than length in packet)\n", f); } for (i = 0; i < len;) { fprintf(f, "%02X ", *data++); if (!(++i & 15)) { fprintf(f, "\n\t\t"); } } fputc('\n', f); } *first = (raw_type == DUSB_RPKT_VIRT_DATA) ? 0 : 1; } break; case DUSB_RPKT_VIRT_DATA_ACK: { uint16_t tmp = (((uint16_t)(data[5])) << 8) | ((uint16_t)(data[6])); fprintf(f, "\t[%04X]\n", tmp); if (len != 5 + 2) { fputs("(unexpected size for a packet of that type)\n", f); } } break; } return ret; } libticalcs-1.1.9+dfsg/src/dusb_rpkt.h000066400000000000000000000030631327711501700175150ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: packets.h 1179 2005-06-06 14:42:32Z roms $ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ // /!\ NOTE: for this file, backwards compatibility will not necessarily be maintained as strongly as it is for ticalcs.h ! #ifndef __DUSB_RPKT__ #define __DUSB_RPKT__ #include #ifdef __cplusplus extern "C" { #endif // Raw packet types #define DUSB_RPKT_BUF_SIZE_REQ 1 #define DUSB_RPKT_BUF_SIZE_ALLOC 2 #define DUSB_RPKT_VIRT_DATA 3 #define DUSB_RPKT_VIRT_DATA_LAST 4 #define DUSB_RPKT_VIRT_DATA_ACK 5 TIEXPORT3 const char* TICALL dusb_rpkt_type2name(uint8_t id); TIEXPORT3 int TICALL dusb_dissect(CalcModel model, FILE * f, const uint8_t * data, uint32_t len, uint8_t ep, uint8_t * first); #ifdef __cplusplus } #endif #endif libticalcs-1.1.9+dfsg/src/dusb_vpkt.c000066400000000000000000000472501327711501700175220ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: cmd84p.c 2077 2006-03-31 21:16:19Z roms $ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This unit manages virtual packets from/to D-USB (DirectLink). Virtual packets are fragmented into one or more raw packets. The size of packet can be negotiated on both sides. */ #include #include #include #include "ticalcs.h" #include "internal.h" #include "logging.h" #include "error.h" #include "dusb_rpkt.h" #include "dusb_vpkt.h" #define VPKT_DBG 1 // 1 = verbose, 2 = more verbose // Type to string typedef struct { uint16_t id; const char *name; } DUSBVtlPktInfo; static const DUSBVtlPktInfo vpkt_types[] = { { 0x0000, "" }, { DUSB_VPKT_PING, "Ping / Set Mode" }, { DUSB_VPKT_OS_BEGIN, "Begin OS Transfer" }, { DUSB_VPKT_OS_ACK, "Acknowledgement of OS Transfer" }, { DUSB_VPKT_OS_HEADER, "OS Header" }, { DUSB_VPKT_OS_DATA, "OS Data" }, { DUSB_VPKT_EOT_ACK, "Acknowledgement of EOT" }, { DUSB_VPKT_PARM_REQ, "Parameter Request" }, { DUSB_VPKT_PARM_DATA, "Parameter Data" }, { DUSB_VPKT_DIR_REQ, "Request Directory Listing" }, { DUSB_VPKT_VAR_HDR, "Variable Header" }, { DUSB_VPKT_RTS, "Request to Send" }, { DUSB_VPKT_VAR_REQ, "Request Variable" }, { DUSB_VPKT_VAR_CNTS, "Variable Contents" }, { DUSB_VPKT_PARM_SET, "Parameter Set" }, { 0x000F, "" }, { DUSB_VPKT_MODIF_VAR, "Modify Variable" }, { DUSB_VPKT_EXECUTE, "Remote Control" }, { DUSB_VPKT_MODE_SET, "Acknowledgement of Mode Setting" }, { DUSB_VPKT_DATA_ACK, "Acknowledgement of Data" }, { DUSB_VPKT_DELAY_ACK, "Delay Acknowledgment" }, { DUSB_VPKT_EOT, "End of Transmission" }, { DUSB_VPKT_ERROR, "Error" }, { -1, NULL} }; TIEXPORT3 const char* TICALL dusb_vpkt_type2name(uint16_t id) { const DUSBVtlPktInfo *p; for (p = vpkt_types; p->name != NULL; p++) { if (p->id == id) { return p->name; } } return "unknown: not listed"; } // Creation/Destruction/Garbage Collecting of packets TIEXPORT3 DUSBVirtualPacket* TICALL dusb_vtl_pkt_new_ex(CalcHandle * handle, uint32_t size, uint16_t type, uint8_t * data) { DUSBVirtualPacket* vtl = NULL; if (ticalcs_validate_handle(handle)) { GList * vtl_pkt_list; vtl = g_malloc0(sizeof(DUSBVirtualPacket)); // aborts the program if it fails. vtl->size = size; vtl->type = type; vtl->data = data; vtl_pkt_list = g_list_append((GList *)(handle->priv.dusb_vtl_pkt_list), vtl); handle->priv.dusb_vtl_pkt_list = (void *)vtl_pkt_list; } else { ticalcs_critical("%s: handle is invalid", __FUNCTION__); } return vtl; } TIEXPORT3 DUSBVirtualPacket* TICALL dusb_vtl_pkt_new(CalcHandle * handle) { return dusb_vtl_pkt_new_ex(handle, 0, 0, NULL); } TIEXPORT3 void TICALL dusb_vtl_pkt_fill(DUSBVirtualPacket* vtl, uint32_t size, uint16_t type, uint8_t * data) { if (vtl != NULL) { vtl->size = size; vtl->type = type; vtl->data = data; } else { ticalcs_critical("%s: vtl is NULL", __FUNCTION__); } } TIEXPORT3 void TICALL dusb_vtl_pkt_del(CalcHandle * handle, DUSBVirtualPacket* vtl) { GList *vtl_pkt_list; if (!ticalcs_validate_handle(handle)) { ticalcs_critical("%s: handle is invalid", __FUNCTION__); return; } if (vtl == NULL) { ticalcs_critical("%s: vtl is NULL", __FUNCTION__); return; } vtl_pkt_list = g_list_remove((GList *)(handle->priv.dusb_vtl_pkt_list), vtl); handle->priv.dusb_vtl_pkt_list = (void *)vtl_pkt_list; g_free(vtl->data); g_free(vtl); } TIEXPORT3 void * TICALL dusb_vtl_pkt_alloc_data(size_t size) { return g_malloc0(size + DUSB_DH_SIZE); } TIEXPORT3 DUSBVirtualPacket * TICALL dusb_vtl_pkt_realloc_data(DUSBVirtualPacket* vtl, size_t size) { if (vtl != NULL) { if (size + DUSB_DH_SIZE > size) { uint8_t * data = g_realloc(vtl->data, size + DUSB_DH_SIZE); if (size > vtl->size) { // The previous time, vtl->size + DUSB_DH_SIZE bytes were allocated and initialized. // This time, we've allocated size + DUSB_DH_SIZE bytes, so we need to initialize size - vtl->size extra bytes. memset(data + vtl->size + DUSB_DH_SIZE, 0x00, size - vtl->size); } vtl->data = data; } else { return NULL; } } return vtl; } TIEXPORT3 void TICALL dusb_vtl_pkt_free_data(void * data) { return g_free(data); } // Raw packets TIEXPORT3 int TICALL dusb_send_buf_size_request(CalcHandle* handle, uint32_t size) { DUSBRawPacket raw; int ret; VALIDATE_HANDLE(handle); if (size > sizeof(raw.data) + 1) { ticalcs_warning("Clamping dubious large DUSB buffer size request"); size = sizeof(raw.data) + 1; } memset(&raw, 0, sizeof(raw)); raw.size = 4; raw.type = DUSB_RPKT_BUF_SIZE_REQ; raw.data[0] = (size >> 24) & 0xFF; raw.data[1] = (size >> 16) & 0xFF; raw.data[2] = (size >> 8) & 0xFF; raw.data[3] = (size ) & 0xFF; ret = dusb_send(handle, &raw); if (!ret) { ticalcs_info(" PC->TI: Buffer Size Request (%i bytes)", size); } return ret; } TIEXPORT3 int TICALL dusb_recv_buf_size_alloc(CalcHandle* handle, uint32_t *size) { DUSBRawPacket raw; uint32_t tmp; int ret = 0; VALIDATE_HANDLE(handle); memset(&raw, 0, sizeof(raw)); do { ret = dusb_recv(handle, &raw); if (ret) { break; } if (raw.size != 4 || raw.type != DUSB_RPKT_BUF_SIZE_ALLOC) { ret = ERR_INVALID_PACKET; break; } tmp = (((uint32_t)raw.data[0]) << 24) | (((uint32_t)raw.data[1]) << 16) | (((uint32_t)raw.data[2]) << 8) | (((uint32_t)raw.data[3]) << 0); if (tmp > sizeof(raw.data)) { ticalcs_critical("Clamping overly large buffer size allocation to %u bytes", (unsigned int)sizeof(raw.data)); tmp = sizeof(raw.data); } if ( (handle->model == CALC_TI83PCE_USB || handle->model == CALC_TI84PCE_USB) && tmp > 1018) { ticalcs_info("The 83PCE/84+CE allocate more than they support. Clamping buffer size to 1018"); tmp = 1018; } if (size) { *size = tmp; } ticalcs_info(" TI->PC: Buffer Size Allocation (%i bytes)", tmp); handle->priv.dusb_rpkt_maxlen = tmp; } while(0); return ret; } TIEXPORT3 int TICALL dusb_recv_buf_size_request(CalcHandle* handle, uint32_t *size) { DUSBRawPacket raw; uint32_t tmp; int ret = 0; VALIDATE_HANDLE(handle); memset(&raw, 0, sizeof(raw)); do { ret = dusb_recv(handle, &raw); if (ret) { break; } if (raw.size != 4 || raw.type != DUSB_RPKT_BUF_SIZE_REQ) { ret = ERR_INVALID_PACKET; } tmp = (((uint32_t)raw.data[0]) << 24) | (((uint32_t)raw.data[1]) << 16) | (((uint32_t)raw.data[2]) << 8) | (((uint32_t)raw.data[3]) << 0); if (size) { *size = tmp; } ticalcs_info(" TI->PC: Buffer Size Request (%i bytes)", tmp); } while(0); return ret; } TIEXPORT3 int TICALL dusb_send_buf_size_alloc(CalcHandle* handle, uint32_t size) { DUSBRawPacket raw; int ret; VALIDATE_HANDLE(handle); if (size > sizeof(raw.data) + 1) { ticalcs_warning("Clamping dubious large DUSB buffer size request"); size = sizeof(raw.data) + 1; } memset(&raw, 0, sizeof(raw)); raw.size = 4; raw.type = DUSB_RPKT_BUF_SIZE_ALLOC; raw.data[0] = (size >> 24) & 0xFF; raw.data[1] = (size >> 16) & 0xFF; raw.data[2] = (size >> 8) & 0xFF; raw.data[3] = (size ) & 0xFF; ret = dusb_send(handle, &raw); if (!ret) { ticalcs_info(" PC->TI: Buffer Size Allocation (%i bytes)", size); } handle->priv.dusb_rpkt_maxlen = size; return ret; } TIEXPORT3 int TICALL dusb_get_buf_size(CalcHandle* handle, uint32_t *size) { VALIDATE_HANDLE(handle); VALIDATE_NONNULL(size); *size = handle->priv.dusb_rpkt_maxlen; return 0; } TIEXPORT3 int TICALL dusb_set_buf_size(CalcHandle* handle, uint32_t size) { VALIDATE_HANDLE(handle); handle->priv.dusb_rpkt_maxlen = size; return 0; } TIEXPORT3 int TICALL dusb_send_acknowledge(CalcHandle* handle) { DUSBRawPacket raw; int ret; VALIDATE_HANDLE(handle); memset(&raw, 0, sizeof(raw)); raw.size = 2; raw.type = DUSB_RPKT_VIRT_DATA_ACK; raw.data[0] = 0xE0; raw.data[1] = 0x00; ret = dusb_send(handle, &raw); if (!ret) { #if (VPKT_DBG == 2) ticalcs_info(" PC->TI: Virtual Packet Data Acknowledgement"); #endif } return ret; } TIEXPORT3 int TICALL dusb_recv_acknowledge(CalcHandle *handle) { DUSBRawPacket raw; int ret = 0; VALIDATE_HANDLE(handle); memset(&raw, 0, sizeof(raw)); do { ret = dusb_recv(handle, &raw); if (ret) { break; } #if (VPKT_DBG == 2) ticalcs_info(" TI->PC: Virtual Packet Data Acknowledgement"); #endif if (raw.size != 2 && raw.size != 4) { ret = ERR_INVALID_PACKET; break; } if (raw.type == DUSB_RPKT_BUF_SIZE_REQ) { uint32_t size; if (raw.size != 4) { ret = ERR_INVALID_PACKET; break; } size = (((uint32_t)raw.data[0]) << 24) | (((uint32_t)raw.data[1]) << 16) | (((uint32_t)raw.data[2]) << 8) | (((uint32_t)raw.data[3]) << 0); ticalcs_info(" TI->PC: Buffer Size Request (%i bytes)", size); ret = dusb_send_buf_size_alloc(handle, size); if (ret) { break; } ret = dusb_recv(handle, &raw); if (ret) { break; } } if (raw.type != DUSB_RPKT_VIRT_DATA_ACK) { ret = ERR_INVALID_PACKET; break; } if (raw.data[0] != 0xE0 && raw.data[1] != 0x00) { ret = ERR_INVALID_PACKET; break; } } while(0); return ret; } // Work around TI's OS behaviour: extra bulk write of 0 size required after the last raw packet in a transfer, // when some conditions are met. static void workaround_send(CalcHandle *handle, DUSBRawPacket *raw, DUSBVirtualPacket *vtl) { uint8_t buf[64]; ticalcs_info("workaround_send: vtl->size=%d\traw->size=%d", vtl->size, raw->size); if (handle->model == CALC_TI89T_USB) { // A 1076-byte (string) variable doesn't require this workaround, but bigger (string) variables do. if (vtl->size > 1076 && ((raw->size + 5) % 64) == 0) { ticalcs_info("XXX triggering an extra bulk write\n\tvtl->size=%d\traw->size=%d", vtl->size, raw->size); ticables_cable_send(handle->cable, buf, 0); } } else if (handle->model == CALC_TI84P_USB || handle->model == CALC_TI84PC_USB || handle->model == CALC_TI82A_USB || handle->model == CALC_TI84PT_USB) { // A 244-byte (program) variable doesn't require this workaround, but bigger (program) variables do. if (raw->type == DUSB_RPKT_VIRT_DATA_LAST && vtl->size > 244 && (vtl->size % 250) == 244) { ticalcs_info("XXX triggering an extra bulk write\n\tvtl->size=%d\traw->size=%d", vtl->size, raw->size); ticables_cable_send(handle->cable, buf, 0); } } else if (handle->model == CALC_TI83PCE_USB || handle->model == CALC_TI84PCE_USB) { if (raw->type == DUSB_RPKT_VIRT_DATA_LAST && ((raw->size + 5) % 64) == 0) { ticalcs_info("XXX triggering an extra bulk write\n\tvtl->size=%d\traw->size=%d", vtl->size, raw->size); ticables_cable_send(handle->cable, buf, 0); } } else { ticalcs_warning("XXX unhandled model in workaround_send"); } } // Fragmentation of packets TIEXPORT3 int TICALL dusb_send_data(CalcHandle *handle, DUSBVirtualPacket *vtl) { DUSBRawPacket raw; int i, r, q; long offset; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(vtl); if (vtl->size && !vtl->data) { return ERR_INVALID_PARAMETER; } memset(&raw, 0, sizeof(raw)); do { if (vtl->size <= handle->priv.dusb_rpkt_maxlen - DUSB_DH_SIZE) { // we have a single packet which is the last one, too raw.size = vtl->size + DUSB_DH_SIZE; raw.type = DUSB_RPKT_VIRT_DATA_LAST; raw.data[0] = MSB(MSW(vtl->size)); raw.data[1] = LSB(MSW(vtl->size)); raw.data[2] = MSB(LSW(vtl->size)); raw.data[3] = LSB(LSW(vtl->size)); raw.data[4] = MSB(vtl->type); raw.data[5] = LSB(vtl->type); if (vtl->data) { memcpy(&raw.data[DUSB_DH_SIZE], vtl->data, vtl->size); } ret = dusb_send(handle, &raw); if (ret) { break; } #if (VPKT_DBG == 2) ticalcs_info(" PC->TI: Virtual Packet Data Final\n\t\t(size = %08x, type = %s)", vtl->size, dusb_vpkt_type2name(vtl->type)); #elif (VPKT_DBG == 1) ticalcs_info(" PC->TI: %s", dusb_vpkt_type2name(vtl->type)); #endif workaround_send(handle, &raw, vtl); ret = dusb_recv_acknowledge(handle); if (ret) { break; } } else { // we have more than one packet: first packet has data header raw.size = handle->priv.dusb_rpkt_maxlen; raw.type = DUSB_RPKT_VIRT_DATA; raw.data[0] = MSB(MSW(vtl->size)); raw.data[1] = LSB(MSW(vtl->size)); raw.data[2] = MSB(LSW(vtl->size)); raw.data[3] = LSB(LSW(vtl->size)); raw.data[4] = MSB(vtl->type); raw.data[5] = LSB(vtl->type); memcpy(&raw.data[DUSB_DH_SIZE], vtl->data, handle->priv.dusb_rpkt_maxlen - DUSB_DH_SIZE); offset = handle->priv.dusb_rpkt_maxlen - DUSB_DH_SIZE; ret = dusb_send(handle, &raw); if (ret) { break; } #if (VPKT_DBG == 2) ticalcs_info(" PC->TI: Virtual Packet Data with Continuation\n\t\t(size = %08x, type = %s)", vtl->size, dusb_vpkt_type2name(vtl->type)); #elif (VPKT_DBG == 1) ticalcs_info(" PC->TI: %s", dusb_vpkt_type2name(vtl->type)); #endif ret = dusb_recv_acknowledge(handle); if (ret) { break; } // other packets doesn't have data header but last one has a different type q = (vtl->size - offset) / handle->priv.dusb_rpkt_maxlen; r = (vtl->size - offset) % handle->priv.dusb_rpkt_maxlen; // send full chunks (no header) for (i = 1; i <= q; i++) { raw.size = handle->priv.dusb_rpkt_maxlen; raw.type = DUSB_RPKT_VIRT_DATA; memcpy(raw.data, vtl->data + offset, handle->priv.dusb_rpkt_maxlen); offset += handle->priv.dusb_rpkt_maxlen; ret = dusb_send(handle, &raw); if (ret) { goto end; } #if (VPKT_DBG == 2) ticalcs_info(" PC->TI: Virtual Packet Data with Continuation"); #endif ret = dusb_recv_acknowledge(handle); if (ret) { goto end; } handle->updat->max1 = vtl->size; handle->updat->cnt1 += handle->priv.dusb_rpkt_maxlen; handle->updat->pbar(); } // send last chunk (type) raw.size = r; raw.type = DUSB_RPKT_VIRT_DATA_LAST; memcpy(raw.data, vtl->data + offset, r); offset += r; ret = dusb_send(handle, &raw); if (ret) { break; } #if (VPKT_DBG == 2) ticalcs_info(" PC->TI: Virtual Packet Data Final"); #endif // XXX is that workaround necessary on 83PCE/84+CE/84+CE-T ? if (handle->model != CALC_TI84P_USB && handle->model != CALC_TI84PC_USB && handle->model != CALC_TI82A_USB && handle->model != CALC_TI84PT_USB) { workaround_send(handle, &raw, vtl); } ret = dusb_recv_acknowledge(handle); if (ret) { break; } } } while(0); end: return ret; } // Work around TI's OS behaviour: extra bulk read of 0 size required after the last raw packet in a transfer, // when some conditions are met. static void workaround_recv(CalcHandle *handle, DUSBRawPacket * raw, DUSBVirtualPacket * vtl) { uint8_t buf[64]; ticalcs_info("workaround_recv: vtl->size=%d\traw->size=%d", vtl->size, raw->size); if (handle->model == CALC_TI89T_USB) { if ((raw->size % 64) == 0) { ticalcs_info("XXX triggering an extra bulk read\n\tvtl->size=%d\traw->size=%d", vtl->size, raw->size); ticables_cable_recv(handle->cable, buf, 0); } } else if (handle->model == CALC_TI84P_USB || handle->model == CALC_TI84PC_USB || handle->model == CALC_TI82A_USB || handle->model == CALC_TI84PT_USB) { if (((raw->size + 5) % 64) == 0) { ticalcs_info("XXX triggering an extra bulk read\n\tvtl->size=%d\traw->size=%d", vtl->size, raw->size); ticables_cable_recv(handle->cable, buf, 0); } } else if (handle->model == CALC_TI83PCE_USB || handle->model == CALC_TI84PCE_USB) { // These models don't seem to need receive workarounds. } else { ticalcs_warning("XXX unhandled model in workaround_recv"); } } // beware: data field may be re-allocated in size ! TIEXPORT3 int TICALL dusb_recv_data_varsize(CalcHandle* handle, DUSBVirtualPacket* vtl, uint32_t* declared_size, uint32_t est_size) { DUSBRawPacket raw; int i = 0; unsigned long alloc_size; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(vtl); VALIDATE_NONNULL(declared_size); memset(&raw, 0, sizeof(raw)); do { ret = dusb_recv(handle, &raw); if (ret) { break; } if (raw.type != DUSB_RPKT_VIRT_DATA && raw.type != DUSB_RPKT_VIRT_DATA_LAST) { ticalcs_critical("Unexpected raw packet type"); ret = ERR_INVALID_PACKET; break; } if (!i++) { // first packet has a data header if (raw.size < DUSB_DH_SIZE) { ticalcs_critical("First raw packet is too small"); ret = ERR_INVALID_PACKET; break; } if (raw.size > sizeof(raw.data)) { ticalcs_critical("Raw packet is too large: %u bytes", raw.size); ret = ERR_INVALID_PACKET; break; } *declared_size = (((uint32_t)raw.data[0]) << 24) | (((uint32_t)raw.data[1]) << 16) | (((uint32_t)raw.data[2]) << 8) | (((uint32_t)raw.data[3]) << 0); alloc_size = (*declared_size > 10000 ? 10000 : *declared_size); if (alloc_size < raw.size - DUSB_DH_SIZE) { alloc_size = raw.size - DUSB_DH_SIZE; } vtl->type = (((uint16_t)raw.data[4]) << 8) | (raw.data[5] << 0); vtl->data = g_realloc(vtl->data, alloc_size); if (vtl->data != NULL) { memcpy(vtl->data, &raw.data[DUSB_DH_SIZE], raw.size - DUSB_DH_SIZE); } vtl->size = raw.size - DUSB_DH_SIZE; #if (VPKT_DBG == 2) ticalcs_info(" TI->PC: %s\n\t\t(size = %08x, type = %s)", raw.type == DUSB_RPKT_VIRT_DATA_LAST ? "Virtual Packet Data Final" : "Virtual Packet Data with Continuation", *declared_size, dusb_vpkt_type2name(vtl->type)); #elif (VPKT_DBG == 1) ticalcs_info(" TI->PC: %s", dusb_vpkt_type2name(vtl->type)); #endif if (vtl->data != NULL && vtl->type == 0xEE00) { ticalcs_info(" Error Code : %04x\n", (((int)vtl->data[0]) << 8) | vtl->data[1]); } } else { // others have more data if (vtl->size + raw.size > alloc_size) { if (vtl->size + raw.size <= est_size) { alloc_size = est_size; } else { alloc_size = (vtl->size + raw.size) * 2; } vtl->data = g_realloc(vtl->data, alloc_size); } memcpy(vtl->data + vtl->size, raw.data, raw.size); vtl->size += raw.size; #if (VPKT_DBG == 2) ticalcs_info(" TI->PC: %s", raw.type == DUSB_RPKT_VIRT_DATA_LAST ? "Virtual Packet Data Final" : "Virtual Packet Data with Continuation"); #endif if (raw.type == DUSB_RPKT_VIRT_DATA_LAST) { handle->updat->max1 = vtl->size; } else if (vtl->size < *declared_size) { handle->updat->max1 = *declared_size; } else if (vtl->size < est_size) { handle->updat->max1 = est_size; } else { handle->updat->max1 = vtl->size + raw.size; } handle->updat->cnt1 = vtl->size; handle->updat->pbar(); } workaround_recv(handle, &raw, vtl); ret = dusb_send_acknowledge(handle); if (ret) { break; } } while (raw.type != DUSB_RPKT_VIRT_DATA_LAST); //printf("dusb_recv_data: rpkt.size=%d\n", raw.size); return ret; } TIEXPORT3 int TICALL dusb_recv_data(CalcHandle* handle, DUSBVirtualPacket* vtl) { uint32_t declared_size; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(vtl); ret = dusb_recv_data_varsize(handle, vtl, &declared_size, 0); if (!ret) { if (declared_size != vtl->size) { ticalcs_warning("invalid packet (declared size = %d, actual size = %d)", declared_size, vtl->size); ret = ERR_INVALID_PACKET; } } return ret; } libticalcs-1.1.9+dfsg/src/dusb_vpkt.h000066400000000000000000000072621327711501700175260ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: cmd84p.h 2074 2006-03-31 08:36:06Z roms $ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ // /!\ NOTE: for this file, backwards compatibility will not necessarily be maintained as strongly as it is for ticalcs.h ! #ifndef __DUSB_VPKT__ #define __DUSB_VPKT__ #ifdef __cplusplus extern "C" { #endif // Convenients structures #define DUSB_DH_SIZE (4+2) // size + type typedef struct { uint32_t size; // virtual packet size uint16_t type; // virtual packet type uint8_t *data; // virtual packet data } DUSBVirtualPacket; // Virtual packet types #define DUSB_VPKT_PING 0x0001 #define DUSB_VPKT_OS_BEGIN 0x0002 #define DUSB_VPKT_OS_ACK 0x0003 #define DUSB_VPKT_OS_HEADER 0x0004 #define DUSB_VPKT_OS_DATA 0x0005 #define DUSB_VPKT_EOT_ACK 0x0006 #define DUSB_VPKT_PARM_REQ 0x0007 #define DUSB_VPKT_PARM_DATA 0x0008 #define DUSB_VPKT_DIR_REQ 0x0009 #define DUSB_VPKT_VAR_HDR 0x000A #define DUSB_VPKT_RTS 0x000B #define DUSB_VPKT_VAR_REQ 0x000C #define DUSB_VPKT_VAR_CNTS 0x000D #define DUSB_VPKT_PARM_SET 0x000E #define DUSB_VPKT_MODIF_VAR 0x0010 #define DUSB_VPKT_EXECUTE 0x0011 #define DUSB_VPKT_MODE_SET 0x0012 #define DUSB_VPKT_DATA_ACK 0xAA00 #define DUSB_VPKT_DELAY_ACK 0xBB00 #define DUSB_VPKT_EOT 0xDD00 #define DUSB_VPKT_ERROR 0xEE00 // Type to string TIEXPORT3 const char* TICALL dusb_vpkt_type2name(uint16_t id); // Functions TIEXPORT3 DUSBVirtualPacket* TICALL dusb_vtl_pkt_new(CalcHandle * handle); TIEXPORT3 DUSBVirtualPacket* TICALL dusb_vtl_pkt_new_ex(CalcHandle * handle, uint32_t size, uint16_t type, uint8_t * data); TIEXPORT3 void TICALL dusb_vtl_pkt_fill(DUSBVirtualPacket* vtl, uint32_t size, uint16_t type, uint8_t * data); TIEXPORT3 void TICALL dusb_vtl_pkt_del(CalcHandle * handle, DUSBVirtualPacket* pkt); TIEXPORT3 void * TICALL dusb_vtl_pkt_alloc_data(size_t size); TIEXPORT3 DUSBVirtualPacket * TICALL dusb_vtl_pkt_realloc_data(DUSBVirtualPacket* vtl, size_t size); TIEXPORT3 void TICALL dusb_vtl_pkt_free_data(void * data); TIEXPORT3 int TICALL dusb_send_buf_size_request(CalcHandle *handle, uint32_t size); TIEXPORT3 int TICALL dusb_recv_buf_size_alloc(CalcHandle *handle, uint32_t *size); TIEXPORT3 int TICALL dusb_recv_buf_size_request(CalcHandle *handle, uint32_t *size); TIEXPORT3 int TICALL dusb_send_buf_size_alloc(CalcHandle *handle, uint32_t size); TIEXPORT3 int TICALL dusb_send_data(CalcHandle *handle, DUSBVirtualPacket* pkt); TIEXPORT3 int TICALL dusb_recv_data(CalcHandle *handle, DUSBVirtualPacket* pkt); TIEXPORT3 int TICALL dusb_recv_data_varsize(CalcHandle *handle, DUSBVirtualPacket* vtl, uint32_t* declared_size, uint32_t est_size); TIEXPORT3 int TICALL dusb_send_acknowledge(CalcHandle *handle); TIEXPORT3 int TICALL dusb_recv_acknowledge(CalcHandle *handle); TIEXPORT3 int TICALL dusb_get_buf_size(CalcHandle *handle, uint32_t * size); TIEXPORT3 int TICALL dusb_set_buf_size(CalcHandle *handle, uint32_t size); #ifdef __cplusplus } #endif #endif libticalcs-1.1.9+dfsg/src/error.c000066400000000000000000000306021327711501700166430ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #ifdef HAVE_CONFIG_H #include #endif #include "ticalcs.h" #include "gettext.h" #include "export3.h" #include "error.h" #include "logging.h" #include "internal.h" // extern helpers extern int nsp_reset; /** * ticalcs_error_get: * @number: error number (see error.h for list). * @message: a newly glib allocated string which contains corresponding error *message. * * Attempt to match the message corresponding to the error number. The returned * string must be freed when no longer needed. * The error message has the following format: * - 1: the error message * - 2: the cause(s), explanations on how to fix it * - 3: the error returned by the system * * Return value: 0 if error has been caught, the error number otherwise (propagation). **/ TIEXPORT3 int TICALL ticalcs_error_get(int number, char **message) { // free memory //dusb_vtl_pkt_purge(); //dusb_cpca_purge(); //nsp_vtl_pkt_purge(); if (message == NULL) { ticalcs_critical("ticalcs_error_get(NULL)\n"); return number; } switch(number) { case ERR_ABORT: *message = g_strconcat( _("Msg: transfer aborted."), "\n", _("Cause: the user!"), NULL); break; case ERR_NOT_READY: *message = g_strconcat( _("Msg: calculator is not ready."), "\n", _("Cause: the calculator is busy (Var-Link menu, Window, ...). Press HOME..."), NULL); break; case ERR_CHECKSUM: *message = g_strconcat( _("Msg: checksum error."), "\n", _("Cause: a transmission error. Try again."), NULL); break; case ERR_INVALID_HOST: *message = g_strconcat( _("Msg: invalid host ID."), "\n", _("Cause: received an unexpected Machine ID from calculator, probably due to a transmission error."), NULL); break; case ERR_INVALID_TARGET: *message = g_strconcat( _("Msg: invalid target ID."), "\n", _("Cause: received an unexpected Target ID from calculator, probably due to a transmission error."), NULL); break; case ERR_INVALID_CMD: *message = g_strconcat( _("Msg: invalid command ID."), "\n", _("Cause: received an unexpected Command ID from calculator, probably due to a transmission error."), NULL); break; case ERR_EOT: *message = g_strconcat( _("Msg: not really an error, should not appear!"), "\n", _("Cause: a bug. Drop us an email!"), NULL); break; case ERR_VAR_VERSION: *message = g_strconcat( _("Msg: program or variable is incompatible with this OS version."), "\n", _("Cause: this variable type may not be supported by the target calculator, or you may need to upgrade your calculator OS."), NULL); break; case ERR_VAR_REJECTED: *message = g_strconcat( _("Msg: contents has been refused."), "\n", _("Cause: you attempted to send a variable which is locked/archived on the target calculator. The calculator may be out of memory. The certificate may be invalid or already installed."), NULL); break; case ERR_CTS_ERROR: *message = g_strconcat( _("Invalid CTS packet."), "\n", _("Cause: a transmission error."), NULL); break; case ERR_NACK: *message = g_strconcat( _("NACK received."), "\n", _("Cause: the command has been refused."), NULL); break; case ERR_INVALID_PACKET: *message = g_strconcat( _("Invalid packet."), "\n", _("Cause: a transmission error."), NULL); break; case ERR_MALLOC: break; case ERR_NO_CABLE: *message = g_strconcat( _("The cable cannot be used."), "\n", _("Cause: the cable has not been initialized due to a previous/current error."), NULL); break; case ERR_BUSY: break; case ERR_FILE_OPEN: break; case ERR_VOID_FUNCTION: case ERR_UNSUPPORTED: *message = g_strconcat( _("Msg: this function does not exist for this calculator."), "\n", _("Cause: the operation you attempted is not supported by your calculator model."), NULL); break; case ERR_OUT_OF_MEMORY: *message = g_strconcat( _("Msg: calculator out of memory."), "\n", _("Cause: the calculator does not have memory enough for doing the operation."), NULL); break; case ERR_OPEN_FILE: *message = g_strconcat( _("Msg: unable to open (reading) the file."), "\n", _("Cause: disk space or permissions."), NULL); break; case ERR_SAVE_FILE: *message = g_strconcat( _("Msg: unable to open (writing) the file."), "\n", _("Cause: disk space or permissions."), NULL); break; case ERR_PENDING_TRANSFER: *message = g_strconcat( _("A transfer is in progress. You cannot start a new one."), "\n", _("Cause: this should not happen. Probably a bug: drop us an email!"), NULL); break; case ERR_FATAL_ERROR: break; case ERR_MISSING_VAR: *message = g_strconcat( _("The requested var does not exist."), "\n", _("Cause: you attempted to download a variable which does not exist on the calculator any longer. Maybe you have manually deleted it ?"), NULL); break; case ERR_NO_VARS: *message = g_strconcat( _("There is nothing to backup."), "\n", _("Cause: 0 variables stored onto your calculator."), NULL); break; case ERR_INVALID_HANDLE: *message = g_strconcat( _("Invalid ticalcs handle."), "\n", _("Cause: bad cable or calc model."), NULL); break; case ERR_INVALID_PARAMETER: *message = g_strconcat( _("Invalid parameter."), "\n", _("Cause: if you see this in normal usage, a bug: drop us an email ! Otherwise, check the arguments you're passing to the function."), NULL); break; case ERR_INVALID_SCREENSHOT: *message = g_strconcat( _("Unknown screenshot format."), "\n", _("Cause: a transmission error, or unsupported calculator version."), NULL); break; case ERR_CALC_ERROR1: // must be synchronized with cmd68k.c (static uint8_t dbus_errors[]) *message = g_strconcat( _("Msg: hand-held returned an error."), "\n", _("Cause: hand-held returned an uncaught error. Please report log."), NULL); break; case ERR_CALC_ERROR1+1: *message = g_strdup( _("Msg: cannot delete application.")); break; case ERR_CALC_ERROR1+2: *message = g_strdup( _("Msg: invalid variable name.")); break; case ERR_CALC_ERROR1+3: *message = g_strdup( _("Msg: cannot overwrite variable (locked/archived).")); break; case ERR_CALC_ERROR1+4: *message = g_strdup( _("Msg: cannot delete variable (locked/archived).")); break; case ERR_CALC_ERROR1+5: *message = g_strdup( _("Msg: FLASH application rejected (bad target model).")); break; case ERR_CALC_ERROR1+6: *message = g_strdup( _("Msg: malformed RTS packet (AMS version conflict).")); break; case ERR_CALC_ERROR1+7: *message = g_strdup( _("Msg: FLASH application rejected (signature does not match).")); break; case ERR_CALC_ERROR2: // must be synchronized with dusb_cmd.c (static uint16_t usb_errors[]) *message = g_strconcat( _("Msg: hand-held returned an error (not caught)."), "\n", _("Cause: hand-held returned an uncaught error. Please report log."), NULL); break; case ERR_CALC_ERROR2+1: *message = g_strdup( _("Msg: invalid argument or name.")); break; case ERR_CALC_ERROR2+2: *message = g_strdup( _("Msg: cannot delete var/app from archive.")); break; case ERR_CALC_ERROR2+3: *message = g_strdup( _("Msg: transmission error.")); break; case ERR_CALC_ERROR2+4: *message = g_strdup( _("Msg: using basic mode while being in boot mode.")); break; case ERR_CALC_ERROR2+5: *message = g_strdup( _("Msg: out of memory.")); break; case ERR_CALC_ERROR2+6: *message = g_strdup( _("Msg: invalid name.")); break; case ERR_CALC_ERROR2+7: *message = g_strdup( _("Msg: invalid name.")); break; case ERR_CALC_ERROR2+8: *message = g_strdup( _("Msg: busy?")); break; case ERR_CALC_ERROR2+9: *message = g_strdup( _("Msg: can't overwrite, variable is locked.")); break; case ERR_CALC_ERROR2+10: *message = g_strdup( _("Msg: mode token too small.")); break; case ERR_CALC_ERROR2+11: *message = g_strdup( _("Msg: mode token too large.")); break; case ERR_CALC_ERROR2+12: *message = g_strdup( _("Msg: wrong size for parameter.")); break; case ERR_CALC_ERROR2+13: *message = g_strdup( _("Msg: invalid parameter ID.")); break; case ERR_CALC_ERROR2+14: *message = g_strdup( _("Msg: read-only parameter.")); break; case ERR_CALC_ERROR2+15: *message = g_strdup( _("Msg: wrong modify request?")); break; case ERR_CALC_ERROR2+16: *message = g_strdup( _("Msg: remote control?")); break; case ERR_CALC_ERROR2+17: *message = g_strdup( _("Msg: battery low.")); break; case ERR_CALC_ERROR2+18: *message = g_strdup( _("Msg: FLASH application rejected (signature does not match).")); break; case ERR_CALC_ERROR2+19: *message = g_strdup( _("Msg: hand-held is busy (set your calculator to HOME screen).")); break; case ERR_CALC_ERROR3+0: // must be synchronized with nsp_cmd.c (static uint8_t usb_errors[]) *message = g_strconcat( _("Msg: hand-held returned an error (not caught)."), "\n", _("Cause: hand-held returned an uncaught error. Please report log."), NULL); break; case ERR_CALC_ERROR3+1: *message = g_strdup( _("Msg: out of memory.")); break; case ERR_CALC_ERROR3+2: *message = g_strdup( _("Msg: OS installation failed. File is corrupted/wrong.")); break; // The following one is returned when the filename does not fit in a 254-byte packet. case ERR_CALC_ERROR3+3: *message = g_strdup( _("Msg: packet too large.")); break; case ERR_CALC_ERROR3+4: *message = g_strdup( _("Msg: the variable or directory does not exist.")); break; case ERR_CALC_ERROR3+5: *message = g_strdup( _("Msg: the directory name is invalid.")); break; case ERR_CALC_ERROR3+6: *message = g_strdup( _("Msg: not currently listing a directory.")); break; case ERR_CALC_ERROR3+7: *message = g_strdup( _("Msg: no more files to list.")); break; case ERR_CALC_ERROR3+8: *message = g_strdup( _("Msg: the directory name already exists.")); break; // The following one is returned with folder names >= 230 bytes long case ERR_CALC_ERROR3+9: *message = g_strdup( _("Msg: the destination (folder or file) path is too long.")); break; case ERR_CALC_ERROR3+10: *message = g_strdup( _("Msg: the file name is invalid.")); break; case ERR_CALC_ERROR3+11: *message = g_strdup( _("Msg: no file extension.")); break; case ERR_CALC_ERROR3+12: *message = g_strdup( _("Msg: forbidden characters in folder name.")); break; // The following one (FF 20) is returned immediately by a e.g. CX CAS running 3.0.1.1753, // when ones tries to send it ZiDian.tcc (English-Chinese dictionary) 3.1.0.392. // A CX CAS running 3.1.0.392 sends FF 04 (OS refused because it's not suitable / corrupted / whatever) instead. // // 3.0.1.1753 behaves exactly the same if the magic in the header is edited from __OSEXT__1 to __OTEXT__1. // Therefore, it seems that FF 20 is a generic error message, rather than just "this particular OS extension is refused". case ERR_CALC_ERROR3+13: *message = g_strdup( _("Msg: OS upgrade type not recognized.")); break; case ERR_CALC_ERROR3+14: *message = g_strdup( _("Msg: anti-downgrade protection refuses this OS version.")); break; default: // propagate error code return number; } return 0; } /** * ticalcs_error_free: * @message: a message previously allocated by ticalcs_error_get() * * Free the given message string allocated by ticalcs_error_get(); * * Return value: 0 if the argument was valid and the message was freed, nonzero otherwise. **/ TIEXPORT3 int TICALL ticalcs_error_free(char *message) { if (message == NULL) { ticalcs_critical("ticalcs_error_free(NULL)\n"); return ERR_INVALID_PARAMETER; } g_free(message); return 0; } libticalcs-1.1.9+dfsg/src/error.h000066400000000000000000000053421327711501700166530ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: error.h 1035 2005-05-07 21:04:23Z roms $ */ /* libticalcs - Ti Link Calc library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TICALCS_ERROR__ #define __TICALCS_ERROR__ /* Error codes must begin at 256 up to 511 */ typedef enum { ERR_NO_ERROR = 0, // No error (returns 0) ERR_ABORT = 256, // Operation aborted (exported in ticalcs.h) ERR_NOT_READY, // Calculator is not ready (don't change it !) ERR_CHECKSUM, // Checksum error ERR_INVALID_HOST, // Invalid host ID ERR_INVALID_TARGET, // Invalid target ID ERR_INVALID_CMD, // Invalid command ID ERR_EOT, // Not really an error (internal use) ERR_VAR_REJECTED, // The variable has been rejected by calc ERR_CTS_ERROR, // Invalid CTS packet ERR_NACK, // NACK received ERR_INVALID_PACKET, // Packet is invalid ERR_MALLOC, // No memory ?! ERR_NO_CABLE, // No cable attached ERR_BUSY, // Device is busy (transfer in progress) ERR_FILE_OPEN, // Can't open file ERR_UNSUPPORTED, // This function does not exist for the calc // --- ERR_VOID_FUNCTION, // This function does not exist for the calc ERR_OUT_OF_MEMORY, // Calc reply out of *memory ERR_OPEN_FILE, ERR_SAVE_FILE, // Can not open (writing) file ERR_PENDING_TRANSFER, // A transfer is in progress ERR_FATAL_ERROR, // Fatal error (alloc, file, ...) ERR_MISSING_VAR, // The requested var does not exist ERR_NO_VARS, // No vars to backup // --- ERR_ROM_ERROR, ERR_NO_CALC, // No calc probed ERR_INVALID_HANDLE, // Invalid handle ERR_INVALID_PARAMETER, ERR_INVALID_SCREENSHOT, ERR_VAR_VERSION, // Variable rejected due to version code // --- 300 to 349 are reserved for hand-held status (DUSB) ERR_CALC_ERROR2 = 300, // Hand-held returned an error code // --- 350 to 399 are reserved for hand-held status (DBUS) ERR_CALC_ERROR1 = 350, // Hand-held returned an error code // --- 400 to 459 are reserved for hand-held status (NSpire) ERR_CALC_ERROR3 = 400, // --- } CalcError; #endif libticalcs-1.1.9+dfsg/src/export3.h000066400000000000000000000051151327711501700171240ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs2 - hand-helds support library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TICALCS_EXPORT__ #define __TICALCS_EXPORT__ #ifdef HAVE_CONFIG_H # include #endif #ifdef __cplusplus extern "C" { #endif /* Calling convention: default */ # define TICALL /* Symbols exporting */ #if defined(HAVE_FVISIBILITY) // GCC 4.0 has introduced the -fvisibility flag (similar to declspec) # define TIEXPORT3 __attribute__ ((visibility("default"))) #elif defined(__WIN32__) # if defined(__BORLANDC__) // BCC32 v5.x (or C++Builder) # if __BORLANDC__ >= 0x0500 // (c) 2001 Thomas Wolf (two@chello.at) # define TIEXPORT3 # else # define TIEXPORT3 # endif # elif defined(_MSC_VER) // MSVC 5.0 mini # if defined(TICALCS_EXPORTS) # define TIEXPORT3 __declspec(dllexport) # else # define TIEXPORT3 __declspec(dllimport) # endif # elif defined(__MINGW32__) // MinGW - GCC for Windows, (c) 2002 Kevin Kofler # if defined(TICALCS_EXPORTS) // defined by the configure script # define TIEXPORT3 __declspec(dllexport) # else # define TIEXPORT3 __declspec(dllimport) # endif # endif #else # define TIEXPORT3 // default #endif #ifdef __cplusplus } #endif /* Symbols deprecating */ #ifndef TILIBS_DEPRECATED # ifdef __GNUC__ # if (__GNUC__>3) || (__GNUC__==3 && __GNUC_MINOR__>=3) # define TILIBS_DEPRECATED __attribute__((deprecated)) # else /* not GCC >= 3.3 */ # define TILIBS_DEPRECATED # endif /* GCC >= 3.3 */ # else /* not __GNUC__ */ # ifdef _MSC_VER # if _MSC_VER >= 1300 # define TILIBS_DEPRECATED __declspec(deprecated) # else /* not _MSC_VER >= 1300 */ # define TILIBS_DEPRECATED # endif /* _MSC_VER >= 1300 */ # else /* not _MSC_VER */ # define TILIBS_DEPRECATED # endif /* _MSC_VER */ # endif /* __GNUC__ */ #endif /* TILIBS_DEPRECATED */ #endif libticalcs-1.1.9+dfsg/src/gettext.h000066400000000000000000000071461327711501700172120ustar00rootroot00000000000000/* Convenience header for conditional use of GNU . Copyright (C) 1995-1998, 2000-2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 /* NLS can be disabled through the configure --disable-nls option. */ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ # include #else /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. We don't include as well because people using "gettext.h" will not include , and also including would fail on SunOS 4, whereas is OK. */ #if defined(__sun) # include #endif /* Many header files from the libstdc++ coming with g++ 3.3 or newer include , which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. */ #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) # include # if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H # include # endif #endif /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ # define gettext(Msgid) ((const char *) (Msgid)) # define dgettext(Domainname, Msgid) ((const char *) (Msgid)) # define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define textdomain(Domainname) ((const char *) (Domainname)) # define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) # define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) #endif /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. The argument, String, should be a literal string. Concatenated strings and other string expressions won't work. The macro's expansion is not parenthesized, so that it is suitable as initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String /* Short gettext aliases. */ #define _(String) dgettext(PACKAGE, String) #define N_(String) gettext_noop(String) #if defined(__WIN32__) && !defined(__MINGW32__) # undef PACKAGE # define PACKAGE "libticalcs2" // name of package #endif #endif /* _LIBGETTEXT_H */ libticalcs-1.1.9+dfsg/src/internal.h000066400000000000000000000207431327711501700173400ustar00rootroot00000000000000/* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2012 Romain Liévin * Copyright (C) 2012 Lionel Debroux * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * \file internal.h * \brief Definitions for internal (libticalcs) usage. */ #ifndef __TICALCS_INTERNAL__ #define __TICALCS_INTERNAL__ #include "error.h" #include "pause.h" #include "macros.h" #define VALIDATE_NONNULL(ptr) \ do \ { \ if (ptr == NULL) \ { \ ticalcs_critical("%s: " #ptr " is NULL", __FUNCTION__); \ return ERR_INVALID_PARAMETER; \ } \ } while(0); #define VALIDATE_HANDLE(handle) \ do \ { \ if (!ticalcs_validate_handle(handle)) \ { \ ticalcs_critical("%s: " #handle " is invalid", __FUNCTION__); \ return ERR_INVALID_HANDLE; \ } \ } while(0); #define VALIDATE_CALCFNCTS(calc) \ do \ { \ if (!ticalcs_validate_calcfncts(calc)) \ { \ ticalcs_critical("%s: " # calc " is invalid", __FUNCTION__); \ return ERR_INVALID_HANDLE; \ } \ } while(0); #define VALIDATE_BACKUPCONTENT(content) \ do \ { \ if (!ticalcs_validate_backupcontent(content)) \ { \ ticalcs_critical("%s: " #content " is NULL", __FUNCTION__); \ return ERR_INVALID_PARAMETER; \ } \ } while(0); #define VALIDATE_FILECONTENT(content) \ do \ { \ if (!ticalcs_validate_filecontent(content)) \ { \ ticalcs_critical("%s: " #content " is NULL", __FUNCTION__); \ return ERR_INVALID_PARAMETER; \ } \ } while(0); #define VALIDATE_FILECONTENT_ENTRIES(content) \ do \ { \ if (!ticalcs_validate_filecontent_entries(content)) \ { \ ticalcs_critical("%s: " #content "->entries is NULL", __FUNCTION__); \ return ERR_INVALID_PARAMETER; \ } \ } while(0); #define VALIDATE_FLASHCONTENT(content) \ do \ { \ if (!ticalcs_validate_flashcontent(content)) \ { \ ticalcs_critical("%s: " #content " is NULL", __FUNCTION__); \ return ERR_INVALID_PARAMETER; \ } \ } while(0); #define VALIDATE_VARENTRY(var) \ do \ { \ if (!ticalcs_validate_varentry(var)) \ { \ ticalcs_critical("%s: " #var " is NULL", __FUNCTION__); \ return ERR_INVALID_PARAMETER; \ } \ } while(0); #define VALIDATE_VARREQUEST(var) \ do \ { \ if (!ticalcs_validate_varrequest(var)) \ { \ ticalcs_critical("%s: " #var " is NULL", __FUNCTION__); \ return ERR_INVALID_PARAMETER; \ } \ } while(0); #define VALIDATE_SCREENWIDTH(width) \ do \ { \ if (width > 320) \ { \ ticalcs_critical("%s: no calculator model known to this library has screens of width > 320 pixels", __FUNCTION__); \ return ERR_INVALID_PARAMETER; \ } \ } while(0); #define VALIDATE_SCREENHEIGHT(height) \ do \ { \ if (height > 240) \ { \ ticalcs_critical("%s: no calculator model known to this library has screens of height > 240 pixels", __FUNCTION__); \ return ERR_INVALID_PARAMETER; \ } \ } while(0); #define RETURN_IF_HANDLE_NOT_ATTACHED(handle) \ do \ { \ if (!handle->attached) \ { \ return ERR_NO_CABLE; \ } \ } while(0); #define RETURN_IF_HANDLE_NOT_OPEN(handle) \ do \ { \ if (!handle->open) \ { \ return ERR_NO_CABLE; \ } \ } while(0); #define RETURN_IF_HANDLE_BUSY(handle) \ do \ { \ if (handle->busy) \ { \ return ERR_BUSY; \ } \ } while(0); static inline int ticalcs_validate_handle(CalcHandle * handle) { return handle != NULL; } static inline int ticalcs_validate_calcfncts(const CalcFncts * calc) { return calc != NULL; } static inline int ticalcs_validate_backupcontent(BackupContent * content) { return content != NULL; } static inline int ticalcs_validate_filecontent(FileContent * content) { return content != NULL; } static inline int ticalcs_validate_filecontent_entries(FileContent * content) { return content->num_entries == 0 || content->entries != NULL; } static inline int ticalcs_validate_flashcontent(FlashContent * content) { return content != NULL; } static inline int ticalcs_validate_varentry(VarEntry * var) { return var != NULL; } static inline int ticalcs_validate_varrequest(VarRequest * var) { return var != NULL; } static inline void * ticalcs_alloc_screen(size_t len) { return g_malloc(len); } static inline void * ticalcs_realloc_screen(void * mem, size_t len) { return g_realloc(mem, len); } static inline int dirlist_init_tree(CalcHandle * handle, GNode ** tree, const char * type) { int ret = ERR_MALLOC; (*tree) = g_node_new(NULL); if (*tree != NULL) { TreeInfo *ti = (TreeInfo *)g_malloc(sizeof(TreeInfo)); if (ti != NULL) { ti->model = handle->model; ti->type = type; (*tree)->data = ti; ret = 0; } } return ret; } static inline int dirlist_init_trees(CalcHandle * handle, GNode ** vars, GNode ** apps) { int ret = dirlist_init_tree(handle, vars, VAR_NODE_NAME); if (!ret) { ret = dirlist_init_tree(handle, apps, APP_NODE_NAME); } return ret; } static inline GNode * dirlist_create_append_node(void * data, GNode ** tree) { GNode * node = g_node_new(data); if (node != NULL) { g_node_append(*tree, node); } return node; } #define ticalcs_slprintf(str, size, format, ...) \ snprintf(str, size - 1, format, ##__VA_ARGS__); \ str[size - 1] = 0; #define ticalcs_strlcpy(dst, src, size) \ strncpy(dst, src, size - 1); \ dst[size - 1] = 0; // backup.c int tixx_recv_all_vars_backup(CalcHandle* handle, FileContent* content); // calc_00.c int noop_is_ready (CalcHandle* handle); int noop_send_key (CalcHandle* handle, uint32_t key); int noop_execute (CalcHandle* handle, VarEntry *ve, const char* args); int noop_recv_screen (CalcHandle* handle, CalcScreenCoord* sc, uint8_t** bitmap); int noop_get_dirlist (CalcHandle* handle, GNode** vars, GNode** apps); int noop_get_memfree (CalcHandle* handle, uint32_t* ram, uint32_t* flash); int noop_send_backup (CalcHandle* handle, BackupContent* content); int noop_recv_backup (CalcHandle* handle, BackupContent* content); int noop_send_var (CalcHandle* handle, CalcMode mode, FileContent* content); int noop_recv_var (CalcHandle* handle, CalcMode mode, FileContent* content, VarRequest* vr); int noop_send_var_ns (CalcHandle* handle, CalcMode mode, FileContent* content); int noop_recv_var_ns (CalcHandle* handle, CalcMode mode, FileContent* content, VarEntry** ve); int noop_send_flash (CalcHandle* handle, FlashContent* content); int noop_recv_flash (CalcHandle* handle, FlashContent* content, VarRequest* vr); int noop_send_os (CalcHandle* handle, FlashContent* content); int noop_recv_idlist (CalcHandle* handle, uint8_t* idlist); int noop_dump_rom_1 (CalcHandle* handle); int noop_dump_rom_2 (CalcHandle* handle, CalcDumpSize size, const char *filename); int noop_set_clock (CalcHandle* handle, CalcClock* _clock); int noop_get_clock (CalcHandle* handle, CalcClock* _clock); int noop_del_var (CalcHandle* handle, VarRequest* vr); int noop_new_folder (CalcHandle* handle, VarRequest* vr); int noop_get_version (CalcHandle* handle, CalcInfos* infos); int noop_send_cert (CalcHandle* handle, FlashContent* content); int noop_recv_cert (CalcHandle* handle, FlashContent* content); int noop_rename_var (CalcHandle* handle, VarRequest* oldname, VarRequest* newname); int noop_change_attr (CalcHandle* handle, VarRequest* vr, FileAttr attr); int noop_send_all_vars_backup (CalcHandle* handle, FileContent* content); int noop_recv_all_vars_backup (CalcHandle* handle, FileContent* content); // cmdz80.c int ti82_send_asm_exec(CalcHandle*, VarEntry * var); // dusb_cmd.c int dusb_check_cmd_data(CalcModel model, const uint8_t * data, uint32_t len, uint32_t vtl_size, uint16_t vtl_type); int dusb_dissect_cmd_data(CalcModel model, FILE *f, const uint8_t * data, uint32_t len, uint32_t vtl_size, uint16_t vtl_type); // dusb_cmd.c #define CA(x) (const DUSBCalcAttr **)(x) #define CP(x) (const DUSBCalcParam **)(x) #define VALIDATE_ATTRS(nattrs, attrs) \ if (nattrs != 0 && attrs == NULL) \ { \ ticalcs_critical("%s: " #attrs " is NULL", __FUNCTION__); \ return ERR_INVALID_PARAMETER; \ } #endif // __TICALCS_INTERNAL__ libticalcs-1.1.9+dfsg/src/keys73.c000066400000000000000000000175631327711501700166520ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2007 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "ticalcs.h" #include "keys73.h" /* Conversion of an ASCII code into a TI key. This table is very incomplete. It contains most of ASCII chars only. Same for TI73/TI83. */ const OldCalcKeys_ TI73_KEYS[] = { /* 0x00 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"Enter", "Enter", KEY73_Enter, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x10 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"ESC", "Quit", KEY73_Quit, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x20 */ {" ", "Space", KEY73_Space, "", 0, "", 0, "", 0, "", 0}, {"!", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"#", "", 0, "", 0, "", 0, "", 0, "", 0}, {"$", "", 0, "", 0, "", 0, "", 0, "", 0}, {"%", "", 0, "", 0, "", 0, "", 0, "", 0}, {"&", "", 0, "", 0, "", 0, "", 0, "", 0}, {"'", "", 0, "", 0, "", 0, "", 0, "", 0}, {"(", "LParen", KEY73_LParen, "", 0, "", 0, "", 0, "", 0}, {")", "RParen", KEY73_RParen, "", 0, "", 0, "", 0, "", 0}, {"*", "Mul", KEY73_Mul, "", 0, "", 0, "", 0, "", 0}, {"+", "Add", KEY73_Add, "", 0, "", 0, "", 0, "", 0}, {",", "Comma", KEY73_Comma, "", 0, "", 0, "", 0, "", 0}, {"-", "Sub", KEY73_Sub, "", 0, "", 0, "", 0, "", 0}, {".", "", 0, "", 0, "", 0, "", 0, "", 0}, {"/", "Div", KEY73_Div, "", 0, "", 0, "", 0, "", 0}, /* 0x30 */ {"0", "0", KEY73_0, "", 0, "", 0, "", 0, "", 0}, {"1", "1", KEY73_1, "", 0, "", 0, "", 0, "", 0}, {"2", "2", KEY73_2, "", 0, "", 0, "", 0, "", 0}, {"3", "3", KEY73_3, "", 0, "", 0, "", 0, "", 0}, {"4", "4", KEY73_4, "", 0, "", 0, "", 0, "", 0}, {"5", "5", KEY73_5, "", 0, "", 0, "", 0, "", 0}, {"6", "6", KEY73_6, "", 0, "", 0, "", 0, "", 0}, {"7", "7", KEY73_7, "", 0, "", 0, "", 0, "", 0}, {"8", "8", KEY73_8, "", 0, "", 0, "", 0, "", 0}, {"9", "9", KEY73_9, "", 0, "", 0, "", 0, "", 0}, {":", "", 0, "", 0, "", 0, "", 0, "", 0}, {";", "", 0, "", 0, "", 0, "", 0, "", 0}, {"<", "", 0, "", 0, "", 0, "", 0, "", 0}, {"=", "", 0, "", 0, "", 0, "", 0, "", 0}, {">", "", 0, "", 0, "", 0, "", 0, "", 0}, {"?", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x40 */ {"@", "@", 0, "", 0, "", 0, "", 0, "", 0}, {"A", "A", KEY73_CapA, "", 0, "", 0, "", 0, "", 0}, {"B", "B", KEY73_CapB, "", 0, "", 0, "", 0, "", 0}, {"C", "C", KEY73_CapC, "", 0, "", 0, "", 0, "", 0}, {"D", "D", KEY73_CapD, "", 0, "", 0, "", 0, "", 0}, {"E", "E", KEY73_CapE, "", 0, "", 0, "", 0, "", 0}, {"F", "F", KEY73_CapF, "", 0, "", 0, "", 0, "", 0}, {"G", "G", KEY73_CapG, "", 0, "", 0, "", 0, "", 0}, {"H", "H", KEY73_CapH, "", 0, "", 0, "", 0, "", 0}, {"I", "I", KEY73_CapI, "", 0, "", 0, "", 0, "", 0}, {"J", "J", KEY73_CapJ, "", 0, "", 0, "", 0, "", 0}, {"K", "K", KEY73_CapK, "", 0, "", 0, "", 0, "", 0}, {"L", "L", KEY73_CapL, "", 0, "", 0, "", 0, "", 0}, {"M", "M", KEY73_CapM, "", 0, "", 0, "", 0, "", 0}, {"N", "N", KEY73_CapN, "", 0, "", 0, "", 0, "", 0}, {"O", "O", KEY73_CapO, "", 0, "", 0, "", 0, "", 0}, /* 0x50 */ {"P", "P", KEY73_CapP, "", 0, "", 0, "", 0, "", 0}, {"Q", "Q", KEY73_CapQ, "", 0, "", 0, "", 0, "", 0}, {"R", "R", KEY73_CapR, "", 0, "", 0, "", 0, "", 0}, {"S", "S", KEY73_CapS, "", 0, "", 0, "", 0, "", 0}, {"T", "T", KEY73_CapT, "", 0, "", 0, "", 0, "", 0}, {"U", "U", KEY73_CapU, "", 0, "", 0, "", 0, "", 0}, {"V", "V", KEY73_CapV, "", 0, "", 0, "", 0, "", 0}, {"W", "W", KEY73_CapW, "", 0, "", 0, "", 0, "", 0}, {"X", "X", KEY73_CapX, "", 0, "", 0, "", 0, "", 0}, {"Y", "Y", KEY73_CapY, "", 0, "", 0, "", 0, "", 0}, {"Z", "Z", KEY73_CapZ, "", 0, "", 0, "", 0, "", 0}, {"[", "LBrack", KEY73_LBrack, "", 0, "", 0, "", 0, "", 0}, {"\\", "", 0, "", 0, "", 0, "", 0, "", 0}, {"]", "RBrack", KEY73_RBrack, "", 0, "", 0, "", 0, "", 0}, {"^", "", 0, "", 0, "", 0, "", 0, "", 0}, {"_", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x60 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"a", "", 0, "", 0, "", 0, "", 0, "", 0}, {"b", "", 0, "", 0, "", 0, "", 0, "", 0}, {"c", "", 0, "", 0, "", 0, "", 0, "", 0}, {"d", "", 0, "", 0, "", 0, "", 0, "", 0}, {"e", "", 0, "", 0, "", 0, "", 0, "", 0}, {"f", "", 0, "", 0, "", 0, "", 0, "", 0}, {"g", "", 0, "", 0, "", 0, "", 0, "", 0}, {"h", "", 0, "", 0, "", 0, "", 0, "", 0}, {"i", "", 0, "", 0, "", 0, "", 0, "", 0}, {"j", "", 0, "", 0, "", 0, "", 0, "", 0}, {"k", "", 0, "", 0, "", 0, "", 0, "", 0}, {"l", "", 0, "", 0, "", 0, "", 0, "", 0}, {"m", "", 0, "", 0, "", 0, "", 0, "", 0}, {"n", "", 0, "", 0, "", 0, "", 0, "", 0}, {"o", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x70 */ {"p", "", 0, "", 0, "", 0, "", 0, "", 0}, {"q", "", 0, "", 0, "", 0, "", 0, "", 0}, {"r", "", 0, "", 0, "", 0, "", 0, "", 0}, {"s", "", 0, "", 0, "", 0, "", 0, "", 0}, {"t", "", 0, "", 0, "", 0, "", 0, "", 0}, {"u", "", 0, "", 0, "", 0, "", 0, "", 0}, {"v", "", 0, "", 0, "", 0, "", 0, "", 0}, {"w", "", 0, "", 0, "", 0, "", 0, "", 0}, {"x", "", 0, "", 0, "", 0, "", 0, "", 0}, {"y", "", 0, "", 0, "", 0, "", 0, "", 0}, {"z", "", 0, "", 0, "", 0, "", 0, "", 0}, {"{", "", 0, "", 0, "", 0, "", 0, "", 0}, {"|", "", 0, "", 0, "", 0, "", 0, "", 0}, {"}", "", 0, "", 0, "", 0, "", 0, "", 0}, {"~", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x80 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\173", "Ans", KEY73_Ans, "\173", 173, "ANS", 4372, "", 8365, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x90 */ }; libticalcs-1.1.9+dfsg/src/keys73.h000066400000000000000000000567071327711501700166620ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TICALCS_KEYS73__ #define __TICALCS_KEYS73__ // Scan codes of the TI73 (TI's ti73.inc, line 1513) #define KEY73_Right 0x01 #define KEY73_Left 0x02 #define KEY73_Up 0x03 #define KEY73_Down 0x04 #define KEY73_Enter 0x05 #define KEY73_AlphaEnter 0x06 #define KEY73_AlphaUp 0x07 #define KEY73_AlphaDown 0x08 #define KEY73_Clear 0x09 #define KEY73_Del 0x0A #define KEY73_Ins 0x0B #define KEY73_Recall 0x0C #define KEY73_LastEnt 0x0D #define KEY73_BOL 0x0E #define KEY73_EOL 0x0F #define KEY73_SelAll 0x10 #define KEY73_UnselAll 0x11 #define KEY73_LtoTI82 0x12 #define KEY73_Backup 0x13 #define KEY73_Recieve 0x14 #define KEY73_LnkQuit 0x15 #define KEY73_Trans 0x16 #define KEY73_Rename 0x17 #define KEY73_Overw 0x18 #define KEY73_Omit 0x19 #define KEY73_Cont 0x1A #define KEY73_LtoTI83 0x1B #define KEY73_SendApp 0x1C #define KEY73_vApps 0x1C #define KEY73_SendId 0x1D #define KEY73_SendSW 0x1E #define KEY73_vALL 0x1F #define KEY73_vSendType 0x20 #define KEY73_NoWay 0x21 #define KEY73_Yes 0x22 #define KEY73_About 0x23 #define KEY73_App 0x24 #define KEY73_ProgExec 0x25 #define KEY73_Listflag 0x26 #define KEY73_menustart 0x2c #define KEY73_AreYouSure 0x2c #define KEY73_Prgm 0x2D #define KEY73_Zoom 0x2E #define KEY73_Draw 0x2F #define KEY73_SPlot 0x30 #define KEY73_Stat 0x31 #define KEY73_Math 0x32 #define KEY73_Test 0x33 #define KEY73_AppsMenu 0x34 #define KEY73_Vars 0x35 #define KEY73_Mem 0x36 #define KEY73_ConstSetmenu 0x37 #define KEY73_ConvMenu 0x38 #define KEY73_Trigmenu 0x39 #define KEY73_LIST 0x3A #define KEY73_ConstMenu 0x3B #define KEY73_Const 0x3C #define KEY73_Alpha 0x3d #define KEY73_Catalog 0x3e #define KEY73_InputDone 0x3f #define KEY73_Quit 0x40 #define KEY73_LinkIO 0x41 #define KEY73_ChkApps 0x42 #define KEY73_StatEd 0x43 #define KEY73_Graph 0x44 #define KEY73_Mode 0x45 #define KEY73_PrgmEd 0x46 #define KEY73_PrgmCr 0x47 #define KEY73_Window 0x48 #define KEY73_Y 0x49 #define KEY73_Table 0x4A #define KEY73_TblSet 0x4B #define KEY73_ChkRAM 0x4C #define KEY73_DelMem 0x4D #define KEY73_ResetMem 0x4E #define KEY73_ResetDef 0x4F #define KEY73_PrgmInput 0x50 #define KEY73_ZFactEd 0x51 #define KEY73_Error 0x52 #define KEY73_ExtApps 0x53 #define KEY73_SolveRoot 0x54 #define KEY73_StatP 0x55 #define KEY73_ConstEd 0x56 #define KEY73_PrgmSetVar 0x57 #define KEY73_Format 0x58 #define KEY73_echoStart1 0x5a #define KEY73_Trace 0x5a #define KEY73_ZFit 0x5b #define KEY73_ZIn 0x5c #define KEY73_ZOut 0x5d #define KEY73_ZPrev 0x5e #define KEY73_ZBox 0x5f #define KEY73_ZDecml 0x60 #define KEY73_SetZm 0x61 #define KEY73_ZSquar 0x62 #define KEY73_ZStd 0x63 #define KEY73_ZTrig 0x64 #define KEY73_ZQuad1 0x65 #define KEY73_ZInt 0x67 #define KEY73_ZStat 0x68 #define echoStart2 0x69 #define KEY73_Select 0x69 #define KEY73_Circl 0x6a #define KEY73_ClDrw 0x6b #define KEY73_Line 0x6c #define KEY73_Pen 0x6d #define KEY73_PtChg 0x6e #define KEY73_PtOff 0x6f #define KEY73_PtOn 0x70 #define KEY73_Vert 0x71 #define KEY73_Horiz 0x72 #define KEY73_Text 0x73 #define KEY73_TanLn 0x74 #define KEY73_ManFit 0x75 #define KEY73_Eval 0x76 #define echoStart 0x7d #define KEY73_Remain 0x7d #define KEY73_Plot3 0x7e #define KEY73_ListName 0x7f #define KEY73_Add 0x80 #define KEY73_Sub 0x81 #define KEY73_Mul 0x82 #define KEY73_Div 0x83 #define KEY73_Expon 0x84 #define KEY73_LParen 0x85 #define KEY73_RParen 0x86 #define KEY73_LBrack 0x87 #define KEY73_RBrack 0x88 #define KEY73_Shade 0x89 #define KEY73_Store 0x8a #define KEY73_Comma 0x8b #define KEY73_Chs 0x8c #define KEY73_DecPnt 0x8d #define KEY73_0 0x8e #define KEY73_1 0x8f #define KEY73_2 0x90 #define KEY73_3 0x91 #define KEY73_4 0x92 #define KEY73_5 0x93 #define KEY73_6 0x94 #define KEY73_7 0x95 #define KEY73_8 0x96 #define KEY73_9 0x97 #define KEY73_EE 0x98 #define KEY73_Space 0x99 #define KEY73_CapA 0x9A #define KEY73_CapB 0x9B #define KEY73_CapC 0x9C #define KEY73_CapD 0x9D #define KEY73_CapE 0x9E #define KEY73_CapF 0x9F #define KEY73_CapG 0xA0 #define KEY73_CapH 0xA1 #define KEY73_CapI 0xA2 #define KEY73_CapJ 0xA3 #define KEY73_CapK 0xA4 #define KEY73_CapL 0xA5 #define KEY73_CapM 0xA6 #define KEY73_CapN 0xA7 #define KEY73_CapO 0xA8 #define KEY73_CapP 0xA9 #define KEY73_CapQ 0xAA #define KEY73_CapR 0xAB #define KEY73_CapS 0xAC #define KEY73_CapT 0xAD #define KEY73_CapU 0xAE #define KEY73_CapV 0xAF #define KEY73_CapW 0xB0 #define KEY73_CapX 0xB1 #define KEY73_CapY 0xB2 #define KEY73_CapZ 0xB3 #define KEY73_Varx 0xB4 #define KEY73_Pi 0xB5 #define KEY73_Inv 0xB6 #define KEY73_Sin 0xB7 #define KEY73_ASin 0xB8 #define KEY73_Cos 0xB9 #define KEY73_ACos 0xBA #define KEY73_Tan 0xBB #define KEY73_ATan 0xBC #define KEY73_Square 0xBD #define KEY73_Sqrt 0xBE #define KEY73_Ln 0xBF #define KEY73_Exp 0xC0 #define KEY73_Log 0xC1 #define KEY73_ALog 0xC2 #define KEY73_ToABC 0xC3 #define KEY73_Ans 0xc5 #define KEY73_Colon 0xc6 #define KEY73_Unit 0xc7 #define KEY73_FracSlash 0xc8 #define KEY73_Root 0xc9 #define KEY73_Quest 0xca #define KEY73_Quote 0xcb #define KEY73_Theta 0xcc #define KEY73_If 0xcd #define KEY73_Then 0xce #define KEY73_Else 0xcf #define KEY73_For 0xd0 #define KEY73_While 0xd1 #define KEY73_Repeat 0xd2 #define KEY73_End 0xd3 #define KEY73_Pause 0xd4 #define KEY73_Lbl 0xd5 #define KEY73_Goto 0xd6 #define KEY73_ISG 0xd7 #define KEY73_DSL 0xd8 #define KEY73_Menu 0xd9 #define KEY73_Exec 0xda #define KEY73_Return 0xdb #define KEY73_Stop 0xdc #define KEY73_Input 0xdd #define KEY73_Prompt 0xde #define KEY73_Disp 0xdf #define KEY73_DispG 0xe0 #define KEY73_DispT 0xe1 #define KEY73_Output 0xe2 #define KEY73_GetKey 0xe3 #define KEY73_ClrHome 0xe4 #define KEY73_Percent 0xe6 #define KEY73_MixSimp 0xe7 #define KEY73_FracDec 0xe8 #define KEY73_Simp 0xe9 #define KEY73_UnredF 0xea #define KEY73_IDiv 0xeb #define KEY73_Convert 0xec #define KEY73_LBrace 0xed #define KEY73_RBrace 0xee #define KEY73_L1A 0xef #define KEY73_L2A 0xf0 #define KEY73_L3A 0xf1 #define KEY73_L4A 0xf2 #define KEY73_L5A 0xf3 #define KEY73_L6A 0xf4 #define KEY73_ConvLength 0xf5 #define KEY73_ConvArea 0xf6 #define KEY73_ConvVolume 0xf7 #define KEY73_ConvTime 0xf8 #define KEY73_ConvTemp 0xf9 #define KEY73_ConvMass 0xfa #define KEY73_ConvSpeed 0xfb // FE (ExtendEcho) prefixed keys: #define KE1BT 0xfe00 #define KEY73_DrawInv 0xfe00 #define KEY73_DrawF 0xfe01 #define KEY73_PixelOn 0xfe02 #define KEY73_PixelOff 0xfe03 #define KEY73_PxlTest 0xfe04 #define KEY73_RCGDB 0xfe05 #define KEY73_RCPic 0xfe06 #define KEY73_STGDB 0xfe07 #define KEY73_STPic 0xfe08 #define KEY73_Abs 0xfe09 #define KEY73_TEqu 0xfe0a #define KEY73_TNoteQ 0xfe0b #define KEY73_TGT 0xfe0c #define KEY73_TGTE 0xfe0d #define KEY73_TLT 0xfe0e #define KEY73_TLTE 0xfe0f #define KEY73_And 0xfe10 #define KEY73_Or 0xfe11 #define KEY73_Xor 0xfe12 #define KEY73_Not 0xfe13 #define KEY73_XRoot 0xfe15 #define KEY73_Cube 0xfe16 #define KEY73_CbRt 0xfe17 #define KEY73_ToDec 0xfe18 #define KEY73_CubicR 0xfe19 #define KEY73_QuartR 0xfe1a #define KEY73_Plot1 0xfe1b #define KEY73_Plot2 0xfe1c #define KEY73_Round 0xfe1d #define KEY73_IPart 0xfe1e #define KEY73_FPart 0xfe1f #define KEY73_Int 0xfe20 #define KEY73_Rand 0xfe21 #define KEY73_NPR 0xfe22 #define KEY73_NCR 0xfe23 #define KEY73_XFactorial 0xfe24 #define KEY73_Rad 0xfe25 #define KEY73_Degr 0xfe26 #define KEY73_APost 0xfe27 #define KEY73_ToDMS 0xfe28 #define KEY73_RToPo 0xfe29 #define KEY73_RToPr 0xfe2a #define KEY73_PToRx 0xfe2b #define KEY73_PToRy 0xfe2c #define KEY73_RowSwap 0xfe2d #define KEY73_RowPlus 0xfe2e #define KEY73_TimRow 0xfe2f #define KEY73_TRowP 0xfe30 #define KEY73_SortA 0xfe31 #define KEY73_SortD 0xfe32 #define KEY73_Seq 0xfe33 #define KEY73_Min 0xfe34 #define KEY73_Max 0xfe35 #define KEY73_Mean 0xfe36 #define KEY73_Median 0xfe37 #define KEY73_Sum 0xfe38 #define KEY73_Prod 0xfe39 #define KEY73_Det 0xfe3a #define KEY73_Transp 0xfe3b #define KEY73_Dim 0xfe3c #define KEY73_Fill 0xfe3d #define KEY73_Ident 0xfe3e #define KEY73_Randm 0xfe3f #define KEY73_Aug 0xfe40 #define KEY73_LstMode 0xfe41 #define KEY73_mRad 0xfe43 #define KEY73_mDeg 0xfe44 #define KEY73_mNormF 0xfe45 #define KEY73_mSci 0xfe46 #define KEY73_Fix 0xfe47 #define KEY73_mFloat 0xfe48 #define KEY73_SetMenu 0xfe49 #define KEY73_EOFrac 0xfe4a #define KEY73_BoyIcon 0xfe4b #define KEY73_TreeIcon 0xfe4c #define KEY73_FaceIcon 0xfe4d #define KEY73_CircleIcon 0xfe4e #define KEY73_DiamonIcon 0xfe4f #define KEY73_StartIcon 0xfe50 #define KEY73_DollarIcon 0xfe51 #define KEY73_FNOn 0xfe54 #define KEY73_FNOff 0xfe55 #define KEY73_PlotsOn 0xfe56 #define KEY73_PlotsOff 0xfe57 #define KEY73_PixelChg 0xfe58 #define KEY73_SendMBL 0xfe59 #define KEY73_RecvMBL 0xfe5a #define KEY73_BoxPlot 0xfe5b #define KEY73_BoxIcon 0xfe5c #define KEY73_CrossIcon 0xfe5d #define KEY73_DotIcon 0xfe5e #define KE2BT (0xfe00+95) #define KEY73_Seqential 0xfe5f #define KEY73_SimulG 0xfe60 #define KEY73_CoordOn 0xfe61 #define KEY73_CoordOff 0xfe62 #define KEY73_DrawLine 0xfe63 #define KEY73_DrawDot 0xfe64 #define KEY73_AxisOn 0xfe65 #define KEY73_AxisOff 0xfe66 #define KEY73_GridOn 0xfe67 #define KEY73_GridOff 0xfe68 #define KEY73_LblOn 0xfe69 #define KEY73_OblOff 0xfe6a #define KEY73_PolarG 0xfe6b #define KEY73_RectG 0xfe6c #define KEY73_L1 0xfe6d #define KEY73_L2 0xfe6e #define KEY73_L3 0xfe6f #define KEY73_L4 0xfe70 #define KEY73_L5 0xfe71 #define KEY73_L6 0xfe72 #define KEY73_MatA 0xfe73 #define KEY73_MatB 0xfe74 #define KEY73_MatC 0xfe75 #define KEY73_MatD 0xfe76 #define KEY73_MatE 0xfe77 #define KEY73_Xmin 0xfe78 #define KEY73_Xmax 0xfe79 #define KEY73_Xscl 0xfe7a #define KEY73_Ymin 0xfe7b #define KEY73_Ymax 0xfe7c #define KEY73_Yscl 0xfe7d #define KEY73_Tmin 0xfe7e #define KEY73_Tmax 0xfe7f #define KEY73_TStep 0xfe80 #define KEY73_Omin 0xfe81 #define KEY73_Omax 0xfe82 #define KEY73_OStep 0xfe83 #define KEY73_u0 0xfe84 #define KEY73_v0 0xfe85 #define KEY73_nMin 0xfe86 #define KEY73_nMax 0xfe87 #define KEY73_DeltaY 0xfe88 #define KEY73_DeltaX 0xfe89 #define KEY73_ZXmin 0xfe8a #define KEY73_ZXmax 0xfe8b #define KEY73_ZXscl 0xfe8c #define KEY73_ZYmin 0xfe8d #define KEY73_ZYmax 0xfe8e #define KEY73_ZYscl 0xfe8f #define KEY73_ZTmin 0xfe90 #define KEY73_ZTmax 0xfe91 #define KEY73_ZTStep 0xfe92 #define KEY73_ZOmin 0xfe93 #define KEY73_ZOmax 0xfe94 #define KEY73_ZOStep 0xfe95 #define KEY73_ABC 0xfe96 #define KEY73_BC 0xfe97 #define KEY73_AutoSimp 0xfe98 #define KEY73_ManSimp 0xfe99 #define KEY73_DelLast 0xfe9a #define KEY73_singleC 0xfe9b #define KEY73_MultiC 0xfe9c #define KEY73_Pic1 0xfe9d #define KEY73_Pic2 0xfe9e #define KEY73_Pic3 0xfe9f #define KEY73_DelVar 0xfea0 #define KEY73_GetCalc 0xfea1 #define KEY73_Stndrd 0xfea2 #define KEY73_Param 0xfea3 #define KEY73_Polar 0xfea4 #define KEY73_AFillOn 0xfea5 #define KEY73_AFillOff 0xfea6 #define KEY73_ACalcOn 0xfea7 #define KEY73_ACalcOff 0xfea8 #define KEY73_SetConst 0xfea9 #define KEY73_GraphStyle 0xfeaa #define KEY73_ExprOn 0xfeab #define KEY73_ExprOff 0xfeac #define KEY73_StatA 0xfead #define KEY73_StatB 0xfeae #define KEY73_StatC 0xfeaf #define KEY73_Corr 0xfeb0 #define KEY73_StatD 0xfeb1 #define KEY73_StatE 0xfeb2 #define KEY73_RegEq 0xfeb3 #define KEY73_MinX 0xfeb4 #define KEY73_Q1 0xfeb5 #define KEY73_MD 0xfeb6 #define KEY73_Q3 0xfeb7 #define KEY73_MaxX 0xfeb8 #define KEY73_StatX1 0xfeb9 #define KEY73_StatY1 0xfeba #define KEY73_StatX2 0xfebb #define KEY73_StatY2 0xfebc #define KEY73_StatX3 0xfebd #define KEY73_StatY3 0xfebe #define KEY73_TblMin 0xfebf #define KEY73_TblStep 0xfec0 #define KEY73_SetupLst 0xfec1 #define KEY73_ClrAllLst 0xfec2 #define KEY73_Logistic 0xfec3 #define KEY73_c1 0xfec4 #define KEY73_c2 0xfec5 #define KEY73_c3 0xfec6 #define KEY73_c4 0xfec7 #define KEY73_PlotStart 0xfec8 #define KEY73_ZPlotStart 0xfec9 #define KEY73_XFact 0xfeca #define KEY73_YFact 0xfecb #define KEY73_MaxY 0xfecc #define KEY73_TblInput 0xfecd #define KEY73_PlotStep 0xfece #define KEY73_ZPlotStep 0xfecf #define KEY73_SelectA 0xfed0 #define KEY73_ZFitA 0xfed1 #define KEY73_OneVar 0xfed2 #define KEY73_TwoVar 0xfed3 #define KEY73_LR 0xfed4 #define KEY73_LRExp 0xfed5 #define KEY73_LRLn 0xfed6 #define KEY73_MedMed 0xfed7 #define KEY73_Quad 0xfed8 #define KEY73_ClrLst 0xfed9 #define KEY73_Hist 0xfeda #define KEY73_XYLine 0xfedb #define KEY73_Scatter 0xfedc #define KEY73_LR1 0xfedd #define KEY73_ClrTbl 0xfede // FC (ExtendEcho2) prefixed keys: #define KE2BT2 0xfc00 #define KEY73_GDB1 0xfc00 #define KEY73_GDB2 0xfc01 #define KEY73_GDB3 0xfc02 #define KEY73_Y1 0xfc03 #define KEY73_Y2 0xfc04 #define KEY73_Y3 0xfc05 #define KEY73_Y4 0xfc06 #define KEY73_Y5 0xfc07 #define KEY73_Y6 0xfc08 #define KEY73_Y7 0xfc09 #define KEY73_Y8 0xfc0a #define KEY73_Y9 0xfc0b #define KEY73_Y0 0xfc0c #define KEY73_X1T 0xfc0d #define KEY73_Y1T 0xfc0e #define KEY73_X2T 0xfc0f #define KEY73_Y2T 0xfc10 #define KEY73_X3T 0xfc11 #define KEY73_Y3T 0xfc12 #define KEY73_X4T 0xfc13 #define KEY73_Y4T 0xfc14 #define KEY73_X5T 0xfc15 #define KEY73_Y5T 0xfc16 #define KEY73_X6T 0xfc17 #define KEY73_Y6T 0xfc18 #define KEY73_R1 0xfc19 #define KEY73_R2 0xfc1a #define KEY73_R3 0xfc1b #define KEY73_R4 0xfc1c #define KEY73_R5 0xfc1d #define KEY73_R6 0xfc1e #define KEY73_GDB4 0xfc1f #define KEY73_GDB5 0xfc20 #define KEY73_GDB6 0xfc21 #define KEY73_Pic4 0xfc22 #define KEY73_Pic5 0xfc23 #define KEY73_Pic6 0xfc24 #define KEY73_GDB7 0xfc25 #define KEY73_GDB8 0xfc26 #define KEY73_GDB9 0xfc27 #define KEY73_GDB0 0xfc28 #define KEY73_Pic7 0xfc29 #define KEY73_Pic8 0xfc2a #define KEY73_Pic9 0xfc2b #define KEY73_Pic0 0xfc2c #define KEY73_StatN 0xfc2d #define KEY73_XMean 0xfc2e #define KEY73_LCM 0xfc32 #define KEY73_GCD 0xfc33 #define KEY73_RandInt 0xfc34 #define KEY73_RandNorm 0xfc35 #define KEY73_ToPolar 0xfc36 #define KEY73_ToRect 0xfc37 #define KEY73_YMean 0xfc38 #define KEY73_StdX 0xfc39 #define KEY73_StdX1 0xfc3a #define KEY73_w0 0xfc3b #define KEY73_MatF 0xfc3c #define KEY73_MatG 0xfc3d #define KEY73_MatRH 0xfc3e #define KEY73_MatI 0xfc3f #define KEY73_MatJ 0xfc40 #define KEY73_YMean1 0xfc41 #define KEY73_StdY 0xfc42 #define KEY73_StdY1 0xfc43 #define KEY73_MatToLst 0xfc44 #define KEY73_LstToMat 0xfc45 #define KEY73_CumSum 0xfc46 #define KEY73_DeltaLst 0xfc47 #define KEY73_StdDev 0xfc48 #define KEY73_Variance 0xfc49 #define KEY73_Length 0xfc4a #define KEY73_EquToStrng 0xfc4b #define KEY73_StrngToEqu 0xfc4c #define KEY73_Expr 0xfc4d #define KEY73_SubStrng 0xfc4e #define KEY73_InStrng 0xfc4f #define KEY73_Str1 0xfc50 #define KEY73_Str2 0xfc51 #define KEY73_Str3 0xfc52 #define KEY73_Str4 0xfc53 #define KEY73_Str5 0xfc54 #define KEY73_Str6 0xfc55 #define KEY73_Str7 0xfc56 #define KEY73_Str8 0xfc57 #define KEY73_Str9 0xfc58 #define KEY73_Str0 0xfc59 #define KEY73_SimpFact 0xfc5a #define KEY73_PictPlot 0xfc5b #define KEY73_CirclePlot 0xfc5c #define KEY73_StemPlot 0xfc5d #define KEY73_BarPlot 0xfc5e #define KEY73_SumX 0xfc66 #define KEY73_SumX2 0xfc67 #define KEY73_SumY 0xfc68 #define XRes 0xfc69 #define KEY73_SumY2 0xfc6a #define KEY73_SumXY 0xfc6b #define KEY73_uXRes 0xfc6c #define KEY73_ModBox 0xfc6d #define KEY73_NormProb 0xfc6e #define KEY73_MinY 0xfc6f #define KEY73_Ref 0xfc70 #define KEY73_RRef 0xfc71 #define KEY73_LRSqr 0xfc72 #define KEY73_BRSqr 0xfc73 #define KEY73_DiagOn 0xfc74 #define KEY73_DiagOff 0xfc75 #endif libticalcs-1.1.9+dfsg/src/keys83.c000066400000000000000000000176351327711501700166530ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: keys83p.c 2385 2006-05-26 07:44:30Z roms $ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2007 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "ticalcs.h" #include "keys83.h" /* Conversion of an ASCII code into a TI key This table is very incomplete. It contains most of ASCII chars only. Same for TI73/TI83. */ const OldCalcKeys_ TI83_KEYS[] = { /* 0x00 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"Enter", "Enter", KEY83_Enter, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x10 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"ESC", "Quit", KEY83_Quit, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x20 */ {" ", "Space", KEY83_Space, "", 0, "", 0, "", 0, "", 0}, {"!", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"#", "", 0, "", 0, "", 0, "", 0, "", 0}, {"$", "", 0, "", 0, "", 0, "", 0, "", 0}, {"%", "", 0, "", 0, "", 0, "", 0, "", 0}, {"&", "", 0, "", 0, "", 0, "", 0, "", 0}, {"'", "", 0, "", 0, "", 0, "", 0, "", 0}, {"(", "LParen", KEY83_LParen, "", 0, "", 0, "", 0, "", 0}, {")", "RParen", KEY83_RParen, "", 0, "", 0, "", 0, "", 0}, {"*", "Mul", KEY83_Mul, "", 0, "", 0, "", 0, "", 0}, {"+", "Add", KEY83_Add, "", 0, "", 0, "", 0, "", 0}, {",", "Comma", KEY83_Comma, "", 0, "", 0, "", 0, "", 0}, {"-", "Sub", KEY83_Sub, "", 0, "", 0, "", 0, "", 0}, {".", "", 0, "", 0, "", 0, "", 0, "", 0}, {"/", "Div", KEY83_Div, "", 0, "", 0, "", 0, "", 0}, /* 0x30 */ {"0", "0", KEY83_0, "", 0, "", 0, "", 0, "", 0}, {"1", "1", KEY83_1, "", 0, "", 0, "", 0, "", 0}, {"2", "2", KEY83_2, "", 0, "", 0, "", 0, "", 0}, {"3", "3", KEY83_3, "", 0, "", 0, "", 0, "", 0}, {"4", "4", KEY83_4, "", 0, "", 0, "", 0, "", 0}, {"5", "5", KEY83_5, "", 0, "", 0, "", 0, "", 0}, {"6", "6", KEY83_6, "", 0, "", 0, "", 0, "", 0}, {"7", "7", KEY83_7, "", 0, "", 0, "", 0, "", 0}, {"8", "8", KEY83_8, "", 0, "", 0, "", 0, "", 0}, {"9", "9", KEY83_9, "", 0, "", 0, "", 0, "", 0}, {":", "", 0, "", 0, "", 0, "", 0, "", 0}, {";", "", 0, "", 0, "", 0, "", 0, "", 0}, {"<", "", 0, "", 0, "", 0, "", 0, "", 0}, {"=", "", 0, "", 0, "", 0, "", 0, "", 0}, {">", "", 0, "", 0, "", 0, "", 0, "", 0}, {"?", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x40 */ {"@", "@", 0, "", 0, "", 0, "", 0, "", 0}, {"A", "A", KEY83_CapA, "", 0, "", 0, "", 0, "", 0}, {"B", "B", KEY83_CapB, "", 0, "", 0, "", 0, "", 0}, {"C", "C", KEY83_CapC, "", 0, "", 0, "", 0, "", 0}, {"D", "D", KEY83_CapD, "", 0, "", 0, "", 0, "", 0}, {"E", "E", KEY83_CapE, "", 0, "", 0, "", 0, "", 0}, {"F", "F", KEY83_CapF, "", 0, "", 0, "", 0, "", 0}, {"G", "G", KEY83_CapG, "", 0, "", 0, "", 0, "", 0}, {"H", "H", KEY83_CapH, "", 0, "", 0, "", 0, "", 0}, {"I", "I", KEY83_CapI, "", 0, "", 0, "", 0, "", 0}, {"J", "J", KEY83_CapJ, "", 0, "", 0, "", 0, "", 0}, {"K", "K", KEY83_CapK, "", 0, "", 0, "", 0, "", 0}, {"L", "L", KEY83_CapL, "", 0, "", 0, "", 0, "", 0}, {"M", "M", KEY83_CapM, "", 0, "", 0, "", 0, "", 0}, {"N", "N", KEY83_CapN, "", 0, "", 0, "", 0, "", 0}, {"O", "O", KEY83_CapO, "", 0, "", 0, "", 0, "", 0}, /* 0x50 */ {"P", "P", KEY83_CapP, "", 0, "", 0, "", 0, "", 0}, {"Q", "Q", KEY83_CapQ, "", 0, "", 0, "", 0, "", 0}, {"R", "R", KEY83_CapR, "", 0, "", 0, "", 0, "", 0}, {"S", "S", KEY83_CapS, "", 0, "", 0, "", 0, "", 0}, {"T", "T", KEY83_CapT, "", 0, "", 0, "", 0, "", 0}, {"U", "U", KEY83_CapU, "", 0, "", 0, "", 0, "", 0}, {"V", "V", KEY83_CapV, "", 0, "", 0, "", 0, "", 0}, {"W", "W", KEY83_CapW, "", 0, "", 0, "", 0, "", 0}, {"X", "X", KEY83_CapX, "", 0, "", 0, "", 0, "", 0}, {"Y", "Y", KEY83_CapY, "", 0, "", 0, "", 0, "", 0}, {"Z", "Z", KEY83_CapZ, "", 0, "", 0, "", 0, "", 0}, {"[", "LBrack", KEY83_LBrack, "", 0, "", 0, "", 0, "", 0}, {"\\", "", 0, "", 0, "", 0, "", 0, "", 0}, {"]", "RBrack", KEY83_RBrack, "", 0, "", 0, "", 0, "", 0}, {"^", "", 0, "", 0, "", 0, "", 0, "", 0}, {"_", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x60 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"a", "", 0, "", 0, "", 0, "", 0, "", 0}, {"b", "", 0, "", 0, "", 0, "", 0, "", 0}, {"c", "", 0, "", 0, "", 0, "", 0, "", 0}, {"d", "", 0, "", 0, "", 0, "", 0, "", 0}, {"e", "", 0, "", 0, "", 0, "", 0, "", 0}, {"f", "", 0, "", 0, "", 0, "", 0, "", 0}, {"g", "", 0, "", 0, "", 0, "", 0, "", 0}, {"h", "", 0, "", 0, "", 0, "", 0, "", 0}, {"i", "", 0, "", 0, "", 0, "", 0, "", 0}, {"j", "", 0, "", 0, "", 0, "", 0, "", 0}, {"k", "", 0, "", 0, "", 0, "", 0, "", 0}, {"l", "", 0, "", 0, "", 0, "", 0, "", 0}, {"m", "", 0, "", 0, "", 0, "", 0, "", 0}, {"n", "", 0, "", 0, "", 0, "", 0, "", 0}, {"o", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x70 */ {"p", "", 0, "", 0, "", 0, "", 0, "", 0}, {"q", "", 0, "", 0, "", 0, "", 0, "", 0}, {"r", "", 0, "", 0, "", 0, "", 0, "", 0}, {"s", "", 0, "", 0, "", 0, "", 0, "", 0}, {"t", "", 0, "", 0, "", 0, "", 0, "", 0}, {"u", "", 0, "", 0, "", 0, "", 0, "", 0}, {"v", "", 0, "", 0, "", 0, "", 0, "", 0}, {"w", "", 0, "", 0, "", 0, "", 0, "", 0}, {"x", "", 0, "", 0, "", 0, "", 0, "", 0}, {"y", "", 0, "", 0, "", 0, "", 0, "", 0}, {"z", "", 0, "", 0, "", 0, "", 0, "", 0}, {"{", "", 0, "", 0, "", 0, "", 0, "", 0}, {"|", "", 0, "", 0, "", 0, "", 0, "", 0}, {"}", "", 0, "", 0, "", 0, "", 0, "", 0}, {"~", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x80 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\173", "Ans", KEY83_Ans, "\173", 173, "ANS", 4372, "", 8365, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x90 */ }; libticalcs-1.1.9+dfsg/src/keys83.h000066400000000000000000000634451327711501700166600ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: keys83p.h 1179 2005-06-06 14:42:32Z roms $ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TICALCS_KEYS83__ #define __TICALCS_KEYS83__ // Scan codes of the TI83 (thanks to B. Moody) #define KEY83_Right 0x01 #define KEY83_Left 0x02 #define KEY83_Up 0x03 #define KEY83_Down 0x04 #define KEY83_Enter 0x05 #define KEY83_AlphaEnter 0x06 #define KEY83_AlphaUp 0x07 #define KEY83_AlphaDown 0x08 #define KEY83_Clear 0x09 #define KEY83_Del 0x0A #define KEY83_Ins 0x0B #define KEY83_Recall 0x0C #define KEY83_LastEnt 0x0D #define KEY83_BOL 0x0E #define KEY83_EOL 0x0F #define KEY83_SelAll 0x10 #define KEY83_UnselAll 0x11 #define KEY83_LtoTI82 0x12 #define KEY83_Backup 0x13 #define KEY83_Recieve 0x14 #define KEY83_LnkQuit 0x15 #define KEY83_Trans 0x16 #define KEY83_Rename 0x17 #define KEY83_Overw 0x18 #define KEY83_Omit 0x19 #define KEY83_Cont 0x1A #define KEY83_SendID 0x1B #define KEY83_SendSW 0x1C #define KEY83_Yes 0x1D #define KEY83_NoWay 0x1E #define KEY83_vSendType 0x1F #define KEY83_OverWAll 0x20 #define KEY83_No 0x25 #define KEY83_KReset 0x26 #define KEY83_App 0x27 #define KEY83_Doug 0x28 #define KEY83_Listflag 0x29 #define KEY83_AreYouSure 0x2B #define KEY83_AppsMenu 0x2C #define KEY83_Prgm 0x2D #define KEY83_Zoom 0x2E #define KEY83_Draw 0x2F #define KEY83_SPlot 0x30 #define KEY83_Stat 0x31 #define KEY83_Math 0x32 #define KEY83_Test 0x33 #define KEY83_Char 0x34 #define KEY83_Vars 0x35 #define KEY83_Mem 0x36 #define KEY83_Matrix 0x37 #define KEY83_Dist 0x38 #define KEY83_Angle 0x39 #define KEY83_List 0x3A #define KEY83_Calc 0x3B #define KEY83_Fin 0x3C #define KEY83_Catalog 0x3E #define KEY83_Off 0x3F #define KEY83_Quit 0x40 #define KEY83_LinkIO 0x41 #define KEY83_MatrixEd 0x42 #define KEY83_StatEd 0x43 #define KEY83_Graph 0x44 #define KEY83_Mode 0x45 #define KEY83_PrgmEd 0x46 #define KEY83_PrgmCr 0x47 #define KEY83_Window 0x48 #define KEY83_Yequ 0x49 #define KEY83_Table 0x4A #define KEY83_TblSet 0x4B #define KEY83_ChkRAM 0x4C #define KEY83_DelMem 0x4D #define KEY83_ResetMem 0x4E #define KEY83_ResetDef 0x4F #define KEY83_PrgmInput 0x50 #define KEY83_ZFactEd 0x51 #define KEY83_Error 0x52 #define KEY83_SolveTVM 0x53 #define KEY83_SolveRoot 0x54 #define KEY83_StatP 0x55 #define KEY83_InfStat 0x56 #define KEY83_Format 0x57 #define KEY83_ExtApps 0x58 #define KEY83_NewApps 0x59 #define KEY83_Trace 0x5A #define KEY83_ZFit 0x5B #define KEY83_ZIn 0x5C #define KEY83_ZOut 0x5D #define KEY83_ZPrev 0x5E #define KEY83_Box 0x5F #define KEY83_Decml 0x60 #define KEY83_SetZm 0x61 #define KEY83_Squar 0x62 #define KEY83_Std 0x63 #define KEY83_Trig 0x64 #define KEY83_UsrZm 0x65 #define KEY83_ZSto 0x66 #define KEY83_ZInt 0x67 #define KEY83_ZStat 0x68 #define KEY83_Select 0x69 #define KEY83_Circl 0x6A #define KEY83_ClDrw 0x6B #define KEY83_Line 0x6C #define KEY83_Pen 0x6D #define KEY83_PtChg 0x6E #define KEY83_PtOff 0x6F #define KEY83_PtOn 0x70 #define KEY83_Vert 0x71 #define KEY83_Horiz 0x72 #define KEY83_Text 0x73 #define KEY83_TanLn 0x74 #define KEY83_Eval 0x75 #define KEY83_Inters 0x76 #define KEY83_DYDX 0x77 #define KEY83_FnIntg 0x78 #define KEY83_RootG 0x79 #define KEY83_DYDT 0x7A #define KEY83_DXDT 0x7B #define KEY83_DRDo 0x7C #define KEY83_GFMin 0x7D #define KEY83_GFMax 0x7E #define KEY83_ListName 0x7F #define KEY83_Add 0x80 #define KEY83_Sub 0x81 #define KEY83_Mul 0x82 #define KEY83_Div 0x83 #define KEY83_Expon 0x84 #define KEY83_LParen 0x85 #define KEY83_RParen 0x86 #define KEY83_LBrack 0x87 #define KEY83_RBrack 0x88 #define KEY83_Shade 0x89 #define KEY83_Store 0x8A #define KEY83_Comma 0x8B #define KEY83_Chs 0x8C #define KEY83_DecPnt 0x8D #define KEY83_0 0x8E #define KEY83_1 0x8F #define KEY83_2 0x90 #define KEY83_3 0x91 #define KEY83_4 0x92 #define KEY83_5 0x93 #define KEY83_6 0x94 #define KEY83_7 0x95 #define KEY83_8 0x96 #define KEY83_9 0x97 #define KEY83_EE 0x98 #define KEY83_Space 0x99 #define KEY83_CapA 0x9A #define KEY83_CapB 0x9B #define KEY83_CapC 0x9C #define KEY83_CapD 0x9D #define KEY83_CapE 0x9E #define KEY83_CapF 0x9F #define KEY83_CapG 0xA0 #define KEY83_CapH 0xA1 #define KEY83_CapI 0xA2 #define KEY83_CapJ 0xA3 #define KEY83_CapK 0xA4 #define KEY83_CapL 0xA5 #define KEY83_CapM 0xA6 #define KEY83_CapN 0xA7 #define KEY83_CapO 0xA8 #define KEY83_CapP 0xA9 #define KEY83_CapQ 0xAA #define KEY83_CapR 0xAB #define KEY83_CapS 0xAC #define KEY83_CapT 0xAD #define KEY83_CapU 0xAE #define KEY83_CapV 0xAF #define KEY83_CapW 0xB0 #define KEY83_CapX 0xB1 #define KEY83_CapY 0xB2 #define KEY83_CapZ 0xB3 #define KEY83_Varx 0xB4 #define KEY83_Pi 0xB5 #define KEY83_Inv 0xB6 #define KEY83_Sin 0xB7 #define KEY83_ASin 0xB8 #define KEY83_Cos 0xB9 #define KEY83_ACos 0xBA #define KEY83_Tan 0xBB #define KEY83_ATan 0xBC #define KEY83_Square 0xBD #define KEY83_Sqrt 0xBE #define KEY83_Ln 0xBF #define KEY83_Exp 0xC0 #define KEY83_Log 0xC1 #define KEY83_ALog 0xC2 #define KEY83_ToABC 0xC3 #define KEY83_ClrTbl 0xC4 #define KEY83_Ans 0xC5 #define KEY83_Colon 0xC6 #define KEY83_NDeriv 0xC7 #define KEY83_FnInt 0xC8 #define KEY83_Root 0xC9 #define KEY83_Quest 0xCA #define KEY83_Quote 0xCB #define KEY83_Theta 0xCC #define KEY83_If 0xCD #define KEY83_Then 0xCE #define KEY83_Else 0xCF #define KEY83_For 0xD0 #define KEY83_While 0xD1 #define KEY83_Repeat 0xD2 #define KEY83_End 0xD3 #define KEY83_Pause 0xD4 #define KEY83_Lbl 0xD5 #define KEY83_Goto 0xD6 #define KEY83_ISG 0xD7 #define KEY83_DSL 0xD8 #define KEY83_Menu 0xD9 #define KEY83_Exec 0xDA #define KEY83_Return 0xDB #define KEY83_Stop 0xDC #define KEY83_Input 0xDD #define KEY83_Prompt 0xDE #define KEY83_Disp 0xDF #define KEY83_DispG 0xE0 #define KEY83_DispT 0xE1 #define KEY83_Output 0xE2 #define KEY83_GetKey 0xE3 #define KEY83_ClrHome 0xE4 #define KEY83_PrtScr 0xE5 #define KEY83_SinH 0xE6 #define KEY83_CosH 0xE7 #define KEY83_TanH 0xE8 #define KEY83_ASinH 0xE9 #define KEY83_ACosH 0xEA #define KEY83_ATanH 0xEB #define KEY83_LBrace 0xEC #define KEY83_RBrace 0xED #define KEY83_I 0xEE #define KEY83_CONSTeA 0xEF #define KEY83_Plot3 0xF0 #define KEY83_FMin 0xF1 #define KEY83_FMax 0xF2 #define KEY83_L1A 0xF3 #define KEY83_L2A 0xF4 #define KEY83_L3A 0xF5 #define KEY83_L4A 0xF6 #define KEY83_L5A 0xF7 #define KEY83_L6A 0xF8 #define KEY83_unA 0xF9 #define KEY83_vnA 0xFA #define KEY83_wnA 0xFB // FE (ExtendEcho) prefixed keys: #define KE1BT 0xfe00 #define KEY83_DrawInv 0xfe00 #define KEY83_DrawF 0xfe01 #define KEY83_PixelOn 0xfe02 #define KEY83_PixelOff 0xfe03 #define KEY83_PxlTest 0xfe04 #define KEY83_RCGDB 0xfe05 #define KEY83_RCPic 0xfe06 #define KEY83_STGDB 0xfe07 #define KEY83_STPic 0xfe08 #define KEY83_Abs 0xfe09 #define KEY83_TEqu 0xfe0a #define KEY83_TNoteQ 0xfe0b #define KEY83_TGT 0xfe0c #define KEY83_TGTE 0xfe0d #define KEY83_TLT 0xfe0e #define KEY83_TLTE 0xfe0f #define KEY83_And 0xfe10 #define KEY83_Or 0xfe11 #define KEY83_Xor 0xfe12 #define KEY83_Not 0xfe13 #define KEY83_LR1 0xfe14 #define KEY83_XRoot 0xfe15 #define KEY83_Cube 0xfe16 #define KEY83_CbRt 0xfe17 #define KEY83_ToDec 0xfe18 #define KEY83_CubicR 0xfe19 #define KEY83_QuartR 0xfe1a #define KEY83_Plot1 0xfe1b #define KEY83_Plot2 0xfe1c #define KEY83_Round 0xfe1d #define KEY83_IPart 0xfe1e #define KEY83_FPart 0xfe1f #define KEY83_Int 0xfe20 #define KEY83_Rand 0xfe21 #define KEY83_NPR 0xfe22 #define KEY83_NCR 0xfe23 #define KEY83_XFactorial 0xfe24 #define KEY83_Rad 0xfe25 #define KEY83_Degr 0xfe26 #define KEY83_APost 0xfe27 #define KEY83_ToDMS 0xfe28 #define KEY83_RToPo 0xfe29 #define KEY83_RToPr 0xfe2a #define KEY83_PToRx 0xfe2b #define KEY83_PToRy 0xfe2c #define KEY83_RowSwap 0xfe2d #define KEY83_RowPlus 0xfe2e #define KEY83_TimRow 0xfe2f #define KEY83_TRowP 0xfe30 #define KEY83_SortA 0xfe31 #define KEY83_SortD 0xfe32 #define KEY83_Seq 0xfe33 #define KEY83_Min 0xfe34 #define KEY83_Max 0xfe35 #define KEY83_Mean 0xfe36 #define KEY83_Median 0xfe37 #define KEY83_Sum 0xfe38 #define KEY83_Prod 0xfe39 #define KEY83_Det 0xfe3a #define KEY83_Transp 0xfe3b #define KEY83_Dim 0xfe3c #define KEY83_Fill 0xfe3d #define KEY83_Ident 0xfe3e #define KEY83_Randm 0xfe3f #define KEY83_Aug 0xfe40 #define KEY83_OneVar 0xfe41 #define KEY83_TwoVar 0xfe42 #define KEY83_LR 0xfe43 #define KEY83_LRExp 0xfe44 #define KEY83_LRLn 0xfe45 #define KEY83_LRPwr 0xfe46 #define KEY83_MedMed 0xfe47 #define KEY83_Quad 0xfe48 #define KEY83_ClrLst 0xfe49 #define KEY83_Hist 0xfe4a #define KEY83_xyLine 0xfe4b #define KEY83_Scatter 0xfe4c #define KEY83_mRad 0xfe4d #define KEY83_mDeg 0xfe4e #define KEY83_mNormF 0xfe4f #define KEY83_mSci 0xfe50 #define KEY83_mEng 0xfe51 #define KEY83_mFloat 0xfe52 #define KEY83_Fix 0xfe53 #define KEY83_SplitOn 0xfe54 #define KEY83_FullScreen 0xfe55 #define KEY83_Stndrd 0xfe56 #define KEY83_Param 0xfe57 #define KEY83_Polar 0xfe58 #define KEY83_SeqG 0xfe59 #define KEY83_AFillOn 0xfe5a #define KEY83_AFillOff 0xfe5b #define KEY83_ACalcOn 0xfe5c #define KEY83_ACalcOff 0xfe5d #define KEY83_FNOn 0xfe5e #define KEY83_FNOff 0xfe5f #define KEY83_PlotsOn 0xfe60 #define KEY83_PlotsOff 0xfe61 #define KEY83_PixelChg 0xfe62 #define KEY83_SendMBL 0xfe63 #define KEY83_RecvMBL 0xfe64 #define KEY83_BoxPlot 0xfe65 #define KEY83_BoxIcon 0xfe66 #define KEY83_CrossIcon 0xfe67 #define KEY83_DotIcon 0xfe68 #define KEY83_Seqential 0xfe69 #define KEY83_SimulG 0xfe6a #define KEY83_PolarG 0xfe6b #define KEY83_RectG 0xfe6c #define KEY83_CoordOn 0xfe6d #define KEY83_CoordOff 0xfe6e #define KEY83_DrawLine 0xfe6f #define KEY83_DrawDot 0xfe70 #define KEY83_AxisOn 0xfe71 #define KEY83_AxisOff 0xfe72 #define KEY83_GridOn 0xfe73 #define KEY83_GridOff 0xfe74 #define KEY83_LblOn 0xfe75 #define KEY83_LblOff 0xfe76 #define KEY83_L1 0xfe77 #define KEY83_infData 0xfe77 #define KEY83_L2 0xfe78 #define KEY83_infStats 0xfe78 #define KEY83_L3 0xfe79 #define KEY83_infYes 0xfe79 #define KEY83_L4 0xfe7a #define KEY83_infNo 0xfe7a #define KEY83_L5 0xfe7b #define KEY83_infCalc 0xfe7b #define KEY83_L6 0xfe7c #define KEY83_infDraw 0xfe7c #define KEY83_MatA 0xfe7d #define KEY83_infAlt1ne 0xfe7d #define KEY83_MatB 0xfe7e #define KEY83_infAlt1lt 0xfe7e #define KEY83_MatC 0xfe7f #define KEY83_infAlt1gt 0xfe7f #define KEY83_MatD 0xfe80 #define KEY83_infAlt2ne 0xfe80 #define KEY83_MatE 0xfe81 #define KEY83_infAlt2lt 0xfe81 #define KEY83_Xmin 0xfe82 #define KEY83_infAlt2gt 0xfe82 #define KEY83_Xmax 0xfe83 #define KEY83_infAlt3ne 0xfe83 #define KEY83_Xscl 0xfe84 #define KEY83_infAlt3lt 0xfe84 #define KEY83_Ymin 0xfe85 #define KEY83_infAlt3gt 0xfe85 #define KEY83_Ymax 0xfe86 #define KEY83_infAlt4ne 0xfe86 #define KEY83_Yscl 0xfe87 #define KEY83_infAlt4lt 0xfe87 #define KEY83_Tmin 0xfe88 #define KEY83_infAlt4gt 0xfe88 #define KEY83_Tmax 0xfe89 #define KEY83_infAlt5ne 0xfe89 #define KEY83_TStep 0xfe8a #define KEY83_infAlt5lt 0xfe8a #define KEY83_Omin 0xfe8b #define KEY83_infAlt5gt 0xfe8b #define KEY83_Omax 0xfe8c #define KEY83_infAlt6ne 0xfe8c #define KEY83_OStep 0xfe8d #define KEY83_infAlt6lt 0xfe8d #define KEY83_infAlt6gt 0xfe8e #define KEY83_u0 0xfe8e #define KEY83_v0 0xfe8f #define KEY83_nMin 0xfe90 #define KEY83_nMax 0xfe91 #define KEY83_DeltaY 0xfe92 #define KEY83_DeltaX 0xfe93 #define KEY83_ZXmin 0xfe94 #define KEY83_ZXmax 0xfe95 #define KEY83_ZXscl 0xfe96 #define KEY83_ZYmin 0xfe97 #define KEY83_ZYmax 0xfe98 #define KEY83_ZYscl 0xfe99 #define KEY83_ZTmin 0xfe9a #define KEY83_ZTmax 0xfe9b #define KEY83_ZTStep 0xfe9c #define KEY83_ZOmin 0xfe9d #define KEY83_ZOmax 0xfe9e #define KEY83_ZOStep 0xfe9f #define KEY83_Zu0 0xfea0 #define KEY83_Zv0 0xfea1 #define KEY83_ZnMin 0xfea2 #define KEY83_ZnMax 0xfea3 #define KEY83_DelLast 0xfea4 #define KEY83_SinReg 0xfea5 #define KEY83_ConstE 0xfea6 #define KEY83_Pic1 0xfea7 #define KEY83_Pic2 0xfea8 #define KEY83_Pic3 0xfea9 #define KEY83_DelVar 0xfeaa #define KEY83_GetCalc 0xfeab #define KEY83_RealM 0xfeac #define KEY83_PolarM 0xfead #define KEY83_RectM 0xfeae #define KEY83_uv 0xfeaf #define KEY83_vw 0xfeb0 #define KEY83_uw 0xfeb1 #define KEY83_FinPMTend 0xfeb2 #define KEY83_FinPMTbeg 0xfeb3 #define KEY83_GraphStyle 0xfeb4 #define KEY83_ExprOn 0xfeb5 #define KEY83_ExprOff 0xfeb6 #define KEY83_StatA 0xfeb7 #define KEY83_StatB 0xfeb8 #define KEY83_StatC 0xfeb9 #define KEY83_Corr 0xfeba #define KEY83_StatD 0xfebb #define KEY83_StatE 0xfebc #define KEY83_RegEq 0xfebd #define KEY83_MinX 0xfebe #define KEY83_Q1 0xfebf #define KEY83_MD 0xfec0 #define KEY83_Q3 0xfec1 #define KEY83_MaxX 0xfec2 #define KEY83_StatX1 0xfec3 #define KEY83_StatY1 0xfec4 #define KEY83_StatX2 0xfec5 #define KEY83_StatY2 0xfec6 #define KEY83_StatX3 0xfec7 #define KEY83_StatY3 0xfec8 #define KEY83_TblMin 0xfec9 #define KEY83_TblStep 0xfeca #define KEY83_SetupLst 0xfecb #define KEY83_ClrAllLst 0xfecc #define KEY83_Logistic 0xfecd #define KEY83_ZTest 0xfece #define KEY83_TTest 0xfecf #define KEY83_2SampZTest 0xfed0 #define KEY83_2SampTTest 0xfed1 #define KEY83_1PropZTest 0xfed2 #define KEY83_2PropZTest 0xfed3 #define KEY83_ChiTest 0xfed4 #define KEY83_2SampFTest 0xfed5 #define KEY83_ZIntVal 0xfed6 #define KEY83_TIntVal 0xfed7 #define KEY83_2SampTInt 0xfed8 #define KEY83_2SampZInt 0xfed9 #define KEY83_1PropZInt 0xfeda #define KEY83_2PropZInt 0xfedb #define KEY83_DNormal 0xfedc #define KEY83_InvNorm 0xfedd #define KEY83_DT 0xfede #define KEY83_Chi 0xfedf #define KEY83_DF 0xfee0 #define KEY83_BinPDF 0xfee1 #define KEY83_BinCDF 0xfee2 #define KEY83_PoiPDF 0xfee3 #define KEY83_PoiCDF 0xfee4 #define KEY83_un 0xfee5 #define KEY83_vn 0xfee6 #define KEY83_wn 0xfee7 #define KEY83_Recn 0xfee8 #define KEY83_PlotStart 0xfee9 #define KEY83_ZPlotStart 0xfeea #define KEY83_XFact 0xfeeb #define KEY83_YFact 0xfeec #define KEY83_ANOVA 0xfeed #define KEY83_MaxY 0xfeee #define KEY83_WebOn 0xfeef #define KEY83_WebOff 0xfef0 #define KEY83_TblInput 0xfef1 #define KEY83_GeoPDF 0xfef2 #define KEY83_GeoCDF 0xfef3 #define KEY83_ShadeNorm 0xfef4 #define KEY83_ShadeT 0xfef5 #define KEY83_ShadeChi 0xfef6 #define KEY83_ShadeF 0xfef7 #define KEY83_PlotStep 0xfef8 #define KEY83_ZPlotStep 0xfef9 #define KEY83_LinRegtTest 0xfefa #define KEY83_MGT 0xfefb #define KEY83_SelectA 0xfefc #define KEY83_ZFitA 0xfefd // FC (ExtendEcho2) prefixed keys: #define KE2BT2 0xfc00 #define KEY83_GDB1 0xfc00 #define KEY83_GDB2 0xfc01 #define KEY83_GDB3 0xfc02 #define KEY83_Y1 0xfc03 #define KEY83_Y2 0xfc04 #define KEY83_Y3 0xfc05 #define KEY83_Y4 0xfc06 #define KEY83_Y5 0xfc07 #define KEY83_Y6 0xfc08 #define KEY83_Y7 0xfc09 #define KEY83_Y8 0xfc0a #define KEY83_Y9 0xfc0b #define KEY83_Y0 0xfc0c #define KEY83_X1T 0xfc0d #define KEY83_Y1T 0xfc0e #define KEY83_X2T 0xfc0f #define KEY83_Y2T 0xfc10 #define KEY83_X3T 0xfc11 #define KEY83_Y3T 0xfc12 #define KEY83_X4T 0xfc13 #define KEY83_Y4T 0xfc14 #define KEY83_X5T 0xfc15 #define KEY83_Y5T 0xfc16 #define KEY83_X6T 0xfc17 #define KEY83_Y6T 0xfc18 #define KEY83_R1 0xfc19 #define KEY83_R2 0xfc1a #define KEY83_R3 0xfc1b #define KEY83_R4 0xfc1c #define KEY83_R5 0xfc1d #define KEY83_R6 0xfc1e #define KEY83_GDB4 0xfc1f #define KEY83_GDB5 0xfc20 #define KEY83_GDB6 0xfc21 #define KEY83_Pic4 0xfc22 #define KEY83_Pic5 0xfc23 #define KEY83_Pic6 0xfc24 #define KEY83_GDB7 0xfc25 #define KEY83_GDB8 0xfc26 #define KEY83_GDB9 0xfc27 #define KEY83_GDB0 0xfc28 #define KEY83_Pic7 0xfc29 #define KEY83_Pic8 0xfc2a #define KEY83_Pic9 0xfc2b #define KEY83_Pic0 0xfc2c #define KEY83_StatN 0xfc2d #define KEY83_XMean 0xfc2e #define KEY83_Conj 0xfc2f #define KEY83_Real 0xfc30 #define KEY83_FAngle 0xfc31 #define KEY83_LCM 0xfc32 #define KEY83_GCD 0xfc33 #define KEY83_RandInt 0xfc34 #define KEY83_RandNorm 0xfc35 #define KEY83_ToPolar 0xfc36 #define KEY83_ToRect 0xfc37 #define KEY83_YMean 0xfc38 #define KEY83_StdX 0xfc39 #define KEY83_StdX1 0xfc3a #define KEY83_w0 0xfc3b #define KEY83_MatF 0xfc3c #define KEY83_MatG 0xfc3d #define KEY83_MatRH 0xfc3e #define KEY83_MatI 0xfc3f #define KEY83_MatJ 0xfc40 #define KEY83_YMean1 0xfc41 #define KEY83_StdY 0xfc42 #define KEY83_StdY1 0xfc43 #define KEY83_MatToLst 0xfc44 #define KEY83_LstToMat 0xfc45 #define KEY83_CumSum 0xfc46 #define KEY83_DeltaLst 0xfc47 #define KEY83_StdDev 0xfc48 #define KEY83_Variance 0xfc49 #define KEY83_Length 0xfc4a #define KEY83_EquToStrng 0xfc4b #define KEY83_StrngToEqu 0xfc4c #define KEY83_Expr 0xfc4d #define KEY83_SubStrng 0xfc4e #define KEY83_InStrng 0xfc4f #define KEY83_Str1 0xfc50 #define KEY83_Str2 0xfc51 #define KEY83_Str3 0xfc52 #define KEY83_Str4 0xfc53 #define KEY83_Str5 0xfc54 #define KEY83_Str6 0xfc55 #define KEY83_Str7 0xfc56 #define KEY83_Str8 0xfc57 #define KEY83_Str9 0xfc58 #define KEY83_Str0 0xfc59 #define KEY83_FinN 0xfc5a #define KEY83_FinI 0xfc5b #define KEY83_FinPV 0xfc5c #define KEY83_FinPMT 0xfc5d #define KEY83_FinFV 0xfc5e #define KEY83_FinPY 0xfc5f #define KEY83_FinCY 0xfc60 #define KEY83_FinFPMT 0xfc61 #define KEY83_FinFI 0xfc62 #define KEY83_FinFPV 0xfc63 #define KEY83_FinFN 0xfc64 #define KEY83_FinFFV 0xfc65 #define KEY83_FinNPV 0xfc66 #define KEY83_FinIRR 0xfc67 #define KEY83_FinBAL 0xfc68 #define KEY83_FinPRN 0xfc69 #define KEY83_FinINT 0xfc6a #define KEY83_SumX 0xfc6b #define KEY83_SumX2 0xfc6c #define KEY83_FinToNom 0xfc6d #define KEY83_FinToEff 0xfc6e #define KEY83_FinDBD 0xfc6f #define KEY83_StatVP 0xfc70 #define KEY83_StatZ 0xfc71 #define KEY83_StatT 0xfc72 #define KEY83_StatChi 0xfc73 #define KEY83_StatF 0xfc74 #define KEY83_StatDF 0xfc75 #define KEY83_StatPhat 0xfc76 #define KEY83_StatPhat1 0xfc77 #define KEY83_StatPhat2 0xfc78 #define KEY83_StatMeanX1 0xfc79 #define KEY83_StatMeanX2 0xfc7a #define KEY83_StatStdX1 0xfc7b #define KEY83_StatStdX2 0xfc7c #define KEY83_StatStdXP 0xfc7d #define KEY83_StatN1 0xfc7e #define KEY83_StatN2 0xfc7f #define KEY83_StatLower 0xfc80 #define KEY83_StatUpper 0xfc81 #define KEY83_uw0 0xfc82 #define KEY83_Imag 0xfc83 #define KEY83_SumY 0xfc84 #define KEY83_Xres 0xfc85 #define KEY83_Stat_s 0xfc86 #define KEY83_SumY2 0xfc87 #define KEY83_SumXY 0xfc88 #define KEY83_uXres 0xfc89 #define KEY83_ModBox 0xfc8a #define KEY83_NormProb 0xfc8b #define KEY83_NormalPDF 0xfc8c #define KEY83_TPDF 0xfc8d #define KEY83_ChiPDF 0xfc8e #define KEY83_FPDF 0xfc8f #define KEY83_MinY 0xfc90 #define KEY83_RandBin 0xfc91 #define KEY83_Ref 0xfc92 #define KEY83_RRef 0xfc93 #define KEY83_LRSqr 0xfc94 #define KEY83_BRSqr 0xfc95 #define KEY83_DiagOn 0xfc96 #define KEY83_DiagOff 0xfc97 #define KEY83_un1 0xfc98 #define KEY83_vn1 0xfc99 #endif libticalcs-1.1.9+dfsg/src/keys83p.c000066400000000000000000000176171327711501700170330ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2007 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "ticalcs.h" #include "keys83p.h" /* Conversion of an ASCII code into a TI key This table is very incomplete. It contains most of ASCII chars only. */ const OldCalcKeys_ TI83P_KEYS[] = { /* 0x00 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"Enter", "Enter", KEY83P_Enter, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x10 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"ESC", "Quit", KEY83P_Quit, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x20 */ {" ", "Space", KEY83P_Space, "", 0, "", 0, "", 0, "", 0}, {"!", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"#", "", 0, "", 0, "", 0, "", 0, "", 0}, {"$", "", 0, "", 0, "", 0, "", 0, "", 0}, {"%", "", 0, "", 0, "", 0, "", 0, "", 0}, {"&", "", 0, "", 0, "", 0, "", 0, "", 0}, {"'", "", 0, "", 0, "", 0, "", 0, "", 0}, {"(", "LParen", KEY83P_LParen, "", 0, "", 0, "", 0, "", 0}, {")", "RParen", KEY83P_RParen, "", 0, "", 0, "", 0, "", 0}, {"*", "Mul", KEY83P_Mul, "", 0, "", 0, "", 0, "", 0}, {"+", "Add", KEY83P_Add, "", 0, "", 0, "", 0, "", 0}, {",", "Comma", KEY83P_Comma, "", 0, "", 0, "", 0, "", 0}, {"-", "Sub", KEY83P_Sub, "", 0, "", 0, "", 0, "", 0}, {".", "", 0, "", 0, "", 0, "", 0, "", 0}, {"/", "Div", KEY83P_Div, "", 0, "", 0, "", 0, "", 0}, /* 0x30 */ {"0", "0", KEY83P_0, "", 0, "", 0, "", 0, "", 0}, {"1", "1", KEY83P_1, "", 0, "", 0, "", 0, "", 0}, {"2", "2", KEY83P_2, "", 0, "", 0, "", 0, "", 0}, {"3", "3", KEY83P_3, "", 0, "", 0, "", 0, "", 0}, {"4", "4", KEY83P_4, "", 0, "", 0, "", 0, "", 0}, {"5", "5", KEY83P_5, "", 0, "", 0, "", 0, "", 0}, {"6", "6", KEY83P_6, "", 0, "", 0, "", 0, "", 0}, {"7", "7", KEY83P_7, "", 0, "", 0, "", 0, "", 0}, {"8", "8", KEY83P_8, "", 0, "", 0, "", 0, "", 0}, {"9", "9", KEY83P_9, "", 0, "", 0, "", 0, "", 0}, {":", "", 0, "", 0, "", 0, "", 0, "", 0}, {";", "", 0, "", 0, "", 0, "", 0, "", 0}, {"<", "", 0, "", 0, "", 0, "", 0, "", 0}, {"=", "", 0, "", 0, "", 0, "", 0, "", 0}, {">", "", 0, "", 0, "", 0, "", 0, "", 0}, {"?", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x40 */ {"@", "@", 0, "", 0, "", 0, "", 0, "", 0}, {"A", "A", KEY83P_CapA, "", 0, "", 0, "", 0, "", 0}, {"B", "B", KEY83P_CapB, "", 0, "", 0, "", 0, "", 0}, {"C", "C", KEY83P_CapC, "", 0, "", 0, "", 0, "", 0}, {"D", "D", KEY83P_CapD, "", 0, "", 0, "", 0, "", 0}, {"E", "E", KEY83P_CapE, "", 0, "", 0, "", 0, "", 0}, {"F", "F", KEY83P_CapF, "", 0, "", 0, "", 0, "", 0}, {"G", "G", KEY83P_CapG, "", 0, "", 0, "", 0, "", 0}, {"H", "H", KEY83P_CapH, "", 0, "", 0, "", 0, "", 0}, {"I", "I", KEY83P_CapI, "", 0, "", 0, "", 0, "", 0}, {"J", "J", KEY83P_CapJ, "", 0, "", 0, "", 0, "", 0}, {"K", "K", KEY83P_CapK, "", 0, "", 0, "", 0, "", 0}, {"L", "L", KEY83P_CapL, "", 0, "", 0, "", 0, "", 0}, {"M", "M", KEY83P_CapM, "", 0, "", 0, "", 0, "", 0}, {"N", "N", KEY83P_CapN, "", 0, "", 0, "", 0, "", 0}, {"O", "O", KEY83P_CapO, "", 0, "", 0, "", 0, "", 0}, /* 0x50 */ {"P", "P", KEY83P_CapP, "", 0, "", 0, "", 0, "", 0}, {"Q", "Q", KEY83P_CapQ, "", 0, "", 0, "", 0, "", 0}, {"R", "R", KEY83P_CapR, "", 0, "", 0, "", 0, "", 0}, {"S", "S", KEY83P_CapS, "", 0, "", 0, "", 0, "", 0}, {"T", "T", KEY83P_CapT, "", 0, "", 0, "", 0, "", 0}, {"U", "U", KEY83P_CapU, "", 0, "", 0, "", 0, "", 0}, {"V", "V", KEY83P_CapV, "", 0, "", 0, "", 0, "", 0}, {"W", "W", KEY83P_CapW, "", 0, "", 0, "", 0, "", 0}, {"X", "X", KEY83P_CapX, "", 0, "", 0, "", 0, "", 0}, {"Y", "Y", KEY83P_CapY, "", 0, "", 0, "", 0, "", 0}, {"Z", "Z", KEY83P_CapZ, "", 0, "", 0, "", 0, "", 0}, {"[", "LBrack", KEY83P_LBrack, "", 0, "", 0, "", 0, "", 0}, {"\\", "", 0, "", 0, "", 0, "", 0, "", 0}, {"]", "RBrack", KEY83P_RBrack, "", 0, "", 0, "", 0, "", 0}, {"^", "", 0, "", 0, "", 0, "", 0, "", 0}, {"_", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x60 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"a", "", 0, "", 0, "", 0, "", 0, "", 0}, {"b", "", 0, "", 0, "", 0, "", 0, "", 0}, {"c", "", 0, "", 0, "", 0, "", 0, "", 0}, {"d", "", 0, "", 0, "", 0, "", 0, "", 0}, {"e", "", 0, "", 0, "", 0, "", 0, "", 0}, {"f", "", 0, "", 0, "", 0, "", 0, "", 0}, {"g", "", 0, "", 0, "", 0, "", 0, "", 0}, {"h", "", 0, "", 0, "", 0, "", 0, "", 0}, {"i", "", 0, "", 0, "", 0, "", 0, "", 0}, {"j", "", 0, "", 0, "", 0, "", 0, "", 0}, {"k", "", 0, "", 0, "", 0, "", 0, "", 0}, {"l", "", 0, "", 0, "", 0, "", 0, "", 0}, {"m", "", 0, "", 0, "", 0, "", 0, "", 0}, {"n", "", 0, "", 0, "", 0, "", 0, "", 0}, {"o", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x70 */ {"p", "", 0, "", 0, "", 0, "", 0, "", 0}, {"q", "", 0, "", 0, "", 0, "", 0, "", 0}, {"r", "", 0, "", 0, "", 0, "", 0, "", 0}, {"s", "", 0, "", 0, "", 0, "", 0, "", 0}, {"t", "", 0, "", 0, "", 0, "", 0, "", 0}, {"u", "", 0, "", 0, "", 0, "", 0, "", 0}, {"v", "", 0, "", 0, "", 0, "", 0, "", 0}, {"w", "", 0, "", 0, "", 0, "", 0, "", 0}, {"x", "", 0, "", 0, "", 0, "", 0, "", 0}, {"y", "", 0, "", 0, "", 0, "", 0, "", 0}, {"z", "", 0, "", 0, "", 0, "", 0, "", 0}, {"{", "", 0, "", 0, "", 0, "", 0, "", 0}, {"|", "", 0, "", 0, "", 0, "", 0, "", 0}, {"}", "", 0, "", 0, "", 0, "", 0, "", 0}, {"~", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x80 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\173", "Ans", KEY83P_Ans, "\173", 173, "ANS", 4372, "", 8365, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x90 */ }; libticalcs-1.1.9+dfsg/src/keys83p.h000066400000000000000000001104071327711501700170270ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TICALCS_KEYS83P__ #define __TICALCS_KEYS83P__ // Scan codes of the TI83+ (TI's ti83plus.inc, line 1798) #define KEY83P_Right 0x01 #define KEY83P_Left 0x02 #define KEY83P_Up 0x03 #define KEY83P_Down 0x04 #define KEY83P_Enter 0x05 #define KEY83P_AlphaEnter 0x06 #define KEY83P_AlphaUp 0x07 #define KEY83P_AlphaDown 0x08 #define KEY83P_Clear 0x09 #define KEY83P_Del 0x0A #define KEY83P_Ins 0x0B #define KEY83P_Recall 0x0C #define KEY83P_LastEnt 0x0D #define KEY83P_BOL 0x0E #define KEY83P_EOL 0x0F #define KEY83P_SelAll 0x10 #define KEY83P_UnselAll 0x11 #define KEY83P_LtoTI82 0x12 #define KEY83P_Backup 0x13 #define KEY83P_Recieve 0x14 #define KEY83P_LnkQuit 0x15 #define KEY83P_Trans 0x16 #define KEY83P_Rename 0x17 #define KEY83P_Overw 0x18 #define KEY83P_Omit 0x19 #define KEY83P_Cont 0x1A #define KEY83P_SendID 0x1B #define KEY83P_SendSW 0x1C #define KEY83P_Yes 0x1D #define KEY83P_NoWay 0x1E #define KEY83P_vSendType 0x1F #define KEY83P_OverWAll 0x20 #define KEY83P_No 0x25 #define KEY83P_KReset 0x26 #define KEY83P_App 0x27 #define KEY83P_Doug 0x28 #define KEY83P_Listflag 0x29 #define KEY83P_menuStart 0x2B #define KEY83P_AreYouSure 0x2B #define KEY83P_AppsMenu 0x2C #define KEY83P_Prgm 0x2D #define KEY83P_Zoom 0x2E #define KEY83P_Draw 0x2F #define KEY83P_SPlot 0x30 #define KEY83P_Stat 0x31 #define KEY83P_Math 0x32 #define KEY83P_Test 0x33 #define KEY83P_Char 0x34 #define KEY83P_Vars 0x35 #define KEY83P_Mem 0x36 #define KEY83P_Matrix 0x37 #define KEY83P_Dist 0x38 #define KEY83P_Angle 0x39 #define KEY83P_List 0x3A #define KEY83P_Calc 0x3B #define KEY83P_Fin 0x3C #define KEY83P_menuEnd 0x3C #define KEY83P_Catalog 0x3E #define KEY83P_InputDone 0x3F #define KEY83P_Off 0x3F #define KEY83P_Quit 0x40 #define KEY83P_appStart 0x40 #define KEY83P_LinkIO 0x41 #define KEY83P_MatrixEd 0x42 #define KEY83P_StatEd 0x43 #define KEY83P_Graph 0x44 #define KEY83P_Mode 0x45 #define KEY83P_PrgmEd 0x46 #define KEY83P_PrgmCr 0x47 #define KEY83P_Window 0x48 #define KEY83P_Yequ 0x49 #define KEY83P_Table 0x4A #define KEY83P_TblSet 0x4B #define KEY83P_ChkRAM 0x4C #define KEY83P_DelMem 0x4D #define KEY83P_ResetMem 0x4E #define KEY83P_ResetDef 0x4F #define KEY83P_PrgmInput 0x50 #define KEY83P_ZFactEd 0x51 #define KEY83P_Error 0x52 #define KEY83P_SolveTVM 0x53 #define KEY83P_SolveRoot 0x54 #define KEY83P_StatP 0x55 #define KEY83P_InfStat 0x56 #define KEY83P_Format 0x57 #define KEY83P_ExtApps 0x58 #define KEY83P_NewApps 0x59 #define KEY83P_echoStart1 0x5A #define KEY83P_Trace 0x5A #define KEY83P_ZFit 0x5B #define KEY83P_ZIn 0x5C #define KEY83P_ZOut 0x5D #define KEY83P_ZPrev 0x5E #define KEY83P_Box 0x5F #define KEY83P_Decml 0x60 #define KEY83P_SetZm 0x61 #define KEY83P_Squar 0x62 #define KEY83P_Std 0x63 #define KEY83P_Trig 0x64 #define KEY83P_UsrZm 0x65 #define KEY83P_ZSto 0x66 #define KEY83P_ZInt 0x67 #define KEY83P_ZStat 0x68 #define KEY83P_echoStart2 0x69 #define KEY83P_Select 0x69 #define KEY83P_Circl 0x6A #define KEY83P_ClDrw 0x6B #define KEY83P_Line 0x6C #define KEY83P_Pen 0x6D #define KEY83P_PtChg 0x6E #define KEY83P_PtOff 0x6F #define KEY83P_PtOn 0x70 #define KEY83P_Vert 0x71 #define KEY83P_Horiz 0x72 #define KEY83P_Text 0x73 #define KEY83P_TanLn 0x74 #define KEY83P_Eval 0x75 #define KEY83P_Inters 0x76 #define KEY83P_DYDX 0x77 #define KEY83P_FnIntg 0x78 #define KEY83P_RootG 0x79 #define KEY83P_DYDT 0x7A #define KEY83P_DXDT 0x7B #define KEY83P_DRDo 0x7C #define KEY83P_GFMin 0x7D #define KEY83P_GFMax 0x7E #define KEY83P_EchoStart 0x7F #define KEY83P_ListName 0x7F #define KEY83P_Add 0x80 #define KEY83P_Sub 0x81 #define KEY83P_Mul 0x82 #define KEY83P_Div 0x83 #define KEY83P_Expon 0x84 #define KEY83P_LParen 0x85 #define KEY83P_RParen 0x86 #define KEY83P_LBrack 0x87 #define KEY83P_RBrack 0x88 #define KEY83P_Shade 0x89 #define KEY83P_Store 0x8A #define KEY83P_Comma 0x8B #define KEY83P_Chs 0x8C #define KEY83P_DecPnt 0x8D #define KEY83P_0 0x8E #define KEY83P_1 0x8F #define KEY83P_2 0x90 #define KEY83P_3 0x91 #define KEY83P_4 0x92 #define KEY83P_5 0x93 #define KEY83P_6 0x94 #define KEY83P_7 0x95 #define KEY83P_8 0x96 #define KEY83P_9 0x97 #define KEY83P_EE 0x98 #define KEY83P_Space 0x99 #define KEY83P_CapA 0x9A #define KEY83P_CapB 0x9B #define KEY83P_CapC 0x9C #define KEY83P_CapD 0x9D #define KEY83P_CapE 0x9E #define KEY83P_CapF 0x9F #define KEY83P_CapG 0xA0 #define KEY83P_CapH 0xA1 #define KEY83P_CapI 0xA2 #define KEY83P_CapJ 0xA3 #define KEY83P_CapK 0xA4 #define KEY83P_CapL 0xA5 #define KEY83P_CapM 0xA6 #define KEY83P_CapN 0xA7 #define KEY83P_CapO 0xA8 #define KEY83P_CapP 0xA9 #define KEY83P_CapQ 0xAA #define KEY83P_CapR 0xAB #define KEY83P_CapS 0xAC #define KEY83P_CapT 0xAD #define KEY83P_CapU 0xAE #define KEY83P_CapV 0xAF #define KEY83P_CapW 0xB0 #define KEY83P_CapX 0xB1 #define KEY83P_CapY 0xB2 #define KEY83P_CapZ 0xB3 #define KEY83P_Varx 0xB4 #define KEY83P_Pi 0xB5 #define KEY83P_Inv 0xB6 #define KEY83P_Sin 0xB7 #define KEY83P_ASin 0xB8 #define KEY83P_Cos 0xB9 #define KEY83P_ACos 0xBA #define KEY83P_Tan 0xBB #define KEY83P_ATan 0xBC #define KEY83P_Square 0xBD #define KEY83P_Sqrt 0xBE #define KEY83P_Ln 0xBF #define KEY83P_Exp 0xC0 #define KEY83P_Log 0xC1 #define KEY83P_ALog 0xC2 #define KEY83P_ToABC 0xC3 #define KEY83P_ClrTbl 0xC4 #define KEY83P_Ans 0xC5 #define KEY83P_Colon 0xC6 #define KEY83P_NDeriv 0xC7 #define KEY83P_FnInt 0xC8 #define KEY83P_Root 0xC9 #define KEY83P_Quest 0xCA #define KEY83P_Quote 0xCB #define KEY83P_Theta 0xCC #define KEY83P_If 0xCD #define KEY83P_Then 0xCE #define KEY83P_Else 0xCF #define KEY83P_For 0xD0 #define KEY83P_While 0xD1 #define KEY83P_Repeat 0xD2 #define KEY83P_End 0xD3 #define KEY83P_Pause 0xD4 #define KEY83P_Lbl 0xD5 #define KEY83P_Goto 0xD6 #define KEY83P_ISG 0xD7 #define KEY83P_DSL 0xD8 #define KEY83P_Menu 0xD9 #define KEY83P_Exec 0xDA #define KEY83P_Return 0xDB #define KEY83P_Stop 0xDC #define KEY83P_Input 0xDD #define KEY83P_Prompt 0xDE #define KEY83P_Disp 0xDF #define KEY83P_DispG 0xE0 #define KEY83P_DispT 0xE1 #define KEY83P_Output 0xE2 #define KEY83P_GetKey 0xE3 #define KEY83P_ClrHome 0xE4 #define KEY83P_PrtScr 0xE5 #define KEY83P_SinH 0xE6 #define KEY83P_CosH 0xE7 #define KEY83P_TanH 0xE8 #define KEY83P_ASinH 0xE9 #define KEY83P_ACosH 0xEA #define KEY83P_ATanH 0xEB #define KEY83P_LBrace 0xEC #define KEY83P_RBrace 0xED #define KEY83P_I 0xEE #define KEY83P_CONSTeA 0xEF #define KEY83P_Plot3 0xF0 #define KEY83P_FMin 0xF1 #define KEY83P_FMax 0xF2 #define KEY83P_L1A 0xF3 #define KEY83P_L2A 0xF4 #define KEY83P_L3A 0xF5 #define KEY83P_L4A 0xF6 #define KEY83P_L5A 0xF7 #define KEY83P_L6A 0xF8 #define KEY83P_unA 0xF9 #define KEY83P_vnA 0xFA #define KEY83P_wnA 0xFB // FE (ExtendEcho) prefixed keys: #define kE1BT 0xfe00 #define KEY83P_DrawInv 0xfe00 #define KEY83P_DrawF 0xfe01 #define KEY83P_PixelOn 0xfe02 #define KEY83P_PixelOff 0xfe03 #define KEY83P_PxlTest 0xfe04 #define KEY83P_RCGDB 0xfe05 #define KEY83P_RCPic 0xfe06 #define KEY83P_STGDB 0xfe07 #define KEY83P_STPic 0xfe08 #define KEY83P_Abs 0xfe09 #define KEY83P_TEqu 0xfe0a #define KEY83P_TNoteQ 0xfe0b #define KEY83P_TGT 0xfe0c #define KEY83P_TGTE 0xfe0d #define KEY83P_TLT 0xfe0e #define KEY83P_TLTE 0xfe0f #define KEY83P_And 0xfe10 #define KEY83P_Or 0xfe11 #define KEY83P_Xor 0xfe12 #define KEY83P_Not 0xfe13 #define KEY83P_LR1 0xfe14 #define KEY83P_XRoot 0xfe15 #define KEY83P_Cube 0xfe16 #define KEY83P_CbRt 0xfe17 #define KEY83P_ToDec 0xfe18 #define KEY83P_CubicR 0xfe19 #define KEY83P_QuartR 0xfe1a #define KEY83P_Plot1 0xfe1b #define KEY83P_Plot2 0xfe1c #define KEY83P_Round 0xfe1d #define KEY83P_IPart 0xfe1e #define KEY83P_FPart 0xfe1f #define KEY83P_Int 0xfe20 #define KEY83P_Rand 0xfe21 #define KEY83P_NPR 0xfe22 #define KEY83P_NCR 0xfe23 #define KEY83P_XFactorial 0xfe24 #define KEY83P_Rad 0xfe25 #define KEY83P_Degr 0xfe26 #define KEY83P_APost 0xfe27 #define KEY83P_ToDMS 0xfe28 #define KEY83P_RToPo 0xfe29 #define KEY83P_RToPr 0xfe2a #define KEY83P_PToRx 0xfe2b #define KEY83P_PToRy 0xfe2c #define KEY83P_RowSwap 0xfe2d #define KEY83P_RowPlus 0xfe2e #define KEY83P_TimRow 0xfe2f #define KEY83P_TRowP 0xfe30 #define KEY83P_SortA 0xfe31 #define KEY83P_SortD 0xfe32 #define KEY83P_Seq 0xfe33 #define KEY83P_Min 0xfe34 #define KEY83P_Max 0xfe35 #define KEY83P_Mean 0xfe36 #define KEY83P_Median 0xfe37 #define KEY83P_Sum 0xfe38 #define KEY83P_Prod 0xfe39 #define KEY83P_Det 0xfe3a #define KEY83P_Transp 0xfe3b #define KEY83P_Dim 0xfe3c #define KEY83P_Fill 0xfe3d #define KEY83P_Ident 0xfe3e #define KEY83P_Randm 0xfe3f #define KEY83P_Aug 0xfe40 #define KEY83P_OneVar 0xfe41 #define KEY83P_TwoVar 0xfe42 #define KEY83P_LR 0xfe43 #define KEY83P_LRExp 0xfe44 #define KEY83P_LRLn 0xfe45 #define KEY83P_LRPwr 0xfe46 #define KEY83P_MedMed 0xfe47 #define KEY83P_Quad 0xfe48 #define KEY83P_ClrLst 0xfe49 #define KEY83P_Hist 0xfe4a #define KEY83P_xyLine 0xfe4b #define KEY83P_Scatter 0xfe4c #define KEY83P_mRad 0xfe4d #define KEY83P_mDeg 0xfe4e #define KEY83P_mNormF 0xfe4f #define KEY83P_mSci 0xfe50 #define KEY83P_mEng 0xfe51 #define KEY83P_mFloat 0xfe52 #define KEY83P_Fix 0xfe53 #define KEY83P_SplitOn 0xfe54 #define KEY83P_FullScreen 0xfe55 #define KEY83P_Stndrd 0xfe56 #define KEY83P_Param 0xfe57 #define KEY83P_Polar 0xfe58 #define KEY83P_SeqG 0xfe59 #define KEY83P_AFillOn 0xfe5a #define KEY83P_AFillOff 0xfe5b #define KEY83P_ACalcOn 0xfe5c #define KEY83P_ACalcOff 0xfe5d #define KEY83P_FNOn 0xfe5e #define KEY83P_FNOff 0xfe5f #define KEY83P_PlotsOn 0xfe60 #define KEY83P_PlotsOff 0xfe61 #define KEY83P_PixelChg 0xfe62 #define KEY83P_SendMBL 0xfe63 #define KEY83P_RecvMBL 0xfe64 #define KEY83P_BoxPlot 0xfe65 #define KEY83P_BoxIcon 0xfe66 #define KEY83P_CrossIcon 0xfe67 #define KEY83P_DotIcon 0xfe68 #define kE2BT (kE1BT+105) #define KEY83P_Seqential 0xfe69 #define KEY83P_SimulG 0xfe6a #define KEY83P_PolarG 0xfe6b #define KEY83P_RectG 0xfe6c #define KEY83P_CoordOn 0xfe6d #define KEY83P_CoordOff 0xfe6e #define KEY83P_DrawLine 0xfe6f #define KEY83P_DrawDot 0xfe70 #define KEY83P_AxisOn 0xfe71 #define KEY83P_AxisOff 0xfe72 #define KEY83P_GridOn 0xfe73 #define KEY83P_GridOff 0xfe74 #define KEY83P_LblOn 0xfe75 #define KEY83P_LblOff 0xfe76 #define KEY83P_L1 0xfe77 #define KEY83P_L2 0xfe78 #define KEY83P_L3 0xfe79 #define KEY83P_L4 0xfe7a #define KEY83P_L5 0xfe7b #define KEY83P_L6 0xfe7c // FC (ExtendEcho2) prefixed keys: #define kE2BT2 0xfc00 #define KEY83P_GDB1 0xfc00 #define KEY83P_GDB2 0xfc01 #define KEY83P_GDB3 0xfc02 #define KEY83P_Y1 0xfc03 #define KEY83P_Y2 0xfc04 #define KEY83P_Y3 0xfc05 #define KEY83P_Y4 0xfc06 #define KEY83P_Y5 0xfc07 #define KEY83P_Y6 0xfc08 #define KEY83P_Y7 0xfc09 #define KEY83P_Y8 0xfc0a #define KEY83P_Y9 0xfc0b #define KEY83P_Y0 0xfc0c #define KEY83P_X1T 0xfc0d #define KEY83P_Y1T 0xfc0e #define KEY83P_X2T 0xfc0f #define KEY83P_Y2T 0xfc10 #define KEY83P_X3T 0xfc11 #define KEY83P_Y3T 0xfc12 #define KEY83P_X4T 0xfc13 #define KEY83P_Y4T 0xfc14 #define KEY83P_X5T 0xfc15 #define KEY83P_Y5T 0xfc16 #define KEY83P_X6T 0xfc17 #define KEY83P_Y6T 0xfc18 #define KEY83P_R1 0xfc19 #define KEY83P_R2 0xfc1a #define KEY83P_R3 0xfc1b #define KEY83P_R4 0xfc1c #define KEY83P_R5 0xfc1d #define KEY83P_R6 0xfc1e #define KEY83P_GDB4 0xfc1f #define KEY83P_GDB5 0xfc20 #define KEY83P_GDB6 0xfc21 #define KEY83P_Pic4 0xfc22 #define KEY83P_Pic5 0xfc23 #define KEY83P_Pic6 0xfc24 #define KEY83P_GDB7 0xfc25 #define KEY83P_GDB8 0xfc26 #define KEY83P_GDB9 0xfc27 #define KEY83P_GDB0 0xfc28 #define KEY83P_Pic7 0xfc29 #define KEY83P_Pic8 0xfc2a #define KEY83P_Pic9 0xfc2b #define KEY83P_Pic0 0xfc2c #define KEY83P_StatN 0xfc2d #define KEY83P_XMean 0xfc2e #define KEY83P_Conj 0xfc2f #define KEY83P_Real 0xfc30 #define KEY83P_FAngle 0xfc31 #define KEY83P_LCM 0xfc32 #define KEY83P_GCD 0xfc33 #define KEY83P_RandInt 0xfc34 #define KEY83P_RandNorm 0xfc35 #define KEY83P_ToPolar 0xfc36 #define KEY83P_ToRect 0xfc37 #define KEY83P_YMean 0xfc38 #define KEY83P_StdX 0xfc39 #define KEY83P_StdX1 0xfc3a #define KEY83P_w0 0xfc3b #define KEY83P_MatF 0xfc3c #define KEY83P_MatG 0xfc3d #define KEY83P_MatRH 0xfc3e #define KEY83P_MatI 0xfc3f #define KEY83P_MatJ 0xfc40 #define KEY83P_YMean1 0xfc41 #define KEY83P_StdY 0xfc42 #define KEY83P_StdY1 0xfc43 #define KEY83P_MatToLst 0xfc44 #define KEY83P_LstToMat 0xfc45 #define KEY83P_CumSum 0xfc46 #define KEY83P_DeltaLst 0xfc47 #define KEY83P_StdDev 0xfc48 #define KEY83P_Variance 0xfc49 #define KEY83P_Length 0xfc4a #define KEY83P_EquToStrng 0xfc4b #define KEY83P_StrngToEqu 0xfc4c #define KEY83P_Expr 0xfc4d #define KEY83P_SubStrng 0xfc4e #define KEY83P_InStrng 0xfc4f #define KEY83P_Str1 0xfc50 #define KEY83P_Str2 0xfc51 #define KEY83P_Str3 0xfc52 #define KEY83P_Str4 0xfc53 #define KEY83P_Str5 0xfc54 #define KEY83P_Str6 0xfc55 #define KEY83P_Str7 0xfc56 #define KEY83P_Str8 0xfc57 #define KEY83P_Str9 0xfc58 #define KEY83P_Str0 0xfc59 #define KEY83P_FinN 0xfc5a #define KEY83P_FinI 0xfc5b #define KEY83P_FinPV 0xfc5c #define KEY83P_FinPMT 0xfc5d #define KEY83P_FinFV 0xfc5e #define KEY83P_FinPY 0xfc5f #define KEY83P_FinCY 0xfc60 #define KEY83P_FinFPMT 0xfc61 #define KEY83P_FinFI 0xfc62 #define KEY83P_FinFPV 0xfc63 #define KEY83P_FinFN 0xfc64 #define KEY83P_FinFFV 0xfc65 #define KEY83P_FinNPV 0xfc66 #define KEY83P_FinIRR 0xfc67 #define KEY83P_FinBAL 0xfc68 #define KEY83P_FinPRN 0xfc69 #define KEY83P_FinINT 0xfc6a #define KEY83P_SumX 0xfc6b #define KEY83P_SumX2 0xfc6c #define KEY83P_FinToNom 0xfc6d #define KEY83P_FinToEff 0xfc6e #define KEY83P_FinDBD 0xfc6f #define KEY83P_StatVP 0xfc70 #define KEY83P_StatZ 0xfc71 #define KEY83P_StatT 0xfc72 #define KEY83P_StatChi 0xfc73 #define KEY83P_StatF 0xfc74 #define KEY83P_StatDF 0xfc75 #define KEY83P_StatPhat 0xfc76 #define KEY83P_StatPhat1 0xfc77 #define KEY83P_StatPhat2 0xfc78 #define KEY83P_StatMeanX1 0xfc79 #define KEY83P_StatMeanX2 0xfc7a #define KEY83P_StatStdX1 0xfc7b #define KEY83P_StatStdX2 0xfc7c #define KEY83P_StatStdXP 0xfc7d #define KEY83P_StatN1 0xfc7e #define KEY83P_StatN2 0xfc7f #define KEY83P_StatLower 0xfc80 #define KEY83P_StatUpper 0xfc81 #define KEY83P_uw0 0xfc82 #define KEY83P_Imag 0xfc83 #define KEY83P_SumY 0xfc84 #define KEY83P_Xres 0xfc85 #define KEY83P_Stat_s 0xfc86 #define KEY83P_SumY2 0xfc87 #define KEY83P_SumXY 0xfc88 #define KEY83P_uXres 0xfc89 #define KEY83P_ModBox 0xfc8a #define KEY83P_NormProb 0xfc8b #define KEY83P_NormalPDF 0xfc8c #define KEY83P_TPDF 0xfc8d #define KEY83P_ChiPDF 0xfc8e #define KEY83P_FPDF 0xfc8f #define KEY83P_MinY 0xfc90 #define KEY83P_RandBin 0xfc91 #define KEY83P_Ref 0xfc92 #define KEY83P_RRef 0xfc93 #define KEY83P_LRSqr 0xfc94 #define KEY83P_BRSqr 0xfc95 #define KEY83P_DiagOn 0xfc96 #define KEY83P_DiagOff 0xfc97 #define KEY83P_un1 0xfc98 #define KEY83P_vn1 0xfc99 #define k83_00End KEY83P_vn1 #define KEY83P_Archive 0xfc9a #define KEY83P_Unarchive 0xfc9b #define KEY83P_Asm 0xfc9c #define KEY83P_AsmPrgm 0xfc9d #define KEY83P_AsmComp 0xfc9e #define KEY83P_capAAcute 0xfc9f #define KEY83P_capAGrave 0xfca0 #define KEY83P_capACaret 0xfca1 #define KEY83P_capADier 0xfca2 #define KEY83P_aAcute 0xfca3 #define KEY83P_aGrave 0xfca4 #define KEY83P_aCaret 0xfca5 #define KEY83P_aDier 0xfca6 #define KEY83P_capEAcute 0xfca7 #define KEY83P_capEGrave 0xfca8 #define KEY83P_capECaret 0xfca9 #define KEY83P_capEDier 0xfcaa #define KEY83P_eAcute 0xfcab #define KEY83P_eGrave 0xfcac #define KEY83P_eCaret 0xfcad #define KEY83P_eDier 0xfcae #define KEY83P_capIAcute 0xfcaf #define KEY83P_capIGrave 0xfcb0 #define KEY83P_capICaret 0xfcb1 #define KEY83P_capIDier 0xfcb2 #define KEY83P_iAcute 0xfcb3 #define KEY83P_iGrave 0xfcb4 #define KEY83P_iCaret 0xfcb5 #define KEY83P_iDier 0xfcb6 #define KEY83P_capOAcute 0xfcb7 #define KEY83P_capOGrave 0xfcb8 #define KEY83P_capOCaret 0xfcb9 #define KEY83P_capODier 0xfcba #define KEY83P_oAcute 0xfcbb #define KEY83P_oGrave 0xfcbc #define KEY83P_oCaret 0xfcbd #define KEY83P_oDier 0xfcbe #define KEY83P_capUAcute 0xfcbf #define KEY83P_capUGrave 0xfcc0 #define KEY83P_capUCaret 0xfcc1 #define KEY83P_capUDier 0xfcc2 #define KEY83P_uAcute 0xfcc3 #define KEY83P_uGrave 0xfcc4 #define KEY83P_uCaret 0xfcc5 #define KEY83P_uDier 0xfcc6 #define KEY83P_capCCed 0xfcc7 #define KEY83P_cCed 0xfcc8 #define KEY83P_capNTilde 0xfcc9 #define KEY83P_nTilde 0xfcca #define KEY83P_accent 0xfccb #define KEY83P_grave 0xfccc #define KEY83P_dieresis 0xfccd #define KEY83P_quesDown 0xfcce #define KEY83P_exclamDown 0xfccf #define KEY83P_alpha 0xfcd0 #define KEY83P_beta 0xfcd1 #define KEY83P_gamma 0xfcd2 #define KEY83P_capDelta 0xfcd3 #define KEY83P_delta 0xfcd4 #define KEY83P_epsilon 0xfcd5 #define KEY83P_lambda 0xfcd6 #define KEY83P_mu 0xfcd7 #define KEY83P_pi2 0xfcd8 #define KEY83P_rho 0xfcd9 #define KEY83P_capSigma 0xfcda #define KEY83P_sigma 0xfcdb #define KEY83P_tau 0xfcdc #define KEY83P_phi 0xfcdd #define KEY83P_capOmega 0xfcde #define KEY83P_phat 0xfcdf #define KEY83P_chi2 0xfce0 #define KEY83P_statF2 0xfce1 #define KEY83P_La 0xfce2 #define KEY83P_Lb 0xfce3 #define KEY83P_Lc 0xfce4 #define KEY83P_Ld 0xfce5 #define KEY83P_Le 0xfce6 #define KEY83P_Lf 0xfce7 #define KEY83P_Lg 0xfce8 #define KEY83P_Lh 0xfce9 #define KEY83P_Li 0xfcea #define KEY83P_Lj 0xfceb #define KEY83P_Lk 0xfcec #define KEY83P_Ll 0xfced #define KEY83P_Lm 0xfcee #define KEY83P_Lsmalln 0xfcef #define KEY83P_Lo 0xfcf0 #define KEY83P_Lp 0xfcf1 #define KEY83P_Lq 0xfcf2 #define KEY83P_Lsmallr 0xfcf3 #define KEY83P_Ls 0xfcf4 #define KEY83P_Lt 0xfcf5 #define KEY83P_Lu 0xfcf6 #define KEY83P_Lv 0xfcf7 #define KEY83P_Lw 0xfcf8 #define KEY83P_Lx 0xfcf9 #define KEY83P_Ly 0xfcfa #define KEY83P_Lz 0xfcfb #define KEY83P_GarbageC 0xfcfc // Key codes added in OS 1.15 #define KEY83P_Backspace 0x21 #define KEY83P_Reserved 0xFB01 #define KEY83P_AtSign 0xFB02 #define KEY83P_Pound 0xFB03 #define KEY83P_Dollar 0xFB04 #define KEY83P_Ampersand 0xFB05 #define KEY83P_BackQuote 0xFB06 #define KEY83P_Semicolon 0xFB07 #define KEY83P_BackSlash 0xFB08 #define KEY83P_VertSlash 0xFB09 #define KEY83P_Underscore 0xFB0A #define KEY83P_Tilde 0xFB0B #define KEY83P_Percent 0xFB0C #define KEY83P_Tab 0xFB0D #define KEY83P_ShftTaB 0xFB0E #define KEY83P_ShftDel 0xFB0F #define KEY83P_ShftBack 0xFB10 #define KEY83P_ShftPgUp 0xFB11 #define KEY83P_ShftPgDn 0xFB12 #define KEY83P_ShftLeft 0xFB13 #define KEY83P_ShftRight 0xFB14 #define KEY83P_ShftUp 0xFB15 #define KEY83P_ShftDn 0xFB16 #define KEY83P_DiaAdd 0xFB17 #define KEY83P_DiaSub 0xFB18 #define KEY83P_DiaTilde 0xFB19 #define KEY83P_DiaDiv 0xFB1A #define KEY83P_DiaBkSlash 0xFB1B #define KEY83P_DiaColon 0xFB1C #define KEY83P_DiaQuote 0xFB1D #define KEY83P_DiaLBrack 0xFB1E #define KEY83P_DiaRBrack 0xFB1F #define KEY83P_DiaBkSpace 0xFB20 #define KEY83P_DiaEnter 0xFB21 #define KEY83P_DiaComma 0xFB22 #define KEY83P_DiaDel 0xFB23 #define KEY83P_DiaDecPnt 0xFB24 #define KEY83P_Dia0 0xFB25 #define KEY83P_Dia1 0xFB26 #define KEY83P_Dia2 0xFB27 #define KEY83P_Dia3 0xFB28 #define KEY83P_Dia4 0xFB29 #define KEY83P_Dia5 0xFB2A #define KEY83P_Dia6 0xFB2B #define KEY83P_Dia7 0xFB2C #define KEY83P_Dia8 0xFB2D #define KEY83P_Dia9 0xFB2E #define KEY83P_DiaTab 0xFB2F #define KEY83P_DiaSpace 0xFB30 #define KEY83P_DiaA 0xFB31 #define KEY83P_DiaB 0xFB32 #define KEY83P_DiaC 0xFB33 #define KEY83P_DiaD 0xFB34 #define KEY83P_DiaE 0xFB35 #define KEY83P_DiaF 0xFB36 #define KEY83P_DiaG 0xFB37 #define KEY83P_DiaH 0xFB38 #define KEY83P_DiaI 0xFB39 #define KEY83P_DiaJ 0xFB3A #define KEY83P_DiaK 0xFB3B #define KEY83P_DiaL 0xFB3C #define KEY83P_DiaM 0xFB3D #define KEY83P_DiaN 0xFB3E #define KEY83P_DiaO 0xFB3F #define KEY83P_DiaP 0xFB40 #define KEY83P_DiaQ 0xFB41 #define KEY83P_DiaR 0xFB42 #define KEY83P_DiaS 0xFB43 #define KEY83P_DiaT 0xFB44 #define KEY83P_DiaU 0xFB45 #define KEY83P_DiaV 0xFB46 #define KEY83P_DiaW 0xFB47 #define KEY83P_DiaX 0xFB48 #define KEY83P_DiaY 0xFB49 #define KEY83P_DiaZ 0xFB4A #define KEY83P_DiaPgUp 0xFB4B #define KEY83P_DiaPgDn 0xFB4C #define KEY83P_DiaLeft 0xFB4D #define KEY83P_DiaRight 0xFB4E #define KEY83P_DiaUp 0xFB4F #define KEY83P_DiaDn 0xFB50 #define KEY83P_SqrAdd 0xFB51 #define KEY83P_SqrSub 0xFB52 #define KEY83P_SqrTilde 0xFB53 #define KEY83P_SqrDiv 0xFB54 #define KEY83P_SqrBkSlash 0xFB55 #define KEY83P_SqrColon 0xFB56 #define KEY83P_SqrQuote 0xFB57 #define KEY83P_SqrLBrack 0xFB58 #define KEY83P_SqrRBrack 0xFB59 #define KEY83P_SqrBkSpace 0xFB5A #define KEY83P_SqrEnter 0xFB5B #define KEY83P_SqrComma 0xFB5C #define KEY83P_SqrDel 0xFB5D #define KEY83P_SqrDecPnt 0xFB5E #define KEY83P_Sqr0 0xFB5F #define KEY83P_Sqr1 0xFB60 #define KEY83P_Sqr2 0xFB61 #define KEY83P_Sqr3 0xFB62 #define KEY83P_Sqr4 0xFB63 #define KEY83P_Sqr5 0xFB64 #define KEY83P_Sqr6 0xFB65 #define KEY83P_Sqr7 0xFB66 #define KEY83P_Sqr8 0xFB67 #define KEY83P_Sqr9 0xFB68 #define KEY83P_SqrTab 0xFB69 #define KEY83P_SqrSpace 0xFB6A #define KEY83P_SqrA 0xFB6B #define KEY83P_SqrB 0xFB6C #define KEY83P_SqrC 0xFB6D #define KEY83P_SqrD 0xFB6E #define KEY83P_SqrE 0xFB6F #define KEY83P_SqrF 0xFB70 #define KEY83P_SqrG 0xFB71 #define KEY83P_SqrH 0xFB72 #define KEY83P_SqrI 0xFB73 #define KEY83P_SqrJ 0xFB74 #define KEY83P_SqrK 0xFB75 #define KEY83P_SqrL 0xFB76 #define KEY83P_SqrM 0xFB77 #define KEY83P_SqrN 0xFB78 #define KEY83P_SqrO 0xFB79 #define KEY83P_SqrP 0xFB7A #define KEY83P_SqrQ 0xFB7B #define KEY83P_SqrR 0xFB7C #define KEY83P_SqrS 0xFB7D #define KEY83P_SquareT 0xFB7E #define KEY83P_SqrU 0xFB7F #define KEY83P_SqrV 0xFB80 #define KEY83P_SqrW 0xFB81 #define KEY83P_SqrX 0xFB82 #define KEY83P_SqrY 0xFB83 #define KEY83P_SqrZ 0xFB84 #define KEY83P_SqrPgUp 0xFB85 #define KEY83P_SqrPgDn 0xFB86 #define KEY83P_SqrLeft 0xFB87 #define KEY83P_SqrRight 0xFB88 #define KEY83P_SqrUp 0xFB89 #define KEY83P_SqrDn 0xFB8A #define KEY83P_UnDef 0xFB8B // Key codes added in OS 1.16 #define KEY83P_Lellipsis 0xFB8C #define KEY83P_Langle 0xFB8D #define KEY83P_Lss 0xFB8E #define KEY83P_LsupX 0xFB8F #define KEY83P_LsubT 0xFB90 #define KEY83P_Lsub0 0xFB91 #define KEY83P_Lsub1 0xFB92 #define KEY83P_Lsub2 0xFB93 #define KEY83P_Lsub3 0xFB94 #define KEY83P_Lsub4 0xFB95 #define KEY83P_Lsub5 0xFB96 #define KEY83P_Lsub6 0xFB97 #define KEY83P_Lsub7 0xFB98 #define KEY83P_Lsub8 0xFB99 #define KEY83P_Lsub9 0xFB9A #define KEY83P_Lten 0xFB9B #define KEY83P_Lleft 0xFB9C #define KEY83P_Lconvert 0xFB9D #define KEY83P_LupArrow 0xFB9E #define KEY83P_LdownArrow 0xFB9F #define KEY83P_Lcross 0xFBA0 #define KEY83P_Lintegral 0xFBA1 #define KEY83P_LsqUp 0xFBA2 #define KEY83P_LsqDown 0xFBA3 #define KEY83P_Lroot 0xFBA4 #define KEY83P_LinvEQ 0xFBA5 // Key codes added in OS 2.21 (TI-84+) #define KEY84P_SetDate 0xFBA6 #define KEY84P_SetTime 0xFBA7 #define KEY84P_CheckTmr 0xFBA8 #define KEY84P_SetDtFmt 0xFBA9 #define KEY84P_SetTmFmt 0xFBAA #define KEY84P_TimeCnv 0xFBAB #define KEY84P_DayOfWk 0xFBAC #define KEY84P_GetDtStr 0xFBAD #define KEY84P_GetTmStr 0xFBAE #define KEY84P_GetDate 0xFBAF #define KEY84P_GetTime 0xFBB0 #define KEY84P_StartTmr 0xFBB1 #define KEY84P_GetDtFmt 0xFBB2 #define KEY84P_GetTmFmt 0xFBB3 #define KEY84P_IsClockOn 0xFBB4 #define KEY84P_ClockOff 0xFBB5 #define KEY84P_ClockOn 0xFBB6 #define KEY84P_OpenLib 0xFBB7 #define KEY84P_ExecLib 0xFBB8 // Key codes added in OS 2.30 #define KEY84P_InvT 0xFBB9 #define KEY84P_Chi2GOFTest 0xFBBA #define KEY84P_LinRegTInt 0xFBBB // BC: unknown #define KEY84P_ManualFit 0xFBBD // Key codes for OS 2.53MP / 2.54MP only // (note that these conflict with earlier and later OSes) #define KEY84P_253_LogBASE 0xFBBC #define KEY84P_253_SumSeq 0xFBBD // BE: unknown #define KEY84P_253_FracSlash 0xFBBF #define KEY84P_253_Unit 0xFBC0 #define KEY84P_253_MixSimp 0xFBC1 #define KEY84P_253_FracDec 0xFBC2 #define KEY84P_253_Remainder 0xFBC3 #define KEY84P_253_RandIntNoRep 0xFBC4 // C5: unknown #define KEY84P_253_Placeholder 0xFBC6 #define KEY84P_253_MATHPRINT 0xFBC7 #define KEY84P_253_CLASSIC 0xFBC8 #define KEY84P_253_SimpleMode 0xFBC9 #define KEY84P_253_MixedMode 0xFBCA #define KEY84P_253_AUTO 0xFBCB #define KEY84P_253_DEC 0xFBCC #define KEY84P_253_FRAC 0xFBCD #define KEY84P_253_ZQuadrant1 0xFBCE #define KEY84P_253_ZFracOneHalf 0xFBCF #define KEY84P_253_ZFracOneThird 0xFBD0 #define KEY84P_253_ZFracOneQuarter 0xFBD1 #define KEY84P_253_ZFracOneFifth 0xFBD2 #define KEY84P_253_ZFracOneEighth 0xFBD3 #define KEY84P_253_ZFracOneTenth 0xFBD4 // D5: unknown #define KEY84P_253_ManualFit 0xFBD6 // Key codes added in OS 2.55MP // BE: unknown // BF: unknown #define KEY84P_ZQuadrant1 0xFBC0 #define KEY84P_ZFracOneHalf 0xFBC1 #define KEY84P_ZFracOneThird 0xFBC2 #define KEY84P_ZFracOneQuarter 0xFBC3 #define KEY84P_ZFracOneFifth 0xFBC4 #define KEY84P_ZFracOneEighth 0xFBC5 #define KEY84P_ZFracOneTenth 0xFBC6 #define KEY84P_LogBASE 0xFBC7 #define KEY84P_SumSeq 0xFBC8 // C9: unknown #define KEY84P_FracSlash 0xFBCA #define KEY84P_Unit 0xFBCB #define KEY84P_MixSimp 0xFBCC #define KEY84P_FracDec 0xFBCD #define KEY84P_Remainder 0xFBCE #define KEY84P_RandIntNoRep 0xFBCF // D0: unknown #define KEY84P_Placeholder 0xFBD1 #define KEY84P_MATHPRINT 0xFBD2 #define KEY84P_CLASSIC 0xFBD3 #define KEY84P_SimpleMode 0xFBD4 #define KEY84P_MixedMode 0xFBD5 #define KEY84P_AUTO 0xFBD6 #define KEY84P_DEC 0xFBD7 #define KEY84P_FRAC 0xFBD8 #define KEY84P_STATWIZARD_ON 0xFBD9 #define KEY84P_STATWIZARD_OFF 0xFBDA // Key codes added in OS 4.0 (TI-84+CSE) #define KEY84PC_BLUE 0xFBDB #define KEY84PC_RED 0xFBDC #define KEY84PC_BLACK 0xFBDD #define KEY84PC_MAGENTA 0xFBDE #define KEY84PC_GREEN 0xFBDF #define KEY84PC_ORANGE 0xFBE0 #define KEY84PC_BROWN 0xFBE1 #define KEY84PC_NAVY 0xFBE2 #define KEY84PC_LTBLUE 0xFBE3 #define KEY84PC_YELLOW 0xFBE4 #define KEY84PC_WHITE 0xFBE5 #define KEY84PC_LTGRAY 0xFBE6 #define KEY84PC_MEDGRAY 0xFBE7 #define KEY84PC_GRAY 0xFBE8 #define KEY84PC_DARKGRAY 0xFBE9 #define KEY84PC_Image1 0xFBEA #define KEY84PC_Image2 0xFBEB #define KEY84PC_Image3 0xFBEC #define KEY84PC_Image4 0xFBED #define KEY84PC_Image5 0xFBEE #define KEY84PC_Image6 0xFBEF #define KEY84PC_Image7 0xFBF0 #define KEY84PC_Image8 0xFBF1 #define KEY84PC_Image9 0xFBF2 #define KEY84PC_Image0 0xFBF3 #define KEY84PC_GridLine 0xFBF4 #define KEY84PC_BackgroundOn 0xFBF5 #define KEY84PC_BackgroundOff 0xFBF6 #define KEY84PC_GraphColor 0xFBF7 #define KEY84PC_QuickPlotAndFitEq 0xFBF8 #define KEY84PC_TextColor 0xFA01 #define KEY84PC_Asm84PCPrgm 0xFA02 #define KEY84PC_DetectAsymOn 0xFA03 #define KEY84PC_DetectAsymOff 0xFA04 #define KEY84PC_BorderColor 0xFA05 #define KEY84PC_SmallDotIcon 0xFA06 #define KEY84PC_Thin 0xFA07 #define KEY84PC_DotThin 0xFA08 // Key codes added in OS 5.0 (TI-84+CE) // 09-14: unknown #define KEY84PCE_PlySmlt2 0xFA15 #define KEY84PCE_Asm84CEPrgm 0xFA16 #endif libticalcs-1.1.9+dfsg/src/keys86.c000066400000000000000000000201101327711501700166340ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: keys83p.c 2385 2006-05-26 07:44:30Z roms $ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2007 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "ticalcs.h" #include "keys86.h" /* Conversion of an ASCII code into a TI key This table is very incomplete. It contains most of ASCII chars only. */ const OldCalcKeys_ TI86_KEYS[] = { /* 0x00 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"Enter", "Enter", KEY86_Enter, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x10 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"ESC", "Exit", KEY86_Exit, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x20 */ {" ", "Space", KEY86_Space, "", 0, "", 0, "", 0, "", 0}, {"!", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"#", "", 0, "", 0, "", 0, "", 0, "", 0}, {"$", "", 0, "", 0, "", 0, "", 0, "", 0}, {"%", "", 0, "", 0, "", 0, "", 0, "", 0}, {"&", "", 0, "", 0, "", 0, "", 0, "", 0}, {"'", "", 0, "", 0, "", 0, "", 0, "", 0}, {"(", "LParen", KEY86_LParen, "", 0, "", 0, "", 0, "", 0}, {")", "RParen", KEY86_RParen, "", 0, "", 0, "", 0, "", 0}, {"*", "Mul", KEY86_Mul, "", 0, "", 0, "", 0, "", 0}, {"+", "Add", KEY86_Add, "", 0, "", 0, "", 0, "", 0}, {",", "Comma", KEY86_Comma, "", 0, "", 0, "", 0, "", 0}, {"-", "Sub", KEY86_Sub, "", 0, "", 0, "", 0, "", 0}, {".", "", 0, "", 0, "", 0, "", 0, "", 0}, {"/", "Div", KEY86_Div, "", 0, "", 0, "", 0, "", 0}, /* 0x30 */ {"0", "0", KEY86_0, "", 0, "", 0, "", 0, "", 0}, {"1", "1", KEY86_1, "", 0, "", 0, "", 0, "", 0}, {"2", "2", KEY86_2, "", 0, "", 0, "", 0, "", 0}, {"3", "3", KEY86_3, "", 0, "", 0, "", 0, "", 0}, {"4", "4", KEY86_4, "", 0, "", 0, "", 0, "", 0}, {"5", "5", KEY86_5, "", 0, "", 0, "", 0, "", 0}, {"6", "6", KEY86_6, "", 0, "", 0, "", 0, "", 0}, {"7", "7", KEY86_7, "", 0, "", 0, "", 0, "", 0}, {"8", "8", KEY86_8, "", 0, "", 0, "", 0, "", 0}, {"9", "9", KEY86_9, "", 0, "", 0, "", 0, "", 0}, {":", "", 0, "", 0, "", 0, "", 0, "", 0}, {";", "", 0, "", 0, "", 0, "", 0, "", 0}, {"<", "", 0, "", 0, "", 0, "", 0, "", 0}, {"=", "=", KEY86_Equal, "", 0, "", 0, "", 0, "", 0}, {">", "", 0, "", 0, "", 0, "", 0, "", 0}, {"?", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x40 */ {"@", "@", 0, "", 0, "", 0, "", 0, "", 0}, {"A", "A", KEY86_CapA, "", 0, "", 0, "", 0, "", 0}, {"B", "B", KEY86_CapB, "", 0, "", 0, "", 0, "", 0}, {"C", "C", KEY86_CapC, "", 0, "", 0, "", 0, "", 0}, {"D", "D", KEY86_CapD, "", 0, "", 0, "", 0, "", 0}, {"E", "E", KEY86_CapE, "", 0, "", 0, "", 0, "", 0}, {"F", "F", KEY86_CapF, "", 0, "", 0, "", 0, "", 0}, {"G", "G", KEY86_CapG, "", 0, "", 0, "", 0, "", 0}, {"H", "H", KEY86_CapH, "", 0, "", 0, "", 0, "", 0}, {"I", "I", KEY86_CapI, "", 0, "", 0, "", 0, "", 0}, {"J", "J", KEY86_CapJ, "", 0, "", 0, "", 0, "", 0}, {"K", "K", KEY86_CapK, "", 0, "", 0, "", 0, "", 0}, {"L", "L", KEY86_CapL, "", 0, "", 0, "", 0, "", 0}, {"M", "M", KEY86_CapM, "", 0, "", 0, "", 0, "", 0}, {"N", "N", KEY86_CapN, "", 0, "", 0, "", 0, "", 0}, {"O", "O", KEY86_CapO, "", 0, "", 0, "", 0, "", 0}, /* 0x50 */ {"P", "P", KEY86_CapP, "", 0, "", 0, "", 0, "", 0}, {"Q", "Q", KEY86_CapQ, "", 0, "", 0, "", 0, "", 0}, {"R", "R", KEY86_CapR, "", 0, "", 0, "", 0, "", 0}, {"S", "S", KEY86_CapS, "", 0, "", 0, "", 0, "", 0}, {"T", "T", KEY86_CapT, "", 0, "", 0, "", 0, "", 0}, {"U", "U", KEY86_CapU, "", 0, "", 0, "", 0, "", 0}, {"V", "V", KEY86_CapV, "", 0, "", 0, "", 0, "", 0}, {"W", "W", KEY86_CapW, "", 0, "", 0, "", 0, "", 0}, {"X", "X", KEY86_CapX, "", 0, "", 0, "", 0, "", 0}, {"Y", "Y", KEY86_CapY, "", 0, "", 0, "", 0, "", 0}, {"Z", "Z", KEY86_CapZ, "", 0, "", 0, "", 0, "", 0}, {"[", "LBrack", KEY86_LBrack, "", 0, "", 0, "", 0, "", 0}, {"\\", "", 0, "", 0, "", 0, "", 0, "", 0}, {"]", "RBrack", KEY86_RBrack, "", 0, "", 0, "", 0, "", 0}, {"^", "", 0, "", 0, "", 0, "", 0, "", 0}, {"_", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x60 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"a", "a", KEY86_a, "", 0, "", 0, "", 0, "", 0}, {"b", "b", KEY86_b, "", 0, "", 0, "", 0, "", 0}, {"c", "c", KEY86_c, "", 0, "", 0, "", 0, "", 0}, {"d", "d", KEY86_d, "", 0, "", 0, "", 0, "", 0}, {"e", "e", KEY86_e, "", 0, "", 0, "", 0, "", 0}, {"f", "f", KEY86_f, "", 0, "", 0, "", 0, "", 0}, {"g", "g", KEY86_g, "", 0, "", 0, "", 0, "", 0}, {"h", "h", KEY86_h, "", 0, "", 0, "", 0, "", 0}, {"i", "i", KEY86_i, "", 0, "", 0, "", 0, "", 0}, {"j", "j", KEY86_j, "", 0, "", 0, "", 0, "", 0}, {"k", "k", KEY86_k, "", 0, "", 0, "", 0, "", 0}, {"l", "l", KEY86_l, "", 0, "", 0, "", 0, "", 0}, {"m", "m", KEY86_m, "", 0, "", 0, "", 0, "", 0}, {"n", "n", KEY86_n, "", 0, "", 0, "", 0, "", 0}, {"o", "o", KEY86_o, "", 0, "", 0, "", 0, "", 0}, /* 0x70 */ {"p", "p", KEY86_p, "", 0, "", 0, "", 0, "", 0}, {"q", "q", KEY86_q, "", 0, "", 0, "", 0, "", 0}, {"r", "r", KEY86_r, "", 0, "", 0, "", 0, "", 0}, {"s", "s", KEY86_s, "", 0, "", 0, "", 0, "", 0}, {"t", "t", KEY86_t, "", 0, "", 0, "", 0, "", 0}, {"u", "u", KEY86_u, "", 0, "", 0, "", 0, "", 0}, {"v", "v", KEY86_v, "", 0, "", 0, "", 0, "", 0}, {"w", "w", KEY86_w, "", 0, "", 0, "", 0, "", 0}, {"x", "x", KEY86_x, "", 0, "", 0, "", 0, "", 0}, {"y", "y", KEY86_y, "", 0, "", 0, "", 0, "", 0}, {"z", "z", KEY86_z, "", 0, "", 0, "", 0, "", 0}, {"{", "", 0, "", 0, "", 0, "", 0, "", 0}, {"|", "", 0, "", 0, "", 0, "", 0, "", 0}, {"}", "", 0, "", 0, "", 0, "", 0, "", 0}, {"~", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x80 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\173", "Ans", KEY86_Ans, "\173", 173, "ANS", 4372, "", 8365, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x90 */ }; libticalcs-1.1.9+dfsg/src/keys86.h000066400000000000000000000142331327711501700166520ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: keys83p.h 1179 2005-06-06 14:42:32Z roms $ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TICALCS_KEYS86__ #define __TICALCS_KEYS86__ // Scan codes of the TI86 (thanks to B. Moody) #define KEY86_Right 0x01 #define KEY86_Left 0x02 #define KEY86_Up 0x03 #define KEY86_Down 0x04 #define KEY86_Colon 0x05 #define KEY86_Enter 0x06 #define KEY86_Exit 0x07 #define KEY86_Clear 0x08 #define KEY86_Del 0x09 #define KEY86_Ins 0x0A #define KEY86_Next 0x0B #define KEY86_Add 0x0C #define KEY86_Sub 0x0D #define KEY86_Mul 0x0E #define KEY86_Div 0x0F #define KEY86_Expon 0x10 #define KEY86_LParen 0x11 #define KEY86_RParen 0x12 #define KEY86_LBrack 0x13 #define KEY86_RBrack 0x14 #define KEY86_Equal 0x15 #define KEY86_Store 0x16 #define KEY86_Recall 0x17 #define KEY86_Comma 0x18 #define KEY86_Ang 0x19 #define KEY86_Chs 0x1A #define KEY86_DecPnt 0x1B #define KEY86_0 0x1C #define KEY86_1 0x1D #define KEY86_2 0x1E #define KEY86_3 0x1F #define KEY86_4 0x20 #define KEY86_5 0x21 #define KEY86_6 0x22 #define KEY86_7 0x23 #define KEY86_8 0x24 #define KEY86_9 0x25 #define KEY86_EE 0x26 #define KEY86_Space 0x27 #define KEY86_CapA 0x28 #define KEY86_CapB 0x29 #define KEY86_CapC 0x2A #define KEY86_CapD 0x2B #define KEY86_CapE 0x2C #define KEY86_CapF 0x2D #define KEY86_CapG 0x2E #define KEY86_CapH 0x2F #define KEY86_CapI 0x30 #define KEY86_CapJ 0x31 #define KEY86_CapK 0x32 #define KEY86_CapL 0x33 #define KEY86_CapM 0x34 #define KEY86_CapN 0x35 #define KEY86_CapO 0x36 #define KEY86_CapP 0x37 #define KEY86_CapQ 0x38 #define KEY86_CapR 0x39 #define KEY86_CapS 0x3A #define KEY86_CapT 0x3B #define KEY86_CapU 0x3C #define KEY86_CapV 0x3D #define KEY86_CapW 0x3E #define KEY86_CapX 0x3F #define KEY86_CapY 0x40 #define KEY86_CapZ 0x41 #define KEY86_a 0x42 #define KEY86_b 0x43 #define KEY86_c 0x44 #define KEY86_d 0x45 #define KEY86_e 0x46 #define KEY86_f 0x47 #define KEY86_g 0x48 #define KEY86_h 0x49 #define KEY86_i 0x4A #define KEY86_j 0x4B #define KEY86_k 0x4C #define KEY86_l 0x4D #define KEY86_m 0x4E #define KEY86_n 0x4F #define KEY86_o 0x50 #define KEY86_p 0x51 #define KEY86_q 0x52 #define KEY86_r 0x53 #define KEY86_s 0x54 #define KEY86_t 0x55 #define KEY86_u 0x56 #define KEY86_v 0x57 #define KEY86_w 0x58 #define KEY86_x 0x59 #define KEY86_y 0x5A #define KEY86_z 0x5B #define KEY86_Varx 0x5C #define KEY86_Ans 0x5D #define KEY86_Pi 0x5E #define KEY86_Inv 0x5F #define KEY86_Sin 0x60 #define KEY86_ASin 0x61 #define KEY86_Cos 0x62 #define KEY86_ACos 0x63 #define KEY86_Tan 0x64 #define KEY86_ATan 0x65 #define KEY86_Square 0x66 #define KEY86_Sqrt 0x67 #define KEY86_Ln 0x68 #define KEY86_Exp 0x69 #define KEY86_Log 0x6A #define KEY86_ALog 0x6B #define KEY86_Math 0x6C #define KEY86_Cplx 0x6D #define KEY86_String 0x6E #define KEY86_Test 0x6F #define KEY86_Conv 0x70 #define KEY86_Char 0x71 #define KEY86_Base 0x72 #define KEY86_Custom 0x73 #define KEY86_Vars 0x74 #define KEY86_Catalog 0x75 #define KEY86_Quit 0x76 #define KEY86_LastEnt 0x77 #define KEY86_LinkIO 0x78 #define KEY86_Mem 0x79 #define KEY86_List 0x7A #define KEY86_Vector 0x7B #define KEY86_Const 0x7C #define KEY86_Matrix 0x7D #define KEY86_Poly 0x7E #define KEY86_Simult 0x7F #define KEY86_Stat 0x80 #define KEY86_GrMenu 0x81 #define KEY86_Mode 0x82 #define KEY86_Prgm 0x83 #define KEY86_Calcu 0x84 #define KEY86_Solver 0x85 #define KEY86_Table 0x86 #define KEY86_BOL 0x87 #define KEY86_EOL 0x88 #define KEY86_F1 0xC2 #define KEY86_F2 0xC3 #define KEY86_F3 0xC4 #define KEY86_F4 0xC5 #define KEY86_F5 0xC6 #define KEY86_F6 0xC7 #define KEY86_F7 0xC8 #define KEY86_F8 0xC9 #define KEY86_F9 0xCA #define KEY86_F10 0xCB #endif libticalcs-1.1.9+dfsg/src/keys89.c000066400000000000000000000464121327711501700166540ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "ticalcs.h" /* Conversion of an PC scancode into an TI scancode. This array use UniCode character set on PC side (16 bits chars) as an index. The TI character set is the same as PC one from 0x00 to 0x7F and from 0xC0 to 0xFF. These codes can be found in the section B of the french manual From 0x00 to 0xff, Unicode codes. From 0x0100, I have put proprietary TI scancodes. The array can be used in reverse order too, at least for the first column... Note: this array is a copy of the TI92 one which has been modified thus some rows may not really exists on the TI89. */ const OldCalcKeys_ TI89_KEYS[] = { /* 0x00, 0 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"<-", "BS", 257, "BS", 257, "INS", 4353, "DEL", 8449, "BS", 257}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"ENTER", "CR", 13, "CR", 13, "ENTRY", 4109, "APPROX", 8205, "CR", 13}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x10, 16 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"ESC", "ESC", 264, "ESC", 264, "QUIT", 4360, "", 8456, "ESC", 264}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x20, 32 */ {"SPACE", "", 32, "", 32, "", 32, "", 8224, "SPACE", 32}, {"!", "!", 33, "", 0, "", 0, "", 0, "", 0}, {"\"", "\"", 34, "", 0, "", 0, "", 0, "", 0}, {"#", "#", 35, "", 0, "", 0, "", 0, "", 0}, {"$", "$", 36, "", 0, "", 0, "", 0, "", 0}, {"%", "%", 37, "", 0, "", 0, "", 0, "", 0}, {"&", "&", 38, "", 0, "", 0, "", 0, "", 0}, {"'", "'", 39, "", 0, "", 0, "", 0, "", 0}, {"(", "(", 40, "B", 66, "{", 123, "i", 0, "b", 98}, {")", ")", 41, "C", 67, "}", 125, "(c)", 169, "c", 99}, {"*", "*", 42, "J", 74, "sqrt", 4138, "&", 38, "j", 106}, {"+", "+", 43, "U", 85, "CHAR", 4139, "Contrast+", 0, "u", 117}, {",", ",", 44, "D", 68, "[", 91, "", 8236, "d", 100}, {"-", "-", 45, "O", 79, "VAR-LNK", 4141, "Contrast-", 0, "o", 111}, {".", ".", 46, "W", 87, ">", 62, ">=", 158, "w", 119}, {"/", "/", 47, "E", 69, "]", 93, "!", 33, "e", 101}, /* 0x30, 48 */ {"0", "0", 48, "V", 86, "<", 60, "<=", 156, "v", 118}, {"1", "1", 49, "Q", 81, "\"", 34, "", 8241, "q", 113}, {"2", "2", 50, "R", 82, "\\", 92, "", 8242, "r", 114}, {"3", "3", 51, "S", 83, "UNITS", 4147, "", 8243, "s", 115}, {"4", "4", 52, "L", 76, ":", 58, "", 8244, "l", 108}, {"5", "5", 53, "M", 77, "MATH", 4149, "", 8245, "m", 109}, {"6", "6", 54, "N", 78, "MEM", 4150, "", 8246, "n", 110}, {"7", "7", 55, "G", 71, "integrate", 4151, "", 8247, "g", 103}, {"8", "8", 56, "H", 72, "derivate", 4152, "", 8248, "h", 104}, {"9", "9", 57, "I", 73, ";", 4153, "", 8249, "i", 105}, {":", ":", 58, "", 0, "", 0, "", 0, "", 0}, {";", ";", 59, "", 0, "", 0, "", 0, "", 0}, {"<", "<", 60, "", 0, "", 0, "", 0, "", 0}, {"=", "=", 61, "A", 65, "'", 39, "<>", 157, "a", 97}, {">", ">", 62, "", 0, "", 0, "", 0, "", 0}, {"?", "?", 63, "", 0, "", 0, "", 0, "", 0}, /* 0x40, 64 */ {"@", "@", 64, "", 0, "", 0, "", 0, "", 0}, {"A", "A", 65, "A", 65, "Table3", 0, "", 8257, "", 0}, {"B", "B", 66, "B", 66, "'", 39, "", 8258, "", 0}, {"C", "C", 67, "C", 67, "Table4", 0, "COPY", 8259, "", 0}, {"D", "D", 68, "D", 68, "\176", 176, "", 8260, "", 0}, {"E", "E", 69, "E", 69, "Table5", 0, "WINDOW", 8261, "", 0}, {"F", "F", 70, "F", 70, "\208", 159, "FORMAT", 8262, "", 0}, {"G", "G", 71, "G", 71, "Table6", 0, "", 8263, "", 0}, {"H", "H", 72, "H", 72, "&", 38, "", 8264, "", 0}, {"I", "I", 73, "I", 73, "\151", 151, "", 8265, "", 0}, {"J", "J", 74, "J", 74, "\165", 190, "", 8266, "", 0}, {"K", "K", 75, "K", 75, "|", 124, "", 8267, "", 0}, {"L", "L", 76, "L", 76, "\"", 34, "", 8268, "", 0}, {"M", "M", 77, "M", 77, ";", 59, "", 8269, "", 0}, {"N", "N", 78, "N", 78, "Table7", 0, "NEW", 8270, "", 0}, {"O", "O", 79, "O", 79, "Table8", 0, "OPEN", 8271, "", 0}, /* 0x50, 80 */ {"P", "P", 80, "P", 80, "_", 95, "", 8272, "", 0}, {"Q", "Q", 81, "Q", 81, "?", 63, "HOME", 8273, "", 0}, {"R", "R", 82, "R", 82, "@", 64, "GRAPH", 8274, "", 0}, {"S", "S", 83, "S", 83, "\223", 223, "SAVE", 8275, "", 0}, {"T", "T", 84, "T", 84, "#", 35, "TblSet", 8276, "", 0}, {"U", "U", 85, "U", 85, "Table9", 0, "", 8277, "", 0}, {"V", "V", 86, "V", 86, "\157", 157, "PASTE", 8278, "", 0}, {"W", "W", 87, "W", 87, "!", 33, "Y=", 8279, "", 0}, {"X", "X", 88, "X", 88, "\169", 169, "CUT", 8280, "", 0}, {"Y", "Y", 89, "Y", 89, "\18", 18, "TABLE", 8281, "", 0}, {"Z", "Z", 90, "Z", 90, "CapsLock", 0, "", 8282, "", 0}, {"[", "[", 91, "", 0, "", 0, "", 0, "", 0}, {"\\", "\\", 92, "", 0, "", 0, "", 0, "", 0}, {"]", "]", 93, "", 0, "", 0, "", 0, "", 0}, {"^", "^", 94, "^", 94, "\140", 140, "THETA", 136, "^", 94}, {"_", "_", 95, "", 0, "", 0, "", 0, "", 0}, /* 0x60, 96 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"a", "a", 97, "A", 65, "Table3", 0, "", 8257, "", 0}, {"b", "b", 98, "B", 66, "'", 39, "", 8258, "", 0}, {"c", "c", 99, "C", 67, "Table4", 0, "COPY", 8259, "", 0}, {"d", "d", 100, "D", 68, "\176", 176, "", 8260, "", 0}, {"e", "e", 101, "E", 69, "Table5", 0, "WINDOW", 8261, "", 0}, {"f", "f", 102, "F", 70, "\208", 159, "FORMAT", 8262, "", 0}, {"g", "g", 103, "G", 71, "Table6", 0, "", 8263, "", 0}, {"h", "h", 104, "H", 72, "&", 38, "", 8264, "", 0}, {"i", "i", 105, "I", 73, "\151", 151, "", 8265, "", 0}, {"j", "j", 106, "J", 74, "\165", 190, "", 8266, "", 0}, {"k", "k", 107, "K", 75, "|", 124, "", 8267, "", 0}, {"l", "l", 108, "L", 76, "\"", 34, "", 8268, "", 0}, {"m", "m", 109, "M", 77, ";", 59, "", 8269, "", 0}, {"n", "n", 110, "N", 78, "Table7", 0, "NEW", 8270, "", 0}, {"o", "o", 111, "O", 79, "Table8", 0, "OPEN", 8271, "", 0}, /* 0x70, 112 */ {"p", "p", 112, "P", 80, "_", 95, "", 8272, "", 0}, {"q", "q", 113, "Q", 81, "?", 63, "HOME", 8273, "", 0}, {"r", "r", 114, "R", 82, "@", 64, "GRAPH", 8274, "", 0}, {"s", "s", 115, "S", 83, "\223", 223, "SAVE", 8275, "", 0}, {"t", "t", 116, "T", 84, "TAN", 4180, "TAN-1", 8276, "t", 116}, {"u", "u", 117, "U", 85, "Table9", 0, "", 8277, "", 0}, {"v", "v", 118, "V", 86, "\157", 157, "PASTE", 8278, "", 0}, {"w", "w", 119, "W", 87, "!", 33, "Y=", 8279, "", 0}, {"x", "x", 120, "X", 88, "LN", 4184, "eX", 8280, "x", 120}, {"y", "y", 121, "Y", 89, "SIN", 4185, "SIN-1", 8281, "y", 121}, {"z", "z", 122, "Z", 90, "COS", 4196, "COS-1", 8282, "z", 122}, {"{", "{", 0, "", 0, "", 0, "", 0, "", 0}, {"|", "|", 124, "F", 70, "\xb0", 176, "d/b", 8316, "f", 102}, /* Degree */ {"}", "}", 0, "", 0, "", 0, "", 0, "", 0}, {"~", "~", 126, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x80, 128 */ {"\128", "\128", 128, "", 0, "", 0, "", 0, "", 0}, {"\129", "\129", 129, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\131", "\131", 131, "\130", 130, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\133", "\133", 133, "\132", 132, "", 0, "", 0, "", 0}, {"\134", "\134", 134, "", 0, "", 0, "", 0, "", 0}, {"\135", "\135", 135, "", 0, "", 0, "", 0, "", 0}, {"\136", "\136", 136, "\136", 136, ":", 58, "", 8328, "", 0}, {"\137", "\137", 137, "", 0, "", 0, "", 0, "", 0}, {"\138", "\138", 138, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0,"", 0, "", 0}, {"\140", "\140", 140, "\139", 139, "", 0, "", 0, "", 0}, {"\141", "\141", 141, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\143", "\143", 143, "\142", 142, "", 0, "", 0, "", 0}, /* 0x90, 144 */ {"\144", "\144", 144, "", 0, "", 0, "", 0, "", 0}, {"\145", "\145", 145, "", 0, "", 0, "", 0, "", 0}, {"\146", "\146", 146, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"EE", "EE", 149, "K", 75, "angl", 159, "SYMB", 8341, "k", 107}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0xA0, 160 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"(-)", "(-)", 173, " ", 32, "ANS", 4372, "", 8365, " ", 32}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0xB0, 176 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0xC0, 192 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0xD0, 208 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0xE0, 224 */ {"\xe0", "\xe0", 224, "\192", 192, "", 0, "", 0, "", 0}, /* agrave */ {"\225", "\225", 225, "\193", 193, "", 0, "", 0, "", 0}, {"\xe2", "\xe2", 226, "\194", 194, "", 0, "", 0, "", 0}, /* acirc */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\xe4", "\xe4", 228, "\196", 196, "", 0, "", 0, "", 0}, /* auml */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\xe7", "\xe7", 231, "\199", 199, "", 0, "", 0, "", 0}, /* ccedil */ {"\xe8", "\xe8", 232, "\200", 200, "", 0, "", 0, "", 0}, /* egrave */ {"\xe9", "\xe9", 233, "\201", 201, "", 0, "", 0, "", 0}, /* eacute */ {"\xea", "\xea", 234, "\202", 202, "", 0, "", 0, "", 0}, /* ecirc */ {"\xeb", "\xeb", 235, "\203", 203, "", 0, "", 0, "", 0}, /* euml */ {"\236", "\236", 236, "\204", 204, "", 0, "", 0, "", 0}, {"\237", "\237", 237, "\205", 205, "", 0, "", 0, "", 0}, {"\xee", "\xee", 238, "\206", 206, "", 0, "", 0, "", 0}, /* icirc */ {"\xef", "\xef", 239, "\207", 207, "", 0, "", 0, "", 0}, /* iuml */ /* 0xF0, 240-255 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\xf1", "\xf1", 241, "\209", 209, "", 0, "", 0, "", 0}, /* ntilde */ {"\242", "\242", 242, "\210", 210, "", 0, "", 0, "", 0}, {"\243", "\243", 243, "\211", 211, "", 0, "", 0, "", 0}, {"\xf4", "\xf4", 244, "\212", 212, "", 0, "", 0, "", 0}, /* ocirc */ {"\xf5", "\xf5", 245, "", 0, "", 0, "", 0, "", 0}, /* otilde */ {"\xf6", "\xf6", 246, "\214", 214, "", 0, "", 0, "", 0}, /* ouml */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\xf9", "\xf9", 249, "\217", 217, "", 0, "", 0, "", 0}, /* ugrave */ {"\250", "\250", 250, "\221", 221, "", 0, "", 0, "", 0}, {"\xfb", "\xfb", 251, "\219", 219, "", 0, "", 0, "", 0}, /* ucirc */ {"\xfc", "\xfc", 252, "\220", 220, "", 0, "", 0, "", 0}, /* uuml */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\xff", "\xff", 255, "", 0, "", 0, "", 0, "", 0}, /* yuml */ /* 0x100, 256 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"<-", "BS", 257, "BS", 257, "INS", 4353, "DEL", 8449, "", 0}, {"STO->", "STO->", 258, "P", 80, "RCL", 4354, "@", 64, "p", 112}, {"SIN", "SIN", 259, "SIN", 259, "SIN\200", 4355, "", 8451, "", 0}, {"COS", "COS", 260, "COS", 260, "COS\200", 4356, "", 8452, "", 0}, {"TAN", "TAN", 261, "TAN", 261, "TAN\200", 4357, "", 8453, "", 0}, {"LN", "LN", 262, "LN", 262, "e^x", 4358, "", 8454, "", 0}, {"CLEAR", "CLEAR", 263, "CLEAR", 263, "CLEAR", 263, "", 8455, "", 0}, {"ESC", "ESC", 264, "ESC", 264, "QUIT", 4360, "", 8456, "", 0}, {"APPS", "APPS", 265, "APPS", 265, "SWITCH", 4361, "", 8457, "", 0}, {"MODE", "MODE", 266, "MODE", 266, ">", 18, "_", 95, "MODE", 266 }, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"F1", "F1", 268, "F1", 268, "F1", 8460, "F1", 0, "", 0}, {"F2", "F2", 269, "F2", 269, "F2", 8461, "F2", 0, "", 0}, {"F3", "F3", 270, "F3", 270, "F3", 8462, "F3", 0, "", 0}, {"F4", "F4", 271, "F4", 271, "F4", 8463, "F4", 0, "", 0}, /* 0x110,272 */ {"F5", "F5", 272, "F5", 272, "F5", 8464, "F5", 268, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"HOME", "HOME", 277, "HOME", 277, "CUST", 4373, "HOME", 277, "HOME", 277}, {"CATLG", "CATLG", 278, "i", 151, "infinite", 190, "CATLG", 278, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x120, 288 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x130, 304 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x140, 320 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x150, 336 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"LEFT", "LEFT", 337, "LEFT", 16721, "LEFT", 4433, "LEFT", 8529, "", 0}, {"UP", "UP", 338, "UP", 16722, "UP", 4434, "UP", 8530, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"RIGHT", "RIGHT", 340, "RIGHT", 16724, "RIGHT", 4436, "RIGHT", 8532, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"DOWN", "DOWN", 344, "DOWN", 16728, "DOWN", 4440, "DOWN", 8536, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x160 */ }; libticalcs-1.1.9+dfsg/src/keys89.h000066400000000000000000000045671327711501700166660ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TICALCS_KEYS89__ #define __TICALCS_KEYS89__ // Keys of the TI89 (to update: tiams.h, line 38) #define KEY89_CR 13 #define KEY89_ENTER 13 #define KEY89_LP 40 // Left parenthesis #define KEY89_RP 41 // Right parenthesis #define KEY89_MULT 42 #define KEY89_PLUS 43 #define KEY89_COMMA 44 #define KEY89_MINUS 45 #define KEY89_DOT 46 #define KEY89_DIVIDE 47 #define KEY89_0 48 #define KEY89_1 49 #define KEY89_2 50 #define KEY89_3 51 #define KEY89_4 52 #define KEY89_5 53 #define KEY89_6 54 #define KEY89_7 55 #define KEY89_8 56 #define KEY89_9 57 #define KEY89_EQUALS 61 #define KEY89_POWER 94 #define KEY89_T 116 #define KEY89_X 120 #define KEY89_Y 121 #define KEY89_Z 122 #define KEY89_TUBE 124 #define KEY89_EE 149 #define KEY89_NEG 173 #define KEY89_BS 257 #define KEY89_STO 258 #define KEY89_CLEAR 263 #define KEY89_ESC 264 #define KEY89_APPS 265 #define KEY89_MODE 266 #define KEY89_ON 267 #define KEY89_F1 268 #define KEY89_F2 269 #define KEY89_F3 270 #define KEY89_F4 271 #define KEY89_F5 272 #define KEY89_F6 273 #define KEY89_F7 274 #define KEY89_F8 275 #define KEY89_CHS 276 #define KEY89_HOME 277 #define KEY89_CATLG 278 #define KEY89_LEFT 337 #define KEY89_UP 338 #define KEY89_RIGHT 340 #define KEY89_DOWN 344 // Key modifiers #define KEY89_2ND 4096 #define KEY89_CTRL 8192 #define KEY89_SHIFT 16384 #define KEY89_ALPHA 32768 #endif libticalcs-1.1.9+dfsg/src/keys92p.c000066400000000000000000000463321327711501700170270ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "ticalcs.h" /* Conversion of an PC scancode into an TI scancode. This array use UniCode character set on PC side (16 bits chars) as an index. The TI character set is the same as PC one from 0x00 to 0x7F and from 0xC0 to 0xFF. These codes can be found in the section B of the french manual From 0x00 to 0xff, Unicode codes. From 0x0100, I have put proprietary TI scancodes. The array can be used in reverse order too, at least for the first column... */ const OldCalcKeys_ TI92P_KEYS[] = { /* 0x00, 0-15 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"<-", "BS", 257, "BS", 257, "INS", 4353, "DEL", 8449, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"ENTER", "CR", 13, "CR", 13, "APPROX", 8205, "ENTRY", 4109, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x10, 16-31 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"ESC", "ESC", 264, "ESC", 264, "QUIT", 4360, "", 8456, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x20, 32-47 */ {"SPACE", "", 32, "", 32, "", 32, "", 8224, "", 0}, {"!", "!", 33, "", 0, "", 0, "", 0, "", 0}, {"\"", "\"", 34, "", 0, "", 0, "", 0, "", 0}, {"#", "#", 35, "", 0, "", 0, "", 0, "", 0}, {"$", "$", 36, "", 0, "", 0, "", 0, "", 0}, {"%", "%", 37, "", 0, "", 0, "", 0, "", 0}, {"&", "&", 38, "", 0, "", 0, "", 0, "", 0}, {"'", "'", 39, "", 0, "", 0, "", 0, "", 0}, {"(", "(", 40, "(", 40, "{", 123, "", 8232, "", 0}, {")", ")", 41, ")", 41, "}", 125, "", 8233, "", 0}, {"*", "*", 42, "*", 42, "\214", 4138, "", 8234, "", 0}, {"+", "+", 43, "+", 43, "CHAR", 4139, "Contrast+", 0, "", 0}, {",", ",", 44, ",", 44, "[", 91, "", 8236, "", 0}, {"-", "-", 45, "-", 45, "VAR-LINK", 4141, "Contrast-", 0, "", 0}, {".", ".", 46, ".", 46, ">", 62, "", 8238, "", 0}, {"/", "/", 47, "/", 47, "]", 93, "", 8239, "", 0}, /* 0x30, 48-63 */ {"0", "0", 48, "0", 48, "<", 60, "", 8240, "", 0}, {"1", "1", 49, "1", 49, "E", 149, "", 8241, "", 0}, {"2", "2", 50, "2", 50, "CATALOG", 4146, "", 8242, "", 0}, {"3", "3", 51, "3", 51, "CUSTOM", 4147, "", 8243, "", 0}, {"4", "4", 52, "4", 52, "\132", 4148, "", 8244, "", 0}, {"5", "5", 53, "5", 53, "MATH", 4149, "", 8245, "", 0}, {"6", "6", 54, "6", 54, "MEM", 4150, "", 8246, "", 0}, {"7", "7", 55, "7", 55, "VAR-LINK", 4151, "", 8247, "", 0}, {"8", "8", 56, "8", 56, "\189", 4152, "", 8248, "", 0}, {"9", "9", 57, "9", 57, "\133", 4153, "", 8249, "", 0}, {":", ":", 58, "", 0, "", 0, "", 0, "", 0}, {";", ";", 59, "", 0, "", 0, "", 0, "", 0}, {"<", "<", 60, "", 0, "", 0, "", 0, "", 0}, {"=", "=", 61, "=", 61, "\\", 92, "", 8253, "", 0}, {">", ">", 62, "", 0, "", 0, "", 0, "", 0}, {"?", "?", 63, "", 0, "", 0, "", 0, "", 0}, /* 0x40, 64-79 */ {"@", "@", 64, "", 0, "", 0, "", 0, "", 0}, {"A", "A", 65, "A", 65, "Table3", 0, "", 8257, "", 0}, {"B", "B", 66, "B", 66, "'", 39, "", 8258, "", 0}, {"C", "C", 67, "C", 67, "Table4", 0, "COPY", 8259, "", 0}, {"D", "D", 68, "D", 68, "\176", 176, "", 8260, "", 0}, {"E", "E", 69, "E", 69, "Table5", 0, "WINDOW", 8261, "", 0}, {"F", "F", 70, "F", 70, "\208", 159, "FORMAT", 8262, "", 0}, {"G", "G", 71, "G", 71, "Table6", 0, "", 8263, "", 0}, {"H", "H", 72, "H", 72, "&", 38, "", 8264, "", 0}, {"I", "I", 73, "I", 73, "\151", 151, "", 8265, "", 0}, {"J", "J", 74, "J", 74, "\165", 190, "", 8266, "", 0}, {"K", "K", 75, "K", 75, "|", 124, "", 8267, "", 0}, {"L", "L", 76, "L", 76, "\"", 34, "", 8268, "", 0}, {"M", "M", 77, "M", 77, ";", 59, "", 8269, "", 0}, {"N", "N", 78, "N", 78, "Table7", 0, "NEW", 8270, "", 0}, {"O", "O", 79, "O", 79, "Table8", 0, "OPEN", 8271, "", 0}, /* 0x50, 80-95 */ {"P", "P", 80, "P", 80, "_", 95, "", 8272, "", 0}, {"Q", "Q", 81, "Q", 81, "?", 63, "HOME", 8273, "", 0}, {"R", "R", 82, "R", 82, "@", 64, "GRAPH", 8274, "", 0}, {"S", "S", 83, "S", 83, "\223", 223, "SAVE", 8275, "", 0}, {"T", "T", 84, "T", 84, "#", 35, "TblSet", 8276, "", 0}, {"U", "U", 85, "U", 85, "Table9", 0, "", 8277, "", 0}, {"V", "V", 86, "V", 86, "\157", 157, "PASTE", 8278, "", 0}, {"W", "W", 87, "W", 87, "!", 33, "Y=", 8279, "", 0}, {"X", "X", 88, "X", 88, "\169", 169, "CUT", 8280, "", 0}, {"Y", "Y", 89, "Y", 89, "\18", 18, "TABLE", 8281, "", 0}, {"Z", "Z", 90, "Z", 90, "CapsLock", 0, "", 8282, "", 0}, {"[", "[", 91, "", 0, "", 0, "", 0, "", 0}, {"\\", "\\", 92, "", 0, "", 0, "", 0, "", 0}, {"]", "]", 93, "", 0, "", 0, "", 0, "", 0}, {"^", "^", 94, "^", 94, "\140", 140, "", 8286, "", 0}, {"_", "_", 95, "", 0, "", 0, "", 0, "", 0}, /* 0x60, 96-111 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"a", "a", 97, "A", 65, "Table3", 0, "", 8257, "", 0}, {"b", "b", 98, "B", 66, "'", 39, "", 8258, "", 0}, {"c", "c", 99, "C", 67, "Table4", 0, "COPY", 8259, "", 0}, {"d", "d", 100, "D", 68, "\176", 176, "", 8260, "", 0}, {"e", "e", 101, "E", 69, "Table5", 0, "WINDOW", 8261, "", 0}, {"f", "f", 102, "F", 70, "\208", 159, "FORMAT", 8262, "", 0}, {"g", "g", 103, "G", 71, "Table6", 0, "", 8263, "", 0}, {"h", "h", 104, "H", 72, "&", 38, "", 8264, "", 0}, {"i", "i", 105, "I", 73, "\151", 151, "", 8265, "", 0}, {"j", "j", 106, "J", 74, "\165", 190, "", 8266, "", 0}, {"k", "k", 107, "K", 75, "|", 124, "", 8267, "", 0}, {"l", "l", 108, "L", 76, "\"", 34, "", 8268, "", 0}, {"m", "m", 109, "M", 77, ";", 59, "", 8269, "", 0}, {"n", "n", 110, "N", 78, "Table7", 0, "NEW", 8270, "", 0}, {"o", "o", 111, "O", 79, "Table8", 0, "OPEN", 8271, "", 0}, /* 0x70, 112 */ {"p", "p", 112, "P", 80, "_", 95, "", 8272, "", 0}, {"q", "q", 113, "Q", 81, "?", 63, "HOME", 8273, "", 0}, {"r", "r", 114, "R", 82, "@", 64, "GRAPH", 8274, "", 0}, {"s", "s", 115, "S", 83, "\223", 223, "SAVE", 8275, "", 0}, {"t", "t", 116, "T", 84, "#", 35, "TblSet", 8276, "", 0}, {"u", "u", 117, "U", 85, "Table9", 0, "", 8277, "", 0}, {"v", "v", 118, "V", 86, "\157", 157, "PASTE", 8278, "", 0}, {"w", "w", 119, "W", 87, "!", 33, "Y=", 8279, "", 0}, {"x", "x", 120, "X", 88, "\169", 169, "CUT", 8280, "", 0}, {"y", "y", 121, "Y", 89, "\18", 18, "TABLE", 8281, "", 0}, {"z", "z", 122, "Z", 90, "CapsLock", 0, "", 8282, "", 0}, {"{", "{", 0, "", 0, "", 0, "", 0, "", 0}, {"|", "|", 0, "", 0, "", 0, "", 0, "", 0}, {"}", "}", 0, "", 0, "", 0, "", 0, "", 0}, {"~", "~", 126, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x80, 128 */ {"\128", "\128", 128, "", 0, "", 0, "", 0, "", 0}, {"\129", "\129", 129, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\131", "\131", 131, "\130", 130, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\133", "\133", 133, "\132", 132, "", 0, "", 0, "", 0}, {"\134", "\134", 134, "", 0, "", 0, "", 0, "", 0}, {"\135", "\135", 135, "", 0, "", 0, "", 0, "", 0}, {"\136", "\136", 136, "\136", 136, ":", 58, "", 8328, "", 0}, {"\137", "\137", 137, "", 0, "", 0, "", 0, "", 0}, {"\138", "\138", 138, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\140", "\140", 140, "\139", 139, "", 0, "", 0, "", 0}, {"\141", "\141", 141, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\143", "\143", 143, "\142", 142, "", 0, "", 0, "", 0}, /* 0x90, 144 */ {"\144", "\144", 144, "", 0, "", 0, "", 0, "", 0}, {"\145", "\145", 145, "", 0, "", 0, "", 0, "", 0}, {"\146", "\146", 146, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0xA0, 160 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\173", "\173", 173, "\173", 173, "ANS", 4372, "", 8365, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0xB0, 176 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0xC0, 192 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0xD0, 208 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0xE0, 224 */ {"\xe0", "\xe0", 224, "\192", 192, "", 0, "", 0, "", 0}, /* agrave */ {"\225", "\225", 225, "\193", 193, "", 0, "", 0, "", 0}, {"\xe2", "\xe2", 226, "\194", 194, "", 0, "", 0, "", 0}, /* acirc */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\xe4", "\xe4", 228, "\196", 196, "", 0, "", 0, "", 0}, /* auml */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\xe7", "\xe7", 231, "\199", 199, "", 0, "", 0, "", 0}, /* ccedil */ {"\xe8", "\xe8", 232, "\200", 200, "", 0, "", 0, "", 0}, /* egrave */ {"\xe9", "\xe9", 233, "\201", 201, "", 0, "", 0, "", 0}, /* eacute */ {"\xea", "\xea", 234, "\202", 202, "", 0, "", 0, "", 0}, /* ecirc */ {"\xeb", "\xeb", 235, "\203", 203, "", 0, "", 0, "", 0}, /* euml */ {"\236", "\236", 236, "\204", 204, "", 0, "", 0, "", 0}, {"\237", "\237", 237, "\205", 205, "", 0, "", 0, "", 0}, {"\xee", "\xee", 238, "\206", 206, "", 0, "", 0, "", 0}, /* icirc */ {"\xef", "\xef", 239, "\207", 207, "", 0, "", 0, "", 0}, /* iuml */ /* 0xF0, 240-255 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\xf1", "\xf1", 241, "\209", 209, "", 0, "", 0, "", 0}, /* ntilde */ {"\242", "\242", 242, "\210", 210, "", 0, "", 0, "", 0}, {"\243", "\243", 243, "\211", 211, "", 0, "", 0, "", 0}, {"\xf4", "\xf4", 244, "\212", 212, "", 0, "", 0, "", 0}, /* ocirc */ {"\xf5", "\xf5", 245, "", 0, "", 0, "", 0, "", 0}, /* otilde */ {"\xf6", "\xf6", 246, "\214", 214, "", 0, "", 0, "", 0}, /* ouml */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\xf9", "\xf9", 249, "\217", 217, "", 0, "", 0, "", 0}, /* ugrave */ {"\250", "\250", 250, "\221", 221, "", 0, "", 0, "", 0}, {"\xfb", "\xfb", 251, "\219", 219, "", 0, "", 0, "", 0}, /* ucirc */ {"\xfc", "\xfc", 252, "\220", 220, "", 0, "", 0, "", 0}, /* uuml */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"\xff", "\xff", 255, "", 0, "", 0, "", 0, "", 0}, /* yuml */ /* 0x100, 256 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"<-", "BS", 257, "BS", 257, "INS", 4353, "DEL", 8449, "", 0}, {"STO->", "STO->", 258, "STO->", 258, "RCL", 4354, "", 8450, "", 0}, {"SIN", "SIN", 259, "SIN", 259, "SIN\200", 4355, "", 8451, "", 0}, {"COS", "COS", 260, "COS", 260, "COS\200", 4356, "", 8452, "", 0}, {"TAN", "TAN", 261, "TAN", 261, "TAN\200", 4357, "", 8453, "", 0}, {"LN", "LN", 262, "LN", 262, "e^x", 4358, "", 8454, "", 0}, {"CLEAR", "CLEAR", 263, "CLEAR", 263, "CLEAR", 263, "", 8455, "", 0}, {"ESC", "ESC", 264, "ESC", 264, "QUIT", 4360, "", 8456, "", 0}, {"APPS", "APPS", 265, "APPS", 265, "SWITCH", 4361, "", 8457, "", 0}, {"MODE", "MODE", 266, "MODE", 266, "MODE", 266, "", 8458, "", 0}, {"ON", "ON", 267, "OFF", 267, "OFF", 267, "", 0, "", 0}, {"F1", "F1", 268, "F1", 268, "F1", 8460, "", 0, "", 0}, {"F2", "F2", 269, "F2", 269, "F2", 8461, "", 0, "", 0}, {"F3", "F3", 270, "F3", 270, "F3", 8462, "", 0, "", 0}, {"F4", "F4", 271, "F4", 271, "F4", 8463, "", 0, "", 0}, /* 0x110,272 */ {"F5", "F5", 272, "F5", 272, "F5", 8464, "", 0, "", 0}, {"F6", "F6", 273, "F6", 273, "F6", 8465, "", 0, "", 0}, {"F7", "F7", 274, "F7", 274, "F7", 8466, "", 0, "", 0}, {"F8", "F8", 275, "F8", 275, "F8", 8467, "", 0, "", 0}, {"CHS?", "CHS?", 276, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x120, 288 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x130, 304 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x140, 320 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, /* 0x150, 336 */ {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"LEFT", "LEFT", 337, "LEFT", 16721, "LEFT", 4433, "LEFT", 8529, "", 0}, {"UP", "UP", 338, "UP", 16722, "UP", 4434, "UP", 8530, "", 0}, {"LEFT-UP", "LEFT-UP", 339, "LEFT-UP", 339, "LEFT-UP", 339, "LEFT-UP", 339, "", 0}, {"RIGHT", "RIGHT", 340, "RIGHT", 16724, "RIGHT", 4436, "RIGHT", 8532, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"RIGHT-UP", "RIGHT-UP", 342, "RIGHT-UP", 0, "RIGHT-UP", 0, "RIGHT-UP", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"DOWN", "DOWN", 344, "DOWN", 16728, "DOWN", 4440, "DOWN", 8536, "", 0}, {"LEFT-DOWN", "LEFT-DOWN", 345, "LEFT-DOWN", 345, "LEFT-DOWN", 345, "LEFT-DOWN", 345, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"RIGHT-DOWN", "RIGHT-DOWN", 348, "RIGHT-DOWN", 348, "RIGHT-DOWN", 348, "RIGHT-DOWN", 348, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0}, {"", "", 0, "", 0, "", 0, "", 0, "", 0} /* 0x160 */ }; libticalcs-1.1.9+dfsg/src/keys92p.h000066400000000000000000000061361327711501700170320ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TICALCS_KEYS92P__ #define __TICALCS_KEYS92P__ // Keys codes of the TI92/TI92+ #define KEY92P_CR 13 #define KEY92P_ENTER 13 #define KEY92P_SPACE 32 #define KEY92P_LP 40 // Left parenthesis #define KEY92P_RP 41 // Right parenthesis #define KEY92P_MULT 42 #define KEY92P_PLUS 43 #define KEY92P_COMMA 44 #define KEY92P_MINUS 45 #define KEY92P_DOT 46 #define KEY92P_DIVIDE 47 #define KEY92P_0 48 #define KEY92P_1 49 #define KEY92P_2 50 #define KEY92P_3 51 #define KEY92P_4 52 #define KEY92P_5 53 #define KEY92P_6 54 #define KEY92P_7 55 #define KEY92P_8 56 #define KEY92P_9 57 #define KEY92P_EQUALS 61 #define KEY92P_A 65 #define KEY92P_B 66 #define KEY92P_C 67 #define KEY92P_D 68 #define KEY92P_E 69 #define KEY92P_F 70 #define KEY92P_G 71 #define KEY92P_H 72 #define KEY92P_I 73 #define KEY92P_J 74 #define KEY92P_K 75 #define KEY92P_L 76 #define KEY92P_M 77 #define KEY92P_N 78 #define KEY92P_O 79 #define KEY92P_P 80 #define KEY92P_Q 81 #define KEY92P_R 82 #define KEY92P_S 83 #define KEY92P_T 84 #define KEY92P_U 85 #define KEY92P_V 86 #define KEY92P_W 87 #define KEY92P_X 88 #define KEY92P_Y 89 #define KEY92P_Z 90 #define KEY92P_POWER 94 #define KEY92P_THETA 136 #define KEY92P_NEG 173 #define KEY92P_DELETE 257 #define KEY92P_STO 258 #define KEY92P_SIN 259 #define KEY92P_COS 260 #define KEY92P_TAN 261 #define KEY92P_LN 262 #define KEY92P_CLEAR 263 #define KEY92P_ESC 264 #define KEY92P_MENU 265 #define KEY92P_MODE 266 #define KEY92P_ON 267 #define KEY92P_F1 268 #define KEY92P_F2 269 #define KEY92P_F3 270 #define KEY92P_F4 271 #define KEY92P_F5 272 #define KEY92P_F6 273 #define KEY92P_F7 274 #define KEY92P_F8 275 #define KEY92P_CHS 276 #define KEY92P_LEFT 337 #define KEY92P_UP 338 #define KEY92P_UP_LF 339 #define KEY92P_RIGHT 340 #define KEY92P_UP_RG 342 #define KEY92P_DOWN 344 #define KEY92P_DW_LF 345 #define KEY92P_DW_RG 348 // Key modifiers #define KEY92P_2ND 4096 #define KEY92P_CTRL 8192 #define KEY92P_SHIFT 16384 #define KEY92P_DRAG 32768 #endif libticalcs-1.1.9+dfsg/src/keysnsp.h000066400000000000000000000242241327711501700172160ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 2016 Lionel Debroux * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TICALCS_KEYSNSP__ #define __TICALCS_KEYSNSP__ // Keys codes of the Nspire #define KEYNSP_ESC 0x1B9600 #define KEYNSP_CTRL_ESC 0x00EF00 #define KEYNSP_TAB 0x099500 #define KEYNSP_SHIFT_TAB 0x7C9500 #define KEYNSP_CTRL_TAB 0x00ED00 #define KEYNSP_HOME 0x00FD00 #define KEYNSP_CTRL_HOME 0x00FE00 #define KEYNSP_MENU 0x003600 #define KEYNSP_CTRL_MENU 0x00CE00 #define KEYNSP_MOUSE_CONTEXT_MENU 0x00A000 #define KEYNSP_CLICK 0x00AD00 #define KEYNSP_CTRL_CLICK 0x00AC00 #define KEYNSP_SHIFT_GRAB 0x00F900 #define KEYNSP_LEFT 0x000700 #define KEYNSP_SHIFT_LEFT 0x00F100 #define KEYNSP_SHIFT_HOLD_LEFT 0x000703 #define KEYNSP_CTRL_LEFT 0x00DA00 #define KEYNSP_RIGHT 0x002700 #define KEYNSP_SHIFT_RIGHT 0x00F200 #define KEYNSP_SHIFT_HOLD_RIGHT 0x002703 #define KEYNSP_CTRL_RIGHT 0x00DB00 #define KEYNSP_UP 0x001700 #define KEYNSP_SHIFT_UP 0x00F300 #define KEYNSP_SHIFT_HOLD_UP 0x001703 #define KEYNSP_CTRL_UP 0x00DC00 #define KEYNSP_DOWN 0x003700 #define KEYNSP_SHIFT_DOWN 0x00F400 #define KEYNSP_SHIFT_HOLD_DOWN 0x003703 #define KEYNSP_CTRL_DOWN 0x00DD00 #define KEYNSP_EQUAL 0x3D7500 #define KEYNSP_CTRL_EQUAL 0x00E900 #define KEYNSP_SUCH_THAT 0x7CED00 #define KEYNSP_A 0x616600 #define KEYNSP_SHIFT_A 0x416600 #define KEYNSP_CTRL_A 0x616600 #define KEYNSP_B 0x624600 #define KEYNSP_SHIFT_B 0x424600 #define KEYNSP_CTRL_B 0x02B100 #define KEYNSP_C 0x632600 #define KEYNSP_SHIFT_C 0x432600 #define KEYNSP_CTRL_C 0x03B200 #define KEYNSP_FLAG 0x00A700 #define KEYNSP_CTRL_FLAG 0x00F800 #define KEYNSP_LESS_THAN 0x3CA600 #define KEYNSP_CTRL_LESS_THAN 0x00CF00 #define KEYNSP_D 0x648500 #define KEYNSP_SHIFT_D 0x448500 #define KEYNSP_CTRL_D 0x04B300 #define KEYNSP_E 0x656500 #define KEYNSP_SHIFT_E 0x456500 #define KEYNSP_CTRL_E 0x05B400 #define KEYNSP_F 0x664500 #define KEYNSP_SHIFT_F 0x464500 #define KEYNSP_CTRL_F 0x06B500 #define KEYNSP_G 0x672500 #define KEYNSP_SHIFT_G 0x472500 #define KEYNSP_CTRL_G 0x07B600 #define KEYNSP_TILDE 0x27F500 #define KEYNSP_CTRL_TILDE 0x240500 #define KEYNSP_GREATER_THAN 0x3E8600 #define KEYNSP_CTRL_GREATER_THAN 0x00DE00 #define KEYNSP_H 0x688400 #define KEYNSP_SHIFT_H 0x488400 #define KEYNSP_CTRL_H 0x08B700 #define KEYNSP_I 0x696400 #define KEYNSP_SHIFT_I 0x496400 #define KEYNSP_CTRL_I 0x09B800 #define KEYNSP_J 0x6A4400 #define KEYNSP_SHIFT_J 0x4A4400 #define KEYNSP_CTRL_J 0x0AB900 #define KEYNSP_K 0x6B2400 #define KEYNSP_SHIFT_K 0x4B2400 #define KEYNSP_CTRL_K 0x0BBA00 #define KEYNSP_QUOTE 0x22A100 #define KEYNSP_IMAGINARY 0x00A200 #define KEYNSP_CTRL_IMAGINARY 0x00A100 #define KEYNSP_L 0x6C8300 #define KEYNSP_SHIFT_L 0x4C8300 #define KEYNSP_CTRL_L 0x0CBB00 #define KEYNSP_M 0x6D6300 #define KEYNSP_SHIFT_M 0x4D6300 #define KEYNSP_CTRL_M 0x0DBC00 #define KEYNSP_N 0x6E4300 #define KEYNSP_SHIFT_N 0x4E4300 #define KEYNSP_CTRL_N 0x0EBD00 #define KEYNSP_O 0x6F2300 #define KEYNSP_SHIFT_O 0x4F2300 #define KEYNSP_CTRL_O 0x0FBE00 #define KEYNSP_COLON 0x3A0100 #define KEYNSP_CTRL_COLON 0x3B0200 #define KEYNSP_EXP 0x00A400 #define KEYNSP_P 0x708200 #define KEYNSP_SHIFT_P 0x508200 #define KEYNSP_CTRL_P 0x10BF00 #define KEYNSP_Q 0x716200 #define KEYNSP_SHIFT_Q 0x516200 #define KEYNSP_CTRL_Q 0x11C000 #define KEYNSP_R 0x724200 #define KEYNSP_SHIFT_R 0x524200 #define KEYNSP_CTRL_R 0x12C100 #define KEYNSP_S 0x732200 #define KEYNSP_SHIFT_S 0x532200 #define KEYNSP_CTRL_S 0x13C200 #define KEYNSP_QUESTION_MARK 0x3F0300 #define KEYNSP_CTRL_QUESTION_MARK 0x00CB00 #define KEYNSP_PI 0x00A300 #define KEYNSP_CTRL_PI 0x00F400 #define KEYNSP_T 0x748100 #define KEYNSP_SHIFT_T 0x548100 #define KEYNSP_CTRL_T 0x14C300 #define KEYNSP_U 0x756100 #define KEYNSP_SHIFT_U 0x556100 #define KEYNSP_CTRL_U 0x15C400 #define KEYNSP_V 0x764100 #define KEYNSP_SHIFT_V 0x564100 #define KEYNSP_CTRL_V 0x16C500 #define KEYNSP_W 0x772100 #define KEYNSP_SHIFT_W 0x572100 #define KEYNSP_CTRL_W 0x17C600 #define KEYNSP_COMMA 0x2CA000 #define KEYNSP_THETA 0x880600 #define KEYNSP_X 0x788000 #define KEYNSP_SHIFT_X 0x588000 #define KEYNSP_CTRL_X 0x18C700 #define KEYNSP_Y 0x796000 #define KEYNSP_SHIFT_Y 0x596000 #define KEYNSP_CTRL_Y 0x19C800 #define KEYNSP_Z 0x7A4000 #define KEYNSP_SHIFT_Z 0x5A4000 #define KEYNSP_CTRL_Z 0x1AC900 #define KEYNSP_SPACE 0x202000 #define KEYNSP_CTRL_SPACE 0x00CD00 #define KEYNSP_NEW_LINE 0x000A00 #define KEYNSP_CTRL 0x00AA04 #define KEYNSP_SHIFT 0x00AB03 #define KEYNSP_CTRL_SHIFT 0x00AB07 #define KEYNSP_BACK_SPACE 0x081500 #define KEYNSP_SHIFT_BACK_SPACE 0x081500 #define KEYNSP_CTRL_BACK_SPACE 0x00E304 #define KEYNSP_VAR 0x00AF00 #define KEYNSP_CTRL_VAR 0x00A800 #define KEYNSP_LEFT_PARENTHESES 0x285500 #define KEYNSP_CTRL_LEFT_PARENTHESES 0x00E700 #define KEYNSP_RIGHT_PARENTHESES 0x293500 #define KEYNSP_CTRL_RIGHT_PARENTHESES 0x00E500 #define KEYNSP_CATALOG 0x009100 #define KEYNSP_CTRL_CATALOG 0x00EE00 #define KEYNSP_POWER 0x5E9300 #define KEYNSP_CTRL_POWER 0x00EB00 #define KEYNSP_SIN 0x007400 #define KEYNSP_CTRL_SIN 0x00E800 #define KEYNSP_COS 0x005400 #define KEYNSP_CTRL_COS 0x00E600 #define KEYNSP_TAN 0x003400 #define KEYNSP_CTRL_TAN 0x00E400 #define KEYNSP_SLASH 0x2F1400 #define KEYNSP_CTRL_SLASH 0x00E200 #define KEYNSP_SQUARE 0x009300 #define KEYNSP_CTRL_SQUARE 0x009200 #define KEYNSP_SEVEN 0x377100 #define KEYNSP_CTRL_SEVEN 0x00D700 #define KEYNSP_EIGHT 0x385100 #define KEYNSP_CTRL_EIGHT 0x00D800 #define KEYNSP_NINE 0x393100 #define KEYNSP_CTRL_NINE 0x00D900 #define KEYNSP_TIMES 0x2A1300 #define KEYNSP_CTRL_TIMES 0x00E100 #define KEYNSP_TEN_POWER 0x00EC00 #define KEYNSP_CTRL_TEN_POWER 0x009400 #define KEYNSP_FOUR 0x347200 #define KEYNSP_CTRL_FOUR 0x00D400 #define KEYNSP_FIVE 0x355200 #define KEYNSP_CTRL_FIVE 0x00D500 #define KEYNSP_SIX 0x363200 #define KEYNSP_CTRL_SIX 0x00D600 #define KEYNSP_MINUS 0x2D1200 #define KEYNSP_CTRL_MINUS 0x00E000 #define KEYNSP_E_POWER 0x00CA00 #define KEYNSP_CTRL_E_POWER 0x00A900 #define KEYNSP_ONE 0x317300 #define KEYNSP_CTRL_ONE 0x00D100 #define KEYNSP_TWO 0x325300 #define KEYNSP_CTRL_TWO 0x00D200 #define KEYNSP_THREE 0x333300 #define KEYNSP_CTRL_THREE 0x00D300 #define KEYNSP_PLUS 0x2B1100 #define KEYNSP_CTRL_PLUS 0x00DF00 #define KEYNSP_ON 0x000B00 #define KEYNSP_CTRL_ON 0x00F000 #define KEYNSP_ZERO 0x305000 #define KEYNSP_CTRL_ZERO 0x00D000 #define KEYNSP_POINT 0x2E7000 #define KEYNSP_NEG 0xB13000 #define KEYNSP_CTRL_NEG 0x00AE00 #define KEYNSP_ENTER 0x0D1000 #define KEYNSP_CTRL_ENTER 0x00A600 #endif libticalcs-1.1.9+dfsg/src/logging.h000066400000000000000000000025241327711501700171470ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs2 - hand-helds support library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TICALCS_LOGGING__ #define __TICALCS_LOGGING__ #include #define ticalcs_debug(format, ...) g_log("ticalcs", G_LOG_LEVEL_DEBUG, format, ##__VA_ARGS__) #define ticalcs_info(format, ...) g_log("ticalcs", G_LOG_LEVEL_INFO, format, ##__VA_ARGS__) #define ticalcs_warning(format, ...) g_log("ticalcs", G_LOG_LEVEL_WARNING, format, ##__VA_ARGS__) #define ticalcs_critical(format, ...) g_log("ticalcs", G_LOG_LEVEL_CRITICAL, format, ##__VA_ARGS__) #endif libticalcs-1.1.9+dfsg/src/macros.h000066400000000000000000000025761327711501700170140ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs2 - hand-helds support library, a part of the TiLP project * Copyright (C) 1999-2006 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TICALCS_MACROS__ #define __TICALCS_MACROS__ #include "stdints3.h" // extract a word from a longword # define LSW(l) (uint16_t) ((l) & 0x0000FFFF) # define MSW(l) (uint16_t)(((l) & 0xFFFF0000) >> 16) // extract a byte from a word # define LSB(w) (uint8_t) ((w) & 0x00FF) # define MSB(w) (uint8_t)(((w) & 0xFF00) >> 8) // extract a nibble from a byte # define LSN(b) ((b) & 0x0F) # define MSN(b) (((b) & 0xF0) >> 4) // convert 2 nibbles into a BCD byte # define BCD(b) (10*MSN(b)+LSN(b)) #endif libticalcs-1.1.9+dfsg/src/nsp_cmd.c000066400000000000000000000560401327711501700171410ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: nsp_cmd.c 2077 2006-03-31 21:16:19Z roms $ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This unit handles commands and session management thru DirectLink. */ #include #include #include #include "ticalcs.h" #include "internal.h" #include "logging.h" #include "error.h" #include "nsp_vpkt.h" #include "nsp_cmd.h" /////////////---------------- static const uint8_t usb_errors[] = { 0x02, 0x04, 0x07, 0x0a, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x20, 0x80 }; static int err_code(uint8_t code) { int i; for (i = 0; i < (int)(sizeof(usb_errors) / sizeof(usb_errors[0])); i++) { if (usb_errors[i] == code) { return i+1; } } ticalcs_warning("Nspire error code 0x%02x not found in list. Please report it at .", (int)code); return 0; } /////////////---------------- static int put_str(uint8_t *dst, const char *src) { size_t i, j; size_t len = strlen(src); for (i = 0; i < len; i++) { dst[i] = src[i]; } dst[i++] = '\0'; if (i < 9) { for (j = i; j < 9; j++) { dst[j] = '\0'; } } else { j = i; } return j; } /////////////---------------- TIEXPORT3 int TICALL nsp_cmd_r_login(CalcHandle *handle) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = nsp_vtl_pkt_new(handle); ticalcs_info(" receiving login:"); retval = nsp_recv_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } /////////////---------------- TIEXPORT3 int TICALL nsp_cmd_s_status(CalcHandle *handle, uint8_t status) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = nsp_vtl_pkt_new_ex(handle, 1, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, handle->priv.nsp_dst_port, NSP_CMD_STATUS, nsp_vtl_pkt_alloc_data(1)); ticalcs_info(" sending status (%04x):", status); pkt->data[0] = status; retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_status(CalcHandle *handle, uint8_t *status) { NSPVirtualPacket* pkt; uint8_t value; int retval = 0; VALIDATE_HANDLE(handle); pkt = nsp_vtl_pkt_new(handle); ticalcs_info(" receiving status:"); retval = nsp_recv_data(handle, pkt); if (!retval) { value = pkt->data[0]; if (pkt->cmd != NSP_CMD_STATUS) { retval = ERR_INVALID_PACKET; goto end; } if (status) { *status = value; } if (value != 0x00) { retval = ERR_CALC_ERROR3 + err_code(value); } } end: nsp_vtl_pkt_del(handle, pkt); return retval; } /////////////---------------- TIEXPORT3 int TICALL nsp_cmd_s_dev_infos(CalcHandle *handle, uint8_t cmd) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); ticalcs_info(" requesting device information (cmd = %02x):", cmd); pkt = nsp_vtl_pkt_new_ex(handle, 0, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_DEV_INFOS, cmd, nsp_vtl_pkt_alloc_data(0)); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_dev_infos(CalcHandle *handle, uint8_t *cmd, uint32_t *size, uint8_t **data) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(cmd); VALIDATE_NONNULL(size); VALIDATE_NONNULL(data); pkt = nsp_vtl_pkt_new(handle); ticalcs_info(" receiving device information:"); retval = nsp_recv_data(handle, pkt); if (!retval) { *cmd = pkt->cmd; *data = g_malloc0(pkt->size); // aborts the program if it fails. memcpy(*data, pkt->data, pkt->size); } nsp_vtl_pkt_del(handle, pkt); return retval; } /////////////---------------- TIEXPORT3 int TICALL nsp_cmd_s_screen_rle(CalcHandle *handle, uint8_t cmd) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = nsp_vtl_pkt_new_ex(handle, 0, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_SCREEN_RLE, cmd, nsp_vtl_pkt_alloc_data(0)); ticalcs_info(" requesting RLE screenshot (cmd = %02x):", cmd); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_screen_rle(CalcHandle *handle, uint8_t *cmd, uint32_t *size, uint8_t **data) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(cmd); VALIDATE_NONNULL(size); VALIDATE_NONNULL(data); pkt = nsp_vtl_pkt_new(handle); ticalcs_info(" receiving RLE screenshot:"); pkt->size = *size; retval = nsp_recv_data(handle, pkt); if (!retval) { *cmd = pkt->cmd; *size = pkt->size; *data = g_malloc0(pkt->size); // aborts the program if it fails. memcpy(*data, pkt->data, pkt->size); } nsp_vtl_pkt_del(handle, pkt); return retval; } /////////////---------------- TIEXPORT3 int TICALL nsp_cmd_s_dir_attributes(CalcHandle *handle, const char *name) { NSPVirtualPacket* pkt; size_t len; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(name); len = strlen(name) < 8 ? 8 : strlen(name); pkt = nsp_vtl_pkt_new_ex(handle, 1 + len + 1, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_FILE_MGMT, NSP_CMD_FM_ATTRIBUTES, nsp_vtl_pkt_alloc_data(1 + len + 1)); ticalcs_info(" unknown directory list command in <%s>:", name); pkt->data[0] = 0x01; put_str(pkt->data + 1, name); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_dir_attributes(CalcHandle *handle, uint32_t *size, uint8_t *type, uint32_t *date) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = nsp_vtl_pkt_new(handle); ticalcs_info(" unknown directory list command reply received:"); retval = nsp_recv_data(handle, pkt); if (!retval) { if (pkt->cmd != NSP_CMD_FM_ATTRIBUTES) { retval = ERR_CALC_ERROR3 + err_code(pkt->data[0]); goto end; } if (size) { *size = ( (((uint32_t)pkt->data[0]) << 24) | (((uint32_t)pkt->data[1]) << 16) | (((uint32_t)pkt->data[2]) << 8) | (((uint32_t)pkt->data[3]) )); } if (date) { *date = ( (((uint32_t)pkt->data[4]) << 24) | (((uint32_t)pkt->data[5]) << 16) | (((uint32_t)pkt->data[6]) << 8) | (((uint32_t)pkt->data[7]) )); } if (type) { *type = *(pkt->data + 8); } } end: nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_s_dir_enum_init(CalcHandle *handle, const char *name) { NSPVirtualPacket* pkt; size_t len; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(name); len = strlen(name) < 8 ? 8 : strlen(name); pkt = nsp_vtl_pkt_new_ex(handle, len + 1, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_FILE_MGMT, NSP_CMD_FM_DIRLIST_INIT, nsp_vtl_pkt_alloc_data(len + 1)); ticalcs_info(" initiating directory listing in <%s>:", name); put_str(pkt->data, name); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_dir_enum_init(CalcHandle *handle) { return nsp_cmd_r_status(handle, NULL); } TIEXPORT3 int TICALL nsp_cmd_s_dir_enum_next(CalcHandle *handle) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = nsp_vtl_pkt_new_ex(handle, 0, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_FILE_MGMT, NSP_CMD_FM_DIRLIST_NEXT, nsp_vtl_pkt_alloc_data(0)); if (pkt != NULL) { ticalcs_info(" requesting next directory entry:"); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); } else { retval = ERR_MALLOC; } return retval; } TIEXPORT3 int TICALL nsp_cmd_r_dir_enum_next(CalcHandle *handle, char* name, uint32_t *size, uint8_t *type) { NSPVirtualPacket* pkt; uint8_t data_size; //uint32_t date; int o; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(name); pkt = nsp_vtl_pkt_new(handle); ticalcs_info(" next directory entry:"); retval = nsp_recv_data(handle, pkt); if (!retval) { if (pkt->cmd != NSP_CMD_FM_DIRLIST_ENT) { if (pkt->data[0] == NSP_ERR_NO_MORE_TO_LIST) { retval = ERR_EOT; goto end; } else { retval = ERR_CALC_ERROR3 + err_code(pkt->data[0]); goto end; } } data_size = pkt->data[1] + 2; ticalcs_strlcpy(name, (char *)pkt->data + 2, data_size + 1); o = data_size - 10; if (size) { *size = ( (((uint32_t)pkt->data[o ]) << 24) | (((uint32_t)pkt->data[o + 1]) << 16) | (((uint32_t)pkt->data[o + 2]) << 8) | (((uint32_t)pkt->data[o + 3]) )); } if (type) { *type = pkt->data[o + 8]; } } end: nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_s_dir_enum_done(CalcHandle *handle) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = nsp_vtl_pkt_new_ex(handle, 0, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_FILE_MGMT, NSP_CMD_FM_DIRLIST_DONE, nsp_vtl_pkt_alloc_data(0)); ticalcs_info(" closing directory listing:"); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_dir_enum_done(CalcHandle *handle) { return nsp_cmd_r_status(handle, NULL); } /////////////---------------- TIEXPORT3 int TICALL nsp_cmd_s_put_file(CalcHandle *handle, const char *name, uint32_t size) { NSPVirtualPacket* pkt; int o; size_t len; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(name); len = strlen(name) < 8 ? 8 : strlen(name); pkt = nsp_vtl_pkt_new_ex(handle, 6 + len, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_FILE_MGMT, NSP_CMD_FM_PUT_FILE, nsp_vtl_pkt_alloc_data(6 + len)); ticalcs_info(" sending variable:"); pkt->data[0] = 0x01; o = put_str(pkt->data + 1, name); o++; pkt->data[o+0] = MSB(MSW(size)); pkt->data[o+1] = LSB(MSW(size)); pkt->data[o+2] = MSB(LSW(size)); pkt->data[o+3] = LSB(LSW(size)); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_put_file(CalcHandle *handle) { return nsp_cmd_r_file_ok(handle); } TIEXPORT3 int TICALL nsp_cmd_s_put_file_eot(CalcHandle *handle) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = nsp_vtl_pkt_new_ex(handle, 2, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_FILE_MGMT, NSP_CMD_FM_PUT_FILE_EOT, nsp_vtl_pkt_alloc_data(2)); ticalcs_info(" sending EOT:"); pkt->data[0] = 0x01; retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } // No nsp_cmd_r_put_file_eot because the calculator doesn't seem to reply to CMD_FM_PUT_FILE_EOT. TIEXPORT3 int TICALL nsp_cmd_s_get_file(CalcHandle *handle, const char *name) { NSPVirtualPacket* pkt; size_t len; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(name); len = strlen(name) < 8 ? 8 : strlen(name); ticalcs_info(" requesting variable:"); pkt = nsp_vtl_pkt_new_ex(handle, 2 + len, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_FILE_MGMT, NSP_CMD_FM_GET_FILE, nsp_vtl_pkt_alloc_data(2 + len)); pkt->data[0] = 0x01; put_str(pkt->data + 1, name); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_get_file(CalcHandle *handle, uint32_t *size) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = nsp_vtl_pkt_new(handle); ticalcs_info(" file size:"); retval = nsp_recv_data(handle, pkt); if (!retval) { if (pkt->cmd != NSP_CMD_FM_PUT_FILE) { retval = ERR_INVALID_PACKET; goto end; } if (size) { *size = ( (((uint32_t)pkt->data[10]) << 24) | (((uint32_t)pkt->data[11]) << 16) | (((uint32_t)pkt->data[12]) << 8) | (((uint32_t)pkt->data[13]) )); } } end: nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_s_del_file(CalcHandle *handle, const char *name) { NSPVirtualPacket* pkt; size_t len; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(name); len = strlen(name) < 8 ? 8 : strlen(name); pkt = nsp_vtl_pkt_new_ex(handle, 2 + len, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_FILE_MGMT, NSP_CMD_FM_DEL_FILE, nsp_vtl_pkt_alloc_data(2 + len)); ticalcs_info(" deleting variable:"); pkt->data[0] = 0x01; put_str(pkt->data + 1, name); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_del_file(CalcHandle *handle) { return nsp_cmd_r_status(handle, NULL); } TIEXPORT3 int TICALL nsp_cmd_s_new_folder(CalcHandle *handle, const char *name) { NSPVirtualPacket* pkt; size_t len; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(name); len = strlen(name) < 8 ? 8 : strlen(name); pkt = nsp_vtl_pkt_new_ex(handle, 2 + len, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_FILE_MGMT, NSP_CMD_FM_NEW_FOLDER, nsp_vtl_pkt_alloc_data(2 + len)); ticalcs_info(" creating folder:"); pkt->data[0] = 0x03; put_str(pkt->data + 1, name); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_new_folder(CalcHandle *handle) { return nsp_cmd_r_status(handle, NULL); } TIEXPORT3 int TICALL nsp_cmd_s_del_folder(CalcHandle *handle, const char *name) { NSPVirtualPacket* pkt; size_t len; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(name); len = strlen(name) < 8 ? 8 : strlen(name); pkt = nsp_vtl_pkt_new_ex(handle, 2 + len, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_FILE_MGMT, NSP_CMD_FM_DEL_FOLDER, nsp_vtl_pkt_alloc_data(2 + len)); ticalcs_info(" deleting folder:"); pkt->data[0] = 0x03; put_str(pkt->data + 1, name); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_del_folder(CalcHandle *handle) { return nsp_cmd_r_status(handle, NULL); } TIEXPORT3 int TICALL nsp_cmd_s_copy_file(CalcHandle *handle, const char *name, const char *name2) { NSPVirtualPacket* pkt; size_t len; size_t len2; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(name); VALIDATE_NONNULL(name2); len = strlen(name) < 8 ? 8 : strlen(name); len2 = strlen(name2) < 8 ? 8 : strlen(name2); pkt = nsp_vtl_pkt_new_ex(handle, 3 + len + len2, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_FILE_MGMT, NSP_CMD_FM_COPY_FILE, nsp_vtl_pkt_alloc_data(3 + len + len2)); ticalcs_info(" copying file:"); pkt->data[0] = 0x01; put_str(pkt->data + 1, name); put_str(pkt->data + 2 + len, name2); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_copy_file(CalcHandle *handle) { return nsp_cmd_r_status(handle, NULL); } TIEXPORT3 int TICALL nsp_cmd_s_rename_file(CalcHandle *handle, const char *name, const char *name2) { NSPVirtualPacket* pkt; size_t len; size_t len2; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(name); VALIDATE_NONNULL(name2); len = strlen(name) < 8 ? 8 : strlen(name); len2 = strlen(name2) < 8 ? 8 : strlen(name2); ticalcs_info(" renaming file:"); pkt = nsp_vtl_pkt_new_ex(handle, 3 + len + len2, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_FILE_MGMT, NSP_CMD_FM_RENAME_FILE, nsp_vtl_pkt_alloc_data(3 + len + len2)); pkt->data[0] = 0x01; put_str(pkt->data + 1, name); put_str(pkt->data + 2 + len, name2); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_rename_file(CalcHandle *handle) { return nsp_cmd_r_status(handle, NULL); } TIEXPORT3 int TICALL nsp_cmd_s_file_ok(CalcHandle *handle) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = nsp_vtl_pkt_new_ex(handle, 0, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_FILE_MGMT, NSP_CMD_FM_OK, nsp_vtl_pkt_alloc_data(0)); ticalcs_info(" sending file contents:"); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_file_ok(CalcHandle *handle) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = nsp_vtl_pkt_new(handle); ticalcs_info(" file status:"); retval = nsp_recv_data(handle, pkt); if (!retval) { if (pkt->cmd != NSP_CMD_FM_OK) { if (pkt->cmd == NSP_CMD_STATUS) { retval = ERR_CALC_ERROR3 + err_code(pkt->data[0]); } else { retval = ERR_INVALID_PACKET; } } else { ticalcs_info(" ok"); } } nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_s_file_contents(CalcHandle *handle, uint32_t size, uint8_t *data) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(data); pkt = nsp_vtl_pkt_new_ex(handle, size, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_FILE_MGMT, NSP_CMD_FM_CONTENTS, nsp_vtl_pkt_alloc_data(size)); ticalcs_info(" sending file contents:"); memcpy(pkt->data, data, size); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_file_contents(CalcHandle *handle, uint32_t *size, uint8_t **data) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(size); VALIDATE_NONNULL(data); pkt = nsp_vtl_pkt_new(handle); ticalcs_info(" receiving file contents:"); pkt->size = *size; retval = nsp_recv_data(handle, pkt); if (!retval) { *size = pkt->size; *data = g_malloc0(pkt->size); memcpy(*data, pkt->data, pkt->size); } nsp_vtl_pkt_del(handle, pkt); return retval; } /////////////---------------- TIEXPORT3 int TICALL nsp_cmd_s_os_install(CalcHandle *handle, uint32_t size) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = nsp_vtl_pkt_new_ex(handle, 4, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_OS_INSTALL, NSP_CMD_OS_INSTALL, nsp_vtl_pkt_alloc_data(4)); ticalcs_info(" installing OS:"); pkt->data[0] = MSB(MSW(size)); pkt->data[1] = LSB(MSW(size)); pkt->data[2] = MSB(LSW(size)); pkt->data[3] = LSB(LSW(size)); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_os_install(CalcHandle *handle) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = nsp_vtl_pkt_new(handle); ticalcs_info(" receiving OS installation:"); retval = nsp_recv_data(handle, pkt); if (!retval) { if (pkt->cmd != NSP_CMD_OS_OK) { retval = ERR_INVALID_PACKET; } } nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_s_os_contents(CalcHandle *handle, uint32_t size, uint8_t *data) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(data); pkt = nsp_vtl_pkt_new_ex(handle, size, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_OS_INSTALL, NSP_CMD_OS_CONTENTS, nsp_vtl_pkt_alloc_data(size)); ticalcs_info(" sending OS contents:"); memcpy(pkt->data, data, size); retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_progress(CalcHandle *handle, uint8_t *value) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(value); pkt = nsp_vtl_pkt_new(handle); ticalcs_info(" OS installation status:"); retval = nsp_recv_data(handle, pkt); if (!retval) { *value = pkt->data[0]; switch(pkt->cmd) { case NSP_CMD_OS_PROGRESS: ticalcs_info(" %i/100", *value); break; case NSP_CMD_STATUS: retval = ERR_CALC_ERROR3 + err_code(*value); break; default: retval = ERR_INVALID_PACKET; break; } nsp_vtl_pkt_del(handle, pkt); } return retval; } /////////////---------------- TIEXPORT3 int TICALL nsp_cmd_s_generic_data(CalcHandle *handle, uint32_t size, uint8_t *data, uint16_t sid, uint8_t cmd) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); ticalcs_info(" sending generic data of size %lu (%lX) with command %02X:", (unsigned long)size, (unsigned long)size, cmd); pkt = nsp_vtl_pkt_new_ex(handle, size, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, sid, cmd, nsp_vtl_pkt_alloc_data(size)); if (data) { memcpy(pkt->data, data, size); } retval = nsp_send_data(handle, pkt); nsp_vtl_pkt_del(handle, pkt); return retval; } TIEXPORT3 int TICALL nsp_cmd_r_generic_data(CalcHandle *handle, uint32_t *size, uint8_t **data) { NSPVirtualPacket* pkt; int retval = 0; VALIDATE_HANDLE(handle); pkt = nsp_vtl_pkt_new(handle); ticalcs_info(" receiving generic data:"); retval = nsp_recv_data(handle, pkt); if (size) { *size = pkt->size; } if (data) { *data = g_malloc0(pkt->size); if (*data) { memcpy(*data, pkt->data, pkt->size); } else { retval = ERR_MALLOC; } } nsp_vtl_pkt_del(handle, pkt); return retval; } /////////////---------------- TIEXPORT3 int TICALL nsp_cmd_s_echo(CalcHandle *handle, uint32_t size, uint8_t *data) { ticalcs_info(" sending echo:"); return nsp_cmd_s_generic_data(handle, size, data, NSP_PORT_ECHO, 0); } TIEXPORT3 int TICALL nsp_cmd_r_echo(CalcHandle *handle, uint32_t *size, uint8_t **data) { ticalcs_info(" receiving echo:"); return nsp_cmd_r_generic_data(handle, size, data); } /////////////---------------- TIEXPORT3 int TICALL nsp_cmd_s_key(CalcHandle *handle, uint32_t code) { NSPVirtualPacket * pkt1, * pkt2; int retval = 0; VALIDATE_HANDLE(handle); ticalcs_info(" sending key:"); retval = nsp_session_open(handle, NSP_SID_KEYPRESSES); if (!retval) { pkt1 = nsp_vtl_pkt_new_ex(handle, 3, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_KEYPRESSES, 0x01, nsp_vtl_pkt_alloc_data(3)); pkt1->data[2] = 0x80; retval = nsp_send_data(handle, pkt1); if (!retval) { pkt2 = nsp_vtl_pkt_new_ex(handle, 25, NSP_SRC_ADDR, handle->priv.nsp_src_port, NSP_DEV_ADDR, NSP_PORT_KEYPRESSES, 0, nsp_vtl_pkt_alloc_data(25)); pkt2->data[3] = 0x08; pkt2->data[4] = 0x02; pkt2->data[5] = (uint8_t)(code >> 16); pkt2->data[7] = (uint8_t)(code >> 8); pkt2->data[23] = (uint8_t)(code & 0xFF); retval = nsp_send_data(handle, pkt2); nsp_vtl_pkt_del(handle, pkt2); } nsp_vtl_pkt_del(handle, pkt1); if (!retval) { retval = nsp_session_close(handle); } } return retval; } TIEXPORT3 int TICALL nsp_cmd_s_keypress_event(CalcHandle *handle, const uint8_t keycode[3]) { uint32_t key; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(keycode); key = ((uint32_t)(keycode[0]) << 16) | ((uint32_t)(keycode[1]) << 8) | (uint32_t)(keycode[2]); return nsp_cmd_s_key(handle, key); } // There doesn't seem to be a need for cmd_r_key / cmd_r_keypress_event. libticalcs-1.1.9+dfsg/src/nsp_cmd.h000066400000000000000000000154231327711501700171460ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: cmd84p.h 2074 2006-03-31 08:36:06Z roms $ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ // /!\ NOTE: for this file, backwards compatibility will not necessarily be maintained as strongly as it is for ticalcs.h ! #ifndef __NSP_CMDS__ #define __NSP_CMDS__ #ifdef __cplusplus extern "C" { #endif // Services IDs #define NSP_SID_NULL 0x4001 #define NSP_SID_ECHO 0x4002 #define NSP_SID_DEV_INFOS 0x4020 #define NSP_SID_SCREENSHOT 0x4021 #define NSP_SID_SCREEN_RLE 0x4024 #define NSP_SID_KEYPRESSES 0x4042 #define NSP_SID_LOGIN 0x4050 #define NSP_SID_MESSAGES 0x4051 #define NSP_SID_FILE_MGMT 0x4060 #define NSP_SID_OS_INSTALL 0x4080 // Errors #define NSP_ERR_OK 0x00 #define NSP_ERR_DIR_UNKNOWN 0x0a #define NSP_ERR_DIRNAME_INVALID 0x0f #define NSP_ERR_LIST_FAILED 0x10 #define NSP_ERR_NO_MORE_TO_LIST 0x11 #define NSP_ERR_FILENAME_INVALID 0x14 #define NSP_ERR_NO_FILE_EXTENSION 0x15 // Status command #define NSP_CMD_STATUS 0xff // Device Information command #define NSP_CMD_DI_VERSION 0x01 #define NSP_CMD_DI_MODEL 0x02 #define NSP_CMD_DI_FEXT 0x03 // File Management commands #define NSP_CMD_FM_PUT_FILE 0x03 #define NSP_CMD_FM_OK 0x04 #define NSP_CMD_FM_CONTENTS 0x05 #define NSP_CMD_FM_PUT_FILE_EOT 0x06 #define NSP_CMD_FM_GET_FILE 0x07 #define NSP_CMD_FM_DEL_FILE 0x09 #define NSP_CMD_FM_NEW_FOLDER 0x0a #define NSP_CMD_FM_DEL_FOLDER 0x0b #define NSP_CMD_FM_COPY_FILE 0x0c #define NSP_CMD_FM_DIRLIST_INIT 0x0d #define NSP_CMD_FM_DIRLIST_NEXT 0x0e #define NSP_CMD_FM_DIRLIST_DONE 0x0f #define NSP_CMD_FM_DIRLIST_ENT 0x10 #define NSP_CMD_FM_ATTRIBUTES 0x20 #define NSP_CMD_FM_RENAME_FILE 0x21 // OS Installation commands #define NSP_CMD_OS_INSTALL 0x03 #define NSP_CMD_OS_OK 0x04 #define NSP_CMD_OS_CONTENTS 0x05 #define NSP_CMD_OS_PROGRESS 0x06 // Structures // ... // Command wrappers TIEXPORT3 int TICALL nsp_cmd_r_login(CalcHandle *handle); TIEXPORT3 int TICALL nsp_cmd_s_status(CalcHandle *handle, uint8_t status); TIEXPORT3 int TICALL nsp_cmd_r_status(CalcHandle *handle, uint8_t *status); TIEXPORT3 int TICALL nsp_cmd_s_generic_data(CalcHandle *handle, uint32_t size, uint8_t *data, uint16_t sid, uint8_t cmd); TIEXPORT3 int TICALL nsp_cmd_r_generic_data(CalcHandle *handle, uint32_t *size, uint8_t **data); TIEXPORT3 int TICALL nsp_cmd_s_echo(CalcHandle *handle, uint32_t size, uint8_t *data); TIEXPORT3 int TICALL nsp_cmd_r_echo(CalcHandle *handle, uint32_t *size, uint8_t **data); TIEXPORT3 int TICALL nsp_cmd_s_dev_infos(CalcHandle *handle, uint8_t cmd); TIEXPORT3 int TICALL nsp_cmd_r_dev_infos(CalcHandle *handle, uint8_t *cmd, uint32_t *size, uint8_t **data); TIEXPORT3 int TICALL nsp_cmd_s_screen_rle(CalcHandle *handle, uint8_t cmd); TIEXPORT3 int TICALL nsp_cmd_r_screen_rle(CalcHandle *handle, uint8_t *cmd, uint32_t *size, uint8_t **data); TIEXPORT3 int TICALL nsp_cmd_s_dir_attributes(CalcHandle *handle, const char *name); TIEXPORT3 int TICALL nsp_cmd_r_dir_attributes(CalcHandle *handle, uint32_t *size, uint8_t *type, uint32_t *date); TIEXPORT3 int TICALL nsp_cmd_s_dir_enum_init(CalcHandle *handle, const char *name); TIEXPORT3 int TICALL nsp_cmd_r_dir_enum_init(CalcHandle *handle); TIEXPORT3 int TICALL nsp_cmd_s_dir_enum_next(CalcHandle *handle); TIEXPORT3 int TICALL nsp_cmd_r_dir_enum_next(CalcHandle *handle, char* name, uint32_t *size, uint8_t *type); TIEXPORT3 int TICALL nsp_cmd_s_dir_enum_done(CalcHandle *handle); TIEXPORT3 int TICALL nsp_cmd_r_dir_enum_done(CalcHandle *handle); TIEXPORT3 int TICALL nsp_cmd_s_put_file(CalcHandle *handle, const char *name, uint32_t size); TIEXPORT3 int TICALL nsp_cmd_r_put_file(CalcHandle *handle); TIEXPORT3 int TICALL nsp_cmd_s_put_file_eot(CalcHandle *handle); // No nsp_cmd_r_put_file_eot because the calculator doesn't seem to reply to CMD_FM_PUT_FILE_EOT. TIEXPORT3 int TICALL nsp_cmd_s_get_file(CalcHandle *handle, const char *name); TIEXPORT3 int TICALL nsp_cmd_r_get_file(CalcHandle *handle, uint32_t *size); TIEXPORT3 int TICALL nsp_cmd_s_del_file(CalcHandle *handle, const char *name); TIEXPORT3 int TICALL nsp_cmd_r_del_file(CalcHandle *handle); TIEXPORT3 int TICALL nsp_cmd_s_new_folder(CalcHandle *handle, const char *name); TIEXPORT3 int TICALL nsp_cmd_r_new_folder(CalcHandle *handle); TIEXPORT3 int TICALL nsp_cmd_s_del_folder(CalcHandle *handle, const char *name); TIEXPORT3 int TICALL nsp_cmd_r_del_folder(CalcHandle *handle); TIEXPORT3 int TICALL nsp_cmd_s_copy_file(CalcHandle *handle, const char *name, const char *name2); TIEXPORT3 int TICALL nsp_cmd_r_copy_file(CalcHandle *handle); TIEXPORT3 int TICALL nsp_cmd_s_rename_file(CalcHandle *handle, const char *name, const char *name2); TIEXPORT3 int TICALL nsp_cmd_r_rename_file(CalcHandle *handle); TIEXPORT3 int TICALL nsp_cmd_s_file_ok(CalcHandle *handle); TIEXPORT3 int TICALL nsp_cmd_r_file_ok(CalcHandle *handle); TIEXPORT3 int TICALL nsp_cmd_s_file_contents(CalcHandle *handle, uint32_t size, uint8_t *data); TIEXPORT3 int TICALL nsp_cmd_r_file_contents(CalcHandle *handle, uint32_t *size, uint8_t **data); TIEXPORT3 int TICALL nsp_cmd_s_os_install(CalcHandle *handle, uint32_t size); TIEXPORT3 int TICALL nsp_cmd_r_os_install(CalcHandle *handle); TIEXPORT3 int TICALL nsp_cmd_s_os_contents(CalcHandle *handle, uint32_t size, uint8_t *data); TIEXPORT3 int TICALL nsp_cmd_r_progress(CalcHandle *handle, uint8_t *value); TIEXPORT3 int TICALL nsp_cmd_s_key(CalcHandle *handle, uint32_t code); TIEXPORT3 int TICALL nsp_cmd_s_keypress_event(CalcHandle *handle, const uint8_t keycode[3]); // There doesn't seem to be a need for nsp_cmd_r_key / nsp_cmd_r_keypress_event. #ifdef __cplusplus } #endif #endif libticalcs-1.1.9+dfsg/src/nsp_rpkt.c000066400000000000000000000134001327711501700173470ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: packets.c 1404 2005-07-20 20:39:39Z roms $ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 2007 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This unit manages raw packets from/to NSpire thru DirectLink cable. Documentation & credits can be found at . */ #include #include #include "ticalcs.h" #include "internal.h" #include "logging.h" #include "error.h" #define VPKT_DBG 1 // 1 = verbose, 2 = more verbose // CRC implementation from O. Armand (ExtendeD) static uint16_t compute_crc(uint8_t *data, uint32_t size) { uint16_t acc = 0; uint32_t i; if (size == 0) { return 0; } for (i = 0; i < size; i++) { uint16_t first, second, third; first = (((uint16_t)data[i]) << 8) | (acc >> 8); acc &= 0xff; second = (((acc & 0x0f) << 4) ^ acc) << 8; third = second >> 5; acc = third >> 7; acc = (acc ^ first ^ second ^ third); } return acc; } static int hexdump(uint8_t *data, uint32_t size) { #if (VPKT_DBG == 1) char str[64]; uint32_t i; str[0] = 0; if (size <= 12) { str[0] = ' '; str[1] = ' '; str[2] = ' '; str[3] = ' '; for (i = 0; i < size; i++) { sprintf(&str[3*i+4], "%02X ", data[i]); } } else { sprintf(str, " %02X %02X %02X %02X %02X ..... %02X %02X %02X %02X %02X", data[0], data[1], data[2], data[3], data[4], data[size-5], data[size-4], data[size-3], data[size-2], data[size-1]); } ticalcs_info("%s", str); #endif #if (VPKT_DBG == 2) char *str = (char *)g_malloc(3*size + 8 + 10); uint32_t i, j, k; int step = 12; for (k = 0; k < 4; k++) { str[k] = ' '; } for (i = j = 0; i < size; i++, j++) { if (i && !(i % step)) { ticalcs_info(str); j = 0; } sprintf(&str[3*j+4], "%02X ", data[i]); } ticalcs_info("%s", str); g_free(str); #endif return 0; } TIEXPORT3 int TICALL nsp_send(CalcHandle* handle, NSPRawPacket* pkt) { uint8_t buf[sizeof(NSPRawPacket)] = { 0 }; uint32_t size; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(pkt); size = pkt->data_size + NSP_HEADER_SIZE; pkt->data_sum = compute_crc(pkt->data, pkt->data_size); if (pkt->src_port == 0x00fe || pkt->src_port == 0x00ff || pkt->src_port == 0x00d3) { pkt->ack = 0x0a; pkt->seq = handle->priv.nsp_seq; } else { if (!handle->priv.nsp_seq_pc) { handle->priv.nsp_seq_pc++; } pkt->seq = handle->priv.nsp_seq_pc; } ticalcs_info(" %04x:%04x->%04x:%04x AK=%02x SQ=%02x HC=%02x DC=%04x (%i bytes)", pkt->src_addr, pkt->src_port, pkt->dst_addr, pkt->dst_port, pkt->ack, pkt->seq, pkt->hdr_sum, pkt->data_sum, pkt->data_size); if (pkt->data_size) { hexdump(pkt->data, pkt->data_size); } buf[0] = 0x54; buf[1] = 0xFD; buf[2] = MSB(pkt->src_addr); buf[3] = LSB(pkt->src_addr); buf[4] = MSB(pkt->src_port); buf[5] = LSB(pkt->src_port); buf[6] = MSB(pkt->dst_addr); buf[7] = LSB(pkt->dst_addr); buf[8] = MSB(pkt->dst_port); buf[9] = LSB(pkt->dst_port); buf[10] = MSB(pkt->data_sum); buf[11] = LSB(pkt->data_sum); buf[12] = pkt->data_size; buf[13] = pkt->ack; buf[14] = pkt->seq; buf[15] = pkt->hdr_sum = tifiles_checksum(buf, NSP_HEADER_SIZE-1) & 0xff; memcpy(buf + NSP_HEADER_SIZE, pkt->data, pkt->data_size); ticables_progress_reset(handle->cable); ret = ticables_cable_send(handle->cable, buf, size); if (!ret) { if (size >= 128) { ticables_progress_get(handle->cable, NULL, NULL, &handle->updat->rate); } if (handle->updat->cancel) { ret = ERR_ABORT; } } return ret; } TIEXPORT3 int TICALL nsp_recv(CalcHandle* handle, NSPRawPacket* pkt) { uint8_t buf[NSP_HEADER_SIZE]; int ret; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(pkt); ticables_progress_reset(handle->cable); ret = ticables_cable_recv(handle->cable, buf, NSP_HEADER_SIZE); while (!ret) { pkt->unused = (((uint16_t)buf[0]) << 8) | buf[1]; pkt->src_addr = (((uint16_t)buf[2]) << 8) | buf[3]; pkt->src_port = (((uint16_t)buf[4]) << 8) | buf[5]; pkt->dst_addr = (((uint16_t)buf[6]) << 8) | buf[7]; pkt->dst_port = (((uint16_t)buf[8]) << 8) | buf[9]; pkt->data_sum = (((uint16_t)buf[10]) << 8) | buf[11]; pkt->data_size = buf[12]; pkt->ack = buf[13]; pkt->seq = buf[14]; pkt->hdr_sum = buf[15]; if (pkt->src_port == 0x00fe || pkt->src_port == 0x00ff || pkt->src_port == 0x00d3) { handle->priv.nsp_seq_pc++; } else { handle->priv.nsp_seq = pkt->seq; } // Next, follows data if (pkt->data_size) { ret = ticables_cable_recv(handle->cable, pkt->data, pkt->data_size); if (ret) { break; } if (pkt->data_size >= 128) { ticables_progress_get(handle->cable, NULL, NULL, &handle->updat->rate); } } if (handle->updat->cancel) { ret = ERR_ABORT; break; } ticalcs_info(" %04x:%04x->%04x:%04x AK=%02x SQ=%02x HC=%02x DC=%04x (%i bytes)", pkt->src_addr, pkt->src_port, pkt->dst_addr, pkt->dst_port, pkt->ack, pkt->seq, pkt->hdr_sum, pkt->data_sum, pkt->data_size); if (pkt->data_size) { hexdump(pkt->data, pkt->data_size); } break; } return ret; } libticalcs-1.1.9+dfsg/src/nsp_vpkt.c000066400000000000000000000313101327711501700173530ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: cmd84p.c 2077 2006-03-31 21:16:19Z roms $ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This unit manages virtual packets from/to NSPire (DirectLink). Virtual packets are fragmented into one or more raw packets. Please note this unit does not fully implement the NSpire protocol. It assumes there is one Nspire which is not exposing services. This assumption allows to work in a linear fashion although we need sometimes some nasty hacks (LOGIN for instance). A better unit should implement a kind of daemon listening on all ports and launching a thread for each connection attempt. This way is fully parallelized but need a state machine and so more (complex) code. Maybe later... */ #include #include #include #include "ticalcs.h" #include "internal.h" #include "logging.h" #include "error.h" #include "nsp_vpkt.h" // Type to string static const NSPServiceName sid_types[] = { { 0x00FE, "Reception Acknowledgment" }, { 0x00FF, "Reception Ack" }, { 0x4001, "Null" }, { 0x4002, "Echo" }, { 0x4003, "Device Address Request/Assignment" }, { 0x4020, "Device Information" }, { 0x4021, "Screen Capture" }, { 0x4024, "Screen Capture w/ RLE" }, { 0x4042, "Keypresses" }, { 0x4050, "Login" }, { 0x4060, "File Management" }, { 0x4080, "OS Installation" }, { 0x40DE, "Service Disconnect" }, { -1, NULL}, }; TIEXPORT3 const char* TICALL nsp_sid2name(uint16_t id) { const NSPServiceName *p; for (p = sid_types; p->name != NULL; p++) { if (p->id == id) { return p->name; } } return "unknown: not listed"; } // Creation/Destruction/Garbage Collecting of packets TIEXPORT3 NSPVirtualPacket* TICALL nsp_vtl_pkt_new(CalcHandle * handle) { return nsp_vtl_pkt_new_ex(handle, 0, 0, 0, 0, 0, 0, NULL); } TIEXPORT3 NSPVirtualPacket* TICALL nsp_vtl_pkt_new_ex(CalcHandle * handle, uint32_t size, uint16_t src_addr, uint16_t src_port, uint16_t dst_addr, uint16_t dst_port, uint8_t cmd, uint8_t * data) { NSPVirtualPacket* vtl = NULL; if (ticalcs_validate_handle(handle)) { GList * vtl_pkt_list; vtl = g_malloc0(sizeof(NSPVirtualPacket)); // aborts the program if it fails. nsp_vtl_pkt_fill(vtl, size, src_addr, src_port, dst_addr, dst_port, cmd, data); // aborts the program if it fails. vtl_pkt_list = g_list_append((GList *)(handle->priv.nsp_vtl_pkt_list), vtl); handle->priv.nsp_vtl_pkt_list = (void *)vtl_pkt_list; } else { ticalcs_critical("%s: handle is invalid", __FUNCTION__); } return vtl; } TIEXPORT3 void TICALL nsp_vtl_pkt_fill(NSPVirtualPacket* vtl, uint32_t size, uint16_t src_addr, uint16_t src_port, uint16_t dst_addr, uint16_t dst_port, uint8_t cmd, uint8_t * data) { if (vtl != NULL) { vtl->src_addr = src_addr; vtl->src_port = src_port; vtl->dst_addr = dst_addr; vtl->dst_port = dst_port; vtl->cmd = cmd; vtl->size = size; vtl->data = data; } else { ticalcs_critical("%s: vtl is NULL", __FUNCTION__); } } TIEXPORT3 void TICALL nsp_vtl_pkt_del(CalcHandle *handle, NSPVirtualPacket* vtl) { GList *vtl_pkt_list; if (!ticalcs_validate_handle(handle)) { ticalcs_critical("%s: handle is invalid", __FUNCTION__); return; } if (vtl == NULL) { ticalcs_critical("%s: vtl is NULL", __FUNCTION__); return; } vtl_pkt_list = g_list_remove((GList *)(handle->priv.nsp_vtl_pkt_list), vtl); handle->priv.nsp_vtl_pkt_list = (void *)vtl_pkt_list; g_free(vtl->data); g_free(vtl); } TIEXPORT3 void * TICALL nsp_vtl_pkt_alloc_data(size_t size) { return g_malloc0(size + 1); } TIEXPORT3 NSPVirtualPacket * TICALL nsp_vtl_pkt_realloc_data(NSPVirtualPacket* vtl, size_t size) { if (vtl != NULL) { if (size + 1 > size) { uint8_t * data = g_realloc(vtl->data, size + 1); if (size > vtl->size) { // The previous time, vtl->size + 1 bytes were allocated and initialized. // This time, we've allocated size + 1 bytes, so we need to initialize size - vtl->size extra bytes. memset(data + vtl->size + 1, 0x00, size - vtl->size); } vtl->data = data; } else { return NULL; } } return vtl; } TIEXPORT3 void TICALL nsp_vtl_pkt_free_data(void * data) { return g_free(data); } // Session Management TIEXPORT3 int TICALL nsp_session_open(CalcHandle *handle, uint16_t port) { VALIDATE_HANDLE(handle); handle->priv.nsp_src_port++; handle->priv.nsp_dst_port = port; ticalcs_info(" opening session from port #%04x to port #%04x:", handle->priv.nsp_src_port, handle->priv.nsp_dst_port); return 0; } TIEXPORT3 int TICALL nsp_session_close(CalcHandle *handle) { int ret; VALIDATE_HANDLE(handle); ticalcs_info(" closed session from port #%04x to port #%04x:", handle->priv.nsp_src_port, handle->priv.nsp_dst_port); ret = nsp_send_disconnect(handle); if (!ret) { ret = nsp_recv_ack(handle); if (!ret) { handle->priv.nsp_dst_port = NSP_PORT_ADDR_REQUEST; } } return ret; } // Address Request/Assignment TIEXPORT3 int TICALL nsp_addr_request(CalcHandle *handle) { NSPRawPacket pkt; int ret; VALIDATE_HANDLE(handle); memset(&pkt, 0, sizeof(pkt)); // Reset connection so that device send an address request packet ret = handle->cable->cable->reset(handle->cable); if (!ret) { handle->priv.nsp_seq_pc = 1; ticalcs_info(" device address request:"); ret = nsp_recv(handle, &pkt); if (!ret) { if ( pkt.src_port != NSP_PORT_ADDR_ASSIGN || pkt.dst_port != NSP_PORT_ADDR_REQUEST) { ret = ERR_INVALID_PACKET; } } } return ret; } TIEXPORT3 int TICALL nsp_addr_assign(CalcHandle *handle, uint16_t addr) { NSPRawPacket pkt; VALIDATE_HANDLE(handle); ticalcs_info(" assigning address %04x:", addr); memset(&pkt, 0, sizeof(pkt)); pkt.data_size = 4; pkt.src_addr = NSP_SRC_ADDR; pkt.src_port = NSP_PORT_ADDR_ASSIGN; pkt.dst_addr = NSP_DEV_ADDR; pkt.dst_port = NSP_PORT_ADDR_ASSIGN; pkt.data[0] = MSB(addr); pkt.data[1] = LSB(addr); pkt.data[2] = 0xFF; pkt.data[3] = 0x00; return nsp_send(handle, &pkt); } // Acknowledgement TIEXPORT3 int TICALL nsp_send_ack(CalcHandle* handle) { NSPRawPacket pkt; VALIDATE_HANDLE(handle); ticalcs_info(" sending ack:"); memset(&pkt, 0, sizeof(pkt)); pkt.data_size = 2; pkt.src_addr = NSP_SRC_ADDR; pkt.src_port = NSP_PORT_PKT_ACK2; pkt.dst_addr = NSP_DEV_ADDR; pkt.dst_port = handle->priv.nsp_dst_port; pkt.data[0] = MSB(handle->priv.nsp_src_port); pkt.data[1] = LSB(handle->priv.nsp_src_port); return nsp_send(handle, &pkt); } TIEXPORT3 int TICALL nsp_send_nack(CalcHandle* handle) { VALIDATE_HANDLE(handle); return nsp_send_nack_ex(handle, handle->priv.nsp_dst_port); } TIEXPORT3 int TICALL nsp_send_nack_ex(CalcHandle* handle, uint16_t port) { NSPRawPacket pkt; VALIDATE_HANDLE(handle); ticalcs_info(" sending nAck:"); memset(&pkt, 0, sizeof(pkt)); pkt.data_size = 2; pkt.src_addr = NSP_SRC_ADDR; pkt.src_port = NSP_PORT_PKT_NACK; pkt.dst_addr = NSP_DEV_ADDR; pkt.dst_port = port; pkt.data[0] = MSB(NSP_PORT_LOGIN); pkt.data[1] = LSB(NSP_PORT_LOGIN); return nsp_send(handle, &pkt); } TIEXPORT3 int TICALL nsp_recv_ack(CalcHandle *handle) { NSPRawPacket pkt; uint16_t addr; int ret = 0; VALIDATE_HANDLE(handle); ticalcs_info(" receiving ack:"); memset(&pkt, 0, sizeof(pkt)); ret = nsp_recv(handle, &pkt); if (!ret) { if (pkt.src_port != NSP_PORT_PKT_ACK2) { ticalcs_info("XXX weird src_port\n"); ret = ERR_INVALID_PACKET; } if (pkt.dst_port != handle->priv.nsp_src_port) { ticalcs_info("XXX weird .dst_port\n"); ret = ERR_INVALID_PACKET; } if (pkt.data_size >= 2) { addr = (((uint16_t)pkt.data[0]) << 8) | pkt.data[1]; if (addr != handle->priv.nsp_dst_port) { ticalcs_info("XXX weird addr\n"); ret = ERR_INVALID_PACKET; } } else { ticalcs_info("XXX weird addr\n"); ret = ERR_INVALID_PACKET; } if (pkt.ack != 0x0A) { ticalcs_info("XXX weird .ack\n"); ret = ERR_INVALID_PACKET; } } return ret; } // Service Disconnection TIEXPORT3 int TICALL nsp_send_disconnect(CalcHandle *handle) { NSPRawPacket pkt; VALIDATE_HANDLE(handle); ticalcs_info(" disconnecting from service #%04x:", handle->priv.nsp_dst_port); memset(&pkt, 0, sizeof(pkt)); pkt.data_size = 2; pkt.src_addr = NSP_SRC_ADDR; pkt.src_port = NSP_PORT_DISCONNECT; pkt.dst_addr = NSP_DEV_ADDR; pkt.dst_port = handle->priv.nsp_dst_port; pkt.data[0] = MSB(handle->priv.nsp_src_port); pkt.data[1] = LSB(handle->priv.nsp_src_port); return nsp_send(handle, &pkt); } TIEXPORT3 int TICALL nsp_recv_disconnect(CalcHandle *handle) { NSPRawPacket pkt; uint16_t addr; int ret; VALIDATE_HANDLE(handle); ticalcs_info(" receiving disconnect:"); memset(&pkt, 0, sizeof(pkt)); ret = nsp_recv(handle, &pkt); if (!ret) { if (pkt.src_port != NSP_PORT_DISCONNECT) { ret = ERR_INVALID_PACKET; } else { // nasty hacks handle->priv.nsp_dst_port = (((uint16_t)pkt.data[0]) << 8) | pkt.data[1]; addr = pkt.dst_port; ticalcs_info(" sending ack:"); pkt.unused = 0; pkt.data_size = 2; pkt.src_addr = NSP_SRC_ADDR; pkt.src_port = NSP_PORT_PKT_ACK2; pkt.dst_addr = NSP_DEV_ADDR; pkt.dst_port = handle->priv.nsp_dst_port; pkt.data_sum = 0; pkt.ack = 0; pkt.seq = 0; pkt.hdr_sum = 0; pkt.data[0] = MSB(addr); pkt.data[1] = LSB(addr); ret = nsp_send(handle, &pkt); } } return ret; } // Fragmenting of packets TIEXPORT3 int TICALL nsp_send_data(CalcHandle *handle, NSPVirtualPacket *vtl) { NSPRawPacket raw; int i, r, q; long offset = 0; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(vtl); if (vtl->size && !vtl->data) { return ERR_INVALID_PARAMETER; } memset(&raw, 0, sizeof(raw)); raw.src_addr = vtl->src_addr; raw.src_port = vtl->src_port; raw.dst_addr = vtl->dst_addr; raw.dst_port = vtl->dst_port; q = (vtl->size - offset) / (NSP_DATA_SIZE-1); r = (vtl->size - offset) % (NSP_DATA_SIZE-1); for (i = 1; i <= q; i++) { raw.data_size = NSP_DATA_SIZE; raw.data[0] = vtl->cmd; memcpy(raw.data + 1, vtl->data + offset, NSP_DATA_SIZE-1); offset += NSP_DATA_SIZE-1; ret = nsp_send(handle, &raw); if (ret) { break; } if (raw.src_port != NSP_PORT_ADDR_ASSIGN && raw.dst_port != NSP_PORT_ADDR_REQUEST) { ret = nsp_recv_ack(handle); if (ret) { break; } } handle->updat->max1 = vtl->size; handle->updat->cnt1 += NSP_DATA_SIZE; handle->updat->pbar(); } if (!ret) { if (r || !vtl->size) { raw.data_size = r + 1; raw.data[0] = vtl->cmd; if (vtl->data) { memcpy(raw.data + 1, vtl->data + offset, r); } offset += r; ret = nsp_send(handle, &raw); if (!ret) { if (raw.src_port != NSP_PORT_ADDR_ASSIGN && raw.dst_port != NSP_PORT_ADDR_REQUEST) { ret = nsp_recv_ack(handle); } } } } return ret; } // Note: data field may be re-allocated. TIEXPORT3 int TICALL nsp_recv_data(CalcHandle* handle, NSPVirtualPacket* vtl) { NSPRawPacket raw; long offset = 0; uint32_t size; int ret = 0; VALIDATE_HANDLE(handle); VALIDATE_NONNULL(vtl); memset(&raw, 0, sizeof(raw)); size = vtl->size; vtl->size = 0; vtl->data = g_malloc(NSP_DATA_SIZE); if (vtl->data) { for (;;) { ret = nsp_recv(handle, &raw); if (ret) { break; } if (raw.data_size > 0) { vtl->cmd = raw.data[0]; vtl->size += raw.data_size-1; vtl->data = g_realloc(vtl->data, vtl->size); memcpy(vtl->data + offset, &(raw.data[1]), raw.data_size-1); offset += raw.data_size-1; handle->updat->max1 = size ? size : vtl->size; handle->updat->cnt1 += NSP_DATA_SIZE; handle->updat->pbar(); } if (raw.dst_port == NSP_PORT_LOGIN) { ret = nsp_send_nack_ex(handle, raw.src_port); if (ret) { break; } } else if (raw.src_port != NSP_PORT_ADDR_ASSIGN && raw.dst_port != NSP_PORT_ADDR_REQUEST) { ret = nsp_send_ack(handle); if (ret) { break; } } if (raw.data_size < NSP_DATA_SIZE) { break; } if (size && vtl->size == size) { break; } } } vtl->src_addr = raw.src_addr; vtl->src_port = raw.src_port; vtl->dst_addr = raw.dst_addr; vtl->dst_port = raw.dst_port; return ret; } libticalcs-1.1.9+dfsg/src/nsp_vpkt.h000066400000000000000000000071631327711501700173710ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ // /!\ NOTE: for this file, backwards compatibility will not necessarily be maintained as strongly as it is for ticalcs.h ! #ifndef __NSP_VPKT__ #define __NSP_VPKT__ #ifdef __cplusplus extern "C" { #endif // Convenient structures typedef struct { uint16_t src_addr; uint16_t src_port; uint16_t dst_addr; uint16_t dst_port; uint8_t cmd; uint32_t size; uint8_t *data; } NSPVirtualPacket; typedef struct { uint16_t id; const char *name; } NSPServiceName; // Constants #define NSP_SRC_ADDR 0x6400 #define NSP_DEV_ADDR 0x6401 #define NSP_PORT_PKT_NACK 0x00D3 #define NSP_PORT_PKT_ACK1 0x00FE #define NSP_PORT_PKT_ACK2 0x00FF #define NSP_PORT_NULL 0x4001 #define NSP_PORT_ECHO 0x4002 #define NSP_PORT_ADDR_REQUEST 0x4003 #define NSP_PORT_ADDR_ASSIGN 0x4003 #define NSP_PORT_DEV_INFOS 0x4020 #define NSP_PORT_SCREENSHOT 0x4021 #define NSP_PORT_SCREEN_RLE 0x4024 #define NSP_PORT_KEYPRESSES 0x4042 #define NSP_PORT_LOGIN 0x4050 #define NSP_PORT_FILE_MGMT 0x4060 #define NSP_PORT_OS_INSTALL 0x4080 #define NSP_PORT_DISCONNECT 0x40DE // Functions TIEXPORT3 const char* TICALL nsp_sid2name(uint16_t id); TIEXPORT3 NSPVirtualPacket* TICALL nsp_vtl_pkt_new(CalcHandle *handle); TIEXPORT3 NSPVirtualPacket* TICALL nsp_vtl_pkt_new_ex(CalcHandle *handle, uint32_t size, uint16_t src_addr, uint16_t src_port, uint16_t dst_addr, uint16_t dst_port, uint8_t cmd, uint8_t * data); TIEXPORT3 void TICALL nsp_vtl_pkt_fill(NSPVirtualPacket* vtl, uint32_t size, uint16_t src_addr, uint16_t src_port, uint16_t dst_addr, uint16_t dst_port, uint8_t cmd, uint8_t * data); TIEXPORT3 void TICALL nsp_vtl_pkt_del(CalcHandle *handle, NSPVirtualPacket* vtl); TIEXPORT3 void * TICALL nsp_vtl_pkt_alloc_data(size_t size); TIEXPORT3 NSPVirtualPacket * TICALL nsp_vtl_pkt_realloc_data(NSPVirtualPacket* vtl, size_t size); TIEXPORT3 void TICALL nsp_vtl_pkt_free_data(void * data); TIEXPORT3 int TICALL nsp_session_open(CalcHandle *handle, uint16_t port); TIEXPORT3 int TICALL nsp_session_close(CalcHandle *handle); TIEXPORT3 int TICALL nsp_addr_request(CalcHandle *handle); TIEXPORT3 int TICALL nsp_addr_assign(CalcHandle *handle, uint16_t dev_addr); TIEXPORT3 int TICALL nsp_send_ack(CalcHandle *handle); TIEXPORT3 int TICALL nsp_recv_ack(CalcHandle *handle); TIEXPORT3 int TICALL nsp_send_nack(CalcHandle *handle); TIEXPORT3 int TICALL nsp_send_nack_ex(CalcHandle *handle, uint16_t port); TIEXPORT3 int TICALL nsp_send_data(CalcHandle *handle, NSPVirtualPacket* vtl); TIEXPORT3 int TICALL nsp_recv_data(CalcHandle *handle, NSPVirtualPacket* vtl); TIEXPORT3 int TICALL nsp_send_disconnect(CalcHandle *handle); TIEXPORT3 int TICALL nsp_recv_disconnect(CalcHandle *handle); #ifdef __cplusplus } #endif #endif libticalcs-1.1.9+dfsg/src/pause.h000066400000000000000000000024061327711501700166350ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TICALCS_PAUSE__ #define __TICALCS_PAUSE__ // Little pause in milli-seconds #define PAUSE_BETWEEN_VARS 250 // 250ms #if defined(__LINUX__) || defined(__MACOSX__) || defined(__BSD__) || defined(__ANDROID__) # include # define PAUSE(x) usleep(1000*(x)) #elif defined(__WIN32__) # define WIN32_LEAN_AND_MEAN # include # define PAUSE(x) Sleep((x)) #endif #endif libticalcs-1.1.9+dfsg/src/probe.c000066400000000000000000000366271327711501700166360ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Probing support. */ #include #include #include #include "ticalcs.h" #include "internal.h" #include "logging.h" #include "dbus_pkt.h" #include "error.h" #include "gettext.h" #include "calc_xx.h" #include "dusb_vpkt.h" #include "dusb_cmd.h" #define DEAD_TIME 250 /* Get the first byte sent by the calc (Machine ID) */ static int tixx_recv_ACK(CalcHandle* handle, uint8_t* mid) { uint8_t host, cmd; uint16_t length; uint8_t buffer[5]; int ret; ret = dbus_recv(handle, &host, &cmd, &length, buffer); if (!ret) { ticalcs_info(" TI->PC: ACK"); *mid = host; if (cmd == DBUS_CMD_SKP) { ret = ERR_VAR_REJECTED; } } return ret; } /** * ticalcs_probe_calc_2: * @handle: a previously allocated handle * @type: the calculator model * * This function tries and detect the calculator type for non-silent models * by requesting a screedump and analyzing the Machine ID. * It supposes your calc is on and plugged. * * PC: 08 6D 00 00 PC request a screen dump * TI: MId 56 00 00 TI reply OK * * Beware: the call sequence is very important: 86, 85, 73, 83, 82 !!! * * Return value: 0 if successful, an error code otherwise. **/ static int ticalcs_probe_calc_2(CalcHandle* handle, CalcModel* model) { int err; uint8_t data; do { ticalcs_info(_("Probing calculator...\n")); *model = CALC_NONE; /* Test for a TI86 before a TI85 */ ticalcs_info(_("Check for TI86... ")); err = dbus_send(handle, DBUS_MID_PC_TI86, DBUS_CMD_SCR, 2, NULL); if (err) { break; } err = tixx_recv_ACK(handle, &data); ticalcs_info("<%02X-%02X> ", DBUS_MID_PC_TI86, data); if (!err && (data == DBUS_MID_TI86_PC)) { ticalcs_info("OK !\n"); *model = CALC_TI86; break; } else { ticalcs_info("NOK.\n"); ticables_cable_reset(handle->cable); PAUSE(DEAD_TIME); } /* Test for a TI85 */ ticalcs_info(_("Check for TI85... ")); err = dbus_send(handle, DBUS_MID_PC_TI85, DBUS_CMD_SCR, 2, NULL); if (err) { break; } err = tixx_recv_ACK(handle, &data); ticalcs_info("<%02X-%02X> ", DBUS_MID_PC_TI85, data); if (!err && (data == DBUS_MID_TI85_PC)) { ticalcs_info("OK !\n"); *model = CALC_TI85; break; } else { ticalcs_info("NOK.\n"); ticables_cable_reset(handle->cable); PAUSE(DEAD_TIME); } /* Test for a TI73 before a TI83 */ ticalcs_info(_("Check for TI73... ")); err = dbus_send(handle, DBUS_MID_PC_TI73, DBUS_CMD_SCR, 2, NULL); if (err) { break; } err = tixx_recv_ACK(handle, &data); ticalcs_info("<%02X-%02X> ", DBUS_MID_PC_TI73, data); if (!err && (data == DBUS_MID_TI73_PC)) { ticalcs_info("OK !\n"); *model = CALC_TI73; break; } else { ticalcs_info("NOK.\n"); ticables_cable_reset(handle->cable); PAUSE(DEAD_TIME); } /* Test for a TI83 before a TI82 */ ticalcs_info(_("Check for TI83... ")); err = dbus_send(handle, DBUS_MID_PC_TI83, DBUS_CMD_SCR, 2, NULL); if (err) { break; } err = tixx_recv_ACK(handle, &data); ticalcs_info("<%02X-%02X> ", DBUS_MID_PC_TI83, data); if (!err && (data == DBUS_MID_TI83_PC)) { ticalcs_info("OK !\n"); *model = CALC_TI83; break; } else { ticalcs_info("NOK.\n"); ticables_cable_reset(handle->cable); PAUSE(DEAD_TIME); } /* Test for a TI82 */ ticalcs_info(_("Check for TI82... ")); err = dbus_send(handle, DBUS_MID_PC_TI83, DBUS_CMD_SCR, 2, NULL); if (err) { break; } err = tixx_recv_ACK(handle, &data); ticalcs_info("<%02X-%02X> ", DBUS_MID_PC_TI82, data); if (!err && (data == DBUS_MID_TI82_PC)) { ticalcs_info("OK !\n"); *model = CALC_TI82; break; } else { ticalcs_info("NOK.\n"); ticables_cable_reset(handle->cable); PAUSE(DEAD_TIME); } #if 0 /* Test for a TI80 */ #warning TI-80 DETECTION FAILS ticalcs_info(_("Check for TI80... ")); err = dbus_send(handle, DBUS_MID_PC_TI80, DBUS_CMD_SCR, 0, NULL); if (err) { break; } err = tixx_recv_ACK(handle, &data); ticalcs_info("<%02X-%02X> ", DBUS_MID_PC_TI80, data); if (!err && (data == DBUS_MID_TI80_PC)) { ticalcs_info("OK !\n"); *model = CALC_TI80; break; } else { ticalcs_info("NOK.\n"); ticables_cable_reset(handle->cable); PAUSE(DEAD_TIME); } #endif } while(0); return (*model == CALC_NONE) ? ERR_NO_CALC : 0; } /** * ticalcs_probe_calc_1: * @handle: a previously allocated handle * @type: the calculator model * * Check if the calculator is ready and detect the type. * Works only on FLASH calculators with an AMS2.08 or OS2.00 by requesting the * version. A previous version was based on MID but TI83+/84+, TI89/TI89t, TI92+/V200 * could not be distinguished ;-( * * Return value: 0 if successful, an error code otherwise. **/ static int ticalcs_probe_calc_1(CalcHandle* handle, CalcModel* model) { uint8_t host, cmd; uint16_t status; uint8_t buffer[256]; int i, ret; // init value *model = CALC_NONE; do { CalcInfos infos; // test for FLASH hand-helds (00 68 00 00 -> XX 56 00 00) // where XX is 0x98: TI89/89t, 0x88: TI92+/V200, 0x73: TI83+/84+, 0x74: TI73 ticalcs_info(_("Check for TIXX... ")); for (i = 0; i < 2; i++) { ticalcs_info(" PC->TI: RDY?"); ret = dbus_send(handle, DBUS_MID_PC_TIXX, DBUS_CMD_RDY, 2, NULL); if (ret) { continue; } ret = dbus_recv(handle, &host, &cmd, &status, buffer); ticalcs_info(" TI->PC: ACK"); if (ret) { continue; } break; } // test for TI73 if (!ret) { if (host == DBUS_MID_TI73_PC) { *model = CALC_TI73; break; } else if (host == DBUS_MID_TI92_PC) { *model = CALC_TI92; break; } } // test for TI92 (09 68 00 00 -> 89 56 00 00) else if (ret) { ticalcs_info(_("Check for TI92... ")); ticables_cable_reset(handle->cable); PAUSE(DEAD_TIME); // needed ! for (i = 0; i < 2; i++) { ticalcs_info(" PC->TI: RDY?"); ret = dbus_send(handle, DBUS_MID_PC_TI92, DBUS_CMD_RDY, 2, NULL); if (ret) { continue; } ret = dbus_recv(handle, &host, &cmd, &status, buffer); ticalcs_info(" TI->PC: ACK"); if (ret) { continue; } break; } if (!ret) { *model = CALC_TI92; } } if (cmd != DBUS_CMD_ACK) { ret = ERR_INVALID_CMD; break; } if ((status & 1) != 0) { ret = ERR_NOT_READY; break; } // test for TI9x FLASH hand-helds again (request version and analyze HW_ID) if(!ret && (host != DBUS_MID_TI73_PC) && (host != DBUS_MID_TI83p_PC)) { ticalcs_info(_("Check for TI9X... ")); handle->model = CALC_TI89; handle->calc = (CalcFncts *)&calc_89; memset(&infos, 0, sizeof(CalcInfos)); ret = ticalcs_calc_get_version(handle, &infos); if (ret) { break; } *model = infos.model; } else { ticalcs_info(_("Check for TI8X... ")); handle->model = CALC_TI83P; handle->calc = (CalcFncts *)&calc_83p; memset(&infos, 0, sizeof(CalcInfos)); ret = ticalcs_calc_get_version(handle, &infos); if (ret) { break; } *model = infos.model; } } while(0); ticalcs_info(_("Calculator type: %s"), tifiles_model_to_string(*model)); if (!ret) { ret = (*model == CALC_NONE) ? ERR_NO_CALC : 0; } return ret; } extern const CalcUpdate default_update; /** * ticalcs_probe_calc: * @cable: a valid (=opened/attached) link cable handle * @model: the calculator model which have been detected * * This function attempts to detect the calculator model plugged onto the cable. * It works in a heuristic fashion. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_probe_calc(CableHandle* cable, CalcModel* model) { CalcHandle calc; int ret = 0; VALIDATE_NONNULL(cable); VALIDATE_NONNULL(model); do { // Hack: we construct the structure here because we don't really need it. // I want to use ticalcs functions with a non-fixed calculator memset(&calc, 0, sizeof(CalcHandle)); calc.model = *model = CALC_NONE; calc.updat = (CalcUpdate *)&default_update; calc.buffer = (uint8_t *)g_malloc(65536 + 6); calc.cable = cable; calc.open = !0; // first: search for FLASH hand-helds (fast) ret = ticalcs_probe_calc_1(&calc, model); if (!ret && (*model != CALC_NONE)) { g_free(calc.buffer); break; } // second: search for other calcs (slow) ret = ticalcs_probe_calc_2(&calc, model); g_free(calc.buffer); } while(0); if (!ret) { ret = (*model == CALC_NONE) ? ERR_NO_CALC : 0; } return ret; } /** * ticalcs_probe_usb_calc: * @cable: a valid (=opened/attached) link cable handle * @model: the calculator model which have been detected * * This function attempts to detect the calculator model plugged onto the cable. * It works in a heuristic fashion and with FLASH hand-helds only. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_probe_usb_calc(CableHandle* cable, CalcModel* model) { CalcHandle calc; int ret = ERR_NO_CALC; VALIDATE_NONNULL(cable); VALIDATE_NONNULL(model); do { // Hack: we construct the structure here because we don't really need it. // I want to use ticalcs functions with a non-fixed calculator memset(&calc, 0, sizeof(CalcHandle)); calc.model = *model = CALC_NONE; calc.updat = (CalcUpdate *)&default_update; calc.buffer = (uint8_t *)g_malloc(65536 + 6); calc.cable = cable; calc.open = !0; if (cable->model == CABLE_SLV) { ret = ticalcs_probe_calc_1(&calc, model); } else if (cable->model == CABLE_USB) { CableDeviceInfo info; ret = ticables_cable_get_device_info(cable, &info); if (!ret) { *model = ticalcs_device_info_to_model(&info); } } g_free(calc.buffer); } while(0); return ret; } /** * ticalcs_probe: * @c_model: link cable model * @c_port: link cable port * @model: hand-held model detected/found [out] * @all: which hand-helds to detect (FLASH only or all) * * This function attempts to detect the calculator model plugged onto a * given link cable model/port. It works in a heuristic fashion. * This function handles device opening/closing for you. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_probe(CableModel c_model, CablePort c_port, CalcModel* model, int all) { CableHandle *handle; int ret = 0; CalcHandle calc; VALIDATE_NONNULL(model); // get handle handle = ticables_handle_new(c_model, c_port); ticables_options_set_timeout(handle, 10); // hack: we construct the structure here because we don't really need it. // I want to use ticalcs functions with a non-fixed calculator memset(&calc, 0, sizeof(CalcHandle)); calc.model = *model = CALC_NONE; calc.updat = (CalcUpdate *)&default_update; calc.buffer = (uint8_t *)g_malloc(65536 + 6); calc.cable = handle; calc.open = !0; do { // open cable ret = ticables_cable_open(handle); if (ret) { ticables_handle_del(handle); break; } // probe if (c_model == CABLE_USB) { ret = ticalcs_probe_usb_calc(handle, model); } else { if (all) { ret = ticalcs_probe_calc(handle, model); } else { ret = ticalcs_probe_calc_1(&calc, model); } } // close ticables_cable_close(handle); ticables_handle_del(handle); } while(0); return ret; } /** * ticalcs_device_info_to_model: * @info: pointer to device info * * Converts a cable device info to a CalcModel, if possible. * * Return value: != CALC_NONE if a precise calculator model can be determined through the cable+device info, CALC_NONE if invalid argument or SilverLink cable. */ TIEXPORT3 CalcModel TICALL ticalcs_device_info_to_model(const CableDeviceInfo *info) { CalcModel model = CALC_NONE; if (info != NULL) { if (info->family == CABLE_FAMILY_DBUS) { // Can't determine calc model through the sole cable model. That's a job for the upper layers. // Fall through. } else if (info->family == CABLE_FAMILY_USB_TI8X) { if (info->variant == CABLE_VARIANT_TI84P || info->variant == CABLE_VARIANT_TI84PSE) { model = CALC_TI84P_USB; } else if (info->variant == CABLE_VARIANT_TI84PCSE) { model = CALC_TI84PC_USB; } else if (info->variant == CABLE_VARIANT_TI84PCE) { model = CALC_TI84PCE_USB; } else if (info->variant == CABLE_VARIANT_TI83PCE) { model = CALC_TI83PCE_USB; } else if (info->variant == CABLE_VARIANT_TI82A) { model = CALC_TI82A_USB; } else if (info->variant == CABLE_VARIANT_TI84PT) { model = CALC_TI84PT_USB; } else { ticalcs_warning("Unexpected variant for TI-(e)Z80 USB cable, assuming 84+CE"); model = CALC_TI84PCE_USB; } } else if (info->family == CABLE_FAMILY_USB_TI9X) { // This cable family has a single corresponding calc model. if (info->variant != CABLE_VARIANT_TI89TM) { ticalcs_warning("Unexpected variant for TI-68k USB cable"); } model = CALC_TI89T_USB; } else if (info->family == CABLE_FAMILY_USB_NSPIRE) { // This cable family has a single corresponding calc model. if (info->variant != CABLE_VARIANT_NSPIRE) { ticalcs_warning("Unexpected variant for Nspire USB cable"); } model = CALC_NSPIRE; } else { ticalcs_critical("Unexpected cable family"); // Fall through. } } // else fall through. return model; } /** * ticalcs_remap_model_from_usb: * @cable: a cable model model taken in #CableModel. * @cable: a calc model model taken in #CalcModel. * * This function remaps a CALC_*_USB model to the corresponding CALC_* model, if said CALC_* model exists and the selected cable is USB. * * Return value: the new calculator model, which can be the same as the passed one. **/ TIEXPORT3 CalcModel TICALL ticalcs_remap_model_from_usb(CableModel cable, CalcModel calc) { if (cable == CABLE_USB) { if (calc == CALC_TI84P_USB) { return CALC_TI84P; } else if (calc == CALC_TI84PC_USB) { return CALC_TI84PC; } else if (calc == CALC_TI89T_USB) { return CALC_TI89T; } // else fall through. } // else fall through. return calc; } /** * ticalcs_remap_model_from_usb: * @cable: a cable model model taken in #CableModel. * @cable: a calc model model taken in #CalcModel. * * This function remaps a CALC_* model to the corresponding CALC_*_USB model, if said CALC_*_USB model exists and the selected cable is USB. * * Return value: the new calculator model, which can be the same as the passed one. **/ TIEXPORT3 CalcModel TICALL ticalcs_remap_model_to_usb(CableModel cable, CalcModel calc) { if (cable == CABLE_USB) { if (calc == CALC_TI84P) { return CALC_TI84P_USB; } else if (calc == CALC_TI84PC) { return CALC_TI84PC_USB; } else if (calc== CALC_TI89T) { return CALC_TI89T_USB; } // else fall through. } // else fall through. return calc; } libticalcs-1.1.9+dfsg/src/rom73.h000066400000000000000000000120171327711501700164660ustar00rootroot00000000000000static unsigned char romDump73[] = { 0x2a, 0x2a, 0x54, 0x49, 0x37, 0x33, 0x2a, 0x2a, 0x1a, 0x0a, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x69, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x30, 0x2e, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0b, 0x00, 0xf1, 0x02, 0x06, 0x52, 0x4f, 0x4d, 0x44, 0x55, 0x4d, 0x50, 0x00, 0xf1, 0x02, 0xef, 0x02, 0x5f, 0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x30, 0x35, 0x3f, 0x2a, 0x5d, 0x9a, 0xe9, 0x01, 0xd5, 0x3f, 0x11, 0x2b, 0x01, 0x19, 0x11, 0x52, 0x8a, 0x01, 0xb6, 0x01, 0xed, 0xb0, 0xfd, 0xcb, 0x1f, 0xae, 0xfd, 0xcb, 0x08, 0x9e, 0xdb, 0x06, 0x32, 0x13, 0x86, 0xcd, 0x53, 0x8a, 0x3a, 0x13, 0x86, 0xd3, 0x06, 0x21, 0x00, 0x00, 0x22, 0x16, 0x86, 0x22, 0x18, 0x86, 0xef, 0xd7, 0x44, 0xef, 0xad, 0x44, 0x21, 0x00, 0x00, 0x22, 0xe2, 0x83, 0x21, 0xd2, 0x8b, 0xef, 0x71, 0x44, 0x11, 0x04, 0x00, 0xed, 0x53, 0xe2, 0x83, 0xef, 0x71, 0x44, 0xfb, 0x76, 0xef, 0x0f, 0x40, 0xfe, 0x37, 0x28, 0x2f, 0xcd, 0x6a, 0x8b, 0x28, 0xf2, 0xcd, 0xca, 0x8a, 0x38, 0x53, 0xed, 0x5b, 0x26, 0x86, 0x21, 0x55, 0xaa, 0xb7, 0xed, 0x52, 0x28, 0x09, 0x7a, 0xb7, 0x20, 0x43, 0x43, 0x10, 0x0a, 0x18, 0xd8, 0x21, 0x01, 0x00, 0xcd, 0x00, 0x8b, 0x18, 0xd0, 0x10, 0x10, 0x21, 0x02, 0x00, 0xcd, 0x00, 0x8b, 0xef, 0xad, 0x44, 0x21, 0x00, 0x00, 0x22, 0xe2, 0x83, 0xc9, 0x10, 0x20, 0x21, 0x04, 0x8c, 0x22, 0x1e, 0x86, 0x21, 0x04, 0x00, 0x22, 0x1c, 0x86, 0x21, 0x03, 0x00, 0xcd, 0x08, 0x8b, 0x21, 0x02, 0x04, 0x22, 0xe2, 0x83, 0x21, 0xfa, 0x8b, 0xef, 0x71, 0x44, 0x18, 0x9c, 0x10, 0x1b, 0x21, 0x07, 0x00, 0x22, 0xe2, 0x83, 0x21, 0xf2, 0x8b, 0xef, 0x71, 0x44, 0x2a, 0x16, 0x86, 0x23, 0x22, 0x16, 0x86, 0xef, 0x6e, 0x44, 0xcd, 0x5c, 0x8b, 0x18, 0xe1, 0x10, 0xe3, 0x2a, 0x2a, 0x86, 0x3a, 0x2c, 0x86, 0xcb, 0x24, 0x17, 0xcb, 0x24, 0x17, 0xd3, 0x06, 0x37, 0xcb, 0x1c, 0xcb, 0x3c, 0x22, 0x1e, 0x86, 0xcd, 0xc0, 0x8a, 0x20, 0x19, 0x67, 0x6f, 0x22, 0x22, 0x86, 0x21, 0x00, 0x04, 0x22, 0x20, 0x86, 0x21, 0x20, 0x86, 0x22, 0x1e, 0x86, 0x21, 0x04, 0x00, 0x11, 0x07, 0x00, 0x18, 0x06, 0x21, 0x00, 0x04, 0x11, 0x06, 0x00, 0x22, 0x1c, 0x86, 0xeb, 0xcd, 0x08, 0x8b, 0x3a, 0x13, 0x86, 0xd3, 0x06, 0x38, 0x9b, 0x21, 0x02, 0x00, 0x22, 0xe2, 0x83, 0x2a, 0x18, 0x86, 0x23, 0x22, 0x18, 0x86, 0xef, 0x6e, 0x44, 0x3e, 0x4b, 0xef, 0x6b, 0x44, 0x18, 0x9d, 0xe9, 0xef, 0x8e, 0x4b, 0x48, 0x47, 0x21, 0x91, 0x01, 0xb7, 0xed, 0x42, 0xd8, 0xf3, 0x3e, 0x1c, 0xd3, 0x06, 0x21, 0x00, 0x40, 0x44, 0x4d, 0x3e, 0xf5, 0xed, 0xb1, 0x37, 0xc0, 0xe5, 0xc5, 0x11, 0xb0, 0x8a, 0x06, 0x0c, 0x1a, 0xbe, 0x20, 0x0c, 0x23, 0x13, 0x10, 0xf8, 0x23, 0x23, 0x23, 0x87, 0x06, 0x04, 0x20, 0xf0, 0xc1, 0xe1, 0x20, 0xdf, 0xed, 0x73, 0x13, 0x86, 0x2b, 0xe5, 0x21, 0xaa, 0x8a, 0x22, 0x15, 0x86, 0x21, 0x15, 0x86, 0xe5, 0x11, 0x17, 0x86, 0xef, 0xfc, 0x46, 0x21, 0xf0, 0xff, 0x39, 0xeb, 0xe1, 0x01, 0x14, 0x00, 0xc9, 0xed, 0x7b, 0x13, 0x86, 0xaf, 0xc9, 0x3e, 0x01, 0x00, 0xf3, 0x00, 0x00, 0xed, 0x56, 0xf3, 0xd3, 0x14, 0xf3, 0xf1, 0xef, 0x54, 0x80, 0x7e, 0x01, 0x00, 0x04, 0xed, 0xa1, 0xe0, 0x28, 0xfb, 0xc9, 0x21, 0x00, 0x00, 0x11, 0x26, 0x86, 0x06, 0x04, 0xcd, 0x45, 0x8b, 0xd8, 0x3a, 0x29, 0x86, 0xc6, 0xff, 0xd8, 0x3a, 0x28, 0x86, 0xb7, 0x28, 0x0b, 0x47, 0xc6, 0xbf, 0xd8, 0x11, 0x2a, 0x86, 0xcd, 0x45, 0x8b, 0xd8, 0xe5, 0x11, 0x24, 0x86, 0x06, 0x02, 0xcd, 0x45, 0x8b, 0xd1, 0xd8, 0x2a, 0x24, 0x86, 0xed, 0x52, 0xc8, 0x37, 0xc9, 0xe5, 0x21, 0x00, 0x00, 0x22, 0x1c, 0x86, 0xe1, 0x22, 0x1a, 0x86, 0x21, 0x00, 0x00, 0x11, 0x1a, 0x86, 0x01, 0x04, 0x00, 0xcd, 0x2f, 0x8b, 0xd8, 0xed, 0x5b, 0x1e, 0x86, 0xed, 0x4b, 0x1c, 0x86, 0xcd, 0x2f, 0x8b, 0xd8, 0x22, 0x24, 0x86, 0x11, 0x24, 0x86, 0x01, 0x02, 0x00, 0x18, 0x00, 0x78, 0xb1, 0xc8, 0x0b, 0xc5, 0x1a, 0x13, 0x4f, 0x06, 0x00, 0x09, 0xd5, 0xe5, 0xcd, 0xa6, 0x8b, 0xe1, 0xd1, 0xc1, 0xd8, 0x18, 0xea, 0xc5, 0xe5, 0xd5, 0xcd, 0x70, 0x8b, 0xd1, 0xe1, 0x38, 0x0b, 0x06, 0x00, 0x09, 0x79, 0x12, 0x13, 0xc1, 0x10, 0xed, 0xb7, 0xc5, 0xc1, 0xc9, 0x06, 0xff, 0xf5, 0x3e, 0x00, 0xd3, 0x00, 0xfb, 0x76, 0x76, 0x10, 0xfb, 0xf1, 0xc9, 0xdb, 0x00, 0x2f, 0xe6, 0x03, 0xc9, 0xf3, 0x3e, 0x00, 0xd3, 0x00, 0x06, 0x08, 0x16, 0xff, 0xcd, 0x96, 0x8b, 0xd8, 0xc6, 0xfe, 0x3e, 0x02, 0x30, 0x03, 0xc0, 0x3e, 0x01, 0xd3, 0x00, 0xcb, 0x19, 0x14, 0xcd, 0x96, 0x8b, 0xd8, 0x3e, 0x00, 0xd3, 0x00, 0x10, 0xe2, 0xc9, 0x21, 0xff, 0xff, 0x2b, 0xdb, 0x00, 0xaa, 0xe6, 0x03, 0xc0, 0x7c, 0xb5, 0x20, 0xf5, 0x37, 0xc9, 0xf3, 0x06, 0x08, 0xcd, 0xbc, 0x8b, 0xd8, 0xcb, 0x19, 0x3e, 0x01, 0x30, 0x02, 0x3e, 0x02, 0x14, 0xcd, 0xc0, 0x8b, 0xd8, 0x10, 0xed, 0x3e, 0x00, 0x16, 0xff, 0xd3, 0x00, 0x21, 0xff, 0xff, 0x2b, 0xdb, 0x00, 0xaa, 0xe6, 0x03, 0xc8, 0x7c, 0xb5, 0x20, 0xf5, 0x37, 0xc9, 0x44, 0x75, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0x20, 0x52, 0x4f, 0x4d, 0x2e, 0x2e, 0x2e, 0x00, 0xc1, 0x4d, 0x4f, 0x44, 0x45, 0x5d, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x3a, 0x00, 0x30, 0x4b, 0x20, 0x6f, 0x66, 0x20, 0x35, 0x31, 0x32, 0x4b, 0x00, 0x00, 0x08, 0x00, 0x2e, 0x2d, }; static unsigned int romDumpSize73 = 825; libticalcs-1.1.9+dfsg/src/rom82.h000066400000000000000000000171761327711501700165010ustar00rootroot00000000000000static unsigned char romDump82[] = { 0x2a, 0x2a, 0x54, 0x49, 0x38, 0x32, 0x2a, 0x2a, 0x1a, 0x0a, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x69, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x30, 0x2e, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x04, 0x0b, 0x00, 0xa5, 0x04, 0x03, 0x24, 0x52, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0x04, 0xa3, 0x04, 0x11, 0x65, 0x01, 0x19, 0x11, 0xa8, 0x82, 0x01, 0x06, 0x02, 0xed, 0xb0, 0x22, 0x34, 0x84, 0xed, 0x73, 0x1a, 0x82, 0x11, 0xde, 0xfc, 0x19, 0xcd, 0xa8, 0x82, 0x2a, 0x10, 0x8d, 0x22, 0x12, 0x8d, 0x2a, 0x0c, 0x8d, 0x22, 0x0e, 0x8d, 0x21, 0x08, 0x00, 0x39, 0x5e, 0x23, 0x56, 0x21, 0x06, 0x00, 0x19, 0x7e, 0x23, 0xae, 0x23, 0xae, 0xfe, 0xa1, 0x20, 0x03, 0x3e, 0x40, 0xe9, 0xe1, 0xe1, 0xe1, 0xf1, 0xd3, 0x02, 0x3e, 0x06, 0x32, 0x19, 0x82, 0xc9, 0xfd, 0xcb, 0x08, 0x9e, 0xdb, 0x02, 0x32, 0x28, 0x82, 0xcd, 0x53, 0x83, 0x21, 0x00, 0x00, 0x22, 0x2b, 0x82, 0x22, 0x2d, 0x82, 0xfd, 0xcb, 0x12, 0x86, 0xcd, 0x19, 0x84, 0x21, 0x00, 0x00, 0x22, 0x0c, 0x80, 0x21, 0x78, 0x84, 0xcd, 0x10, 0x84, 0x11, 0x04, 0x00, 0xed, 0x53, 0x0c, 0x80, 0xcd, 0x10, 0x84, 0xfb, 0x76, 0xf3, 0x21, 0x00, 0x80, 0x7e, 0x36, 0x00, 0xfe, 0x37, 0x28, 0x2f, 0xcd, 0x76, 0x83, 0x28, 0xee, 0xcd, 0xb3, 0x82, 0x38, 0x53, 0xed, 0x5b, 0x3b, 0x82, 0x21, 0x55, 0xaa, 0xb7, 0xed, 0x52, 0x28, 0x09, 0x7a, 0xb7, 0x20, 0x43, 0x43, 0x10, 0x0a, 0x18, 0xd4, 0x21, 0x01, 0x00, 0xcd, 0xe9, 0x82, 0x18, 0xcc, 0x10, 0x10, 0x21, 0x02, 0x00, 0xcd, 0xe9, 0x82, 0xcd, 0x19, 0x84, 0x21, 0x00, 0x00, 0x22, 0x0c, 0x80, 0xc9, 0x10, 0x20, 0x21, 0xaa, 0x84, 0x22, 0x33, 0x82, 0x21, 0x04, 0x00, 0x22, 0x31, 0x82, 0x21, 0x03, 0x00, 0xcd, 0xf1, 0x82, 0x21, 0x02, 0x04, 0x22, 0x0c, 0x80, 0x21, 0xa0, 0x84, 0xcd, 0x10, 0x84, 0x18, 0x98, 0x10, 0x1b, 0x21, 0x07, 0x00, 0x22, 0x0c, 0x80, 0x21, 0x98, 0x84, 0xcd, 0x10, 0x84, 0x2a, 0x2b, 0x82, 0x23, 0x22, 0x2b, 0x82, 0xcd, 0xe4, 0x83, 0xcd, 0x45, 0x83, 0x18, 0xe1, 0x10, 0xe3, 0x2a, 0x3f, 0x82, 0x3a, 0x41, 0x82, 0xcb, 0x24, 0x17, 0xcb, 0x24, 0x17, 0xe6, 0x07, 0xf6, 0x88, 0xd3, 0x02, 0x37, 0xcb, 0x1c, 0xcb, 0x3c, 0x22, 0x33, 0x82, 0xcd, 0xa9, 0x82, 0x20, 0x19, 0x67, 0x6f, 0x22, 0x37, 0x82, 0x21, 0x00, 0x04, 0x22, 0x35, 0x82, 0x21, 0x35, 0x82, 0x22, 0x33, 0x82, 0x21, 0x04, 0x00, 0x11, 0x07, 0x00, 0x18, 0x06, 0x21, 0x00, 0x04, 0x11, 0x06, 0x00, 0x22, 0x31, 0x82, 0xeb, 0xcd, 0xf1, 0x82, 0x3a, 0x28, 0x82, 0xd3, 0x02, 0x38, 0x97, 0x21, 0x02, 0x00, 0x22, 0x0c, 0x80, 0x2a, 0x2d, 0x82, 0x23, 0x22, 0x2d, 0x82, 0xcd, 0xe4, 0x83, 0x3e, 0x4b, 0xcd, 0x30, 0x84, 0x18, 0x99, 0xe9, 0x7e, 0x01, 0x00, 0x04, 0xed, 0xa1, 0xe0, 0x28, 0xfb, 0xc9, 0x21, 0x00, 0x00, 0x11, 0x3b, 0x82, 0x06, 0x04, 0xcd, 0x2e, 0x83, 0xd8, 0x3a, 0x3e, 0x82, 0xc6, 0xff, 0xd8, 0x3a, 0x3d, 0x82, 0xb7, 0x28, 0x0b, 0x47, 0xc6, 0xbf, 0xd8, 0x11, 0x3f, 0x82, 0xcd, 0x2e, 0x83, 0xd8, 0xe5, 0x11, 0x39, 0x82, 0x06, 0x02, 0xcd, 0x2e, 0x83, 0xd1, 0xd8, 0x2a, 0x39, 0x82, 0xed, 0x52, 0xc8, 0x37, 0xc9, 0xe5, 0x21, 0x00, 0x00, 0x22, 0x31, 0x82, 0xe1, 0x22, 0x2f, 0x82, 0x21, 0x00, 0x00, 0x11, 0x2f, 0x82, 0x01, 0x04, 0x00, 0xcd, 0x18, 0x83, 0xd8, 0xed, 0x5b, 0x33, 0x82, 0xed, 0x4b, 0x31, 0x82, 0xcd, 0x18, 0x83, 0xd8, 0x22, 0x39, 0x82, 0x11, 0x39, 0x82, 0x01, 0x02, 0x00, 0x18, 0x00, 0x78, 0xb1, 0xc8, 0x0b, 0xc5, 0x1a, 0x13, 0x4f, 0x06, 0x00, 0x09, 0xd5, 0xe5, 0xcd, 0xb5, 0x83, 0xe1, 0xd1, 0xc1, 0xd8, 0x18, 0xea, 0xc5, 0xe5, 0xd5, 0xcd, 0x7c, 0x83, 0xd1, 0xe1, 0x38, 0x0b, 0x06, 0x00, 0x09, 0x79, 0x12, 0x13, 0xc1, 0x10, 0xed, 0xb7, 0xc5, 0xc1, 0xc9, 0x06, 0xff, 0xf5, 0x3e, 0xc0, 0xd3, 0x00, 0xfb, 0x76, 0x76, 0x10, 0xfb, 0xf1, 0xc9, 0xf3, 0x3e, 0xc0, 0xd3, 0x00, 0x01, 0x03, 0xfe, 0x21, 0xd4, 0xe8, 0xdb, 0x00, 0xe6, 0x0c, 0x28, 0x06, 0x01, 0x0c, 0xf8, 0x21, 0xc1, 0xc2, 0x79, 0x32, 0x7a, 0x83, 0x78, 0x32, 0x8a, 0x83, 0x22, 0x29, 0x82, 0xc9, 0xdb, 0x00, 0x2f, 0xe6, 0x00, 0xc9, 0xf3, 0x3e, 0xc0, 0xd3, 0x00, 0x06, 0x08, 0x16, 0xff, 0xcd, 0xa4, 0x83, 0xd8, 0xc6, 0x00, 0x3a, 0x2a, 0x82, 0x30, 0x04, 0xc0, 0x3a, 0x29, 0x82, 0xd3, 0x00, 0xcb, 0x19, 0x14, 0xcd, 0xa4, 0x83, 0xd8, 0x3e, 0xc0, 0xd3, 0x00, 0x10, 0xe0, 0xc9, 0x21, 0xff, 0xff, 0x2b, 0xdb, 0x00, 0xaa, 0xcd, 0x79, 0x83, 0xc0, 0x7c, 0xb5, 0x20, 0xf4, 0x37, 0xc9, 0xf3, 0x06, 0x08, 0xcd, 0xcd, 0x83, 0xd8, 0xcb, 0x19, 0x3a, 0x29, 0x82, 0x30, 0x03, 0x3a, 0x2a, 0x82, 0x14, 0xcd, 0xd1, 0x83, 0xd8, 0x10, 0xeb, 0x3e, 0xc0, 0x16, 0xff, 0xd3, 0x00, 0x21, 0xff, 0xff, 0x2b, 0xdb, 0x00, 0xaa, 0xcd, 0x79, 0x83, 0xc8, 0x7c, 0xb5, 0x20, 0xf4, 0x37, 0xc9, 0x06, 0x05, 0xeb, 0x3e, 0x20, 0xcd, 0x30, 0x84, 0x10, 0xf9, 0x21, 0x0d, 0x80, 0x7e, 0xf5, 0x35, 0xeb, 0x01, 0x0a, 0x10, 0xaf, 0x29, 0x8f, 0xb9, 0x38, 0x02, 0x91, 0x2c, 0x10, 0xf7, 0xeb, 0xc6, 0x30, 0xcd, 0x30, 0x84, 0x35, 0x7a, 0xb3, 0x20, 0xe6, 0xf1, 0x77, 0xc9, 0x7e, 0x23, 0xb7, 0xc8, 0xcd, 0x30, 0x84, 0x18, 0xf7, 0x3e, 0x20, 0x4f, 0xcd, 0x6a, 0x84, 0x06, 0x40, 0xcd, 0x72, 0x84, 0xaf, 0xd3, 0x11, 0x10, 0xf8, 0x79, 0x3c, 0xfe, 0x2c, 0x38, 0xec, 0xc9, 0xe5, 0xd5, 0xc5, 0x21, 0x00, 0x00, 0x01, 0x08, 0x00, 0xbe, 0x28, 0x03, 0x09, 0x30, 0xfa, 0x23, 0xaf, 0xcd, 0x6a, 0x84, 0x11, 0x0d, 0x80, 0x1a, 0x3c, 0x12, 0x3d, 0xf6, 0x20, 0xcd, 0x6a, 0x84, 0x1b, 0x1a, 0x87, 0x87, 0x87, 0xf6, 0x80, 0xcd, 0x6a, 0x84, 0x06, 0x07, 0xcd, 0x72, 0x84, 0x7e, 0xd3, 0x11, 0x23, 0x10, 0xf7, 0xc1, 0xd1, 0xe1, 0x3e, 0x01, 0xf5, 0xcd, 0x72, 0x84, 0xf1, 0xd3, 0x10, 0xc9, 0xdb, 0x10, 0x87, 0x38, 0xfb, 0xc9, 0x44, 0x75, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0x20, 0x52, 0x4f, 0x4d, 0x2e, 0x2e, 0x2e, 0x00, 0x5b, 0x4d, 0x4f, 0x44, 0x45, 0x5d, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x3a, 0x00, 0x30, 0x4b, 0x20, 0x6f, 0x66, 0x20, 0x31, 0x32, 0x38, 0x4b, 0x00, 0x00, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x3a, 0x00, 0x0c, 0x0c, 0x00, 0x0c, 0x0c, 0x00, 0x5b, 0x0c, 0x08, 0x08, 0x08, 0x08, 0x08, 0x0c, 0x5d, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x18, 0x30, 0x1c, 0x22, 0x26, 0x2a, 0x32, 0x22, 0x1c, 0x31, 0x08, 0x18, 0x08, 0x08, 0x08, 0x08, 0x1c, 0x32, 0x1c, 0x22, 0x02, 0x04, 0x08, 0x10, 0x3e, 0x33, 0x3e, 0x04, 0x08, 0x04, 0x02, 0x22, 0x1c, 0x34, 0x04, 0x0c, 0x14, 0x24, 0x3e, 0x04, 0x04, 0x35, 0x3e, 0x20, 0x3c, 0x02, 0x02, 0x22, 0x1c, 0x36, 0x0c, 0x10, 0x20, 0x3c, 0x22, 0x22, 0x1c, 0x37, 0x3e, 0x02, 0x04, 0x08, 0x10, 0x10, 0x10, 0x38, 0x1c, 0x22, 0x22, 0x1c, 0x22, 0x22, 0x1c, 0x39, 0x1c, 0x22, 0x22, 0x1e, 0x02, 0x04, 0x18, 0x44, 0x3c, 0x22, 0x22, 0x22, 0x22, 0x22, 0x3c, 0x45, 0x3e, 0x20, 0x20, 0x3c, 0x20, 0x20, 0x3e, 0x49, 0x1c, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1c, 0x4b, 0x22, 0x24, 0x28, 0x30, 0x28, 0x24, 0x22, 0x4d, 0x22, 0x36, 0x2a, 0x2a, 0x22, 0x22, 0x22, 0x4f, 0x1c, 0x22, 0x22, 0x22, 0x22, 0x22, 0x1c, 0x52, 0x3c, 0x22, 0x22, 0x3c, 0x28, 0x24, 0x22, 0x54, 0x3e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x58, 0x22, 0x22, 0x14, 0x08, 0x14, 0x22, 0x22, 0x61, 0x00, 0x00, 0x1c, 0x02, 0x1e, 0x22, 0x1e, 0x63, 0x00, 0x00, 0x1c, 0x20, 0x20, 0x22, 0x1c, 0x65, 0x00, 0x00, 0x1c, 0x22, 0x3e, 0x20, 0x1c, 0x66, 0x0c, 0x12, 0x10, 0x38, 0x10, 0x10, 0x10, 0x67, 0x00, 0x1e, 0x22, 0x22, 0x1e, 0x02, 0x1c, 0x69, 0x08, 0x00, 0x18, 0x08, 0x08, 0x08, 0x1c, 0x6c, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1c, 0x6d, 0x00, 0x00, 0x34, 0x2a, 0x2a, 0x22, 0x22, 0x6e, 0x00, 0x00, 0x2c, 0x32, 0x22, 0x22, 0x22, 0x6f, 0x00, 0x00, 0x1c, 0x22, 0x22, 0x22, 0x1c, 0x70, 0x00, 0x00, 0x3c, 0x22, 0x3c, 0x20, 0x20, 0x72, 0x00, 0x00, 0x2c, 0x32, 0x20, 0x20, 0x20, 0x73, 0x00, 0x00, 0x1c, 0x20, 0x1c, 0x02, 0x3c, 0x74, 0x10, 0x10, 0x38, 0x10, 0x10, 0x12, 0x0c, 0x75, 0x00, 0x00, 0x22, 0x22, 0x22, 0x26, 0x1a, 0xde, 0x86, }; static unsigned int romDumpSize82 = 1261; libticalcs-1.1.9+dfsg/src/rom83.h000066400000000000000000000113041327711501700164650ustar00rootroot00000000000000static unsigned char romDump83[] = { 0x2a, 0x2a, 0x54, 0x49, 0x38, 0x33, 0x2a, 0x2a, 0x1a, 0x0a, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x69, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x30, 0x2e, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x02, 0x0b, 0x00, 0xbb, 0x02, 0x06, 0x52, 0x4f, 0x4d, 0x44, 0x55, 0x4d, 0x50, 0x00, 0xbb, 0x02, 0xb9, 0x02, 0x43, 0x44, 0x32, 0x36, 0x34, 0x34, 0x32, 0x31, 0x31, 0x39, 0x30, 0x30, 0x31, 0x39, 0x45, 0x39, 0xd4, 0x3f, 0x30, 0x30, 0x30, 0x30, 0x3f, 0x11, 0x37, 0x01, 0x19, 0x11, 0xe5, 0x82, 0x01, 0x63, 0x01, 0xed, 0xb0, 0xfd, 0xcb, 0x08, 0x9e, 0xdb, 0x02, 0x32, 0x65, 0x82, 0xdb, 0x00, 0xe6, 0x10, 0xf6, 0xc0, 0x32, 0x66, 0x82, 0x21, 0x00, 0x00, 0x22, 0x68, 0x82, 0x22, 0x6a, 0x82, 0xcd, 0x95, 0x47, 0xcd, 0x5d, 0x47, 0x21, 0x00, 0x00, 0x22, 0x0c, 0x80, 0x21, 0x12, 0x84, 0xcd, 0x0d, 0x47, 0x11, 0x04, 0x00, 0xed, 0x53, 0x0c, 0x80, 0xcd, 0x0d, 0x47, 0xfb, 0x76, 0xcd, 0x14, 0x40, 0xfe, 0x37, 0x28, 0x2f, 0xcd, 0xaa, 0x83, 0x28, 0xf2, 0xcd, 0xf0, 0x82, 0x38, 0x53, 0xed, 0x5b, 0x78, 0x82, 0x21, 0x55, 0xaa, 0xb7, 0xed, 0x52, 0x28, 0x09, 0x7a, 0xb7, 0x20, 0x43, 0x43, 0x10, 0x0a, 0x18, 0xd8, 0x21, 0x01, 0x00, 0xcd, 0x26, 0x83, 0x18, 0xd0, 0x10, 0x10, 0x21, 0x02, 0x00, 0xcd, 0x26, 0x83, 0xcd, 0x5d, 0x47, 0x21, 0x00, 0x00, 0x22, 0x0c, 0x80, 0xc9, 0x10, 0x20, 0x21, 0x44, 0x84, 0x22, 0x70, 0x82, 0x21, 0x04, 0x00, 0x22, 0x6e, 0x82, 0x21, 0x03, 0x00, 0xcd, 0x2e, 0x83, 0x21, 0x02, 0x04, 0x22, 0x0c, 0x80, 0x21, 0x3a, 0x84, 0xcd, 0x0d, 0x47, 0x18, 0x9c, 0x10, 0x1b, 0x21, 0x07, 0x00, 0x22, 0x0c, 0x80, 0x21, 0x32, 0x84, 0xcd, 0x0d, 0x47, 0x2a, 0x68, 0x82, 0x23, 0x22, 0x68, 0x82, 0xcd, 0x09, 0x47, 0xcd, 0x98, 0x83, 0x18, 0xe1, 0x10, 0xe3, 0x2a, 0x7c, 0x82, 0x3a, 0x7e, 0x82, 0xcb, 0x24, 0x17, 0xcb, 0x24, 0x17, 0xf5, 0xe6, 0x08, 0x07, 0xf6, 0xc0, 0xd3, 0x00, 0xf1, 0xe6, 0x07, 0xf6, 0x88, 0xd3, 0x02, 0x37, 0xcb, 0x1c, 0xcb, 0x3c, 0x22, 0x70, 0x82, 0xcd, 0xe6, 0x82, 0x20, 0x19, 0x67, 0x6f, 0x22, 0x74, 0x82, 0x21, 0x00, 0x04, 0x22, 0x72, 0x82, 0x21, 0x72, 0x82, 0x22, 0x70, 0x82, 0x21, 0x04, 0x00, 0x11, 0x07, 0x00, 0x18, 0x06, 0x21, 0x00, 0x04, 0x11, 0x06, 0x00, 0x22, 0x6e, 0x82, 0xeb, 0xcd, 0x2e, 0x83, 0x3a, 0x66, 0x82, 0xd3, 0x00, 0x3a, 0x65, 0x82, 0xd3, 0x02, 0x38, 0x89, 0x21, 0x02, 0x00, 0x22, 0x0c, 0x80, 0x2a, 0x6a, 0x82, 0x23, 0x22, 0x6a, 0x82, 0xcd, 0x09, 0x47, 0x3e, 0x4b, 0xcd, 0x05, 0x47, 0x18, 0x8b, 0xe9, 0x7e, 0x01, 0x00, 0x04, 0xed, 0xa1, 0xe0, 0x28, 0xfb, 0xc9, 0x21, 0x00, 0x00, 0x11, 0x78, 0x82, 0x06, 0x04, 0xcd, 0x77, 0x83, 0xd8, 0x3a, 0x7b, 0x82, 0xc6, 0xff, 0xd8, 0x3a, 0x7a, 0x82, 0xb7, 0x28, 0x0b, 0x47, 0xc6, 0xbf, 0xd8, 0x11, 0x7c, 0x82, 0xcd, 0x77, 0x83, 0xd8, 0xe5, 0x11, 0x76, 0x82, 0x06, 0x02, 0xcd, 0x77, 0x83, 0xd1, 0xd8, 0x2a, 0x76, 0x82, 0xed, 0x52, 0xc8, 0x37, 0xc9, 0xe5, 0x21, 0x00, 0x00, 0x22, 0x6e, 0x82, 0xe1, 0x22, 0x6c, 0x82, 0x21, 0x00, 0x00, 0x11, 0x6c, 0x82, 0x01, 0x04, 0x00, 0xcd, 0x55, 0x83, 0xd8, 0xed, 0x5b, 0x70, 0x82, 0xed, 0x4b, 0x6e, 0x82, 0xcd, 0x55, 0x83, 0xd8, 0x22, 0x76, 0x82, 0x11, 0x76, 0x82, 0x01, 0x02, 0x00, 0x18, 0x00, 0x78, 0xb1, 0xc8, 0x0b, 0xc5, 0xdb, 0x00, 0xe6, 0x10, 0xf6, 0xc0, 0xf5, 0x1a, 0x13, 0x4f, 0x06, 0x00, 0x09, 0xd5, 0xe5, 0xcd, 0xe6, 0x83, 0xe1, 0xd1, 0xc1, 0x0e, 0x00, 0xed, 0x41, 0xc1, 0xd8, 0x18, 0xde, 0xdb, 0x00, 0xe6, 0x10, 0xf6, 0xc0, 0x4f, 0xc5, 0xe5, 0xd5, 0xcd, 0xb0, 0x83, 0xd1, 0xe1, 0x38, 0x0b, 0x06, 0x00, 0x09, 0x79, 0x12, 0x13, 0xc1, 0x10, 0xed, 0xb7, 0xc5, 0xc1, 0x79, 0xd3, 0x00, 0xc9, 0x06, 0xff, 0xf5, 0xdb, 0x00, 0xe6, 0x10, 0xf6, 0xc0, 0xd3, 0x00, 0xfb, 0x76, 0x76, 0x10, 0xfb, 0xf1, 0xc9, 0xdb, 0x00, 0x2f, 0xe6, 0x0c, 0xc9, 0xf3, 0x3e, 0xc0, 0xd3, 0x00, 0x06, 0x08, 0x16, 0xff, 0xcd, 0xd6, 0x83, 0xd8, 0xc6, 0xf8, 0x3e, 0xc2, 0x30, 0x03, 0xc0, 0x3e, 0xc1, 0xd3, 0x00, 0xcb, 0x19, 0x14, 0xcd, 0xd6, 0x83, 0xd8, 0x3e, 0xc0, 0xd3, 0x00, 0x10, 0xe2, 0xc9, 0x21, 0xff, 0xff, 0x2b, 0xdb, 0x00, 0xaa, 0xe6, 0x0c, 0xc0, 0x7c, 0xb5, 0x20, 0xf5, 0x37, 0xc9, 0xf3, 0x06, 0x08, 0xcd, 0xfc, 0x83, 0xd8, 0xcb, 0x19, 0x3e, 0xc1, 0x30, 0x02, 0x3e, 0xc2, 0x14, 0xcd, 0x00, 0x84, 0xd8, 0x10, 0xed, 0x3e, 0xc0, 0x16, 0xff, 0xd3, 0x00, 0x21, 0xff, 0xff, 0x2b, 0xdb, 0x00, 0xaa, 0xe6, 0x0c, 0xc8, 0x7c, 0xb5, 0x20, 0xf5, 0x37, 0xc9, 0x44, 0x75, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0x20, 0x52, 0x4f, 0x4d, 0x2e, 0x2e, 0x2e, 0x00, 0xc1, 0x4d, 0x4f, 0x44, 0x45, 0x5d, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x3a, 0x00, 0x30, 0x4b, 0x20, 0x6f, 0x66, 0x20, 0x32, 0x35, 0x36, 0x4b, 0x00, 0x00, 0x04, 0x00, 0xd4, 0x3f, 0x30, 0x30, 0x30, 0x30, 0x3f, 0xd4, 0x93, 0x1b, }; static unsigned int romDumpSize83 = 771; libticalcs-1.1.9+dfsg/src/rom834pceu.h000066400000000000000000000020051327711501700174240ustar00rootroot00000000000000static unsigned char romDump834pceu[] = { 0x2a, 0x2a, 0x54, 0x49, 0x38, 0x33, 0x46, 0x2a, 0x1a, 0x0a, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x69, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x30, 0x2e, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x0d, 0x00, 0x4f, 0x00, 0x06, 0x52, 0x4f, 0x4d, 0x44, 0x55, 0x4d, 0x50, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x4d, 0x00, 0xef, 0x7b, 0x21, 0xc3, 0xa8, 0xd1, 0xcd, 0x20, 0x03, 0x02, 0xcd, 0x0c, 0x05, 0x02, 0xd4, 0x34, 0x14, 0x02, 0x21, 0x00, 0x40, 0x00, 0xe5, 0xcd, 0x34, 0x13, 0x02, 0xc1, 0x13, 0x13, 0x21, 0x00, 0x00, 0x00, 0xed, 0xb0, 0xe5, 0x21, 0xba, 0xa8, 0xd1, 0xcd, 0x20, 0x03, 0x02, 0xcd, 0x0c, 0x05, 0x02, 0xc1, 0xd8, 0x21, 0x21, 0x00, 0x00, 0x19, 0xed, 0x0f, 0xc9, 0x06, 0x52, 0x4f, 0x4d, 0x44, 0x55, 0x4d, 0x50, 0x00, 0x06, 0x52, 0x4f, 0x4d, 0x44, 0x41, 0x54, 0x41, 0x00, 0xd6, 0x1b, }; static unsigned int romDumpSize834pceu = 153; libticalcs-1.1.9+dfsg/src/rom83p.h000066400000000000000000000126141327711501700166520ustar00rootroot00000000000000static unsigned char romDump8Xp[] = { 0x2a, 0x2a, 0x54, 0x49, 0x38, 0x33, 0x46, 0x2a, 0x1a, 0x0a, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x69, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x30, 0x2e, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x03, 0x0d, 0x00, 0x2d, 0x03, 0x06, 0x52, 0x4f, 0x4d, 0x44, 0x55, 0x4d, 0x50, 0x00, 0x00, 0x00, 0x2d, 0x03, 0x2b, 0x03, 0xbb, 0x6d, 0xdb, 0x02, 0x07, 0xe6, 0x01, 0xd3, 0x20, 0xfd, 0xcb, 0x1f, 0xae, 0xfd, 0xcb, 0x08, 0x9e, 0xdb, 0x06, 0x32, 0xec, 0x86, 0xcd, 0xf1, 0x9e, 0x3a, 0xec, 0x86, 0xd3, 0x06, 0xdb, 0x02, 0x87, 0x30, 0x10, 0x3e, 0x01, 0xd3, 0x20, 0xdb, 0x21, 0xe6, 0x03, 0x3e, 0x10, 0x28, 0x01, 0x87, 0x32, 0xbc, 0xa0, 0x21, 0x00, 0x00, 0x22, 0xef, 0x86, 0x22, 0xf1, 0x86, 0xef, 0x70, 0x45, 0xef, 0x46, 0x45, 0x21, 0x00, 0x00, 0x22, 0x4b, 0x84, 0x21, 0x8c, 0xa0, 0xef, 0x0a, 0x45, 0x11, 0x04, 0x00, 0xed, 0x53, 0x4b, 0x84, 0xef, 0x0a, 0x45, 0xfb, 0x76, 0xef, 0x18, 0x40, 0xfe, 0x37, 0x28, 0x2f, 0xcd, 0x5f, 0xa0, 0x28, 0xf2, 0xcd, 0xb6, 0x9f, 0x38, 0x62, 0xed, 0x5b, 0xff, 0x86, 0x21, 0x55, 0xaa, 0xb7, 0xed, 0x52, 0x28, 0x09, 0x7a, 0xb7, 0x20, 0x52, 0x43, 0x10, 0x0a, 0x18, 0xd8, 0x21, 0x01, 0x00, 0xcd, 0xec, 0x9f, 0x18, 0xd0, 0x10, 0x10, 0x21, 0x02, 0x00, 0xcd, 0xec, 0x9f, 0xef, 0x46, 0x45, 0x21, 0x00, 0x00, 0x22, 0x4b, 0x84, 0xc9, 0x10, 0x2f, 0x21, 0xba, 0xa0, 0x22, 0xf7, 0x86, 0x21, 0x04, 0x00, 0x22, 0xf5, 0x86, 0x21, 0x03, 0x00, 0xcd, 0xf4, 0x9f, 0x21, 0x02, 0x04, 0x22, 0x4b, 0x84, 0x21, 0xb4, 0xa0, 0xef, 0x0a, 0x45, 0x2a, 0xbb, 0xa0, 0xcb, 0x3c, 0xcb, 0x3c, 0xef, 0x07, 0x45, 0x3e, 0x4b, 0xef, 0x04, 0x45, 0x18, 0x8d, 0x10, 0x1b, 0x21, 0x07, 0x00, 0x22, 0x4b, 0x84, 0x21, 0xac, 0xa0, 0xef, 0x0a, 0x45, 0x2a, 0xef, 0x86, 0x23, 0x22, 0xef, 0x86, 0xef, 0x07, 0x45, 0xcd, 0x48, 0xa0, 0x18, 0xe1, 0x10, 0xe3, 0x2a, 0x03, 0x87, 0x3a, 0x05, 0x87, 0xcb, 0x24, 0x17, 0xcb, 0x24, 0x17, 0xd3, 0x06, 0x37, 0xcb, 0x1c, 0xcb, 0x3c, 0x22, 0xf7, 0x86, 0xcd, 0xac, 0x9f, 0x20, 0x19, 0x67, 0x6f, 0x22, 0xfb, 0x86, 0x21, 0x00, 0x04, 0x22, 0xf9, 0x86, 0x21, 0xf9, 0x86, 0x22, 0xf7, 0x86, 0x21, 0x04, 0x00, 0x11, 0x07, 0x00, 0x18, 0x06, 0x21, 0x00, 0x04, 0x11, 0x06, 0x00, 0x22, 0xf5, 0x86, 0xeb, 0xcd, 0xf4, 0x9f, 0x3a, 0xec, 0x86, 0xd3, 0x06, 0x38, 0x9b, 0x21, 0x02, 0x00, 0x22, 0x4b, 0x84, 0x2a, 0xf1, 0x86, 0x23, 0x22, 0xf1, 0x86, 0xef, 0x07, 0x45, 0x3e, 0x4b, 0xef, 0x04, 0x45, 0x18, 0x9d, 0xe9, 0x01, 0x13, 0x01, 0x01, 0x01, 0x13, 0x01, 0x00, 0x02, 0x37, 0x01, 0x03, 0x02, 0x37, 0x01, 0x03, 0x02, 0x38, 0x01, 0x03, 0xef, 0x6f, 0x4c, 0x4f, 0xef, 0xba, 0x80, 0x6f, 0xc6, 0xfc, 0xd8, 0x3c, 0x20, 0x05, 0xcb, 0x40, 0x20, 0x01, 0x2c, 0x26, 0x00, 0x29, 0x29, 0x11, 0xdd, 0x9e, 0x19, 0x79, 0xcd, 0xa5, 0x9f, 0xd8, 0x23, 0xef, 0xb7, 0x80, 0xcd, 0xa5, 0x9f, 0xd8, 0xf3, 0xfd, 0xe5, 0x11, 0x09, 0x7b, 0x7b, 0x32, 0xee, 0x83, 0xd3, 0x06, 0x1a, 0x47, 0xc5, 0xd5, 0xcd, 0x91, 0x9f, 0x7b, 0xef, 0xc6, 0x80, 0x21, 0x80, 0x9f, 0x11, 0x38, 0x98, 0xef, 0xda, 0x47, 0xed, 0x73, 0x3c, 0x98, 0xcd, 0x44, 0x9f, 0xf1, 0xc1, 0x18, 0x4a, 0x3a, 0x94, 0x50, 0x57, 0x21, 0x00, 0x81, 0x01, 0x30, 0x01, 0x3e, 0xed, 0xed, 0xb1, 0xc0, 0x7e, 0xd6, 0xa0, 0x20, 0xf6, 0x4e, 0x47, 0x23, 0x22, 0xdb, 0x84, 0x2a, 0x92, 0x50, 0x3c, 0x32, 0x34, 0x98, 0xb7, 0xc4, 0x91, 0x9f, 0x3e, 0x3a, 0xed, 0xb1, 0xc0, 0x11, 0x63, 0x9f, 0x1a, 0xbe, 0x20, 0xf4, 0x23, 0x13, 0xfe, 0xc4, 0x20, 0xf6, 0xef, 0x09, 0x40, 0xfd, 0x21, 0x31, 0x00, 0xe9, 0x31, 0x00, 0x00, 0xe1, 0xf1, 0x77, 0xbe, 0x20, 0xfd, 0x36, 0xf0, 0xfd, 0xe1, 0xc9, 0xdb, 0x02, 0x87, 0x3e, 0x1f, 0x30, 0x09, 0xdb, 0x21, 0xe6, 0x03, 0x3e, 0x7f, 0x20, 0x01, 0x1f, 0xa2, 0xd3, 0x06, 0xc9, 0xbe, 0x23, 0x3f, 0xc0, 0x7e, 0xb8, 0xc9, 0x7e, 0x01, 0x00, 0x04, 0xed, 0xa1, 0xe0, 0x28, 0xfb, 0xc9, 0x21, 0x00, 0x00, 0x11, 0xff, 0x86, 0x06, 0x04, 0xcd, 0x31, 0xa0, 0xd8, 0x3a, 0x02, 0x87, 0xc6, 0xff, 0xd8, 0x3a, 0x01, 0x87, 0xb7, 0x28, 0x0b, 0x47, 0xc6, 0xbf, 0xd8, 0x11, 0x03, 0x87, 0xcd, 0x31, 0xa0, 0xd8, 0xe5, 0x11, 0xfd, 0x86, 0x06, 0x02, 0xcd, 0x31, 0xa0, 0xd1, 0xd8, 0x2a, 0xfd, 0x86, 0xed, 0x52, 0xc8, 0x37, 0xc9, 0xe5, 0x21, 0x00, 0x00, 0x22, 0xf5, 0x86, 0xe1, 0x22, 0xf3, 0x86, 0x21, 0x00, 0x00, 0x11, 0xf3, 0x86, 0x01, 0x04, 0x00, 0xcd, 0x1b, 0xa0, 0xd8, 0xed, 0x5b, 0xf7, 0x86, 0xed, 0x4b, 0xf5, 0x86, 0xcd, 0x1b, 0xa0, 0xd8, 0x22, 0xfd, 0x86, 0x11, 0xfd, 0x86, 0x01, 0x02, 0x00, 0x18, 0x00, 0x78, 0xb1, 0xc8, 0x0b, 0xc5, 0x1a, 0x13, 0x4f, 0x06, 0x00, 0x09, 0xd5, 0xe5, 0xcd, 0x7b, 0xa0, 0xe1, 0xd1, 0xc1, 0xd8, 0x18, 0xea, 0xc5, 0xe5, 0xd5, 0xcd, 0x6f, 0xa0, 0xd1, 0xe1, 0x38, 0x0b, 0x06, 0x00, 0x09, 0x79, 0x12, 0x13, 0xc1, 0x10, 0xed, 0xb7, 0xc5, 0xc1, 0xc9, 0x06, 0xff, 0xf5, 0xdb, 0x02, 0xe6, 0x80, 0xd3, 0x08, 0x3e, 0x00, 0xd3, 0x00, 0xfb, 0x76, 0x76, 0x10, 0xfb, 0xaf, 0xd3, 0x08, 0xf1, 0xc9, 0xdb, 0x00, 0x2f, 0xe6, 0x03, 0xc0, 0xdb, 0x02, 0xe6, 0x80, 0xc8, 0xdb, 0x09, 0xe6, 0x18, 0xc9, 0x21, 0x8a, 0xa0, 0xcd, 0x59, 0x00, 0xef, 0x03, 0x4f, 0x57, 0x18, 0x09, 0x21, 0x8a, 0xa0, 0xcd, 0x59, 0x00, 0xef, 0xe5, 0x4e, 0xcd, 0x5c, 0x00, 0x4a, 0xb7, 0xc9, 0x37, 0xc9, 0x44, 0x75, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0x20, 0x52, 0x4f, 0x4d, 0x2e, 0x2e, 0x2e, 0x00, 0xc1, 0x4d, 0x4f, 0x44, 0x45, 0x5d, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x3a, 0x00, 0x30, 0x4b, 0x20, 0x6f, 0x66, 0x20, 0x00, 0x00, 0x08, 0x00, 0x66, 0x5b, }; static unsigned int romDumpSize8Xp = 887; libticalcs-1.1.9+dfsg/src/rom84p.h000066400000000000000000000224551327711501700166570ustar00rootroot00000000000000static unsigned char romDump84p[] = { 0x2a, 0x2a, 0x54, 0x49, 0x38, 0x33, 0x46, 0x2a, 0x1a, 0x0a, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x69, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x30, 0x2e, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcb, 0x05, 0x0d, 0x00, 0xba, 0x05, 0x06, 0x52, 0x4f, 0x4d, 0x44, 0x55, 0x4d, 0x50, 0x00, 0x00, 0x00, 0xba, 0x05, 0xb8, 0x05, 0xbb, 0x6d, 0xef, 0x70, 0x45, 0xdb, 0x06, 0xf5, 0xcd, 0x90, 0xa2, 0xf1, 0xd3, 0x06, 0xed, 0x73, 0x72, 0x98, 0xcd, 0xc2, 0x9d, 0xcd, 0xe7, 0xa0, 0x30, 0x20, 0xcd, 0x57, 0xa0, 0x30, 0x1b, 0xed, 0x7b, 0x72, 0x98, 0xcd, 0xc2, 0x9d, 0x21, 0x2c, 0x9f, 0xef, 0x0a, 0x45, 0xef, 0x72, 0x49, 0xef, 0x40, 0x45, 0xef, 0x58, 0x45, 0xfd, 0xcb, 0x09, 0xa6, 0xc9, 0x21, 0xd5, 0x9e, 0xef, 0x0a, 0x45, 0xfd, 0xcb, 0x41, 0xae, 0x21, 0x00, 0x80, 0xcd, 0x0e, 0xa0, 0x38, 0xd3, 0x2a, 0x00, 0x80, 0x11, 0x02, 0x00, 0xef, 0x0c, 0x40, 0x28, 0x1a, 0x11, 0x03, 0x00, 0xef, 0x0c, 0x40, 0x28, 0x1d, 0x11, 0x05, 0x00, 0xef, 0x0c, 0x40, 0x28, 0x4c, 0x11, 0x55, 0xaa, 0xef, 0x0c, 0x40, 0x28, 0x36, 0x18, 0xd3, 0x11, 0x02, 0x00, 0x01, 0x00, 0x00, 0xcd, 0xa2, 0x9f, 0x18, 0xb3, 0x21, 0x74, 0x98, 0x36, 0x00, 0x23, 0x36, 0x00, 0x23, 0xdb, 0x21, 0xe6, 0x03, 0x3e, 0x10, 0x28, 0x01, 0x87, 0x77, 0x23, 0x36, 0x00, 0x3e, 0x81, 0x21, 0x74, 0x58, 0x11, 0x03, 0x00, 0x01, 0x04, 0x00, 0xcd, 0xa2, 0x9f, 0xda, 0xb2, 0x9d, 0x18, 0x9f, 0x11, 0x01, 0x00, 0x01, 0x00, 0x00, 0xcd, 0xa2, 0x9f, 0xda, 0xb2, 0x9d, 0x18, 0x91, 0xdd, 0x21, 0x04, 0x80, 0xdd, 0x6e, 0x00, 0xdd, 0x66, 0x01, 0xdd, 0x5e, 0x02, 0xdd, 0x56, 0x03, 0x01, 0x02, 0x04, 0xed, 0x43, 0x4b, 0x84, 0x7b, 0xcd, 0x30, 0xa0, 0x7c, 0xcd, 0x30, 0xa0, 0x7d, 0xcd, 0x30, 0xa0, 0x7b, 0x87, 0x87, 0x11, 0x00, 0x40, 0xb7, 0xed, 0x52, 0x38, 0x03, 0x3c, 0x18, 0xf5, 0x19, 0x11, 0x00, 0x40, 0x19, 0xe5, 0x32, 0xeb, 0x83, 0xdb, 0x06, 0xf5, 0x3a, 0xeb, 0x83, 0xd3, 0x06, 0x56, 0x01, 0x00, 0x04, 0x7e, 0xba, 0x20, 0x06, 0x23, 0x0b, 0x78, 0xb1, 0x20, 0xf6, 0xc1, 0x78, 0xd3, 0x06, 0xe1, 0x28, 0x12, 0x3a, 0xeb, 0x83, 0x11, 0x06, 0x00, 0x01, 0x00, 0x04, 0xcd, 0xa2, 0x9f, 0xda, 0xb2, 0x9d, 0xc3, 0xd7, 0x9d, 0xdd, 0x21, 0x78, 0x84, 0xdd, 0x36, 0x00, 0x00, 0xdd, 0x36, 0x01, 0x04, 0xdd, 0x72, 0x02, 0xdd, 0x72, 0x03, 0x3e, 0x81, 0x21, 0x78, 0x44, 0x11, 0x07, 0x00, 0x01, 0x04, 0x00, 0xcd, 0xa2, 0x9f, 0xda, 0xb2, 0x9d, 0xc3, 0xd7, 0x9d, 0x44, 0x75, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0xce, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x72, 0x65, 0x73, 0x73, 0x20, 0xc1, 0x4f, 0x4e, 0x5d, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x20, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x2e, 0x00, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x20, 0x20, 0x20, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x55, 0x53, 0x42, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 0x71, 0x75, 0x69, 0x74, 0x2e, 0x00, 0xf3, 0xc5, 0x32, 0xeb, 0x83, 0xdb, 0x06, 0xf5, 0x3e, 0x83, 0xd3, 0x06, 0xe5, 0x21, 0x00, 0x40, 0x73, 0x23, 0x72, 0x23, 0x71, 0x23, 0x70, 0x23, 0xeb, 0xe1, 0x78, 0xb1, 0x28, 0x25, 0xc5, 0x3a, 0xeb, 0x83, 0xd3, 0x06, 0x7e, 0xf5, 0x3e, 0x83, 0xd3, 0x06, 0xf1, 0x12, 0x23, 0xcb, 0x7c, 0x28, 0x0b, 0xcb, 0xbc, 0xcb, 0xf4, 0x3a, 0xeb, 0x83, 0x3c, 0x32, 0xeb, 0x83, 0x13, 0x0b, 0x78, 0xb1, 0x20, 0xdd, 0xc1, 0x03, 0x03, 0x03, 0x03, 0x21, 0x00, 0x40, 0x11, 0x00, 0x00, 0x7e, 0x23, 0x83, 0x5f, 0x30, 0x01, 0x14, 0x0b, 0x78, 0xb1, 0x20, 0xf4, 0x73, 0x23, 0x72, 0xf1, 0xd3, 0x06, 0xd1, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x21, 0x00, 0x80, 0xc3, 0xfa, 0xa0, 0x01, 0x04, 0x00, 0xe5, 0xcd, 0x0a, 0xa1, 0xe1, 0xd8, 0x23, 0x23, 0x4e, 0x23, 0x46, 0x23, 0x78, 0xb1, 0x28, 0x09, 0xe5, 0xc5, 0xcd, 0x0a, 0xa1, 0xc1, 0xe1, 0xd8, 0x09, 0x01, 0x02, 0x00, 0xc3, 0x0a, 0xa1, 0xdd, 0xe5, 0xf5, 0xe5, 0xc5, 0xf5, 0x0f, 0x0f, 0x0f, 0x0f, 0xcd, 0x47, 0xa0, 0xf1, 0xcd, 0x47, 0xa0, 0xc1, 0xe1, 0xf1, 0xdd, 0xe1, 0xc9, 0xe6, 0x0f, 0xfe, 0x0a, 0x30, 0x04, 0xc6, 0x30, 0x18, 0x02, 0xc6, 0x37, 0xef, 0x04, 0x45, 0xc9, 0xef, 0x0e, 0x81, 0xd8, 0x3e, 0x80, 0xd3, 0x57, 0xaf, 0xd3, 0x4c, 0x3e, 0x01, 0xd3, 0x5b, 0xaf, 0xdb, 0x4c, 0x3e, 0x02, 0xd3, 0x54, 0x3e, 0x20, 0xd3, 0x4a, 0xaf, 0xd3, 0x4b, 0xdb, 0x3a, 0xcb, 0x5f, 0x28, 0x04, 0x3e, 0x20, 0xd3, 0x4b, 0xaf, 0xd3, 0x54, 0x3e, 0x42, 0xd3, 0x36, 0xaf, 0xd3, 0x37, 0x3e, 0x01, 0xd3, 0x38, 0xdb, 0x04, 0xcb, 0x7f, 0x28, 0xfa, 0xdb, 0x3a, 0xcb, 0x5f, 0x28, 0x04, 0x3e, 0x44, 0xd3, 0x54, 0x3e, 0xc4, 0xd3, 0x54, 0x3e, 0x08, 0xd3, 0x4c, 0x11, 0xff, 0xff, 0x1b, 0x7a, 0xb3, 0x37, 0xc8, 0xdb, 0x4c, 0xfe, 0x1a, 0x28, 0x04, 0xfe, 0x5a, 0x20, 0xf1, 0x3e, 0xff, 0xd3, 0x87, 0xaf, 0xd3, 0x92, 0xdb, 0x87, 0x3e, 0x0e, 0xd3, 0x89, 0x3e, 0x05, 0xd3, 0x8b, 0xdb, 0x81, 0xf6, 0x00, 0xd3, 0x81, 0xdb, 0x54, 0xf6, 0x01, 0xd3, 0x54, 0x06, 0x05, 0x11, 0xff, 0xff, 0x1b, 0x7a, 0xb3, 0x28, 0x06, 0xdb, 0x8c, 0xb7, 0x28, 0xf6, 0xc9, 0x10, 0xf0, 0x37, 0xc9, 0xdb, 0x02, 0xcb, 0x6f, 0x37, 0xc8, 0x3a, 0x4d, 0x00, 0xb7, 0xcb, 0x6f, 0xc8, 0xcb, 0x77, 0x37, 0xc0, 0x3f, 0xc9, 0xfd, 0xcb, 0x40, 0xd6, 0xfd, 0xcb, 0x43, 0x86, 0xef, 0xf2, 0x50, 0xfd, 0xcb, 0x41, 0x86, 0xc9, 0xfb, 0x76, 0xdb, 0x04, 0xcb, 0x5f, 0x37, 0xc8, 0xfd, 0xcb, 0x41, 0x6e, 0x28, 0xf2, 0xc5, 0xf5, 0xaf, 0x32, 0x34, 0x98, 0x18, 0x28, 0xdb, 0x04, 0xcb, 0x5f, 0x28, 0x47, 0xfd, 0xcb, 0x41, 0x6e, 0x20, 0x1c, 0xdb, 0x84, 0xcb, 0x57, 0x20, 0x04, 0xcb, 0x4f, 0x28, 0x0a, 0xfd, 0xcb, 0x41, 0xee, 0xaf, 0x32, 0x27, 0x9c, 0x18, 0x08, 0xdb, 0x86, 0xcb, 0x6f, 0x20, 0x27, 0x18, 0xd8, 0xc5, 0xe5, 0x21, 0x40, 0x00, 0xb7, 0xed, 0x42, 0xe1, 0x41, 0x30, 0x02, 0x06, 0x40, 0xcd, 0x71, 0xa1, 0xeb, 0xe1, 0x38, 0x10, 0xb7, 0x06, 0x00, 0xed, 0x42, 0x28, 0x05, 0x44, 0x4d, 0xeb, 0x18, 0xb7, 0xc1, 0x78, 0xc1, 0xc9, 0xf1, 0xc1, 0x37, 0xc9, 0x78, 0xb7, 0xc8, 0x3e, 0x40, 0xb8, 0xd8, 0x78, 0x32, 0x80, 0x9c, 0x3a, 0x27, 0x9c, 0xb7, 0x28, 0x07, 0xb8, 0x30, 0x04, 0x47, 0x32, 0x80, 0x9c, 0xdb, 0x8f, 0xcb, 0x57, 0xca, 0x27, 0xa2, 0xaf, 0xd3, 0x5b, 0x3a, 0x27, 0x9c, 0xb7, 0x20, 0x3d, 0x3e, 0x01, 0xd3, 0x8e, 0x3e, 0x21, 0xd3, 0x9a, 0xaf, 0xdb, 0x9a, 0x3e, 0x08, 0xd3, 0x93, 0xaf, 0xdb, 0x93, 0x3e, 0xff, 0xd3, 0x89, 0xaf, 0xd3, 0x95, 0xdb, 0x89, 0x3e, 0xa1, 0xd3, 0x8b, 0xdb, 0x94, 0xcb, 0x57, 0xc2, 0x6d, 0xa2, 0xcb, 0x77, 0xc2, 0x6d, 0xa2, 0x3e, 0x01, 0xd3, 0x5b, 0x3a, 0x27, 0x9c, 0xb7, 0x20, 0x08, 0x3e, 0x01, 0xd3, 0x8e, 0xdb, 0x94, 0xdb, 0x96, 0xf5, 0x3a, 0x80, 0x9c, 0x47, 0x0e, 0x00, 0xdb, 0xa1, 0x77, 0x23, 0x0c, 0x10, 0xf9, 0x3e, 0x01, 0xd3, 0x8e, 0xdb, 0x94, 0xcb, 0x57, 0x20, 0x7e, 0xcb, 0x77, 0x20, 0x7a, 0xf1, 0x91, 0x32, 0x27, 0x9c, 0xfd, 0xcb, 0x41, 0xee, 0xc0, 0x3e, 0x01, 0xd3, 0x8e, 0x3e, 0x21, 0xd3, 0x9a, 0x3e, 0x08, 0xd3, 0x93, 0xaf, 0xdb, 0x93, 0x3e, 0x0e, 0xd3, 0x89, 0xaf, 0xd3, 0x95, 0xfd, 0xcb, 0x41, 0xae, 0xaf, 0x32, 0x27, 0x9c, 0xfd, 0xcb, 0x41, 0x86, 0x3e, 0x20, 0xd3, 0x94, 0x3e, 0x01, 0xd3, 0x5b, 0xc9, 0x3e, 0x02, 0xd3, 0x8e, 0xdb, 0x94, 0xcb, 0x77, 0x28, 0x0a, 0xe6, 0xdf, 0xd3, 0x94, 0xf1, 0xef, 0x57, 0x52, 0x18, 0x32, 0x3a, 0x27, 0x9c, 0xb7, 0x20, 0x02, 0xdb, 0x96, 0xf5, 0x0e, 0x00, 0xdb, 0xa2, 0x77, 0x23, 0x0c, 0x10, 0xf9, 0x3e, 0x02, 0xd3, 0x8e, 0xf1, 0x91, 0x32, 0x27, 0x9c, 0xc0, 0xaf, 0x32, 0x27, 0x9c, 0xdb, 0x94, 0xe6, 0xfe, 0xd3, 0x94, 0xfd, 0xcb, 0x41, 0xae, 0x3e, 0xa1, 0x32, 0x8b, 0x00, 0x18, 0x06, 0xf1, 0xfd, 0xcb, 0x41, 0xae, 0x37, 0xfb, 0x3e, 0x01, 0xd3, 0x5b, 0xfd, 0xcb, 0x41, 0x86, 0xc9, 0x01, 0x13, 0x01, 0x01, 0x01, 0x13, 0x01, 0x00, 0x02, 0x37, 0x01, 0x03, 0x02, 0x37, 0x01, 0x03, 0x02, 0x38, 0x01, 0x03, 0xef, 0x6f, 0x4c, 0x4f, 0xef, 0xba, 0x80, 0x6f, 0xc6, 0xfc, 0xd8, 0x3c, 0x20, 0x05, 0xcb, 0x40, 0x20, 0x01, 0x2c, 0x26, 0x00, 0x29, 0x29, 0x11, 0x7c, 0xa2, 0x19, 0x79, 0xcd, 0x44, 0xa3, 0xd8, 0x23, 0xef, 0xb7, 0x80, 0xcd, 0x44, 0xa3, 0xd8, 0xf3, 0xfd, 0xe5, 0x11, 0x09, 0x7b, 0x7b, 0x32, 0xee, 0x83, 0xd3, 0x06, 0x1a, 0x47, 0xc5, 0xd5, 0xcd, 0x30, 0xa3, 0x7b, 0xef, 0xc6, 0x80, 0x21, 0x1f, 0xa3, 0x11, 0x38, 0x98, 0xef, 0xda, 0x47, 0xed, 0x73, 0x3c, 0x98, 0xcd, 0xe3, 0xa2, 0xf1, 0xc1, 0x18, 0x4a, 0x3a, 0x94, 0x50, 0x57, 0x21, 0x00, 0x81, 0x01, 0x30, 0x01, 0x3e, 0xed, 0xed, 0xb1, 0xc0, 0x7e, 0xd6, 0xa0, 0x20, 0xf6, 0x4e, 0x47, 0x23, 0x22, 0xdb, 0x84, 0x2a, 0x92, 0x50, 0x3c, 0x32, 0x34, 0x98, 0xb7, 0xc4, 0x30, 0xa3, 0x3e, 0x3a, 0xed, 0xb1, 0xc0, 0x11, 0x02, 0xa3, 0x1a, 0xbe, 0x20, 0xf4, 0x23, 0x13, 0xfe, 0xc4, 0x20, 0xf6, 0xef, 0x09, 0x40, 0xfd, 0x21, 0x31, 0x00, 0xe9, 0x31, 0x00, 0x00, 0xe1, 0xf1, 0x77, 0xbe, 0x20, 0xfd, 0x36, 0xf0, 0xfd, 0xe1, 0xc9, 0xdb, 0x02, 0x87, 0x3e, 0x1f, 0x30, 0x09, 0xdb, 0x21, 0xe6, 0x03, 0x3e, 0x7f, 0x20, 0x01, 0x1f, 0xa2, 0xd3, 0x06, 0xc9, 0xbe, 0x23, 0x3f, 0xc0, 0x7e, 0xb8, 0xc9, 0x6f, 0x6d, }; static unsigned int romDumpSize84p = 1540; libticalcs-1.1.9+dfsg/src/rom84pc.h000066400000000000000000000077571327711501700170320ustar00rootroot00000000000000static unsigned char romDump84pc[] = { 0x2a, 0x2a, 0x54, 0x49, 0x38, 0x33, 0x46, 0x2a, 0x1a, 0x0a, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x69, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x30, 0x2e, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x02, 0x0d, 0x00, 0x42, 0x02, 0x06, 0x52, 0x4f, 0x4d, 0x44, 0x55, 0x4d, 0x50, 0x00, 0x00, 0x00, 0x42, 0x02, 0x40, 0x02, 0xef, 0x69, 0x3e, 0x01, 0xd3, 0x20, 0xfd, 0xcb, 0x0d, 0x8e, 0xfd, 0xcb, 0x1f, 0xae, 0xfd, 0xcb, 0x08, 0x9e, 0xdb, 0x06, 0x32, 0x98, 0x87, 0xdb, 0x0e, 0x32, 0x99, 0x87, 0x21, 0x00, 0x00, 0x22, 0x9b, 0x87, 0x22, 0x9d, 0x87, 0xef, 0x67, 0x45, 0xef, 0x3d, 0x45, 0x21, 0x00, 0x00, 0x22, 0x59, 0x84, 0x21, 0x12, 0xa8, 0xef, 0x01, 0x45, 0x11, 0x04, 0x00, 0xed, 0x53, 0x59, 0x84, 0xef, 0x01, 0x45, 0xfb, 0x76, 0xef, 0x18, 0x40, 0xfe, 0x37, 0x28, 0x2f, 0xcd, 0xea, 0xa7, 0x28, 0xf2, 0xcd, 0x41, 0xa7, 0x38, 0x53, 0xed, 0x5b, 0xab, 0x87, 0x21, 0x55, 0xaa, 0xb7, 0xed, 0x52, 0x28, 0x09, 0x7a, 0xb7, 0x20, 0x43, 0x43, 0x10, 0x0a, 0x18, 0xd8, 0x21, 0x01, 0x00, 0xcd, 0x77, 0xa7, 0x18, 0xd0, 0x10, 0x10, 0x21, 0x02, 0x00, 0xcd, 0x77, 0xa7, 0xef, 0x3d, 0x45, 0x21, 0x00, 0x00, 0x22, 0x59, 0x84, 0xc9, 0x10, 0x20, 0x21, 0x45, 0xa8, 0x22, 0xa3, 0x87, 0x21, 0x04, 0x00, 0x22, 0xa1, 0x87, 0x21, 0x03, 0x00, 0xcd, 0x7f, 0xa7, 0x21, 0x02, 0x04, 0x22, 0x59, 0x84, 0x21, 0x3a, 0xa8, 0xef, 0x01, 0x45, 0x18, 0x9c, 0x10, 0x1b, 0x21, 0x07, 0x00, 0x22, 0x59, 0x84, 0x21, 0x32, 0xa8, 0xef, 0x01, 0x45, 0x2a, 0x9b, 0x87, 0x23, 0x22, 0x9b, 0x87, 0xef, 0xfe, 0x44, 0xcd, 0xd3, 0xa7, 0x18, 0xe1, 0x10, 0xe3, 0x2a, 0xaf, 0x87, 0x3a, 0xb1, 0x87, 0xcb, 0x24, 0x17, 0xcb, 0x24, 0x17, 0x07, 0xd3, 0x0e, 0xcb, 0x3f, 0xd3, 0x06, 0x37, 0xcb, 0x1c, 0xcb, 0x3c, 0x22, 0xa3, 0x87, 0xcd, 0x37, 0xa7, 0x20, 0x19, 0x67, 0x6f, 0x22, 0xa7, 0x87, 0x21, 0x00, 0x04, 0x22, 0xa5, 0x87, 0x21, 0xa5, 0x87, 0x22, 0xa3, 0x87, 0x21, 0x04, 0x00, 0x11, 0x07, 0x00, 0x18, 0x06, 0x21, 0x00, 0x04, 0x11, 0x06, 0x00, 0x22, 0xa1, 0x87, 0xeb, 0xcd, 0x7f, 0xa7, 0x3a, 0x99, 0x87, 0xd3, 0x0e, 0x3a, 0x98, 0x87, 0xd3, 0x06, 0x38, 0x91, 0x21, 0x02, 0x00, 0x22, 0x59, 0x84, 0x2a, 0x9d, 0x87, 0x23, 0x22, 0x9d, 0x87, 0xef, 0xfe, 0x44, 0x3e, 0x4b, 0xef, 0xfb, 0x44, 0x18, 0x93, 0xe9, 0x7e, 0x01, 0x00, 0x04, 0xed, 0xa1, 0xe0, 0x28, 0xfb, 0xc9, 0x21, 0x00, 0x00, 0x11, 0xab, 0x87, 0x06, 0x04, 0xcd, 0xbc, 0xa7, 0xd8, 0x3a, 0xae, 0x87, 0xc6, 0xff, 0xd8, 0x3a, 0xad, 0x87, 0xb7, 0x28, 0x0b, 0x47, 0xc6, 0xbf, 0xd8, 0x11, 0xaf, 0x87, 0xcd, 0xbc, 0xa7, 0xd8, 0xe5, 0x11, 0xa9, 0x87, 0x06, 0x02, 0xcd, 0xbc, 0xa7, 0xd1, 0xd8, 0x2a, 0xa9, 0x87, 0xed, 0x52, 0xc8, 0x37, 0xc9, 0xe5, 0x21, 0x00, 0x00, 0x22, 0xa1, 0x87, 0xe1, 0x22, 0x9f, 0x87, 0x21, 0x00, 0x00, 0x11, 0x9f, 0x87, 0x01, 0x04, 0x00, 0xcd, 0xa6, 0xa7, 0xd8, 0xed, 0x5b, 0xa3, 0x87, 0xed, 0x4b, 0xa1, 0x87, 0xcd, 0xa6, 0xa7, 0xd8, 0x22, 0xa9, 0x87, 0x11, 0xa9, 0x87, 0x01, 0x02, 0x00, 0x18, 0x00, 0x78, 0xb1, 0xc8, 0x0b, 0xc5, 0x1a, 0x13, 0x4f, 0x06, 0x00, 0x09, 0xd5, 0xe5, 0xcd, 0x01, 0xa8, 0xe1, 0xd1, 0xc1, 0xd8, 0x18, 0xea, 0xc5, 0xe5, 0xd5, 0xcd, 0xf5, 0xa7, 0xd1, 0xe1, 0x38, 0x0b, 0x06, 0x00, 0x09, 0x79, 0x12, 0x13, 0xc1, 0x10, 0xed, 0xb7, 0xc5, 0xc1, 0xc9, 0x06, 0xff, 0xf5, 0xdb, 0x02, 0xe6, 0x80, 0xd3, 0x08, 0x3e, 0x00, 0xd3, 0x00, 0xfb, 0x76, 0x76, 0x10, 0xfb, 0xaf, 0xd3, 0x08, 0xf1, 0xc9, 0xdb, 0x00, 0x2f, 0xe6, 0x03, 0xc0, 0xdb, 0x09, 0xe6, 0x18, 0xc9, 0x21, 0x10, 0xa8, 0xcd, 0x59, 0x00, 0xef, 0xe8, 0x4e, 0x57, 0x18, 0x09, 0x21, 0x10, 0xa8, 0xcd, 0x59, 0x00, 0xef, 0xca, 0x4e, 0xcd, 0x5c, 0x00, 0x4a, 0xb7, 0xc9, 0x37, 0xc9, 0x44, 0x75, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0x20, 0x52, 0x4f, 0x4d, 0x2e, 0x2e, 0x2e, 0x00, 0xc1, 0x4d, 0x4f, 0x44, 0x45, 0x5d, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x3a, 0x00, 0x30, 0x4b, 0x20, 0x6f, 0x66, 0x20, 0x34, 0x30, 0x39, 0x36, 0x4b, 0x00, 0x00, 0x40, 0x00, 0x8e, 0xf0, }; static unsigned int romDumpSize84pc = 652; libticalcs-1.1.9+dfsg/src/rom84pcu.h000066400000000000000000000202311327711501700171750ustar00rootroot00000000000000static unsigned char romDump84pcu[] = { 0x2a, 0x2a, 0x54, 0x49, 0x38, 0x33, 0x46, 0x2a, 0x1a, 0x0a, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x69, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x30, 0x2e, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x05, 0x0d, 0x00, 0xfa, 0x04, 0x06, 0x52, 0x4f, 0x4d, 0x44, 0x55, 0x4d, 0x50, 0x00, 0x00, 0x00, 0xfa, 0x04, 0xf8, 0x04, 0xef, 0x69, 0xfd, 0xcb, 0x0d, 0x8e, 0x3e, 0x01, 0xd3, 0x20, 0xef, 0x67, 0x45, 0xed, 0x73, 0xb0, 0xa0, 0xcd, 0x37, 0xa6, 0xcd, 0x6c, 0xa9, 0x30, 0x20, 0xcd, 0xdc, 0xa8, 0x30, 0x1b, 0xed, 0x7b, 0xb0, 0xa0, 0xcd, 0x37, 0xa6, 0x21, 0xa5, 0xa7, 0xef, 0x01, 0x45, 0xef, 0x5d, 0x49, 0xef, 0x37, 0x45, 0xef, 0x4f, 0x45, 0xfd, 0xcb, 0x09, 0xa6, 0xc9, 0x21, 0x4e, 0xa7, 0xef, 0x01, 0x45, 0xfd, 0xcb, 0x41, 0xae, 0x21, 0x00, 0x80, 0xcd, 0x93, 0xa8, 0x38, 0xd3, 0x2a, 0x00, 0x80, 0x11, 0x02, 0x00, 0xef, 0x0c, 0x40, 0x28, 0x1a, 0x11, 0x03, 0x00, 0xef, 0x0c, 0x40, 0x28, 0x1d, 0x11, 0x05, 0x00, 0xef, 0x0c, 0x40, 0x28, 0x44, 0x11, 0x55, 0xaa, 0xef, 0x0c, 0x40, 0x28, 0x2e, 0x18, 0xd3, 0x11, 0x02, 0x00, 0x01, 0x00, 0x00, 0xcd, 0x1e, 0xa8, 0x18, 0xb3, 0x21, 0xb2, 0xa0, 0x36, 0x00, 0x23, 0x36, 0x00, 0x23, 0x36, 0x40, 0x23, 0x36, 0x00, 0x3e, 0x81, 0x21, 0xb2, 0x60, 0x11, 0x03, 0x00, 0x01, 0x04, 0x00, 0xcd, 0x1e, 0xa8, 0xda, 0x27, 0xa6, 0x18, 0xa7, 0x11, 0x01, 0x00, 0x01, 0x00, 0x00, 0xcd, 0x1e, 0xa8, 0xda, 0x27, 0xa6, 0x18, 0x99, 0xdd, 0x21, 0x04, 0x80, 0xdd, 0x6e, 0x00, 0xdd, 0x66, 0x01, 0xdd, 0x5e, 0x02, 0xdd, 0x56, 0x03, 0x01, 0x02, 0x04, 0xed, 0x43, 0x59, 0x84, 0x7b, 0xcd, 0xb5, 0xa8, 0x7c, 0xcd, 0xb5, 0xa8, 0x7d, 0xcd, 0xb5, 0xa8, 0x7b, 0x87, 0x87, 0x11, 0x00, 0x40, 0xb7, 0xed, 0x52, 0x38, 0x03, 0x3c, 0x18, 0xf5, 0x19, 0x11, 0x00, 0x40, 0x19, 0xe5, 0x32, 0xe2, 0xa0, 0xdb, 0x0e, 0xf5, 0xdb, 0x06, 0xf5, 0x3a, 0xe2, 0xa0, 0x07, 0xd3, 0x0e, 0xcb, 0x3f, 0xd3, 0x06, 0x56, 0x01, 0x00, 0x04, 0x7e, 0xba, 0x20, 0x06, 0x23, 0x0b, 0x78, 0xb1, 0x20, 0xf6, 0xc1, 0x78, 0xd3, 0x06, 0xc1, 0x78, 0xd3, 0x0e, 0xe1, 0x28, 0x12, 0x3a, 0xe2, 0xa0, 0x11, 0x06, 0x00, 0x01, 0x00, 0x04, 0xcd, 0x1b, 0xa8, 0xda, 0x27, 0xa6, 0xc3, 0x4c, 0xa6, 0xdd, 0x21, 0xae, 0x84, 0xdd, 0x36, 0x00, 0x00, 0xdd, 0x36, 0x01, 0x04, 0xdd, 0x72, 0x02, 0xdd, 0x72, 0x03, 0x3e, 0x81, 0x21, 0xae, 0x44, 0x11, 0x07, 0x00, 0x01, 0x04, 0x00, 0xcd, 0x1e, 0xa8, 0xda, 0x27, 0xa6, 0xc3, 0x4c, 0xa6, 0x44, 0x75, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0xce, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x72, 0x65, 0x73, 0x73, 0x20, 0xc1, 0x4f, 0x4e, 0x5d, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x20, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x2e, 0x00, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x20, 0x20, 0x20, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x55, 0x53, 0x42, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 0x71, 0x75, 0x69, 0x74, 0x2e, 0x00, 0x07, 0xcb, 0x3f, 0xf3, 0xc5, 0x32, 0xe2, 0xa0, 0xdb, 0x0e, 0xf5, 0xdb, 0x06, 0xf5, 0x9f, 0xd3, 0x0e, 0x3e, 0x83, 0xd3, 0x06, 0xe5, 0x21, 0x00, 0x40, 0x73, 0x23, 0x72, 0x23, 0x71, 0x23, 0x70, 0x23, 0xeb, 0xe1, 0x78, 0xb1, 0x28, 0x25, 0xc5, 0x3a, 0xe2, 0xa0, 0xd3, 0x06, 0x7e, 0xf5, 0x3e, 0x83, 0xd3, 0x06, 0xf1, 0x12, 0x23, 0xcb, 0x7c, 0x28, 0x0b, 0xcb, 0xbc, 0xcb, 0xf4, 0x3a, 0xe2, 0xa0, 0x3c, 0x32, 0xe2, 0xa0, 0x13, 0x0b, 0x78, 0xb1, 0x20, 0xdd, 0xc1, 0x03, 0x03, 0x03, 0x03, 0x21, 0x00, 0x40, 0x11, 0x00, 0x00, 0x7e, 0x23, 0x83, 0x5f, 0x30, 0x01, 0x14, 0x0b, 0x78, 0xb1, 0x20, 0xf4, 0x73, 0x23, 0x72, 0xf1, 0xd3, 0x06, 0xf1, 0xd3, 0x0e, 0xd1, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x21, 0x00, 0x80, 0xc3, 0x7f, 0xa9, 0x01, 0x04, 0x00, 0xe5, 0xcd, 0x8f, 0xa9, 0xe1, 0xd8, 0x23, 0x23, 0x4e, 0x23, 0x46, 0x23, 0x78, 0xb1, 0x28, 0x09, 0xe5, 0xc5, 0xcd, 0x8f, 0xa9, 0xc1, 0xe1, 0xd8, 0x09, 0x01, 0x02, 0x00, 0xc3, 0x8f, 0xa9, 0xdd, 0xe5, 0xf5, 0xe5, 0xc5, 0xf5, 0x0f, 0x0f, 0x0f, 0x0f, 0xcd, 0xcc, 0xa8, 0xf1, 0xcd, 0xcc, 0xa8, 0xc1, 0xe1, 0xf1, 0xdd, 0xe1, 0xc9, 0xe6, 0x0f, 0xfe, 0x0a, 0x30, 0x04, 0xc6, 0x30, 0x18, 0x02, 0xc6, 0x37, 0xef, 0xfb, 0x44, 0xc9, 0xef, 0x0e, 0x81, 0xd8, 0x3e, 0x80, 0xd3, 0x57, 0xaf, 0xd3, 0x4c, 0x3e, 0x01, 0xd3, 0x5b, 0xaf, 0xdb, 0x4c, 0x3e, 0x02, 0xd3, 0x54, 0x3e, 0x20, 0xd3, 0x4a, 0xaf, 0xd3, 0x4b, 0xdb, 0x3a, 0xcb, 0x5f, 0x28, 0x04, 0x3e, 0x20, 0xd3, 0x4b, 0xaf, 0xd3, 0x54, 0x3e, 0x42, 0xd3, 0x36, 0xaf, 0xd3, 0x37, 0x3e, 0x01, 0xd3, 0x38, 0xdb, 0x04, 0xcb, 0x7f, 0x28, 0xfa, 0xdb, 0x3a, 0xcb, 0x5f, 0x28, 0x04, 0x3e, 0x44, 0xd3, 0x54, 0x3e, 0xc4, 0xd3, 0x54, 0x3e, 0x08, 0xd3, 0x4c, 0x11, 0xff, 0xff, 0x1b, 0x7a, 0xb3, 0x37, 0xc8, 0xdb, 0x4c, 0xfe, 0x1a, 0x28, 0x04, 0xfe, 0x5a, 0x20, 0xf1, 0x3e, 0xff, 0xd3, 0x87, 0xaf, 0xd3, 0x92, 0xdb, 0x87, 0x3e, 0x0e, 0xd3, 0x89, 0x3e, 0x05, 0xd3, 0x8b, 0xdb, 0x81, 0xf6, 0x00, 0xd3, 0x81, 0xdb, 0x54, 0xf6, 0x01, 0xd3, 0x54, 0x06, 0x05, 0x11, 0xff, 0xff, 0x1b, 0x7a, 0xb3, 0x28, 0x06, 0xdb, 0x8c, 0xb7, 0x28, 0xf6, 0xc9, 0x10, 0xf0, 0x37, 0xc9, 0xdb, 0x02, 0xcb, 0x6f, 0x37, 0xc8, 0x3a, 0x4d, 0x00, 0xb7, 0xcb, 0x6f, 0xc8, 0xcb, 0x77, 0x37, 0xc0, 0x3f, 0xc9, 0xfd, 0xcb, 0x40, 0xd6, 0xfd, 0xcb, 0x43, 0x86, 0xef, 0xd4, 0x50, 0xfd, 0xcb, 0x41, 0x86, 0xc9, 0xfb, 0x76, 0xdb, 0x04, 0xcb, 0x5f, 0x37, 0xc8, 0xfd, 0xcb, 0x41, 0x6e, 0x28, 0xf2, 0xc5, 0xf5, 0xaf, 0x32, 0x15, 0x9e, 0x18, 0x28, 0xdb, 0x04, 0xcb, 0x5f, 0x28, 0x47, 0xfd, 0xcb, 0x41, 0x6e, 0x20, 0x1c, 0xdb, 0x84, 0xcb, 0x57, 0x20, 0x04, 0xcb, 0x4f, 0x28, 0x0a, 0xfd, 0xcb, 0x41, 0xee, 0xaf, 0x32, 0x08, 0x9f, 0x18, 0x08, 0xdb, 0x86, 0xcb, 0x6f, 0x20, 0x27, 0x18, 0xd8, 0xc5, 0xe5, 0x21, 0x40, 0x00, 0xb7, 0xed, 0x42, 0xe1, 0x41, 0x30, 0x02, 0x06, 0x40, 0xcd, 0xf6, 0xa9, 0xeb, 0xe1, 0x38, 0x10, 0xb7, 0x06, 0x00, 0xed, 0x42, 0x28, 0x05, 0x44, 0x4d, 0xeb, 0x18, 0xb7, 0xc1, 0x78, 0xc1, 0xc9, 0xf1, 0xc1, 0x37, 0xc9, 0x78, 0xb7, 0xc8, 0x3e, 0x40, 0xb8, 0xd8, 0x78, 0x32, 0x61, 0x9f, 0x3a, 0x08, 0x9f, 0xb7, 0x28, 0x07, 0xb8, 0x30, 0x04, 0x47, 0x32, 0x61, 0x9f, 0xdb, 0x8f, 0xcb, 0x57, 0xca, 0xac, 0xaa, 0xaf, 0xd3, 0x5b, 0x3a, 0x08, 0x9f, 0xb7, 0x20, 0x3d, 0x3e, 0x01, 0xd3, 0x8e, 0x3e, 0x21, 0xd3, 0x9a, 0xaf, 0xdb, 0x9a, 0x3e, 0x08, 0xd3, 0x93, 0xaf, 0xdb, 0x93, 0x3e, 0xff, 0xd3, 0x89, 0xaf, 0xd3, 0x95, 0xdb, 0x89, 0x3e, 0xa1, 0xd3, 0x8b, 0xdb, 0x94, 0xcb, 0x57, 0xc2, 0xf2, 0xaa, 0xcb, 0x77, 0xc2, 0xf2, 0xaa, 0x3e, 0x01, 0xd3, 0x5b, 0x3a, 0x08, 0x9f, 0xb7, 0x20, 0x08, 0x3e, 0x01, 0xd3, 0x8e, 0xdb, 0x94, 0xdb, 0x96, 0xf5, 0x3a, 0x61, 0x9f, 0x47, 0x0e, 0x00, 0xdb, 0xa1, 0x77, 0x23, 0x0c, 0x10, 0xf9, 0x3e, 0x01, 0xd3, 0x8e, 0xdb, 0x94, 0xcb, 0x57, 0x20, 0x7e, 0xcb, 0x77, 0x20, 0x7a, 0xf1, 0x91, 0x32, 0x08, 0x9f, 0xfd, 0xcb, 0x41, 0xee, 0xc0, 0x3e, 0x01, 0xd3, 0x8e, 0x3e, 0x21, 0xd3, 0x9a, 0x3e, 0x08, 0xd3, 0x93, 0xaf, 0xdb, 0x93, 0x3e, 0x0e, 0xd3, 0x89, 0xaf, 0xd3, 0x95, 0xfd, 0xcb, 0x41, 0xae, 0xaf, 0x32, 0x08, 0x9f, 0xfd, 0xcb, 0x41, 0x86, 0x3e, 0x20, 0xd3, 0x94, 0x3e, 0x01, 0xd3, 0x5b, 0xc9, 0x3e, 0x02, 0xd3, 0x8e, 0xdb, 0x94, 0xcb, 0x77, 0x28, 0x0a, 0xe6, 0xdf, 0xd3, 0x94, 0xf1, 0xef, 0x36, 0x52, 0x18, 0x32, 0x3a, 0x08, 0x9f, 0xb7, 0x20, 0x02, 0xdb, 0x96, 0xf5, 0x0e, 0x00, 0xdb, 0xa2, 0x77, 0x23, 0x0c, 0x10, 0xf9, 0x3e, 0x02, 0xd3, 0x8e, 0xf1, 0x91, 0x32, 0x08, 0x9f, 0xc0, 0xaf, 0x32, 0x08, 0x9f, 0xdb, 0x94, 0xe6, 0xfe, 0xd3, 0x94, 0xfd, 0xcb, 0x41, 0xae, 0x3e, 0xa1, 0x32, 0x8b, 0x00, 0x18, 0x06, 0xf1, 0xfd, 0xcb, 0x41, 0xae, 0x37, 0xfb, 0x3e, 0x01, 0xd3, 0x5b, 0xfd, 0xcb, 0x41, 0x86, 0xc9, 0xe3, 0x1d, }; static unsigned int romDumpSize84pcu = 1348; libticalcs-1.1.9+dfsg/src/rom85.h000066400000000000000000000165671327711501700165070ustar00rootroot00000000000000static unsigned char romDump85[] = { 0x2a, 0x2a, 0x54, 0x49, 0x38, 0x35, 0x2a, 0x2a, 0x1a, 0x0c, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x69, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x30, 0x2e, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x04, 0x07, 0x00, 0x7e, 0x04, 0x0c, 0x03, 0x24, 0x52, 0x44, 0x7e, 0x04, 0x7c, 0x04, 0x11, 0x43, 0x01, 0x19, 0x11, 0xc1, 0x86, 0x01, 0x01, 0x02, 0xed, 0xb0, 0x22, 0x1a, 0x88, 0x11, 0xea, 0xfc, 0x19, 0xcd, 0xc1, 0x86, 0x2a, 0xe3, 0x8b, 0x22, 0xe5, 0x8b, 0x2a, 0xdf, 0x8b, 0x22, 0xe1, 0x8b, 0xe1, 0xe1, 0xe1, 0xf1, 0xd3, 0x05, 0x3e, 0x06, 0x32, 0x37, 0x83, 0xc9, 0xfd, 0xcb, 0x08, 0x9e, 0xdb, 0x05, 0x32, 0x41, 0x86, 0x21, 0x00, 0x00, 0x22, 0x44, 0x86, 0x22, 0x46, 0x86, 0xfd, 0xcb, 0x12, 0x86, 0xcd, 0x09, 0x88, 0x21, 0x00, 0x00, 0x22, 0x0c, 0x80, 0x21, 0x8c, 0x88, 0xcd, 0x00, 0x88, 0x11, 0x04, 0x00, 0xed, 0x53, 0x0c, 0x80, 0xcd, 0x00, 0x88, 0xfb, 0x76, 0xf3, 0x21, 0x00, 0x80, 0x7e, 0x36, 0x00, 0xfe, 0x37, 0x28, 0x2f, 0xcd, 0x6c, 0x87, 0x28, 0xee, 0xcd, 0xcc, 0x86, 0x38, 0x53, 0xed, 0x5b, 0x54, 0x86, 0x21, 0x55, 0xaa, 0xb7, 0xed, 0x52, 0x28, 0x09, 0x7a, 0xb7, 0x20, 0x43, 0x43, 0x10, 0x0a, 0x18, 0xd4, 0x21, 0x01, 0x00, 0xcd, 0x02, 0x87, 0x18, 0xcc, 0x10, 0x10, 0x21, 0x02, 0x00, 0xcd, 0x02, 0x87, 0xcd, 0x09, 0x88, 0x21, 0x00, 0x00, 0x22, 0x0c, 0x80, 0xc9, 0x10, 0x20, 0x21, 0xbe, 0x88, 0x22, 0x4c, 0x86, 0x21, 0x04, 0x00, 0x22, 0x4a, 0x86, 0x21, 0x03, 0x00, 0xcd, 0x0a, 0x87, 0x21, 0x02, 0x04, 0x22, 0x0c, 0x80, 0x21, 0xb4, 0x88, 0xcd, 0x00, 0x88, 0x18, 0x98, 0x10, 0x1b, 0x21, 0x07, 0x00, 0x22, 0x0c, 0x80, 0x21, 0xac, 0x88, 0xcd, 0x00, 0x88, 0x2a, 0x44, 0x86, 0x23, 0x22, 0x44, 0x86, 0xcd, 0xd4, 0x87, 0xcd, 0x5e, 0x87, 0x18, 0xe1, 0x10, 0xe3, 0x2a, 0x58, 0x86, 0x3a, 0x5a, 0x86, 0xcb, 0x24, 0x17, 0xcb, 0x24, 0x17, 0xd3, 0x05, 0x37, 0xcb, 0x1c, 0xcb, 0x3c, 0x22, 0x4c, 0x86, 0xcd, 0xc2, 0x86, 0x20, 0x19, 0x67, 0x6f, 0x22, 0x50, 0x86, 0x21, 0x00, 0x04, 0x22, 0x4e, 0x86, 0x21, 0x4e, 0x86, 0x22, 0x4c, 0x86, 0x21, 0x04, 0x00, 0x11, 0x07, 0x00, 0x18, 0x06, 0x21, 0x00, 0x04, 0x11, 0x06, 0x00, 0x22, 0x4a, 0x86, 0xeb, 0xcd, 0x0a, 0x87, 0x3a, 0x41, 0x86, 0xd3, 0x05, 0x38, 0x9b, 0x21, 0x02, 0x00, 0x22, 0x0c, 0x80, 0x2a, 0x46, 0x86, 0x23, 0x22, 0x46, 0x86, 0xcd, 0xd4, 0x87, 0x3e, 0x4b, 0xcd, 0x16, 0x88, 0x18, 0x9d, 0xe9, 0x7e, 0x01, 0x00, 0x04, 0xed, 0xa1, 0xe0, 0x28, 0xfb, 0xc9, 0x21, 0x00, 0x00, 0x11, 0x54, 0x86, 0x06, 0x04, 0xcd, 0x47, 0x87, 0xd8, 0x3a, 0x57, 0x86, 0xc6, 0xff, 0xd8, 0x3a, 0x56, 0x86, 0xb7, 0x28, 0x0b, 0x47, 0xc6, 0xbf, 0xd8, 0x11, 0x58, 0x86, 0xcd, 0x47, 0x87, 0xd8, 0xe5, 0x11, 0x52, 0x86, 0x06, 0x02, 0xcd, 0x47, 0x87, 0xd1, 0xd8, 0x2a, 0x52, 0x86, 0xed, 0x52, 0xc8, 0x37, 0xc9, 0xe5, 0x21, 0x00, 0x00, 0x22, 0x4a, 0x86, 0xe1, 0x22, 0x48, 0x86, 0x21, 0x00, 0x00, 0x11, 0x48, 0x86, 0x01, 0x04, 0x00, 0xcd, 0x31, 0x87, 0xd8, 0xed, 0x5b, 0x4c, 0x86, 0xed, 0x4b, 0x4a, 0x86, 0xcd, 0x31, 0x87, 0xd8, 0x22, 0x52, 0x86, 0x11, 0x52, 0x86, 0x01, 0x02, 0x00, 0x18, 0x00, 0x78, 0xb1, 0xc8, 0x0b, 0xc5, 0x1a, 0x13, 0x4f, 0x06, 0x00, 0x09, 0xd5, 0xe5, 0xcd, 0xa8, 0x87, 0xe1, 0xd1, 0xc1, 0xd8, 0x18, 0xea, 0xc5, 0xe5, 0xd5, 0xcd, 0x72, 0x87, 0xd1, 0xe1, 0x38, 0x0b, 0x06, 0x00, 0x09, 0x79, 0x12, 0x13, 0xc1, 0x10, 0xed, 0xb7, 0xc5, 0xc1, 0xc9, 0x06, 0xff, 0xf5, 0x3e, 0xc0, 0xd3, 0x07, 0xfb, 0x76, 0x76, 0x10, 0xfb, 0xf1, 0xc9, 0xdb, 0x07, 0x2f, 0xe6, 0x03, 0xc9, 0xf3, 0x3e, 0xc0, 0xd3, 0x07, 0x06, 0x08, 0x16, 0xff, 0xcd, 0x98, 0x87, 0xd8, 0xc6, 0xfe, 0x3e, 0xe8, 0x30, 0x03, 0xc0, 0x3e, 0xd4, 0xd3, 0x07, 0xcb, 0x19, 0x14, 0xcd, 0x98, 0x87, 0xd8, 0x3e, 0xc0, 0xd3, 0x07, 0x10, 0xe2, 0xc9, 0x21, 0xff, 0xff, 0x2b, 0xdb, 0x07, 0xaa, 0xe6, 0x03, 0xc0, 0x7c, 0xb5, 0x20, 0xf5, 0x37, 0xc9, 0xf3, 0x06, 0x08, 0xcd, 0xbe, 0x87, 0xd8, 0xcb, 0x19, 0x3e, 0xd4, 0x30, 0x02, 0x3e, 0xe8, 0x14, 0xcd, 0xc2, 0x87, 0xd8, 0x10, 0xed, 0x3e, 0xc0, 0x16, 0xff, 0xd3, 0x07, 0x21, 0xff, 0xff, 0x2b, 0xdb, 0x07, 0xaa, 0xe6, 0x03, 0xc8, 0x7c, 0xb5, 0x20, 0xf5, 0x37, 0xc9, 0x06, 0x05, 0xeb, 0x3e, 0x20, 0xcd, 0x16, 0x88, 0x10, 0xf9, 0x21, 0x0d, 0x80, 0x7e, 0xf5, 0x35, 0xeb, 0x01, 0x0a, 0x10, 0xaf, 0x29, 0x8f, 0xb9, 0x38, 0x02, 0x91, 0x2c, 0x10, 0xf7, 0xeb, 0xc6, 0x30, 0xcd, 0x16, 0x88, 0x35, 0x7a, 0xb3, 0x20, 0xe6, 0xf1, 0x77, 0xc9, 0x7e, 0x23, 0xb7, 0xc8, 0xcd, 0x16, 0x88, 0x18, 0xf7, 0x21, 0x00, 0xfc, 0x75, 0x11, 0x01, 0xfc, 0x01, 0xff, 0x03, 0xed, 0xb0, 0xc9, 0xe5, 0xd5, 0xc5, 0x21, 0x00, 0x00, 0x01, 0x08, 0x00, 0xbe, 0x28, 0x03, 0x09, 0x30, 0xfa, 0x23, 0x01, 0x0c, 0x80, 0x0a, 0x0f, 0x5f, 0xf6, 0xfc, 0x57, 0x03, 0x0a, 0x3c, 0x02, 0x3d, 0x47, 0x87, 0x80, 0x0f, 0x0f, 0xab, 0xe6, 0x1f, 0xab, 0x5f, 0x06, 0x07, 0x3a, 0x0d, 0x80, 0xe6, 0x03, 0x28, 0x19, 0x3d, 0x28, 0x1c, 0x3d, 0x7e, 0x0f, 0x0f, 0x28, 0x20, 0x4f, 0x1c, 0x1a, 0xa9, 0xe6, 0x3f, 0xa9, 0x12, 0x1d, 0x1a, 0xa9, 0xe6, 0xf0, 0xa9, 0x18, 0x20, 0x1a, 0xe6, 0xc0, 0xb6, 0x18, 0x1a, 0x7e, 0x07, 0x07, 0x4f, 0x1a, 0xe6, 0x03, 0xb1, 0x18, 0x10, 0x0f, 0x0f, 0x4f, 0x1c, 0x1a, 0xa9, 0xe6, 0x0f, 0xa9, 0x12, 0x1d, 0x1a, 0xa9, 0xe6, 0xfc, 0xa9, 0x12, 0x23, 0x7b, 0xc6, 0x10, 0x5f, 0x10, 0xb8, 0xc1, 0xd1, 0xe1, 0xc9, 0x44, 0x75, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0x20, 0x52, 0x4f, 0x4d, 0x2e, 0x2e, 0x2e, 0x00, 0x5b, 0x45, 0x58, 0x49, 0x54, 0x5d, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x3a, 0x00, 0x30, 0x4b, 0x20, 0x6f, 0x66, 0x20, 0x31, 0x32, 0x38, 0x4b, 0x00, 0x00, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x3a, 0x00, 0x0c, 0x0c, 0x00, 0x0c, 0x0c, 0x00, 0x5b, 0x0c, 0x08, 0x08, 0x08, 0x08, 0x08, 0x0c, 0x5d, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x18, 0x30, 0x1c, 0x22, 0x26, 0x2a, 0x32, 0x22, 0x1c, 0x31, 0x08, 0x18, 0x08, 0x08, 0x08, 0x08, 0x1c, 0x32, 0x1c, 0x22, 0x02, 0x04, 0x08, 0x10, 0x3e, 0x33, 0x3e, 0x04, 0x08, 0x04, 0x02, 0x22, 0x1c, 0x34, 0x04, 0x0c, 0x14, 0x24, 0x3e, 0x04, 0x04, 0x35, 0x3e, 0x20, 0x3c, 0x02, 0x02, 0x22, 0x1c, 0x36, 0x0c, 0x10, 0x20, 0x3c, 0x22, 0x22, 0x1c, 0x37, 0x3e, 0x02, 0x04, 0x08, 0x10, 0x10, 0x10, 0x38, 0x1c, 0x22, 0x22, 0x1c, 0x22, 0x22, 0x1c, 0x39, 0x1c, 0x22, 0x22, 0x1e, 0x02, 0x04, 0x18, 0x44, 0x3c, 0x22, 0x22, 0x22, 0x22, 0x22, 0x3c, 0x45, 0x3e, 0x20, 0x20, 0x3c, 0x20, 0x20, 0x3e, 0x49, 0x1c, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1c, 0x4b, 0x22, 0x24, 0x28, 0x30, 0x28, 0x24, 0x22, 0x4d, 0x22, 0x36, 0x2a, 0x2a, 0x22, 0x22, 0x22, 0x4f, 0x1c, 0x22, 0x22, 0x22, 0x22, 0x22, 0x1c, 0x52, 0x3c, 0x22, 0x22, 0x3c, 0x28, 0x24, 0x22, 0x54, 0x3e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x58, 0x22, 0x22, 0x14, 0x08, 0x14, 0x22, 0x22, 0x61, 0x00, 0x00, 0x1c, 0x02, 0x1e, 0x22, 0x1e, 0x63, 0x00, 0x00, 0x1c, 0x20, 0x20, 0x22, 0x1c, 0x65, 0x00, 0x00, 0x1c, 0x22, 0x3e, 0x20, 0x1c, 0x66, 0x0c, 0x12, 0x10, 0x38, 0x10, 0x10, 0x10, 0x67, 0x00, 0x1e, 0x22, 0x22, 0x1e, 0x02, 0x1c, 0x69, 0x08, 0x00, 0x18, 0x08, 0x08, 0x08, 0x1c, 0x6c, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1c, 0x6d, 0x00, 0x00, 0x34, 0x2a, 0x2a, 0x22, 0x22, 0x6e, 0x00, 0x00, 0x2c, 0x32, 0x22, 0x22, 0x22, 0x6f, 0x00, 0x00, 0x1c, 0x22, 0x22, 0x22, 0x1c, 0x70, 0x00, 0x00, 0x3c, 0x22, 0x3c, 0x20, 0x20, 0x72, 0x00, 0x00, 0x2c, 0x32, 0x20, 0x20, 0x20, 0x73, 0x00, 0x00, 0x1c, 0x20, 0x1c, 0x02, 0x3c, 0x74, 0x10, 0x10, 0x38, 0x10, 0x10, 0x12, 0x0c, 0x75, 0x00, 0x00, 0x22, 0x22, 0x22, 0x26, 0x1a, 0x99, 0x72, }; static unsigned int romDumpSize85 = 1218; libticalcs-1.1.9+dfsg/src/rom86.h000066400000000000000000000102571327711501700164760ustar00rootroot00000000000000static unsigned char romDump86[] = { 0x2a, 0x2a, 0x54, 0x49, 0x38, 0x36, 0x2a, 0x2a, 0x1a, 0x0a, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x69, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x30, 0x2e, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x02, 0x0c, 0x00, 0x63, 0x02, 0x12, 0x07, 0x52, 0x4f, 0x4d, 0x44, 0x75, 0x6d, 0x70, 0x20, 0x63, 0x02, 0x61, 0x02, 0x8e, 0x28, 0xfd, 0xcb, 0x15, 0xbe, 0xfd, 0xcb, 0x08, 0x9e, 0xdb, 0x05, 0x32, 0x00, 0x90, 0x21, 0x00, 0x00, 0x22, 0x03, 0x90, 0x22, 0x05, 0x90, 0xcd, 0xb1, 0x4a, 0xcd, 0x82, 0x4a, 0x21, 0x00, 0x00, 0x22, 0x0f, 0xc0, 0x21, 0x71, 0xd9, 0xcd, 0x37, 0x4a, 0x11, 0x04, 0x00, 0xed, 0x53, 0x0f, 0xc0, 0xcd, 0x37, 0x4a, 0xfb, 0x76, 0xcd, 0x68, 0x40, 0xfe, 0x37, 0x28, 0x2f, 0xcd, 0x09, 0xd9, 0x28, 0xf2, 0xcd, 0x69, 0xd8, 0x38, 0x53, 0xed, 0x5b, 0x13, 0x90, 0x21, 0x55, 0xaa, 0xb7, 0xed, 0x52, 0x28, 0x09, 0x7a, 0xb7, 0x20, 0x43, 0x43, 0x10, 0x0a, 0x18, 0xd8, 0x21, 0x01, 0x00, 0xcd, 0x9f, 0xd8, 0x18, 0xd0, 0x10, 0x10, 0x21, 0x02, 0x00, 0xcd, 0x9f, 0xd8, 0xcd, 0x82, 0x4a, 0x21, 0x00, 0x00, 0x22, 0x0f, 0xc0, 0xc9, 0x10, 0x20, 0x21, 0xa3, 0xd9, 0x22, 0x0b, 0x90, 0x21, 0x04, 0x00, 0x22, 0x09, 0x90, 0x21, 0x03, 0x00, 0xcd, 0xa7, 0xd8, 0x21, 0x02, 0x04, 0x22, 0x0f, 0xc0, 0x21, 0x99, 0xd9, 0xcd, 0x37, 0x4a, 0x18, 0x9c, 0x10, 0x1c, 0x21, 0x07, 0x00, 0x22, 0x0f, 0xc0, 0x21, 0x91, 0xd9, 0xcd, 0x37, 0x4a, 0x2a, 0x03, 0x90, 0x23, 0x22, 0x03, 0x90, 0xaf, 0xcd, 0x33, 0x4a, 0xcd, 0xfb, 0xd8, 0x18, 0xe0, 0x10, 0xe2, 0x2a, 0x17, 0x90, 0x3a, 0x19, 0x90, 0xcb, 0x24, 0x17, 0xcb, 0x24, 0x17, 0xd3, 0x05, 0x37, 0xcb, 0x1c, 0xcb, 0x3c, 0x22, 0x0b, 0x90, 0xcd, 0x5f, 0xd8, 0x20, 0x19, 0x67, 0x6f, 0x22, 0x0f, 0x90, 0x21, 0x00, 0x04, 0x22, 0x0d, 0x90, 0x21, 0x0d, 0x90, 0x22, 0x0b, 0x90, 0x21, 0x04, 0x00, 0x11, 0x07, 0x00, 0x18, 0x06, 0x21, 0x00, 0x04, 0x11, 0x06, 0x00, 0x22, 0x09, 0x90, 0xeb, 0xcd, 0xa7, 0xd8, 0x3a, 0x00, 0x90, 0xd3, 0x05, 0x38, 0x9a, 0x21, 0x02, 0x00, 0x22, 0x0f, 0xc0, 0x2a, 0x05, 0x90, 0x23, 0x22, 0x05, 0x90, 0xaf, 0xcd, 0x33, 0x4a, 0x3e, 0x4b, 0xcd, 0x2b, 0x4a, 0x18, 0x9c, 0xe9, 0x7e, 0x01, 0x00, 0x04, 0xed, 0xa1, 0xe0, 0x28, 0xfb, 0xc9, 0x21, 0x00, 0x00, 0x11, 0x13, 0x90, 0x06, 0x04, 0xcd, 0xe4, 0xd8, 0xd8, 0x3a, 0x16, 0x90, 0xc6, 0xff, 0xd8, 0x3a, 0x15, 0x90, 0xb7, 0x28, 0x0b, 0x47, 0xc6, 0xbf, 0xd8, 0x11, 0x17, 0x90, 0xcd, 0xe4, 0xd8, 0xd8, 0xe5, 0x11, 0x11, 0x90, 0x06, 0x02, 0xcd, 0xe4, 0xd8, 0xd1, 0xd8, 0x2a, 0x11, 0x90, 0xed, 0x52, 0xc8, 0x37, 0xc9, 0xe5, 0x21, 0x00, 0x00, 0x22, 0x09, 0x90, 0xe1, 0x22, 0x07, 0x90, 0x21, 0x00, 0x00, 0x11, 0x07, 0x90, 0x01, 0x04, 0x00, 0xcd, 0xce, 0xd8, 0xd8, 0xed, 0x5b, 0x0b, 0x90, 0xed, 0x4b, 0x09, 0x90, 0xcd, 0xce, 0xd8, 0xd8, 0x22, 0x11, 0x90, 0x11, 0x11, 0x90, 0x01, 0x02, 0x00, 0x18, 0x00, 0x78, 0xb1, 0xc8, 0x0b, 0xc5, 0x1a, 0x13, 0x4f, 0x06, 0x00, 0x09, 0xd5, 0xe5, 0xcd, 0x45, 0xd9, 0xe1, 0xd1, 0xc1, 0xd8, 0x18, 0xea, 0xc5, 0xe5, 0xd5, 0xcd, 0x0f, 0xd9, 0xd1, 0xe1, 0x38, 0x0b, 0x06, 0x00, 0x09, 0x79, 0x12, 0x13, 0xc1, 0x10, 0xed, 0xb7, 0xc5, 0xc1, 0xc9, 0x06, 0xff, 0xf5, 0x3e, 0xc0, 0xd3, 0x07, 0xfb, 0x76, 0x76, 0x10, 0xfb, 0xf1, 0xc9, 0xdb, 0x07, 0x2f, 0xe6, 0x03, 0xc9, 0xf3, 0x3e, 0xc0, 0xd3, 0x07, 0x06, 0x08, 0x16, 0xff, 0xcd, 0x35, 0xd9, 0xd8, 0xc6, 0xfe, 0x3e, 0xe8, 0x30, 0x03, 0xc0, 0x3e, 0xd4, 0xd3, 0x07, 0xcb, 0x19, 0x14, 0xcd, 0x35, 0xd9, 0xd8, 0x3e, 0xc0, 0xd3, 0x07, 0x10, 0xe2, 0xc9, 0x21, 0xff, 0xff, 0x2b, 0xdb, 0x07, 0xaa, 0xe6, 0x03, 0xc0, 0x7c, 0xb5, 0x20, 0xf5, 0x37, 0xc9, 0xf3, 0x06, 0x08, 0xcd, 0x5b, 0xd9, 0xd8, 0xcb, 0x19, 0x3e, 0xd4, 0x30, 0x02, 0x3e, 0xe8, 0x14, 0xcd, 0x5f, 0xd9, 0xd8, 0x10, 0xed, 0x3e, 0xc0, 0x16, 0xff, 0xd3, 0x07, 0x21, 0xff, 0xff, 0x2b, 0xdb, 0x07, 0xaa, 0xe6, 0x03, 0xc8, 0x7c, 0xb5, 0x20, 0xf5, 0x37, 0xc9, 0x44, 0x75, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0x20, 0x52, 0x4f, 0x4d, 0x2e, 0x2e, 0x2e, 0x00, 0x5b, 0x45, 0x58, 0x49, 0x54, 0x5d, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x3a, 0x00, 0x30, 0x4b, 0x20, 0x6f, 0x66, 0x20, 0x32, 0x35, 0x36, 0x4b, 0x00, 0x00, 0x04, 0x00, 0x5d, 0xf9, }; static unsigned int romDumpSize86 = 684; libticalcs-1.1.9+dfsg/src/rom89.h000066400000000000000000000212641327711501700165010ustar00rootroot00000000000000static unsigned char romDump89[] = { 0x2a, 0x2a, 0x54, 0x49, 0x38, 0x39, 0x2a, 0x2a, 0x01, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x52, 0x00, 0x00, 0x00, 0x72, 0x6f, 0x6d, 0x64, 0x75, 0x6d, 0x70, 0x00, 0x21, 0x00, 0x00, 0x00, 0x9d, 0x05, 0x00, 0x00, 0xa5, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x05, 0x43, 0x20, 0x78, 0x00, 0xc8, 0x70, 0x01, 0x22, 0x08, 0x02, 0x81, 0x00, 0x40, 0x00, 0x00, 0x66, 0x10, 0x42, 0x40, 0x22, 0x68, 0x00, 0xbc, 0x0c, 0x29, 0x00, 0xc8, 0x00, 0x02, 0x65, 0x02, 0x70, 0x03, 0x43, 0xfa, 0x00, 0xac, 0x32, 0x80, 0x48, 0xe7, 0x1c, 0x04, 0x2a, 0x78, 0x00, 0xc8, 0x43, 0xfa, 0x00, 0x00, 0x28, 0x09, 0x02, 0x84, 0x00, 0x03, 0xff, 0xff, 0x76, 0x01, 0x61, 0x3e, 0x4a, 0x40, 0x66, 0x14, 0x28, 0x2f, 0x00, 0x10, 0x0c, 0x84, 0x00, 0x1f, 0xff, 0xff, 0x62, 0x08, 0x02, 0x84, 0x00, 0x03, 0xff, 0xff, 0x61, 0x26, 0x30, 0x3c, 0x03, 0xbf, 0x41, 0xf8, 0x4c, 0x00, 0x2f, 0x18, 0x51, 0xc8, 0xff, 0xfc, 0x61, 0x6a, 0x30, 0x3c, 0x03, 0xbf, 0x41, 0xf8, 0x5b, 0x00, 0x21, 0x1f, 0x51, 0xc8, 0xff, 0xfc, 0x61, 0x06, 0x4c, 0xdf, 0x20, 0x38, 0x4e, 0x75, 0x3f, 0x3c, 0x00, 0x06, 0x42, 0xa7, 0x20, 0x6d, 0x01, 0xb0, 0x4e, 0x90, 0x5c, 0x8f, 0x42, 0x40, 0x2a, 0x08, 0x67, 0x3c, 0x3f, 0x28, 0x00, 0x0c, 0x20, 0x6d, 0x02, 0x58, 0x4e, 0x90, 0x54, 0x8f, 0xb1, 0xc4, 0x62, 0x20, 0x70, 0x00, 0x30, 0x10, 0xd1, 0xc0, 0xb1, 0xc4, 0x63, 0x16, 0x70, 0x01, 0x20, 0x45, 0x41, 0xe8, 0x00, 0x0b, 0x4a, 0x43, 0x67, 0x12, 0x72, 0x10, 0x16, 0x10, 0xc6, 0x41, 0x83, 0x10, 0x4e, 0x75, 0x20, 0x6d, 0x01, 0xb4, 0x4e, 0x90, 0x60, 0xc2, 0x02, 0x10, 0x00, 0xef, 0x4e, 0x75, 0xff, 0xff, 0x4f, 0xef, 0xef, 0xb4, 0x48, 0xe7, 0x1e, 0x30, 0x20, 0x6d, 0x06, 0x78, 0x4e, 0x90, 0x3f, 0x3c, 0x00, 0x02, 0x20, 0x6d, 0x06, 0x3c, 0x4e, 0x90, 0x48, 0x7a, 0x03, 0xb8, 0x48, 0x7a, 0x03, 0xb9, 0x45, 0xef, 0x10, 0x48, 0x2f, 0x0a, 0x20, 0x6d, 0x01, 0x4c, 0x4e, 0x90, 0x3f, 0x3c, 0x00, 0x01, 0x2f, 0x0a, 0x42, 0xa7, 0x20, 0x6d, 0x06, 0xa4, 0x4e, 0x90, 0x61, 0x00, 0x03, 0xf8, 0x3f, 0x00, 0x48, 0x7a, 0x03, 0xa3, 0x2f, 0x0a, 0x20, 0x6d, 0x01, 0x4c, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x20, 0x3e, 0xbc, 0x00, 0x01, 0x2f, 0x0a, 0x48, 0x78, 0x00, 0x14, 0x20, 0x6d, 0x06, 0xa4, 0x4e, 0x90, 0x22, 0x0d, 0x02, 0x81, 0x00, 0xe0, 0x00, 0x00, 0x2f, 0x01, 0x48, 0x7a, 0x03, 0x84, 0x2f, 0x0a, 0x20, 0x6d, 0x01, 0x4c, 0x4e, 0x90, 0x3f, 0x3c, 0x00, 0x01, 0x2f, 0x0a, 0x48, 0x78, 0x00, 0x28, 0x20, 0x6d, 0x06, 0xa4, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x1c, 0x2e, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x0a, 0x20, 0x6d, 0x01, 0x4c, 0x4e, 0x90, 0x3f, 0x3c, 0x00, 0x01, 0x2f, 0x0a, 0x48, 0x78, 0x00, 0x50, 0x20, 0x6d, 0x06, 0xa4, 0x4e, 0x90, 0x3c, 0x3a, 0xff, 0x54, 0x4f, 0xef, 0x00, 0x12, 0x48, 0x78, 0x00, 0x14, 0x48, 0x78, 0x00, 0x04, 0x45, 0xef, 0x00, 0x22, 0x2f, 0x0a, 0x20, 0x6d, 0x01, 0x6c, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x0c, 0x4a, 0x40, 0x67, 0x04, 0x78, 0xff, 0x60, 0x60, 0x18, 0x2f, 0x00, 0x1b, 0xe1, 0x4c, 0x42, 0x40, 0x10, 0x2f, 0x00, 0x1a, 0x88, 0x40, 0x16, 0x2f, 0x00, 0x1d, 0xe1, 0x4b, 0x42, 0x40, 0x10, 0x2f, 0x00, 0x1c, 0x86, 0x40, 0x47, 0xfa, 0x02, 0xc4, 0x70, 0x04, 0x20, 0x4a, 0x4e, 0x93, 0x48, 0x78, 0x00, 0x14, 0x7a, 0x00, 0x3a, 0x03, 0x2f, 0x05, 0x2f, 0x0a, 0x20, 0x6d, 0x01, 0x6c, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x0c, 0x4a, 0x40, 0x66, 0x20, 0x48, 0x78, 0x00, 0x14, 0x48, 0x78, 0x00, 0x02, 0x48, 0x72, 0x58, 0x00, 0x20, 0x6d, 0x01, 0x6c, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x0c, 0x4a, 0x40, 0x66, 0x06, 0x30, 0x03, 0x20, 0x4a, 0x4e, 0x93, 0x20, 0x6d, 0x01, 0x48, 0x4e, 0x90, 0x3a, 0x00, 0x0c, 0x44, 0x00, 0x02, 0x67, 0x20, 0x0c, 0x44, 0x00, 0x03, 0x67, 0x2c, 0x0c, 0x44, 0x00, 0x05, 0x67, 0x00, 0x00, 0xdc, 0x0c, 0x44, 0xaa, 0x55, 0x66, 0x00, 0x01, 0xe0, 0x93, 0xc9, 0x42, 0x41, 0x70, 0x01, 0x60, 0x00, 0x01, 0xd0, 0x93, 0xc9, 0x42, 0x41, 0x70, 0x02, 0x41, 0xef, 0x00, 0x1a, 0x61, 0x00, 0x01, 0xd8, 0x60, 0x00, 0x01, 0xca, 0x0c, 0x46, 0x00, 0x03, 0x66, 0x04, 0x70, 0x01, 0x60, 0x14, 0x20, 0x0d, 0x02, 0x80, 0x00, 0xe0, 0x00, 0x00, 0x0c, 0x80, 0x00, 0x80, 0x00, 0x00, 0x57, 0xc0, 0x48, 0x80, 0x44, 0x40, 0x48, 0xc0, 0x72, 0x20, 0x48, 0x41, 0xe1, 0xa9, 0x24, 0x01, 0x42, 0x42, 0x48, 0x42, 0xe0, 0x4a, 0x20, 0x01, 0x02, 0x80, 0x00, 0xff, 0x00, 0x00, 0xe0, 0x88, 0x84, 0x80, 0x20, 0x01, 0x02, 0x80, 0x00, 0x00, 0xff, 0x00, 0xe1, 0x88, 0xe1, 0x49, 0x48, 0x41, 0x42, 0x41, 0x82, 0x80, 0x43, 0xef, 0x10, 0x64, 0x84, 0x81, 0x23, 0x02, 0x72, 0x04, 0x70, 0x03, 0x41, 0xef, 0x00, 0x1a, 0x61, 0x00, 0x01, 0x74, 0x20, 0x0d, 0x20, 0x6d, 0x01, 0x4c, 0x0c, 0x46, 0x00, 0x03, 0x66, 0x04, 0x70, 0x01, 0x60, 0x12, 0x02, 0x80, 0x00, 0xe0, 0x00, 0x00, 0x0c, 0x80, 0x00, 0x80, 0x00, 0x00, 0x57, 0xc0, 0x48, 0x80, 0x44, 0x40, 0x32, 0x00, 0x48, 0xc1, 0x70, 0x20, 0x48, 0x40, 0xe3, 0xa8, 0x72, 0x0a, 0xe2, 0xa8, 0x2f, 0x00, 0x48, 0x7a, 0x02, 0x0d, 0x45, 0xef, 0x10, 0x28, 0x2f, 0x0a, 0x4e, 0x90, 0x3f, 0x3c, 0x00, 0x04, 0x2f, 0x0a, 0x48, 0x78, 0x00, 0x3c, 0x20, 0x6d, 0x06, 0xa4, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x16, 0x60, 0x00, 0x01, 0x0e, 0x76, 0x00, 0x16, 0x2f, 0x00, 0x1b, 0xe1, 0x8b, 0x86, 0x2f, 0x00, 0x1a, 0x12, 0x2f, 0x00, 0x1d, 0xe1, 0x49, 0x48, 0x41, 0x42, 0x41, 0x70, 0x00, 0x10, 0x2f, 0x00, 0x1c, 0x48, 0x40, 0x42, 0x40, 0x82, 0x80, 0x86, 0x81, 0x0c, 0x46, 0x00, 0x03, 0x66, 0x04, 0x70, 0x01, 0x60, 0x14, 0x20, 0x0d, 0x02, 0x80, 0x00, 0xe0, 0x00, 0x00, 0x0c, 0x80, 0x00, 0x80, 0x00, 0x00, 0x57, 0xc0, 0x48, 0x80, 0x44, 0x40, 0x32, 0x00, 0x48, 0xc1, 0x70, 0x20, 0x48, 0x40, 0xe3, 0xa8, 0xb0, 0x83, 0x64, 0x0e, 0x93, 0xc9, 0x42, 0x41, 0x70, 0x04, 0x41, 0xef, 0x00, 0x1a, 0x61, 0x00, 0x00, 0xc0, 0x20, 0x0d, 0x20, 0x6d, 0x01, 0x4c, 0x0c, 0x46, 0x00, 0x03, 0x66, 0x04, 0x70, 0x01, 0x60, 0x12, 0x02, 0x80, 0x00, 0xe0, 0x00, 0x00, 0x0c, 0x80, 0x00, 0x80, 0x00, 0x00, 0x57, 0xc0, 0x48, 0x80, 0x44, 0x40, 0x32, 0x00, 0x48, 0xc1, 0x70, 0x20, 0x48, 0x40, 0xe3, 0xa8, 0x72, 0x0a, 0xe2, 0xa8, 0x2f, 0x00, 0x20, 0x03, 0xe2, 0xa8, 0x2f, 0x00, 0x48, 0x7a, 0x01, 0x60, 0x45, 0xef, 0x10, 0x2c, 0x2f, 0x0a, 0x4e, 0x90, 0x3f, 0x3c, 0x00, 0x04, 0x2f, 0x0a, 0x48, 0x78, 0x00, 0x3c, 0x20, 0x6d, 0x06, 0xa4, 0x4e, 0x90, 0x20, 0x0d, 0x02, 0x80, 0x00, 0xe0, 0x00, 0x00, 0x22, 0x40, 0xd3, 0xc3, 0x10, 0x11, 0x72, 0x00, 0x4f, 0xef, 0x00, 0x1a, 0xb0, 0x31, 0x18, 0x00, 0x66, 0x34, 0x34, 0x01, 0x52, 0x42, 0x52, 0x81, 0x0c, 0x81, 0x00, 0x00, 0x10, 0x00, 0x66, 0xec, 0x0c, 0x42, 0x10, 0x00, 0x66, 0x20, 0x02, 0x40, 0x00, 0xff, 0x42, 0x2f, 0x10, 0x5c, 0x1f, 0x7c, 0x00, 0x10, 0x10, 0x5d, 0x1f, 0x40, 0x10, 0x5e, 0x42, 0x2f, 0x10, 0x5f, 0x43, 0xef, 0x10, 0x5c, 0x72, 0x04, 0x70, 0x07, 0x60, 0x06, 0x32, 0x3c, 0x10, 0x00, 0x70, 0x06, 0x41, 0xef, 0x00, 0x1a, 0x61, 0x10, 0x4a, 0x45, 0x67, 0x00, 0xfd, 0x7a, 0x4c, 0xdf, 0x0c, 0x78, 0x4f, 0xef, 0x10, 0x4c, 0x4e, 0x75, 0x48, 0xe7, 0x1c, 0x38, 0x26, 0x48, 0x38, 0x01, 0x2a, 0x09, 0x28, 0x48, 0x18, 0xc0, 0xe0, 0x48, 0x18, 0x80, 0x17, 0x41, 0x00, 0x02, 0x30, 0x01, 0xe0, 0x48, 0x11, 0x40, 0x00, 0x03, 0x48, 0x78, 0x00, 0x04, 0x2f, 0x08, 0x20, 0x6d, 0x01, 0x68, 0x4e, 0x90, 0x50, 0x8f, 0x4a, 0x40, 0x66, 0x3a, 0x3f, 0x04, 0x42, 0x67, 0x2f, 0x05, 0x20, 0x6d, 0x01, 0x68, 0x4e, 0x90, 0x50, 0x8f, 0x4a, 0x40, 0x66, 0x28, 0x45, 0xfa, 0x00, 0x2c, 0x70, 0x04, 0x20, 0x4b, 0x4e, 0x92, 0x36, 0x00, 0x30, 0x04, 0x20, 0x45, 0x4e, 0x92, 0xd6, 0x40, 0x16, 0x83, 0xe0, 0x4b, 0x18, 0x83, 0x48, 0x78, 0x00, 0x02, 0x2f, 0x0b, 0x20, 0x6d, 0x01, 0x68, 0x4e, 0x90, 0x50, 0x8f, 0x4c, 0xdf, 0x1c, 0x38, 0x4e, 0x75, 0x34, 0x00, 0x42, 0x41, 0x93, 0xc9, 0x60, 0x10, 0x70, 0x00, 0x30, 0x01, 0x10, 0x30, 0x08, 0x00, 0x02, 0x40, 0x00, 0xff, 0xd2, 0xc0, 0x52, 0x41, 0xb4, 0x41, 0x66, 0xec, 0x30, 0x09, 0x4e, 0x75, 0x31, 0x2e, 0x30, 0x32, 0x00, 0x52, 0x6f, 0x6d, 0x44, 0x75, 0x6d, 0x70, 0x65, 0x72, 0x20, 0x76, 0x25, 0x73, 0x00, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x48, 0x57, 0x25, 0x69, 0x00, 0x52, 0x4f, 0x4d, 0x20, 0x62, 0x61, 0x73, 0x65, 0x3a, 0x20, 0x30, 0x78, 0x25, 0x6c, 0x78, 0x00, 0x62, 0x79, 0x20, 0x54, 0x68, 0x65, 0x20, 0x54, 0x69, 0x4c, 0x50, 0x20, 0x54, 0x65, 0x61, 0x6d, 0x00, 0x53, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x25, 0x6c, 0x75, 0x20, 0x4b, 0x42, 0x00, 0x44, 0x6f, 0x6e, 0x65, 0x3a, 0x20, 0x25, 0x6c, 0x75, 0x2f, 0x25, 0x6c, 0x75, 0x4b, 0x42, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x20, 0x38, 0x00, 0xc8, 0x02, 0x80, 0x00, 0xe0, 0x00, 0x00, 0x20, 0x40, 0x22, 0x68, 0x01, 0x04, 0xd1, 0xfc, 0x00, 0x01, 0x00, 0x00, 0xb3, 0xc8, 0x64, 0x14, 0x0c, 0x51, 0x00, 0x16, 0x63, 0x0e, 0x4e, 0x4c, 0x46, 0xfc, 0x30, 0x00, 0x40, 0xc1, 0x46, 0xc0, 0xe7, 0x49, 0x6a, 0x04, 0x70, 0x01, 0x4e, 0x75, 0x20, 0x29, 0x00, 0x16, 0x4e, 0x75, 0x00, 0x00, 0x04, 0xd0, 0x01, 0x5c, 0xf3, 0x59, 0x81, }; static unsigned int romDumpSize89 = 1437; libticalcs-1.1.9+dfsg/src/rom89t.h000066400000000000000000000247131327711501700166670ustar00rootroot00000000000000static unsigned char romDump89t[] = { 0x2a, 0x2a, 0x54, 0x49, 0x38, 0x39, 0x2a, 0x2a, 0x01, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x52, 0x00, 0x00, 0x00, 0x72, 0x6f, 0x6d, 0x64, 0x75, 0x6d, 0x70, 0x00, 0x21, 0x00, 0x00, 0x00, 0xc5, 0x06, 0x00, 0x00, 0xa5, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x06, 0x6b, 0x20, 0x78, 0x00, 0xc8, 0x70, 0x01, 0x22, 0x08, 0x02, 0x81, 0x00, 0x40, 0x00, 0x00, 0x66, 0x10, 0x42, 0x40, 0x22, 0x68, 0x00, 0xbc, 0x0c, 0x29, 0x00, 0xc8, 0x00, 0x02, 0x65, 0x02, 0x70, 0x03, 0x4a, 0x40, 0x67, 0x0e, 0x48, 0x7a, 0x00, 0xb6, 0x20, 0x68, 0x03, 0x98, 0x4e, 0x90, 0x58, 0x8f, 0x4e, 0x75, 0x48, 0xe7, 0x1c, 0x04, 0x2a, 0x78, 0x00, 0xc8, 0x43, 0xfa, 0x00, 0x00, 0x28, 0x09, 0x02, 0x84, 0x00, 0x03, 0xff, 0xff, 0x76, 0x01, 0x61, 0x40, 0x4a, 0x40, 0x66, 0x14, 0x28, 0x2f, 0x00, 0x10, 0x0c, 0x84, 0x00, 0x1f, 0xff, 0xff, 0x62, 0x08, 0x02, 0x84, 0x00, 0x03, 0xff, 0xff, 0x61, 0x28, 0x30, 0x3c, 0x03, 0xbf, 0x41, 0xf8, 0x4c, 0x00, 0x2f, 0x18, 0x51, 0xc8, 0xff, 0xfc, 0x61, 0x00, 0x00, 0x82, 0x30, 0x3c, 0x03, 0xbf, 0x41, 0xf8, 0x5b, 0x00, 0x21, 0x1f, 0x51, 0xc8, 0xff, 0xfc, 0x61, 0x06, 0x4c, 0xdf, 0x20, 0x38, 0x4e, 0x75, 0x3f, 0x3c, 0x00, 0x06, 0x42, 0xa7, 0x20, 0x6d, 0x01, 0xb0, 0x4e, 0x90, 0x5c, 0x8f, 0x42, 0x40, 0x2a, 0x08, 0x67, 0x3c, 0x3f, 0x28, 0x00, 0x0c, 0x20, 0x6d, 0x02, 0x58, 0x4e, 0x90, 0x54, 0x8f, 0xb1, 0xc4, 0x62, 0x20, 0x70, 0x00, 0x30, 0x10, 0xd1, 0xc0, 0xb1, 0xc4, 0x63, 0x16, 0x70, 0x01, 0x20, 0x45, 0x41, 0xe8, 0x00, 0x0b, 0x4a, 0x43, 0x67, 0x12, 0x72, 0x10, 0x16, 0x10, 0xc6, 0x41, 0x83, 0x10, 0x4e, 0x75, 0x20, 0x6d, 0x01, 0xb4, 0x4e, 0x90, 0x60, 0xc2, 0x02, 0x10, 0x00, 0xef, 0x4e, 0x75, 0x57, 0x72, 0x6f, 0x6e, 0x67, 0x20, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x00, 0x00, 0x4e, 0x56, 0xef, 0xb4, 0x48, 0xe7, 0x1f, 0x20, 0x20, 0x6d, 0x06, 0x78, 0x4e, 0x90, 0x3f, 0x3c, 0x00, 0x02, 0x20, 0x6d, 0x06, 0x3c, 0x4e, 0x90, 0x48, 0x7a, 0x04, 0xb8, 0x48, 0x7a, 0x04, 0xbd, 0x45, 0xee, 0xff, 0xda, 0x2f, 0x0a, 0x20, 0x6d, 0x01, 0x4c, 0x4e, 0x90, 0x3f, 0x3c, 0x00, 0x01, 0x2f, 0x0a, 0x42, 0xa7, 0x20, 0x6d, 0x06, 0xa4, 0x4e, 0x90, 0x61, 0x00, 0x04, 0xfc, 0x3f, 0x00, 0x48, 0x7a, 0x04, 0xa7, 0x2f, 0x0a, 0x20, 0x6d, 0x01, 0x4c, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x20, 0x3e, 0xbc, 0x00, 0x01, 0x2f, 0x0a, 0x48, 0x78, 0x00, 0x14, 0x20, 0x6d, 0x06, 0xa4, 0x4e, 0x90, 0x22, 0x0d, 0x02, 0x81, 0x00, 0xe0, 0x00, 0x00, 0x2f, 0x01, 0x48, 0x7a, 0x04, 0x88, 0x2f, 0x0a, 0x20, 0x6d, 0x01, 0x4c, 0x4e, 0x90, 0x3f, 0x3c, 0x00, 0x01, 0x2f, 0x0a, 0x48, 0x78, 0x00, 0x28, 0x20, 0x6d, 0x06, 0xa4, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x1c, 0x2e, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x0a, 0x20, 0x6d, 0x01, 0x4c, 0x4e, 0x90, 0x3f, 0x3c, 0x00, 0x01, 0x2f, 0x0a, 0x48, 0x78, 0x00, 0x50, 0x20, 0x6d, 0x06, 0xa4, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x12, 0x20, 0x6d, 0x0f, 0x10, 0x20, 0x28, 0xfb, 0xa8, 0x22, 0x28, 0xfb, 0xac, 0x24, 0x3c, 0x76, 0x02, 0x10, 0x03, 0x26, 0x3c, 0x26, 0x1f, 0x4e, 0x75, 0x92, 0x83, 0x91, 0x82, 0x66, 0x06, 0x41, 0xe8, 0xfb, 0xc6, 0x60, 0x08, 0x30, 0x7c, 0xff, 0xaa, 0xd1, 0xed, 0x0a, 0x4c, 0x20, 0x50, 0x41, 0xe8, 0xff, 0x0a, 0x48, 0x78, 0x07, 0xd0, 0x48, 0x78, 0x00, 0x04, 0x2a, 0x0e, 0x06, 0x85, 0xff, 0xff, 0xef, 0xb6, 0x2f, 0x05, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x0c, 0x4a, 0x40, 0x67, 0x06, 0x78, 0xff, 0x60, 0x00, 0x00, 0xc4, 0x18, 0x2e, 0xef, 0xb7, 0xe1, 0x4c, 0x42, 0x40, 0x10, 0x2e, 0xef, 0xb6, 0x88, 0x40, 0x16, 0x2e, 0xef, 0xb9, 0xe1, 0x4b, 0x42, 0x40, 0x10, 0x2e, 0xef, 0xb8, 0x86, 0x40, 0x70, 0x04, 0x20, 0x45, 0x61, 0x00, 0x03, 0x90, 0x20, 0x6d, 0x0f, 0x10, 0x20, 0x28, 0xfb, 0xa8, 0x22, 0x28, 0xfb, 0xac, 0x2a, 0x3c, 0x76, 0x02, 0x10, 0x03, 0x2c, 0x3c, 0x26, 0x1f, 0x4e, 0x75, 0x92, 0x86, 0x91, 0x85, 0x66, 0x06, 0x41, 0xe8, 0xfb, 0xc6, 0x60, 0x08, 0x30, 0x7c, 0xff, 0xaa, 0xd1, 0xed, 0x0a, 0x4c, 0x7a, 0x00, 0x3a, 0x03, 0x20, 0x50, 0x41, 0xe8, 0xff, 0x0a, 0x48, 0x78, 0x07, 0xd0, 0x2f, 0x05, 0x48, 0x6e, 0xef, 0xb6, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x0c, 0x4a, 0x40, 0x66, 0x54, 0x20, 0x6d, 0x0f, 0x10, 0x20, 0x28, 0xfb, 0xa8, 0x22, 0x28, 0xfb, 0xac, 0x2c, 0x3c, 0x76, 0x02, 0x10, 0x03, 0x2e, 0x3c, 0x26, 0x1f, 0x4e, 0x75, 0x92, 0x87, 0x91, 0x86, 0x66, 0x06, 0x41, 0xe8, 0xfb, 0xc6, 0x60, 0x08, 0x30, 0x7c, 0xff, 0xaa, 0xd1, 0xed, 0x0a, 0x4c, 0x20, 0x50, 0x41, 0xe8, 0xff, 0x0a, 0x48, 0x78, 0x07, 0xd0, 0x48, 0x78, 0x00, 0x02, 0x45, 0xee, 0xef, 0xb6, 0x48, 0x72, 0x58, 0x00, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x0c, 0x4a, 0x40, 0x66, 0x08, 0x30, 0x03, 0x20, 0x4a, 0x61, 0x00, 0x02, 0xf2, 0x20, 0x6d, 0x01, 0x48, 0x4e, 0x90, 0x3a, 0x00, 0x0c, 0x44, 0x00, 0x02, 0x67, 0x20, 0x0c, 0x44, 0x00, 0x03, 0x67, 0x2c, 0x0c, 0x44, 0x00, 0x05, 0x67, 0x00, 0x00, 0x96, 0x0c, 0x44, 0xaa, 0x55, 0x66, 0x00, 0x01, 0x7c, 0x93, 0xc9, 0x42, 0x41, 0x70, 0x01, 0x60, 0x00, 0x01, 0x6c, 0x93, 0xc9, 0x42, 0x41, 0x70, 0x02, 0x41, 0xee, 0xef, 0xb6, 0x61, 0x00, 0x01, 0xa8, 0x60, 0x00, 0x01, 0x66, 0x20, 0x0d, 0x02, 0x80, 0x00, 0xe0, 0x00, 0x00, 0x72, 0x40, 0x48, 0x41, 0x0c, 0x80, 0x00, 0x80, 0x00, 0x00, 0x67, 0x04, 0x72, 0x20, 0x48, 0x41, 0xe0, 0x89, 0x22, 0x4e, 0x23, 0x01, 0x72, 0x04, 0x70, 0x03, 0x41, 0xee, 0xef, 0xb6, 0x61, 0x00, 0x01, 0x7a, 0x20, 0x0d, 0x20, 0x6d, 0x01, 0x4c, 0x02, 0x80, 0x00, 0xe0, 0x00, 0x00, 0x22, 0x3c, 0x00, 0x00, 0x10, 0x00, 0x0c, 0x80, 0x00, 0x80, 0x00, 0x00, 0x67, 0x06, 0x22, 0x3c, 0x00, 0x00, 0x08, 0x00, 0x2f, 0x01, 0x48, 0x7a, 0x02, 0xc5, 0x45, 0xee, 0xff, 0xbc, 0x2f, 0x0a, 0x4e, 0x90, 0x3f, 0x3c, 0x00, 0x04, 0x2f, 0x0a, 0x48, 0x78, 0x00, 0x3c, 0x20, 0x6d, 0x06, 0xa4, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x16, 0x60, 0x00, 0x00, 0xf0, 0x76, 0x00, 0x16, 0x2e, 0xef, 0xb7, 0xe1, 0x8b, 0x86, 0x2e, 0xef, 0xb6, 0x10, 0x2e, 0xef, 0xb9, 0xe1, 0x48, 0x48, 0x40, 0x42, 0x40, 0x72, 0x00, 0x12, 0x2e, 0xef, 0xb8, 0x48, 0x41, 0x42, 0x41, 0x80, 0x81, 0x86, 0x80, 0x20, 0x0d, 0x02, 0x80, 0x00, 0xe0, 0x00, 0x00, 0x72, 0x40, 0x48, 0x41, 0x0c, 0x80, 0x00, 0x80, 0x00, 0x00, 0x67, 0x04, 0x72, 0x20, 0x48, 0x41, 0xb2, 0x83, 0x64, 0x0e, 0x93, 0xc9, 0x42, 0x41, 0x70, 0x04, 0x41, 0xee, 0xef, 0xb6, 0x61, 0x00, 0x00, 0xe6, 0x20, 0x0d, 0x20, 0x6d, 0x01, 0x4c, 0x02, 0x80, 0x00, 0xe0, 0x00, 0x00, 0x22, 0x3c, 0x00, 0x00, 0x10, 0x00, 0x0c, 0x80, 0x00, 0x80, 0x00, 0x00, 0x67, 0x06, 0x22, 0x3c, 0x00, 0x00, 0x08, 0x00, 0x2f, 0x01, 0x20, 0x03, 0x7e, 0x0a, 0xee, 0xa8, 0x2f, 0x00, 0x48, 0x7a, 0x02, 0x36, 0x45, 0xee, 0xff, 0xbc, 0x2f, 0x0a, 0x4e, 0x90, 0x3f, 0x3c, 0x00, 0x04, 0x2f, 0x0a, 0x48, 0x78, 0x00, 0x3c, 0x20, 0x6d, 0x06, 0xa4, 0x4e, 0x90, 0x20, 0x0d, 0x02, 0x80, 0x00, 0xe0, 0x00, 0x00, 0x22, 0x40, 0xd3, 0xc3, 0x10, 0x11, 0x72, 0x00, 0x4f, 0xef, 0x00, 0x1a, 0xb0, 0x31, 0x18, 0x00, 0x66, 0x34, 0x34, 0x01, 0x52, 0x42, 0x52, 0x81, 0x0c, 0x81, 0x00, 0x00, 0x10, 0x00, 0x66, 0xec, 0x0c, 0x42, 0x10, 0x00, 0x66, 0x20, 0x02, 0x40, 0x00, 0xff, 0x42, 0x2e, 0xff, 0xf8, 0x1d, 0x7c, 0x00, 0x10, 0xff, 0xf9, 0x1d, 0x40, 0xff, 0xfa, 0x42, 0x2e, 0xff, 0xfb, 0x43, 0xee, 0xff, 0xf8, 0x72, 0x04, 0x70, 0x07, 0x60, 0x06, 0x32, 0x3c, 0x10, 0x00, 0x70, 0x06, 0x41, 0xee, 0xef, 0xb6, 0x61, 0x44, 0x4a, 0x45, 0x67, 0x00, 0xfd, 0x48, 0x20, 0x6d, 0x0f, 0x10, 0x20, 0x28, 0xfb, 0xa8, 0x22, 0x28, 0xfb, 0xac, 0x24, 0x3c, 0x76, 0x02, 0x10, 0x03, 0x26, 0x3c, 0x26, 0x1f, 0x4e, 0x75, 0x92, 0x83, 0x91, 0x82, 0x66, 0x06, 0x41, 0xe8, 0xfb, 0xc6, 0x60, 0x08, 0x30, 0x7c, 0xff, 0xaa, 0xd1, 0xed, 0x0a, 0x4c, 0x20, 0x50, 0x41, 0xe8, 0xfe, 0xf6, 0x4e, 0x90, 0x4c, 0xee, 0x04, 0xf8, 0xef, 0x9c, 0x4e, 0x5e, 0x4e, 0x75, 0x48, 0xe7, 0x1c, 0x38, 0x26, 0x48, 0x38, 0x01, 0x2a, 0x09, 0x28, 0x48, 0x18, 0xc0, 0xe0, 0x48, 0x18, 0x80, 0x17, 0x41, 0x00, 0x02, 0x30, 0x01, 0xe0, 0x48, 0x11, 0x40, 0x00, 0x03, 0x20, 0x6d, 0x0f, 0x10, 0x20, 0x28, 0xfb, 0xa8, 0x22, 0x28, 0xfb, 0xac, 0x24, 0x3c, 0x76, 0x02, 0x10, 0x03, 0x26, 0x3c, 0x26, 0x1f, 0x4e, 0x75, 0x92, 0x83, 0x91, 0x82, 0x66, 0x06, 0x41, 0xe8, 0xfb, 0xc6, 0x60, 0x08, 0x30, 0x7c, 0xff, 0xaa, 0xd1, 0xed, 0x0a, 0x4c, 0x20, 0x50, 0x41, 0xe8, 0xfe, 0x12, 0x48, 0x78, 0x07, 0xd0, 0x48, 0x78, 0x00, 0x04, 0x2f, 0x0b, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x0c, 0x4a, 0x40, 0x66, 0x00, 0x00, 0xa4, 0x20, 0x6d, 0x0f, 0x10, 0x20, 0x28, 0xfb, 0xa8, 0x22, 0x28, 0xfb, 0xac, 0x24, 0x3c, 0x76, 0x02, 0x10, 0x03, 0x26, 0x3c, 0x26, 0x1f, 0x4e, 0x75, 0x92, 0x83, 0x91, 0x82, 0x66, 0x06, 0x41, 0xe8, 0xfb, 0xc6, 0x60, 0x08, 0x30, 0x7c, 0xff, 0xaa, 0xd1, 0xed, 0x0a, 0x4c, 0x20, 0x50, 0x41, 0xe8, 0xfe, 0x12, 0x48, 0x78, 0x07, 0xd0, 0x3f, 0x04, 0x42, 0x67, 0x2f, 0x05, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x0c, 0x4a, 0x40, 0x66, 0x5c, 0x45, 0xfa, 0x00, 0x60, 0x70, 0x04, 0x20, 0x4b, 0x4e, 0x92, 0x36, 0x00, 0x30, 0x04, 0x20, 0x45, 0x4e, 0x92, 0xd6, 0x40, 0x16, 0x83, 0xe0, 0x4b, 0x18, 0x83, 0x20, 0x6d, 0x0f, 0x10, 0x20, 0x28, 0xfb, 0xa8, 0x22, 0x28, 0xfb, 0xac, 0x24, 0x3c, 0x76, 0x02, 0x10, 0x03, 0x26, 0x3c, 0x26, 0x1f, 0x4e, 0x75, 0x92, 0x83, 0x91, 0x82, 0x66, 0x06, 0x41, 0xe8, 0xfb, 0xc6, 0x60, 0x08, 0x30, 0x7c, 0xff, 0xaa, 0xd1, 0xed, 0x0a, 0x4c, 0x20, 0x50, 0x41, 0xe8, 0xfe, 0x12, 0x48, 0x78, 0x07, 0xd0, 0x48, 0x78, 0x00, 0x02, 0x2f, 0x0b, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x0c, 0x4c, 0xdf, 0x1c, 0x38, 0x4e, 0x75, 0x34, 0x00, 0x42, 0x41, 0x93, 0xc9, 0x60, 0x10, 0x70, 0x00, 0x30, 0x01, 0x10, 0x30, 0x08, 0x00, 0x02, 0x40, 0x00, 0xff, 0xd2, 0xc0, 0x52, 0x41, 0xb4, 0x41, 0x66, 0xec, 0x30, 0x09, 0x4e, 0x75, 0x31, 0x2e, 0x30, 0x32, 0x20, 0x55, 0x53, 0x42, 0x00, 0x52, 0x6f, 0x6d, 0x44, 0x75, 0x6d, 0x70, 0x65, 0x72, 0x20, 0x76, 0x25, 0x73, 0x00, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x48, 0x57, 0x25, 0x69, 0x00, 0x52, 0x4f, 0x4d, 0x20, 0x62, 0x61, 0x73, 0x65, 0x3a, 0x20, 0x30, 0x78, 0x25, 0x6c, 0x78, 0x00, 0x62, 0x79, 0x20, 0x54, 0x68, 0x65, 0x20, 0x54, 0x69, 0x4c, 0x50, 0x20, 0x54, 0x65, 0x61, 0x6d, 0x00, 0x53, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x25, 0x6c, 0x75, 0x20, 0x4b, 0x42, 0x00, 0x44, 0x6f, 0x6e, 0x65, 0x3a, 0x20, 0x25, 0x6c, 0x75, 0x2f, 0x25, 0x6c, 0x75, 0x4b, 0x42, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x20, 0x38, 0x00, 0xc8, 0x02, 0x80, 0x00, 0xe0, 0x00, 0x00, 0x20, 0x40, 0x22, 0x68, 0x01, 0x04, 0xd1, 0xfc, 0x00, 0x01, 0x00, 0x00, 0xb3, 0xc8, 0x64, 0x14, 0x0c, 0x51, 0x00, 0x16, 0x63, 0x0e, 0x4e, 0x4c, 0x46, 0xfc, 0x30, 0x00, 0x40, 0xc1, 0x46, 0xc0, 0xe7, 0x49, 0x6a, 0x04, 0x70, 0x01, 0x4e, 0x75, 0x20, 0x29, 0x00, 0x16, 0x4e, 0x75, 0x00, 0x00, 0x05, 0xf8, 0x01, 0x80, 0xf3, 0x3a, 0x19, }; static unsigned int romDumpSize89t = 1733; libticalcs-1.1.9+dfsg/src/rom92f2.h000066400000000000000000000172351327711501700167260ustar00rootroot00000000000000static unsigned char romDump92[] = { 0x2a, 0x2a, 0x54, 0x49, 0x39, 0x32, 0x2a, 0x2a, 0x01, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x52, 0x00, 0x00, 0x00, 0x72, 0x6f, 0x6d, 0x64, 0x75, 0x6d, 0x70, 0x00, 0x12, 0x00, 0x00, 0x00, 0xf2, 0x04, 0x00, 0x00, 0xa5, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x04, 0x98, 0x00, 0x32, 0x45, 0x58, 0x45, 0x20, 0x41, 0x50, 0x50, 0x4c, 0x00, 0x00, 0x04, 0x4e, 0x04, 0x52, 0x04, 0x54, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x1e, 0x4f, 0xef, 0xef, 0xb4, 0x48, 0xe7, 0x1e, 0x38, 0x23, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x46, 0x20, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x02, 0x54, 0x80, 0x20, 0x40, 0x0c, 0x90, 0x00, 0x00, 0x00, 0x00, 0x66, 0xf4, 0x23, 0xc0, 0x00, 0x00, 0x04, 0x4a, 0x72, 0xe4, 0xd2, 0x80, 0x23, 0xc1, 0x00, 0x00, 0x04, 0x46, 0x60, 0x02, 0x54, 0x80, 0x20, 0x40, 0x0c, 0x90, 0x00, 0x00, 0x00, 0x00, 0x66, 0xf4, 0x06, 0x80, 0xff, 0xff, 0xff, 0x6a, 0x23, 0xc0, 0x00, 0x00, 0x04, 0x4a, 0x48, 0x78, 0x0f, 0x00, 0x42, 0x67, 0x48, 0x79, 0x00, 0x00, 0x00, 0x00, 0x4e, 0xb9, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3c, 0x00, 0x02, 0x4e, 0xb9, 0x00, 0x00, 0x00, 0x00, 0x48, 0x7a, 0x03, 0x34, 0x48, 0x7a, 0x03, 0x35, 0x45, 0xef, 0x10, 0x56, 0x2f, 0x0a, 0x49, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x94, 0x3f, 0x3c, 0x00, 0x01, 0x2f, 0x0a, 0x42, 0xa7, 0x47, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x93, 0x4f, 0xef, 0x00, 0x22, 0x20, 0x39, 0x00, 0x00, 0x00, 0xc4, 0x06, 0x80, 0x00, 0x0f, 0xff, 0xff, 0x42, 0x40, 0x48, 0x40, 0xe8, 0x48, 0x3f, 0x00, 0x48, 0x7a, 0x03, 0x09, 0x2f, 0x0a, 0x4e, 0x94, 0x3f, 0x3c, 0x00, 0x01, 0x2f, 0x0a, 0x48, 0x78, 0x00, 0x14, 0x4e, 0x93, 0x48, 0x79, 0x00, 0x00, 0x00, 0x00, 0x48, 0x7a, 0x02, 0xfe, 0x2f, 0x0a, 0x4e, 0x94, 0x4f, 0xef, 0x00, 0x1e, 0x3e, 0xbc, 0x00, 0x01, 0x2f, 0x0a, 0x48, 0x78, 0x00, 0x28, 0x4e, 0x93, 0x48, 0x7a, 0x02, 0xf6, 0x2f, 0x0a, 0x4e, 0x94, 0x3f, 0x3c, 0x00, 0x01, 0x2f, 0x0a, 0x48, 0x78, 0x00, 0x50, 0x4e, 0x93, 0x4f, 0xef, 0x00, 0x1c, 0x48, 0x78, 0x00, 0x14, 0x48, 0x78, 0x00, 0x04, 0x45, 0xef, 0x00, 0x26, 0x2f, 0x0a, 0x20, 0x7a, 0x03, 0x28, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x0c, 0x4a, 0x40, 0x66, 0x00, 0x02, 0x08, 0x1a, 0x2f, 0x00, 0x1f, 0x1c, 0x2f, 0x00, 0x1e, 0x16, 0x2f, 0x00, 0x21, 0xe1, 0x4b, 0x42, 0x40, 0x10, 0x2f, 0x00, 0x20, 0x86, 0x40, 0x47, 0xfa, 0x02, 0xde, 0x70, 0x04, 0x20, 0x4a, 0x4e, 0x93, 0x78, 0x00, 0x38, 0x03, 0x48, 0x78, 0x00, 0x14, 0x2f, 0x04, 0x2f, 0x0a, 0x20, 0x7a, 0x02, 0xec, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x0c, 0x4a, 0x40, 0x66, 0x20, 0x48, 0x78, 0x00, 0x14, 0x48, 0x78, 0x00, 0x02, 0x48, 0x72, 0x48, 0x00, 0x20, 0x7a, 0x02, 0xd2, 0x4e, 0x90, 0x4f, 0xef, 0x00, 0x0c, 0x4a, 0x40, 0x66, 0x06, 0x30, 0x03, 0x20, 0x4a, 0x4e, 0x93, 0x30, 0x39, 0x00, 0x00, 0x00, 0x1c, 0x56, 0xc0, 0x18, 0x00, 0x48, 0x84, 0x44, 0x44, 0x32, 0x05, 0xe1, 0x49, 0x42, 0x40, 0x10, 0x06, 0x82, 0x40, 0x0c, 0x41, 0x00, 0x02, 0x67, 0x20, 0x0c, 0x41, 0x00, 0x03, 0x67, 0x2c, 0x0c, 0x41, 0x00, 0x05, 0x67, 0x00, 0x00, 0x96, 0x0c, 0x41, 0xaa, 0x55, 0x66, 0x00, 0x01, 0x72, 0x93, 0xc9, 0x42, 0x41, 0x70, 0x01, 0x60, 0x00, 0x01, 0x62, 0x93, 0xc9, 0x42, 0x41, 0x70, 0x02, 0x41, 0xef, 0x00, 0x1e, 0x61, 0x00, 0x01, 0x7c, 0x60, 0x00, 0x01, 0x6e, 0x20, 0x39, 0x00, 0x00, 0x00, 0xc4, 0x06, 0x80, 0x00, 0x0f, 0xff, 0xff, 0x22, 0x00, 0x02, 0x81, 0x00, 0xf0, 0x00, 0x00, 0xe0, 0x89, 0x43, 0xef, 0x10, 0x68, 0x42, 0x40, 0x48, 0x40, 0xe0, 0x48, 0x80, 0x81, 0x23, 0x00, 0x72, 0x04, 0x70, 0x03, 0x41, 0xef, 0x00, 0x1e, 0x61, 0x00, 0x01, 0x48, 0x20, 0x39, 0x00, 0x00, 0x00, 0xc4, 0x06, 0x80, 0x00, 0x0f, 0xff, 0xff, 0x72, 0x0a, 0xe2, 0xa8, 0x02, 0x80, 0x00, 0x3f, 0xfc, 0x00, 0x2f, 0x00, 0x48, 0x7a, 0x01, 0xdf, 0x45, 0xef, 0x10, 0x2c, 0x2f, 0x0a, 0x4e, 0xb9, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3c, 0x00, 0x04, 0x2f, 0x0a, 0x48, 0x78, 0x00, 0x3c, 0x4e, 0xb9, 0x00, 0x00, 0x00, 0x00, 0x4f, 0xef, 0x00, 0x16, 0x60, 0x00, 0x00, 0xe6, 0x76, 0x00, 0x16, 0x2f, 0x00, 0x1f, 0xe1, 0x8b, 0x86, 0x2f, 0x00, 0x1e, 0x10, 0x2f, 0x00, 0x21, 0xe1, 0x48, 0x48, 0x40, 0x42, 0x40, 0x72, 0x00, 0x12, 0x2f, 0x00, 0x20, 0x48, 0x41, 0x42, 0x41, 0x80, 0x81, 0x86, 0x80, 0x20, 0x39, 0x00, 0x00, 0x00, 0xc4, 0x06, 0x80, 0x00, 0x0f, 0xff, 0xff, 0x02, 0x80, 0xff, 0xf0, 0x00, 0x00, 0xb0, 0x83, 0x64, 0x0e, 0x93, 0xc9, 0x42, 0x41, 0x70, 0x04, 0x41, 0xef, 0x00, 0x1e, 0x61, 0x00, 0x00, 0xc0, 0x20, 0x39, 0x00, 0x00, 0x00, 0xc4, 0x06, 0x80, 0x00, 0x0f, 0xff, 0xff, 0x72, 0x0a, 0xe2, 0xa8, 0x02, 0x80, 0x00, 0x3f, 0xfc, 0x00, 0x2f, 0x00, 0x20, 0x03, 0xe2, 0xa8, 0x2f, 0x00, 0x48, 0x7a, 0x01, 0x5e, 0x45, 0xef, 0x10, 0x30, 0x2f, 0x0a, 0x4e, 0xb9, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3c, 0x00, 0x04, 0x2f, 0x0a, 0x48, 0x78, 0x00, 0x3c, 0x4e, 0xb9, 0x00, 0x00, 0x00, 0x00, 0x22, 0x43, 0xd3, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x10, 0x11, 0x72, 0x00, 0x4f, 0xef, 0x00, 0x1a, 0x20, 0x43, 0xd1, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x30, 0x18, 0x00, 0x66, 0x34, 0x34, 0x01, 0x52, 0x42, 0x52, 0x81, 0x0c, 0x81, 0x00, 0x00, 0x10, 0x00, 0x66, 0xe4, 0x0c, 0x42, 0x10, 0x00, 0x66, 0x20, 0x02, 0x40, 0x00, 0xff, 0x42, 0x2f, 0x10, 0x60, 0x1f, 0x7c, 0x00, 0x10, 0x10, 0x61, 0x1f, 0x40, 0x10, 0x62, 0x42, 0x2f, 0x10, 0x63, 0x43, 0xef, 0x10, 0x60, 0x72, 0x04, 0x70, 0x07, 0x60, 0x06, 0x32, 0x3c, 0x10, 0x00, 0x70, 0x06, 0x41, 0xef, 0x00, 0x1e, 0x61, 0x22, 0x4a, 0x44, 0x66, 0x14, 0x60, 0x00, 0xfd, 0xde, 0x30, 0x39, 0x00, 0x00, 0x00, 0x1c, 0x56, 0xc0, 0x18, 0x00, 0x48, 0x84, 0x44, 0x44, 0x60, 0xe8, 0x4c, 0xdf, 0x1c, 0x78, 0x4f, 0xef, 0x10, 0x4c, 0x4e, 0x75, 0x48, 0xe7, 0x1c, 0x38, 0x26, 0x48, 0x38, 0x01, 0x2a, 0x09, 0x28, 0x48, 0x18, 0xc0, 0xe0, 0x48, 0x18, 0x80, 0x17, 0x41, 0x00, 0x02, 0x30, 0x01, 0xe0, 0x48, 0x11, 0x40, 0x00, 0x03, 0x48, 0x78, 0x00, 0x04, 0x2f, 0x08, 0x20, 0x7a, 0x00, 0xd0, 0x4e, 0x90, 0x50, 0x8f, 0x4a, 0x40, 0x66, 0x3a, 0x3f, 0x04, 0x42, 0x67, 0x2f, 0x05, 0x20, 0x7a, 0x00, 0xbe, 0x4e, 0x90, 0x50, 0x8f, 0x4a, 0x40, 0x66, 0x28, 0x45, 0xfa, 0x00, 0x92, 0x70, 0x04, 0x20, 0x4b, 0x4e, 0x92, 0x36, 0x00, 0x30, 0x04, 0x20, 0x45, 0x4e, 0x92, 0xd6, 0x40, 0x16, 0x83, 0xe0, 0x4b, 0x18, 0x83, 0x48, 0x78, 0x00, 0x02, 0x2f, 0x0b, 0x20, 0x7a, 0x00, 0x92, 0x4e, 0x90, 0x50, 0x8f, 0x4c, 0xdf, 0x1c, 0x38, 0x4e, 0x75, 0x31, 0x2e, 0x30, 0x32, 0x00, 0x52, 0x6f, 0x6d, 0x44, 0x75, 0x6d, 0x70, 0x65, 0x72, 0x20, 0x76, 0x25, 0x73, 0x00, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x54, 0x49, 0x2d, 0x39, 0x32, 0x20, 0x25, 0x69, 0x00, 0x52, 0x4f, 0x4d, 0x20, 0x62, 0x61, 0x73, 0x65, 0x3a, 0x20, 0x30, 0x78, 0x25, 0x6c, 0x78, 0x00, 0x62, 0x79, 0x20, 0x54, 0x68, 0x65, 0x20, 0x54, 0x69, 0x4c, 0x50, 0x20, 0x54, 0x65, 0x61, 0x6d, 0x00, 0x53, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x25, 0x6c, 0x75, 0x20, 0x4b, 0x42, 0x00, 0x44, 0x6f, 0x6e, 0x65, 0x3a, 0x20, 0x25, 0x6c, 0x75, 0x2f, 0x25, 0x6c, 0x75, 0x4b, 0x42, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x34, 0x00, 0x42, 0x41, 0x93, 0xc9, 0x60, 0x10, 0x70, 0x00, 0x30, 0x01, 0x10, 0x30, 0x08, 0x00, 0x02, 0x40, 0x00, 0xff, 0xd2, 0xc0, 0x52, 0x41, 0xb4, 0x41, 0x66, 0xec, 0x30, 0x09, 0x4e, 0x75, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0xb3, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x89, 0x09, 0x14, 0x00, 0x02, 0x23, 0x00, 0x05, 0x42, 0xc0, 0x49, 0x46, 0x00, 0x01, 0x4a, 0xc0, 0x49, 0x46, 0x00, 0x02, 0x38, 0x00, 0x09, 0xc0, 0x3b, 0xc0, 0x55, 0x00, 0x01, 0x30, 0x00, 0x09, 0x50, 0x13, 0x7e, 0x17, 0x31, 0x11, 0x1f, 0x07, 0x00, 0x0a, 0x09, 0x04, 0x00, 0x03, 0x33, 0x00, 0x00, 0x00, 0x74, 0x69, 0x6f, 0x73, 0x00, 0xe9, 0x12, 0xe4, 0x00, 0xe8, 0x19, 0xe4, 0xe5, 0x00, 0x00, 0x40, 0xdc, 0x3b, 0x37, }; static unsigned int romDumpSize92 = 1266; libticalcs-1.1.9+dfsg/src/romdump.c000066400000000000000000000222571327711501700172040ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: packets.c 1352 2005-07-12 07:24:18Z roms $ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * Copyright (C) 2006 Kevin Kofler * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This unit manages common ROM dumper. */ #include #include #include #include "ticalcs.h" #include "internal.h" #include "logging.h" #include "error.h" #include "romdump.h" #define MAX_RETRY 3 /* CMD | LEN | DATA | CHK */ #define CMD_IS_READY 0xAA55 #define CMD_KO 0x0000 #define CMD_OK 0x0001 #define CMD_EXIT 0x0002 #define CMD_REQ_SIZE 0x0003 #define CMD_ERROR 0x0004 // unused ! #define CMD_REQ_BLOCK 0x0005 #define CMD_DATA1 0x0006 #define CMD_DATA2 0x0007 // --- Packet Layer static int send_pkt(CalcHandle* handle, uint16_t cmd, uint16_t len, uint8_t* data) { uint16_t sum; uint8_t * buf = handle->buffer; // command buf[0] = LSB(cmd); buf[1] = MSB(cmd); // length buf[2] = LSB(len); buf[3] = MSB(len); // data if (data) { memcpy(buf+4, data, len); } // checksum sum = tifiles_checksum(buf, 4 + len); buf[len+4+0] = LSB(sum); buf[len+4+1] = MSB(sum); return ticables_cable_send(handle->cable, buf, len+6); } static inline int cmd_is_valid(uint16_t cmd) { switch(cmd) { case CMD_IS_READY: case CMD_OK: case CMD_KO: case CMD_EXIT: case CMD_REQ_SIZE: case CMD_ERROR: case CMD_REQ_BLOCK: case CMD_DATA1: case CMD_DATA2: return 1; default: return 0; } } static int recv_pkt(CalcHandle* handle, uint16_t* cmd, uint16_t* len, uint8_t* data) { int i, r, q; uint16_t sum, chksum; int ret; uint8_t * buf = handle->buffer; // Any packet has always at least 4 bytes (cmd, len) ret = ticables_cable_recv(handle->cable, buf, 4); if (!ret) { *cmd = (((uint16_t)buf[1]) << 8) | buf[0]; *len = (((uint16_t)buf[3]) << 8) | buf[2]; if (!cmd_is_valid(*cmd)) { ret = ERR_INVALID_CMD; goto exit; } if (*cmd == CMD_ERROR) { ret = ERR_ROM_ERROR; goto exit; } // compute chunks handle->priv.progress_min_size = 256; handle->priv.progress_blk_size = *len / 20; if (handle->priv.progress_blk_size == 0) { handle->priv.progress_blk_size = 1; } q = *len / handle->priv.progress_blk_size; r = *len % handle->priv.progress_blk_size; handle->updat->max1 = *len; handle->updat->cnt1 = 0; // recv full chunks for(i = 0; i < q; i++) { ret = ticables_cable_recv(handle->cable, &buf[i*handle->priv.progress_blk_size + 4], handle->priv.progress_blk_size); if (ret) { goto exit; } ticables_progress_get(handle->cable, NULL, NULL, &handle->updat->rate); handle->updat->cnt1 += handle->priv.progress_blk_size; if (*len > handle->priv.progress_min_size) { handle->updat->pbar(); } //if (handle->updat->cancel) // return ERR_ABORT; } // recv last chunk { ret = ticables_cable_recv(handle->cable, &buf[i*handle->priv.progress_blk_size + 4], (uint16_t)(r+2)); if (ret) { goto exit; } ticables_progress_get(handle->cable, NULL, NULL, &handle->updat->rate); handle->updat->cnt1 += 1; if (*len > handle->priv.progress_min_size) { handle->updat->pbar(); } if (handle->updat->cancel) { ret = ERR_ABORT; goto exit; } } // verify checksum chksum = (buf[*len+4 + 1] << 8) | buf[*len+4 + 0]; sum = tifiles_checksum(buf, *len + 4); //printf("<%04x %04x>\n", sum, chksum); if (chksum != sum) { ret = ERR_CHECKSUM; goto exit; } if (data) { memcpy(data, buf+4, *len); } } exit: return ret; } // --- Command Layer static int rom_send_RDY(CalcHandle* handle) { ticalcs_info(" PC->TI: IS_READY"); return send_pkt(handle, CMD_IS_READY, 0, NULL); } static int rom_recv_RDY(CalcHandle* handle) { uint16_t cmd, len; int ret; ret = recv_pkt(handle, &cmd, &len, NULL); ticalcs_info(" TI->PC: %s", ret ? "ERROR" : (cmd ? "OK" : "KO")); return ret; } static int rom_send_EXIT(CalcHandle* handle) { ticalcs_info(" PC->TI: EXIT"); return send_pkt(handle, CMD_EXIT, 0, NULL); } static int rom_recv_EXIT(CalcHandle* handle) { uint16_t cmd, len; int ret; ret = recv_pkt(handle, &cmd, &len, NULL); ticalcs_info(" TI->PC: EXIT"); return ret; } static int rom_send_SIZE(CalcHandle* handle) { ticalcs_info(" PC->TI: REQ_SIZE"); return send_pkt(handle, CMD_REQ_SIZE, 0, NULL); } static int rom_recv_SIZE(CalcHandle* handle, uint32_t* size) { uint16_t cmd, len; int ret; ret = recv_pkt(handle, &cmd, &len, (uint8_t *)size); ticalcs_info(" TI->PC: SIZE (0x%08x bytes)", *size); return ret; } static int rom_send_DATA(CalcHandle* handle, uint32_t addr) { ticalcs_info(" PC->TI: REQ_BLOCK at @%08x", addr); return send_pkt(handle, CMD_REQ_BLOCK, 4, (uint8_t *)&addr); } static int rom_recv_DATA(CalcHandle* handle, uint16_t* size, uint8_t* data) { uint16_t cmd; uint16_t rpt; int ret; ret = recv_pkt(handle, &cmd, size, data); if (!ret) { if (cmd == CMD_DATA1) { ticalcs_info(" TI->PC: BLOCK WITHOUT REPEATED DATA (0x%04x bytes)", *size); handle->priv.romdump_std_blk++; } else if (cmd == CMD_DATA2) { *size = (((uint16_t)data[1]) << 8) | data[0]; rpt = (((uint16_t)data[3]) << 8) | data[2]; memset(data, rpt, *size); ticalcs_info(" TI->PC: BLOCK WITH REPEATED DATA (0x%04x bytes)", *size); handle->priv.romdump_sav_blk++; } else { ret = ERR_INVALID_CMD; } } return ret; } /*static int rom_send_ERR(CalcHandle* handle) { ticalcs_info(" PC->TI: ERROR"); return send_pkt(handle, CMD_ERROR, 0, NULL); }*/ // --- Dumping Layer int rd_dump(CalcHandle* handle, const char *filename) { FILE *f; int ret = 0; uint32_t size; uint32_t addr; uint16_t length; uint32_t i; uint8_t * data; VALIDATE_HANDLE(handle); data = handle->buffer; f = fopen(filename, "wb"); if (f == NULL) { return ERR_OPEN_FILE; } ticalcs_strlcpy(update_->text, "Receiving data...", sizeof(update_->text)); update_label(); // check if ready for(i = 0; i < 3; i++) { ret = rom_send_RDY(handle); if (rom_recv_RDY(handle)) { goto exit; // Bail out. } if (!ret) { break; // Proceed further. } } // request ROM size if (rom_send_SIZE(handle)) { goto exit; } if (rom_recv_SIZE(handle, &size)) { goto exit; } // get packets handle->priv.romdump_std_blk = handle->priv.romdump_sav_blk = 0; for (addr = 0x0000; addr < size; ) { if (ret == ERR_ABORT) { goto exit; } // resync if error if (ret) { PAUSE(500); for(i = 0; i < MAX_RETRY; i++) { ret = rom_send_RDY(handle); if (ret) { continue; } ret = rom_recv_RDY(handle); if (ret) { continue; } } if (i == MAX_RETRY && ret) { goto exit; } ret = 0; } if(tifiles_calc_is_ti9x(handle->model) && addr >= 0x10000 && addr < 0x12000) { // certificate is read protected: skip memset(data, 0xff, length); if (fwrite(data, length, 1, f) < 1) { ret = ERR_SAVE_FILE; goto exit; } addr += length; continue; } // receive data ret = rom_send_DATA(handle, addr); if (ret) { continue; } ret = rom_recv_DATA(handle, &length, data); if (ret) { continue; } if (fwrite(data, length, 1, f) < 1) { ret = ERR_SAVE_FILE; goto exit; } addr += length; update_->cnt2 = addr; update_->max2 = size; update_->pbar(); } ticalcs_info("Saved %i blocks on %i blocks\n", handle->priv.romdump_sav_blk, handle->priv.romdump_sav_blk + handle->priv.romdump_std_blk); // finished exit: fclose(f); if (!ret) { PAUSE(200); ret = rom_send_EXIT(handle); if (!ret) { ret = rom_recv_EXIT(handle); } PAUSE(1000); } return ret; } int rd_is_ready(CalcHandle* handle) { int ret; VALIDATE_HANDLE(handle); ret = rom_send_RDY(handle); if (!ret) { ret = rom_recv_RDY(handle); } return ret; } int rd_send(CalcHandle *handle, const char *prgname, uint16_t size, uint8_t *data) { char *template, *tempfname; int fd, ret; VALIDATE_HANDLE(handle); /* Write ROM dumper to a temporary file (note that the file must have the correct suffix or tifiles_file_read_regular will be confused) */ template = g_strconcat("rdXXXXXX", strrchr(prgname, '.'), NULL); fd = g_file_open_tmp(template, &tempfname, NULL); g_free(template); if (fd == -1) { ret = ERR_FILE_OPEN; goto end; } ret = write(fd, data, size); close(fd); if (ret == size) { // Transfer program to calc handle->busy = 0; ret = ticalcs_calc_send_var2(handle, MODE_SEND_EXEC_ASM, tempfname); } else { ret = ERR_FATAL_ERROR; } g_unlink(tempfname); g_free(tempfname); end: return ret; } libticalcs-1.1.9+dfsg/src/romdump.h000066400000000000000000000021451327711501700172030ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs2 - hand-helds support library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __ROMDUMP_H__ #define __ROMDUMP_H__ int rd_dump(CalcHandle* handle, const char *filename); int rd_is_ready(CalcHandle* handle); int rd_send(CalcHandle *handle, const char *prgname, uint16_t size, uint8_t *data); #endif libticalcs-1.1.9+dfsg/src/romdump_834pce_usb/000077500000000000000000000000001327711501700207675ustar00rootroot00000000000000libticalcs-1.1.9+dfsg/src/romdump_834pce_usb/Makefile.am000066400000000000000000000005151327711501700230240ustar00rootroot00000000000000EXTRA_DIST = romdump.z80 CLEANFILES = *.bin *.lst *.8xp SPASMFLAGS = -E -N -T if BUILD_Z80_ROM_DUMPERS all: dump834pceu.8xp endif dump834pceu.bin: romdump.z80 $(SPASM) $(SPASMFLAGS) -A -DTI834PCE $(srcdir)/romdump.z80 dump834pceu.bin dump834pceu.8xp: dump834pceu.bin $(TIPACK) -n 'ROMDUMP' dump834pceu.bin -p -o dump834pceu.8xp libticalcs-1.1.9+dfsg/src/romdump_84p_usb/000077500000000000000000000000001327711501700203745ustar00rootroot00000000000000libticalcs-1.1.9+dfsg/src/romdump_84p_usb/Makefile.am000066400000000000000000000007641327711501700224370ustar00rootroot00000000000000EXTRA_DIST = romdump.z80 CLEANFILES = *.bin *.lst *.8xp SPASMFLAGS = -N -T if BUILD_Z80_ROM_DUMPERS all: dump84p.8xp dump84pcu.8xp endif dump84p.bin: romdump.z80 $(SPASM) $(SPASMFLAGS) -A -DTI84P $(srcdir)/romdump.z80 dump84p.bin dump84p.8xp: dump84p.bin $(TIPACK) -n 'ROMDUMP' dump84p.bin -p -o dump84p.8xp dump84pcu.bin: romdump.z80 $(SPASM) $(SPASMFLAGS) -A -DTI84PC $(srcdir)/romdump.z80 dump84pcu.bin dump84pcu.8xp: dump84pcu.bin $(TIPACK) -n 'ROMDUMP' dump84pcu.bin -p -o dump84pcu.8xp libticalcs-1.1.9+dfsg/src/romdump_89t_usb/000077500000000000000000000000001327711501700204055ustar00rootroot00000000000000libticalcs-1.1.9+dfsg/src/romdump_89t_usb/Makefile.am000066400000000000000000000011421327711501700224370ustar00rootroot00000000000000EXTRA_DIST = *.c *.h usb.txt CLEANFILES = *.89z TIGCCFLAGS = -Os -ffunction-sections -fdata-sections -Wall -W -Wwrite-strings -WA,-g,-t --optimize-nops --optimize-returns --optimize-branches --optimize-moves --optimize-tests --optimize-calcs --remove-unused --cut-ranges --reorder-sections --merge-constants --omit-bss-init if BUILD_68K_ROM_DUMPERS all: romdump.89z endif romdump.89z: romdump.c romdump.h dusb.h tigcc romdump.c -o "romdump" -n RomDump $(TIGCCFLAGS) -DUSE_TI89 -DMIN_AMS=100 -DUNOFFICIAL_OS_SUPPORT -DOPTIMIZE_ROM_CALLS -DKERNEL_FORMAT_BSS -DKERNEL_FORMAT_DATA_VAR -DSAVE_SCREEN --verbose libticalcs-1.1.9+dfsg/src/romdump_89t_usb/dusb.h000066400000000000000000000044421327711501700215170ustar00rootroot00000000000000// USB link routines (taken from Kevin's Backgammon game) // Copyright (c) 2004-2006 Kevin Kofler /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define XR_stringPtr_addr (_rom_call_addr(293)) #define push_offset_array_addr (_rom_call_addr(3c4)) #define IsSupportedAMS300 IsSupportedUSBAMS /* deprecated */ #define IsSupportedUSBAMS() (IsSupportedUSBAMS30x()||IsSupportedUSBAMS31x()) #define IsSupportedUSBAMS30x() (*(long long*)(XR_stringPtr_addr-116)==0x76021003261f4e75ll) #define IsSupportedUSBAMS31x() (*(long long*)(push_offset_array_addr-1112)==0x76021003261f4e75ll) #define DetectLinkInterface30x ((unsigned char(*)(void))(XR_stringPtr_addr-158)) #define DetectReceiveInterface30x ((unsigned char(*)(short))(XR_stringPtr_addr-108)) #define DetectLinkInterface31x ((unsigned char(*)(void))(push_offset_array_addr-1154)) #define DetectReceiveInterface31x ((unsigned char(*)(short))(push_offset_array_addr-1104)) #define DetectLinkInterface (IsSupportedUSBAMS31x()?DetectLinkInterface31x:DetectLinkInterface30x) #define DetectReceiveInterface (IsSupportedUSBAMS31x()?DetectReceiveInterface31x:DetectReceiveInterface30x) #define DetectUSB (*(short(**)(void))(DetectLinkInterface+4)) #define USBCheckReceived (*(void(**)(void))(DetectReceiveInterface+16)) #define USBCheckStatus (*(short(**)(void))(DetectReceiveInterface+22)) #define USB_SendData ((short (*)(const void *, size_t, long))(USBCheckStatus-494)) #define USB_RecvData ((short (*)(void *, size_t, long))(USBCheckStatus-246)) #define USBLinkClose ((short(*)(void))(USBCheckStatus-266)) #define USBLinkReset (*(void(**)(void))(DetectLinkInterface+36)) libticalcs-1.1.9+dfsg/src/romdump_89t_usb/romdump.c000066400000000000000000000127641327711501700222460ustar00rootroot00000000000000///* Hey EMACS -*- linux-c -*- */ /* RomDumper - an TI89/92/92+/V200PLT/Titanium ROM dumper * * Copyright (c) 2004-2005, Romain Liévin for the TiLP and TiEmu projects * Copyright (c) 2006, Romain Liévin for the Direct USB port * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Note: this program could be optimized because I didn't write it with embedded view in mind. */ #include // Include All Header Files #include "romdump.h" #include "dusb.h" #define ROM_size ((uint32_t)(0x200000 << (V200 || ((uint32_t)ROM_base == 0x800000)))) // --- Packet Layer #define BLK_SIZE (4096) static uint16_t CheckSum(uint8_t* data, uint16_t len) { uint16_t i; uint16_t sum = 0; for(i = 0; i < len; i++) { sum += data[i]; } return sum; } static int SendPacket(uint8_t* buf, uint16_t cmd, uint16_t len, uint8_t* data) { short ret; uint16_t sum; // command & length buf[0] = LSB(cmd); buf[1] = MSB(cmd); buf[2] = LSB(len); buf[3] = MSB(len); ret = USB_SendData(buf, 4, TIMEOUT); if(ret) return ret; // data ret = USB_SendData(data, len, TIMEOUT); if(ret) return ret; // checksum sum = CheckSum(buf, 4) + CheckSum(data, len); buf[0] = LSB(sum); buf[1] = MSB(sum); // send ret = USB_SendData(buf, 2, TIMEOUT); if(ret) return ret; return 0; } static int RecvPacket(uint8_t* buf, uint16_t* cmd, uint16_t* len, uint8_t* data) { short ret; uint16_t sum, tmp; // default values *cmd = CMD_NONE; *len = 0; // any packet has always at least 4 bytes (cmd, len) ret = USB_RecvData(buf, 4, TIMEOUT); if(ret) return ret; *cmd = (buf[1] << 8) | buf[0]; *len = (buf[3] << 8) | buf[2]; tmp = CheckSum(buf, 4); // data part if(data) { ret = USB_RecvData(data, *len, TIMEOUT); if(ret) return ret; } // checksum ret = USB_RecvData(buf+*len, 2, TIMEOUT); if(ret) return ret; sum = (buf[*len+1] << 8) | buf[*len+0]; if (sum != CheckSum(data, *len) + tmp) return -1; return 0; } // --- Command Layer static inline int Send_OK(uint8_t* buf) { return SendPacket(buf, CMD_OK, 0, NULL); } static inline int Send_KO(uint8_t* buf) { return SendPacket(buf, CMD_KO, 0, NULL); } static inline int Send_SIZE(uint8_t* buf, uint32_t size) { uint32_t le_size = LE_BE(size); return SendPacket(buf, CMD_REQ_SIZE, 4, (uint8_t *)&le_size); } static inline int Send_DATA(uint8_t* buf, uint16_t len, uint8_t* data) { return SendPacket(buf, CMD_DATA1, len, data); } static inline int Send_RDATA(uint8_t* buf, uint16_t data) { uint8_t tmp[4]; tmp[0] = LSB(BLK_SIZE); tmp[1] = MSB(BLK_SIZE); tmp[2] = LSB(data); tmp[3] = MSB(data); return SendPacket(buf, CMD_DATA2, 4, tmp); } static inline int Send_EXIT(uint8_t* buf) { return SendPacket(buf, CMD_EXIT, 0, NULL); } static inline int Send_ERR(uint8_t* buf) { return SendPacket(buf, CMD_ERROR, 0, NULL); } // --- Dumper Layer static int Dump(uint8_t* buf) { int exit = 0; int ret; uint16_t cmd, len; uint32_t addr; char str[30]; unsigned int i; uint8_t* ptr; while(!exit) { // wait for command ret = RecvPacket(buf, &cmd, &len, buf); //if(ret) continue; // pb with ret val // or keypress if(kbhit()) exit = !0; // and process switch(cmd) { case CMD_IS_READY: Send_OK(buf); break; case CMD_EXIT: Send_EXIT(buf); exit = !0; break; case CMD_REQ_SIZE: Send_SIZE(buf, ROM_size); sprintf(str, "Size: %lu KB", ROM_size >> 10); DrawStr(0, 60, str, A_REPLACE); break; case CMD_REQ_BLOCK: addr = ((uint32_t)buf[0] << 0); addr |= ((uint32_t)buf[1] << 8); addr |= ((uint32_t)buf[2] << 16); addr |= ((uint32_t)buf[3] << 24); if(addr > ROM_size) Send_ERR(buf); #if 0 if(addr >= 0x10000 && addr < 0x12000) // read protected (certificate) addr = 0; if(addr >= 0x18000 && addr < 0x1A000) // read protected (certificate) addr = 0; #endif //sprintf(str, "%02x %02x %02x %02x ", buf[0], buf[1], buf[2], buf[3]); //DrawStr(0, 80, str, A_REPLACE); sprintf(str, "Done: %lu/%luKB ", addr >> 10, ROM_size >> 10); DrawStr(0, 60, str, A_REPLACE); // Check for filled blocks (like 0xff) ptr = (uint8_t *)(ROM_base + addr); for(i = 0; i < BLK_SIZE; i++) if(ptr[i] != ptr[0]) break; if(i == BLK_SIZE) Send_RDATA(buf, ptr[0]); else Send_DATA(buf, BLK_SIZE, (uint8_t *)(ROM_base + addr)); break; case CMD_NONE: break; default: break; } } USBLinkClose(); return 0; } // --- Main Function void _main(void) { char str[30]; uint8_t buf[BLK_SIZE + 3*2]; ClrScr (); FontSetSys (F_8x10); sprintf(str, "RomDumper v%s", VERSION); DrawStr(0, 0, str, A_NORMAL); sprintf(str, "Type: HW%i", HW_VERSION); DrawStr(0, 20, str, A_NORMAL); sprintf(str, "ROM base: 0x%lx", (uint32_t)ROM_base); DrawStr(0, 40, str, A_NORMAL); sprintf(str, "by The TiLP Team"); DrawStr(0, 80, str, A_NORMAL); Dump(buf); return; } libticalcs-1.1.9+dfsg/src/romdump_89t_usb/romdump.h000066400000000000000000000027301327711501700222430ustar00rootroot00000000000000/* RomDumper - an TI89/92/92+/V200PLT/Titanium ROM dumper * * Copyright (c) 2004-2005, Romain Liévin for the TiLP and TiEmu projects * Copyright (c) 2006, Romain Liévin for the Direct USB port * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define VERSION "1.02 USB" // Version #define TIMEOUT 2000 // in ms /* CMD | LEN | DATA | CHK */ #define CMD_IS_READY 0xAA55 #define CMD_KO 0x0000 #define CMD_OK 0x0001 #define CMD_EXIT 0x0002 #define CMD_REQ_SIZE 0x0003 #define CMD_ERROR 0x0004 // unused ! #define CMD_REQ_BLOCK 0x0005 #define CMD_DATA1 0x0006 #define CMD_DATA2 0x0007 #define CMD_NONE 0xffff #define MSB(v) (v >> 8) #define LSB(v) (v & 0xff) #define LE_BE(v) (((v & 0xff000000) >> 24) | ((v & 0x00ff0000) >> 8) | ((v & 0x0000ff00) << 8) | ((v & 0x000000ff) << 24)) libticalcs-1.1.9+dfsg/src/romdump_89t_usb/usb.txt000066400000000000000000000141721327711501700217440ustar00rootroot00000000000000Kevin Kofler's doc. Thanks from roms ! Preliminary doc: unsigned char DetectLinkInterface(void); (0x8d2572/0x8d2c92/0x949c72) Detects if the USB link is usable. Returns 1 (USB preferred) if it is and 2 (legacy DBus IO preferred) if it isn't. This routine uses DetectUSB first, and then runs a complex test transfer to double-check. This test transfer needs to be handled on the receiving side as well, so it is usually easier to just use DetectUSB. short DetectUSB(void); (0x94a174/0x950fdc/0x8864de) Quickly detects if the USB link is usable. Returns 0 if USB is available, or a non-zero error code if it isn't. unsigned char DetectReceiveInterface(short allowLIO); (0x8d25a4/0x8d2cc4/0x949ca4) Waits for a calculator to connect on either the USB or the LIO interface. Returns: * 0 if something is detected on the USB link. * 2 if allowLIO is non-zero, nothing is detected on the USB link and something is detected on the LIO link. * 3 if interrupted by the user ([ON] key). If you want to wait for something to be received on the USB link, DetectReceiveInterface(FALSE) is the function to use, but there's a catch: only one calculator can use DetectReceiveInterface for each transfer. (USB is a host/client protocol.) You absolutely MUST call USBReset on both calculators before using DetectReceiveInterface on the other calculator. This is very much unlike the LIO interface, which is peer-to-peer. Also, the other calculator MUST call DetectUSB to synchronize with a DetectReceiveInterface call. To sum up, for a transfer which is synchronized by the sender (such as a move in a turn-based game), the sending calculator should call: USBLinkClose(); USBLinkReset(); DetectUSB(); USB_SendData(src,size,2000);, the receiving calculator should call: USBLinkClose(); USBLinkReset(); DetectReceiveInterface(FALSE); USB_RecvData(src,size,2000);. short USB_SendData(const void *buffer, size_t size, long timeout); (0x949b86/0x94a36e/0x9433d2) Sends size bytes from buffer over the USB link. For "timeout", try 2000. (I am not sure this is actually a timeout. AMS always uses 2000, so you should do the same.) Returns 0 if successful, some non-0 error code otherwise. short USB_RecvData(void *buffer, size_t size, long timeout); (0x949c7e/0x94a466/0x9434ca) Receives size bytes into buffer from the USB link. For "timeout", try 2000. (I am not sure this is actually a timeout. AMS always uses 2000, so you should do the same.) Returns 0 if successful, some non-0 error code otherwise. short USBLinkClose(void); (0x949c6a/0x94a452/0x9434b6) This function is used by AMS to finalize a file transfer. Returns 0 if successful, some non-0 error code otherwise. void USBLinkReset(void); (0x94a284/0x950ffe/0x886500) This function closes and resets the USB link. It is used by AMS when done with an USB transfer, and sometimes also before initiating one. You should always call this function when done with a transfer. void USBCheckReceived(void); (0x9480d4/0x9488bc/0x9416f6) Subroutine of DetectReceiveInterface. Checks whether something is received on the USB link. See USBCheckStatus. Important: The "catch" described for DetectReceiveInterface also applies to this subroutine. short USBCheckStatus(void); (0x949d74/0x94a55c/0x9435c0) Subroutine of DetectReceiveInterface. Checks whether USBCheckReceived was successful, i.e. something was received on the USB link. USBCheckReceived (or possibly some other status checking routine, but that's the one I know about) must have been called first for this routine to return meaningful results. Returns 1 on success, 0 on failure. Hacks (AMS 3.00/3.01): IsSupportedAMS300: long long at XR_stringPtr-116 is 76021003261f4e75 DetectLinkInterface = XR_stringPtr-158 DetectReceiveInterface = XR_stringPtr-108 Hacks (AMS 3.10): IsSupportedAMS300: long long at push_offset_array-1112 is 76021003261f4e75 DetectLinkInterface = push_offset_array-1154 DetectReceiveInterface = push_offset_array-1104 Hacks (all AMS): DetectUSB: address is at DetectLinkInterface+4. USBCheckReceived: address is at DetectReceiveInterface+16 USBCheckStatus: address is at DetectReceiveInterface+22 USB_SendData = USBCheckStatus-494 USB_RecvData = USBCheckStatus-246 USBLinkClose = USBCheckStatus-266 USBLinkReset: address is at DetectLinkInterface+36. // USB link routines #define XR_stringPtr_addr (_rom_call_addr(293)) #define push_offset_array_addr (_rom_call_addr(3c4)) #define IsSupportedAMS300 IsSupportedUSBAMS /* deprecated */ #define IsSupportedUSBAMS() (IsSupportedUSBAMS30x()||IsSupportedUSBAMS31x()) #define IsSupportedUSBAMS30x() (*(long long*)(XR_stringPtr_addr-116)==0x76021003261f4e75ll) #define IsSupportedUSBAMS31x() (*(long long*)(push_offset_array_addr-1112)==0x76021003261f4e75ll) #define DetectLinkInterface30x ((unsigned char(*)(void))(XR_stringPtr_addr-158)) #define DetectReceiveInterface30x ((unsigned char(*)(short))(XR_stringPtr_addr-108)) #define DetectLinkInterface31x ((unsigned char(*)(void))(push_offset_array_addr-1154)) #define DetectReceiveInterface31x ((unsigned char(*)(short))(push_offset_array_addr-1104)) #define DetectLinkInterface (IsSupportedUSBAMS31x()?DetectLinkInterface31x:DetectLinkInterface30x) #define DetectReceiveInterface (IsSupportedUSBAMS31x()?DetectReceiveInterface31x:DetectReceiveInterface30x) #define DetectUSB (*(short(**)(void))(DetectLinkInterface+4)) #define USBCheckReceived (*(void(**)(void))(DetectReceiveInterface+16)) #define USBCheckStatus (*(short(**)(void))(DetectReceiveInterface+22)) #define USB_SendData ((short (*)(const void *, size_t, long))(USBCheckStatus-494)) #define USB_RecvData ((short (*)(void *, size_t, long))(USBCheckStatus-246)) #define USBLinkClose ((short(*)(void))(USBCheckStatus-266)) #define USBLinkReset (*(void(**)(void))(DetectLinkInterface+36)) Possible hacks: DetectLinkInterface: search for 76021003261f4e75, subtract 42. (Backwards search from XR_stringPtr=0x2d2610? XR_stringPtr-158?) DetectReceiveInterface: search for 76021003261f4e75, add 8. (Backwards search from XR_stringPtr=0x2d2610? XR_stringPtr-108?) USB_SendData = USBLinkClose-228 USB_RecvData = USBLinkClose+20 Signatures: USB_SendData, USB_RecvData: 4e56ffe848ee1c18ffec4a79 USB_LinkClose: 3f3900008xxx4ebafdc8548f (xxx=55C for 3.00, 560 for 3.01, a84 for 3.10) libticalcs-1.1.9+dfsg/src/romdump_8x/000077500000000000000000000000001327711501700174475ustar00rootroot00000000000000libticalcs-1.1.9+dfsg/src/romdump_8x/Makefile.am000066400000000000000000000042741327711501700215120ustar00rootroot00000000000000EXTRA_DIST = *.asm *.inc CLEANFILES = *.bin *.lst *.73p *.82y *.83p *.8xp *.85s *.86p SPASMFLAGS = -N -T rom_dumpers = dump73.73p dump82.82y dump83.83p dump83p.8xp dump84pc.8xp dump85.85s dump86.86p if BUILD_Z80_ROM_DUMPERS all: $(rom_dumpers) endif dump73.bin: romdump.asm romdump.inc ti73defs.inc defs.inc main.asm \ unlock73.asm packet.asm link.asm linksw.asm data.asm $(SPASM) $(SPASMFLAGS) -A -DTI73 -I $(srcdir) $(srcdir)/romdump.asm dump73.bin dump82.bin: romdump.asm romdump.inc ti82defs.inc defs.inc main.asm \ packet.asm link.asm linksw.asm display.asm display82.asm data.asm \ font.asm $(SPASM) $(SPASMFLAGS) -A -DTI82 -I $(srcdir) $(srcdir)/romdump.asm dump82.bin dump83.bin: romdump.asm romdump.inc ti83defs.inc defs.inc main.asm \ packet.asm link.asm linksw.asm data.asm $(SPASM) $(SPASMFLAGS) -A -DTI83 -I $(srcdir) $(srcdir)/romdump.asm dump83.bin dump83p.bin: romdump.asm romdump.inc ti83pdefs.inc defs.inc main.asm \ unlock83p.asm packet.asm link.asm link83p.asm data.asm $(SPASM) $(SPASMFLAGS) -A -DTI83P -I $(srcdir) $(srcdir)/romdump.asm dump83p.bin dump84pc.bin: romdump.asm romdump.inc ti84pcdefs.inc defs.inc main.asm \ packet.asm link.asm link83p.asm data.asm $(SPASM) $(SPASMFLAGS) -A -DTI84PC -I $(srcdir) $(srcdir)/romdump.asm dump84pc.bin dump85.bin: romdump.asm romdump.inc ti85defs.inc defs.inc main.asm \ packet.asm link.asm linksw.asm display.asm display85.asm data.asm \ font.asm $(SPASM) $(SPASMFLAGS) -A -DTI85 -I $(srcdir) $(srcdir)/romdump.asm dump85.bin dump86.bin: romdump.asm romdump.inc ti86defs.inc defs.inc main.asm \ packet.asm link.asm linksw.asm data.asm $(SPASM) $(SPASMFLAGS) -A -DTI86 -I $(srcdir) $(srcdir)/romdump.asm dump86.bin dump73.73p: dump73.bin $(TIPACK) -n 'ROMDUMP' dump73.bin -p -o dump73.73p dump82.82y: dump82.bin $(TIPACK) -n '$$RD' dump82.bin -o dump82.82y dump83.83p: dump83.bin $(TIPACK) -n 'ROMDUMP' dump83.bin -p -o dump83.83p dump83p.8xp: dump83p.bin $(TIPACK) -n 'ROMDUMP' dump83p.bin -p -o dump83p.8xp dump84pc.8xp: dump84pc.bin $(TIPACK) -n 'ROMDUMP' dump84pc.bin -p -o dump84pc.8xp dump85.85s: dump85.bin $(TIPACK) -n '$$RD' dump85.bin -o dump85.85s dump86.86p: dump86.bin $(TIPACK) -n 'ROMDump' dump86.bin -o dump86.86p libticalcs-1.1.9+dfsg/src/romdump_9x/000077500000000000000000000000001327711501700174505ustar00rootroot00000000000000libticalcs-1.1.9+dfsg/src/romdump_9x/Makefile.am000066400000000000000000000015001327711501700215000ustar00rootroot00000000000000EXTRA_DIST = *.c *.h *.tpr CLEANFILES = *.89z *.9xz *.v2z *.92p TIGCCFLAGS = -Os -ffunction-sections -fdata-sections -Wall -W -Wwrite-strings -WA,-g,-t --optimize-nops --optimize-returns --optimize-branches --optimize-moves --optimize-tests --optimize-calcs --remove-unused --cut-ranges --reorder-sections --merge-constants --omit-bss-init if BUILD_68K_ROM_DUMPERS all: romdump.89z romdump.92p endif romdump.89z: romdump.c romdump.h tigcc romdump.c -o "romdump" -n RomDump $(TIGCCFLAGS) -DUSE_TI89 -DUSE_TI92PLUS -DUSE_V200 -DMIN_AMS=100 -DUNOFFICIAL_OS_SUPPORT -DOPTIMIZE_ROM_CALLS -DKERNEL_FORMAT_BSS -DKERNEL_FORMAT_DATA_VAR -DSAVE_SCREEN --verbose romdump.92p: romdump.c romdump.h fargodef.h romdump.89z tigcc romdump.c -o "romdump" -n RomDump $(TIGCCFLAGS) --fargo -DKERNEL_FORMAT_BSS -DKERNEL_FORMAT_DATA_VAR --verbose libticalcs-1.1.9+dfsg/src/romdump_9x/fargodef.h000066400000000000000000000050321327711501700213760ustar00rootroot00000000000000// Miscellaneous defines - there are no official TIGCC headers for Fargo yet. // Copyright (c) 2004-2006 Kevin Kofler /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define NULL ((void *) 0) // The LIO functions in the TI-92 ROM are not exported by Fargo. unsigned short (*LIO_SendData) (const void *src, unsigned long size); unsigned short (*LIO_RecvData) (void *dest, unsigned long size, unsigned long WaitDelay); #define __kb_globals tios__001b extern void __kb_globals; #define kbhit() (*(volatile short*)(&__kb_globals+0x1c)) #define sprintf tios__000f short sprintf (char *buffer, const char *format, ...); #define DrawStr tios__0010 void DrawStr (short x, short y, const char *str, short Attr); enum Attrs {A_REVERSE, A_NORMAL, A_XOR, A_SHADED, A_REPLACE, A_OR, A_AND, A_THICK1, A_SHADE_V, A_SHADE_H, A_SHADE_NS, A_SHADE_PS}; #define __ROM_base tios__0025 extern void __attribute__((may_alias)) __ROM_base; #define ROM_base (&__ROM_base) // ROM_base + 0xc4 (49*4) contains the used ROM size - 4, round up to full 1 or 2 MB #define ROM_size ((49[(unsigned long *)ROM_base] + 0xffffful) & 0xfff00000ul) #define TI92_VERSION ((int)(ROM_size>>20)) #define ERD_dialog tios__002F short ERD_dialog (short err_no, short prog_flag); #define OSLinkTxQueueInquire tios__0008 unsigned short OSLinkTxQueueInquire (void); #define OSReadLinkBlock tios__000A unsigned short OSReadLinkBlock (char *buffer, unsigned short num); #define memset tios__0032 void *memset (void *buffer, short c, unsigned long num); #define __tios_globals tios__001C extern void __tios_globals; #define LCD_MEM (&__tios_globals) #define ClrScr() memset(LCD_MEM,0,3840); #define FontSetSys tios__0012 unsigned char FontSetSys (short Font); enum Fonts {F_4x6, F_6x8, F_8x10}; #define OSLinkReset tios__0006 void OSLinkReset (void); typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned long uint32_t; libticalcs-1.1.9+dfsg/src/romdump_9x/romdump-fargo.tpr000066400000000000000000000022511327711501700227560ustar00rootroot00000000000000[Settings] Archive=0 Pack=0 Packed Variable= Project Name=RomDump GCC Switches=-Os -ffunction-sections -fdata-sections -Wall -W -Wwrite-strings Assembler Switches=-g -t GNU Assembler Switches= Debug Info=0 Standard Library=1 Command Line= Post-Build Process= Use Data Variable=0 Data Variable= Copy Data Variable=1 Copy Data Variable if Archived=1 Optimize NOPs=1 Optimize Returns=1 Optimize Branches=1 Optimize Moves=1 Optimize Tests=1 Optimize Calculations=1 Remove Unused Sections=1 Binary Output=0 Fargo=1 Flash OS=0 Cut Unused Ranges=1 Reorder Sections=1 Merge Constants=1 Initialize BSS=0 [Library Options] Use TI-89=0 Use TI-92 Plus=0 Use V200=0 Optimize Calc Consts=0 Use Kernel=0 Use PreOS=0 Minimum AMS Version Defined=0 Minimum AMS Version=1.00 Unofficial OS Support=0 Reloc Format=AMS ROM Call Format=Direct BSS Ref Format=Kernel Data Ref Format=Kernel Use F-Line Jumps=0 Use 4-Byte F-Line Jumps=0 Use Internal F-Line Emulator=0 Use Return Value=0 Enable Error Return=0 Save Screen=0 Optimize ROM Calls=0 [File Editing] Open File= [Included Files] C File 1=romdump.c Header File 1=romdump.h Header File 2=fargodef.h libticalcs-1.1.9+dfsg/src/romdump_9x/romdump.c000066400000000000000000000134041327711501700213010ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* RomDumper - an TI89/92/92+/V200PLT/Titanium ROM dumper * * Copyright (c) 2004-2005, Romain Liévin for the TiLP and TiEmu projects * Copyright (c) 2005, Kevin Kofler for the Fargo-II port * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Note: this program could be optimized because I didn't write it with embedded view in mind. */ #ifdef FARGO #include "fargodef.h" #else #include // Include All Header Files #define ROM_size ((uint32_t)(0x200000 << (V200 || ((uint32_t)ROM_base == 0x800000)))) #endif #include "romdump.h" // --- Packet Layer #define BLK_SIZE (4096) static uint16_t CheckSum(uint8_t* data, uint16_t len) { uint16_t i; uint16_t sum = 0; for(i = 0; i < len; i++) { sum += data[i]; } return sum; } static int SendPacket(uint8_t* buf, uint16_t cmd, uint16_t len, uint8_t* data) { short ret; uint16_t sum; // command & length buf[0] = LSB(cmd); buf[1] = MSB(cmd); buf[2] = LSB(len); buf[3] = MSB(len); ret = LIO_SendData(buf, 4); if(ret) return ret; // data ret = LIO_SendData(data, len); if(ret) return ret; // checksum sum = CheckSum(buf, 4) + CheckSum(data, len); buf[0] = LSB(sum); buf[1] = MSB(sum); // send ret = LIO_SendData(buf, 2); if(ret) return ret; return 0; } static int RecvPacket(uint8_t* buf, uint16_t* cmd, uint16_t* len, uint8_t* data) { short ret; uint16_t sum, tmp; // default values *cmd = CMD_NONE; *len = 0; // any packet has always at least 4 bytes (cmd, len) ret = LIO_RecvData(buf, 4, TIMEOUT); if(ret) return ret; *cmd = (buf[1] << 8) | buf[0]; *len = (buf[3] << 8) | buf[2]; tmp = CheckSum(buf, 4); // data part if(data) { ret = LIO_RecvData(data, *len, TIMEOUT); if(ret) return ret; } // checksum ret = LIO_RecvData(buf+*len, 2, TIMEOUT); if(ret) return ret; sum = (buf[*len+1] << 8) | buf[*len+0]; if (sum != CheckSum(data, *len) + tmp) return -1; return 0; } // --- Command Layer static inline int Send_OK(uint8_t* buf) { return SendPacket(buf, CMD_OK, 0, NULL); } static inline int Send_KO(uint8_t* buf) { return SendPacket(buf, CMD_KO, 0, NULL); } static inline int Send_SIZE(uint8_t* buf, uint32_t size) { uint32_t le_size = LE_BE(size); return SendPacket(buf, CMD_REQ_SIZE, 4, (uint8_t *)&le_size); } static inline int Send_DATA(uint8_t* buf, uint16_t len, uint8_t* data) { return SendPacket(buf, CMD_DATA1, len, data); } static inline int Send_RDATA(uint8_t* buf, uint16_t data) { uint8_t tmp[4]; tmp[0] = LSB(BLK_SIZE); tmp[1] = MSB(BLK_SIZE); tmp[2] = LSB(data); tmp[3] = MSB(data); return SendPacket(buf, CMD_DATA2, 4, tmp); } static inline int Send_EXIT(uint8_t* buf) { return SendPacket(buf, CMD_EXIT, 0, NULL); } static inline int Send_ERR(uint8_t* buf) { return SendPacket(buf, CMD_ERROR, 0, NULL); } // --- Dumper Layer static int Dump(uint8_t* buf) { int exit = 0; int ret; uint16_t cmd, len; uint32_t addr; char str[30]; unsigned int i; uint8_t* ptr; while(!exit) { // wait for command ret = RecvPacket(buf, &cmd, &len, buf); //if(ret) continue; // pb with ret val // or keypress if(kbhit()) exit = !0; // and process switch(cmd) { case CMD_IS_READY: Send_OK(buf); break; case CMD_EXIT: Send_EXIT(buf); exit = !0; break; case CMD_REQ_SIZE: Send_SIZE(buf, ROM_size); sprintf(str, "Size: %lu KB", ROM_size >> 10); DrawStr(0, 60, str, A_REPLACE); break; case CMD_REQ_BLOCK: addr = ((uint32_t)buf[0] << 0); addr |= ((uint32_t)buf[1] << 8); addr |= ((uint32_t)buf[2] << 16); addr |= ((uint32_t)buf[3] << 24); if(addr > ROM_size) Send_ERR(buf); #if 0 if(addr >= 0x10000 && addr < 0x12000) // read protected (certificate) addr = 0; if(addr >= 0x18000 && addr < 0x1A000) // read protected (certificate) addr = 0; #endif sprintf(str, "Done: %lu/%luKB ", addr >> 10, ROM_size >> 10); DrawStr(0, 60, str, A_REPLACE); // Check for filled blocks (like 0xff) ptr = (uint8_t *)(ROM_base + addr); for(i = 0; i < BLK_SIZE; i++) if(ptr[i] != ptr[0]) break; if(i == BLK_SIZE) Send_RDATA(buf, ptr[0]); else Send_DATA(buf, BLK_SIZE, (uint8_t *)(ROM_base + addr)); break; case CMD_NONE: break; default: break; } } //OSLinkClose(); return 0; } // --- Main Function void _main(void) { char str[30]; uint8_t buf[BLK_SIZE + 3*2]; #ifdef FARGO // Ugly hack to find LIO_SendData and LIO_RecvData... LIO_SendData=(void*)ERD_dialog; while (*(void**)LIO_SendData!=OSLinkTxQueueInquire) LIO_SendData+=2; LIO_RecvData=(void*)LIO_SendData; LIO_SendData-=28; while (*(void**)LIO_RecvData!=OSReadLinkBlock) LIO_RecvData+=2; LIO_RecvData-=150; #endif ClrScr (); FontSetSys (F_8x10); sprintf(str, "RomDumper v%s", VERSION); DrawStr(0, 0, str, A_NORMAL); #ifdef FARGO sprintf(str, "Type: TI-92 %i", TI92_VERSION); #else sprintf(str, "Type: HW%i", HW_VERSION); #endif DrawStr(0, 20, str, A_NORMAL); sprintf(str, "ROM base: 0x%lx", (uint32_t)ROM_base); DrawStr(0, 40, str, A_NORMAL); sprintf(str, "by The TiLP Team"); DrawStr(0, 80, str, A_NORMAL); Dump(buf); return; } libticalcs-1.1.9+dfsg/src/romdump_9x/romdump.h000066400000000000000000000027301327711501700213060ustar00rootroot00000000000000/* RomDumper - an TI89/92/92+/V200PLT/Titanium ROM dumper * * Copyright (c) 2004-2005, Romain Liévin for the TiLP and TiEmu projects * Copyright (c) 2005, Kevin Kofler for the Fargo-II port * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define VERSION "1.02" // Version #define TIMEOUT 20 // 1s x 20 ticks /* CMD | LEN | DATA | CHK */ #define CMD_IS_READY 0xAA55 #define CMD_KO 0x0000 #define CMD_OK 0x0001 #define CMD_EXIT 0x0002 #define CMD_REQ_SIZE 0x0003 #define CMD_ERROR 0x0004 // unused ! #define CMD_REQ_BLOCK 0x0005 #define CMD_DATA1 0x0006 #define CMD_DATA2 0x0007 #define CMD_NONE 0xffff #define MSB(v) (v >> 8) #define LSB(v) (v & 0xff) #define LE_BE(v) (((v & 0xff000000) >> 24) | ((v & 0x00ff0000) >> 8) | ((v & 0x0000ff00) << 8) | ((v & 0x000000ff) << 24)) libticalcs-1.1.9+dfsg/src/romdump_9x/romdump.tpr000066400000000000000000000022171327711501700216640ustar00rootroot00000000000000[Settings] Archive=0 Pack=0 Packed Variable= Project Name=RomDump GCC Switches=-Os -ffunction-sections -fdata-sections -Wall -W -Wwrite-strings Assembler Switches=-g -t GNU Assembler Switches= Debug Info=0 Standard Library=1 Command Line= Post-Build Process= Use Data Variable=0 Data Variable= Copy Data Variable=1 Copy Data Variable if Archived=1 Optimize NOPs=1 Optimize Returns=1 Optimize Branches=1 Optimize Moves=1 Optimize Tests=1 Optimize Calculations=1 Remove Unused Sections=1 Binary Output=0 Fargo=0 Flash OS=0 Cut Unused Ranges=1 Reorder Sections=1 Merge Constants=1 Initialize BSS=0 [Library Options] Use TI-89=1 Use TI-92 Plus=1 Use V200=1 Optimize Calc Consts=0 Use Kernel=0 Use PreOS=0 Minimum AMS Version Defined=1 Minimum AMS Version=1.00 Unofficial OS Support=1 Reloc Format=AMS ROM Call Format=Direct BSS Ref Format=Kernel Data Ref Format=Kernel Use F-Line Jumps=0 Use 4-Byte F-Line Jumps=0 Use Internal F-Line Emulator=0 Use Return Value=0 Enable Error Return=0 Save Screen=1 Optimize ROM Calls=1 [File Editing] Open File= [Included Files] C File 1=romdump.c Header File 1=romdump.h libticalcs-1.1.9+dfsg/src/screen.c000066400000000000000000000313341327711501700167740ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * Copyright (C) 2015 Lionel Debroux * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "ticalcs.h" #include "gettext.h" #include "internal.h" #include "logging.h" #include "error.h" /** * ticalcs_screen_convert_bw_to_rgb888: * @src: source bitmap (1-bit pixels) to be converted. * @width: width of the bitmap in pixels, assumed to be be a multiple of 8. * @height: height of the bitmap in pixels * @dst: storage space for the converted bitmap, must be at least 3 * width * height bytes large * * Convert 1-bit B/W bitmap to RGB888, the output bitmap uses black and white pixels. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_screen_convert_bw_to_rgb888(const uint8_t * src, unsigned int width, unsigned int height, uint8_t * dst) { unsigned int i; VALIDATE_NONNULL(src); VALIDATE_SCREENWIDTH(width); VALIDATE_SCREENHEIGHT(height); VALIDATE_NONNULL(dst); for (i = 0; i < height; i++) { unsigned int j; for (j = 0; j < (width >> 3); j++) { uint8_t data = *src++; uint8_t mask = 0x80; unsigned int bit; for (bit = 0; bit < 8; bit++) { if (data & mask) { *dst++ = 0x00; *dst++ = 0x00; *dst++ = 0x00; } else { *dst++ = 0xFF; *dst++ = 0xFF; *dst++ = 0xFF; } mask >>= 1; } } } return 0; } /** * ticalcs_screen_convert_bw_to_blurry_rgb888: * @src: source bitmap (1-bit pixels) to be converted. * @width: width of the bitmap in pixels, assumed to be be a multiple of 8. * @height: height of the bitmap in pixels * @dst: storage space for the converted bitmap, must be at least 3 * width * height bytes large * * Convert 1-bit B/W bitmap to RGB888, the output bitmap uses a pair of colors mimicking old TI-Z80 / TI-68k screens. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_screen_convert_bw_to_blurry_rgb888(const uint8_t * src, unsigned int width, unsigned int height, uint8_t * dst) { unsigned int i; VALIDATE_NONNULL(src); VALIDATE_SCREENWIDTH(width); VALIDATE_SCREENHEIGHT(height); VALIDATE_NONNULL(dst); for (i = 0; i < height; i++) { unsigned int j; for (j = 0; j < (width >> 3); j++) { uint8_t data = *src++; uint8_t mask = 0x80; unsigned int bit; for (bit = 0; bit < 8; bit++) { if (data & mask) { *dst++ = 0x00; *dst++ = 0x00; *dst++ = 0x34; } else { *dst++ = 0xA8; *dst++ = 0xB4; *dst++ = 0xA8; } mask >>= 1; } } } return 0; } /** * ticalcs_screen_convert_gs4_to_rgb888: * @src: source bitmap (4-bit pixels) to be converted. * @width: width of the bitmap in pixels, assumed to be even. * @height: height of the bitmap in pixels * @dst: storage space for the converted bitmap, must be at least 3 * width * height bytes large * * Convert 4-bit grayscale bitmap to RGB888. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_screen_convert_gs4_to_rgb888(const uint8_t * src, unsigned int width, unsigned int height, uint8_t * dst) { unsigned int i; VALIDATE_NONNULL(src); VALIDATE_SCREENWIDTH(width); VALIDATE_SCREENHEIGHT(height); VALIDATE_NONNULL(dst); for (i = 0; i < height; i++) { unsigned int j; for (j = 0; j < width / 2; j++) { uint8_t data = *src++; uint8_t hi = data >> 4; uint8_t lo = data & 0x0f; *dst++ = hi << 4; *dst++ = hi << 4; *dst++ = hi << 4; *dst++ = lo << 4; *dst++ = lo << 4; *dst++ = lo << 4; } } return 0; } /** * ticalcs_screen_convert_rgb565le_to_rgb888: * @src: source bitmap (16-bit pixels) to be converted. * @width: width of the bitmap in pixels * @height: height of the bitmap in pixels * @dst: storage space for the converted bitmap, must be at least 3 * width * height bytes large * * Convert 16-bit little-endian RGB565 bitmap to RGB888. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_screen_convert_rgb565le_to_rgb888(const uint8_t * src, unsigned int width, unsigned int height, uint8_t * dst) { unsigned int i; VALIDATE_NONNULL(src); VALIDATE_SCREENWIDTH(width); VALIDATE_SCREENHEIGHT(height); VALIDATE_NONNULL(dst); for (i = 0; i < height; i++) { unsigned int j; for (j = 0; j < width; j++) { uint16_t data = (((uint16_t)(src[1])) << 8) | ((uint16_t)(src[0])); src += 2; *dst++ = ((data & 0xF800) >> 11) << 3; *dst++ = ((data & 0x07E0) >> 5) << 2; *dst++ = ((data & 0x001F) >> 0) << 3; } } return 0; } /** * ticalcs_screen_convert_native_to_rgb888: * @format: pixel format of the input data. * @src: source bitmap (16-bit pixels) to be converted. * @width: width of the bitmap in pixels * @height: height of the bitmap in pixels * @dst: storage space for the converted bitmap, must be at least 3 * width * height bytes large * * Convert a bitmap in the calculator's native encoding to RGB888. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_screen_convert_native_to_rgb888(CalcPixelFormat format, const uint8_t * src, unsigned int width, unsigned int height, uint8_t * dst) { int ret; VALIDATE_NONNULL(src); // width and height are validated by other ticalcs_screen_convert_* functions. VALIDATE_NONNULL(dst); switch (format) { case CALC_PIXFMT_MONO: { ret = ticalcs_screen_convert_bw_to_rgb888(src, width, height, dst); } break; case CALC_PIXFMT_GRAY_4: { ret = ticalcs_screen_convert_gs4_to_rgb888(src, width, height, dst); } break; case CALC_PIXFMT_RGB_565_LE: { ret = ticalcs_screen_convert_rgb565le_to_rgb888(src, width, height, dst); } break; default: { ticalcs_critical(_("Unknown pixel format %d\n"), format); ret = ERR_INVALID_PARAMETER; } } return ret; } /** * ticalcs_screen_nspire_rle_uncompress: * @format: pixel format of the input data. * @src: source bitmap to be converted. * @input_size: size of the input data. * @dst: storage space for the uncompressed bitmap, must be at least width * height / 2 bytes large for classic Nspire and 2 * width * height bytes large for color Nspire. * @max_output_size: size of the output data. * * Uncompress a RLE-compressed Nspire screenshot. * * Return value: 0 if successful, an error code otherwise. */ TIEXPORT3 int TICALL ticalcs_screen_nspire_rle_uncompress(CalcPixelFormat format, const uint8_t *src, uint32_t input_size, uint8_t * dst, uint32_t max_output_size) { int ret; VALIDATE_NONNULL(src); VALIDATE_NONNULL(dst); switch (format) { case CALC_PIXFMT_GRAY_4: { uint8_t *q; uint32_t i, j; for (i = 0, j = 0, q = dst; i < input_size;) { int8_t rec = src[i++]; if (rec >= 0) { // Positive count: "repeat 8-bit value" block. uint8_t cnt = ((uint8_t)rec) + 1; uint8_t val = src[i++]; if (j + cnt > max_output_size) { ret = ERR_INVALID_SCREENSHOT; break; } memset(q, val, cnt); q += cnt; j += cnt; } else { // Negative count: "verbatim" block of 8-bit values. uint8_t cnt = ((uint8_t)-rec) + 1; if (j + cnt > max_output_size) { ret = ERR_INVALID_SCREENSHOT; break; } memcpy(q, src+i, cnt); q += cnt; i += cnt; j += cnt; } } ret = 0; } break; case CALC_PIXFMT_RGB_565_LE: { uint8_t *q; uint32_t i, j; for (i = 0, j = 0, q = dst; i < input_size;) { int8_t rec = src[i++]; if (rec >= 0) { // Positive count: "repeat 32-bit value" block. uint8_t cnt = ((uint8_t)rec) + 1; uint32_t val; uint8_t k; if (j + cnt * 4 > max_output_size) { ret = ERR_INVALID_SCREENSHOT; break; } memcpy(&val, src + i, sizeof(uint32_t)); for (k = 0; k < cnt; k++) { memcpy(q, &val, 4); q += 4; } i += 4; j += cnt * 4; } else { // Negative count: "verbatim" block of 32-bit values. uint8_t cnt = ((uint8_t)-rec) + 1; if (j + cnt * 4 > max_output_size) { ret = ERR_INVALID_SCREENSHOT; break; } memcpy(q, src + i, cnt * 4); q += cnt * 4; i += cnt * 4; j += cnt * 4; } } ret = 0; } break; default: { ticalcs_critical(_("Unknown pixel format %d\n"), format); ret = ERR_INVALID_PARAMETER; } } return ret; } /** * ticalcs_screen_84pcse_rle_uncompress: * @src: source bitmap to be converted. * @src_length: size of the input data. * @dst: storage space for the uncompressed bitmap, must be at least width * height / 2 bytes large for classic Nspire and 2 * width * height bytes large for color Nspire. * @dst_length: size of the output data. * * Uncompress a RLE-compressed 84+CSE screenshot. * * Return value: 0 if successful, an error code otherwise. */ TIEXPORT3 int TICALL ticalcs_screen_84pcse_rle_uncompress(const uint8_t *src, uint32_t src_length, uint8_t *dst, uint32_t dst_length) { const uint8_t *palette; unsigned int palette_size, i, c, n; VALIDATE_NONNULL(src); VALIDATE_NONNULL(dst); if (src[0] != 1) { return ERR_INVALID_SCREENSHOT; } src++; src_length--; palette_size = src[src_length - 1]; if (src_length <= palette_size * 2 + 1) { return ERR_INVALID_SCREENSHOT; } src_length -= palette_size * 2 + 1; palette = src + src_length - 2; while (src_length > 0) { if ((src[0] & 0xf0) != 0) { for (i = 0; i < 2; i ++) { c = (i == 0 ? src[0] >> 4 : src[0] & 0x0f); if (c == 0) { break; } if (c > palette_size) { return ERR_INVALID_SCREENSHOT; } if (dst_length < 2) { return ERR_INVALID_SCREENSHOT; } dst[0] = palette[2 * c]; dst[1] = palette[2 * c + 1]; dst += 2; dst_length -= 2; } src++; src_length--; } else if (src_length >= 2 && (src[0] & 0x0f) != 0) { c = src[0]; n = src[1]; if (c > palette_size) { return ERR_INVALID_SCREENSHOT; } if (dst_length < 2 * n) { return ERR_INVALID_SCREENSHOT; } for (i = 0; i < n; i++) { dst[0] = palette[2 * c]; dst[1] = palette[2 * c + 1]; dst += 2; dst_length -= 2; } src += 2; src_length -= 2; } else if (src_length >= 2 && src[0] == 0 && src[1] == 0) { src += 2; src_length -= 2; goto byte_mode; } else { return ERR_INVALID_SCREENSHOT; } } goto finish; byte_mode: while (src_length > 0) { if (src[0] != 0) { c = src[0]; if (c > palette_size) { return ERR_INVALID_SCREENSHOT; } if (dst_length < 2) { return ERR_INVALID_SCREENSHOT; } dst[0] = palette[2 * c]; dst[1] = palette[2 * c + 1]; dst += 2; dst_length -= 2; src++; src_length--; } else if (src_length >= 3 && src[1] != 0) { c = src[1]; n = src[2]; if (c > palette_size) { return ERR_INVALID_SCREENSHOT; } if (dst_length < 2 * n) { return ERR_INVALID_SCREENSHOT; } for (i = 0; i < n; i++) { dst[0] = palette[2 * c]; dst[1] = palette[2 * c + 1]; dst += 2; dst_length -= 2; } src += 3; src_length -= 3; } else if (src_length >= 3 && src[0] == 0 && src[1] == 0 && src[2] == 0) { src += 3; src_length -= 3; goto word_mode; } else { return ERR_INVALID_SCREENSHOT; } } goto finish; word_mode: while (src_length > 0) { if (src_length < 2) { return ERR_INVALID_SCREENSHOT; } if (src[0] != 0x01 || src[1] != 0x00) { if (dst_length < 2) { return ERR_INVALID_SCREENSHOT; } dst[0] = src[0]; dst[1] = src[1]; dst += 2; dst_length -= 2; src += 2; src_length -= 2; } else { if (src_length < 5) { return ERR_INVALID_SCREENSHOT; } n = src[4]; if (dst_length < 2 * n) { return ERR_INVALID_SCREENSHOT; } for (i = 0; i < n; i++) { dst[0] = src[2]; dst[1] = src[3]; dst += 2; dst_length -= 2; } src += 5; src_length -= 5; } } finish: if (src_length != 0 || dst_length != 0) { return ERR_INVALID_SCREENSHOT; } else { return 0; } } libticalcs-1.1.9+dfsg/src/stdints3.h000066400000000000000000000032211327711501700172670ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id: stdints2.h 2103 2006-04-02 12:55:21Z roms $ */ /* libtifiles - Ti File Format library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * Copyright (C) 2006 Tyler Cassidy * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Encapsulate the ISO-C99 'stdint.h' header for platforms which haven't it */ #ifndef __TILIBS_STDINT__ #define __TILIBS_STDINT__ #ifdef HAVE_CONFIG_H # include #endif #ifdef HAVE_STDINT_H # include #else # if defined(__WIN32__) # include typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; typedef __int8 int8_t; typedef __int16 int16_t; typedef __int32 int32_t; typedef __int64 int64_t; # elif defined(__BSD__) # include # else # include # endif /* __WIN32__, __BSD__ */ #endif /* HAVE_STDINT_H */ #endif /* __TIFILES_STDINT__ */ libticalcs-1.1.9+dfsg/src/tf2hex/000077500000000000000000000000001327711501700165455ustar00rootroot00000000000000libticalcs-1.1.9+dfsg/src/tf2hex/Makefile.am000066400000000000000000000002131327711501700205750ustar00rootroot00000000000000EXTRA_DIST = tf2hex.c CLEANFILES = tf2hex all: tf2hex tf2hex: tf2hex.c $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(srcdir)/tf2hex.c -o tf2hex libticalcs-1.1.9+dfsg/src/tf2hex/tf2hex.c000066400000000000000000000026331327711501700201150ustar00rootroot00000000000000#include #include #include #include #define STEP 8 int main(int argc, char **argv) { const char *src_name; const char *dst_name; FILE *fi, *fo; struct stat st; long length, lenread; static unsigned char data[65536]; int i, j; const char *pat; if(argc != 4) { fprintf(stderr, "Usage: tf2hex input_file output_file suffix\n"); return 1; } src_name = argv[1]; dst_name = argv[2]; pat = argv[3]; // read input file fi = fopen(src_name, "rb"); if(fi == NULL) { fprintf(stderr, "Unable to open input file.\n"); return 1; } fstat(fileno(fi), &st); length = st.st_size; lenread = fread(data, sizeof(char), length, fi); fprintf(stdout, "Read %ld bytes.\n", lenread); fclose(fi); if (lenread == length) { // write output file fo = fopen(dst_name, "wt"); if(fo == NULL) { fprintf(stderr, "Unable to open output file.\n"); return 1; } fprintf(fo, "static unsigned char romDump%s[] = {\n", pat); for(i = 0; i < length; i += STEP) { for(j = 0; (j < STEP) && (i+j < length); j++) { fprintf(fo, "0x%02x, ", data[i + j]); } fprintf(fo, "\n"); } fprintf(fo, "};\nstatic unsigned int romDumpSize%s = %ld;\n", pat, length); fclose(fo); } else { fprintf(stderr, "Was unable to read the entire input file.\n"); return 1; } return 0; } libticalcs-1.1.9+dfsg/src/ticalcs.c000066400000000000000000000260311327711501700171350ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs2 - hand-helds support library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #if defined(__WIN32__) #include #endif #include #include "gettext.h" #include "ticalcs.h" #include "internal.h" #include "logging.h" #include "error.h" #include "calc_xx.h" /*****************/ /* Internal data */ /*****************/ extern const CalcUpdate default_update; static CalcFncts const *const calcs[] = { &calc_00, #ifndef NO_TI73 &calc_73, #endif #ifndef NO_TI82 &calc_82, #endif #ifndef NO_TI83 &calc_83, #endif #ifndef NO_TI83P &calc_83p, #endif #ifndef NO_TI84P &calc_84p, #endif #ifndef NO_TI85 &calc_85, #endif #ifndef NO_TI86 &calc_86, #endif #ifndef NO_TI89 &calc_89, #endif #ifndef NO_TI89T &calc_89t, #endif #ifndef NO_TI92 &calc_92, #endif #ifndef NO_TI92P &calc_92p, #endif #ifndef NO_V200 &calc_v2, #endif #ifndef NO_TI84P_USB &calc_84p_usb, #endif #ifndef NO_TI89T_USB &calc_89t_usb, #endif #ifndef NO_NSPIRE &calc_nsp, #endif #ifndef NO_TI80 &calc_80, #endif #ifndef NO_TI84PC &calc_84pcse, #endif #ifndef NO_TI84PC_USB &calc_84pcse_usb, #endif #ifndef NO_TI83PCE_USB &calc_83pce_usb, #endif #ifndef NO_TI84PCE_USB &calc_84pce_usb, #endif #ifndef NO_TI82A_USB &calc_82a_usb, #endif #ifndef NO_TI84PT_USB &calc_84pt_usb, #endif NULL }; static const uint32_t supported_calcs = (1U << CALC_NONE) #ifndef NO_TI73 | (1U << CALC_TI73) #endif #ifndef NO_TI82 | (1U << CALC_TI82) #endif #ifndef NO_TI83 | (1U << CALC_TI83) #endif #ifndef NO_TI83P | (1U << CALC_TI83P) #endif #ifndef NO_TI84P | (1U << CALC_TI84P) #endif #ifndef NO_TI85 | (1U << CALC_TI85) #endif #ifndef NO_TI86 | (1U << CALC_TI86) #endif #ifndef NO_TI89 | (1U << CALC_TI89) #endif #ifndef NO_TI89T | (1U << CALC_TI89T) #endif #ifndef NO_TI92 | (1U << CALC_TI92) #endif #ifndef NO_TI92P | (1U << CALC_TI92P) #endif #ifndef NO_V200 | (1U << CALC_V200) #endif #ifndef NO_TI84P_USB | (1U << CALC_TI84P_USB) #endif #ifndef NO_TI89T_USB | (1U << CALC_TI89T_USB) #endif #ifndef NO_NSPIRE | (1U << CALC_NSPIRE) #endif #ifndef NO_TI80 | (1U << CALC_TI80) #endif #ifndef NO_TI84PC | (1U << CALC_TI84PC) #endif #ifndef NO_TI84PC_USB | (1U << CALC_TI84PC_USB) #endif #ifndef NO_TI83PCE_USB | (1U << CALC_TI83PCE_USB) #endif #ifndef NO_TI84PCE_USB | (1U << CALC_TI84PCE_USB) #endif #ifndef NO_TI82A_USB | (1U << CALC_TI82A_USB) #endif #ifndef NO_TI84PT_USB | (1U << CALC_TI84PT_USB) #endif ; /****************/ /* Entry points */ /****************/ // not static, must be shared between instances int ticalcs_instance = 0; // counts # of instances /** * ticalcs_library_init: * * This function must be the first one to call. It inits library internals. * * Return value: the instance count. **/ TIEXPORT3 int TICALL ticalcs_library_init(void) { char locale_dir[65536 + 20]; #ifdef __WIN32__ HANDLE hDll; int i; hDll = GetModuleHandle("libticalcs2-12.dll"); GetModuleFileName(hDll, locale_dir, sizeof(locale_dir) - 21); for (i = strlen(locale_dir); i >= 0; i--) { if (locale_dir[i] == '\\') { break; } } locale_dir[i] = '\0'; #ifdef __MINGW32__ strcat(locale_dir, "\\..\\share\\locale"); #else strcat(locale_dir, "\\locale"); #endif #else strncpy(locale_dir, LOCALEDIR, sizeof(locale_dir) - 21); locale_dir[sizeof(locale_dir) - 21] = 0; #endif if (ticalcs_instance) { return (++ticalcs_instance); } ticalcs_info(_("ticalcs library version %s"), LIBCALCS_VERSION); errno = 0; #if defined(ENABLE_NLS) ticalcs_info("setlocale: %s", setlocale(LC_ALL, "")); ticalcs_info("bindtextdomain: %s", bindtextdomain(PACKAGE, locale_dir)); bind_textdomain_codeset(PACKAGE, "UTF-8"/*"ISO-8859-15"*/); ticalcs_info("textdomain: %s", textdomain(NULL)); #endif return (++ticalcs_instance); } /** * ticalcs_library_exit: * * This function must be the last one to call. Used to release internal resources. * * Return value: the instance count. **/ TIEXPORT3 int TICALL ticalcs_library_exit(void) { return (--ticalcs_instance); } /***********/ /* Methods */ /***********/ /** * ticalcs_version_get: * * This function returns the library version like "X.Y.Z". * * Return value: a string. **/ TIEXPORT3 const char *TICALL ticalcs_version_get(void) { return LIBCALCS_VERSION; } /** * ticalcs_supported_calcs: * * This function returns the calcs built into the current binary. * * Return value: an integer containing a binary OR of (1 << CALC_*) values, * where CALC_* values are defined in enum CalcModel. **/ TIEXPORT3 uint32_t TICALL ticalcs_supported_calcs (void) { return supported_calcs; } /** * ticalcs_handle_new: * @model: a hand-held model * * Create a new handle associated with the given cable on the given port. * Must be freed with ticables_handle_del when no longer needed. * Note: the handle is a pointer on an opaque structure and should not be modified. * * Return value: NULL if error, an handle otherwise. **/ TIEXPORT3 CalcHandle* TICALL ticalcs_handle_new(CalcModel model) { CalcHandle *handle = NULL; CalcFncts * calc = NULL; unsigned int i; for (i = 0; i < sizeof(calcs) / sizeof(calcs[0]) - 1; i++) // - 1 for the terminating NULL. { if (calcs[i]->model == (int const)model) { calc = (CalcFncts *)calcs[i]; break; } } if (calc != NULL) { handle = (CalcHandle *)g_malloc0(sizeof(CalcHandle)); if (handle != NULL) { handle->model = model; handle->calc = calc; handle->updat = (CalcUpdate *)&default_update; handle->priv.nsp_src_port = 0x8001; handle->priv.nsp_dst_port = 0x4003; // NSP_PORT_ADDR_REQUEST handle->buffer = (uint8_t *)g_malloc(65536 + 6); if (handle->buffer == NULL) { g_free(handle); handle = NULL; } handle->buffer2 = (uint8_t *)g_malloc(65536 + 6); if (handle->buffer2 == NULL) { g_free(handle->buffer); g_free(handle); handle = NULL; } } } return handle; } /** * ticalcs_handle_del: * @handle: the handle * * Release the cable and free the associated resources. * If cable has not been detached with #ticalcs_cable_detach, * it will be detached. * * Return value: always 0. **/ TIEXPORT3 int TICALL ticalcs_handle_del(CalcHandle* handle) { VALIDATE_HANDLE(handle); if (handle->attached) { ticalcs_cable_detach(handle); } if (handle->buffer2) { g_free(handle->buffer2); } if (handle->buffer) { g_free(handle->buffer); } memset((void *)handle, 0, sizeof(*handle)); g_free(handle); return 0; } /** * ticalcs_handle_show: * @handle: the handle * * Show information stored in the handle. * * Return value: always 0. **/ TIEXPORT3 int TICALL ticalcs_handle_show(CalcHandle* handle) { VALIDATE_HANDLE(handle); ticalcs_info(_("Link calc handle details:")); ticalcs_info(_(" model : %s"), ticalcs_model_to_string(handle->model)); return 0; } /** * ticalcs_cable_attach: * @handle: the handle * @cable: a cable to use * * Attach and open the given cable for use with the hand-held. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_cable_attach(CalcHandle* handle, CableHandle* cable) { int ret; VALIDATE_HANDLE(handle); handle->cable = cable; handle->attached = !0; ret = ticables_cable_open(cable); if (!ret) { handle->open = !0; } return ret; } /** * ticalcs_cable_detach: * @handle: the handle * @cable: a cable to use * * Close and detach the cable associated with the hand-held. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_cable_detach(CalcHandle* handle) { int ret; VALIDATE_HANDLE(handle); ret = ticables_cable_close(handle->cable); if (!ret) { handle->open = 0; handle->attached = 0; handle->cable = NULL; } return ret; } /** * ticalcs_update_set: * @handle: the handle * @update: the callbacks to use * * Set the callbacks to use for the given handle. * * Return value: 0 if successful, an error code otherwise. **/ TIEXPORT3 int TICALL ticalcs_update_set(CalcHandle* handle, CalcUpdate* upd) { VALIDATE_HANDLE(handle); handle->updat = upd; return 0; } /** * ticalcs_model_supports_dbus: * @model: a calculator model taken in #CalcModel. * * Returns whether the given calculator model supports the protocol dubbed DBUS by libticalcs. * That is, the standard protocol used by TI-Z80 and TI-68k calculators over the legacy I/O. * * Return value: nonzero if the calculator supports the DBUS protocol, zero if it doesn't. */ TIEXPORT3 int TICALL ticalcs_model_supports_dbus(CalcModel model) { return ( /*model < CALC_MAX &&*/ ( model == CALC_TI73 || model == CALC_TI82 || model == CALC_TI83 || model == CALC_TI83P || model == CALC_TI84P || model == CALC_TI85 || model == CALC_TI86 || model == CALC_TI89 || model == CALC_TI89T || model == CALC_TI92 || model == CALC_TI92P || model == CALC_V200 || model == CALC_TI80 || model == CALC_TI84PC)); } /** * ticalcs_model_supports_dusb: * @model: a calculator model taken in #CalcModel. * * Returns whether the given calculator model supports the protocol dubbed DUSB by libticalcs. * That is, the standard protocol used by TI-Z80, TI-eZ80 and TI-68k calculators over the USB port. * * Return value: nonzero if the calculator supports the DUSB protocol, zero if it doesn't. */ TIEXPORT3 int TICALL ticalcs_model_supports_dusb(CalcModel model) { return ( /*model < CALC_MAX &&*/ ( model == CALC_TI84P_USB || model == CALC_TI89T_USB || model == CALC_TI84PC_USB || model == CALC_TI83PCE_USB || model == CALC_TI84PCE_USB || model == CALC_TI82A_USB || model == CALC_TI84PT_USB)); } /** * ticalcs_model_supports_nsp: * @model: a calculator model taken in #CalcModel. * * Returns whether the given calculator model supports the protocol dubbed NSP by libticalcs. * That is, the standard protocol used by TI-Nspire calculators over the USB port. * * Return value: nonzero if the calculator supports the NSP protocol, zero if it doesn't. */ TIEXPORT3 int TICALL ticalcs_model_supports_nsp(CalcModel model) { return ( /*model < CALC_MAX &&*/ ( model == CALC_NSPIRE)); } libticalcs-1.1.9+dfsg/src/ticalcs.h000066400000000000000000000710261327711501700171460ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs2 - hand-helds support library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TICALCS__ #define __TICALCS__ #ifdef HAVE_CONFIG_H # include #endif #include #include #include "export3.h" #include #ifdef __cplusplus extern "C" { #endif /***********************/ /* Types & Definitions */ /***********************/ /* Versioning */ #ifdef __WIN32__ # define LIBCALCS_VERSION "1.1.9" #else # define LIBCALCS_VERSION VERSION #endif #define LIBCALCS_REQUIRES_LIBTICONV_VERSION "1.1.5" // useless with pkg-config #define LIBCALCS_REQUIRES_LIBTIFILES_VERSION "1.1.0" // useless with pkg-config #define LIBCALCS_REQUIRES_LIBTICABLES_VERSION "1.3.5" // useless with pkg-config /* Types */ // Name of the root node for 'Variables' & 'Applications' tree #define VAR_NODE_NAME "Variables" #define APP_NODE_NAME "Applications" #define ERROR_ABORT (256) /* fixed in error.h */ #define ERROR_EOT (262) /* fixed in error.h */ /** * CalcScreenFormat: * * An enumeration which contains the following calculator types: **/ typedef enum { SCREEN_FULL, SCREEN_CLIPPED } CalcScreenFormat; /** * CalcPixelFormat: * * An enumeration which defines the format of screenshot images: */ typedef enum { CALC_PIXFMT_MONO = 1, // Monochrome (1 bpp) CALC_PIXFMT_GRAY_4 = 2, // Grayscale (4 bpp - Nspire) CALC_PIXFMT_RGB_565_LE = 3, // RGB (16 bpp little-endian - Nspire CX / 84+CSE / 83PCE / 84+CE) CALC_PIXFMT_RGB_5_6_5 = 3 // Ditto } CalcPixelFormat; /** * CalcPathType: * * An enumeration which contains the path type: **/ typedef enum { PATH_FULL, PATH_LOCAL } CalcPathType; /** * CalcMemType: * * An enumeration which contains the different memory sizes: **/ typedef enum { MEMORY_NONE = 0, MEMORY_FREE = (1<<0), MEMORY_USED = (1<<1), } CalcMemType; // To clean-up ! /** * CalcMode: * * An enumeration which contains different mask modes: **/ typedef enum { MODE_NORMAL = 0, // For sending vars MODE_SEND_ONE_VAR = (1 << 1), // Send single var or first var of group (TI82/85 only) MODE_SEND_LAST_VAR = (1 << 2), // Send last var of group file (TI82/85 only) MODE_SEND_EXEC_ASM = (1 << 3), // Send and execute assembly (TI82/85 only; dangerous!) // Miscellaneous MODE_LOCAL_PATH = (1 << 4), // Local path (full by default) MODE_BACKUP = (1 << 5), // Keep archive attribute } CalcMode; /** * CalcRomDumpSize: * * An enumeration which contains the following ROM dump sizes: **/ typedef enum { ROMSIZE_AUTO = 0, ROMSIZE_48KB = 48, /* TI-80 */ ROMSIZE_128KB = 128, /* TI-82, TI-85 */ ROMSIZE_256KB = 256, /* TI-83, TI-86 */ ROMSIZE_512KB = 512, /* TI-83+ */ ROMSIZE_1MB = 1024, /* TI-84+, TI-92, TI-82A */ ROMSIZE_2MB = 2048, /* TI-83+SE, TI-84+SE, TI-89, TI-92 II, TI-92+, TI-84+T */ ROMSIZE_4MB = 4096, /* TI-84+CSE, TI-89T, V200, TI-83PCE, TI-84+CE */ } CalcDumpSize; /** * CalcShellType: * * An enumeration which contains the shell to use with ROM dumping: **/ typedef enum { SHELL_NONE = 4, SHELL_USGARD, SHELL_ZSHELL } CalcShellType; /** * CalcProductIDs: * * An enumeration which contains the product IDs used by TI graphing calculators: **/ typedef enum { PRODUCT_ID_NONE = 0x00, PRODUCT_ID_TI92P = 0x01, PRODUCT_ID_TI73 = 0x02, PRODUCT_ID_TI89 = 0x03, PRODUCT_ID_TI83P = 0x04, // No known calculator uses 0x05 // No known calculator uses 0x06 // No known calculator uses 0x07 PRODUCT_ID_TIV200 = 0x08, PRODUCT_ID_TI89T = 0x09, PRODUCT_ID_TI84P = 0x0A, PRODUCT_ID_TI82A = 0x0B, PRODUCT_ID_NSPIRE_CAS = 0x0C, // The Nspire CAS+ prototypes also uses 0x0C, but libti*/tilp do not handle their unique communication protocol. PRODUCT_ID_LABCRADLE = 0x0D, // Included for completeness, not handled by libticalcs. PRODUCT_ID_NSPIRE_NONCAS = 0x0E, PRODUCT_ID_NSPIRE_CX_CAS = 0x0F, // Yes, two completely different models use ID 0x0F. PRODUCT_ID_TI84PCSE = 0x0F, PRODUCT_ID_NSPIRE_CX_NONCAS = 0x10, PRODUCT_ID_NSPIRE_CM_CAS = 0x11, PRODUCT_ID_NSPIRE_CM_NONCAS = 0x12, PRODUCT_ID_TI83PCE = 0x13, // These two similar models use the same ID as well. PRODUCT_ID_TI84PCE = 0x13, PRODUCT_ID_TI84PT = 0x1B } CalcProductIDs; /** * CalcOperations: * * An enumeration which contains the different supported operations: **/ typedef enum { FTS_NONE = 0, OPS_ISREADY = (1 << 0), OPS_KEYS = (1 << 1), OPS_SCREEN = (1 << 2), OPS_DIRLIST = (1 << 3), OPS_BACKUP = (1 << 4), OPS_VARS = (1 << 5), OPS_FLASH = (1 << 6), OPS_IDLIST = (1 << 7), OPS_CLOCK = (1 << 8), OPS_ROMDUMP = (1 << 9), OPS_VERSION = (1 << 10), OPS_NEWFLD = (1 << 11), OPS_DELVAR = (1 << 12), OPS_OS = (1 << 13), OPS_RENAME = (1 << 14), OPS_CHATTR = (1 << 21), FTS_SILENT = (1 << 15), FTS_FOLDER = (1 << 16), FTS_MEMFREE = (1 << 17), FTS_FLASH = (1 << 18), FTS_CERT = (1 << 19), FTS_BACKUP = (1 << 20), FTS_NONSILENT = (1 << 22) } CalcFeatures; /** * CalcAction: * * An enumeration which contains the action taken on a variable **/ typedef enum { ACT_NONE = 0, ACT_RENAME, ACT_OVER, ACT_SKIP, } CalcAction; /** * InfosMask: * * An enumeration which contains the different flags supported by CalcInfos: **/ typedef enum { INFOS_PRODUCT_NUMBER = (1 << 0), /* obsolete (never used) */ INFOS_PRODUCT_NAME = (1 << 1), INFOS_MAIN_CALC_ID = (1 << 2), /* obsolete, replaced by INFOS_PRODUCT_ID */ INFOS_HW_VERSION = (1 << 3), INFOS_LANG_ID = (1 << 4), INFOS_SUB_LANG_ID = (1 << 5), INFOS_DEVICE_TYPE = (1 << 6), INFOS_BOOT_VERSION = (1 << 7), INFOS_OS_VERSION = (1 << 8), INFOS_RAM_PHYS = (1 << 9), INFOS_RAM_USER = (1 << 10), INFOS_RAM_FREE = (1 << 11), INFOS_FLASH_PHYS = (1 << 12), INFOS_FLASH_USER = (1 << 13), INFOS_FLASH_FREE = (1 << 14), INFOS_LCD_WIDTH = (1 << 15), INFOS_LCD_HEIGHT = (1 << 16), INFOS_BATTERY = (1 << 17), INFOS_BOOT2_VERSION = (1 << 18), INFOS_RUN_LEVEL = (1 << 19), INFOS_BPP = (1 << 20), INFOS_CLOCK_SPEED = (1 << 21), INFOS_PRODUCT_ID = (1 << 22), INFOS_EXACT_MATH = (1 << 23), INFOS_CLOCK_SUPPORT = (1 << 24), INFOS_COLOR_SCREEN = (1 << 25), // INFOS_MORE_INFOS = (1 << 30), /* Some day ? Reserved value for signaling more bits are available elsewhere */ INFOS_CALC_MODEL = 0x80000000 } InfosMask; /** * CalcFnctsIdx: * * Index of function in the #CalcFncts structure: **/ typedef enum { FNCT_IS_READY=0, FNCT_SEND_KEY, FNCT_EXECUTE, FNCT_RECV_SCREEN, FNCT_GET_DIRLIST, FNCT_GET_MEMFREE, FNCT_SEND_BACKUP, FNCT_RECV_BACKUP, FNCT_SEND_VAR, FNCT_RECV_VAR, FNCT_SEND_VAR_NS, FNCT_RECV_VAR_NS, FNCT_SEND_APP, FNCT_RECV_APP, FNCT_SEND_OS, FNCT_RECV_IDLIST, FNCT_DUMP_ROM1, FNCT_DUMP_ROM2, FNCT_SET_CLOCK, FNCT_GET_CLOCK, FNCT_DEL_VAR, FNCT_NEW_FOLDER, FNCT_GET_VERSION, FNCT_SEND_CERT, FNCT_RECV_CERT, FNCT_RENAME, FNCT_CHATTR, FNCT_SEND_ALL_VARS_BACKUP, FNCT_RECV_ALL_VARS_BACKUP, FNCT_LAST // Keep this one last } CalcFnctsIdx; #define FNCT_DUMP_ROM FNCT_DUMP_ROM2 /** * TigMode: * * An enumeration which contains the data to save in tigroup: **/ typedef enum { TIG_NONE = 0, TIG_RAM = (1 << 0), TIG_ARCHIVE = (1 << 1), TIG_FLASH = (1 << 2), TIG_BACKUP = (1 << 3), TIG_ALL = 7, } TigMode; //! Size of the header of a \a DUSBRawPacket #define DUSB_HEADER_SIZE (4+1) /** * DUSBRawPacket: * * Raw packet for the DUSB (84+(SE), 89T) protocol. **/ typedef struct { uint32_t size; ///< raw packet size uint8_t type; ///< raw packet type uint8_t data[1023]; ///< raw packet data } DUSBRawPacket; //! Size of the header of a \a NSPRawPacket #define NSP_HEADER_SIZE (16) //! Size of the data contained in \a NSPRawPacket #define NSP_DATA_SIZE (254) /** * NSPRawPacket: * * Raw packet for the Nspire NavNet protocol. **/ typedef struct { uint16_t unused; uint16_t src_addr; uint16_t src_port; uint16_t dst_addr; uint16_t dst_port; uint16_t data_sum; uint8_t data_size; uint8_t ack; uint8_t seq; uint8_t hdr_sum; uint8_t data[NSP_DATA_SIZE]; } NSPRawPacket; /** * CalcScreenCoord: * @format: returns full or clipped image (#CalcScreenFormat) * @width: real width * @height: real height * @clipped_width: clipped width (89 for instance) * @clipped_height: clipped height (89 for instance) * @pixel_format: format of pixel data (#CalcPixelFormat) * * A structure used for storing screen size. **/ typedef struct { int format; unsigned int width; unsigned int height; unsigned int clipped_width; unsigned int clipped_height; CalcPixelFormat pixel_format; } CalcScreenCoord; /** * TreeInfo: * @model: hand-held model * @type: var or app list (VAR_NODE_NAME or APP_NODE_NAME) * @mem_used: memory used (depends on hand-held model) * @mem_free: memory free (depends on hand-held model) * * A structure used for storing information about a directory list tree. **/ typedef struct { CalcModel model; const char* type; int mem_mask; // tells which field is filled uint32_t mem_used; uint32_t mem_free; } TreeInfo; /** * KeyPair: * @name: name of key (like "ESC") * @value: value of key (like 264) * * A structure which contains a TI scancode. **/ typedef struct { char* name; uint16_t value; } KeyPair; /** * CalcKey: * @key_name: name of key * * A structure which contains a TI scancode with key modifiers. * FIXME: use KeyPair structure to pack infos ! **/ typedef struct { char* key_name; // Name of key KeyPair normal; // normal key KeyPair shift; // SHIFT key (TI9x) KeyPair second; // 2ND key (all) KeyPair diamond; // CTRL key (TI92) KeyPair alpha; // ALPHA key (83+,89) } CalcKey; typedef struct { const char *key_name; const char *normal_name; uint16_t normal_value; const char *shift_name; uint16_t shift_value; const char *second_name; uint16_t second_value; const char *diamond_name; uint16_t diamond_value; const char *alpha_name; uint16_t alpha_value; } OldCalcKeys_; /** * CalcClock: * @year: year * @month: * @day: * @hours: * @minutes: * @seconds: * @time_format: 12 or 24 * @date_format: 1 or 6 * * A structure used for clock management. **/ typedef struct { uint16_t year; uint8_t month; uint8_t day; uint8_t hours; uint8_t minutes; uint8_t seconds; uint8_t time_format; uint8_t date_format; int state; } CalcClock; /** * CalcUpdate: * @text: a text to display about the current operation (locale used is those defined by tifiles_transcoding_set) * @cancel: set to 1 if transfer have to be cancelled * @rate: data rate of cable * @cnt1: current counter for link transfer operations (ticalcs2 only) * @max1: max value of this counter * @cnt2: current count for intermediate operations (ticalcs2 only) * @max2: max value of this counter * @cnt3: current counter for global operations (used by ticalcs2 or tilp) * @max3: max value of this counter * @mask: which cntX is/are used (unused) * @type: pbar type (unused) * @start: init internal vars * @stop: release internal vars * @refresh: pass control to GUI for refresh * @pbar: refresh pprogress bar * @label: refresh label * * Refresh/progress functions * This structure allows to implement a kind of callbacks mechanism (which * allow libCalcs to interact with user without being dependant of a GUI). **/ typedef struct { char text[256]; int cancel; float rate; int cnt1; int max1; int cnt2; int max2; int cnt3; int max3; int mask; int type; void (*start) (void); void (*stop) (void); void (*refresh) (void); void (*pbar) (void); void (*label) (void); } CalcUpdate; typedef struct _CalcFncts CalcFncts; typedef struct _CalcHandle CalcHandle; // convenient wrappers: will be removed later ! #define update_ (handle->updat) #define update_start() handle->updat->start() #define update_pbar() handle->updat->pbar() #define update_label() handle->updat->label() #define update_refresh() handle->updat->refresh() #define update_stop() handle->updat->stop() typedef VarEntry VarRequest; // alias /** * CalcInfos: * @os: OS version like "3.01" * @bios: BIOS (boot) version like 2.01 * * A structure used to pass arguments. **/ typedef struct { CalcModel model; InfosMask mask; char product_name[64]; char product_id[32]; uint32_t product_number; // obsolete, replaced by product_id char main_calc_id[32]; // obsolete, replaced by product_id uint16_t hw_version; // hand-held-dependent uint8_t language_id; uint8_t sub_lang_id; uint16_t device_type; // hand-held-dependent char boot_version[16]; char boot2_version[16]; char os_version[16]; uint64_t ram_phys; uint64_t ram_user; uint64_t ram_free; uint64_t flash_phys; uint64_t flash_user; uint64_t flash_free; uint16_t lcd_width; uint16_t lcd_height; uint8_t battery; // 0 = low, 1 = good uint8_t run_level; // 1 = boot, 2 = OS uint16_t bits_per_pixel; // 1, 4 or 16 uint16_t clock_speed; uint8_t exact_math; uint8_t clock_support; uint8_t color_screen; } CalcInfos; /** * CalcFncts: * @model: link cable model (CalcModel). * @name: name of hand-held like "TI89" * @fullname: complete name of hand-held like "TI-89" * @description: description of hand-held like "TI89 calculator" * @features: supported operations (CalcOperations) * @counters: defines which CalcUpdate counters have to be refreshed (indexed by CalcFnctsIdx) * @is_ready: check whether calculator is ready * @send_key: send key value * @execute: remotely execute a program or application * @recv_screen: request a screendump * @get_dirlist: request a listing of variables, folders (if any) and apps (if any) * @send_backup: send a backup * @recv_backup: request a backup * @send_var: send a variable (silent mode) * @recv_var: request a variable silent mode) * @send_var_ns: send a variable (non-silent mode) * @recv_var_ns: receive a variable (non-silent mode) * @send_flash: send a FLASH app/os * @recv_flash: request a FLASH app/os * @recv_idlist: request hand-held IDLIST * @dump_rom_1: dump the hand-held ROM: send dumper (if any) * @dump_rom_2: dump the hand-held ROM: launch dumper * @set_clock: set date/time * @get_clock: get date/time * @del_var: delete variable * @new_fld: create new folder (if supported) * @get_version: returns Boot code & OS version * @send_cert: send certificate stuff * @recv_cert: receive certificate stuff * @rename_var: rename a variable * @change_attr: change attributes of a variable * @send_all_vars_backup: send a fake backup (set of files and FlashApps) * @recv_all_vars_backup: request a fake backup (set of files and FlashApps) * * A structure used for handling a hand-held. * !!! This structure is for private use !!! **/ struct _CalcFncts { const int model; const char* name; const char* fullname; const char* description; const int features; const CalcProductIDs product_id; const char* counters[FNCT_LAST]; int (*is_ready) (CalcHandle*); int (*send_key) (CalcHandle*, uint32_t); int (*execute) (CalcHandle*, VarEntry*, const char*); int (*recv_screen) (CalcHandle*, CalcScreenCoord*, uint8_t**); int (*get_dirlist) (CalcHandle*, GNode** vars, GNode** apps); int (*get_memfree) (CalcHandle*, uint32_t* ram, uint32_t* flash); int (*send_backup) (CalcHandle*, BackupContent*); int (*recv_backup) (CalcHandle*, BackupContent*); int (*send_var) (CalcHandle*, CalcMode, FileContent*); int (*recv_var) (CalcHandle*, CalcMode, FileContent*, VarRequest*); int (*send_var_ns) (CalcHandle*, CalcMode, FileContent*); int (*recv_var_ns) (CalcHandle*, CalcMode, FileContent*, VarEntry**); int (*send_app) (CalcHandle*, FlashContent*); int (*recv_app) (CalcHandle*, FlashContent*, VarRequest*); int (*send_os) (CalcHandle*, FlashContent*); int (*recv_idlist) (CalcHandle*, uint8_t*); int (*dump_rom_1) (CalcHandle*); int (*dump_rom_2) (CalcHandle*, CalcDumpSize, const char *filename); int (*set_clock) (CalcHandle*, CalcClock* clock); int (*get_clock) (CalcHandle*, CalcClock* clock); int (*del_var) (CalcHandle*, VarRequest*); int (*new_fld) (CalcHandle*, VarRequest*); int (*get_version) (CalcHandle*, CalcInfos*); int (*send_cert) (CalcHandle*, FlashContent*); int (*recv_cert) (CalcHandle*, FlashContent*); int (*rename_var) (CalcHandle*, VarRequest*, VarRequest*); int (*change_attr) (CalcHandle*, VarRequest*, FileAttr); int (*send_all_vars_backup) (CalcHandle*, FileContent*); int (*recv_all_vars_backup) (CalcHandle*, FileContent*); }; /** * CalcHandle: * @model: cable model * @calc: calculator functions * @update: callbacks for GUI interaction * @unused1: unused member kept for API compatibility purposes * @buffer: allocated data buffer for internal use * @buffer2: allocated data buffer for internal use * @open: device has been opened * @busy: transfer is in progress * @cable: handle on cable used with this model * @attached: set if a cable has been attached * @priv: private per-handle data * * A structure used to store information as a handle. * !!! This structure is for private use !!! **/ struct _CalcHandle { CalcModel model; CalcFncts* calc; CalcUpdate* updat; void* unused1; void* buffer; // used as data buffer void* buffer2; int open; int busy; CableHandle* cable; int attached; struct { uint32_t dusb_rpkt_maxlen; // max length of data in raw packet unsigned int progress_blk_size; // refresh pbars every once in a while. unsigned int progress_min_size; // don't refresh if packet is smaller than some amount. unsigned int romdump_std_blk; // number of full-size blocks unsigned int romdump_sav_blk; // number of compressed blocks void * dusb_vtl_pkt_list; void * dusb_cpca_list; void * nsp_vtl_pkt_list; uint8_t nsp_seq_pc; uint8_t nsp_seq; uint16_t nsp_src_port; uint16_t nsp_dst_port; } priv; }; /** * DeviceOptions: * @cable_model: model * @cable_port: port * @cable_timeout: timeout in tenth of seconds * @cable_delay: inter-bit delay in µs * @calc_model: calculator model * * A convenient structure free of use by the user. **/ typedef struct { CableModel cable_model; CablePort cable_port; int cable_timeout; int cable_delay; CalcModel calc_model; } DeviceOptions; // namespace scheme: library_class_function like ticalcs_fext_get /****************/ /* Entry points */ /****************/ TIEXPORT3 int TICALL ticalcs_library_init(void); TIEXPORT3 int TICALL ticalcs_library_exit(void); /*********************/ /* General functions */ /*********************/ // ticalcs.c TIEXPORT3 const char* TICALL ticalcs_version_get(void); TIEXPORT3 uint32_t TICALL ticalcs_supported_calcs(void); TIEXPORT3 CalcHandle* TICALL ticalcs_handle_new(CalcModel model); TIEXPORT3 int TICALL ticalcs_handle_del(CalcHandle *handle); TIEXPORT3 int TICALL ticalcs_handle_show(CalcHandle *handle); TIEXPORT3 int TICALL ticalcs_cable_attach(CalcHandle *handle, CableHandle*); TIEXPORT3 int TICALL ticalcs_cable_detach(CalcHandle *handle); TIEXPORT3 int TICALL ticalcs_update_set(CalcHandle *handle, CalcUpdate*); TIEXPORT3 int TICALL ticalcs_model_supports_dbus(CalcModel model); TIEXPORT3 int TICALL ticalcs_model_supports_dusb(CalcModel model); TIEXPORT3 int TICALL ticalcs_model_supports_nsp(CalcModel model); // error.c TIEXPORT3 int TICALL ticalcs_error_get (int number, char **message); TIEXPORT3 int TICALL ticalcs_error_free (char *message); // calc_xx.c TIEXPORT3 CalcFeatures TICALL ticalcs_calc_features(CalcHandle *handle); TIEXPORT3 int TICALL ticalcs_calc_isready(CalcHandle *handle); TIEXPORT3 int TICALL ticalcs_calc_send_key(CalcHandle *handle, uint32_t); TIEXPORT3 int TICALL ticalcs_calc_execute(CalcHandle *handle, VarEntry*, const char*); TIEXPORT3 int TICALL ticalcs_calc_recv_screen(CalcHandle *handle, CalcScreenCoord* sc, uint8_t** bitmap); TIEXPORT3 int TICALL ticalcs_calc_recv_screen_rgb888(CalcHandle *handle, CalcScreenCoord* sc, uint8_t** bitmap); TIEXPORT3 void TICALL ticalcs_free_screen(uint8_t * bitmap); TIEXPORT3 int TICALL ticalcs_calc_get_dirlist(CalcHandle *handle, GNode** vars, GNode **apps); TIEXPORT3 int TICALL ticalcs_calc_get_memfree(CalcHandle *handle, uint32_t* ram, uint32_t *flash); TIEXPORT3 int TICALL ticalcs_calc_send_backup(CalcHandle *handle, BackupContent*); TIEXPORT3 int TICALL ticalcs_calc_recv_backup(CalcHandle *handle, BackupContent*); TIEXPORT3 int TICALL ticalcs_calc_send_var(CalcHandle *handle, CalcMode, FileContent*); TIEXPORT3 int TICALL ticalcs_calc_recv_var(CalcHandle *handle, CalcMode, FileContent*, VarRequest*); TIEXPORT3 int TICALL ticalcs_calc_send_var_ns(CalcHandle *handle, CalcMode, FileContent*); TIEXPORT3 int TICALL ticalcs_calc_recv_var_ns(CalcHandle *handle, CalcMode, FileContent*, VarEntry**); TIEXPORT3 int TICALL ticalcs_calc_send_app(CalcHandle *handle, FlashContent*); TIEXPORT3 int TICALL ticalcs_calc_recv_app(CalcHandle *handle, FlashContent*, VarRequest*); TIEXPORT3 int TICALL ticalcs_calc_send_os(CalcHandle *handle, FlashContent*); TIEXPORT3 int TICALL ticalcs_calc_recv_idlist(CalcHandle *handle, uint8_t*); TIEXPORT3 int TICALL ticalcs_calc_dump_rom_1(CalcHandle *handle); TIEXPORT3 int TICALL ticalcs_calc_dump_rom_2(CalcHandle *handle, CalcDumpSize, const char *filename); TIEXPORT3 int TICALL ticalcs_calc_set_clock(CalcHandle *handle, CalcClock* clock); TIEXPORT3 int TICALL ticalcs_calc_get_clock(CalcHandle *handle, CalcClock* clock); TIEXPORT3 int TICALL ticalcs_calc_new_fld(CalcHandle *handle, VarRequest*); TIEXPORT3 int TICALL ticalcs_calc_del_var(CalcHandle *handle, VarRequest*); TIEXPORT3 int TICALL ticalcs_calc_get_version(CalcHandle *handle, CalcInfos*); TIEXPORT3 int TICALL ticalcs_calc_send_cert(CalcHandle *handle, FlashContent*); TIEXPORT3 int TICALL ticalcs_calc_recv_cert(CalcHandle *handle, FlashContent*); TIEXPORT3 int TICALL ticalcs_calc_rename_var(CalcHandle *handle, VarRequest*, VarRequest*); TIEXPORT3 int TICALL ticalcs_calc_change_attr(CalcHandle *handle, VarRequest*, FileAttr); TIEXPORT3 int TICALL ticalcs_calc_send_all_vars_backup(CalcHandle *handle, FileContent*); TIEXPORT3 int TICALL ticalcs_calc_recv_all_vars_backup(CalcHandle *handle, FileContent*); TIEXPORT3 int TICALL ticalcs_calc_send_tigroup(CalcHandle *handle, TigContent*, TigMode); TIEXPORT3 int TICALL ticalcs_calc_recv_tigroup(CalcHandle *handle, TigContent*, TigMode); // calc_xx.c: convenient functions TIEXPORT3 int TICALL ticalcs_calc_send_backup2(CalcHandle *handle, const char*); TIEXPORT3 int TICALL ticalcs_calc_recv_backup2(CalcHandle *handle, const char*); TIEXPORT3 int TICALL ticalcs_calc_send_var2(CalcHandle *handle, CalcMode, const char*); TIEXPORT3 int TICALL ticalcs_calc_recv_var2(CalcHandle *handle, CalcMode, const char*, VarRequest*); TIEXPORT3 int TICALL ticalcs_calc_send_var_ns2(CalcHandle *handle, CalcMode, const char*); TIEXPORT3 int TICALL ticalcs_calc_recv_var_ns2(CalcHandle *handle, CalcMode, const char*, VarEntry**); TIEXPORT3 int TICALL ticalcs_calc_send_app2(CalcHandle *handle, const char*); TIEXPORT3 int TICALL ticalcs_calc_recv_app2(CalcHandle *handle, const char*, VarRequest*); TIEXPORT3 int TICALL ticalcs_calc_send_cert2(CalcHandle *handle, const char*); TIEXPORT3 int TICALL ticalcs_calc_recv_cert2(CalcHandle *handle, const char*); TIEXPORT3 int TICALL ticalcs_calc_send_os2(CalcHandle *handle, const char*); TIEXPORT3 int TICALL ticalcs_calc_send_tigroup2(CalcHandle *handle, const char*, TigMode); TIEXPORT3 int TICALL ticalcs_calc_recv_tigroup2(CalcHandle *handle, const char*, TigMode); // dirlist.c TIEXPORT3 void TICALL ticalcs_dirlist_destroy(GNode** tree); TIEXPORT3 void TICALL ticalcs_dirlist_display(GNode* tree); TIEXPORT3 int TICALL ticalcs_dirlist_ram_used(GNode* tree); TIEXPORT3 int TICALL ticalcs_dirlist_flash_used(GNode* vars, GNode* apps); TIEXPORT3 unsigned int TICALL ticalcs_dirlist_ve_count(GNode* tree); TIEXPORT3 VarEntry *TICALL ticalcs_dirlist_ve_exist(GNode* tree, VarEntry *entry); TIEXPORT3 void TICALL ticalcs_dirlist_ve_add(GNode* tree, VarEntry *entry); TIEXPORT3 void TICALL ticalcs_dirlist_ve_del(GNode* tree, VarEntry *entry); // type2str.c TIEXPORT3 const char* TICALL ticalcs_model_to_string(CalcModel model); TIEXPORT3 CalcModel TICALL ticalcs_string_to_model (const char *str); TIEXPORT3 const char* TICALL ticalcs_scrfmt_to_string(CalcScreenFormat format); TIEXPORT3 CalcScreenFormat TICALL ticalcs_string_to_scrfmt(const char *str); TIEXPORT3 const char* TICALL ticalcs_pathtype_to_string(CalcPathType type); TIEXPORT3 CalcPathType TICALL ticalcs_string_to_pathtype(const char *str); TIEXPORT3 const char* TICALL ticalcs_memtype_to_string(CalcMemType type); TIEXPORT3 CalcMemType TICALL ticalcs_string_to_memtype(const char *str); TIEXPORT3 int TICALL ticalcs_infos_to_string(CalcInfos *infos, char *str, uint32_t maxlen); // clock.c TIEXPORT3 const char* TICALL ticalcs_clock_format2date(CalcModel model, int value); TIEXPORT3 int TICALL ticalcs_clock_date2format(CalcModel model, const char *format); TIEXPORT3 int TICALL ticalcs_clock_show(CalcModel model, CalcClock* s); // screen.c TIEXPORT3 int TICALL ticalcs_screen_convert_bw_to_rgb888(const uint8_t * src, unsigned int width, unsigned int height, uint8_t * dst); TIEXPORT3 int TICALL ticalcs_screen_convert_bw_to_blurry_rgb888(const uint8_t * src, unsigned int width, unsigned int height, uint8_t * dst); TIEXPORT3 int TICALL ticalcs_screen_convert_gs4_to_rgb888(const uint8_t * src, unsigned int width, unsigned int height, uint8_t * dst); TIEXPORT3 int TICALL ticalcs_screen_convert_rgb565le_to_rgb888(const uint8_t * src, unsigned int width, unsigned int height, uint8_t * dst); TIEXPORT3 int TICALL ticalcs_screen_convert_native_to_rgb888(CalcPixelFormat format, const uint8_t * src, unsigned int width, unsigned int height, uint8_t * dst); TIEXPORT3 int TICALL ticalcs_screen_nspire_rle_uncompress(CalcPixelFormat format, const uint8_t * src, uint32_t input_size, uint8_t * dst, uint32_t max_output_size); TIEXPORT3 int TICALL ticalcs_screen_84pcse_rle_uncompress(const uint8_t * src, uint32_t src_length, uint8_t * dst, uint32_t dst_length); // tikeys.c TIEXPORT3 const CalcKey* TICALL ticalcs_keys_73 (uint8_t ascii_code); TIEXPORT3 const CalcKey* TICALL ticalcs_keys_83 (uint8_t ascii_code); TIEXPORT3 const CalcKey* TICALL ticalcs_keys_83p(uint8_t ascii_code); TIEXPORT3 const CalcKey* TICALL ticalcs_keys_86 (uint8_t ascii_code); TIEXPORT3 const CalcKey* TICALL ticalcs_keys_89 (uint8_t ascii_code); TIEXPORT3 const CalcKey* TICALL ticalcs_keys_92p(uint8_t ascii_code); // probe.c TIEXPORT3 int TICALL ticalcs_probe_calc (CableHandle* cable, CalcModel* model); TIEXPORT3 int TICALL ticalcs_probe_usb_calc(CableHandle* cable, CalcModel* model); TIEXPORT3 int TICALL ticalcs_probe(CableModel c_model, CablePort c_port, CalcModel* model, int all); TIEXPORT3 CalcModel TICALL ticalcs_device_info_to_model(const CableDeviceInfo *info); TIEXPORT3 CalcModel TICALL ticalcs_remap_model_from_usb(CableModel cable, CalcModel calc); TIEXPORT3 CalcModel TICALL ticalcs_remap_model_to_usb(CableModel cable, CalcModel calc); // dbus_pkt.c TIEXPORT3 int TICALL dbus_send(CalcHandle *handle, uint8_t target, uint8_t cmd, uint16_t length, const uint8_t* data); TIEXPORT3 int TICALL dbus_recv(CalcHandle *handle, uint8_t* host, uint8_t* cmd, uint16_t* length, uint8_t* data); TIEXPORT3 int TICALL dbus_recv_header(CalcHandle *handle, uint8_t* host, uint8_t* cmd, uint16_t* length); TIEXPORT3 int TICALL dbus_recv_data(CalcHandle *handle, uint16_t* length, uint8_t* data); // dusb_rpkt.c TIEXPORT3 int TICALL dusb_send(CalcHandle *handle, DUSBRawPacket* pkt); TIEXPORT3 int TICALL dusb_recv(CalcHandle *handle, DUSBRawPacket* pkt); // nsp_rpkt.c TIEXPORT3 int TICALL nsp_send(CalcHandle *handle, NSPRawPacket* pkt); TIEXPORT3 int TICALL nsp_recv(CalcHandle *handle, NSPRawPacket* pkt); /************************/ /* Deprecated functions */ /************************/ #ifdef __cplusplus } #endif #endif libticalcs-1.1.9+dfsg/src/tikeys.c000066400000000000000000000052171327711501700170260ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "ticalcs.h" #include "keys73.h" #include "keys83.h" #include "keys83p.h" #include "keys86.h" #include "keys89.h" #include "keys92p.h" extern const CalcKey TI73_KEYS[]; extern const CalcKey TI83_KEYS[]; extern const CalcKey TI83P_KEYS[]; extern const CalcKey TI86_KEYS[]; extern const CalcKey TI89_KEYS[]; extern const CalcKey TI92P_KEYS[]; /** * ticalcs_keys_73: * @code: an ASCII character * * Conversion of an ASCII code into a TI key. * * Return value: a TI key. **/ TIEXPORT3 const CalcKey* TICALL ticalcs_keys_73(uint8_t ascii_code) { return &TI73_KEYS[ascii_code]; } /** * ticalcs_keys_83: * @code: an ASCII character * * Conversion of an ASCII code into a TI key. * * Return value: a TI key. **/ TIEXPORT3 const CalcKey* TICALL ticalcs_keys_83(uint8_t ascii_code) { return &TI83_KEYS[ascii_code]; } /** * ticalcs_keys_83p: * @code: an ASCII character * * Conversion of an ASCII code into a TI key. * * Return value: a TI key. **/ TIEXPORT3 const CalcKey* TICALL ticalcs_keys_83p(uint8_t ascii_code) { return &TI83P_KEYS[ascii_code]; } /** * ticalcs_keys_86: * @code: an ASCII character * * Conversion of an ASCII code into a TI key. * * Return value: a TI key. **/ TIEXPORT3 const CalcKey* TICALL ticalcs_keys_86(uint8_t ascii_code) { return &TI86_KEYS[ascii_code]; } /** * ticalcs_keys_89: * @code: an ASCII character * * Conversion of an ASCII code into a TI key. * * Return value: a TI key. **/ TIEXPORT3 const CalcKey* TICALL ticalcs_keys_89(uint8_t ascii_code) { return &TI89_KEYS[ascii_code]; } /** * ticalcs_keys_92p: * @code: an ASCII character * * Conversion of an ASCII code into a TI key. * * Return value: a TI key. **/ TIEXPORT3 const CalcKey* TICALL ticalcs_keys_92p(uint8_t ascii_code) { return &TI92P_KEYS[ascii_code]; } libticalcs-1.1.9+dfsg/src/type2str.c000066400000000000000000000204671327711501700173160ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "ticalcs.h" #include "gettext.h" #include "internal.h" #include "logging.h" #include "error.h" /** * ticalcs_model_to_string: * @model: a calculator model. * * Do an integer to string conversion. * * Return value: a string like "TI92+". **/ TIEXPORT3 const char *TICALL ticalcs_model_to_string(CalcModel model) { return tifiles_model_to_string(model); } /** * ticalcs_string_to_model: * @str: a calculator model as string like "TI92". * * Do a string to integer conversion. * * Return value: a calculator model. **/ TIEXPORT3 CalcModel TICALL ticalcs_string_to_model(const char *str) { return tifiles_string_to_model(str); } TIEXPORT3 const char *TICALL ticalcs_scrfmt_to_string(CalcScreenFormat format) { switch (format) { case SCREEN_FULL: return _("full"); case SCREEN_CLIPPED: return _("clipped"); default: return _("unknown"); } } TIEXPORT3 CalcScreenFormat TICALL ticalcs_string_to_scrfmt(const char *str) { if (str != NULL) { if (!strcmp(str, _("full"))) { return SCREEN_FULL; } else if (!strcmp(str, _("clipped"))) { return SCREEN_CLIPPED; } } else { ticalcs_critical("ticalcs_string_to_scrfmt(NULL)"); } return SCREEN_CLIPPED; } TIEXPORT3 const char *TICALL ticalcs_pathtype_to_string(CalcPathType type) { switch (type) { case PATH_FULL: return _("full"); case PATH_LOCAL: return _("local"); default: return _("unknown"); } } TIEXPORT3 CalcPathType TICALL ticalcs_string_to_pathtype(const char *str) { if (str != NULL) { if (!strcmp(str, _("full"))) { return PATH_FULL; } else if (!strcmp(str, _("local"))) { return PATH_LOCAL; } } else { ticalcs_critical("ticalcs_string_to_pathtype(NULL)"); } return PATH_FULL; } TIEXPORT3 const char *TICALL ticalcs_memtype_to_string(CalcMemType type) { switch (type) { case MEMORY_FREE: return _("free"); case MEMORY_USED: return _("used"); default: return _("unknown"); } } TIEXPORT3 CalcMemType TICALL ticalcs_string_to_memtype(const char *str) { if (str != NULL) { if (!strcmp(str, _("free"))) { return MEMORY_FREE; } else if (!strcmp(str, _("used"))) { return MEMORY_USED; } } return MEMORY_NONE; } TIEXPORT3 int TICALL ticalcs_infos_to_string(CalcInfos *infos, char *str, uint32_t maxlen) { if (infos != NULL) { char language_ids[25]; char device_type[3]; char hw_version[11]; char clock_speed[15]; char lcd_width[20]; char lcd_height[20]; char bpp[11]; char color_screen[11]; char ram_phys[30]; char ram_user[30]; char ram_free[30]; char flash_phys[30]; char flash_user[30]; char flash_free[30]; language_ids[0] = 0; if (infos->mask & INFOS_LANG_ID) { sprintf(language_ids, "%d %d", infos->language_id, infos->sub_lang_id); } device_type[0] = 0; if (infos->mask & INFOS_DEVICE_TYPE) { sprintf(device_type, "%02X", infos->device_type); } hw_version[0] = 0; if (infos->mask & INFOS_HW_VERSION) { sprintf(hw_version, "%d", infos->hw_version); } clock_speed[0] = 0; if (infos->mask & INFOS_CLOCK_SPEED) { sprintf(clock_speed, "%d MHz", infos->clock_speed); } lcd_width[0] = 0; if (infos->mask & INFOS_LCD_WIDTH) { sprintf(lcd_width, "%d pixels", infos->lcd_width); } lcd_height[0] = 0; if (infos->mask & INFOS_LCD_HEIGHT) { sprintf(lcd_height, "%d pixels", infos->lcd_height); } bpp[0] = 0; if (infos->mask & INFOS_BPP) { sprintf(bpp, "%d pixels", infos->bits_per_pixel); } color_screen[0] = 0; if (infos->mask & INFOS_COLOR_SCREEN) { sprintf(color_screen, "%d", infos->color_screen); } ram_phys[0] = 0; // The casts below aren't truncating in practice until one of the models grows more than 4 GB of RAM or Flash. if (infos->mask & INFOS_RAM_PHYS) { sprintf(ram_phys, "%lu B (%lu KB)", (unsigned long)infos->ram_phys, (unsigned long)((infos->ram_phys + 512) >> 10)); } ram_user[0] = 0; if (infos->mask & INFOS_RAM_USER) { sprintf(ram_user, "%lu B (%lu KB)", (unsigned long)infos->ram_user, (unsigned long)((infos->ram_user + 512) >> 10)); } ram_free[0] = 0; if (infos->mask & INFOS_RAM_FREE) { sprintf(ram_free, "%lu B (%lu KB)", (unsigned long)infos->ram_free, (unsigned long)((infos->ram_free + 512) >> 10)); } flash_phys[0] = 0; if (infos->mask & INFOS_FLASH_PHYS) { sprintf(flash_phys, "%lu B (%lu KB)", (unsigned long)infos->flash_phys, (unsigned long)((infos->flash_phys + 512) >> 10)); } flash_user[0] = 0; if (infos->mask & INFOS_FLASH_USER) { sprintf(flash_user, "%lu B (%lu KB)", (unsigned long)infos->flash_user, (unsigned long)((infos->flash_user + 512) >> 10)); } flash_free[0] = 0; if (infos->mask & INFOS_FLASH_FREE) { sprintf(flash_free, "%lu B (%lu KB)", (unsigned long)infos->flash_free, (unsigned long)((infos->flash_free + 512) >> 10)); } ticalcs_slprintf(str, maxlen, "%s" "%s\n" "%s" "%s\n" "%s" "%s\n" "\n" "%s" "%s\n" "%s" "%s\n" "%s" "%s\n" "%s" "%s\n" "%s" "%s\n" "%s" "%s\n" "%s" "%s\n" "%s" "%s\n" "\n" "%s" "%s\n" "%s" "%s\n" "%s" "%s\n" "%s" "%s\n" "\n" "%s" "%s\n" "%s" "%s\n" "%s" "%s\n" "%s" "%s\n" "%s" "%s\n" "%s" "%s\n" "\n" "%s" "%s\n", (infos->mask & INFOS_PRODUCT_NAME) ? _("Product Name: ") : "", (infos->mask & INFOS_PRODUCT_NAME) ? infos->product_name : "", (infos->mask & INFOS_PRODUCT_ID) ? _("Product ID: ") : "", (infos->mask & INFOS_PRODUCT_ID) ? infos->product_id : "", (infos->mask & INFOS_LANG_ID) ? _("Language ID: ") : "", language_ids, (infos->mask & INFOS_DEVICE_TYPE) ? _("Device Type: ") : "", device_type, (infos->mask & INFOS_HW_VERSION) ? _("Hardware Version: ") : "", hw_version, (infos->mask & INFOS_BOOT_VERSION) ? _("Boot Version: ") : "", (infos->mask & INFOS_BOOT_VERSION) ? infos->boot_version : "", (infos->mask & INFOS_BOOT2_VERSION) ? _("Boot2 Version: ") : "", (infos->mask & INFOS_BOOT2_VERSION) ? infos->boot2_version : "", (infos->mask & INFOS_OS_VERSION) ? _("OS Version: ") : "", (infos->mask & INFOS_OS_VERSION) ? infos->os_version : "", (infos->mask & INFOS_RUN_LEVEL) ? _("Run level: ") : "", (infos->mask & INFOS_RUN_LEVEL) ? ((infos->run_level == 2) ? "OS" : "boot") : "", (infos->mask & INFOS_CLOCK_SPEED) ? _("Clock speed: ") : "", clock_speed, (infos->mask & INFOS_EXACT_MATH) ? _("Exact math engine: ") : "", (infos->mask & INFOS_EXACT_MATH) ? ((infos->exact_math) ? _("Yes") : _("No")) : "", (infos->mask & INFOS_LCD_WIDTH) ? _("LCD width: ") : "", lcd_width, (infos->mask & INFOS_LCD_HEIGHT) ? _("LCD height: ") : "", lcd_height, (infos->mask & INFOS_BPP) ? _("Bits per pixel: ") : "", bpp, (infos->mask & INFOS_COLOR_SCREEN) ? _("Color screen: ") : "", color_screen, (infos->mask & INFOS_RAM_PHYS) ? _("Physical RAM: ") : "", ram_phys, (infos->mask & INFOS_RAM_USER) ? _("User RAM: ") : "", ram_user, (infos->mask & INFOS_RAM_FREE) ? _("Free RAM: ") : "", ram_free, (infos->mask & INFOS_FLASH_PHYS) ? _("Physical Flash: ") : "", flash_phys, (infos->mask & INFOS_FLASH_USER) ? _("User Flash: ") : "", flash_user, (infos->mask & INFOS_FLASH_FREE) ? _("Free Flash: ") : "", flash_free, (infos->mask & INFOS_BATTERY) ? _("Battery: ") : "", (infos->mask & INFOS_BATTERY) ? (infos->battery ? _("good") : _("low")) : ""); return 0; } else { ticalcs_critical("%s: infos is NULL", __FUNCTION__); return ERR_INVALID_PARAMETER; } } libticalcs-1.1.9+dfsg/src/update.c000066400000000000000000000024471327711501700170020ustar00rootroot00000000000000/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2005 Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "ticalcs.h" static void ticalcs_update_start(void) {}; static void ticalcs_update_stop(void) {}; static void ticalcs_update_refresh(void){}; static void ticalcs_update_pbar(void) {}; static void ticalcs_update_label(void) {}; CalcUpdate default_update = { "", 0, 0.0, 0, 0, 0, 0, 0, 0, (1 << 0), 0, ticalcs_update_start, ticalcs_update_stop, ticalcs_update_refresh, ticalcs_update_pbar, ticalcs_update_label, }; libticalcs-1.1.9+dfsg/tests/000077500000000000000000000000001327711501700157205ustar00rootroot00000000000000libticalcs-1.1.9+dfsg/tests/Makefile.am000066400000000000000000000007761327711501700177660ustar00rootroot00000000000000## Process this file with automake to produce Makefile.in AM_CPPFLAGS = -I$(top_srcdir)/src \ @GLIB_CFLAGS@ @TICABLES_CFLAGS@ @TIFILES_CFLAGS@ @TICONV_CFLAGS@ EXTRA_DIST = ticalcs2.supp vcheck noinst_PROGRAMS = test_ticalcs_2 torture_ticalcs test_ticalcs_2_LDADD = $(top_builddir)/src/libticalcs2.la \ @GLIB_LIBS@ @TICABLES_LIBS@ @TIFILES_LIBS@ @TICONV_LIBS@ torture_ticalcs_LDADD = $(top_builddir)/src/libticalcs2.la \ @GLIB_LIBS@ @TICABLES_LIBS@ @TIFILES_LIBS@ @TICONV_LIBS@ TESTS = torture_ticalcs libticalcs-1.1.9+dfsg/tests/test_ticalcs_2.c000066400000000000000000000551661327711501700210030ustar00rootroot00000000000000/* $Id$ */ /* libticalcs - Ti Calculator library, a part of the TiLP project * Copyright (C) 1999-2004 Romain Lievin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This program shows how to use the libticalcs library. You can consider this * as an authoritative example. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "ticables.h" #include "tifiles.h" #include "../src/ticalcs.h" #include "../src/nsp_cmd.h" #include "../src/cmdz80.h" #include "../src/dusb_rpkt.h" #include "../src/keysnsp.h" #undef VERSION #define VERSION "Test program" static int read_varname(CalcHandle* h, VarRequest *vr, const char *prompt) { char buf[256]; const char *s; int ret; char * endptr; memset(vr, 0, sizeof(VarRequest)); if (ticalcs_calc_features(h) & FTS_FOLDER) { printf("Enter%s folder name: ", prompt); ret = scanf("%1023s", vr->folder); if (ret < 1) { return 0; } } printf("Enter%s variable name: ", prompt); ret = scanf("%1023s", vr->name); if (ret < 1) { return 0; } if (tifiles_calc_is_ti8x(h->model)) { printf("Enter%s variable type: ", prompt); ret = scanf("%255s", buf); if (ret < 1) { return 0; } // Special handling for types written in hex. errno = 0; vr->type = (uint8_t)strtoul(buf, &endptr, 16); if (errno != 0) { // The string doesn't seem to be a valid numeric value. // Let's try to parse a fext instead. vr->type = tifiles_fext2vartype(h->model, buf); s = tifiles_vartype2string(h->model, vr->type); if (s == NULL || *s == 0) { vr->type = tifiles_string2vartype(h->model, buf); } } } return 1; } static int build_raw_bytes_from_hex_string(char * buffer, uint32_t maxbuflen, unsigned char * data, uint32_t maxdatalen, uint32_t * length) { uint32_t i; uint8_t c = 0; int odd = 0; for (i = 0; i < maxbuflen; i++) { if (buffer[i] == 0) { if (odd) { printf("Odd number of nibbles in hex string, bailing out"); } return odd; } else if (buffer[i] >= '0' && buffer[i] <= '9') { c |= buffer[i] - '0'; } else if (buffer[i] >= 'a' && buffer[i] <= 'f') { c |= buffer[i] - 'a' + 10; } else if (buffer[i] >= 'A' && buffer[i] <= 'F') { c |= buffer[i] - 'A' + 10; } else { continue; } if (odd) { if (*length < maxdatalen) { *data++ = c; odd = 0; c = 0; } else { printf("Reached max length, bailing out"); return 0; } (*length)++; } else { odd++; c <<= 4; } } return 1; } static void print_lc_error(int errnum) { char *msg; ticables_error_get(errnum, &msg); fprintf(stderr, "Link cable error (code %i)...\n<<%s>>\n", errnum, msg); free(msg); } typedef int (*FNCT_MENU) (CalcHandle*); static int is_ready(CalcHandle* h) { int ret; ret = ticalcs_calc_isready(h); printf("Hand-held is %sready !\n", ret ? "not " : ""); return 0; } static int send_key(CalcHandle *h) { int ret; unsigned int key_value; printf("Enter key value to be sent: "); ret = scanf("%i", &key_value); if (ret < 1) { return 0; } return ticalcs_calc_send_key(h, key_value); } static int execute(CalcHandle *h) { VarEntry ve; memset(&ve, 0, sizeof(ve)); if(!read_varname(h, &ve, "")) { return 0; } return ticalcs_calc_execute(h, &ve, ""); } static int recv_screen(CalcHandle *h) { CalcScreenCoord sc = { SCREEN_CLIPPED, 0, 0, 0, 0, CALC_PIXFMT_MONO }; uint8_t* bitmap = NULL; int ret; ret = ticalcs_calc_recv_screen(h, &sc, &bitmap); ticalcs_free_screen(bitmap); return ret; } static int get_dirlist(CalcHandle *h) { GNode *vars, *apps; int ret; ret = ticalcs_calc_get_dirlist(h, &vars, &apps); if (!ret) { ticalcs_dirlist_display(vars); ticalcs_dirlist_display(apps); ticalcs_dirlist_destroy(&vars); ticalcs_dirlist_destroy(&apps); } return ret; } static int send_backup(CalcHandle* h) { char filename[1030]; char filename2[1030]; int ret; filename[0] = 0; printf("Enter filename: "); ret = scanf("%1023s", filename); if (ret < 1) { return 0; } snprintf(filename2, sizeof(filename2) - 1, "%s.%s", filename, tifiles_fext_of_backup(h->model)); filename2[sizeof(filename2) - 1] = 0; return ticalcs_calc_send_backup2(h, filename); } static int recv_backup(CalcHandle* h) { char filename[1030]; char filename2[1030]; int ret; filename[0] = 0; printf("Enter filename: "); ret = scanf("%1023s", filename); if (ret < 1) { return 0; } snprintf(filename2, sizeof(filename2) - 1, "%s.%s", filename, tifiles_fext_of_backup(h->model)); filename2[sizeof(filename2) - 1] = 0; return ticalcs_calc_recv_backup2(h, filename); } static int send_var(CalcHandle* h) { char filename[1030]; int ret; FileContent *content; VarEntry ve; filename[0] = 0; printf("Enter filename: "); ret = scanf("%1023s", filename); if (ret < 1) { return 0; } if (h->model == CALC_NSPIRE) { memset(&ve, 0, sizeof(ve)); if(!read_varname(h, &ve, "")) { return 0; } } content = tifiles_content_create_regular(h->model); if (content != NULL) { ret = tifiles_file_read_regular(filename, content); if (!ret) { if (h->model == CALC_NSPIRE) { strncpy(content->entries[0]->folder, ve.folder, sizeof(content->entries[0]->folder) - 1); content->entries[0]->folder[sizeof(content->entries[0]->folder) - 1] = 0; strncpy(content->entries[0]->name, ve.name, sizeof(content->entries[0]->name) - 1); content->entries[0]->name[sizeof(content->entries[0]->name) - 1] = 0; } ret = ticalcs_calc_send_var(h, MODE_NORMAL, content); tifiles_content_delete_regular(content); } } else { ret = -1; } return ret; } static int recv_var(CalcHandle* h) { char filename[1030]; int ret; VarEntry ve; filename[0] = 0; printf("Enter filename: "); ret = scanf("%1023s", filename); if (ret < 1) { return 0; } memset(&ve, 0, sizeof(ve)); if(!read_varname(h, &ve, "")) { return 0; } return ticalcs_calc_recv_var2(h, MODE_NORMAL, filename, &ve); } static int send_var_ns(CalcHandle* h) { char filename[1030]; int ret; filename[0] = 0; printf("Enter filename: "); ret = scanf("%1023s", filename); if (ret < 1) { return 0; } return ticalcs_calc_send_var_ns2(h, MODE_NORMAL, filename); } static int recv_var_ns(CalcHandle* h) { char filename[1030]; int ret; VarRequest *ve; filename[0] = 0; printf("Enter filename: "); ret = scanf("%1023s", filename); if (ret < 1) { return 0; } return ticalcs_calc_recv_var_ns2(h, MODE_NORMAL, filename, &ve); } static int send_flash(CalcHandle *h) { char filename[1030]; char filename2[1030]; int ret; filename[0] = 0; printf("Enter filename: "); ret = scanf("%1023s", filename); if (ret < 1) { return 0; } snprintf(filename2, sizeof(filename2) - 1, "%s.%s", filename, tifiles_fext_of_flash_app(h->model)); filename2[sizeof(filename2) - 1] = 0; return ticalcs_calc_send_app2(h, filename); } static int recv_flash(CalcHandle *h) { char filename[1030]; int ret; VarEntry ve; filename[0] = 0; printf("Enter filename: "); ret = scanf("%1023s", filename); if (ret < 1) { return 0; } memset(&ve, 0, sizeof(ve)); printf("Enter application name: "); ret = scanf("%1023s", ve.name); if (ret < 1) { return 0; } return ticalcs_calc_recv_app2(h, filename, &ve); } static int send_os(CalcHandle *h) { char filename[1030]; int ret; filename[0] = 0; printf("Enter filename: "); ret = scanf("%1023s", filename); if (ret < 1) { return 0; } return ticalcs_calc_send_os2(h, filename); } static int recv_idlist(CalcHandle *h) { uint8_t id[32]; int ret; ret = ticalcs_calc_recv_idlist(h, id); if (!ret) { printf("IDLIST: <%s>", id); } return ret; } static int dump_rom(CalcHandle *h) { char filename[1030]; int ret; filename[0] = 0; printf("Enter filename: "); ret = scanf("%1023s", filename); if (ret < 1) { return 0; } ret = ticalcs_calc_dump_rom_1(h); if (!ret) { ret = ticalcs_calc_dump_rom_2(h, 0, filename); } return ret; } static int set_clock(CalcHandle *h) { CalcClock clk; int ret; ret = ticalcs_calc_get_clock(h, &clk); if (!ret) { ret = ticalcs_calc_set_clock(h, &clk); } return ret; } static int get_clock(CalcHandle *h) { CalcClock clk; int ret; ret = ticalcs_calc_get_clock(h, &clk); if (!ret) { ticalcs_clock_show(h->model, &clk); } return ret; } static int del_var(CalcHandle* h) { VarEntry ve; memset(&ve, 0, sizeof(ve)); if (!read_varname(h, &ve, "")) { return 0; } return ticalcs_calc_del_var(h, &ve); } static int rename_var(CalcHandle* h) { VarEntry src; VarEntry dst; memset(&src, 0, sizeof(src)); if (!read_varname(h, &src, " current")) { return 0; } memset(&dst, 0, sizeof(dst)); if (!read_varname(h, &dst, " new")) { return 0; } return ticalcs_calc_rename_var(h, &src, &dst); } static int archive_var(CalcHandle* h) { VarEntry ve; memset(&ve, 0, sizeof(ve)); if (!read_varname(h, &ve, "")) { return 0; } return ticalcs_calc_change_attr(h, &ve, ATTRB_ARCHIVED); } static int unarchive_var(CalcHandle* h) { VarEntry ve; memset(&ve, 0, sizeof(ve)); if (!read_varname(h, &ve, "")) { return 0; } return ticalcs_calc_change_attr(h, &ve, ATTRB_NONE); } static int lock_var(CalcHandle* h) { VarEntry ve; memset(&ve, 0, sizeof(ve)); if (!read_varname(h, &ve, "")) { return 0; } return ticalcs_calc_change_attr(h, &ve, ATTRB_LOCKED); } static int new_folder(CalcHandle* h) { VarEntry ve; int ret; memset(&ve, 0, sizeof(ve)); if (!tifiles_calc_is_ti8x(h->model)) { printf("Enter folder name: "); ret = scanf("%1023s", ve.folder); if (ret < 1) { return 0; } } return ticalcs_calc_new_fld(h, &ve); } static int get_version(CalcHandle *h) { int ret; CalcInfos infos; char str[2048]; ret = ticalcs_calc_get_version(h, &infos); if (!ret) { str[0] = 0; ret = ticalcs_infos_to_string(&infos, str, sizeof(str)); if (!ret) { printf("%s\n", str); } } return ret; } static int probe_calc(CalcHandle *h) { int m; int p; int ret; CalcModel model; printf("Enter cable & port for probing (c p): "); ret = scanf("%d %d", &m, &p); if (ret < 2) { return 0; } ticalcs_probe((CableModel)m, (CablePort)p, &model, !0); //ticalcs_probe_calc(h->cable, &model); //ticalcs_probe_usb_calcs(h->cable, &model); printf("Found: <%s>", ticalcs_model_to_string(model)); return 0; } static int nsp_send_key(CalcHandle *h) { //static const uint8_t HOME[] = {0x00, 0xFD, 0x00}; static const uint8_t A[] = {97, 102, 0}; //static const uint8_t ZERO[] = {48, 80, 0}; static const uint8_t ONE[] = {49, 115, 0}; //static const uint8_t TWO[] = {50, 83, 0}; static const uint8_t THREE[] = {51, 51, 0}; //static const uint8_t FOUR[] = {52, 114, 0}; static const uint8_t FIVE[] = {53, 82, 0}; //static const uint8_t SIX[] = {54, 50, 0}; static const uint8_t SEVEN[] = {55, 113, 0}; //static const uint8_t EIGHT[] = {56, 81, 0}; static const uint8_t NINE[] = {57, 49, 0}; ticalcs_calc_send_key(h, KEYNSP_HOME); nsp_cmd_s_keypress_event(h, A); ticalcs_calc_send_key(h, KEYNSP_ZERO); nsp_cmd_s_keypress_event(h, ONE); ticalcs_calc_send_key(h, KEYNSP_TWO); nsp_cmd_s_keypress_event(h, THREE); ticalcs_calc_send_key(h, KEYNSP_FOUR); nsp_cmd_s_keypress_event(h, FIVE); ticalcs_calc_send_key(h, KEYNSP_SIX); nsp_cmd_s_keypress_event(h, SEVEN); ticalcs_calc_send_key(h, KEYNSP_EIGHT); nsp_cmd_s_keypress_event(h, NINE); ticalcs_calc_send_key(h, KEYNSP_HOME); return 0; } static int ti83pfamily_dump(CalcHandle *h) { char filename[1024]; uint8_t buffer[0x4100]; int page; int ret; uint16_t length; FILE *f; filename[0] = 0; printf("Enter page number for dumping: "); ret = scanf("%d", &page); if (ret < 1) { return 0; } printf("Enter filename: "); ret = scanf("%1023s", filename); if (ret < 1) { return 0; } f = fopen(filename, "wb"); if (f != NULL) { memset(buffer, 0, sizeof(buffer)); if ( (ti73_send_DUMP(h, (uint16_t)page) == 0) && (ti73_recv_ACK(h, NULL) == 0) && (ti73_recv_XDP(h, &length, buffer) == 0) && (ti73_send_ACK(h) == 0)) { fwrite(buffer, length, 1, f); } fclose(f); } return 0; } static int ti83pfamily_eke(CalcHandle *h) { if ( (ti73_send_EKE(h) == 0) && (ti73_recv_ACK(h, NULL) == 0)) { printf("EKE successfully sent\n"); } return 0; } static int ti83pfamily_dke(CalcHandle *h) { if ( (ti73_send_DKE(h) == 0) && (ti73_recv_ACK(h, NULL) == 0)) { printf("DKE successfully sent\n"); } return 0; } static int ti83pfamily_eld(CalcHandle *h) { if ( (ti73_send_ELD(h) == 0) && (ti73_recv_ACK(h, NULL) == 0)) { printf("ELD successfully sent\n"); } return 0; } static int ti83pfamily_dld(CalcHandle *h) { if ( (ti73_send_DLD(h) == 0) && (ti73_recv_ACK(h, NULL) == 0)) { printf("DLD successfully sent\n"); } return 0; } static int ti83pfamily_gid(CalcHandle *h) { uint8_t buffer[0x10]; uint16_t length; uint16_t i; if ( (ti73_send_GID(h) == 0) && (ti73_recv_ACK(h, NULL) == 0) && (ti73_recv_XDP(h, &length, buffer) == 0) && (ti73_send_ACK(h) == 0)) { printf("GID successfully sent\n"); for (i = 0; i < length; i++) { printf("%02X ", buffer[i]); } puts("\n"); } return 0; } static int ti83pfamily_rid(CalcHandle *h) { uint8_t buffer[0x30]; uint16_t length; uint16_t i; if ( (ti73_send_RID(h) == 0) && (ti73_recv_SID(h, &length, buffer) == 0) && (ti73_send_ACK(h) == 0)) { printf("RID/SID successful\n"); for (i = 0; i < length; i++) { printf("%02X ", buffer[i]); } puts("\n"); } return 0; } static int ti83pfamily_sid(CalcHandle *h) { static uint8_t DATA[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20 }; if ( (ti73_send_SID(h, DATA) == 0) && (ti73_recv_ACK(h, NULL) == 0)) { printf("SID successful\n"); } return 0; } #include "../src/dusb_cmd.h" static int dusb_dissect_rpkt(CalcHandle *h) { int ret; uint8_t ep = 2; // Assume PC -> TI. uint8_t first = 1; // Assume all packets are first packets. char buffer[65536 + 2]; uint8_t data[sizeof(((DUSBRawPacket *)0)->data)]; uint32_t length = 0; int model; printf("Enter calc model (usually 13, 14, 18-21): "); ret = scanf("%d", &model); if (ret < 1) { return 0; } buffer[0] = 0; printf("Enter raw DUSB packet as hex string of up to 4 * max raw packet size (non-hex characters ignored; CTRL+D to end):\n"); ret = scanf("%65536[^\x04]", buffer); if (ret < 1) { return 0; } fputc('\n', stdout); if (!build_raw_bytes_from_hex_string(buffer, sizeof(buffer) / sizeof(buffer[0]), data, sizeof(data) / sizeof(data[0]), &length)) { if (dusb_dissect((CalcModel)model, stderr, data, length, ep, &first) == 0) { printf("Dissection successful\n"); } else { printf("Dissection failed\n"); } } else { printf("Failed to build raw data, not dissected\n"); } return 0; } static int dusb_get_param_ids(CalcHandle * h) { int ret; char buffer[4096 + 2]; uint16_t data[1024]; uint32_t length = 0; buffer[0] = 0; printf("Enter hex string containing parameter IDs which will be requested to the calculator (non-hex characters ignored; CTRL+D to end):\n"); ret = scanf("%4096[^\x04]", buffer); if (ret < 1) { return 0; } fputc('\n', stdout); if (!build_raw_bytes_from_hex_string(buffer, sizeof(buffer) / sizeof(buffer[0]), (uint8_t *)data, sizeof(data), &length)) { if ((length & 1) == 0) { DUSBCalcParam **params; params = dusb_cp_new_array(h, length / 2); ret = dusb_cmd_s_param_request(h, length / 2, data); if (!ret) { ret = dusb_cmd_r_param_data(h, length / 2, params); if (!ret) { unsigned int i; for (i = 0; i < length / 2; i++) { printf("%04X\t%s\t%04X (%u)\n\t\t", params[i]->id, params[i]->ok ? "OK" : "NOK", params[i]->size, params[i]->size); if (params[i]->ok && params[i]->size > 0 && params[i]->data != NULL) { uint16_t j; uint8_t * ptr = params[i]->data; for (j = 0; j < params[i]->size;) { printf("%02X ", *ptr++); if (!(++j & 15)) { printf("\n\t\t"); } } putchar('\n'); } } } } dusb_cp_del_array(h, length / 2, params); } else { printf("Odd number of bytes in hex string, bailing out"); } } else { printf("Failed to build raw data, not sent\n"); } return 0; } static int dusb_set_param_id(CalcHandle * h) { int ret; char buffer[4096 + 2]; uint8_t * data; uint32_t length = 0; unsigned int param_id; data = dusb_cp_alloc_data(2048); printf("Enter DUSB parameter ID to be set (usually < 0x60): "); ret = scanf("%i", ¶m_id); if (ret < 1) { return 0; } buffer[0] = 0; printf("Enter raw DUSB packet as hex string of up to 4 * max raw packet size (non-hex characters ignored; CTRL+D to end):\n"); ret = scanf("%4096[^\x04]", buffer); if (ret < 1) { return 0; } fputc('\n', stdout); if (!build_raw_bytes_from_hex_string(buffer, sizeof(buffer) / sizeof(buffer[0]), (uint8_t *)data, 2048, &length)) { DUSBCalcParam *param; param = dusb_cp_new_ex(h, param_id, length, data); ret = dusb_cmd_s_param_set(h, param); dusb_cp_del(h, param); if (!ret) { ret = dusb_cmd_r_data_ack(h); } } else { printf("Failed to build raw data, not sent\n"); } return 0; } static struct { const char * desc; FNCT_MENU fnct; } fnct_menu[] = { { "Exit", NULL }, { "Check whether calc is ready", is_ready }, { "Send a key", send_key }, { "Execute program", execute }, { "Do a screenshot", recv_screen }, { "Listing", get_dirlist }, { "Send backup", send_backup }, { "Recv backup", recv_backup }, { "Send var", send_var }, { "Recv var", recv_var }, { "Send var (ns)", send_var_ns }, { "Recv var (ns)", recv_var_ns }, { "Send flash", send_flash }, { "Recv flash", recv_flash }, { "Send OS", send_os }, { "Get ID-LIST", recv_idlist }, { "Dump ROM", dump_rom }, { "Set clock", set_clock }, { "Get clock", get_clock }, { "Delete var", del_var }, { "Rename var", rename_var }, { "Archive var", archive_var }, { "Unarchive var", unarchive_var }, { "Lock var", lock_var }, { "New folder", new_folder }, { "Get version", get_version }, { "Probe calc", probe_calc }, { "Nspire-specific and generic send key", nsp_send_key }, { "83+-family-specific memory dump", ti83pfamily_dump }, { "83+-family-specific enable key echo", ti83pfamily_eke }, { "83+-family-specific disable key echo", ti83pfamily_dke }, { "83+-family-specific enable lockdown", ti83pfamily_eld }, { "83+-family-specific disable lockdown", ti83pfamily_dld }, { "83+-family-specific get standard calculator ID", ti83pfamily_gid }, { "83+-family-specific retrieve some 32-byte memory area", ti83pfamily_rid }, { "83+-family-specific set some 32-byte memory area", ti83pfamily_sid }, { "DUSB: dissect raw packet", dusb_dissect_rpkt }, { "DUSB: get parameter IDs", dusb_get_param_ids }, { "DUSB: set parameter ID", dusb_set_param_id } }; int main(int argc, char **argv) { CableModel cable_model = CABLE_NUL; int port_number = 1; CalcModel calc_model = CALC_NONE; CableHandle* cable = NULL; CalcHandle* calc = NULL; int err = 0, i; int do_exit = 0; unsigned int choice; char* colon; int do_probe = 1; while ((i = getopt(argc, argv, "c:m:n")) != -1) { if (i == 'c') { colon = strchr(optarg, ':'); if (colon) { *colon = 0; port_number = atoi(colon + 1); } cable_model = ticables_string_to_model(optarg); } else if (i == 'm') { calc_model = ticalcs_string_to_model(optarg); } else if (i == 'n') { do_probe = 0; } else { fprintf(stderr, "Usage: %s [-n (no probe)] [-c CABLE[:PORT]] [-m CALC]\n", argv[0]); return 1; } } // Force GLib 2.32+ to print info and debug messages like older versions did, unless this variable is already set. // No effect on earlier GLib versions. g_setenv("G_MESSAGES_DEBUG", "all", /* overwrite = */ FALSE); // init libs ticables_library_init(); ticalcs_library_init(); // set cable if (do_probe && cable_model == CABLE_NUL) { int *pids, npids; ticables_get_usb_devices(&pids, &npids); if (npids < 1) { fprintf(stderr, "No supported USB cable found\n"); return 1; } switch(pids[0]) { case PID_TIGLUSB: cable_model = CABLE_SLV; break; case PID_TI84P: case PID_TI84P_SE: cable_model = CABLE_USB; calc_model = CALC_TI84P_USB; break; case PID_TI89TM: cable_model = CABLE_USB; calc_model = CALC_TI89T_USB; break; case PID_NSPIRE: cable_model = CABLE_USB; calc_model = CALC_NSPIRE; break; default: fprintf(stderr, "Unrecognized PID %04x\n", pids[0]); free(pids); return 1; } free(pids); } cable = ticables_handle_new(cable_model, port_number); if (cable == NULL) { fprintf(stderr, "ticables_handle_new failed\n"); goto end; } // set calc if (do_probe && calc_model == CALC_NONE) { if (ticalcs_probe(cable_model, port_number, &calc_model, 1)) { fprintf(stderr, "No calculator found\n"); goto end; } } calc = ticalcs_handle_new(calc_model); if (calc == NULL) { fprintf(stderr, "ticalcs_handle_new failed\n"); goto end; } // attach cable to calc (and open cable) err = ticalcs_cable_attach(calc, cable); if (err != 0) { fprintf(stderr, "ticalcs_cable_attach failed %d\n", err); goto end; } ticables_options_set_timeout(cable, 50); do { // Display menu printf("Choose an action:\n"); for(i = 0; i < (int)(sizeof(fnct_menu)/sizeof(fnct_menu[0])); i++) { printf("%2d. %s\n", i, fnct_menu[i].desc); } printf("Your choice: "); err = scanf("%u", &choice); if (err < 1) { continue; } printf("\n"); if (choice == 0) { do_exit = 1; } // Process choice if (choice < sizeof(fnct_menu)/sizeof(fnct_menu[0]) && fnct_menu[choice].fnct) { err = (fnct_menu[choice].fnct)(calc); } if (choice && err) { fprintf(stderr, "Function %d returned %d\n", choice, err); } printf("\n"); } while (!do_exit); // detach cable (made by handle_del, too) err = ticalcs_cable_detach(calc); end: // remove calc & cable ticalcs_handle_del(calc); ticables_handle_del(cable); return err; } libticalcs-1.1.9+dfsg/tests/ticalcs2.supp000066400000000000000000000004421327711501700203350ustar00rootroot00000000000000# # Some valgrind suppressions handy for ignoring stuff we don't care # about when valgrinding TILP framework # # Library paths and versions from debian unstable, YMMV # { libglib-2.0 Memcheck:Leak fun:* } { ld-2.3 Memcheck:Overlap fun:* } { libc-2.3 Memcheck:Overlap fun:* } libticalcs-1.1.9+dfsg/tests/torture_ticalcs.c000066400000000000000000001326431327711501700213030ustar00rootroot00000000000000#include #include #include #include #include #include #include #include #include #include #include <../src/error.h> #define PRINTF(FUNCTION, TYPE, args...) \ fprintf(stderr, "%d\t" TYPE "\n", __LINE__, FUNCTION(args)) #define PRINTFVOID(FUNCTION, args...) \ FUNCTION(args); fprintf(stderr, "%d\n", __LINE__) #define INT "%d" #define PTR "%p" #define STR "\"%s\"" #define VOID "" static void torture_ticalcs(void) { CalcHandle * handle; // error.c PRINTF(ticalcs_error_get, INT, -1, NULL); PRINTFVOID(ticalcs_error_free, NULL); // ticalcs.c handle = ticalcs_handle_new(-1); PRINTF(, PTR, handle); ticalcs_handle_del(handle); PRINTF(ticalcs_handle_del, INT, NULL); PRINTF(ticalcs_handle_show, INT, NULL); PRINTF(ticalcs_cable_attach, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_cable_detach, INT, NULL); PRINTF(ticalcs_update_set, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_model_supports_dbus, INT, CALC_NONE); PRINTF(ticalcs_model_supports_dusb, INT, CALC_NONE); PRINTF(ticalcs_model_supports_nsp, INT, CALC_NONE); // calc_xx.c PRINTF(ticalcs_calc_features, INT, NULL); PRINTF(ticalcs_calc_isready, INT, NULL); PRINTF(ticalcs_calc_send_key, INT, NULL, -1); PRINTF(ticalcs_calc_execute, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ticalcs_calc_execute, INT, (void *)0x12345678, NULL, NULL); PRINTF(ticalcs_calc_recv_screen, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ticalcs_calc_recv_screen, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_recv_screen, INT, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_recv_screen_rgb888, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ticalcs_calc_recv_screen_rgb888, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_recv_screen_rgb888, INT, (void *)0x12345678, (void *)0x12345678, NULL); PRINTFVOID(ticalcs_free_screen, NULL); PRINTF(ticalcs_calc_get_dirlist, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ticalcs_calc_get_dirlist, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_get_dirlist, INT, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_get_memfree, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ticalcs_calc_get_memfree, INT, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_get_memfree, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_send_backup, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_send_backup, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_recv_backup, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_recv_backup, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_send_var, INT, NULL, -1, (void *)0x12345678); PRINTF(ticalcs_calc_send_var, INT, (void *)0x12345678, -1, NULL); PRINTF(ticalcs_calc_recv_var, INT, NULL, -1, (void *)0x12345678, (void *)0x12345678); PRINTF(ticalcs_calc_recv_var, INT, (void *)0x12345678, -1, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_recv_var, INT, (void *)0x12345678, -1, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_send_var_ns, INT, NULL, -1, NULL); PRINTF(ticalcs_calc_send_var_ns, INT, NULL, -1, (void *)0x12345678); PRINTF(ticalcs_calc_recv_var_ns, INT, NULL, -1, (void *)0x12345678, (void *)0x12345678); PRINTF(ticalcs_calc_recv_var_ns, INT, (void *)0x12345678, -1, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_recv_var_ns, INT, (void *)0x12345678, -1, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_send_app, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_send_app, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_recv_app, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ticalcs_calc_recv_app, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_recv_app, INT, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_send_os, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_send_os, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_recv_idlist, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_recv_idlist, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_dump_rom_1, INT, NULL); PRINTF(ticalcs_calc_dump_rom_2, INT, NULL, -1, (void *)0x12345678); PRINTF(ticalcs_calc_dump_rom_2, INT, (void *)0x12345678, -1, NULL); PRINTF(ticalcs_calc_set_clock, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_set_clock, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_get_clock, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_get_clock, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_new_fld, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_new_fld, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_del_var, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_del_var, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_rename_var, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ticalcs_calc_rename_var, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_rename_var, INT, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_change_attr, INT, NULL, (void *)0x12345678, -1); PRINTF(ticalcs_calc_change_attr, INT, (void *)0x12345678, NULL, -1); PRINTF(ticalcs_calc_get_version, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_get_version, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_send_cert, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_send_cert, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_recv_cert, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_recv_cert, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_send_tigroup, INT, NULL, (void *)0x12345678, -1); PRINTF(ticalcs_calc_send_tigroup, INT, (void *)0x12345678, NULL, -1); PRINTF(ticalcs_calc_recv_tigroup, INT, NULL, (void *)0x12345678, -1); PRINTF(ticalcs_calc_recv_tigroup, INT, (void *)0x12345678, NULL, -1); PRINTF(ticalcs_calc_send_backup2, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_send_backup2, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_recv_backup2, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_recv_backup2, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_send_var2, INT, NULL, -1, (void *)0x12345678); PRINTF(ticalcs_calc_send_var2, INT, (void *)0x12345678, -1, NULL); PRINTF(ticalcs_calc_recv_var2, INT, NULL, -1, (void *)0x12345678, (void *)0x12345678); PRINTF(ticalcs_calc_recv_var2, INT, (void *)0x12345678, -1, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_recv_var2, INT, (void *)0x12345678, -1, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_send_var_ns2, INT, NULL, -1, (void *)0x12345678); PRINTF(ticalcs_calc_send_var_ns2, INT, (void *)0x12345678, -1, NULL); PRINTF(ticalcs_calc_recv_var_ns2, INT, NULL, -1, (void *)0x12345678, (void *)0x12345678); PRINTF(ticalcs_calc_recv_var_ns2, INT, (void *)0x12345678, -1, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_recv_var_ns2, INT, (void *)0x12345678, -1, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_send_app2, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_send_app2, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_recv_app2, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ticalcs_calc_recv_app2, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_recv_app2, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ticalcs_calc_send_cert2, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_send_cert2, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_recv_cert2, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_recv_cert2, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_send_os2, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_calc_send_os2, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_calc_send_tigroup2, INT, NULL, (void *)0x12345678, -1); PRINTF(ticalcs_calc_send_tigroup2, INT, (void *)0x12345678, NULL, -1); PRINTF(ticalcs_calc_recv_tigroup2, INT, NULL, (void *)0x12345678, -1); PRINTF(ticalcs_calc_recv_tigroup2, INT, (void *)0x12345678, NULL, -1); // dirlist.c PRINTFVOID(ticalcs_dirlist_destroy, NULL); PRINTFVOID(ticalcs_dirlist_display, NULL); PRINTF(ticalcs_dirlist_ram_used, INT, NULL); PRINTF(ticalcs_dirlist_flash_used, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_dirlist_flash_used, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_dirlist_ve_count, INT, NULL); PRINTF(ticalcs_dirlist_ve_exist, PTR, NULL, (void *)0x12345678); PRINTF(ticalcs_dirlist_ve_exist, PTR, (void *)0x12345678, NULL); PRINTFVOID(ticalcs_dirlist_ve_add, NULL, (void *)0x12345678); PRINTFVOID(ticalcs_dirlist_ve_add, (void *)0x12345678, NULL); PRINTFVOID(ticalcs_dirlist_ve_del, NULL, (void *)0x12345678); PRINTFVOID(ticalcs_dirlist_ve_del, (void *)0x12345678, NULL); // type2str.c PRINTF(ticalcs_model_to_string, STR, -1); PRINTF(ticalcs_string_to_model, INT, NULL); PRINTF(ticalcs_scrfmt_to_string, STR, -1); PRINTF(ticalcs_string_to_scrfmt, INT, NULL); PRINTF(ticalcs_pathtype_to_string, STR, -1); PRINTF(ticalcs_string_to_pathtype, INT, NULL); PRINTF(ticalcs_memtype_to_string, STR, -1); PRINTF(ticalcs_string_to_memtype, INT, NULL); PRINTF(ticalcs_infos_to_string, INT, NULL, (void *)0x12345678, 0x12345678); // clock.c PRINTF(ticalcs_clock_format2date, STR, -1, -1); PRINTF(ticalcs_clock_date2format, INT, -1, NULL); PRINTF(ticalcs_clock_show, INT, -1, NULL); // screen.c PRINTF(ticalcs_screen_convert_bw_to_rgb888, INT, NULL, 0x12345678, 0x12345678, (void *)0x12345678); PRINTF(ticalcs_screen_convert_bw_to_rgb888, INT, (void *)0x12345678, 0x12345678, 0x12345678, NULL); PRINTF(ticalcs_screen_convert_bw_to_blurry_rgb888, INT, NULL, 0x12345678, 0x12345678, (void *)0x12345678); PRINTF(ticalcs_screen_convert_bw_to_blurry_rgb888, INT, (void *)0x12345678, 0x12345678, 0x12345678, NULL); PRINTF(ticalcs_screen_convert_gs4_to_rgb888, INT, NULL, 0x12345678, 0x12345678, (void *)0x12345678); PRINTF(ticalcs_screen_convert_gs4_to_rgb888, INT, (void *)0x12345678, 0x12345678, 0x12345678, NULL); PRINTF(ticalcs_screen_convert_rgb565le_to_rgb888, INT, NULL, 0x12345678, 0x12345678, (void *)0x12345678); PRINTF(ticalcs_screen_convert_rgb565le_to_rgb888, INT, (void *)0x12345678, 0x12345678, 0x12345678, NULL); PRINTF(ticalcs_screen_convert_native_to_rgb888, INT, 1, NULL, 0x12345678, 0x12345678, (void *)0x12345678); PRINTF(ticalcs_screen_convert_native_to_rgb888, INT, 1, (void *)0x12345678, 0x12345678, 0x12345678, NULL); PRINTF(ticalcs_screen_nspire_rle_uncompress, INT, 1, (void *)0x12345678, 0x12345678, NULL, 0x12345678); PRINTF(ticalcs_screen_nspire_rle_uncompress, INT, 1, NULL, 0x12345678, (void *)0x12345678, 0x12345678); PRINTF(ticalcs_screen_84pcse_rle_uncompress, INT, (void *)0x12345678, 0x12345678, NULL, 0x12345678); PRINTF(ticalcs_screen_84pcse_rle_uncompress, INT, NULL, 0x12345678, (void *)0x12345678, 0x12345678); // tikeys.c PRINTF(ticalcs_keys_73, PTR, 0); PRINTF(ticalcs_keys_83, PTR, 0); PRINTF(ticalcs_keys_83p, PTR, 0); PRINTF(ticalcs_keys_86, PTR, 0); PRINTF(ticalcs_keys_89, PTR, 0); PRINTF(ticalcs_keys_92p, PTR, 0); // probe.c PRINTF(ticalcs_probe_calc, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_probe_calc, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_probe_usb_calc, INT, NULL, (void *)0x12345678); PRINTF(ticalcs_probe_usb_calc, INT, (void *)0x12345678, NULL); PRINTF(ticalcs_probe, INT, -1, -1, NULL, -1); PRINTF(ticalcs_device_info_to_model, INT, NULL); PRINTF(ticalcs_remap_model_from_usb, INT, 0, 0); PRINTF(ticalcs_remap_model_to_usb, INT, 0, 0); // dbus_pkt.c PRINTF(dbus_send, INT, NULL, 0, 0, 0, (void *)0x12345678); PRINTF(dbus_recv, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(dbus_recv, INT, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(dbus_recv, INT, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(dbus_recv, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(dbus_recv_header, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(dbus_recv_header, INT, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(dbus_recv_header, INT, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(dbus_recv_header, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(dbus_recv_data, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(dbus_recv_data, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(dbus_recv_data, INT, (void *)0x12345678, (void *)0x12345678, NULL); // dusb_rpkt.c PRINTF(dusb_send, INT, NULL, (void *)0x12345678); PRINTF(dusb_send, INT, (void *)0x12345678, NULL); PRINTF(dusb_recv, INT, NULL, (void *)0x12345678); PRINTF(dusb_recv, INT, (void *)0x12345678, NULL); // nsp_rpkt.c PRINTF(nsp_send, INT, NULL, (void *)0x12345678); PRINTF(nsp_send, INT, (void *)0x12345678, NULL); PRINTF(nsp_recv, INT, NULL, (void *)0x12345678); PRINTF(nsp_recv, INT, (void *)0x12345678, NULL); } static void torture_nsp(void) { void * ptr; PRINTF(nsp_vtl_pkt_new, PTR, NULL); PRINTF(nsp_vtl_pkt_new_ex, PTR, NULL, 0x12345678, 0x1234, 0x1234, 0x1234, 0x1234, 0x12, (void *)0x12345678); PRINTFVOID(nsp_vtl_pkt_fill, NULL, 0x12345678, 0x1234, 0x1234, 0x1234, 0x1234, 0x12, NULL); PRINTFVOID(nsp_vtl_pkt_del, NULL, (void *)0x12345678); PRINTFVOID(nsp_vtl_pkt_del, (void *)0x12345678, NULL); ptr = nsp_vtl_pkt_alloc_data(0); PRINTF(, PTR, ptr); nsp_vtl_pkt_free_data(ptr); ptr = nsp_vtl_pkt_realloc_data(NULL, 1); PRINTF(, PTR, ptr); nsp_vtl_pkt_free_data(ptr); PRINTFVOID(nsp_vtl_pkt_free_data, NULL); PRINTF(nsp_session_open, INT, NULL, 0); PRINTF(nsp_session_close, INT, NULL); PRINTF(nsp_addr_request, INT, NULL); PRINTF(nsp_addr_assign, INT, NULL, 0); PRINTF(nsp_send_ack, INT, NULL); PRINTF(nsp_recv_ack, INT, NULL); PRINTF(nsp_send_nack, INT, NULL); PRINTF(nsp_send_nack_ex, INT, NULL, 0); PRINTF(nsp_send_data, INT, NULL, (void *)0x12345678); PRINTF(nsp_send_data, INT, (void *)0x12345678, NULL); PRINTF(nsp_recv_data, INT, NULL, (void *)0x12345678); PRINTF(nsp_recv_data, INT, (void *)0x12345678, NULL); PRINTF(nsp_send_disconnect, INT, NULL); PRINTF(nsp_recv_disconnect, INT, NULL); // nsp_cmd.c PRINTF(nsp_cmd_r_login, INT, NULL); PRINTF(nsp_cmd_s_status, INT, NULL, 0); PRINTF(nsp_cmd_r_status, INT, NULL, (void *)0x12345678); PRINTF(nsp_cmd_s_dev_infos, INT, NULL, 0); PRINTF(nsp_cmd_r_dev_infos, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(nsp_cmd_r_dev_infos, INT, (void *)0x12345678, (void *)0x12345678, NULL, NULL); PRINTF(nsp_cmd_r_dev_infos, INT, (void *)0x12345678, NULL, (void *)0x12345678, NULL); PRINTF(nsp_cmd_r_dev_infos, INT, (void *)0x12345678, NULL, NULL, (void *)0x12345678); PRINTF(nsp_cmd_s_screen_rle, INT, NULL, 0); PRINTF(nsp_cmd_r_screen_rle, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(nsp_cmd_r_screen_rle, INT, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(nsp_cmd_r_screen_rle, INT, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(nsp_cmd_r_screen_rle, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(nsp_cmd_s_dir_attributes, INT, NULL, (void *)0x12345678); PRINTF(nsp_cmd_s_dir_attributes, INT, (void *)0x12345678, NULL); PRINTF(nsp_cmd_r_dir_attributes, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(nsp_cmd_s_dir_enum_init, INT, NULL, (void *)0x12345678); PRINTF(nsp_cmd_s_dir_enum_init, INT, (void *)0x12345678, NULL); PRINTF(nsp_cmd_r_dir_enum_init, INT, NULL); PRINTF(nsp_cmd_s_dir_enum_next, INT, NULL); PRINTF(nsp_cmd_r_dir_enum_next, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(nsp_cmd_r_dir_enum_next, INT, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(nsp_cmd_s_dir_enum_done, INT, NULL); PRINTF(nsp_cmd_r_dir_enum_done, INT, NULL); PRINTF(nsp_cmd_s_put_file, INT, NULL, (void *)0x12345678, 0); PRINTF(nsp_cmd_s_put_file, INT, (void *)0x12345678, NULL, 0); PRINTF(nsp_cmd_r_put_file, INT, NULL); PRINTF(nsp_cmd_s_get_file, INT, NULL, (void *)0x12345678); PRINTF(nsp_cmd_s_get_file, INT, (void *)0x12345678, NULL); PRINTF(nsp_cmd_r_get_file, INT, NULL, (void *)0x12345678); PRINTF(nsp_cmd_s_del_file, INT, NULL, (void *)0x12345678); PRINTF(nsp_cmd_s_del_file, INT, (void *)0x12345678, NULL); PRINTF(nsp_cmd_r_del_file, INT, NULL); PRINTF(nsp_cmd_s_new_folder, INT, NULL, (void *)0x12345678); PRINTF(nsp_cmd_s_new_folder, INT, (void *)0x12345678, NULL); PRINTF(nsp_cmd_r_new_folder, INT, NULL); PRINTF(nsp_cmd_s_del_folder, INT, NULL, (void *)0x12345678); PRINTF(nsp_cmd_s_del_folder, INT, (void *)0x12345678, NULL); PRINTF(nsp_cmd_r_del_folder, INT, NULL); PRINTF(nsp_cmd_s_copy_file, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(nsp_cmd_s_copy_file, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(nsp_cmd_s_copy_file, INT, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(nsp_cmd_r_copy_file, INT, NULL); PRINTF(nsp_cmd_s_rename_file, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(nsp_cmd_s_rename_file, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(nsp_cmd_s_rename_file, INT, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(nsp_cmd_r_rename_file, INT, NULL); PRINTF(nsp_cmd_s_file_ok, INT, NULL); PRINTF(nsp_cmd_r_file_ok, INT, NULL); PRINTF(nsp_cmd_s_file_contents, INT, NULL, 0, (void *)0x12345678); PRINTF(nsp_cmd_s_file_contents, INT, (void *)0x12345678, 0, NULL); PRINTF(nsp_cmd_r_file_contents, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(nsp_cmd_r_file_contents, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(nsp_cmd_r_file_contents, INT, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(nsp_cmd_s_os_install, INT, NULL, 0); PRINTF(nsp_cmd_r_os_install, INT, NULL); PRINTF(nsp_cmd_s_os_contents, INT, NULL, 0, (void *)0x12345678); PRINTF(nsp_cmd_s_os_contents, INT, (void *)0x12345678, 0, NULL); PRINTF(nsp_cmd_r_progress, INT, NULL, (void *)0x12345678); PRINTF(nsp_cmd_r_progress, INT, (void *)0x12345678, NULL); PRINTF(nsp_cmd_s_generic_data, INT, NULL, 0, (void *)0x12345678, 0, 0); PRINTF(nsp_cmd_r_generic_data, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(nsp_cmd_s_echo, INT, NULL, 0, (void *)0x12345678); PRINTF(nsp_cmd_r_echo, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(nsp_cmd_s_keypress_event, INT, NULL, (void *)0x12345678); PRINTF(nsp_cmd_s_keypress_event, INT, (void *)0x12345678, NULL); } static void torture_dusb(void) { void * ptr; DUSBModeSet mode = DUSB_MODE_STARTUP; // dusb_rpkt.c PRINTF(dusb_rpkt_type2name, STR, 0); PRINTF(dusb_dissect, INT, CALC_NONE, NULL, (void *)0x12345678, 8, 2, (void *) 0x12345678); PRINTF(dusb_dissect, INT, CALC_NONE, (void *)0x12345678, NULL, 8, 2, (void *) 0x12345678); PRINTF(dusb_dissect, INT, CALC_NONE, (void *)0x12345678, (void *)0x12345678, 8, 2, NULL); // dusb_vpkt.c PRINTF(dusb_vtl_pkt_new, PTR, NULL); PRINTF(dusb_vtl_pkt_new_ex, PTR, NULL, 0, 0, (void *)0x12345678); PRINTFVOID(dusb_vtl_pkt_fill, NULL, 0, 0, (void *)0x12345678); PRINTFVOID(dusb_vtl_pkt_del, NULL, (void *)0x12345678); PRINTFVOID(dusb_vtl_pkt_del, (void *)0x12345678, NULL); ptr = dusb_vtl_pkt_alloc_data(0); PRINTF(, PTR, ptr); dusb_vtl_pkt_free_data(ptr); ptr = dusb_vtl_pkt_realloc_data(NULL, 1); PRINTF(, PTR, ptr); dusb_vtl_pkt_free_data(ptr); PRINTFVOID(dusb_vtl_pkt_free_data, NULL); PRINTF(dusb_send_buf_size_request, INT, NULL, 0); PRINTF(dusb_recv_buf_size_alloc, INT, NULL, (void *)0x12345678); PRINTF(dusb_recv_buf_size_request, INT, NULL, (void *)0x12345678); PRINTF(dusb_send_buf_size_alloc, INT, NULL, 0); PRINTF(dusb_send_data, INT, NULL, (void *)0x12345678); PRINTF(dusb_send_data, INT, (void *)0x12345678, NULL); PRINTF(dusb_recv_data, INT, NULL, (void *)0x12345678); PRINTF(dusb_recv_data, INT, (void *)0x12345678, NULL); PRINTF(dusb_recv_data_varsize, INT, NULL, (void *)0x12345678, (void *)0x12345678, 0); PRINTF(dusb_recv_data_varsize, INT, (void *)0x12345678, NULL, (void *)0x12345678, 0); PRINTF(dusb_recv_data_varsize, INT, (void *)0x12345678, (void *)0x12345678, NULL, 0); PRINTF(dusb_send_acknowledge, INT, NULL); PRINTF(dusb_recv_acknowledge, INT, NULL); PRINTF(dusb_vpkt_type2name, STR, 0); PRINTF(dusb_get_buf_size, INT, NULL, (void *)0x12345678); PRINTF(dusb_get_buf_size, INT, (void *)0x12345678, NULL); PRINTF(dusb_set_buf_size, INT, NULL, 0); PRINTF(dusb_cmd_param_type2name, STR, 0); // dbus_cmd.c ptr = dusb_cp_new(NULL, 0, 0); PRINTF(, PTR, ptr); ptr = dusb_cp_new_ex(NULL, 0, 0, (void *)0x12345678); PRINTF(, PTR, ptr); PRINTFVOID(dusb_cp_fill, NULL, 0, 0, (void *)0x12345678); dusb_cp_del((void *)0x12345678, ptr); PRINTFVOID(dusb_cp_del, NULL, (void *)0x12345678); PRINTFVOID(dusb_cp_del, (void *)0x12345678, NULL); ptr = dusb_cp_new_array(NULL, 0); PRINTF(, PTR, ptr); dusb_cp_del_array((void *)0x12345678, 0, ptr); PRINTFVOID(dusb_cp_del_array, (void *)0x12345678, 0, NULL); PRINTFVOID(dusb_cp_del_array, NULL, 0, (void *)0x12345678); ptr = dusb_cp_alloc_data(0); PRINTF(, PTR, ptr); dusb_cp_free_data(ptr); ptr = dusb_cp_realloc_data(NULL, 1); PRINTF(, PTR, ptr); dusb_cp_free_data(ptr); PRINTFVOID(dusb_cp_free_data, NULL); ptr = dusb_ca_new(NULL, 0, 0); PRINTF(, PTR, ptr); ptr = dusb_ca_new_ex(NULL, 0, 0, (void *)0x12345678); PRINTF(, PTR, ptr); PRINTFVOID(dusb_ca_fill, NULL, 0, 0, (void *)0x12345678); dusb_ca_del((void *)0x12345678, ptr); PRINTFVOID(dusb_ca_del, NULL, (void *)0x12345678); PRINTFVOID(dusb_ca_del, (void *)0x12345678, NULL); ptr = dusb_ca_new_array(NULL, 0); PRINTF(, PTR, ptr); dusb_ca_del_array((void *)0x12345678, 0, ptr); PRINTFVOID(dusb_ca_del_array, (void *)0x12345678, 0, NULL); PRINTFVOID(dusb_ca_del_array, NULL, 0, (void *)0x12345678); ptr = dusb_ca_alloc_data(0); PRINTF(, PTR, ptr); dusb_ca_free_data(ptr); ptr = dusb_ca_realloc_data(NULL, 1); PRINTF(, PTR, ptr); dusb_ca_free_data(ptr); PRINTFVOID(dusb_ca_free_data, NULL); PRINTF(dusb_cmd_s_mode_set, INT, NULL, mode); PRINTF(dusb_cmd_s_os_begin, INT, NULL, 0); PRINTF(dusb_cmd_r_os_ack, INT, NULL, (void *)0x12345678); PRINTF(dusb_cmd_s_os_header, INT, NULL, 0, 0, 0, 0, (void *)0x12345678); PRINTF(dusb_cmd_s_os_header, INT, (void *)0x12345678, 0, 0, 0, 0, NULL); PRINTF(dusb_cmd_s_os_data, INT, NULL, 0, 0, 0, 0, (void *)0x12345678); PRINTF(dusb_cmd_s_os_data, INT, (void *)0x12345678, 0, 0, 0, 0, NULL); PRINTF(dusb_cmd_s_os_header_89, INT, NULL, 0, (void *)0x12345678); PRINTF(dusb_cmd_s_os_header_89, INT, (void *)0x12345678, 0, NULL); PRINTF(dusb_cmd_s_os_data_89, INT, NULL, 0, (void *)0x12345678); PRINTF(dusb_cmd_s_os_data_89, INT, (void *)0x12345678, 0, NULL); PRINTF(dusb_cmd_r_eot_ack, INT, NULL); PRINTF(dusb_cmd_s_param_request, INT, NULL, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_param_request, INT, (void *)0x12345678, 1, NULL); PRINTF(dusb_cmd_r_param_data, INT, NULL, 1, (void *)0x12345678); PRINTF(dusb_cmd_r_param_data, INT, (void *)0x12345678, 1, NULL); PRINTF(dusb_cmd_r_screenshot, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(dusb_cmd_r_screenshot, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(dusb_cmd_r_screenshot, INT, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(dusb_cmd_s_dirlist_request, INT, NULL, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_dirlist_request, INT, (void *)0x12345678, 1, NULL); PRINTF(dusb_cmd_r_var_header, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(dusb_cmd_r_var_header, INT, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(dusb_cmd_r_var_header, INT, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(dusb_cmd_r_var_header, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(dusb_cmd_s_rts, INT, NULL, (void *)0x12345678, (void *)0x12345678, 0, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_rts, INT, (void *)0x12345678, NULL, (void *)0x12345678, 0, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_rts, INT, (void *)0x12345678, (void *)0x12345678, NULL, 0, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_rts, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, 0, 1, NULL); PRINTF(dusb_cmd_s_var_request, INT, NULL, (void *)0x12345678, (void *)0x12345678, 1, (void *)0x12345678, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_var_request, INT, (void *)0x12345678, NULL, (void *)0x12345678, 1, (void *)0x12345678, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_var_request, INT, (void *)0x12345678, (void *)0x12345678, NULL, 1, (void *)0x12345678, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_var_request, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, 1, NULL, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_var_request, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, 1, (void *)0x12345678, 1, NULL); PRINTF(dusb_cmd_s_var_content, INT, NULL, 0, (void *)0x12345678); PRINTF(dusb_cmd_s_var_content, INT, (void *)0x12345678, 0, NULL); PRINTF(dusb_cmd_r_var_content, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(dusb_cmd_r_var_content, INT, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(dusb_cmd_s_param_set, INT, NULL, (void *)0x12345678); PRINTF(dusb_cmd_s_param_set, INT, (void *)0x12345678, NULL); PRINTF(dusb_cmd_s_var_modify, INT, NULL, (void *)0x12345678, (void *)0x12345678, 1, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_var_modify, INT, (void *)0x12345678, NULL, (void *)0x12345678, 1, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_var_modify, INT, (void *)0x12345678, (void *)0x12345678, NULL, 1, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_var_modify, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, 1, NULL, (void *)0x12345678, (void *)0x12345678, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_var_modify, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, 1, (void *)0x12345678, NULL, (void *)0x12345678, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_var_modify, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, 1, (void *)0x12345678, (void *)0x12345678, NULL, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_var_modify, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, 1, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, 1, NULL); PRINTF(dusb_cmd_s_var_delete, INT, NULL, (void *)0x12345678, (void *)0x12345678, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_var_delete, INT, (void *)0x12345678, NULL, (void *)0x12345678, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_var_delete, INT, (void *)0x12345678, (void *)0x12345678, NULL, 1, (void *)0x12345678); PRINTF(dusb_cmd_s_var_delete, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, 1, NULL); PRINTF(dusb_cmd_s_execute, INT, NULL, (void *)0x12345678, (void *)0x12345678, 0, (void *)0x12345678, 0); // It's OK to have args = NULL PRINTF(dusb_cmd_s_execute, INT, (void *)0x12345678, NULL, (void *)0x12345678, 0, (void *)0x12345678, 0); PRINTF(dusb_cmd_s_execute, INT, (void *)0x12345678, (void *)0x12345678, NULL, 0, (void *)0x12345678, 0); PRINTF(dusb_cmd_r_mode_ack, INT, NULL); PRINTF(dusb_cmd_r_data_ack, INT, NULL); PRINTF(dusb_cmd_r_delay_ack, INT, NULL); PRINTF(dusb_cmd_s_eot, INT, NULL); PRINTF(dusb_cmd_r_eot, INT, NULL); PRINTF(dusb_cmd_s_error, INT, NULL, 0); PRINTF(dusb_cmd_s_param_set_r_data_ack, INT, NULL, 0, 0, (void *)0x12345678); } static void torture_cmdz80(void) { // cmdz80.c PRINTF(ti73_send_VAR, INT, NULL, 0, 0, (void *)0x12345678, 0, 0); PRINTF(ti73_send_VAR, INT, (void *)0x12345678, 0, 0, NULL, 0, 0); PRINTF(ti73_send_VAR2, INT, NULL, 0, 0, 0, 0, 0); PRINTF(ti73_send_CTS, INT, NULL); PRINTF(ti73_send_XDP, INT, NULL, 0, (void *)0x12345678); PRINTF(ti73_send_SKP, INT, NULL, 0); PRINTF(ti73_send_ACK, INT, NULL); PRINTF(ti73_send_ERR, INT, NULL); PRINTF(ti73_send_RDY, INT, NULL); PRINTF(ti73_send_SCR, INT, NULL); PRINTF(ti73_send_KEY, INT, NULL, 0); PRINTF(ti73_send_EOT, INT, NULL); PRINTF(ti73_send_REQ, INT, NULL, 0, 0, (void *)0x12345678, 0, 0); PRINTF(ti73_send_REQ, INT, (void *)0x12345678, 0, 0, NULL, 0, 0); PRINTF(ti73_send_REQ2, INT, NULL, 0, 0, (void *)0x12345678, 0); PRINTF(ti73_send_REQ2, INT, (void *)0x12345678, 0, 0, NULL, 0); PRINTF(ti73_send_RTS, INT, NULL, 0, 0, (void *)0x12345678, 0, 0); PRINTF(ti73_send_RTS, INT, (void *)0x12345678, 0, 0, NULL, 0, 0); PRINTF(ti73_send_VER, INT, NULL); PRINTF(ti73_send_DEL, INT, NULL, 0, 0, (void *)0x12345678, 0); PRINTF(ti73_send_DEL, INT, (void *)0x12345678, 0, 0, NULL, 0); PRINTF(ti73_send_DUMP, INT, NULL, 0); PRINTF(ti73_send_EKE, INT, NULL); PRINTF(ti73_send_DKE, INT, NULL); PRINTF(ti73_send_ELD, INT, NULL); PRINTF(ti73_send_DLD, INT, NULL); PRINTF(ti73_send_GID, INT, NULL); PRINTF(ti73_send_RID, INT, NULL); PRINTF(ti73_send_SID, INT, NULL, (void *)0x12345678); PRINTF(ti73_recv_VAR, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti73_recv_VAR, INT, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti73_recv_VAR, INT, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti73_recv_VAR, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti73_recv_VAR, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti73_recv_VAR, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(ti73_recv_VAR2, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti73_recv_VAR2, INT, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti73_recv_VAR2, INT, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti73_recv_VAR2, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti73_recv_VAR2, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti73_recv_VAR2, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(ti73_recv_CTS, INT, NULL, 0); PRINTF(ti73_recv_SKP, INT, NULL, (void *)0x12345678); PRINTF(ti73_recv_SKP, INT, (void *)0x12345678, NULL); PRINTF(ti73_recv_XDP, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti73_recv_XDP, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti73_recv_ACK, INT, NULL, (void *)0x12345678); PRINTF(ti73_recv_RTS, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti73_recv_RTS, INT, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti73_recv_RTS, INT, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti73_recv_RTS, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti73_recv_RTS, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti73_recv_RTS, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(ti80_send_SCR, INT, NULL); PRINTF(ti80_recv_XDP, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti80_recv_XDP, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti80_recv_ACK, INT, NULL, (void *)0x12345678); PRINTF(ti82_send_VAR, INT, NULL, 0, 0, (void *)0x12345678); PRINTF(ti82_send_VAR, INT, (void *)0x12345678, 0, 0, NULL); PRINTF(ti82_send_CTS, INT, NULL); PRINTF(ti82_send_XDP, INT, NULL, 0, (void *)0x12345678); PRINTF(ti82_send_SKP, INT, NULL, 0); PRINTF(ti82_send_ACK, INT, NULL); PRINTF(ti82_send_ERR, INT, NULL); PRINTF(ti82_send_SCR, INT, NULL); PRINTF(ti82_send_KEY, INT, NULL, 0); PRINTF(ti82_send_EOT, INT, NULL); PRINTF(ti82_send_REQ, INT, NULL, 0, 0, (void *)0x12345678); PRINTF(ti82_send_REQ, INT, (void *)0x12345678, 0, 0, NULL); PRINTF(ti82_send_RTS, INT, NULL, 0, 0, (void *)0x12345678); PRINTF(ti82_send_RTS, INT, (void *)0x12345678, 0, 0, NULL); PRINTF(ti82_recv_VAR, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti82_recv_VAR, INT, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti82_recv_VAR, INT, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti82_recv_VAR, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(ti82_recv_CTS, INT, NULL); PRINTF(ti82_recv_SKP, INT, NULL, (void *)0x12345678); PRINTF(ti82_recv_SKP, INT, (void *)0x12345678, NULL); PRINTF(ti82_recv_XDP, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti82_recv_XDP, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti82_recv_ACK, INT, NULL, (void *)0x12345678); PRINTF(ti82_recv_RTS, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti82_recv_RTS, INT, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti82_recv_RTS, INT, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti82_recv_RTS, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(ti85_send_VAR, INT, NULL, 0, 0, (void *)0x12345678); PRINTF(ti85_send_VAR, INT, (void *)0x12345678, 0, 0, NULL); PRINTF(ti85_send_CTS, INT, NULL); PRINTF(ti85_send_XDP, INT, NULL, 0, (void *)0x12345678); PRINTF(ti85_send_SKP, INT, NULL, 0); PRINTF(ti85_send_ACK, INT, NULL); PRINTF(ti85_send_ERR, INT, NULL); PRINTF(ti85_send_SCR, INT, NULL); PRINTF(ti85_send_KEY, INT, NULL, 0); PRINTF(ti85_send_EOT, INT, NULL); PRINTF(ti85_send_REQ, INT, NULL, 0, 0, (void *)0x12345678); PRINTF(ti85_send_REQ, INT, (void *)0x12345678, 0, 0, NULL); PRINTF(ti85_send_RTS, INT, NULL, 0, 0, (void *)0x12345678); PRINTF(ti85_send_RTS, INT, (void *)0x12345678, 0, 0, NULL); PRINTF(ti85_recv_VAR, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti85_recv_VAR, INT, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti85_recv_VAR, INT, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti85_recv_VAR, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(ti85_recv_CTS, INT, NULL); PRINTF(ti85_recv_SKP, INT, NULL, (void *)0x12345678); PRINTF(ti85_recv_SKP, INT, (void *)0x12345678, NULL); PRINTF(ti85_recv_XDP, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti85_recv_XDP, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti85_recv_ACK, INT, NULL, (void *)0x12345678); PRINTF(ti85_recv_RTS, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti85_recv_RTS, INT, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti85_recv_RTS, INT, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti85_recv_RTS, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL); } static void torture_cmd68k(void) { // cmd68k.c PRINTF(ti89_send_VAR, INT, NULL, 0, 0, (void *)0x12345678); PRINTF(ti89_send_CTS, INT, NULL); PRINTF(ti89_send_XDP, INT, NULL, 0, (void *)0x12345678); PRINTF(ti89_send_SKP, INT, NULL, 0); PRINTF(ti89_send_ACK, INT, NULL); PRINTF(ti89_send_ERR, INT, NULL); PRINTF(ti89_send_RDY, INT, NULL); PRINTF(ti89_send_SCR, INT, NULL); PRINTF(ti89_send_CNT, INT, NULL); PRINTF(ti89_send_KEY, INT, NULL, 0); PRINTF(ti89_send_EOT, INT, NULL); PRINTF(ti89_send_REQ, INT, NULL, 0, 0, (void *)0x12345678); PRINTF(ti89_send_REQ, INT, (void *)0x12345678, 0, 0, NULL); PRINTF(ti89_send_RTS, INT, NULL, 0, 0, (void *)0x12345678); PRINTF(ti89_send_RTS, INT, (void *)0x12345678, 0, 0, NULL); PRINTF(ti89_send_RTS2, INT, NULL, 0, 0, 0); PRINTF(ti89_send_VER, INT, NULL); PRINTF(ti89_send_DEL, INT, NULL, 0, 0, (void *)0x12345678); PRINTF(ti89_send_DEL, INT, (void *)0x12345678, 0, 0, NULL); PRINTF(ti89_recv_VAR, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti89_recv_VAR, INT, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti89_recv_VAR, INT, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti89_recv_VAR, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(ti89_recv_CTS, INT, NULL); PRINTF(ti89_recv_SKP, INT, NULL, (void *)0x12345678); PRINTF(ti89_recv_SKP, INT, (void *)0x12345678, NULL); PRINTF(ti89_recv_XDP, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti89_recv_XDP, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti89_send_ACK, INT, NULL); PRINTF(ti89_recv_CNT, INT, NULL); PRINTF(ti89_recv_EOT, INT, NULL); PRINTF(ti89_recv_RTS, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti89_recv_RTS, INT, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti89_recv_RTS, INT, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti89_recv_RTS, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(ti92_send_VAR, INT, NULL, 0, 0, (void *)0x12345678); PRINTF(ti92_send_VAR, INT, (void *)0x12345678, 0, 0, NULL); PRINTF(ti92_send_CTS, INT, NULL); PRINTF(ti92_send_XDP, INT, NULL, 0, (void *)0x12345678); PRINTF(ti92_send_SKP, INT, NULL, 0); PRINTF(ti92_send_ACK, INT, NULL); PRINTF(ti92_send_ERR, INT, NULL); PRINTF(ti92_send_RDY, INT, NULL); PRINTF(ti92_send_SCR, INT, NULL); PRINTF(ti92_send_SCR, INT, NULL); PRINTF(ti92_send_CNT, INT, NULL); PRINTF(ti92_send_KEY, INT, NULL, 0); PRINTF(ti92_send_EOT, INT, NULL); PRINTF(ti92_send_REQ, INT, NULL, 0, 0, (void *)0x12345678); PRINTF(ti92_send_REQ, INT, (void *)0x12345678, 0, 0, NULL); PRINTF(ti92_send_RTS, INT, NULL, 0, 0, (void *)0x12345678); PRINTF(ti92_send_RTS, INT, (void *)0x12345678, 0, 0, NULL); PRINTF(ti92_recv_VAR, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti92_recv_VAR, INT, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti92_recv_VAR, INT, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti92_recv_VAR, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL); PRINTF(ti92_recv_CTS, INT, NULL); PRINTF(ti92_recv_SKP, INT, NULL, (void *)0x12345678); PRINTF(ti92_recv_SKP, INT, (void *)0x12345678, NULL); PRINTF(ti92_recv_XDP, INT, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti92_recv_XDP, INT, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti92_send_ACK, INT, NULL); PRINTF(ti92_recv_CNT, INT, NULL); PRINTF(ti92_recv_EOT, INT, NULL); PRINTF(ti92_recv_RTS, INT, NULL, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678); PRINTF(ti92_recv_RTS, INT, (void *)0x12345678, NULL, (void *)0x12345678, (void *)0x12345678); PRINTF(ti92_recv_RTS, INT, (void *)0x12345678, (void *)0x12345678, NULL, (void *)0x12345678); PRINTF(ti92_recv_RTS, INT, (void *)0x12345678, (void *)0x12345678, (void *)0x12345678, NULL); } static const uint8_t dusb_bad_raw_type_1[] = { 0x00, 0x00, 0x00, 0x00, 0x00 }; static const uint8_t dusb_bad_raw_type_2[] = { 0x00, 0x00, 0x00, 0x00, 0x06 }; static const uint8_t dusb_good_buf_size_req[] = { 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00 }; static const uint8_t dusb_good_buf_size_alloc[] = { 0x00, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0xFA }; static const uint8_t dusb_bad_vpkt_data_final_0001[] = { 0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x09, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F }; static const uint8_t dusb_good_vpkt_data_final_0001[] = { 0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xA0 }; static const uint8_t dusb_bad_vpkt_data_final_0002[] = { 0x00, 0x00, 0x00, 0x11, 0x04, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x92 }; static const uint8_t dusb_good_vpkt_data_final_0002[] = { 0x00, 0x00, 0x00, 0x11, 0x04, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x92, 0x3B }; static const uint8_t dusb_good_vpkt_data_final_0003[] = { 0x00, 0x00, 0x00, 0x0E, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00 }; static const uint8_t dusb_good_vpkt_data_final_0007[] = { 0x00, 0x00, 0x00, 0x0A, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x07, 0x00, 0x01, 0x00, 0x0A }; static const uint8_t dusb_good_vpkt_data_final_0008[] = { 0x00, 0x00, 0x00, 0x0E, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x01, 0x00, 0x0A, 0x00, 0x00, 0x01, 0x01 }; static const uint8_t dusb_good_vpkt_data_final_0012[] = { 0x00, 0x00, 0x00, 0x0A, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x0F, 0xA0 }; static const uint8_t dusb_good_vpkt_data_final_BB00[] = { 0x00, 0x00, 0x00, 0x0A, 0x04, 0x00, 0x00, 0x00, 0x04, 0xBB, 0x00, 0xFF, 0xFF, 0xFF, 0xFF }; static const uint8_t dusb_good_vpkt_data_final_DD00[] = { 0x00, 0x00, 0x00, 0x06, 0x04, 0x00, 0x00, 0x00, 0x00, 0xdd, 0x00 }; static const uint8_t dusb_good_vpkt_data_ack[] = { 0x00, 0x00, 0x00, 0x02, 0x05, 0xE0, 0x00 }; static void dissect_functions_unit_test(void) { uint8_t first = 1; assert(ERR_INVALID_PACKET == dusb_dissect(CALC_NONE, stderr, (void *)0x12345678, 4, 0, (void *)0x12345678)); assert(ERR_INVALID_PACKET == dusb_dissect(CALC_NONE, stderr, (void *)0x12345678, 1024, 0, (void *)0x12345678)); assert(ERR_INVALID_PACKET == dusb_dissect(CALC_NONE, stderr, dusb_bad_raw_type_1, 5, 0, (void *)0x12345678)); assert(ERR_INVALID_PACKET == dusb_dissect(CALC_NONE, stderr, dusb_bad_raw_type_2, 5, 0, (void *)0x12345678)); assert(ERR_INVALID_PACKET == dusb_dissect(CALC_NONE, stderr, dusb_good_buf_size_req, 6, 0, (void *)0x12345678)); assert(0 == dusb_dissect(CALC_TI84P_USB, stderr, dusb_good_buf_size_req, sizeof(dusb_good_buf_size_req), 2, &first)); assert(0 == dusb_dissect(CALC_TI84P_USB, stderr, dusb_good_buf_size_alloc, sizeof(dusb_good_buf_size_alloc), 1, &first)); assert(ERR_INVALID_PACKET == dusb_dissect(CALC_TI84P_USB, stderr, dusb_bad_vpkt_data_final_0001, sizeof(dusb_bad_vpkt_data_final_0001), 2, &first)); assert(0 == dusb_dissect(CALC_TI84P_USB, stderr, dusb_good_vpkt_data_final_0001, sizeof(dusb_good_vpkt_data_final_0001), 2, &first)); assert(ERR_INVALID_PACKET == dusb_dissect(CALC_TI84P_USB, stderr, dusb_bad_vpkt_data_final_0002, sizeof(dusb_bad_vpkt_data_final_0002), 2, &first)); assert(0 == dusb_dissect(CALC_TI84P_USB, stderr, dusb_good_vpkt_data_final_0002, sizeof(dusb_good_vpkt_data_final_0002), 2, &first)); assert(0 == dusb_dissect(CALC_TI84P_USB, stderr, dusb_good_vpkt_data_final_0003, sizeof(dusb_good_vpkt_data_final_0003), 1, &first)); assert(0 == dusb_dissect(CALC_TI84P_USB, stderr, dusb_good_vpkt_data_final_0007, sizeof(dusb_good_vpkt_data_final_0007), 2, &first)); assert(0 == dusb_dissect(CALC_TI84P_USB, stderr, dusb_good_vpkt_data_final_0008, sizeof(dusb_good_vpkt_data_final_0008), 1, &first)); assert(0 == dusb_dissect(CALC_TI84P_USB, stderr, dusb_good_vpkt_data_final_BB00, sizeof(dusb_good_vpkt_data_final_BB00), 1, &first)); assert(0 == dusb_dissect(CALC_TI84P_USB, stderr, dusb_good_vpkt_data_final_DD00, sizeof(dusb_good_vpkt_data_final_DD00), 1, &first)); assert(0 == dusb_dissect(CALC_TI84P_USB, stderr, dusb_good_vpkt_data_ack, sizeof(dusb_good_vpkt_data_ack), 1, &first)); } int main(int argc, char **argv) { ticalcs_library_init(); torture_ticalcs(); torture_nsp(); torture_dusb(); torture_cmdz80(); torture_cmd68k(); dissect_functions_unit_test(); ticalcs_library_exit(); return 0; } libticalcs-1.1.9+dfsg/tests/vcheck000077500000000000000000000002501327711501700171060ustar00rootroot00000000000000#!/bin/sh make valgrind --tool=memcheck --leak-check=yes --suppressions=/usr/lib/valgrind/glibc-2.3.supp --suppressions=/usr/lib/valgrind/ticalcs2.supp ./test_ticalcs_2libticalcs-1.1.9+dfsg/ticalcs2.pc.in000066400000000000000000000004301327711501700172100ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: TiCalcs Description: TI's calculator management library Version: @VERSION@ Requires: glib-2.0 Requires.private: ticables2,tifiles2 Libs: -L${libdir} -lticalcs2 Cflags: -I${includedir}/tilp2