Jump to content



Photo
* * * * * 4 votes

C.Basic - International Release

Casio Basic C.Basic

  • Please log in to reply
702 replies to this topic

#681 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted 23 October 2023 - 10:57 AM

Very sorry for lete update. :bow:
Here is the new version.
 
C.Basic for FX v2.46β (updated 23/10/2023)
 
C.Basic for CG v1.46β (updated 23/10/2023)
 
(build01)
-Changed to create [CBasic] folder only at first startup and use it as the default save and load folder.(only CG or GIII)
-Fixed a bug that the value of the control variable at the end of For~Next in integer mode was incompatible.
-Fixed a problem in which assignment of a string longer than the limit length failed when the length of the string is limited.
 (Length-1 is the maximum number of characters that can be stored.)
-Fixed a bug in Pol()Rect() function that ListAns did not return an answer when MatBase was 0.
-Fixed rounding of ENG display.
-Fixed a fatal bug when using Ref and Rref functions, because they were not supported.
-Fixed a bug in which a command that could not be input by C.Basic command input mode was added and corrected.
 
(note)
 C.BasicCG execution speed is slowed by up to 50% on fx-CG50 OS 3.80.0212.( 3.70 is recommended for C.BasicCG.)
 Graph90+E does not experience any slowdown even at 3.80.
 
 
@Krtyski
Thank you so much for your ongoing support, it is much appreciated. :D

Edited by sentaro21, 25 October 2023 - 08:58 AM.


#682 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted 25 October 2023 - 02:18 PM

This is a file-related update only. :)
 
C.Basic for FX v2.46β (updated 25/10/2023)
 
C.Basic for CG v1.46β (updated 25/10/2023)
 
(build02)
-Changed the specification so that a new file is created in the current folder when the cursor is on a folder in the file list.
-Changed to overwrite a file if it is larger in size than the previous file.(Only for GIII Model)
 (If the file size is smaller, the previous file is erased and a new file is saved.)


#683 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted 26 October 2023 - 05:43 AM

Here are the updated versions with fixed the bug. :)
 
 
C.Basic for FX v2.46β (updated 26/10/2023)
 
C.Basic for CG v1.46β (updated 26/10/2023)
 
(build03)
-Fixed a bug in the main memory favorites function for files with the same name, where only upper and lower case letters differed.
-Fixed a bug that caused the TicksWait count to be 1 too high.
(Before) TicksWait 4 was the same as TicksWait 5. 
-Fixed a bug that prevented builds due to incomplete source files included in the package.
-Fixed a bug that prevented returning to the folder position. (build01 enbug)
 

Edited by sentaro21, 27 October 2023 - 03:54 AM.


#684 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted 09 December 2023 - 12:05 PM

Here is the new updated version. :)
 
C.Basic for FX v2.47β (updated 10/12/2023)
 
C.Basic for CG v1.47β (updated 10/12/2023)
 
(build01)
-Added a catalog function dedicated to C.Basic commands.(Shift+5 for FX version)
-Added mini-font display in file mode.
-Added ? Minifont display of command and variable display. (newly FX version)
(format)?([@]×[,y][,width][, "blank character"][,number of input digits][,R])
(Example) ?(@30,40,5,">",5)A
  The value of A is displayed in mini-font at the current VRAM pixel coordinates (X=30,Y=40) 
    and waits for input. Blank spaces are filled with ">".
-Fixed a bug that the program freezes when using unsupported commands (internal code 0x7Fxx).
-Error display has been changed. Missing WhileEnd" and "Missing Switch".(ref.ErrorCode_List.txt)
-Disabled initialization of hidden RAM for non-GII models.
-Beep command can be interrupted by AC key.
-Fixed a bug in matrix and list initialization that caused an error if the RGB()HSV()HSL() command was the first one. (1.45 Embuged)
 (Example) {RGB(255,0,255),123,456}
-Fixed a bug in which a file exceeding 4096 bytes could only be loaded with the Load(command.
 
-The Locate command and drawing specifications such as Text can now be specified as mathematical formulas by writing them in parentheses.
 (Format 1) Locate x,y,Value/Strings[,N/O/R/V].
 (Format 2) Locate x,y,Value/Strings[,(drawing specification)].
  N:0 'normal
  O:1 'or
  R:2 'reverse
  V:3 'reverse or
 (Example) Locate 2,3,"ABC",(2)
   Locate 2,3,"ABC",® ' R=2
 Either
 Locate 2,3,"ABC",R
 are the same as
 
-FKeyMenu can now be used to specify formulas by writing the drawing specification in parentheses.
 (Format 1) FKeyMenu( n[~m], "string"/icon number [,C/M/N/R/I/S/U/L [,icon color [,icon background color]]] )
 (Format 2) FKeyMenu( n[~m], "string"/icon number [,(drawing specification) [,icon color [,icon background color]]] )
 Numeric value (0-4) in basic drawing specification
  C:( 0)Erase.
  N:( 1)Normal white icon. (may be omitted)
  R:( 2)Black icon with missing lower right corner.
  I:( 3)Square black icon.
  S:( 4) Black icon with border
 The following modifiers are added to the basic drawing specification values.
  U:( 16)Display string one dot above.
  L:( 32)Extend the display range by 2 dots to the left and right.
  M:( 64)Mask processing.
  M:(128)Masks only the border. (FX version only)
 
 (Example) FKeyMenu (1, "string",NULM)
      FKeyMenu (1, "string",(1+16+32+64))
  The above two will produce the same result.


#685 HappyCalc

HappyCalc

    Casio Addict

  • Members
  • PipPipPip
  • 67 posts
  • Gender:Male
  • Location:Germany
  • Interests:Programming, On-Calc Programming(C.Basic), Gaming, Origami, Eating Chocolate

  • Calculators:
    fx-9860GII-2
    fx-CG50

Posted 10 December 2023 - 02:17 PM

Cool that the Load() bug with big files is fixed. However, there is still a bug regarding folders. Let's say I have some data in
\\fls0\root.bin
\\fls0\FOLDER\file.bin
When I have a PROGRAM.g1m in SMEM:
16->Dim List 1
Load("/root.bin")->List 1
Load("/DATA/file.bin)->List 1
This works fine.
However, when I have this program in Main Mem, it fails on line 3 (load from folder)
I put most programs in Main Mem to reduce flash wear and I can also recover programs if I accidentally delete them.
To resolve this I used BFile syscalls, but that is a bit annoying as it leaks file handles sometimes because I forget a BFile_Close syscall somewhere.

#686 HappyCalc

HappyCalc

    Casio Addict

  • Members
  • PipPipPip
  • 67 posts
  • Gender:Male
  • Location:Germany
  • Interests:Programming, On-Calc Programming(C.Basic), Gaming, Origami, Eating Chocolate

  • Calculators:
    fx-9860GII-2
    fx-CG50

Posted 10 December 2023 - 02:39 PM

I often work with pointers, syscalls and assembly to improve performance. I have some question about memory allocation in C.Basic:
If I create a list with N->Dim List 1, is it guaranteed that List 1 is a contiguos memory area of N elements? And when exactly does C.Basic move pointers around? I noticed that clearing a list/mat/vec sometimes causes reallocation of other lists/vecs/mats, even creating strings can cause that (probably because Mat r has to be reallocated). This cause headaches because some programs tend to break because they hold a reference to a list while that has already been moved. Is it possible to pin/fix a list in place? Maybe something like
{1,2,3,4}->Fixed List 1.L
&List 1->A
16->Dim Fixed List 2.B
&List 2->B
'A, B still point to the same location, even if other things have been allocated/deallicated in the meantime
SysCall(_SCmemcpy,B,A,16) '_SCmemcpy is set to 0x1DD0 or 0xACF depending on calculator

Edited by HappyCalc, 10 December 2023 - 02:40 PM.


#687 CalcLoverHK

CalcLoverHK

    Casio Freak

  • Members
  • PipPipPipPip
  • 264 posts
  • Gender:Male
  • Location:Hong Kong
  • Interests:FPS games, C.Basic

  • Calculators:
    fx-50FHII (2019/1/30)
    fx-991ESPLUS-2 (2023/12/22)
    fx-3650PII (2022/1/15)
    fx-9750GIII (2020/6/13)
    fx-9860G Slim (2024/2/27)
    fx-9860GIISD (2023/3/27)
    fx-9860GIISD-2 (2024/2/5)
    fx-CG20CN (2023/2/12)
    fx-CG50 (2023/10/23)

Posted 10 December 2023 - 07:20 PM

@sentaro21

 

Thanks for the update. FKeyMenu is finally customizable simply by numerical expressions instead of bunch of Ifs  :greengrin:

 

I noticed a few bugs in the new version:

- In FX version, the cursor in file manager does not fully cover the current line.

- Pressing EXIT while Hist pop-up is shown in C.Basic catalog goes back to program editor instead of only closing the pop-up.

 

Also, thanks for uploading more old C.Basic versions on e-Gadget! But it seems like CBASIC099o1.zip in your archive is corrupted. (^^;



#688 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted 11 December 2023 - 10:06 AM

@HappyCalc
Thanks for the bug report. :)
I have identified a bug that prevents access to subfolders from main memory.
 
In C.Basic, matrices and lists are rearranged as their size increases or decreases or delete, 
but each area is allocated to a contiguous area.
Programs are stored from the top of the free area, and matrices and lists are allocated from the bottom.
The first matrix or list allocated will not be reallocated if it is not resized.
 
 
@CalcLoverHK
Thanks for the bug report. :)
99o1 is a replacement uploaded file, so the original is lost.
Please pretend that it was not there, as it does not bother if it is lost. :bow:
 
 
 
Here is bug fixed version. :)
 
C.Basic for FX v2.47β (updated 11/12/2023)
 
C.Basic for CG v1.47β (updated 11/12/2023)
 
(build02)   2023.12.11
-Fixed a bug that EXIT did not return to the catalog after history.
-Fixed a bug that files in a folder could not be accessed when the Load( command was used in a program in main memory.
-Fixed a bug that the cursor in file manager was not correct position. (FX version only). 
 


#689 piu58

piu58

    Casio Freak

  • Members
  • PipPipPipPip
  • 147 posts
  • Gender:Male

  • Calculators:
    Casio Graph 90+E, Casio fx-CG20

Posted 14 December 2023 - 05:13 AM

Dear Sentaro, I am happy to see you again here. I worked with C.Basic all the time. Half a year ago, I switched to the most up-to-date model Graph 90+E, which is a close sibling to the CG-50. I love the white  housings, where I can read the symbols easier.

Using it I detected, that battery life is much longer.

 

I update C.basic today.


Edited by piu58, 14 December 2023 - 05:28 AM.


#690 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted 15 December 2023 - 04:33 AM

@piu58
Long time no see.
My apologies for my long blank. :bow:
 
I am glad that you have continued to use C.Basic on an ongoing basis. ^_^
I have one Graph 90+E, and I think the white-based color scheme is very good.
 
I look forward to working with you again in the future. :D
 


#691 piu58

piu58

    Casio Freak

  • Members
  • PipPipPipPip
  • 147 posts
  • Gender:Male

  • Calculators:
    Casio Graph 90+E, Casio fx-CG20

Posted 15 December 2023 - 05:34 AM

Dear sentaro and all, my most advanced project is the simulation of an open cluster with the calculator. If you let a bunch of stars do what they want, you see interesting effects. Which occur in reality too

- development of a dense core and a halo

- some of the stars escape

- you get double stars, which generate energy = velocity for the other stars

 

Double stars are a remarkable numerical problem, because I have a time step control. The simulation of double stars requires small time steps.

 

I changed my comments into English, but I let the changed version not run. May be you have to eliminate tiny problems lie a missing ' or so.

 

The program recommends 50 stars, but I worked with larger numbers too.

 

The first such calculations were done by Sebastian Hoerner starting around 1951  with very few bodies. Sverre Aarseth dedicated all of his professional life to that problems. His Fortran programs are very advanced and freely available.

 

Here is a wiki site to the problem.

https://en.wikipedia.../N-body_problem

 

~

 

If you run the program you get a graph with the traces of the stars. In the top line is given:
time    (ahead the .)number of escaper (after the .)Wkin/Wpot, that is the relation kinetic to potential energy

'ProgramMode:RUN
'nbody, Open and galactic clusters. Leapfrog method.
' Stop for looking at results: line 236 R/S
' w0=|r| w1=|v| r0-2=Koor v0-2:velocity
' t = sqrt(rrr/Gm) t*. 
't(Mio.a)=sqrt(6.4rrr/m) r/Ly m/mS
Goto M 'Main

Lbl i'init
ClrGraph
0->X
0->Y
1->G
2->l 'Limit for escapers
10->N
"N"?N
1->Q
1->M
0.136*Sqrt(N)->W'Relax.
30->S
"final time"?S
0.03->J'use J=0.03 for balance between accuracy and calculation time
"J"?J
1->g
0.1*Sqrt(1/N)->d
0.05/(N^.333)->a'Plummer radius reduces creation of double stars
{N,3}->Dim Mat r
{N,3}->Dim Mat v
{N,3}->Dim Mat w
{N,3}->Dim Mat a
{N,3}->Dim Mat b
{N,1}->Dim Mat m
'Startwerte
0->i
While i<N
 0->R
 0->V
 For 0->j To 2
  Ran#->Z
  2Q*(Z-0.5)->r[i,j]
  R+r[i,j]^<2>->R
  Ran#->Z
  2*(Z-0.5)->v[i,j]
  V+v[i,j]^<2>->V
 Next
 SqrtR->R
 SqrtV->V
 If (R<Q) And (V<1)
  M/N->m[i]
  i+1->i
 IfEnd
WhileEnd
Gosub b 'baryz R
'virialisieren
Gosub k
Gosub p
Sqrt(2*K/P)->c 
For 0->i To N-1
 For 0->k To 2
  v[i,k]/c->v[i,k] 'virial.
  0->v[i,k] 'cc
 Next
Next
Gosub B'baryz V
Gosub a'first acceleration here
Return 

Lbl g'Grafik
For 0->i To N-1
 Blue Plot r[i,0]/Q,r[i,1]/Q
Next
Return 

Lbl a'acceleration
For 0->p To N-1
 For 0->k To 2
  a[p,k]->b[p,k]
  0->a[p,k]
 Next
Next
0->B
For 0->p To N-1
 For p+1->q To N-1
  Sqrt((r[p,0]-r[q,0])^<2>+(r[p,1]-r[q,1])^<2>+(r[p,2]-r[q,2])^<2>)->R
  R(RR+aa)->E
  For 0->k To 2
   G*(r[q,k]-r[p,k])/E->A
   a[p,k]+m[q]*A->a[p,k]
   a[q,k]-m[p]*A->a[q,k]
  Next'k
 Next'q
 Sqrt((a[p,0]-b[p,0])^<2>+(a[p,1]-b[p,1])^<2>+(a[p,2]-b[p,2])^<2>)->j
 Sqrt(a[p,0]^<2>+a[p,1]^<2>+a[p,2]^<2>)->A
 If j/A>B
  j/A->B
 IfEnd
Next'p
d->D
If B>0
 J/B*d->D
IfEnd
Return 

Lbl p'Wpot
0->P
For 0->i To N-1
 For i+1->j To N-1
  0->R
  For 0->k To 2
   (r[i,k]-r[j,k])^<2>+R->R
  Next
  Sqrt(R)->R
  P+m[i]*m[j]/R->P
 Next
Next
Return 

Lbl k'Wkin
0->K
For 0->i To N-1
 v[i,0]^<2>+v[i,1]^<2>+v[i,2]^<2>->V
 K+m[i]/2*V->K
Next
Return 

Lbl b'baryzentrisch R
0->x:0->y:0->z:0->L
For 0->i To N-1
 {i,x,r[i,0]}
 m[i]*r[i,0]+x->x 
 m[i]*r[i,1]+y->y
 m[i]*r[i,2]+z->z
 m[i]+L->L
Next
For 0->i To N-1
 r[i,0]-x/L->r[i,0]
 r[i,1]-y/L->r[i,1]
 r[i,2]-z/L->r[i,2]
Next
Return 

Lbl B'baryzentrisch V
0->x:0->y:0->z
For 0->i To N-1
 v[i,0]+x->x
 v[i,1]+y->y
 v[i,2]+z->z
Next
For 0->i To N-1
 v[i,0]-x/N->v[i,0]
 v[i,1]-y/N->v[i,1]
 v[i,2]-z/N->v[i,2]
Next
Return 

Lbl l'Leapfrog1
For 0->i To N-1
 For 0->k To 2
  v[i,k]+a[i,k]*d/2->w[i,k]  
 Next
Next
For 0->i To N-1
 For 0->k To 2
  r[i,k]+w[i,k]*d->r[i,k]  
 Next
Next
Gosub a
For 0->i To N-1
 For 0->k To 2
  w[i,k]+a[i,k]*d/2->v[i,k]
 Next
Next
Return 

Lbl L'Leapfrog
While t<=T
 Gosub l
 t+d->t
 If g>0.1
  D->d
 IfEnd
WhileEnd
Return 

Lbl G'Init graf
ClrGraph:CoordOff:AxesOff:GridOff:LabelOff:S-L-Normal:Rad:'#_SketchThin _
'_AxesOn_
' x0 x\1 dx y0 y\1 dy
ViewWindow (-)7.2,7.2,1,(-)4,4,1
Return 

'Print.XY / Grafik
Lbl P
Text 1,9,"                               "
Text 1,9,X
Text 1,179,Y
Return 
'Stop
Lbl S
Plot :Text 1,1,">"Disps
While Getkey<>31:WhileEnd'exit=47
Text 1,1," "
Plot :
Return 

Lbl M
Gosub G
Gosub i
1000->o
"number of outputs"?o
Gosub g
0->X
Gosub P
S/o->s'values for output
0->t
While t<S
 t+s->T
 If (T>S)
  S->T
 IfEnd
 Gosub L
 Gosub g
 t->X
 Gosub P
 0->n ' escaper
 For 0->i To N-1
  r[i,0]^<2>+r[i,1]^<2>+r[i,2]^<2>->R
  v[i,0]^<2>+v[i,1]^<2>+v[i,2]^<2>->V
  SqrtR->R
  SqrtV->V
  R->w[i,0]
  Vc->w[i,1]
  0.6->w[i,2] ' (O)=place (G)=velocity
  R>l=>n+1->n
 Next
 t->X
 Gosub k
 Gosub p
 100*n+K/P->Y
 Gosub P 'R//S for looking at the results in w0,1
 n>N/10-0.5=>Stop
WhileEnd
Gosub S
Stop


Edited by piu58, 15 December 2023 - 09:47 AM.


#692 CalcLoverHK

CalcLoverHK

    Casio Freak

  • Members
  • PipPipPipPip
  • 264 posts
  • Gender:Male
  • Location:Hong Kong
  • Interests:FPS games, C.Basic

  • Calculators:
    fx-50FHII (2019/1/30)
    fx-991ESPLUS-2 (2023/12/22)
    fx-3650PII (2022/1/15)
    fx-9750GIII (2020/6/13)
    fx-9860G Slim (2024/2/27)
    fx-9860GIISD (2023/3/27)
    fx-9860GIISD-2 (2024/2/5)
    fx-CG20CN (2023/2/12)
    fx-CG50 (2023/10/23)

Posted 15 December 2023 - 05:35 AM

@Sentaro21

 

Well, I managed to fix the CBASIC099o1.zip using WinZip and successfully retrieved most of its files. Suprisingly the g1a file is also saved and works as usual. Some of its source files are lost, but anyway I uploaded it on my Mediafire driver.

 

I am working on C.Basic version documentation, so I have to trace every C.Basic version you have released and see what exactly you have changed in each of them, as well as making some sort of table like this ^_^https://imgur.com/a/vXixVMC (credits to Minecraft Wiki)



#693 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted 18 December 2023 - 06:10 AM

@piu58
Thank you for this interesting program.
It is wonderful to be able to easily handle advanced calculations that are considered PC-required with C.Basic at hand. ^_^
 
 
@CalcLoverHK
Sorry for the trouble. And thank you.
Although it has evolved to the point where it is no longer the same thing compared to earlier versions,
Thanks to all of you. Thank you very much. :D


#694 loklol

loklol

    Newbie

  • Members
  • Pip
  • 8 posts
  • Gender:Male
  • Interests:CALCULATOR minecraft
    hacking programming

  • Calculators:
    fx-82AU plus II 2nd edition CY-863 Version A
    fx-82AU plus II 1st edition LY711X Version A
    fx-991es plus 1st edition GY455X Version F
    fx-82MS 1st edition 25 4
    fx-100
    fx-9750gii SH3 2.04.0200

Posted 29 May 2024 - 11:38 AM

wow, this program is amazing although i wont be able to test it yet, I am amazed by how much effort is still put into making these prograams!



#695 piu58

piu58

    Casio Freak

  • Members
  • PipPipPipPip
  • 147 posts
  • Gender:Male

  • Calculators:
    Casio Graph 90+E, Casio fx-CG20

Posted 06 June 2024 - 04:51 PM

It changes the pocket calculator into a real programming system.



#696 CalcLoverHK

CalcLoverHK

    Casio Freak

  • Members
  • PipPipPipPip
  • 264 posts
  • Gender:Male
  • Location:Hong Kong
  • Interests:FPS games, C.Basic

  • Calculators:
    fx-50FHII (2019/1/30)
    fx-991ESPLUS-2 (2023/12/22)
    fx-3650PII (2022/1/15)
    fx-9750GIII (2020/6/13)
    fx-9860G Slim (2024/2/27)
    fx-9860GIISD (2023/3/27)
    fx-9860GIISD-2 (2024/2/5)
    fx-CG20CN (2023/2/12)
    fx-CG50 (2023/10/23)

Posted 04 August 2024 - 09:48 AM

Hi everyone

 

Since January this year I have participated in the development of C.Basic. During these months I have set up the Git page for C.Basic and documented all known bugs there.

 

A while ago Lephenixnoir and I did research on the inferior floating-point arithmetic performance of GCC when compared to Renesas SHC compiler. The conclusion is that the current GCC configuration still use an older software FPU library `fp-bit` for sh-elf, while other targets have switched to a newer one called `soft-fp`. The benchmark results show that the build with `soft-fp` is faster than the one with SHC. As such, I began to port C.Basic FX to fxSDK and GCC. The N-Queens results validate the performance uplift.

 

The new update for FX Edition (v2.50 build 1) has been published. Click the link below to check the full changelogs and download the latest version. If you find any bugs, please report here or in the Git bug tracker  :)

https://git.planet-c...ases/tag/2.50.1

 

Thanks, CalcLoverHK


Edited by CalcLoverHK, 11 August 2024 - 05:43 AM.


#697 Hlib2

Hlib2

    Casio Freak

  • Members
  • PipPipPipPip
  • 142 posts
  • Gender:Male
  • Location:Ukraine
  • Interests:industrial electronics,
    graphing calculators

  • Calculators:
    fx-9860GII-2
    graph-100+
    fx-991DE_X
    ti-89_Titanium
    ti-voyage200
    ti-84+SE

Posted 08 August 2024 - 11:31 AM

Thanks to everyone who continues to work on the CBASIC project. These wonderful calculators, such as the fx-9860gii and fx-cg50, will delight us with their mathematical capabilities for a very long time.
I am currently unable to test the latest CBASIC update. But I will be very grateful to you for your help in clarifying some of the problems associated with the development of this project.
Here are my stupid questions.
1) 1.012040->X: Int(10^4×Frac(10^2×FracX))
Ans=2040 . Does CBASIC v.2.50 return the correct result in this example?
2) Do the deltaList, Cuml, Percent and Prod functions work in CBASIC now?
3) Do trigonometric functions in Integer mode work correctly?
4) If the number of nested For or While loops exceeds the number 7 (seven), will the program run in the latest version of CBASIC?
5) In the fx-9860gii-2 model, the BackLight 1 (On) command has an unpredictable duration: either infinity or time set in manual settings. The BackLight 2 (Change) command has the same defect. The BackLight 3 (Off) command does not work at all.
6) If the program was started from the /ABC folder, can it call the program from any other folder that was saved in flash memory? For example, from the /DEF folder? In ti-83+/84+ and in ti-89T/v200 it is very easy to do, and I can work with huge databases that exceed the size of RAM.
The 8-Queens benchmark is a very limited test that does not reflect the actual capabilities of the calculator. In other tests, we will get different results. In some calculations, for example, the fx-9750g+ (4.3 MHz) is faster than even the hp-50g (75 MHz).
Using one non-standard command in 8-queens benchmark in CBASIC, even in older versions, already gives a result for fx-9860gii-2 of 0.4_sec (29 MHz) without any code optimization.
(OffTopic). One of my recent projects is the study of chess algorithms on graphing calculators. 8×8 board - Fischer random chess and Contemporary random chess. 9×9 board - Modern random chess (MRC by Jose M Carrillo) and some variations on this theme. To my great disappointment, I still haven`t seen any successful chess software for HP-Prime (400 MHz). It is very strange that even a cheap cellphone priced at $25 (100 MHz) can play chess well (ChessMaster.jar or KasparovChess.jar) and reproduce much more complex programs than modern calculators can do. (OffTopic).
I wish success in your work to all fans of CASIO calculators.

Edited by Hlib2, 08 August 2024 - 04:56 PM.


#698 Hlib2

Hlib2

    Casio Freak

  • Members
  • PipPipPipPip
  • 142 posts
  • Gender:Male
  • Location:Ukraine
  • Interests:industrial electronics,
    graphing calculators

  • Calculators:
    fx-9860GII-2
    graph-100+
    fx-991DE_X
    ti-89_Titanium
    ti-voyage200
    ti-84+SE

Posted 08 August 2024 - 02:52 PM

Another idea related to the running of the CBASIC interpreter. To speed up the calculator, I suggest adding a command that temporarily cancels checking for all errors in each program statement (syntax, matching data types, correct array sizes, etc.). On your own risk, as assembler-code fragments inside BASIC program in ti-89T/84+(with appropriate libraries) or in hp-49g +/50g.
Here`s how it might look in CBASIC:
... BASIC code ... : CheckOff : ... BASIC code ... : CheckOn : ... BASIC code.
The CheckOn/Off mode can be added to the list of general application settings with the ability to check the current status: CheckOnState (0 or 1).

#699 CalcLoverHK

CalcLoverHK

    Casio Freak

  • Members
  • PipPipPipPip
  • 264 posts
  • Gender:Male
  • Location:Hong Kong
  • Interests:FPS games, C.Basic

  • Calculators:
    fx-50FHII (2019/1/30)
    fx-991ESPLUS-2 (2023/12/22)
    fx-3650PII (2022/1/15)
    fx-9750GIII (2020/6/13)
    fx-9860G Slim (2024/2/27)
    fx-9860GIISD (2023/3/27)
    fx-9860GIISD-2 (2024/2/5)
    fx-CG20CN (2023/2/12)
    fx-CG50 (2023/10/23)

Posted 09 August 2024 - 07:37 PM

Hi Hlib2, glad to see you coming back. To be honest, I was kinda concerned about your situation as you offlined for 2 years and you happened to be in Ukraine which we all know what is happening. Regardless though, stay safe ;) .

 

1) 1.012040->X: Int(10^4×Frac(10^2×FracX))
Ans=2040 . Does CBASIC v.2.50 return the correct result in this example?

 

It still outputs 2039 which is obviously incorrect. Unfortunately this seems to be the case of inaccuracy of floating-point arithmetic which is nearly impossible to deal with properly. In this case the actual value has an offset of -2.273736754*10^-13, but this value is unpredictable and there is no feasible way to find the correction value to compensate the error.

 

2) Do the deltaList, Cuml, Percent and Prod functions work in CBASIC now?

 

Only Prod function works for now.

 

3) Do trigonometric functions in Integer mode work correctly?

 

Nope, and it would be worthless to implement them in integer version, after all they are meant for calculation involving fractions and the integer mode will truncate the result, making it inaccurate. However, if you really want to use them in your program running in integer mode, you can first add '#CBDBL before them and get back to integer mode by '#CBINT later. To save the non-integer results, append # to variable like sin 30->A#. Note that you have to refer this variable as "A#" because it is a floating-point type which is different from A% (integer variable A).

 

4) If the number of nested For or While loops exceeds the number 7 (seven), will the program run in the latest version of CBASIC?

 

It will not run as it results in Nesting ERROR due to the design constraints below. I do agree this design is inflexible and there should be idealy 1 macro defining the stack limit, instead of equally allocating the stack area to these loop structures.

#define StackGotoMax 10+26+2+6+26
#define StackGosubMax 16
#define IfCntMax 32
#define StackForMax 7
#define StackWhileMax 7
#define StackDoMax 7
#define StackSwitchMax 7

5) In the fx-9860gii-2 model, the BackLight 1 (On) command has an unpredictable duration: either infinity or time set in manual settings. The BackLight 2 (Change) command has the same defect. The BackLight 3 (Off) command does not work at all.

 

"BackLight 3" should be "BackLight 0". I was able to reproduce the issue. Since backlight duration is RTC-driven, apparently the RTC timer stopped updating while C.Basic was displaying "Done", hence the infinity. However, if you enable Exec TimeDsp and press EXE to show execute time, the timer operated as usual and backlight can automatically turn itself off. Not sure why this happens.

 

6) If the program was started from the /ABC folder, can it call the program from any other folder that was saved in flash memory? For example, from the /DEF folder? In ti-83+/84+ and in ti-89T/v200 it is very easy to do, and I can work with huge databases that exceed the size of RAM.

 

C.Basic is unable to call program in different folder for now as the support of viewing subfolders is incomplete.

 

Another idea related to the running of the CBASIC interpreter. To speed up the calculator, I suggest adding a command that temporarily cancels checking for all errors in each program statement (syntax, matching data types, correct array sizes, etc.). On your own risk, as assembler-code fragments inside BASIC program in ti-89T/84+(with appropriate libraries) or in hp-49g +/50g.
Here`s how it might look in CBASIC:
... BASIC code ... : CheckOff : ... BASIC code ... : CheckOn : ... BASIC code.
The CheckOn/Off mode can be added to the list of general application settings with the ability to check the current status: CheckOnState (0 or 1).

 

Good idea, though for the command part it can be '#ERR0/1 to maintain compatibility with Casio Basic. Idealy, I think instead of disabling error checking, it would be better to seperate it entirely from C.Basic function implementations and leave that to debug mode only.

 

Thanks for your suggestions!


Edited by CalcLoverHK, 11 August 2024 - 05:37 AM.

  • Hlib2 likes this

#700 piu58

piu58

    Casio Freak

  • Members
  • PipPipPipPip
  • 147 posts
  • Gender:Male

  • Calculators:
    Casio Graph 90+E, Casio fx-CG20

Posted 14 August 2024 - 10:13 AM

1) 1.012040->X: Int(10^4×Frac(10^2×FracX))

Ans=2040 . Does CBASIC v.2.50 return the correct result in this example?

 

The calculatotor an casio basic use BCD coding of floating point numbers. So all the decimal numerals were preserved.

C.basic uses a binary represention. The preservation of decimal places is not assured. If you want the correct answer you shave to use

Int(0.5+10^4*Frac(10^2*Frac x))

You have to do this in almost all programming languages.

 

Do trigonometric functions in Integer mode work correctly?

 

Integers are not thought for triconometric functions. I don't see a reason for using this.



#701 Hlib2

Hlib2

    Casio Freak

  • Members
  • PipPipPipPip
  • 142 posts
  • Gender:Male
  • Location:Ukraine
  • Interests:industrial electronics,
    graphing calculators

  • Calculators:
    fx-9860GII-2
    graph-100+
    fx-991DE_X
    ti-89_Titanium
    ti-voyage200
    ti-84+SE

Posted 15 August 2024 - 10:31 AM

@ CalcLoverHK
This is a very clear and detailed explanation of current issues. I appreciate your help!
@ piu58

If you want the correct answer you have to use
Int(0.5+10^4*Frac(10^2*Frac x))

Yes, this is a useful way. In CBASIC, we also need to check the results more carefully and avoid dangerous constructions.

Integers are not thought for triconometric functions. I don`t see a reason for using this.

You are absolutely right. In integer mode √A and #√A, ln A and #ln A, e^A and #e^A run normally, but sin A without # gives Syntax ERROR. Obviously, this makes some sense.

#702 CalcLoverHK

CalcLoverHK

    Casio Freak

  • Members
  • PipPipPipPip
  • 264 posts
  • Gender:Male
  • Location:Hong Kong
  • Interests:FPS games, C.Basic

  • Calculators:
    fx-50FHII (2019/1/30)
    fx-991ESPLUS-2 (2023/12/22)
    fx-3650PII (2022/1/15)
    fx-9750GIII (2020/6/13)
    fx-9860G Slim (2024/2/27)
    fx-9860GIISD (2023/3/27)
    fx-9860GIISD-2 (2024/2/5)
    fx-CG20CN (2023/2/12)
    fx-CG50 (2023/10/23)

Posted 31 August 2024 - 02:29 PM

Hi all

A new bugfix update for FX Edition (v2.50 build 2) has been published. Click the link below to check the full changelogs and download the latest version. eyebrows.gif
https://git.planet-c...ases/tag/2.50.2

The GCC port for CG Edition is still underway. Although we have managed to compile the build, it has several critical ABI issues and crash points. Please wait until we are able to fix most of them for now. redface.gif

Thanks for your patience.

 

- CalcLoverHK



#703 CalcLoverHK

CalcLoverHK

    Casio Freak

  • Members
  • PipPipPipPip
  • 264 posts
  • Gender:Male
  • Location:Hong Kong
  • Interests:FPS games, C.Basic

  • Calculators:
    fx-50FHII (2019/1/30)
    fx-991ESPLUS-2 (2023/12/22)
    fx-3650PII (2022/1/15)
    fx-9750GIII (2020/6/13)
    fx-9860G Slim (2024/2/27)
    fx-9860GIISD (2023/3/27)
    fx-9860GIISD-2 (2024/2/5)
    fx-CG20CN (2023/2/12)
    fx-CG50 (2023/10/23)

Posted 20 October 2024 - 04:47 AM

Hi all

 

Build 3 for FX Edition 2.50 has been published. This version mainly contains refactoring changes that bring down the add-in size eyebrows.gif

https://git.planet-c...ases/tag/2.50.3

 

- CalcLoverHK

 

(Update)

A floating-point performance regression has been discovered in the previous version. Please install the patched version below. redface.gif
https://git.planet-c...es/tag/2.50.3.1


Edited by CalcLoverHK, 20 October 2024 - 08:00 PM.




Also tagged with one or more of these keywords: Casio Basic C.Basic

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users