CodeWalrus

Development => Calculators => Calc Projects, Programming & Tutorials => Topic started by: Cakeisalie5 on March 15, 2017, 12:34:52 PM

Title: The P7 project: free your CASIO calculator!
Post by: Cakeisalie5 on March 15, 2017, 12:34:52 PM
Hi! I've been developing this project for a while, but Critor (https://codewalr.us/index.php?action=profile;u=49) suggested me to make a topic here about it, and I saw a few reactions that made me thought a little CASIO on this forum wouldn't hurt too much :P

The origin of the name is "Protocol 7", as it's the name Simon Lothar (the one and only) gave to the proprietary protocol CASIO used on the fx-9860G and upper, and is still using on Prizm & the fx-CG50 (or Graph 90+E) for screenstreaming and OS updating.

Before I started the project, there were already a few projects, but none satisfied me: xfer9860 (http://freecode.com/projects/xfer9860) by Andreas Bertheussen, which only managed the fx-9860G by hardcoding its model ID (for what I've understood), and UsbConnector (http://www.planet-casio.com/Fr/forums/topic13656-1-UsbConnector,(Remplacement,pour,FA124,multi,os).html) by Nessotrin (an occasional member of Planète Casio), which I didn't like the project organization (also, C++, yuk).

So I started the P7 project in August 2016, which at the time was only made of a library, called libp7, and a transfer utility, p7. The first version was published a week later, even though it couldn't do a lot (I have lost part of the commit history because of the reunion of the utilities under a `p7utils` repository, but I think I could only send and request a file on the storage memory, which was already great for the time). In september (https://frama.link/september), I added a new utility, p7screen, which could display a streamed screen for your fx-9860G! I also made, in january 2017, a little Python 3.x module, pyp7 (https://github.com/cakeisalie5/pyp7), which uses libp7, and Intelligide (another member from Planète Casio) started a GUI project using C++ and Qt, p7gui (https://github.com/intelligide/p7gui). Also, but that's a little under the hood project, I'm making p7os, which will be able to backup and, maybe later, install a new OS on your fx-9860G calculator. :)

Aside from the P7 project, I'm making projects which will later be merged to it, although this is unofficial for now: libg1m (https://github.com/cakeisalie5/libg1m) (for manipulating files under CASIO format), and libfontcharacter (https://github.com/cakeisalie5/libfontcharacter) (a library for managing CASIO's encoding and tokens), based on the FONTCHARACTER reference (https://github.com/cakeisalie5/fontcharacter_reference), a reference of all existing characters, with Unicode equivalents, known tokens, ...

Today, the released version of p7utils/libp7 (3.0) cannot, to me, do a lot today, although it makes what wasn't so basic to now something easily accessible. But there's still a lot to do, which will probably be done for the 4.0 release:
- include usage of libg1m in libp7, in order to manage MCS transactions;
- manage the old CAS protocol(s), so libp7 allow you to interact with your Graph 100 or any old calculator;
- integrate file encoding using libg1m (which can only decode for now), for saving your backups in the G1M/G2M/G1R/G2R format;
- manage the fx-CG*0 screenstreaming formats (Projector mode is already supported (https://twitter.com/thecakefive/status/840316647000936448) in the indev version);
- manage CASIO's SB-88[A] cables (libp7 only manages active serial cable for now, such as the PC/CASIO USB cable sold by Util Pocket (http://util-pocket.biz) in France);
- plenty of other awesome stuff! :)

The official website of the P7 project is right here (thanks to Planète Casio for hosting it):
https://p7.planet-casio.com/en.html (https://p7.planet-casio.com/en.html)

Any suggestions or complaint? Don't hesitate, answer to this topic! :P
(also, thanks p4nix, the website couldn't allow me to answer your private message :D)
Title: Re: The P7 project: free your CASIO calculator!
Post by: Dream of Omnimaga on March 15, 2017, 04:43:00 PM
That seems pretty interesting. About the screen streaming, does it mean a PC software could capture animated GIF/AVI screenshots even when a C/ASM/BASIC game is running?
Title: Re: The P7 project: free your CASIO calculator!
Post by: Cakeisalie5 on March 15, 2017, 04:55:58 PM
I don't know how it's made on the Prizm, but on the fx-9860G, it depends on if the game/application uses the system functions to update the screen or not (as when the screenstreaming is on, it is those system functions who are in charge of sending the screen content). If it is the case, then yes, it's possible (although p7screen is only a PoC/test application and cannot do this, you'll have to code your own application using libp7 and p7_getscreen). ^^
Title: Re: The P7 project: free your CASIO calculator!
Post by: p4nix on March 15, 2017, 05:15:07 PM
Do you know if there is a way to include the functions sending the pictures to the computer to monochrome lib?
Also, try to encourage other planet-casio.com members to crosspost their projects here  :thumbsup:

Also, can you already send multiple files at once, apart from using a script and not stopping the transfer on the calc? I'm not quite up to date atm :p
Title: Re: The P7 project: free your CASIO calculator!
Post by: Dream of Omnimaga on March 15, 2017, 10:10:12 PM
Quote from: p4nix on March 15, 2017, 05:15:07 PM
Also, try to encourage other planet-casio.com members to crosspost their projects here  :thumbsup:
I think with France in particular, the language barrier is a serious problem (even more than with countries that don't use alphabet for their language, such as China or Japan). The public education system in France is not as serious as elsewhere regarding English learning (in Quebec, learning English is mandatory starting in grade 4). However, CodeWalrus allows users to post in French, German, Dutch and Hebrew if they want to, as long as they put the language inside the topic title (eg [Fr] or [De]). Kinda like how TI-Planet allows users to post in English and I think Portuguese or Spanish.
Title: Re: The P7 project: free your CASIO calculator!
Post by: Cakeisalie5 on March 15, 2017, 10:24:33 PM
Quote from: p4nixDo you know if there is a way to include the functions sending the pictures to the computer to monochrome lib?
I don't think there's a specific syscall for this, I'll ask Simon Lothar, but don't expect much. x)

Quote from: p4nixAlso, can you already send multiple files at once, apart from using a script and not stopping the transfer on the calc? I'm not quite up to date atm :p
Of course, using the --no-init and --no-exit options! So all of the calls to p7 except the last one will need the --no-exit option, and all calls except the first one will need the --no-init option. The command itself don't support sending multiple files at once, but you can still make a simple bash script given what I told above ;)

Quote from: p4nixAlso, try to encourage other planet-casio.com members to crosspost their projects here  :thumbsup:
Quote from: DJ OmnimagaThe public education system in France is not as serious as elsewhere regarding English learning (in Quebec, learning English is mandatory starting in grade 4).
Actually, English is mandatory also in France, and even if most french people aren't almost native speakers, people that do the most on Planète Casio have a good level of English as it's the dominant language in computer science and stuff. The main barrier is that it can be tiring to be in several communities simultaneously. But as I'm trying to gather as much information as I can as I need them for my projects (libp7, libg1m, FONTCHARACTER reference, ...), and information is everywhere, I need to go everywhere to get them. :p

Also, we're quite few at Planète Casio, and even less are really working on CASIO-related projects. Apart from the P7 project, the gint project (+fxsdk), we don't have much. But I'll see what I can do and if some members are interested :)
Title: Re: The P7 project: free your CASIO calculator!
Post by: Dream of Omnimaga on April 06, 2017, 05:23:32 AM
Ah ok about English, I just noticed that on most forums I've been to, the proportion of people who have serious troubles writing English sentences is much higher than people from other countries. I sadly can't help on this project since I only do BASIC/TI-BASIC and such languages, though.
Title: Re: The P7 project: free your CASIO calculator!
Post by: Hayleia on April 06, 2017, 08:46:02 AM
Quote from: Cakeisalie5 on March 15, 2017, 10:24:33 PM
Actually, English is mandatory also in France, and even if most french people aren't almost native speakers, people that do the most on Planète Casio have a good level of English as it's the dominant language in computer science and stuff. The main barrier is that it can be tiring to be in several communities simultaneously. But as I'm trying to gather as much information as I can as I need them for my projects (libp7, libg1m, FONTCHARACTER reference, ...), and information is everywhere, I need to go everywhere to get them. :p
Quote from: DJ Omnimaga on April 06, 2017, 05:23:32 AM
Ah ok about English, I just noticed that on most forums I've been to, the proportion of people who have serious troubles writing English sentences is much higher than people from other countries. I sadly can't help on this project since I only do BASIC/TI-BASIC and such languages, though.
I kind of agree with both of these. I mean, I had a shortcut to say "Lol French" in MH4U each time I see a French person speaking frenglish, that's for a reason... Not sure what causes French people to be worse at English than people from other countries but they are. And they are recognizable too. And they're bad at MH4U too -.-
...Which doesn't prevent people from PC to be quite good at it. I'm only talking about the masses which we can meet while playing videogames or browsing random forums but not on a forum about programming on calculators. The masses don't code and don't care about calculators. People from PC (or CW, etc) on the other hand care about coding, do it in English of course, read stuff in English to progress, etc, unlike a lot of people I see who are like "meh, I can't learn that, I only found English tutorials and nothing in French" -.-
Title: Re: The P7 project: free your CASIO calculator!
Post by: Cakeisalie5 on April 06, 2017, 11:51:12 PM
Quote from: DJ OmnimagaAh ok about English, I just noticed that on most forums I've been to, the proportion of people who have serious troubles writing English sentences is much higher than people from other countries.
That's what most of the people think, yeah (it's even in What The f*** France :p). I hope it's not true. But that's not the topic to discuss about that ;)

I told the gint project leader a while ago, he seemed interested and, by the look of it, he created an account and stuff so there will probably be a gint project topic here some day (he'll be passing important tests during the month/two months if I'm not mistaken, he'll probably do that after).

And in order to unfocus more, sorry for not giving as many news about this project as on Planète Casio. The 4.0 release is still far away, but on the right tracks. I've implemented Prizm screenstreaming and corrected serial management for Linux, it now works with Util-Pocket cable (same as usual self assembled cables, sort of?) and the SB-88A Critor lent me.

What I'll be working on next is the introduction in libp7 of the legacy protocols (CFX-9700G, CFX-9850G, AlgebraFX), the correction of the serial stream on Microsoft Windows (probably followed by the USB correction for Microsoft Windows), SCSI implementation (required for the Prizm color screenstreaming, more info here in french, sorry about that), MCS full interactions (which still requires a lot of work on libg1m, although a lot of it has already be done), libfontcharacter maturation, and other minor stuff, such as settings management. Not in that order, Microsoft Windows thingies will probably be one of the last things I'll do because the Windows API and the CESG502 driver are a real pain to work with. Sorry for being slow at doing things, but I'm really trying to make things clean so that no one has to make an equivalent to my projects later :)
Title: Re: The P7 project: free your CASIO calculator!
Post by: Dream of Omnimaga on April 07, 2017, 04:23:38 PM
It's ok. It's better to take your time and not rush things with bugs.

Also I'm glad that CFX-9850G support is being considered :)
Title: Re: The P7 project: free your CASIO calculator!
Post by: Cakeisalie5 on April 07, 2017, 04:51:57 PM
Actually, it is not only considered. I've been working on regrouping documentation about it for a while now, it's just tricky to make a good integration of it in libp7. Here are the headers documenting it, for machines and humans, in case you're curious :)

libg1m/format.h (https://github.com/cakeisalie5/libg1m/blob/master/include/libg1m/format.h#L27) - libg1m/format/cas.h (https://github.com/cakeisalie5/libg1m/blob/master/include/libg1m/format/cas.h) - libg1m/format/cas/ (https://github.com/cakeisalie5/libg1m/tree/master/include/libg1m/format/cas) - libp7/protocol/legacy.h (https://github.com/cakeisalie5/libp7/blob/master/include/libp7/protocol/legacy.h)
Title: Re: The P7 project: free your CASIO calculator!
Post by: Dream of Omnimaga on April 17, 2017, 03:01:09 AM
That's awesome. My main issue with the 9850G right now is the cable my calc came with is some weird 2.5 mm plug with an USB one on the other end. I don't even know if the cable is legit or fake, because on XP and Windows 7 I never got able to get my calc detected in FA-123 nor 124. Thanks for your hard work by the way