CPCWiki forum

General Category => Programming => Topic started by: ervin on 01:37, 29 November 19

Title: cpctelera & SDCC
Post by: ervin on 01:37, 29 November 19
Hi everyone.

I've noticed that cpctelera's version of SDCC is a little out of date.
The latest SDCC is 3.9.0, and was released in April 2019.

Does anyone know if it's possible to update SDCC inside a cpctelera environment?
Or is cpctelera tied too closely to the version of SDCC that it is bundled with?

Thanks for any help.
8)
Title: Re: cpctelera & SDCC
Post by: ronaldo on 18:20, 29 November 19
Hi @ervin (http://www.cpcwiki.eu/forum/index.php?action=profile;u=82) ,

   You can easily add a new version of SDCC to CPCtelera, even without touching anything inside CPCtelera. CPCtelera picks binaries from $CPCT_PATH/tools/sdcc-3.6.8-r9946/bin/ (latest 1.5 release). You may rename SDCCs folder and then create a symbolic link to whatever version you like. For instance, with these commands inside $CPCT_PATH/tools/ folder, you would end up with everything working same, as if nothing happened:

[tools]$ mv sdcc-3.6.8-r9946/ oldsdcc       # Rename SDCC folder into oldsdcc
[tools]$ ln -s oldsdcc/ sdcc-3.6.8-r9946    # Create a symbolic link from CPCtelera's expected folder to oldsdcc
[tools]$ ls
2cdt/     arkosTracker-1.0/  dskgen/       iDSK-0.13/  oldsdcc/     rvm/      sdcc-3.6.8-r9946@  zx7b/
android/  cpc2cdt/           hex2bin-2.0/  img2cpc/    rgas-1.2.2/  scripts/  winape/            Makefile
[tools]$


Everything works with no change after these commands. However, you now have the power to seamlessly change your SDCC version, just by making the symbolic link point to whichever version you wanted. The only thing to know is that SDCC folder must have a bin/ subfolder with all compiled binaries (identical to sdcc-3.6.8-r9946/bin). Nothing else is requiered, because CPCtelera will look for these binaries through the symbolic link and use them.

And by now, CPCtelera has not changed SDCC version because all tests I made with SDCC 3.8 and SDCC 3.9 didn't convince me. Generated code seems not to be better, and many times seems to be worse than SDCC 3.6.8. However, I must admit that I didn't conduct extensive tests. I may be wrong. And, of course, there is also the benefit of improvements of the compiler with respect to bugs and recognizion of language features. That should also be taken into account.
Title: Re: cpctelera & SDCC
Post by: ervin on 02:32, 30 November 19
Thanks ronaldo.
That's really great information!
Title: Re: cpctelera & SDCC
Post by: shifters74 on 11:02, 30 November 19
Hi all,

are there any libraries for string and memory handling, reading a string from the keyboard, printing at locations on the screen, reading and writing from/to a file etc - normally simple stuff.

The SDCC documentation and CPCtelera document say not but wondering if the community had any to hand.

While its possible of course to write your own, i don't want to have to reinvent the wheel for simple stuff (and probably not do it that well!)


If there is nothing is it recommended to write a bit of z80 to access the firmware routines to do this?

thanks
shifters
Title: Re: cpctelera & SDCC
Post by: SRS on 19:55, 30 November 19
I recommend looking at CPCteleras Examples.

You can find a lot there i.e. inside "cpctelera\examples\easy\strings"
Title: Re: cpctelera & SDCC
Post by: shifters74 on 21:09, 30 November 19
Quote from: SRS on 19:55, 30 November 19
I recommend looking at CPCteleras Examples.

You can find a lot there i.e. inside "cpctelera\examples\easy\strings"
Lol i did look at the examples and totally missed it  :doh:

Thanks
Shifters
Title: Re: cpctelera & SDCC
Post by: SRS on 21:16, 30 November 19
*lol*

Enjoy :)
Powered by SMFPacks Menu Editor Mod