Register

mylib v0.45

Discuss issues related to the fx-9860G Software Development Kit
Member
Posts: 43
Joined: Thu May 31, 2012 5:45 pm
Location: Greece
Calculators: Casio fx-9860G SD

mylib v0.45

Postby hayzel » Sun Feb 17, 2013 8:43 pm

I am working on a new project (concrete sections analysis) for casio 9860 and made an update to the helper library I made for 9860sdk.
the download link is : http://www.casiopeia.net/forum/downloads.php?view=detail&df_id=86.
Most of the code is easy to use for any medium c programmer, though there are some usefull comments inside mylib.h
The new mylib, brings:
- some new functions (dynamic Strings,dynamic Dialogs, dynamic StringLists)
- a redesigned dialog system (supports refreshCallbacks for more dynamic dialogs)
- good placing of miniTexts with exact pixel width counting of texts.
- a menu system supporting second level pop up menus.
- some cleanup of the code.

Some things I like to add:
- a new cellEditor replacing the old and obsolete matrixEditor/matrixDisplay.
- some new controls . like for example spin button.
- a simple layout system. so you will not have to count all the time px dimensions for the DialogItems.

The mylib is a work in process. So I will update the link from time to time. I decided to upload it now, so anyone using it, or wants to use it, can give me feedback about bugs, suggestions or ideas.

mylib runs on casio 9860 sdk, and uses only one documented (thanks simon) direct syscall (0x0137) for counting the px width of mini glyphs.
I would like to know if it runs fine on all versions of 9860s.

Any comments are welcomed in this thread.
Last edited by hayzel on Fri May 17, 2013 2:23 pm, edited 1 time in total.

Senior Member
Posts: 369
Joined: Tue Jan 03, 2012 11:24 pm
Calculators: Casio Afx 1.0, Casio fx-9860GII SD, Casio Classpad 330, Casio fx-CG20, Casio Classpad fx-CP400

Re: mylib v0.4

Postby helder7 » Wed Feb 20, 2013 8:52 pm

Nice to see an update!

I took a quick look at the lib and new string manipulating functions are nice.

hayzel wrote:I would like to know if it runs fine on all versions of 9860s.

Someone with Power Graphic 2 model can test it?
SiO2 + CaCO3 ----------> CaSiO3 + CO2

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

Re: mylib v0.4

Postby Casimo » Thu Feb 21, 2013 6:51 am

The old version worked and if you don't use IsKey... everything should be ok. I'll test it.
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 Feb 23, 2013 10:21 am

New file uploaded mylib v.0.41

changes:
- Cleanup/fix some things in dynamic Strings
- Try no to use buf[] of chars in code, so to minimize unsafe operations. Uses now String (maybe more slow, but I don't care).
- Put more ASSERTs on code for boundary checking of bufs[]
- fixed DEBUGNUM macro (didn't display floats)
- drawLine,drawRect, now can use line patterns
- new and revisited view* functions:
. draw Lines,Rects,Points, FillAreas in real coordinates.
. convert between real and screen coordinates
. scale view around an origin.
. draw arrows
. line patterns work here too.
. viewPrintMini can ALIGN text Left,Right,Center and Vertical, on given point.

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

Re: mylib v0.4

Postby hayzel » Wed Feb 27, 2013 6:08 pm

I made the GetFreeMemory() function in mylib, thinking that it returned the free malloc memory in the calculator.
Noticed thought that the implementation I have:

Bfile_GetMediaFree(DEVICE_MAIN_MEMORY,&i);

only I think it returns the available user memory for basic programs and other data, not the free malloc memory.

The GetFreeMemory is being used by me to maybe catch some memory leak problems, by comparing its value to the start and to the end of a program.

So the question is, what is the correct procedure to get the free available memory for malloc calls?

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 » Wed Feb 27, 2013 6:18 pm

hayzel wrote:So the question is, what is the correct procedure to get the free available memory for malloc calls?
Inspect the index of fx_calculators_SuperH_based.chm for "Heap_SetTopChunk (0x0499)".
You will find a snippet:
int HeapMaxContiguousPiece( int*freespace );

Perhaps this fits your needs.
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.4

Postby hayzel » Wed Feb 27, 2013 7:57 pm

SimonLothar wrote:
hayzel wrote:So the question is, what is the correct procedure to get the free available memory for malloc calls?
Inspect the index of fx_calculators_SuperH_based.chm for "Heap_SetTopChunk (0x0499)".
You will find a snippet:
int HeapMaxContiguousPiece( int*freespace );

Perhaps this fits your needs.


Thanks, looking at the code, this is it!

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

Re: mylib v0.4

Postby hayzel » Wed Feb 27, 2013 8:19 pm

syscall 0x0499 is compatible with all casio 9860 models (gii for example) ?

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

Re: mylib v0.4

Postby Casimo » Thu Feb 28, 2013 6:41 am

As far as I know all system calls are compatible.
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 » Thu Feb 28, 2013 8:29 am

hayzel wrote:
SimonLothar wrote:
hayzel wrote:So the question is, what is the correct procedure to get the free available memory for malloc calls?
Inspect the index of fx_calculators_SuperH_based.chm for "Heap_SetTopChunk (0x0499)".
You will find a snippet:
int HeapMaxContiguousPiece( int*freespace );

Perhaps this fits your needs.


Thanks, looking at the code, this is it!


Looking at the code and reading that page , I cannot figure out what the linkliststart pointer value is.
Is it always 0x88024000 as line 5 says, or it is version depended as lines 2-3 say?
If it is version depended I may need a getOSVersion function.

Next

Return to Casio fx-9860 SDK

Who is online

Users browsing this forum: No registered users and 24 guests