Jump to content



Photo
- - - - -

Casio Fx-9860G Sdk Tutorials (2016 Avaiable)


  • Please log in to reply
6 replies to this topic

#1 frankmar98

frankmar98

    Casio Freak

  • Moderator
  • PipPipPipPip
  • 102 posts
  • Gender:Male
  • Location:Spain
  • Interests:Science, programming

  • Calculators:
    CFX-9970G
    fx-9860G SD
    HP Prime
    TI-84+CE-T TI-83+
    fx-9750GII SH4-A
    CP-300 fx-4800p
    fx-3650pII PB-100
    fx-991SP X fx-991ES plus

Posted 06 August 2016 - 11:27 AM

Hello, since I upgraded my fx-9750GII SH4-A, I want to learn to use the SDK.

 

I know something about C, ANSI C, learned from my father's college book of Prentice Hall (examples are executed in DEC minis or MS-DOS, but in recent GCC it is the same)

 

I need some tutorials for learning to use the Casio fx libraries and Hitachi math libraries, I expect they are different from MS-DOS or Linux ones.

 

Do you know some good tutorial?

 

P.D.: I have less time than I would like, because I'm studying Spanish, History of Spain and History of Phylosophy to enter the college (Chemistry). I try to keep programming, but I musn't do it.

 

Thanks in advance

 

Regards

 



#2 Viliami

Viliami

    Casio Addict

  • Moderator
  • PipPipPip
  • 85 posts
  • Gender:Male
  • Location:New Zealand
  • Interests:C++ - OpenGL,SDL
    Python - Pygame
    Java - SFML
    C - Casio SDK

  • Calculators:
    FX-9750 GII upgraded to FX-9860 GII

Posted 09 August 2016 - 07:55 AM

The Fx-9860gii SDK uses C by default (it also supports C++, SH4A and SH3 ASM), the SDK just uses the standard C with some extra functions for I/O and drawing. 

 

 

In the "fxlib.h" header file, there are a bunch of Bdisp functions, these functions deal with drawing pixels to the screen and clearing them.

e.g Bdisp_PutDisp_DD() is the function used to draw a pixel to the screen and Bdisp_AllClr_DD() is the function used to clear all the pixels from the screen.

 

There is a good tutorial created by Fez and reformatted by Helder7 about the Bdisp functions and basic I/O over here: http://www.casiopeia...php?f=20&t=1420

 

You can also download the official Casio docs on the fxlib library over here: http://edu.casio.com...greement.html#2

 

 

Here is a hello world program, most of this is auto-generated by the SDK when you create a new project:

/*****************************************************************/
/*                                                               */
/*   CASIO fx-9860G SDK Library                                  */
/*                                                               */
/*   File name : [ProjectName].c                                 */
/*                                                               */
/*   Copyright (c) 2006 CASIO COMPUTER CO., LTD.                 */
/*                                                               */
/*****************************************************************/

#include "fxlib.h"

//****************************************************************************
//  AddIn_main (Sample program main function)
//
//  param   :   isAppli   : 1 = This application is launched by MAIN MENU.
//                        : 0 = This application is launched by a strip in eACT application.
//
//              OptionNum : Strip number (0~3)
//                         (This parameter is only used when isAppli parameter is 0.)
//
//  retval  :   1 = No error / 0 = Error
//
//****************************************************************************

int AddIn_main(int isAppli, unsigned short OptionNum)
{
    Bdisp_AllClr_DDVRAM();          // clear screen
    PrintXY(1,1,"Hello World!",0);  // print "Hello World!" to the VRAM
    Bdisp_PutDisp_DD();             // copy pixels from the VRAM to the actual display
    return 1;
}




//****************************************************************************
//**************                                              ****************
//**************                 Notice!                      ****************
//**************                                              ****************
//**************  Please do not change the following source.  ****************
//**************                                              ****************
//****************************************************************************


#pragma section _BR_Size
unsigned long BR_Size;
#pragma section


#pragma section _TOP

//****************************************************************************
//  InitializeSystem
//
//  param   :   isAppli   : 1 = Application / 0 = eActivity
//              OptionNum : Option Number (only eActivity)
//
//  retval  :   1 = No error / 0 = Error
//
//****************************************************************************
int InitializeSystem(int isAppli, unsigned short OptionNum)
{
    return INIT_ADDIN_APPLICATION(isAppli, OptionNum);
}

#pragma section


As you can see from above, there is no main() function, unlike standard C our entry point to the program isn't the main() function, it is the AddIn_Main() function.


Edited by Viliami, 10 August 2016 - 08:34 AM.

  • flyingfisch and frankmar98 like this

#3 frankmar98

frankmar98

    Casio Freak

  • Moderator
  • PipPipPipPip
  • 102 posts
  • Gender:Male
  • Location:Spain
  • Interests:Science, programming

  • Calculators:
    CFX-9970G
    fx-9860G SD
    HP Prime
    TI-84+CE-T TI-83+
    fx-9750GII SH4-A
    CP-300 fx-4800p
    fx-3650pII PB-100
    fx-991SP X fx-991ES plus

Posted 09 August 2016 - 10:24 AM

Thanks, Viliami. It seems to be relatively easy with the fxlib.h reference.

 

I want to use the math.h lib, is it the same in the hitachi c compiler than in GCC?

 

Regards



#4 Viliami

Viliami

    Casio Addict

  • Moderator
  • PipPipPip
  • 85 posts
  • Gender:Male
  • Location:New Zealand
  • Interests:C++ - OpenGL,SDL
    Python - Pygame
    Java - SFML
    C - Casio SDK

  • Calculators:
    FX-9750 GII upgraded to FX-9860 GII

Posted 10 August 2016 - 08:32 AM

I don't know if it supports all of the math.h lib functions, but it does support most of the main ones. 

 

On this page (https://edu.casio.co...load/index.html) there is a link to download the fx-9860G SDK manuals, it's a .zip file. It has a bunch of .pdfs and if you open up the "C Standard Libraries.pdf" file, you will see all of the math.h functions the SDK supports.

 

It has a math.h lib and a mathf.h lib (for floats)

 

Here is a list of the math.h functions supported by the SDK:

double acos(double d)
double asin(double d)
double atan(double d)
double atan2(double y, doublex)
double cos(double d)
double sin(double d)
double tan(double d)
double cosh(double d)
double sinh(double d)
double tanh(double d)
double exp(double d)
double frexp(double value, int *e)
double ldexp(double ret, int f)
double log(double d)
double log10(double d)
double modf(double a, double *b)
double pow(double x, double y)
double sqrt(double d)
double ceil(double d)
double fabs(double d)
double floor(double d)
double fmod(double x, double y)

Here is a list of the mathf.h functions supported by the SDK:

float acosf(float f)
float asinf(float f)
float atanf(float f)
float atan2f(float y, float x)
float cosf(float f)
float sinf(float f)
float tanf(float f)
float coshf(float f)
float sinhf(float f)
float tanhf(float f)
float expf(float f)
float frexpf(float value, int *e)
float ldexpf(float ret, int f)
float logf(float f)
float log10f(float f)
float modff(float a, float *b)
float powf(float x, float y)
float sqrtf(float f)
float ceilf(float f)
float fabsf(float f)
float floorf(float f)
float fmodf(float x, float y)

Edited by Viliami, 10 August 2016 - 08:33 AM.

  • frankmar98 likes this

#5 frankmar98

frankmar98

    Casio Freak

  • Moderator
  • PipPipPipPip
  • 102 posts
  • Gender:Male
  • Location:Spain
  • Interests:Science, programming

  • Calculators:
    CFX-9970G
    fx-9860G SD
    HP Prime
    TI-84+CE-T TI-83+
    fx-9750GII SH4-A
    CP-300 fx-4800p
    fx-3650pII PB-100
    fx-991SP X fx-991ES plus

Posted 10 August 2016 - 09:48 AM

Ok, great! Thank you!

 

Yesterday I had some problems building the projects, but the problem was Windows 10 64 bits, I read old threads and reinstalled the SDK as administrator and in C:\CasioSDK folder created by me, and it worked.

 

I really appreciate your help, there are very few fx-9860G SDK active developers in 2016.

 

Also, I had problems displaying a float in the screen, is there any routine to do this, or I should with a loop, parse the float in a string?


  • Viliami likes this

#6 Viliami

Viliami

    Casio Addict

  • Moderator
  • PipPipPip
  • 85 posts
  • Gender:Male
  • Location:New Zealand
  • Interests:C++ - OpenGL,SDL
    Python - Pygame
    Java - SFML
    C - Casio SDK

  • Calculators:
    FX-9750 GII upgraded to FX-9860 GII

Posted 13 August 2016 - 01:22 AM

I just use the sprintf function, (which is in the stdio.h lib, also sidenote: the printXY function is from the fxlib.h lib) to convert the float into a char array and then print it to the screen.

Here is an example function:

void printFloat(int x, int y, float f){
    unsigned char buffer[9];
    sprintf(buffer, "%f", f);
    PrintXY(x,y, buffer, 0);
}

and here it is in use:

int AddIn_main(int isAppli, unsigned short OptionNum)
{
    float pi = 3.141593;            //the float we're going to print
    Bdisp_AllClr_DDVRAM();          //clear screen
    printFloat(1,1,pi);             //call the function to print the float
    Bdisp_PutDisp_DD();             //put pixels from VRAM onto the screen
    
    while(1){}
    return 1;
}

  • frankmar98 likes this

#7 frankmar98

frankmar98

    Casio Freak

  • Moderator
  • PipPipPipPip
  • 102 posts
  • Gender:Male
  • Location:Spain
  • Interests:Science, programming

  • Calculators:
    CFX-9970G
    fx-9860G SD
    HP Prime
    TI-84+CE-T TI-83+
    fx-9750GII SH4-A
    CP-300 fx-4800p
    fx-3650pII PB-100
    fx-991SP X fx-991ES plus

Posted 13 August 2016 - 10:42 AM

Ok, great! Thank you!


  • Viliami likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users