Casio Basic to SDK
- SimonLothar
- Senior Member
-
- 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
There are syscalls 0x2F to 0x33 which do various plot-functions.aapman55 wrote:is there a plot function in the sdk or do i have to write an own one?
I'll be back!
- aapman55
- Senior Member
-
- Posts: 66
- Joined: Sun Apr 15, 2012 4:00 pm
- Calculators: Casio fx-9860G
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.
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
- 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
- SimonLothar
- Senior Member
-
- 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
You need some code like
The members of TShape are documented in my CHM-Helpfile http://www.casiopeia.net/forum/downloads.php?view=detail&df_id=72.
- 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!
- aapman55
- Senior Member
-
- Posts: 66
- Joined: Sun Apr 15, 2012 4:00 pm
- Calculators: Casio fx-9860G
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?
as in the graph menu. would that be possible?
- aapman55
- Senior Member
-
- Posts: 66
- Joined: Sun Apr 15, 2012 4:00 pm
- Calculators: Casio fx-9860G
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.
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.
- SimonLothar
- Senior Member
-
- 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
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.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'll be back!
Who is online
Users browsing this forum: No registered users and 16 guests