![:bow:](/dot/public/style_emoticons/default/prie.gif)
![:D](/dot/public/style_emoticons/default/biggrin.png)
Edited by sentaro21, 25 October 2023 - 08:58 AM.
Posted 23 October 2023 - 10:57 AM
Edited by sentaro21, 25 October 2023 - 08:58 AM.
Posted 25 October 2023 - 02:18 PM
Posted 26 October 2023 - 05:43 AM
Edited by sentaro21, 27 October 2023 - 03:54 AM.
Posted 09 December 2023 - 12:05 PM
Posted 10 December 2023 - 02:17 PM
16->Dim List 1 Load("/root.bin")->List 1 Load("/DATA/file.bin)->List 1This works fine.
Posted 10 December 2023 - 02:39 PM
{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.
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
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
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. (^^;
Posted 11 December 2023 - 10:06 AM
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.
Posted 15 December 2023 - 04:33 AM
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.
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)
Posted 18 December 2023 - 06:10 AM
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!
Posted 06 June 2024 - 04:51 PM
It changes the pocket calculator into a real programming system.
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.
Posted 08 August 2024 - 11:31 AM
Edited by Hlib2, 08 August 2024 - 04:56 PM.
Posted 08 August 2024 - 02:52 PM
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 will 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.
I was able to reproduce the issue, though "BackLight 3" should be "BackLight 0". Since backlight duration is RTC-driven, apparently the RTC timer stops updating when C.Basic displays "Done", hence the infinity. However, if you enable Exec TimeDsp and press
to show execute time, the timer operates 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 February 2025 - 03:38 AM.
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.
Posted 15 August 2024 - 10:31 AM
Yes, this is a useful way. In CBASIC, we also need to check the results more carefully and avoid dangerous constructions.If you want the correct answer you have to use
Int(0.5+10^4*Frac(10^2*Frac x))
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.Integers are not thought for triconometric functions. I don`t see a reason for using this.
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.
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.
Thanks for your patience.
- CalcLoverHK
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
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.
https://git.planet-c...es/tag/2.50.3.1
Edited by CalcLoverHK, 20 October 2024 - 08:00 PM.
Posted 15 January 2025 - 01:09 PM
Edited by Hlib2, 15 January 2025 - 05:56 PM.
Posted 20 January 2025 - 04:42 PM
prog name "SAMPLE" Wait 0 `#CBINT RefrshCtrl 1 : RefrshTime 0 Screen.T : _ClrVram Screen.G : _ClrVram Disp "_Rectangle SAMPLE" : Screen.G For 0->L To 56 Step 16 For 0->K To 56 Step 16 _Rectangle K,L,K+7,L+7,1,1,0 Next : Next _Rectangle 19,19,52,52,3,3,2 _DispVram Exex. time = 0.020_s
Edited by Hlib2, 20 January 2025 - 04:46 PM.
Posted 11 February 2025 - 09:22 AM
@Hlib2
Some of your questions require further confirmations from Sentaro himself, so I will answer the remaining ones with my own knowledge.
1) How can I change the basic settings of the modes using the program: Storage mode (main, smem), Pict mode (mem, heap (not working properly), both, main), Max List, Max Pict, Use Hidn RAM, SetupRecover?
There are currently no way to change these settings in a program. We will consider adding them in the form of '# commands.
4) Is it possible in C.BASIC to execute Str "*" as a program text, and not just as an expression like Expr (Str 1)?
What do you mean on "executing Str "*" as a program text"? Can you give examples on this?
Update from Sentaro:
I think the idea is to consider the data strings in the Matrix as a program and have it run like a subprogram.
I think it is not difficult to implement them, including Save/Load the data of the program, but I did not implement them because I did not feel any special need to do so.
5) Extended Opcode List: 0x7F58, 0x7F59 etc. How to use them in program (format example)?
These opcodes are meant for internal use only and most of them are extended commands, e.g. 0x7F58 and 0x7F59 that you have mentioned are ElemSize and ColSize commands.
6) System(*) and SysCall. Could you please provide a link to the use of these commands in C.BASIC, as I have only a limited understanding of this from the forum materials.
System command usage (incomplete list)
Edited by CalcLoverHK, 13 February 2025 - 03:42 AM.
Posted 11 February 2025 - 02:13 PM
General →
Your Projects →
Inside Casio Basic is now to be preparedStarted by Krtyski , 02 Dec 2016 ![]() |
|
![]()
|
0 members, 8 guests, 0 anonymous users