Register

fx-CP400 .c2p image format

Discuss issues related to Calculator Hacking/Modding.
Member
Posts: 43
Joined: Wed Jul 24, 2013 3:33 am
Calculators: Casio fx-7400GII (SH4), Casio fx-9750 G II (SH4), Casio fx-9860 GII SD, Casio Classpad 330, Casio Classpad fx-cp400, Casio fx-CG 50

fx-CP400 .c2p image format

Postby critor » Sun Feb 23, 2014 5:52 pm

I'm trying to understand the new fx-CP400 .c2p image format, in order to develop an image converter.

Direct analysis of some clipart .c2p files available on http://www.charliewatson.com/casio/cpends.php seems to already exclude trivial formats like BMP RGB, since the geometry of the large solid color areas is not visible at all in a hexadecimal editor.

So the image data is at least compressed.
Casio reinventing the wheel seems unlikely to me, and I would think of a derivative of a common picture format, or data compression format.

Here is a very simple screen capture made with ScreenReceiver (320x528 pixels) capture :
Image

And now the .c2p file generated with the fx-CP400 StorePic instruction :
Image

Eventually, we'll certainly have to understand the header and footer, but for now I'd like to focus on the data area - so basically from 0xB0 to 0x15F.

I've already found what seems to be the dimensions of the image, 4 bytes starting at 0xC2 :
- 0x136 ( 310 )
- 0x191 ( 401 )

It would be here 310x401 - probably the StorePic instruction is removing borders and menu bars.

An idea about the format assuming that Casio uses some usual image or data compression format ?


Thank you .

Senior Member
User avatar
Posts: 603
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750 G II, Casio fx-9750 G II (SH4), Casio fx-9860G, Casio fx-9860 G SD, Casio fx-9860G Slim, Casio fx-9860 GII SD, Casio fx-9860 GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG 20, Casio Classpad fx-cp400, Casio fx-CG 50

Re: fx-CP400 .c2p image format

Postby SimonLothar » Sun Feb 23, 2014 6:43 pm

Hi,

the format resembles the fx-CG G3P-Format. The G3P pictures are kind of zlib-compressed (as far as I remember developed by Mark Adler). There are fx-CG-syscalls, which do the inflate-/deflate-job, but I did not properly publish their interfaces. There have been certain concerns ([1] and [2]).
I'll be back!

Member
Posts: 43
Joined: Wed Jul 24, 2013 3:33 am
Calculators: Casio fx-7400GII (SH4), Casio fx-9750 G II (SH4), Casio fx-9860 GII SD, Casio Classpad 330, Casio Classpad fx-cp400, Casio fx-CG 50

Re: fx-CP400 .c2p image format

Postby critor » Sun Feb 23, 2014 10:30 pm

Thank you very much for the hint, SimonLothar.

And would you have the zlib data offsets so that I can try to inflate it?

Senior Member
User avatar
Posts: 603
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750 G II, Casio fx-9750 G II (SH4), Casio fx-9860G, Casio fx-9860 G SD, Casio fx-9860G Slim, Casio fx-9860 GII SD, Casio fx-9860 GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG 20, Casio Classpad fx-cp400, Casio fx-CG 50

Re: fx-CP400 .c2p image format

Postby SimonLothar » Tue Feb 25, 2014 8:30 am

First I want to cite correctly

"...version 1.2.3, July 18th, 2005
Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler..."

This refers to the essential algorithms used with G3P-files.

I'd suspect the the start of the compressed image at 0x00DC in the C2P-hexdump you posted (0x00D0 with G3P). But I did not verify it, yet.
Hint: Possibly the original deflate-/inflate-algorithms have been "specialized" by the calculator's manufacturer.
I'll be back!

Senior Member
Posts: 100
Joined: Sun Mar 24, 2013 12:01 pm
Calculators: None

Re: fx-CP400 .c2p image format

Postby TeamFX » Wed Feb 26, 2014 8:24 pm

The word at 0xDC (0xD0) is probably some kind of ID.
See: http://www.omnimaga.org/casio-prizm/hac ... halted%29/

It seems to encode the following information:
- type or version of the image format
- program or function used to create it
- Casio Provided or not

It is most likely required for the inflation process. So you cannot easily add the Casio Provided flag without recompressing the whole image.

Member
Posts: 43
Joined: Wed Jul 24, 2013 3:33 am
Calculators: Casio fx-7400GII (SH4), Casio fx-9750 G II (SH4), Casio fx-9860 GII SD, Casio Classpad 330, Casio Classpad fx-cp400, Casio fx-CG 50

Re: fx-CP400 .c2p image format

Postby critor » Thu Jul 31, 2014 2:49 am

Thank you everybody.

I'm now able to generate with my own code .c2p files accepted by the fx-CP400 ;)
(tested on both OS 1.00 and 2.00)

Image

I'm releasing the .c2p file format reference I've written and used.
http://tiplanet.org/forum/archives_voir.php?id=86868

Junior Member
Posts: 2
Joined: Tue Jan 14, 2014 2:21 pm
Calculators: Casio Classpad fx-cp400

Re: fx-CP400 .c2p image format

Postby cdi.comics » Fri Aug 08, 2014 10:44 am

how can I place pictures in classpad2? You could make a toturial or video on youtube.

Member
Posts: 43
Joined: Wed Jul 24, 2013 3:33 am
Calculators: Casio fx-7400GII (SH4), Casio fx-9750 G II (SH4), Casio fx-9860 GII SD, Casio Classpad 330, Casio Classpad fx-cp400, Casio fx-CG 50

Re: fx-CP400 .c2p image format

Postby critor » Fri Aug 22, 2014 11:47 am

For the moment, you've got a beta online generator:
http://tiplanet.org/forum/editgx.php?mode=44

The other way would be do download the above documentation and use a hex editor.

Junior Member
Posts: 8
Joined: Wed Dec 21, 2016 8:29 pm
Calculators: Casio Classpad fx-cp400

Re: fx-CP400 .c2p image format

Postby 1q2w3e4rr » Thu Dec 29, 2016 5:21 pm

hi thank u for what you have done :)

i have a problem! when i upload my picture and run the program the picture divide into pieces! how small the picture should be?

and i was searching for hours and i could't fine another program to do this! how someone crate such a format(c2p) and then leave it without no support!

Member
Posts: 43
Joined: Wed Jul 24, 2013 3:33 am
Calculators: Casio fx-7400GII (SH4), Casio fx-9750 G II (SH4), Casio fx-9860 GII SD, Casio Classpad 330, Casio Classpad fx-cp400, Casio fx-CG 50

Re: fx-CP400 .c2p image format

Postby critor » Mon Jan 02, 2017 8:02 pm

Hi and thanks for your post. :)

Unfortunately, I don't think the .c2p format readers embedded in the calculator can handle pictures larger than the screen.
Juste choose a smaller image size if you don't want to scroll, hoping that the text is going to remain readable.

There is an official image conversion tool, but Casio will only share it with teachers (I don't remember if they have to pay for it or not).
And anyway, it won't do better than the public online tool.

Return to Calculator Hacking/Modding Discussions

Who is online

Users browsing this forum: Google [Bot] and 3 guests