Join us on Discord!
You can help CodeWalrus stay online by donating here.

C SDK and Libraries for the TI84+CE/TI8PCE

Started by MateoConLechuga, January 29, 2016, 02:59:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kotu

  • Calculators owned: TI 84+CE-T
  • Consoles, mobile devices and vintage computers owned: Sega Master System, Sony PlayStation 3
SUBSCRIBE TO THE FUTURERAVE.UK MAILING LIST
http://futurerave.uk

MateoConLechuga

This is a rather important update to the libs; it appears the gfx_VertLine_NoClip was off by one pixel. This has since been fixed; if you have used it in your program (I don't think anyone other than me has), you should check to make sure it is working properly. Thanks all! :D

Download libraries: https://github.com/CE-Programming/libraries/releases/latest

Dream of Omnimaga

I was scared at first because I thought that meant that all authors of games would need to update O.O. Hopefully it's not too much of an issue with old games, though.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

MateoConLechuga

#78
So the toolchain has had quite a ton of updates, including RTC support, more OS integration, and many other neat things that you will definitely want to explore. (hint: look at tice.h) Perhaps the most important is the release of v3 of the fileio library, which now allows you to set, store, and recall variables used in BASIC programs, such as Ans, Matrices, Strings, Lists, and others with ease. Be sure to update as soon as you can, and enjoy! :D

Download toolchain: https://github.com/CE-Programming/toolchain/releases/latest
Download libraries: https://github.com/CE-Programming/libraries/releases/latest

Dream of Omnimaga

Thanks for the hard work on this Mateo. Most people who talk about doing C on the CE says they find the toolchain very easy to get started with, while with many other calc models, what usually happened was a flood of support topics where people asked why their C envionment showed errors. You did a good job at making it intuitive it seems, which is a must if you want many people to use it.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

MateoConLechuga

Okay, so this is a nice little breakdown of what is new and fixed, so update the toolchain and libraries whenever you get a chance :)

Toolchain: https://github.com/CE-Programming/toolchain/releases/latest
Libraries: https://github.com/CE-Programming/libraries/releases/latest

1) v3 of the graphx library fixes many persistent bugs and introduces new features such as clipped text.
3) The installation method on windows is now easier than ever, just a double click to run a program and the environment variables will be configured.
3) Wiki pages have been added to the toolchain wiki to describe how to build your first program and more.
4) ConvPNG has been updated to fix some issues with compressed sprites

If you would like to add to the toolchain wiki, feel free! It is open to all :)

Enjoy everyone; I think other than continued optimizations of library functions, that there isn't much else to add unless you all keep up with the requests :P

Some eye candy:

Unicorn

And not to let the linux installation become to hard compared to windows, run this script to update and install the toolchain, as well as set up the environment variables. There is a wiki page here.

cd ~/
if [ ! -d "CEdev" ]; then
echo "$(tput setaf 2)Checking for CEdev Directory... Didn't find it."
echo "$(tput setaf 3)Updating Path and Creating Environment Variables..."
echo "export CEDEV=~/CEdev/" >> ~/.bashrc
echo "export PATH=$PATH:~/CEdev/bin/" >> ~/.bashrc
else
echo "$(tput setaf 2)Checking for CEdev Directory... Found it."
fi
echo "$(tput setaf 3)Downloading the SDK...$(tput setaf 1)"
wget $(curl https://api.github.com/repos/CE-Programming/toolchain/releases/latest -s| grep browser_download_url | awk '{ print $2; }' | tr -d \",) -q
echo "$(tput setaf 2)Unzipping...$(tput setaf 1)"
unzip -o -q CEdev.zip -d ~/
echo "$(tput setaf 2)Removing CEdev.zip$(tput setaf 1)"
rm CEdev.zip
echo "$(tput setaf 6)$(tput bold)C SDK Installed!$(tput bold)"
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Lionel Debroux

#82
Several portability suggestions for your script, derived from the GCC4TI and libti*/gfm/tilp install scripts:
1) you should consider using either wget or curl, but not both ;)
2) you probably want to prompt the user for the value of the CEdev variable. The only reasonably portable way to do that is the `read` shell built-in: "dialog" implementations are not necessarily installed OOTB, and dialog usage is hilariously non-portable - I simply got rid of all that crap in the GCC4TI install script;
3) you should prompt the user whether to write to .bashrc - this way, those who don't use bash can opt out;
4) you should try to do without using awk, which is not installed OOTB on minimal Linux distros or at least some of the BSDs;
5) likewise, you should get rid of tput usage and use raw ANSI escape sequences. ncurses is probably installed OOTB on most Linux distros, but not necessarily elsewhere.

EDIT: heh, I now see that on IRC, jacobly posted two of the same suggestions, and a third one in a different form :)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TIEmu and TILP.
Co-admin of TI-Planet.

Unicorn

Quote from: Lionel Debroux on November 19, 2016, 08:04:58 AM
Several portability suggestions for your script, derived from the GCC4TI and libti*/gfm/tilp install scripts:
1) you should consider using either wget or curl, but not both ;)
2) you probably want to prompt the user for the value of the CEdev variable. The only reasonably portable way to do that is the `read` shell built-in: "dialog" implementations are not necessarily installed OOTB, and dialog usage is hilariously non-portable - I simply got rid of all that crap in the GCC4TI install script;
3) you should prompt the user whether to write to .bashrc - this way, those who don't use bash can opt out;
4) you should try to do without using awk, which is not installed OOTB on minimal Linux distros or at least some of the BSDs;
5) likewise, you should get rid of tput usage and use raw ANSI escape sequences. ncurses is probably installed OOTB on most Linux distros, but not necessarily elsewhere.

EDIT: heh, I now see that on IRC, jacobly posted two of the same suggestions, and a third one in a different form :)
So I've been told, @Lionel Debroux  :P Do you mind if I ask a few questions about what you mean?

Quote
2) you probably want to prompt the user for the value of the CEdev variable. The only reasonably portable way to do that is the `read` shell built-in: "dialog" implementations are not necessarily installed OOTB, and dialog usage is hilariously non-portable - I simply got rid of all that crap in the GCC4TI install script;
What do you mean promp for the value? How would you go about doing that?
Quote
3) you should prompt the user whether to write to .bashrc - this way, those who don't use bash can opt out;
How should I do this? Prompt, have them choose whether to write to bashrc or "other", and the specify other?
Quote
4) you should try to do without using awk, which is not installed OOTB on minimal Linux distros or at least some of the BSDs;
No idea what you just said there, awk is not installed on minimal distros? What is awk?
Quote
5) likewise, you should get rid of tput usage and use raw ANSI escape sequences. ncurses is probably installed OOTB on most Linux distros, but not necessarily elsewhere.
How would I use ncurses, or some other program for colored text?

Thanks in advance :)
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Lionel Debroux

2), 3) for prompting the user, see e.g. the GCC4TI top-level install script at https://github.com/debrouxl/gcc4ti/blob/next/trunk/tigcc-linux/scripts/Install . It uses `read` a number of times at the beginning, as well as at the end.
3) I meant have the user choose whether (s)he wants to write to .bashrc. That's what the GCC4TI install script does at the end.
Extra bonus points for attempting to support zsh; however, you probably don't want to support csh, ksh, tcsh, old Bourne sh, and whatever else fell out of favor but I forget at the moment :)

4) awk is one of the usual scriptable *nix text parsing programs, great for parsing fields in delimited formats, but it can compute stuff, too. In the code snippet above, you used it in the pipe chain, between grep and tr :)
In some Linux distros, users have to install it by themselves, which is why I suggested rewriting the pipe chain not to use awk. On IRC, jacobly suggested a simpler `wget | sed` pipe chain.

5) I wrote ncurses because tput is part of it. And for the same portability reasons, to either minimal Linux distros or more probably some of the BSDs, I'm suggested to get rid of tput altogether, e.g. writing raw ANSI escape sequences in your script: \033[<code>m - even if it will print those sequences in the output even when the output is redirected to a file by the user. See e.g. the TILP install script, https://ti-pla.net/tilpinst -> https://raw.githubusercontent.com/debrouxl/tilp_and_gfm/experimental/tilp/trunk/build/scripts/install_tilp.sh .
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TIEmu and TILP.
Co-admin of TI-Planet.

Dream of Omnimaga

@MateoConLechuga nice updates. Clipping being added to more features will make things even easier for certain games. :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

MateoConLechuga

Here's a list of changes; you should definitely update :D

- LibLoad v2.0 format is used for libraries, this helps reduces their size
- Libraries are preconfigured to be sent to the archive
- graphx v4 is out; which fixes a few things and adds gfx_Lighten and gfx_Darken (Screenshot below, graphics demo 11 of the toolchain)
- Changing user header files triggers a rebuild of source files
- Some random cleanup of examples

Download toolchain: https://github.com/CE-Programming/toolchain/releases/latest
Download libraries: https://github.com/CE-Programming/libraries/releases/latest



kotu

Sweet :)

gfx_Lighten and gfx_Darken work on the palette I presume?
  • Calculators owned: TI 84+CE-T
  • Consoles, mobile devices and vintage computers owned: Sega Master System, Sony PlayStation 3
SUBSCRIBE TO THE FUTURERAVE.UK MAILING LIST
http://futurerave.uk

MateoConLechuga

Quote from: kotu on December 18, 2016, 08:13:50 PM
gfx_Lighten and gfx_Darken work on the palette I presume?
Yep, they can lighten or darken different hues. They take an original color as input.

Dream of Omnimaga

Do you plan to keep backwards compatibility with old C programs that use the libraries in long terms by the way?

Just asking because TI and HP didn't with Nspire Lua and HP PPL
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Powered by EzPortal