CodeWalrus

Development => Calculators => Calculator News, Coding, Help & Talk => Topic started by: Dream of Omnimaga on January 08, 2017, 11:17:36 PM

Title: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: Dream of Omnimaga on January 08, 2017, 11:17:36 PM
One of the many complains that Casio calculator programmers always had was that its BASIC language was slow. TI programmers had similar complains about TI-BASIC, but the slow speed of TI-BASIC is nothing compared to Casio calculators, especially the ClassPad series. Thankfully, the fx-9860G series has a BASIC language that runs at speeds roughly comparable with the TI-84 Plus, but only because of the much faster processor (between 29 and 58 MHz depending of the fx-9860G hardware revision, compared to 15 MHz on the TI-84 Plus).

As a result, over the last 15 years, various Casio community hobbyists attempted to create third-party languages that ran much faster than BASIC, but much easier to learn than existing alternatives. We had MLC and later PRGM2, but neither came to fruition, although some major MLC games came out in 2005. Today, a Japanese community member has decided to take things even further, with a new BASIC interpreter rather than a new language, so that people can make their games run much faster without having to learn a new language. And thus, C.Basic was born:

https://www.youtube.com/watch?v=88VbT-6BhQs

As you can notice in the video above, the execution speed is a far cry from third-party TI-84 Plus and CE languages such as Axe Parser. Grammer, BBC Basic and ICE Compiler, but there is still a significant increase over the original built-in Casio BASIC interpreter. In addition to that, this add-in can run your BASIC programs from storage memory, according to the documentation. Although it is not fully completed yet and that most of the documentation is in Japanese, it is in the process of being translated for international audiences and the author recommends downloading the latest version.

Download links: http://egadget2.web.fc2.com/archives/fx-9860GII/Addin/Cbasic_Change_Log.html
Readme: http://egadget.blog.fc2.com/blog-entry-529.html
English documentation: http://egadget.blog.fc2.com/blog-entry-493.html
Supported commands: http://egadget.blog.fc2.com/blog-entry-460.html

Source: http://community.casiocalc.org/topic/7620-inside-casio-basic-is-now-to-be-prepared/
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: p2 on January 09, 2017, 02:30:29 PM
well thats an interesting way to boost the game speed :D
do we have any exact numbers, like cyrcles per second for basic, C.Basic and Axe so we can properly compare it? :)
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: p4nix on January 09, 2017, 05:06:37 PM
Just remember you can overclock to 230 MHz from the normal 30 Mhz :trollface:
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: Dream of Omnimaga on January 09, 2017, 05:24:49 PM
This is dangerous on certain Prizm hardware revisions (up to late 2013 IIRC), so before attempting any overclock on your 9860g it might be worth making sure it's not from the same batch, in case they have the same problem with overclocking.
Quote from: p2 on January 09, 2017, 02:30:29 PM
well thats an interesting way to boost the game speed :D
do we have any exact numbers, like cyrcles per second for basic, C.Basic and Axe so we can properly compare it? :)
Nope, sadly
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: Dream of Omnimaga on January 31, 2017, 02:32:15 AM
International release and website: http://egadget2.web.fc2.com/CBasic/Interpreter/CBasic_interpreter.html

Source: http://community.casiocalc.org/topic/7637-cbasic-international-release/

I hope to have some time to try this out (and hope that FA-124 is Windows 10-compatible) someday.
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: p4nix on January 31, 2017, 08:01:57 PM
Seems like you only have to wait for the : version to get compiled programs DJO ;)
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: Dream of Omnimaga on January 31, 2017, 09:49:15 PM
I am ok with interpreted if it means the speed is increased from regular basic. It's better than nothing. I must say that I would like a fx-CG10/20 version a lot, though.
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: Cakeisalie5 on March 13, 2017, 04:32:52 PM
Quote from: DJ OmnimagaI hope to have some time to try this out (and hope that FA-124 is Windows 10-compatible) someday.
It is compatible... Oo
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: Dream of Omnimaga on March 13, 2017, 06:42:14 PM
Good to hear. I was worried because it took Casio half a decade before finally supporting 64-bit Windows OSes, so I thought that a similar delay would happen with Windows 10.

I still hope C.Basic gets ported to the color-screen Casio, though, because my interest towards monochrome calculators have almost vanished when the color TI-84+ series came out.
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: p4nix on March 13, 2017, 08:44:11 PM
Casio SDK still has problems unfortunately. However, gcc toolchain is far superior IMO.
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: Dream of Omnimaga on March 13, 2017, 09:13:11 PM
By the way, you had issues making C stuff for Casio calcs before due to using Linux, right? has this been fixed ever since?
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: Cakeisalie5 on March 14, 2017, 09:57:14 PM
Quote from: DJ OmnimagaBy the way, you had issues making C stuff for Casio calcs before due to using Linux, right? has this been fixed ever since?

For the fx-9860G, we have had a working toolchain using GCC and lephe's g1a-wrapper for a few years now. We also have a ~working fxlib conversion for GCC (.lib -> .a), but a few functions don't work anymore (e.g. sprintf) and it's only C89-compatible, where GCC supports the latest C standards (C99, C11).

So to replace fxlib, we have a few alternative projects: gint (which is about taking over the hardware control for the time of add-in execution), and a little project I've launched a few days ago, libcarrot, which focuses on using the system for interacting with the hardware, and being fxlib-compatible. ^^

Also, for transferring, I'm the developer of the P7 project, which the initial focus is to make communicating with your fx-9860G possible under any platform (even if I'm focusing on Linux for now).
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: E37 on March 15, 2017, 01:17:52 AM
That's awesome!

If you move it next to a singularity (not too near) and view it from a distance it will be faster  ;)
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: Dream of Omnimaga on March 15, 2017, 11:23:46 AM
Quote from: Cakeisalie5 on March 14, 2017, 09:57:14 PM
Quote from: DJ OmnimagaBy the way, you had issues making C stuff for Casio calcs before due to using Linux, right? has this been fixed ever since?

For the fx-9860G, we have had a working toolchain using GCC and lephe's g1a-wrapper for a few years now. We also have a ~working fxlib conversion for GCC (.lib -> .a), but a few functions don't work anymore (e.g. sprintf) and it's only C89-compatible, where GCC supports the latest C standards (C99, C11).

So to replace fxlib, we have a few alternative projects: gint (which is about taking over the hardware control for the time of add-in execution), and a little project I've launched a few days ago, libcarrot, which focuses on using the system for interacting with the hardware, and being fxlib-compatible. ^^

Also, for transferring, I'm the developer of the P7 project, which the initial focus is to make communicating with your fx-9860G possible under any platform (even if I'm focusing on Linux for now).
Ah ok, that's good. Hopefully @p4nix should find this handy if he ever does 9860G programming again.
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: p4nix on March 15, 2017, 05:19:12 PM
I already use p7 and thanked @Cakeisalie5 over PM ;) It's a really useful tool and I can recommend it anyone doing fx9860 dev.
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: c4ooo on March 15, 2017, 11:30:40 PM
We need a third party TIBASIC interpreter for the CE calc. Perhaps @PT_  can look into it, given that he has made a compiler before?
(From what mateo has gathered, its very bad and unoptimized)
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: PT_ on March 15, 2017, 11:33:52 PM
Quote from: c4ooo on March 15, 2017, 11:30:40 PM
We need a third party TIBASIC interpreter for the CE calc. Perhaps @PT_  can look into it, given that he has made a compiler before?
(From what mateo has gathered, its very bad and unoptimized)
The TI-BASIC interpreter could indeed be better and smaller, but writing one yourself is pretty hard, I've experience ;)
Title: Re: C.Basic - A much faster Casio fx-9860gII BASIC interpreter
Post by: Dream of Omnimaga on March 17, 2017, 04:26:50 PM
BrandonW attempted a 83+ one before