Les membres ayant 30 points peuvent parler sur les canaux annonces, projets et hs du chat.
La shoutbox n'est pas chargée par défaut pour des raisons de performances. Cliquez pour charger.

Forum Casio - Projets de programmation


Index du Forum » Projets de programmation » C.Basic Projets
Sentaro21 Hors ligne Membre Points: 878 Défis: 0 Message

C.Basic Projets

Posté le 30/04/2017 11:08

Hello, everyone.

I am Sentaro21, and I am developing C.Basic, a Basic interpreter that allows high-speed execution of Basic programs while maintaining compatibility with genuine Casio Basic.

Here is an English site, by Krtyski, about the C.Basic project (I helped him with the translation, but it's still unfinished) :
https://egadget2.web.fc2.com/CBasic/Interpreter/CBasic_interpreter.html

The articles and various programs from this site served as a reference to evaluate the compatibility level of C.Basic. Results were not good every time I tested them, but compatibility increased over time.

These programs have been ported experimentally. Many thanks to their authors.

Block Tower (C.Basic version)
https://pm.matrix.jp/CB/CB_BlockTower.zip

Sudoku (C.Basic version)
https://pm.matrix.jp/CB/CB_Sudoku.zip

Maze Generator (C.Basic version)
https://pm.matrix.jp/CB/CB_MazeGene.zip

Graph 3D (C.Basic version)
https://pm.matrix.jp/CB/CB_Graph3D.zip

TokiTori (C.Basic version 25/11/2018)
https://pm.matrix.jp/CB/CB_Tokitori.zip
(added Save/Load feature)

Ice slider (C.Basic version 25/11/2018)
https://pm.matrix.jp/CB/CB_IceSlider.zip
(added Save/Load feature)

Clonelab (C.Basic version 25/11/2018)
https://pm.matrix.jp/CB/CB_Clonlab.zip
(added Save/Load feature)

Arkenstone (C.Basic version 25/11/2018)
https://pm.matrix.jp/CB/CB_Arkenstone.zip
(added Save/Load feature)

Aventura (C.Basic version 25/11/2018)
https://pm.matrix.jp/CB/CB_Aventura.zip
(added Save/Load feature)

Electricity (C.Basic version 10/2/2019)
https://pm.matrix.jp/CB/CB_Electric.zip
(added Save/Load feature)

Here are examples of programs that reach near-C performance :

BallGame (C.Basic version)
https://pm.matrix.jp/CB/CB_BallGame.zip

Asprin (C.Basic version)
https://pm.matrix.jp/CB/CB_Aspirin.zip


The C.Basic project is still yet to be completed, thus I would like to get your feedback.

This is the latest version of C.Basic 2.47 beta for Graph 35+USB/35+EII/75/85/95 (SD)
https://pm.matrix.jp/CB/CBASIC247beta02.zip (updated 11/12/2023)

This is the latest version of C.BasicCG 1.47 beta for Graph90+E/fx-CG10/20/50:
https://pm.matrix.jp/CB/CBASICCG147beta02.zip (updated 11/12/2023)

C.Basic manuals
https://gitlab.com/sentaro21/cbasic

Currently C.Basic exists thanks to this site.
Thank you very much.


Précédente 1, 2, 3 ··· 10 ··· 12, 13, 14, 15, 16, 17, 18 ··· 20 ··· 30, 31, 32 Suivante
Sentaro21 Hors ligne Membre Points: 878 Défis: 0 Message

Citer : Posté le 05/09/2019 08:03 | #


Thanks very much!
This is the first time for CG version 1.26, so the FX version stayed at 2.26.
Je continue à développer C.Basic. (Il est compatible avec Basic Casio.)
Overclocking utilitaire Ftune/Ptune2/Ptune3 est également disponible.
Si vous avez des questions ou un rapport de bogue, n'hésitez pas à me le faire savoir.
Lightmare Hors ligne Membre de CreativeCalc Points: 690 Défis: 0 Message

Citer : Posté le 05/09/2019 18:49 | #


@Sentaro21 : Good idea ! but i'm not very familiar with syscalls. So i searched in the wiki and some topics about serial-communication syscall and now i know the Serial_Open() function is the syscall 0x1BB7 and takes one parameter which is the mode 1 to 5, but it's supposed to return 0, and it returned -2147302072, so i'm lost, and i ask for everyone some help about this syscall and how to use the C.Basic's Syscall() function.
"Quand je dis à la cour : "Sautez ! ", tout le monde me demande "jusqu'où ?" "
Dijkstra - The Witcher
Sentaro21 Hors ligne Membre Points: 878 Défis: 0 Message

Citer : Posté le 06/09/2019 01:59 | #


Thanks!

Usage of SysCall command of C.Basic is as follows.
6->Dim List 1.B0  // char mode[6] based 0

0->List 1[0]
5->List 1[1]    // baud 9600=5 ->mode[1]
0->List 1[2]    // parity 0=no ->mode[2]
0->List 1[3]    // datalength 8bit=0 ->mode[3]
0->List 1[4]    // stop bits one=0 ->mode[4]
0->List 1[5]    // not used
SysCall(0x1BB7,VarPtr(List 1))        // Serial_Open

or
{0,5,0,0,0,0}-List 1.B0    // set all parameter
SysCall(0x1BB7,&List 1)        // Serial_Open


This program is return 0 at 1st run.
Second run is return 3.

Je continue à développer C.Basic. (Il est compatible avec Basic Casio.)
Overclocking utilitaire Ftune/Ptune2/Ptune3 est également disponible.
Si vous avez des questions ou un rapport de bogue, n'hésitez pas à me le faire savoir.
Redcmd Hors ligne Membre Points: 380 Défis: 7 Message

Citer : Posté le 06/09/2019 02:39 | #


The cusor still moves down after clip&paste
But only on line 5 now
Sentaro21 Hors ligne Membre Points: 878 Défis: 0 Message

Citer : Posté le 06/09/2019 02:51 | #


Are there still cursor bugs?
Je continue à développer C.Basic. (Il est compatible avec Basic Casio.)
Overclocking utilitaire Ftune/Ptune2/Ptune3 est également disponible.
Si vous avez des questions ou un rapport de bogue, n'hésitez pas à me le faire savoir.
Redcmd Hors ligne Membre Points: 380 Défis: 7 Message

Citer : Posté le 06/09/2019 02:54 | #


Yes
When pasting in the edior [SHIFT] + [9]
If the cusor is on line 5 (of the screen, not the file), the cusor moves down to line 6 (and the screen moves down)
It should stay at line 5
Every other line is perfectly fine
Sentaro21 Hors ligne Membre Points: 878 Défis: 0 Message

Citer : Posté le 06/09/2019 03:04 | #


I confirmed.
I will fix it.

Ajouté le 06/09/2019 à 03:24 :
Sorry,
I lost the bug.
Could you please show me more detail?

Je continue à développer C.Basic. (Il est compatible avec Basic Casio.)
Overclocking utilitaire Ftune/Ptune2/Ptune3 est également disponible.
Si vous avez des questions ou un rapport de bogue, n'hésitez pas à me le faire savoir.
Redcmd Hors ligne Membre Points: 380 Défis: 7 Message

Citer : Posté le 06/09/2019 03:31 | #


I got the memory full error (while in normal basic)
When jumping between C.Basic and normal Basic, the error comes up
it also stuck a password on the program below it

I just found an interesting bug
It's to do with disabling End statements (IfEnd, Next, WhileEnd etc) with Dsz, => or If commands
On normal basic the program ran like normal
But in C.Basic it stopped mid way through
(Its due to normal Basic, being a bit buggy with the End Statements)

Ajouté le 06/09/2019 à 03:34 :
For 1-> X To 2
    2 -> N
    For 1->Y To 2
        Locate X, Y, N
        Dsz N
    Next
Next

Normal basic prints this to the screen
22
11
while C.Basic prints
2
1

When Dsz gets to 0
It doesn't run the command after it, which is the 'next' statement
This causes all sorts of issues in normal basic
While in C.Basic nothing breaks
But because you are trying to mirror normal basic as much as possible
this can be conceded a bug

I have no idea how you are going to fix that
If its fixable at all
Though, theres a super low low chance that someone is going to do that
Because normally it ends with everything being buggy, and the program crashing at random points

Unless it can be fixed easily, I dont see any reason to fix it
Sentaro21 Hors ligne Membre Points: 878 Défis: 0 Message

Citer : Posté le 06/09/2019 03:45 | #


Thanks more bug report.

In C.Basic, structured loop commands must be used in pairs.
That's currently incompatible.

Since the main memory error is fatal, I'll investigate it.

Je continue à développer C.Basic. (Il est compatible avec Basic Casio.)
Overclocking utilitaire Ftune/Ptune2/Ptune3 est également disponible.
Si vous avez des questions ou un rapport de bogue, n'hésitez pas à me le faire savoir.
Redcmd Hors ligne Membre Points: 380 Défis: 7 Message

Citer : Posté le 06/09/2019 03:51 | #


Program 1 got the memory error
and now theres a password on program 2 (which is under program 1)
When viewing program 2 in Bide, the password is Blank - ""
When accessing program 2 on the calc, I get the password screen
because the password is blank, I type nothing into it, and press [EXE] - nothing happens
does the code check to see if you typed anything first, before checking if the password is correct?


Well putting a ' after Dsz N fixes it
Sentaro21 Hors ligne Membre Points: 878 Défis: 0 Message

Citer : Posté le 08/09/2019 09:53 | #


Sorry,
The main memory bug has not been resolved yet.
Please make frequent backups until the bug is fixed.
The problem of Dsz is dealt with by making it an error.

Here is new update version.

2.27 beta for Graph 35+USB/35+EII/75/85/95 (SD)
https://pm.matrix.jp/CB/CBASIC227beta.zip
-Fixed the bug that key input is hung-up in fx-Manager PLUS Subscription for Graph 35+E II.
-Fixed ? command bug with option that noto return inut value.
(example)?(16,4,4,"_",4)->A
-Changed the specification of Next/WhileEnd/LpWhile following Isz/Dsz to "Not Support Error".
Je continue à développer C.Basic. (Il est compatible avec Basic Casio.)
Overclocking utilitaire Ftune/Ptune2/Ptune3 est également disponible.
Si vous avez des questions ou un rapport de bogue, n'hésitez pas à me le faire savoir.
Redcmd Hors ligne Membre Points: 380 Défis: 7 Message

Citer : Posté le 08/09/2019 10:54 | #


What happens if Dsz is before a Next, but it never reaches 0?
No errors should occur

"Error: No Support"?
Sentaro21 Hors ligne Membre Points: 878 Défis: 0 Message

Citer : Posté le 08/09/2019 11:54 | #


If Dsz/Isz does not reach 0, it is no error.
When Dsz/Isz reaches 0, the error occurs if the next command is IfEnd/Next/WhileEnd/LpWhile.

Because this Basic Casio specification is possible only by interpreter,
Since it cannot be used as a specification in future compiler versions, it was decided that it was an error.
Je continue à développer C.Basic. (Il est compatible avec Basic Casio.)
Overclocking utilitaire Ftune/Ptune2/Ptune3 est également disponible.
Si vous avez des questions ou un rapport de bogue, n'hésitez pas à me le faire savoir.
Critor Hors ligne Administrateur Points: 2670 Défis: 18 Message

Citer : Posté le 08/09/2019 12:08 | #


I've just posted some comprehensive benchmarks with and without C.Basic and/or Ftune/Ptune.
https://tiplanet.org/forum/viewtopic.php?t=22948&p=245063#p245063

4 tests :
- float test in Basic (numeric context)
- float test in Basic (exact context)
- float test in Python
- integer test in Python

C.Basic is very impressive, and even more with Ftune/Ptune !
Sentaro21 Hors ligne Membre Points: 878 Défis: 0 Message

Citer : Posté le 08/09/2019 12:42 | #


Oh! it is very interesting!!
Thanks very much!!

Unfortunately,
I can't see it now during maintenance, so I'll see later.

Ajouté le 08/09/2019 à 12:55 :
I'm sorry, I could see it after logging in.

Ajouté le 08/09/2019 à 14:43 :
Dsz N: Next

N-1-> N: N = 0 => Break

I tried to deal with by replacing.

2.27 beta for Graph 35+USB/35+EII/75/85/95 (SD) (re-upload)
https://pm.matrix.jp/CB/CBASIC227beta.zip
-Fixed incompatibility of Next/WhileEnd/LpWhile following Isz/Dsz.
Je continue à développer C.Basic. (Il est compatible avec Basic Casio.)
Overclocking utilitaire Ftune/Ptune2/Ptune3 est également disponible.
Si vous avez des questions ou un rapport de bogue, n'hésitez pas à me le faire savoir.
Redcmd Hors ligne Membre Points: 380 Défis: 7 Message

Citer : Posté le 09/09/2019 02:51 | #


I made two programs with the names "." and ".."
In the program menu the "." is shown above ".." (normal basic)
While in C.Basic its the other way around
[Main Menu]     29550  (2)
..               :      32
.                :      32



I was able to reproduce the full memory error
Create a program with an exact multiple of 4 bytes
e.g 36, 40, 44, 120, 124 etc
so if you did remove one character, the byte count would decrease (dont decrease it)
so a simple program could be
99
the size is 36 bytes
(removing one of the 9's, would bring the byte count down to 32)

Exit the program and go to C.Basic (you can make the program in C.basic)
press [F2] to edit the program again
delete one of the 9's then replace it
the byte count must stay the same (36 bytes)
press [EXIT], [EXE] and [F1] to save
go to normal basic
press [F2] to edit
press [DEL] to cause the Full Memory error

you will also notice two double quotes at the end of the code
99""
and a password will be set on the program below
password is double quotes ""


The program list doesn't show if a program has a password on it or not
You can't type certain symbols into the pasword field
' " ~ + - x / [SPACE]
So if a program had the password " (double quotes), you wouldn't be able to access it
Sentaro21 Hors ligne Membre Points: 878 Défis: 0 Message

Citer : Posté le 09/09/2019 10:29 | #


Thanks!
I tried to create a 32-byte file after erasing all the programs in the main memory, but I could not reproduce full memory error.
Are there any more tips to reproduce reliably?
Je continue à développer C.Basic. (Il est compatible avec Basic Casio.)
Overclocking utilitaire Ftune/Ptune2/Ptune3 est également disponible.
Si vous avez des questions ou un rapport de bogue, n'hésitez pas à me le faire savoir.
Redcmd Hors ligne Membre Points: 380 Défis: 7 Message

Citer : Posté le 09/09/2019 10:42 | #


a default blank 32 byte program is not 32 bytes
32 bytes is the rounded value
rounded from 30 bytes (or 34 bytes, depending on the direction of rounding)
if you removed 2 bytes from the program, it would work, but theres nothing to remove, because theres no code to remove it from
you have to have a 36byte file, which removing one character would lead it to round down to 32 bytes
creating a blank program and putting two 1 bytes characters into it. Like "99"
will bring the byte count up 36

make a 36byte program
I wasn't clear enough about it being 36 bytes
(well... a multiple of 4 bytes)
I never had to run the code

The problem is when C.Basic saves the file
the memory table casio uses and what C.Basic uses, is off by 4 bytes
so when its rounded to a multiple of 4 bytes. +1 or -1 bytes needs to be added or removed before rounding OR +4 or -4 after rounding
(I think, havn't looked at the C code for C.Basic)
C.Basic seems a bit more flexable and is able to read/write to the file fine
but normal basic is not

Sentaro21 Hors ligne Membre Points: 878 Défis: 0 Message

Citer : Posté le 09/09/2019 10:58 | # | Fichier joint


Ok!
I haven't reproduced it yet, but I modified C.Basic a little.
Is there a change in the error situation?

[Fichier joint] CBASIC228test.zip
Je continue à développer C.Basic. (Il est compatible avec Basic Casio.)
Overclocking utilitaire Ftune/Ptune2/Ptune3 est également disponible.
Si vous avez des questions ou un rapport de bogue, n'hésitez pas à me le faire savoir.
Redcmd Hors ligne Membre Points: 380 Défis: 7 Message

Citer : Posté le 09/09/2019 11:04 | #


Still memory full error
Sentaro21 Hors ligne Membre Points: 878 Défis: 0 Message

Citer : Posté le 09/09/2019 11:27 | #


OK!
Is there any way to avoid memory full errors?
Je continue à développer C.Basic. (Il est compatible avec Basic Casio.)
Overclocking utilitaire Ftune/Ptune2/Ptune3 est également disponible.
Si vous avez des questions ou un rapport de bogue, n'hésitez pas à me le faire savoir.
Précédente 1, 2, 3 ··· 10 ··· 12, 13, 14, 15, 16, 17, 18 ··· 20 ··· 30, 31, 32 Suivante

LienAjouter une imageAjouter une vidéoAjouter un lien vers un profilAjouter du codeCiterAjouter un spoiler(texte affichable/masquable par un clic)Ajouter une barre de progressionItaliqueGrasSoulignéAfficher du texte barréCentréJustifiéPlus petitPlus grandPlus de smileys !
Cliquez pour épingler Cliquez pour détacher Cliquez pour fermer
Alignement de l'image: Redimensionnement de l'image (en pixel):
Afficher la liste des membres
:bow: :cool: :good: :love: ^^
:omg: :fusil: :aie: :argh: :mdr:
:boulet2: :thx: :champ: :whistle: :bounce:
valider
 :)  ;)  :D  :p
 :lol:  8)  :(  :@
 0_0  :oops:  :grr:  :E
 :O  :sry:  :mmm:  :waza:
 :'(  :here:  ^^  >:)

Σ π θ ± α β γ δ Δ σ λ
Veuillez donner la réponse en chiffre
Vous devez activer le Javascript dans votre navigateur pour pouvoir valider ce formulaire.

Si vous n'avez pas volontairement désactivé cette fonctionnalité de votre navigateur, il s'agit probablement d'un bug : contactez l'équipe de Planète Casio.

Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2024 | Il y a 117 connectés | Nous contacter | Qui sommes-nous ? | Licences et remerciements

Planète Casio est un site communautaire non affilié à Casio. Toute reproduction de Planète Casio, même partielle, est interdite.
Les programmes et autres publications présentes sur Planète Casio restent la propriété de leurs auteurs et peuvent être soumis à des licences ou copyrights.
CASIO est une marque déposée par CASIO Computer Co., Ltd