Register

Need some newbie help please

Discuss issues related to the fx-9860G Software Development Kit
Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Re: Need some newbie help please

Postby SimonLothar » Thu Jul 11, 2013 3:26 pm

Did you include bitmaps.cpp in the project's file list? Then try to delete the include-statement. Or delete bitmaps.cpp from the project's file list. Highlander - There can be only one!
I'll be back!

Member
User avatar
Posts: 44
Joined: Tue Jul 02, 2013 11:57 am
Location: London
Calculators: Casio fx-7400G, Casio fx-7400G PLUS, Casio fx-7400GII, Casio fx-9750G, Casio fx-9750G PLUS, Casio fx-9860GII

Re: Need some newbie help please

Postby MrMagoo » Fri Jul 12, 2013 9:06 am

Ok, got rid of that error, but now getting this one.

E:\Casio\Projects\Inputs\Main.cpp(21) : C5020 (E) Identifier "iconlist" is undefined
E:\Casio\Projects\Inputs\Main.cpp(17) : C5550 (W) Variable "editresult" was set but never used
"The trouble with internet quotations, is that the majority are totally made up." - Abraham Lincoln 1863

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Re: Need some newbie help please

Postby SimonLothar » Fri Jul 12, 2013 12:33 pm

MrMagoo wrote:E:\Casio\Projects\Inputs\Main.cpp(21) : C5020 (E) Identifier "iconlist" is undefined
Remove bitmaps.cpp from the project's file list, rename it to bitmaps.hpp and include it at the beginning of the main-file, t. i. before Addin_main.
MrMagoo wrote:E:\Casio\Projects\Inputs\Main.cpp(17) : C5550 (W) Variable "editresult" was set but never used
This is only a warning. If you assign a value to a variable and you do not use this variable, the C++ compiler assumes, that you forgot something and hence warns you.
I'll be back!

Member
User avatar
Posts: 44
Joined: Tue Jul 02, 2013 11:57 am
Location: London
Calculators: Casio fx-7400G, Casio fx-7400G PLUS, Casio fx-7400GII, Casio fx-9750G, Casio fx-9750G PLUS, Casio fx-9860GII

Re: Need some newbie help please

Postby MrMagoo » Fri Jul 12, 2013 1:36 pm

:-) Love it!

I have created my own bitmaps too!

Two more questions, how do i set the menu grid size? so maybe 4x3?
how do I process the result of the item selected? I tried printing editresult, but it was the wrong variable type, and I tried using;

Code: Select all
sprintf( (char*)out_buffer, "%f", editresult );   // convert the processing result back to a presentable string


but just got zero
"The trouble with internet quotations, is that the majority are totally made up." - Abraham Lincoln 1863

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Re: Need some newbie help please

Postby SimonLothar » Fri Jul 12, 2013 6:15 pm

MrMagoo wrote:Love it!
That lightens my heart.
MrMagoo wrote:Two more questions, how do i set the menu grid size? so maybe 4x3?
At present this is fixed and cannot be parameterized. I intended to do some enhanced version of graphicMenu with variable icon sizes this weekend...provided the weather does not redirect me to some beer garden.
MrMagoo wrote:how do I process the result of the item selected? I tried printing editresult, but it was the wrong variable type, and I tried using;
Code: Select all
sprintf( (char*)out_buffer, "%f", editresult );   // convert the processing result back to a presentable string

but just got zero
We cannot blame the compiler for that. "%f" is for doubles. editresult is int. int needs "%d" as formatstring.
Best refer to page 358..363 of "SHC Manual.PDF". There all secrets become reveiled.
I'll be back!

Member
User avatar
Posts: 44
Joined: Tue Jul 02, 2013 11:57 am
Location: London
Calculators: Casio fx-7400G, Casio fx-7400G PLUS, Casio fx-7400GII, Casio fx-9750G, Casio fx-9750G PLUS, Casio fx-9860GII

Re: Need some newbie help please

Postby MrMagoo » Fri Jul 12, 2013 7:13 pm

SimonLothar wrote:At present this is fixed and cannot be parameterized. I intended to do some enhanced version of graphicMenu with variable icon sizes this weekend...provided the weather does not redirect me to some beer garden..


Ha Ha Ha, I dont blame you.
Would a work-around be to restrict the movement? So only the first 12 are accessible?
"The trouble with internet quotations, is that the majority are totally made up." - Abraham Lincoln 1863

Member
User avatar
Posts: 44
Joined: Tue Jul 02, 2013 11:57 am
Location: London
Calculators: Casio fx-7400G, Casio fx-7400G PLUS, Casio fx-7400GII, Casio fx-9750G, Casio fx-9750G PLUS, Casio fx-9860GII

Re: Need some newbie help please

Postby MrMagoo » Fri Jul 12, 2013 7:15 pm

Yes! you can. I changed the 4 to 3 in the up and down getkey cases.

Boom! It's done
"The trouble with internet quotations, is that the majority are totally made up." - Abraham Lincoln 1863

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Re: Need some newbie help please

Postby SimonLothar » Fri Jul 12, 2013 7:33 pm

MrMagoo wrote:Would a work-around be to restrict the movement? So only the first 12 are accessible?

change
Code: Select all
const unsigned char* iconlist[] = { ICON1, ICON2, ICON3, ICON4,
                           ICON5, ICON1, ICON2, ICON3,
                           ICON4, ICON5, ICON1, ICON2,
                           ICON3, ICON4, ICON5, ICON1,
                           ICON5,
                           0 };   // do not forget the terminating zero!
to
Code: Select all
const unsigned char* iconlist[] = { ICON1, ICON2, ICON3, ICON4,
                           ICON5, ICON1, ICON2, ICON3,
                           ICON4, ICON5, ICON1, ICON2,
                           0 };   // do not forget the terminating zero!
I'll be back!

Member
User avatar
Posts: 44
Joined: Tue Jul 02, 2013 11:57 am
Location: London
Calculators: Casio fx-7400G, Casio fx-7400G PLUS, Casio fx-7400GII, Casio fx-9750G, Casio fx-9750G PLUS, Casio fx-9860GII

Re: Need some newbie help please

Postby MrMagoo » Mon Jul 15, 2013 8:04 am

Ok this is awesome, got it working perfectly :-)

Next question, how do I display a bitmap in a given position, at a given size?
Does the width of the bmp file still have to be a multiple of 8?

Also, in my old casio basic programs I used the matrix to store and retrieve data, can this be done with SDK? or can I store data someehere more secure?

Thanks!
"The trouble with internet quotations, is that the majority are totally made up." - Abraham Lincoln 1863

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Re: Need some newbie help please

Postby SimonLothar » Mon Jul 15, 2013 10:29 am

MrMagoo wrote:got it working perfectly
fine
MrMagoo wrote:...how do I display a bitmap in a given position, at a given size?
Does the width of the bmp file still have to be a multiple of 8?
In the definition of a bitmap the width has always to be a multiple of 8.
Code: Select all
const unsigned char ICON1[]={
0xFF,0xFF,0xFF,0xFC,
0x80,0,0,0x04,
0x80,0,0,0x04,
...
0 };
But the displaying function Bdisp_WriteGraph_VRAM clips unneeded bits, if you pass a smaller width or height:
Code: Select all
DISPGRAPH dg;

  dg.x = 10;  // 0..127
  dg.y = 20;  // 0..63
  dg.GraphData.width = 30;
  dg.GraphData.height = 18;
  dg.GraphData.pBitmap = (unsigned char*)ICON1;
  dg.WriteModify = IMB_WRITEMODIFY_NORMAL;
  Bdisp_WriteGraph_VRAM( &dg );


MrMagoo wrote:Also, in my old casio basic programs I used the matrix to store and retrieve data, can this be done with SDK? or can I store data someehere more secure?
It is possible to access a built-in matrix from out of an add-in.
But as you said, it would not be secure, because the built-in matrix could be changed by the built-in MAIN MENU functions, as well.

To save data from out of an add-in, there are two basic options.

You could use the main memory:
Advantage: fast, no optimization necessary.
Disadvantage: limited space; looses all changes since the last proper "switch off", if the calculator is not shut down properly, f. i. by a reset. Take care: some games do a reset indeed!

You could use the storage memory:
Advantage: a lot of space (if it isn't crammed with games); data are immediately saved.
Disadvantage: if used heavily with deleting, creating and writing, some day optimization will be necessary.

If you need a real big dump (up to 2 GB), a SD card would be an option with some models. But it is rather slow.
I'll be back!

PreviousNext

Return to Casio fx-9860 SDK

Who is online

Users browsing this forum: No registered users and 28 guests