How to find and display the Prizm's built-in MENU-icons
34 posts
• Page 4 of 4 • 1, 2, 3, 4
- AmazoNKA
- Senior Member
- Posts: 116
- Joined: Mon Mar 02, 2015 10:53 am
- Calculators: Casio fx-CG20
Re: How to find and display the Prizm's built-in MENU-icons
SimonLothar wrote:I did not find such a feature.AmazoNKA wrote:So I'm keen to know if there is a system call or some flag or memoty file which can detect that currently running add in is the first one run on the calculator so far please.
A little byproduct of my investigations:
The flag which controls the MENU-key behaviour can be read and changed using the following code.
- Code: Select all
//
unsigned char APP_MenuKeyFlag( unsigned char value ){
unsigned int ea;
unsigned int j;
unsigned char*pMenuKeyFlag;
if ( OSVersionAsInt() <= 0x02020000 ){
ea = *(unsigned int*)0x8002007C; // get pointer to syscall table
ea += 0x1e6e*4; // // get pointer to syscall 1e6e
ea = *(unsigned int*)( ea );
j = *(unsigned char*)( ea + 1 );
j *= 4;
j = ( ea + j + 4 ) & 0xFFFFFFFC;
pMenuKeyFlag = (unsigned char*)(*( unsigned int*)( j ) + 3 );
}else{
pMenuKeyFlag = 0;
}
j = 0;
if ( pMenuKeyFlag ){
j = *pMenuKeyFlag;
*pMenuKeyFlag = value;
}
return j;
}
But beware. If you set the flag to 1, the calculator cannot leave your addin any more, unless restarted with the RESTART-button. So provide for some function to set the flag back to 0.
And the flag seems to control some other features, too, f. i. if you connect the calculator to some USB-port, the connection dialog does not pop up.
This is a big discovery and to me looks like a shorter version of the other routine you published for enabling and disabling menu button. Thanks again
- AmazoNKA
- Senior Member
- Posts: 116
- Joined: Mon Mar 02, 2015 10:53 am
- Calculators: Casio fx-CG20
Re: How to find and display the Prizm's built-in MENU-icons
SimonLothar wrote:syscall 0D08 is the call to display a string.
Bdisp_MMPrint(int*x, int*y, unsigned char*, int mode, int xmax, int, int, int color, int, int, int );
Examples:
x = 0x30;
y = 0x50;
Bdisp_MMPrint( &x, &y, "ABCDEFGHIJK", 2, 0x50, 0, 0, 0, 0, 1, 0 ); // black
x = 0x30;
y = 0x60;
Bdisp_MMPrint( &x, &y, "DEFGHI", 2, 100, 0, 0, 0xF800, 0, 1, 0 ); // red
Dear Simon, I'm not sure if I'm just passing the string incorrectly or should use a different system call but things which display natively ok with os and addins names including ' and acute French characters do not seem to render into the right font - maybe it is a matter of passing right hex code but if i pass \x##\x## or similar values in the string they just show as that hex code literary not the character they should show... I wonder what you think is happening and if there is a work around please. Thanks
- 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
Re: How to find and display the Prizm's built-in MENU-icons
Meanwhile I renamed syscall 0D08 to Bdisp_MMPrint_pxpy.
As for the multibyte-characters syscall 0x0D08 and 0x0D09 work in the same way.
F. i. this works well for me
Bdisp_MMPrint( x, y, "\xE5\x01\xE5\x02\xE5\x03\xE5\x04\xE5\x05", 2, 500, 0, 0, 0xF800, 0, 1, 0 );
giving ÀÁÂÃÄ
As for the multibyte-characters syscall 0x0D08 and 0x0D09 work in the same way.
F. i. this works well for me
Bdisp_MMPrint( x, y, "\xE5\x01\xE5\x02\xE5\x03\xE5\x04\xE5\x05", 2, 500, 0, 0, 0xF800, 0, 1, 0 );
giving ÀÁÂÃÄ
I'll be back!
- AmazoNKA
- Senior Member
- Posts: 116
- Joined: Mon Mar 02, 2015 10:53 am
- Calculators: Casio fx-CG20
Re: How to find and display the Prizm's built-in MENU-icons
You are absolutely right - i must have made a mistake with my hexes overrunning into three digits etc and doing something wrong trying to fix it. Nice to see it works for most multibyte characters
34 posts
• Page 4 of 4 • 1, 2, 3, 4
Return to Tutorials & Code Snippets
Who is online
Users browsing this forum: No registered users and 1 guest