Register

Casio Basic to SDK

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

Postby SimonLothar » Fri Jul 06, 2012 8:57 pm

aapman55 wrote:is there a plot function in the sdk or do i have to write an own one?
There are syscalls 0x2F to 0x33 which do various plot-functions.
I'll be back!

Senior Member
User avatar
Posts: 66
Joined: Sun Apr 15, 2012 4:00 pm
Calculators: Casio fx-9860G

Postby aapman55 » Sat Jul 07, 2012 8:08 pm

i looked up those 2 syscalls in your syscall pdf file. if i understand it correct, 0x2F is a variable and the other one will be the plot command. I put it in the following code.

Code: Select all
/*****************************************************************/
/*                                                               */
/*   CASIO fx-9860G SDK Library                                  */
/*                                                               */
/*   File name : [ProjectName].c                                 */
/*                                                               */
/*   Copyright (c) 2006 CASIO COMPUTER CO., LTD.                 */
/*                                                               */
/*****************************************************************/
#include "fxlib.h"
#define SCA 0xD201D002
#define SCB 0x422B0009
#define SCE 0x80010070

typedef int(*sc_ipi)(int*);
typedef int(*sc_iv)(void);

const unsigned int sc0x2F[] = { SCA, SCB, SCE, 0x2F };
#define VARX (*(sc_iv)sc0x2F)

const unsigned int sc0x33[] = { SCA, SCB, SCE, 0x33 };
#define PLOTX (*(sc_ipi)sc0x33)



//****************************************************************************
//  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)
{
    unsigned int key;

    Bdisp_AllClr_DDVRAM();


PLOTX(5*VARX());
    while(1){
        GetKey(&key);
    }

    return 1;
}


My questions are:
(1) is the syscall done correctly? i assumed that the variable doesnt need to have input, correct me if im wrong.
(2) what still needs to be added to make it work

thanks in advance

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

Postby SimonLothar » Sat Jul 07, 2012 9:00 pm

You need some code like
Code: Select all
typedef struct{
    unsigned int x1;
    unsigned int y1;
    unsigned int x2;
    unsigned int y2;
    unsigned char f[4];
    unsigned int on_bits;
    unsigned int off_bits;
} TShapeX;

typedef int(*sc_itshp)(TShapeX*);

const unsigned int sc0x2F[] = { SCA, SCB, SCE, 0x2F };
#define Bdisp_ShapeToVRAM (*(sc_itshp)sc0x2F)

const unsigned int sc0x33[] = { SCA, SCB, SCE, 0x33 };
#define Bdisp_ShapeToVRAM_DD (*(sc_itshp)sc0x33)

//
int F00_1_Handler(){
TShapeX shape;
unsigned int key;
   Bdisp_AllClr_VRAM();

   shape.x1 = 10;
   shape.y1 = 15;
   shape.x2 = 20;
   shape.y2 = 25;
   shape.f[0] = 2;
   shape.f[1] = 2;
   shape.f[2] = 1;
   shape.f[3] = 1;
   shape.on_bits = 3;
   shape.off_bits = 3;

    Bdisp_ShapeToVRAM( &shape );
   
   GetKey( &key );

   return 1;
}

The members of TShape are documented in my CHM-Helpfile http://www.casiopeia.net/forum/downloads.php?view=detail&df_id=72.
I'll be back!

Senior Member
User avatar
Posts: 66
Joined: Sun Apr 15, 2012 4:00 pm
Calculators: Casio fx-9860G

Postby aapman55 » Sun Jul 08, 2012 11:19 am

ah i think you misunderstood the question. what i understand from the help file is that these syscalls draw shapes on the desired location. But what i wanted to do was to plot a real function.
as in the graph menu. would that be possible?

Senior Member
User avatar
Posts: 66
Joined: Sun Apr 15, 2012 4:00 pm
Calculators: Casio fx-9860G

Postby aapman55 » Mon Jul 09, 2012 10:20 am

i have 2 more other questions.
1) how do i ask for a numerical input to store in a variable?
2) how do i make a nice scrolling screen or menu where most of the menu or scren does not fit on the screen and by moving with the cursors the focus moves along.

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

Postby SimonLothar » Tue Jul 10, 2012 7:13 am

aapman55 wrote:ah i think you misunderstood the question. what i understand from the help file is that these syscalls draw shapes on the desired location. But what i wanted to do was to plot a real function.
as in the graph menu. would that be possible?
I don't know yet, whether the graph-menu-plot-operations are sufficiently encapsulated to be used from out of an addin (t. i. as syscall or combination of syscalls). I'll have a look.
I'll be back!

Previous

Return to Casio fx-9860 SDK

Who is online

Users browsing this forum: No registered users and 22 guests