fx-9860G/GII detect the MAIN MENU (C)
1 post
• Page 1 of 1
- 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
fx-9860G/GII detect the MAIN MENU (C)
Purobaz asked:
when using a persitent timer on a fx-9860G/GII, how can we detect, whether the MAIN MENU or some Addin/BuildIn is on top, inside of the timer handler.
A fitting syscall has not been found to achieve this.
But the following code finds the address of a certain system variable, which gives the answer.
This should be OS-independent.
returns 3 if the MAIN MENU is active
else 0
Purobaz verified this within a timer.
The scheme should work with interrupt handlers as well.
when using a persitent timer on a fx-9860G/GII, how can we detect, whether the MAIN MENU or some Addin/BuildIn is on top, inside of the timer handler.
A fitting syscall has not been found to achieve this.
But the following code finds the address of a certain system variable, which gives the answer.
This should be OS-independent.
- Code: Select all
unsigned int ea;
unsigned int j;
ea = *(unsigned int*)0x8001007C;
ea += 0x0490*4;
ea = *(unsigned int*)( ea );
j = *(unsigned char*)( ea + 1 );
j *= 4;
j = ( ea + j + 4 ) & 0xFFFFFFFC;
j = *(unsigned int*)( j ) + 1;
return *(unsigned char*)j;
returns 3 if the MAIN MENU is active
else 0
Purobaz verified this within a timer.
The scheme should work with interrupt handlers as well.
I'll be back!
1 post
• Page 1 of 1
Return to Tutorials & Code Snippets
Who is online
Users browsing this forum: No registered users and 3 guests