I used the folowing code:
#include "stdio.h"
#include "casio2.h"
void main(void)
{
int result1;
setpage(0);
clearpage(0);
setbpix(1,1,0);
result1 = tstpixel(1,1,0);
if (result1 == 1)
{
printf("tstpixel OK!");
}
else
printf("ERROR!");
waitakey(K_F6);
}and uploaded it. The calc showed ERROR! (as expected!) i need this function
for a program I'm currently working on.
Here is the code of setbpix & tstpix (cut out of casio2.h)
void setbPix(short x,short y,short page){ //Superna
asm{
mov cx,page //numero de page //4
shl cx,6 //multiplication par 64 //2
add cx,0x1a20 //ajout de la page 0 //2
mov es,cx //on le met dans es //2
mov si,64
mov cx,128
sub si,y //On copie y //4
sub cx,x //On copie x //4
mov bx,cx //On en fait une copie //2
and cx,7 //Reste de division par 8 dans cl //2
shr bx,3 //on divise par 8 //3
shl bx,6 //On multiplie par 64 //2
add si,bx //On ajoute le tout a si //1
mov ch,1 //On met le state //2
shl ch,cl //on le deplace selon cl //3
or es:[si],ch}}; //On l'applique a l'octet //7// Remet le bytechar tstpixel(int X, int Y,int page) { //Teste un pixel et retourne 0 ou 1//Superna&Whyp
asm { mov cx,page //numero de page //4
shl cx,6 //multiplication par 64 //2
add cx,0x1a20 //ajout de la page 0 //2
mov es,cx //on le met dans es //2
mov si,64 //on met 64
mov cx,128 //on met 128
mov si,Y //On enleve y //4
mov cx,X //On enleve x //4
mov bx,cx //On en fait une copie //2
and cx,7 //Reste de division par 8 dans cl //2
shr bx,3 //on divise par 8 //3
shl bx,6 //On multiplie par 64 //2
add si,bx //On ajoute le tout a si //1
mov al,es:[si];
ror al,cl;
and al,1; }
return _AL; }There seems to be no difference between the version 2.0 and the 2.01
in these routines.
Has anyone an idea how to fix this problem???
Thanx
@SuperNA
The CDK is no longer downloadable on you site!



