Register

mylib v0.45

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: mylib v0.4

Postby SimonLothar » Sat Mar 02, 2013 9:51 am

hayzel wrote:Great!
But why you search with a "while" the MOV.L @(disp,PC),Rn, isn't it constant position, or changes with versions?
It changed position with OS 2.02.
I'll be back!

Member
Posts: 43
Joined: Thu May 31, 2012 5:45 pm
Location: Greece
Calculators: Casio fx-9860G SD

Re: mylib v0.42

Postby hayzel » Sat Mar 02, 2013 8:14 pm

A new version in downloads section.
The zip file contains a complete project for casio 9860 sdk, to test mylib abilities.
http://www.casiopeia.net/forum/downloads.php?view=detail&df_id=86

Changes in v0.42:
-removed temporary the GetFreeMemory for further inquiry of its usage.
-all functions of structs String,StringList,Dialog,Matrix,DialogItem ... are 1based now for simplicity
- fixes in drawing on some of the items of Dialog
-update on string* functions. new stringFill and stringRemoveAt functions.
- all functions except stringSprintf use dynamic Strings now. More slow but more easy to program. stringSprintf buf[] size can be set at compile time with STRING_SPRINTF_SIZE #define
- fixes in isNumberKey and is AlphaKey
- rewrite of strInput to use dynamic strings and rename it to stringInput. The stringInput can now use arrow keys, and store bigger strings than its size.
- Removed all str* 0based pure c functions.
-added HEX number view to DEBUGNUM
-added #define MYLIB_DEBUG to disable ASSERT,DEBUGNUM,DEBUGSTR at compile time.

Senior Member
User avatar
Posts: 113
Joined: Sun Dec 16, 2012 2:59 pm
Calculators: None

Re: mylib v0.4

Postby Casimo » Sat Apr 20, 2013 10:46 am

I totally forgot to test your library 0.42, sorry.
Everything is compatible until
Code: Select all
w1=execMenu("Alph|Abc|Def|Ghi|ijklmno,Numb|one|two|three,Text|text1|text2,,,Done");
, it draws everything correctly but hangs then. It is not possible to open something or continue.
Image

Member
Posts: 43
Joined: Thu May 31, 2012 5:45 pm
Location: Greece
Calculators: Casio fx-9860G SD

Re: mylib v0.4

Postby hayzel » Sat Apr 20, 2013 11:11 am

1. It hangs only on the new casios?
2. It works on the emulator, (casio sdk emulator) ?
3. It hangs after drawing the menu or before?

Senior Member
User avatar
Posts: 113
Joined: Sun Dec 16, 2012 2:59 pm
Calculators: None

Re: mylib v0.4

Postby Casimo » Sun Apr 21, 2013 7:22 am

Calculator: fx 9860 G2-2
Tested in emulator or calculator: no
When does it hang: after drawing the menu
Image

Member
Posts: 43
Joined: Thu May 31, 2012 5:45 pm
Location: Greece
Calculators: Casio fx-9860G SD

Re: mylib v0.4

Postby hayzel » Sun Apr 21, 2013 8:51 am

It shows up :
Alph Numb Text <space> <space> Done
And it just hangs?
When you press a key (F1-F6 Esc, Exe) does it seem to redraw ?
It doesn't crash , right?

Senior Member
User avatar
Posts: 113
Joined: Sun Dec 16, 2012 2:59 pm
Calculators: None

Re: mylib v0.4

Postby Casimo » Mon Apr 22, 2013 2:18 pm

Everything is drawn correctly, I can see the menu, it looks very natural btw.
If I press a key, nothing will happen - even no changes in the menu. I can just see the "top menu" and nothing else.

So, you are right, there is
Alph Numb Text Done

But if I try to press F1 - F6, EXE, ACon or any other key, nothing happens.
There is no system error.
Image

Member
Posts: 43
Joined: Thu May 31, 2012 5:45 pm
Location: Greece
Calculators: Casio fx-9860G SD

Re: mylib v0.4

Postby hayzel » Mon Apr 22, 2013 6:24 pm

I made a special version of the lib, with a debug message box appearing each time you press a key on your calc, in a dialog.

1. Download the special file at http://koppermind.homelinux.org/files/mylibt_test.zip

2. Try it on your calc.

3. It's a bit annoying but each time you press a key, I message box will popup , with the key code pressed.

4. Try to reach the menu. And press, F1-F2.... and Exe and give me here the key code values you get.


Thanks for your time.

Senior Member
User avatar
Posts: 113
Joined: Sun Dec 16, 2012 2:59 pm
Calculators: None

Re: mylib v0.4

Postby Casimo » Tue Apr 23, 2013 3:28 pm

Ok... After I tried keys like up, down etc. in the menu where it doesn't work (I got the normal GetKey return values), I tried pressing F1 - F6 and the calculator freezed (no window popped up even if I pressed any other key).

Edit:
Here it freezes somewhere.
Code: Select all
int execMenu(const char* items)
{
  struct Dialog* dlg;
  struct DialogItem* item;
  int r;
  dlg=dialogInit();
  item=dialogItemInit();
  dialogItemSetMenu(item,items);
  dialogAppend(dlg,item);
  dialogExec(dlg,"",0);
  r=dlg->retSubcode;
  dialogItemFree(item);
  dialogFree(dlg);
  return r;
}


I guess it is in dialogExec;
Code: Select all
else if(key>=KEY_CTRL_F1 && key<=KEY_CTRL_F6)
      {
         w2=key-KEY_CTRL_F1+1;
         if(hasMenu==1 && MenuOption[w2-1]==1)
         {
           stringListItem(menu->text,',',w2,s);//the menu
           w5=stringListCount(s,'|')-1;//num of submenus
           if(w5>0)//has submenus
           {
             w3=stringIdx(s,'|',1);
             stringMid(s,w3+1,stringLength(s),s1);//the submenus in s1
             w4=execMenuPopup(s1,w2);
             if(w4>0)
             {
               SetScreen(Scr1);
               free(Scr1);
               stringFree(s);
               stringFree(s1);
               dlg->retCode=100;
               dlg->retSubcode=w2*100+w4;
               return;
             };
           }else
           {
             SetScreen(Scr1);
             free(Scr1);
             stringFree(s);
             stringFree(s1);
             dlg->retCode=100;
             dlg->retSubcode=w2*100;
             return;
           }
         };//F1-F6 selected
Image

Member
Posts: 43
Joined: Thu May 31, 2012 5:45 pm
Location: Greece
Calculators: Casio fx-9860G SD

Re: mylib v0.4

Postby hayzel » Tue Apr 23, 2013 5:06 pm

It should be something very stupid with the code.
Sadly the code works both on casio 9860sdk and my old casio 9860, so I cannot figure out what it is....

The thing is that you say, that the program does not respond after you press F1-F6 anymore, and you don't get a keycode even for the
first time you press F1-F6 , which is very odd, because even the code falls let's say in an infinite loop , it should print the keycode the first time (debugnum is immediately after getkey)

PreviousNext

Return to Casio fx-9860 SDK

Who is online

Users browsing this forum: No registered users and 20 guests