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

C.Basic - A much faster Casio fx-9860gII BASIC interpreter

Started by Dream of Omnimaga, January 08, 2017, 11:17:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dream of Omnimaga

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/
  • 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

p2

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? :)
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

p4nix

Just remember you can overclock to 230 MHz from the normal 30 Mhz :trollface:
  • Calculators owned: fx9860GII (SH4)

Dream of Omnimaga

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
  • 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

Dream of Omnimaga

  • 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

p4nix

Seems like you only have to wait for the : version to get compiled programs DJO ;)
  • Calculators owned: fx9860GII (SH4)

Dream of Omnimaga

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.
  • 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

Cakeisalie5

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
  • Calculators owned: Graph 65, Graph 100, fx-9750GII-2, Graph 75+E
Leader of the P7 Project, for communication utilities with CASIO calculators.

Dream of Omnimaga

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.
  • 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

p4nix

Casio SDK still has problems unfortunately. However, gcc toolchain is far superior IMO.
  • Calculators owned: fx9860GII (SH4)

Dream of Omnimaga

By the way, you had issues making C stuff for Casio calcs before due to using Linux, right? has this been fixed ever since?
  • 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

Cakeisalie5

#11
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).
  • Calculators owned: Graph 65, Graph 100, fx-9750GII-2, Graph 75+E
Leader of the P7 Project, for communication utilities with CASIO calculators.

E37

That's awesome!

If you move it next to a singularity (not too near) and view it from a distance it will be faster  ;)
  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

Dream of Omnimaga

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.
  • 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

p4nix

I already use p7 and thanked @Cakeisalie5 over PM ;) It's a really useful tool and I can recommend it anyone doing fx9860 dev.
  • Calculators owned: fx9860GII (SH4)

Powered by EzPortal