Jump to content



Photo
* * * * * 4 votes

C.Basic - International Release

Casio Basic C.Basic

  • Please log in to reply
692 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
  • 257 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
  • 145 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
  • 145 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
  • 257 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






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